text string | label_name string | labels int64 |
|---|---|---|
from user import User
class Seller(User):
def __init__(self, name):
super().__init__(name)
| Python | 1 |
}
}
use crate::request::prelude::*;
use twilight_model::{channel::Channel, id::ChannelId};
pub struct GetChannel<'a> {
channel_id: ChannelId,
fut: Option<PendingOption<'a>>,
http: &'a Client,
}
impl<'a> GetChannel<'a> {
pub(crate) fn new(http: &'a Client, channel_id: ChannelId) -> Self {
S... | Rust | 0 |
_START + HEAP_SIZE);
fn enable_nxe_bit() {
use x86_64::registers::msr::{IA32_EFER, rdmsr, wrmsr};
let nxe_bit = 1 << 11;
unsafe {
let efer = rdmsr(IA32_EFER);
wrmsr(IA32_EFER, efer | nxe_bit);
}
}
fn enable_write_protect_bit() {
use x86_64::registers::control_regs::{cr0, cr0_write,... | Rust | 0 |
ane.horz_scrolling:
self._hbar = self.HBar(self._pane)
self._grid.add(1, 0, self._hbar)
if self._pane.vert_scrolling:
self._vbar = self.VBar(self._pane)
self._grid.add(0, 1, self._vbar)
if self.Corner is not None:
self._corner = self.Corner()... | Python | 1 |
(expected_root))
}
pub unsafe fn batchmerkleproof_from_json(
json: &str,
proof_out: *mut BatchMerkleProofPtr,
) -> Result<(), Error> {
let proof_out = mut_ptr_as_mut(proof_out, "proof_out")?;
*proof_out = Box::into_raw(Box::new(serde_json::from_str(json).map(BatchMerkleProof)?));
Ok(())
}
pub unsa... | Rust | 0 |
# coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import copy
import warnings
import sys
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload, Awaitable
if sys.vers... | Python | 1 |
import torch
import torch.nn as nn
from nuplan_extent.planning.training.modeling.models.modules.nanoGPT.visual_gpt import GPT
from nuplan_extent.planning.training.modeling.models.modules.nanoGPT.base_model import GPTConfig
class BaseTransitionModel(nn.Module):
def __init__(self,
n_layer: int = 1... | Python | 1 |
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
# Đọc dữ liệu từ file Excel
file_path = 'C:/Users/MLMachine/Desktop/datasets.xlsx'
df = pd.read_excel(file_path)
# Chuyển đổi cột 'Price' về số (loại bỏ dấu chấm)
df['Price'] = df['Price'].str.replace('.', '').astype(int)
# Tính toán ma trận t... | Python | 1 |
,
)
CloseMessageWindow()
def _loc_8701(): pass
label('loc_8701')
ChrTalk(
0x0102,
(
'#0020350935V#1046F#3P是!',
TxtCtl.Enter,
),
)
CloseMessageWindow()
If(
(
(Expr.Eval, "OP_42(ChrTable['提妲'])"),
(Expr.P... | Python | 1 |
name: String = match &base_lvalue_result.llvm_typ {
llvm::Ty::Dynamic(t) => {
is_dynamic = true;
match t {
ast::Ty::Struct(s) => s.clone(),
ast::Ty::GenericStruct{name, type_param} => {
base_type_param = Some((type_param as &ast::Ty).clone());
name.clone()
},
t => panic!("Cann... | Rust | 0 |
+ r.w;
// // r.y = r.y + r.h;
// // r.w *= -1;
// // r.h *= -1;
// // return r;
// // }
// // "#,
// // )
// // .with_kernel_code(
// // "rectangles[gl_GlobalInvocationID.x] = flip(rectangles[gl_GlobalInvocationID.x]);",
// // ),
// // )?;
// // ... | Rust | 0 |
SSI1_COMB,
#[doc = "SSI0 combined interrupt, interrupt flags are found here SSI0:MIS"]
SSI0_COMB,
#[doc = "PKA Interrupt event"]
PKA_IRQ,
#[doc = "Combined Interrupt for CPE Generated events. Corresponding flags are here RFC_DBELL:RFCPEIFG. Only interrupts selected with CPE1 in RFC_DBELL:RFCPEIFG c... | Rust | 0 |
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_atime as libc::time_t,
tv_nsec: self.stat.st_atimensec as libc::c_long,
}))
}
pub fn created(&self) -> io::Result<SystemTime> {
Ok(SystemTime::from(libc::timespec {
tv_sec: self.stat.st_birthtime as li... | Rust | 0 |
2MDd6L2t4R1ZzalE3V2xHZTB0MVV2Zlg3QVVXbmpqbDcwL1UvT0x1L2krMUV0am8rUEZMMVJwMlFaMUs1S09xU2pTWC96NVNweTl6ZEh1WDlTWExhSDgvOTZ0Y29Geis2MTY5OUhhWXRJZWIvZTNoYWhxcTRMNmFBb1dBdmo2aFFHUjUzQk4wZTQ4YzBpOFkvK3Y3MVREU0FyQ2pwelhwclJXYzFlcGNVak9QejdzVlJ4UlhzcmZxQWZBUTdaeTRmRGwyMElKVjFQUWpJdjIxME5RRXUzRmpQSmp0UmZ1N3dqdUJSRktmVkhJVTlraGJ... | Python | 1 |
om(code))
}
_ => anyhow!(e),
})?
.iter()
.map(|(_, inv)| inv)
.cloned()
.collect::<Vec<_>>();
Ok(list)
}
fn get_invite_by_group_id(&self, id: &str) -> anyhow::Result<Invitation> {
let group_key = self.g... | Rust | 0 |
if cortexm::is_hard_fault(pc, vector_table) {
assert!(
raw_frames.is_empty(),
"when present HardFault handler must be the first frame we unwind but wasn't"
);
outcome = if overflowed_stack(sp, sp_ram_region) {
Outcome::StackOverflow
... | Rust | 0 |
}
command = args.next();
}
_ => {
additional_arguments.push(arg);
}
}
}
if arg_twice_set {
return Err(ParsingError::ArgTwiceSet);
}
if invalid_keybinding {
return Err(ParsingError::InvalidKeybinding);
}
... | Rust | 0 |
::skip]
let e = _mm_setr_epi8(
1, -4, -6, 7, -10, -12, 13, -16,
17, 19, 21, 23, 25, 27, 29, 31,
);
assert_eq_m128i(r, e);
}
#[simd_test(enable = "sse4.1")]
unsafe fn test_mm_min_epu16() {
let a = _mm_setr_epi16(1, 4, 5, 8, 9, 12, 13, 16);
let ... | Rust | 0 |
from aiogoogle.auth.managers import ApiKeyManager
from aiogoogle.models import Request
import pytest
@pytest.fixture
def manager():
return ApiKeyManager()
@pytest.fixture
def key1():
return "asdasdasidajosnoqwndoasfnwuiefn"
@pytest.fixture
def key2():
return "asjdaosdniaurn3uh2873he9has9dhASDQ(Dasd"
... | Python | 1 |
CH_TIME
.write()
.expect("failed to get LAST_FETCH_TIME write lock");
*last_fetch_time = time::Instant::now();
}
fn sleep_if_fetch_too_fast() {
// the duration from last fetch is randomly generated
let expect_duration: u128 = rand::thread_rng().gen_range(2000, 5000);
let actual_duratioi... | Rust | 0 |
}
last_tsn = c.tsn;
n_chunks += 1;
if c.ending_fragment {
found = true;
break;
}
}
if !found {
return None;
}
// Extract the range of chunks
let chunks: Vec<ChunkPayloadData> ... | Rust | 0 |
rsected_by(&ray, 0.0..f32::INFINITY), expected);
}
}
#![deny(warnings)]
extern crate futures;
extern crate hyper;
extern crate gotham;
#[macro_use]
extern crate gotham_derive;
extern crate chrono;
#[macro_use]
extern crate log;
extern crate fern;
extern crate mime;
mod middleware;
use futures::{future, Future, St... | Rust | 0 |
def _on_connection_closed(self, address):
self._main_executor.submit(self._connection_manager.remove_connection,
address)
| Python | 1 |
;
/// use bson::doc;
/// let docbuf = DocBuf::from_document(&doc! {
/// "string": "hello",
/// "bool": true,
/// });
/// assert_eq!(docbuf.get_str("string"), Ok(Some("hello")));
/// assert_eq!(docbuf.get_str("bool"), Err(RawError::UnexpectedType));
/// assert_eq!(docbuf.get_str("... | Rust | 0 |
#PETO TY HOVNO IBA POZNAMKY MI ROBILO AIKO JEDNODUCHSI KOD MAS V SUBORE 12
def vytazenost_liniek(cesta_k_suboru):
# Načítanie všetkých riadkov zo súboru.
with open(cesta_k_suboru, "r", encoding = "UTF-8") as fr:
zaznamy_riadky = fr.readlines()
# Prvý riadok v súbore je maximálna kapacita.
max_... | Python | 1 |
great tool to generate heightmaps!
use std::env;
use std::io::Write;
use std::path::Path;
use marching_squares::simplify::simplify;
use marching_squares::svg;
use marching_squares::{march, Field};
#[derive(Debug)]
struct HeightMap {
img: image::GrayImage,
}
impl HeightMap {
fn open(p: impl AsRef<Path>) -> ... | Rust | 0 |
_A {
match self.bits {
false => AC12EBE_A::AC12EBE_0,
true => AC12EBE_A::AC12EBE_1,
}
}
#[doc = "Checks if the value of the field is `AC12EBE_0`"]
#[inline(always)]
pub fn is_ac12ebe_0(&self) -> bool {
*self == AC12EBE_A::AC12EBE_0
}
#[doc = "Check... | Rust | 0 |
# Mark tests that use specific fixtures
if "mock_openai_api" in item.fixturenames or "llm" in item.name.lower():
item.add_marker(pytest.mark.llm)
if "dbt" in item.name.lower() or "temp_dbt_model" in item.fixturenames:
item.add_marker(pytest.mark.dbt)
... | Python | 1 |
Recall = allNdcg = allPrecision = 0
for i in range(len(batIds)):
temTopLocs = list(topLocs[i])
temTstLocs = tstLocs[batIds[i]]
tstNum = len(temTstLocs)
maxDcg = np.sum([np.reciprocal(np.log2(loc + 2)) for loc in range(min(tstNum, args.topk))])
recall = dcg = precision = 0
for val in temTstLocs:
... | Python | 1 |
# -*- coding: utf-8 -*-
# Copyright 2025 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | Python | 1 |
import math
def inst_current(Irms, AngBeta):
#angBeta = AngBeta * 180/math.pi
#convert rms current to maximum current
Imax = Irms * math.sqrt(2)
return str(round(Imax, 2)) + "cos(\u03C9t + " + str(AngBeta) +")"
def inst_voltage(Vrms, AnglDelta):
#angDelta = AngDelta * 180/math.pi
Vmax =... | Python | 1 |
es else ys[-1]
def compute_loss(self, mels, y_0):
"""
Computes loss between GT Gaussian noise and reconstructed noise by model from diffusion process.
:param mels (torch.Tensor): mel-spectrograms acoustic features of shape [B, n_mels, T//hop_length]
:param y_0 (torch.Tensor): GT spe... | Python | 1 |
lrs[:5], [0.005, 1.004, 2.003, 3.002, 4.001]))
self.assertTrue(np.allclose(lrs[5:10], 5.0))
self.assertTrue(np.allclose(lrs[10:15], 0.5))
self.assertTrue(np.allclose(lrs[15:20], 0.05))
self.assertTrue(np.allclose(lrs[20:25], 0.005))
self.assertTrue(np.allclose(lrs[25:], 0.0005))
... | Python | 1 |
.query(&[("name", format!("{}.omniversal.co", subdomain))])
.send().unwrap()
.json::<CloudflareResponseWithResults>().unwrap();
if find_res.result.len() > 0 {
let id = ... | Rust | 0 |
roblems
def load_jsonl(file_path):
"""Loads a JSON Lines file into a list of dictionaries."""
data = []
try:
with open(file_path, "r", encoding="utf-8") as f:
for line in f:
# Remove leading/trailing whitespace and parse
stripped_line = line.strip()
... | Python | 1 |
import os
MODEL_DIR = "/datasets/llm_model"
ACTUAL_MODEL = "DeepSeek-R1-8B"
# System prompt comune per Mistral e Llama
COMMON_SYSTEM_PROMPT = """You are an AI model designed to answer questions based on academic papers. You have access to the title, abstract, and a specific question related to the paper. Your task is... | Python | 1 |
#!/usr/bin/env python
# Copyright 2015 The PDFium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import optparse
import os
import re
import shutil
import subprocess
import sys
import common
import pngdiffer
import suppressor
# Nomen... | Python | 1 |
() {
T![declare] => ModifierKind::Declare,
T![public] => ModifierKind::Public,
T![protected] => ModifierKind::Protected,
T![private] => ModifierKind::Private,
T![override] => ModifierKind::Override,
T![static] => ModifierKind::Static,
T![readonly] => ModifierKind:... | Rust | 0 |
phase_clone.module = module_clone
phase_clone.pk = None
phase_clone.save()
settings_instance = module.settings_instance
if settings_instance:
settings_instance_clone = deepcopy(settings_instance)
... | Python | 1 |
contestant_and_team(&mut tx, &contestant_id, true)?;
let current_contest_status = crate::get_current_contest_status(&mut tx)?;
if current_contest_status.contest.status
!= crate::proto::resources::contest::Status::Registration
{
return Err(crate::Error::UserError(
... | Rust | 0 |
import random
print("\n","Hello there, lets play this awesome game called ","\n" "ROCK PAPER SCISSOR")
print("Rules : Rock breaks Scissor, Paper covers Rock and Scissor cuts Paper" , "\n")
attempts = 3
actions = ['rock','paper','scissor']
i = 0
while i < (attempts):
i +=1
computer_action = random.choice(actions... | Python | 1 |
from service.RagApp.IntentRecognition.Recognition import intent_recognize
from service.RagApp.IntentRecognition.intents import intent_descriptions
from service.RagApp.IntentRecognition.prompts import intent_prompts
__all__ = ['intent_recognize','intent_prompts', 'intent_descriptions']
| Python | 1 |
fmt::Formatter) -> ::std::fmt::Result {
f.debug_struct(&format!("GESTitleSourcePrivate @ {:?}", self as *const _))
.finish()
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct GESTrackClass {
pub parent_class: gst::GstBinClass,
pub get_mixing_element: Option<unsafe extern "C" fn(*mut GESTrac... | Rust | 0 |
content = re.sub(r":\d.\d+[)\]]", "", content) # Automatic1111-style numeric weight syntax
content = re.sub(r"[+)(\[\]]+", "", content) # plusses, brackets, parens
content = re.sub(r"(?<=\w)(-+)(?!\w)|(?<!\S)(-+)(?!\s\w)", "", content) # remove hyphens not
# between ch... | Python | 1 |
};
str_nodes.insert(name.clone(), children);
node_weights.insert(name.clone(), weight);
}
});
// Convert the maps into a tree of nodes
assert_eq!(possible_parents.len(), 1, "Expected only 1 parent");
let root_name = possible_parents.iter().next().unwrap();
... | Rust | 0 |
expected_output = {
"cache_type": "Normal (Platform cache)",
"cache_size": 200000,
"current_entries": 3,
"high_water_mark": 3,
"flows_added": 18,
"flows_aged": {
"total": 6,
"active_timeout": 0,
"active_timeout_secs": 100,
"inactive_timeout": 0,
"inactive_... | Python | 1 |
(
($module: ident, $scalar: expr) => {
mod $module {
#[allow(unused_imports)]
use crate::core::helper::{RandScalar, RandComplex};
use crate::proptest::*;
use proptest::{prop_assert, proptest};
proptest! {
#[test]
f... | Rust | 0 |
pub trait CompExt: Comp {
fn run(&self) -> CompRunFuture<'_, Self> {
CompRunFuture {
comp: self,
future: Box::pin(self.tick()),
}
}
}
impl<C: Comp> CompExt for C {}
pub trait CompConnector<O: Op> {
type Comp: Comp;
#[must_use]
fn connect(&self, op: O) -> S... | Rust | 0 |
const PACK_2COMP: c_int = 0x80; // 2's compliment
pub const PACK_FORCE_GENERIC_IMPLEMENTATION: c_int = 0x400;
// For rb_integer_unpack:
pub const PACK_FORCE_BIGNUM: c_int = 0x100;
pub const PACK_NEGATIVE: c_int = 0x200;
// Combinations
pub const PACK_LITTLE_ENDIAN: ... | Rust | 0 |
r3 r r r get_atext s
r6 c C sp | d dkrt d| t }| dd } | rT| d dkrTt| \}} || | r@| d dkr@| d tv rt| \}} n| dd dkr(d}z&t| \}} |j t
d d
}W n t jy t| \}} Y n0 |r4t|dkr4|d jdk... | Python | 1 |
(mut stat: *mut mi_stat_count_t,
mut amount: usize) {
mi_stat_update(stat, amount as i64);
}
#[no_mangle]
pub unsafe extern "C" fn _mi_stat_decrease(mut stat: *mut mi_stat_count_t,
mut amount: usize) {
mi_stat_update(stat, -(a... | Rust | 0 |
self.0.to_owned()
}
}
impl<'a> IntoSkyhashBytes for &'a RawString {
fn as_bytes(&self) -> Vec<u8> {
self.0.to_owned()
}
}
/// Implementing this trait enables Skyhash [elements](crate::Element) to be converted
/// into Rust types. This trait is already implemented for most primitive types, but for
... | Rust | 0 |
wt-1": {
"input_res": [40, 98],
"patch_res": [40, 1],
"num_classes": 35,
"mlp_dim": 256,
"dim": 64,
"heads": 1,
"depth": 12,
"dropout": 0.0,
"emb_dropout": 0.1,
"pre_norm": False,
"audio_s... | Python | 1 |
wpgs ffzb"
EMAIL_USE_TLS = True
EMAIL_PORT = 587
# GOOGLE CLOUD SERVICES AND STORAGE CONFIGS HERE BELOW
import os
import json
from google.oauth2 import service_account
# Google Cloud Storage settings
GS_BUCKET_NAME = os.getenv("GS_BUCKET_NAME", "bfa-backend-api")
GS_PROJECT_ID = os.getenv("GS_PROJECT_ID", "vivid-... | Python | 1 |
!(cfg)
)
);
}
impl Default for rte_eth_global_cfg {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
pub mod rte_eth_input_set_field {
pub type Type = ::std::os::raw::c_uint;
pub const RTE_ETH_INPUT_SET_UNKNOWN: Type = 0;
pub const RTE_ETH_INPUT_SET_L2_SRC_MAC: Type = 1... | Rust | 0 |
th(0))))
}
&ArithmeticTerm::Number(n) => Ok(n),
}
}
pub fn get_rational(
&mut self,
at: &ArithmeticTerm,
caller: impl Fn() -> FunctorStub + 'static,
) -> Result<TypedArenaPtr<Rational>, MachineStub> {
let n = self.get_number(at)?;
mat... | Rust | 0 |
ive range (positive), inclusive.
fn max_pos_range(self) -> CodeOffset {
match self {
// 19-bit immediate, left-shifted by 2, for 21 bits of total range. Signed, so +2^20
// from zero. Likewise for two other shifted cases below.
LabelUse::Branch19 => (1 << 20) - 1,
... | Rust | 0 |
import jittor as jt
from shapely.geometry import Polygon
HEADER = r'''
#undef out
#include <executor.h>
#include <vector>
#include <iostream>
#define THCCeilDiv(a,b) ((a + b - 1) / b)
#define DIVUP(m,n) ((m) / (n) + ((m) % (n) > 0))
int const threadsPerBlock = sizeof(unsigned long long) * 8;
#define maxn 10
const d... | Python | 1 |
Avg Hit@{}: {}'.format(self.top_k, avg_hit_at_k)
self.hit_at_k = hit_at_k
################################################################################
# Metrics
################################################################################
def compute_video_hit_at_k(ground_truth, prediction, top_k=3):
... | Python | 1 |
# Cadenas de caracteres
# 1. Muestra ejemplos de todas las operaciones que puedes realizar con cadenas de caracteres
# operaciones con cadenas de caracteres
cadena_01 = "hola"
cadena_02 = "mundo"
# concatenacion
concatenacion = cadena_01 + " " + cadena_02
print()
print(concatenacion)
# repeticion
repeticion = cadena... | Python | 1 |
from copy import deepcopy
from src.part_1 import (
get_all_teams,
post_team,
get_team,
delete_team,
delete_all_teams,
)
from data import TEAMS_B, WRONG_TEAMS
def test_1C():
teams = deepcopy(TEAMS_B[0:3])
bad_teams = deepcopy(WRONG_TEAMS[0:3])
results = {
1: delete_all_teams(... | Python | 1 |
};
hud.map(|_, _hud| {
_hud.connect(
"start",
_mob,
"on_start_game",
VariantArray::new_shared(),
0,
)
.unwrap();
})
.unwrap();
... | Rust | 0 |
e::Ordinal }, // 8708
"varnothing" => Symbol { unicode: 0x2205, atom_type: AtomType::Ordinal }, // 8709
"increment" => Symbol { unicode: 0x2206, atom_type: AtomType::Ordinal }, // 8710
"nabla" => Symbol { unicode: 0x2207, atom_type: AtomType::Alpha }, // 8711
"in" => Symbol { unicode: 0x2208, atom_type:... | Rust | 0 |
# !/usr/bin/python
# coding: utf8
# @Time : 2018-08-04 19:09
# @Author : Liam
# @Email : luyu.real@qq.com
# @Software: PyCharm
# .::::.
# .::::::::.
# :::::::::::
# ..:::::::::::'
# '::::::::::::'
# .:::... | Python | 1 |
305);
*(float*)buf3306 = sincos(*(float*)buf3307, (float*) buf3308);
*(float2*)buf3309 = sincos(*(float2*)buf3310, (float2*) buf3311);
*(float3*)buf3312 = sincos(*(float3*)buf3313, (float3*) buf3314);
*(float4*)buf3315 = sincos(*(float4*)buf3316, (float4*) buf3317);
*(float*)buf3318 = sinh(*(float*)... | Rust | 0 |
{
redis_fixture!(client, con, consumer, "g", gc, {
let _: Value = consumer.register().unwrap();
assert_eq!(gc.collect(), Ok(0));
});
}
#[test]
fn collect_runs_with_a_consumer_and_some_jobs() {
// ugly hack to ensure this test runs after the previous one, because Cargo
// runs them in p... | Rust | 0 |
if env::var_os("RUNNING_UNDER_RR").is_some() {
env_vars.retain(|(k, _v)| k != "LD_PRELOAD" && k != "RUNNING_UNDER_RR");
}
Ok(Command::Compile {
exe: exe.to_owned(),
cmdline,
cwd,
env_vars,
})... | Rust | 0 |
# License: Apache 2.0. See LICENSE file in root directory.
# Copyright(c) 2022 Intel Corporation. All Rights Reserved.
#test:donotrun:!dds
from rspy import log, test
log.nested = 'C '
import pyrealsense2 as rs
if log.is_debug_on():
rs.log_to_console( rs.log_severity.debug )
###################################... | Python | 1 |
(short, long)]
features: Option<Vec<String>>,
/// List of bundles to package
#[clap(short, long)]
bundles: Option<Vec<String>>,
/// JSON string or path to JSON file to merge with tauri.conf.json
#[clap(short, long)]
config: Option<String>,
/// Command line arguments passed to the runner
args: Vec<Stri... | Rust | 0 |
is example shows how multiple filter instances could share
// metrics.
stats: Rc<SampleNetworkFilterStats>,
// This example shows how to use Time API provided by Envoy host.
clock: &'a dyn Clock,
}
impl<'a> SampleNetworkFilterFactory<'a> {
/// Creates a new factory.
pub fn new(clock: &'a dyn Cl... | Rust | 0 |
_A> {
use crate::Variant::*;
match self.bits {
0 => Val(PRESCALE_A::PRESCALE_0),
1 => Val(PRESCALE_A::PRESCALE_1),
2 => Val(PRESCALE_A::PRESCALE_2),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `PRESCALE_0`"]
#[inline(a... | Rust | 0 |
arch::{asm, global_asm};
use super::{allocate_obj_on_stack, push};
use crate::stack::{Stack, StackPointer};
use crate::unwind::{
asm_may_unwind_root, asm_may_unwind_yield, cfi_reset_args_size_root, cfi_reset_args_size_yield,
InitialFunc, StackCallFunc, TrapHandler,
};
use crate::util::EncodedValue;
pub const ... | Rust | 0 |
vec![(AssetType::Token, asset_index), (AssetType::Token, liab_index)],
);
mango_cache.check_valid(
&mango_group,
&UserActiveAssets::merge(&liqee_active_assets, &liqor_active_assets),
now_ts,
)?;
// Make sure orders are cancelled for perps a... | Rust | 0 |
def handler(self, sig, frame):
self.signal_received = sig, frame
logging.debug('SIGINT received. Delaying KeyboardInterrupt.')
| Python | 1 |
e = DAGNode("e", step=3, parents=[d])
>>> [(parent.node_name, child.node_name) for parent, child in dag_iterator(a)]
[('a', 'c'), ('a', 'd'), ('b', 'c'), ('c', 'd'), ('d', 'e')]
Args:
dag (DAGNode): input dag
Returns:
(Iterable[Tuple[DAGNode, DAGNode]])
"""
visited_nodes = set... | Python | 1 |
::e2rcore::implement::render::util_gl;
pub fn file_open( file_path: & str ) -> Option<String> {
let path = File::open( file_path ).expect("file path open invalid");
let mut buf_reader = BufReader::new(path);
let mut contents = String::new();
match buf_reader.read_to_string( & mut contents ) {
E... | Rust | 0 |
ize]);
}
}
use libc::*;
use std::{ptr, io};
use crate::Ptr;
use std::ffi::c_void;
use std::path::Path;
use std::fs::{File, OpenOptions};
use std::ptr::{null, null_mut};
use std::os::unix::io::IntoRawFd;
use errno::errno;
use crate::utils::{BLOCK_SIZE, PAGE_SIZE, BLOCK_MASK};
const DEFAULT_PROT: c_int = PROT_READ |... | Rust | 0 |
date((gt_infos['gt_boxes'][:, 7] == -(i+1)).sum(), index=i)
pos_ps_nmeter.update(num_total_boxes - ign_ps_nmeter.meters[i].val, index=i)
NEW_PSEUDO_LABELS[input_dict['frame_id'][b_idx]] = gt_infos
# assert len(PSEUDO_LABELS)>0, "PSEUDO_LABEL LNGTH is ZERO"
return pos_ps_nmeter, ign_ps_nmete... | Python | 1 |
afe { timerfd_settime(fd, 0, &its, ptr::null_mut()) };
//! assert_eq!(0, _ret);
//! let watcher = Watcher::new().input();
//! Self(Device::new(fd, watcher, true), fd)
//! }
//! }
//!
//! impl Future for Timer {
//! type Output = usize;
//! fn poll(self... | Rust | 0 |
from __future__ import annotations
from decimal import Decimal
from django.contrib.auth.models import AbstractUser
from django.db import models
class User(AbstractUser):
pass
class Category(models.Model):
name = models.CharField(max_length=100)
def __str__(self) -> str:
return self.name
cla... | Python | 1 |
t_code += push_opcode(excerpt) * 2 + Op.SSTORE
contract = pre.deploy_contract(contract_code)
tx = Transaction(
sender=pre.fund_eoa(),
to=contract,
gas_limit=500_000,
protected=False if fork in [Frontier, Homestead] else True,
)
post = {}
key = int.from_bytes(excerp... | Python | 1 |
t::from_waker(&waker);
pin!(future);
'outer: loop {
if core.spawner.reset_woken() {
let (c, res) = context.enter(core, || {
crate::coop::budget(|| future.as_mut().poll(&mut cx))
});
core = c;
... | Rust | 0 |
32, 1))
def forward(self, context):
"""
Forward pass through the secondary learner
Args:
context: Context input to the secondary learner
Returns:
tensor after squeeze operation
"""
pooled = torch.max(self.conv(self.embeddings(context).squee... | Python | 1 |
lf) + 'static>(
&self,
f: F,
) -> SignalHandlerId {
unsafe extern "C" fn notify_what_to_show_trampoline<P, F: Fn(&P) + 'static>(
this: *mut webkit2_webextension_sys::WebKitDOMTreeWalker,
_param_spec: glib_sys::gpointer,
f: glib_sys::gpointer,
) whe... | Rust | 0 |
":
raise ValueError("`use_llama_pro` is only valid for the Freeze or LoRA method.")
if self.use_galore and self.finetuning_type == "lora":
raise ValueError("Cannot use LoRA with GaLore together.")
def save_to_json(self, json_path: str):
r"""Saves the content of this instanc... | Python | 1 |
)
],
visible_item='input_2d_visible',
flip_prob=0.5,
flip_camera=True),
dict(type='PoseSequenceToTensor', item='input_2d'),
dict(type='CollectCameraIntrinsics'),
dict(
type='Collect',
keys=[('input_2d', 'unlabeled_input'),
('target_2d', 'unlabele... | Python | 1 |
'\u1c4d', '\u1c4f')
];
pub static Limbu_table: &'static [(char, char)] = &[
('\u1900', '\u191e'), ('\u1920', '\u1922'), ('\u1923', '\u1926'), ('\u1927', '\u1928'),
('\u1929', '\u192b'), ('\u1930', '\u1931'), ('\u1932', '\u1932'), ('\u1933', '\u1938'),
('\u1939', '\u193b'), ('\u1940', '\... | Rust | 0 |
CStr::from_bytes_with_nul(&self.0)
.unwrap()
.to_str()
.unwrap();
std::fmt::Display::fmt(str, f)
}
}
impl Into<String> for AsciiString {
fn into(self) -> String {
CString::from_vec_with_nul(self.0)
.unwrap()
.into_string()
... | Rust | 0 |
# -*- coding: utf-8 -*-
# by @嗷呜
import json
import random
import re
import sys
import time
from base64 import b64decode, b64encode
import concurrent.futures
import requests
from Crypto.Hash import MD5
from pyquery import PyQuery as pq
sys.path.append('..')
from base.spider import Spider
class Spider(Spider):
def... | Python | 1 |
xfc\x07\
\x80\xd8\xbf\xf1\xc39;\x96\x9dF \xbe\x96.]\xa6\
\xe5\xcbW\xe8\xb8\xe3\x8e\xd5\xe9o\x9f\xa0\xe6\xe6!\xbe\
\x93\x80\x18\x88\xff\xe5\xebX\xef\x00\x84a\xd8`\xa6#\
}w\x00\xd8\xb5j\xb5\xaa{\xef\xbdO\xdf\xfa\xf6e\
\xba\xe3\x8e?\xa8R\xe1FAd\xde\x9b\x16-ZT\
\xf0\x1d\xb1+\xb1\x1e\x00\x9a\x9a\x9a\xde$\xa9\xc1w\x07\
\x80\... | Python | 1 |
2k
'# periods_semicolon_egg -> compass_airfield_payments'
(i4wu_x3lbip): '' = False
@0j(False, oouqkimocsp, jue3blpyod5, b'', c90ecv1o764=kldjtn5opag, wvqwdnk9bkn='', ci_t5w3pcay=0.0, ozjez6mmn50=lfb6xi5jmv_)
@(yield None)
def wtlyyankzjf(jzw3o9ddfwa: g9r4yad68a2=0, upil4_4ixc1: nv5etdgaqz8=0j, uo58n7rak5h=None... | Python | 1 |
from fastapi import APIRouter, Depends, HTTPException, Query
from typing import List, Optional
from datetime import datetime
from ...models.schemas import PriceData
from ...services.price_service import PriceService
from ..dependencies import get_price_service
import logging
router = APIRouter(prefix="/prices")
logger... | Python | 1 |
u32 = 1000148020u32;
#[doc(hidden)] pub const BLEND_OP_DIFFERENCE_EXT: u32 = 1000148021u32;
#[doc(hidden)] pub const BLEND_OP_EXCLUSION_EXT: u32 = 1000148022u32;
#[doc(hidden)] pub const BLEND_OP_INVERT_EXT: u32 = 1000148023u32;
#[doc(hidden)] pub const BLEND_OP_INVERT_RGB_EXT: u32 = 1000148024u32;
#[doc(hidden)] pub c... | Rust | 0 |
possible.
pub fn lock_exclusive(&mut self) -> Result<()> {
if self.exclusive.is_some() {
panic!("Use error, attempt to aquire multiple locks");
}
let el = ExclusiveLock::new(self.exclusive_name())?;
let rname = self.roster_name();
self.roster = Roster::load(&rn... | Rust | 0 |
:read_config;
use cosmwasm_std::testing::{mock_env, mock_info, MockApi, MockStorage, MOCK_CONTRACT_ADDR};
use cosmwasm_std::{from_binary, to_binary, CosmosMsg, Decimal, OwnedDeps, StdError, Uint128, WasmMsg, Storage};
use cw20::{Cw20ExecuteMsg, Cw20ReceiveMsg};
use mirror_protocol::gov::ExecuteMsg as MirrorGovExecuteMs... | Rust | 0 |
fn new_subcommand() -> App<'static, 'static> {
SubCommand::with_name("new")
.about("scaffolds a new gotham server")
.arg(Arg::with_name("name")
.help("Sets the name of the server application")
.required(true)
.takes_value(true))
.arg(Arg::with_name("d... | Rust | 0 |
rm) in any
# way that is inconsistent with the permitted uses described
# herein. You agree not to use any name or emblem of Harvard, Toronto
# or Sherbrooke, or any of their subdivisions for any purpose, or to
# falsely suggest any relationship between End User (or its
# Institution) and Harvard, Toronto and/or Sherbr... | Python | 1 |
# -- encoding: utf-8 --
# Copyright (c) 2024 Huawei Technologies Co., Ltd. All Rights Reserved.
# This file is a part of the ModelEngine Project.
# Licensed under the MIT License. See License.txt in the project root for license information.
# =============================================================================... | Python | 1 |
data,
})
)
);
}
}
named!(DEVC<&[u8], Message>,
do_parse!(
tag!("DEVC") >>
size_hint: tag!("\x00") >>
size: be_u8 >>
num: be_u16 >>
body: take!(size as u16 * num) >>
ta... | Rust | 0 |
port_id: Some(ID1),
target: LifIpAddr { address: IpAddr::V6(Ipv6Addr::UNSPECIFIED), prefix: 0 },
},
];
let route_table2 = &[
hal::Route {
gateway: Some(std_ip!("2.2.3.1")),
metric: None,
port_id: Some(ID1),
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.