text
string
label_name
string
labels
int64
lc[j] = &limbs_lc[j] + &(bit.lc() * *power_of_2_coeff); } } let mut new_limbs_gadget = Vec::<AllocatedFp<BaseField>>::new(); for (value, lc) in limbs_value.iter().zip(limbs_lc.iter()) { let value_gadget = AllocatedFp::<BaseField>::new_witness( ark_relatio...
Rust
0
// crete a ply objet let mut ply = Ply::<DefaultElement>::new(); ply.header.encoding = Encoding::Ascii; ply.header .comments .push("Exported from rust-cv/vslam-sandbox".to_string()); // Define the elements we want to write. In our case we write a 2D Point. // When writing, the `...
Rust
0
t heap, &mut heap_bitmap).unwrap(); // chunk 3 gets described by bitmap byte 0 bit 3 assert_eq!((0, 3), alloc.chunk_index_to_bitmap_indices(3)); assert_eq!((0, 7), alloc.chunk_index_to_bitmap_indices(7)); // chunk 8 gets described by bitmap byte 1 bit 0 assert_eq!((1, 0), alloc....
Rust
0
and has enough energy } else if state.rel_time.burst >= 15. && state.energy >= 60. { CharacterAction::Burst // check if normal attacks can be used (both animations are ended) } else if data.idx.is_on_field() && state.rel_time.ca >= 2.266 { CharacterAction::Ca(state.ca_ca...
Rust
0
p, batch_sz: batch_cap, batch_stride: dim.flat_len(), } } pub fn dim(&self) -> (usize, usize, usize) { self.dim } pub fn stride(&self) -> (usize, usize, usize) { self.stride } pub fn batch_size(&self) -> usize { self.batch_sz } pub fn set_batch_size(&mut self, new_bat...
Rust
0
(|cnt| *cnt -= num); counts.entry(Dir::SE).and_modify(|cnt| *cnt -= num); } { let num = min(counts[&Dir::NE], counts[&Dir::S]); counts.entry(Dir::SE).and_modify(|cnt| *cnt += num); counts.entry(Dir::NE).and_modify(|cnt| *cnt -= num); counts.entry(Dir::S).and_modify(|cnt| ...
Rust
0
def move_ball(tubes, from_tube, to_tube): # Remove a ball from the 'from_tube' and add it to the 'to_tube' ball = tubes[from_tube].pop() tubes[to_tube].append(ball) return tubes def sort_balls(tubes): # Initialize the list of moves moves = [] # Keep simulating the process until all ba...
Python
1
validated public key is stored in the slot, writes are prohibited. /// Use Verify(Invalidate) to invalidate prior to writing. /// Do not use this mode unless slot contains a public key. PubInvalid, /// Writes are never permitted on this slot using the Write command. /// Slots set to never can stil...
Rust
0
ract_y < 1.0 - fract_x { (-1, 0) // west } else { (0, 1) // north } }; // Is there actually another node in that direction? if 0 <= c + dx && c + dx < self.cols as i32 && ...
Rust
0
= self.regs.y; let index = self.regs.x; self.unofficial_strange_write(mem, y, index); } fn sxa(&mut self, mem: &mut impl Memory) { let x = self.regs.x; let index = self.regs.y; self.unofficial_strange_write(mem, x, index); } /////////////// // Interrupts ...
Rust
0
09e0453685b8816895cd56a7ee2fce600026ee23ac445d78f020c1ca40f61a5ebdc1b8f600").unwrap(); let header = BlockHeader::unmarshal_cbor(&bz).unwrap(); assert_eq!(hex::encode(header.marshal_cbor().unwrap()), hex::encode(bz)); } } <reponame>w3f-community/sp-move-vm<filename>language/vm/src/check_bounds.rs<gh_...
Rust
0
ent = extent.intersection(self.extent()); unchecked_copy_extent_between_arrays(self, &src_array.0, in_bounds_extent); } } // SAFETY: `extent` must be in-bounds of both arrays. fn unchecked_copy_extent_between_arrays<Dst, Src, N, Ptr>( dst: &mut Dst, src: &Src, extent: ExtentN<N>, ) where N...
Rust
0
import os def main(): primeiro = Aluno() atual = primeiro ultimo = primeiro while True: os.system('clear') print('Opções:') print('1 -> Cadastrar') print('2 -> Consultar') print('3 -> Pesquisar') print('4 -> Sair') escolha = input('Opção: ') ...
Python
1
configuration"] pub mod gpio_cfgctl3; #[doc = "GPIO_CFGCTL4 register accessor: an alias for `Reg<GPIO_CFGCTL4_SPEC>`"] pub type GPIO_CFGCTL4 = crate::Reg<gpio_cfgctl4::GPIO_CFGCTL4_SPEC>; #[doc = "GPIO8, GPIO9 configuration"] pub mod gpio_cfgctl4; #[doc = "GPIO_CFGCTL5 register accessor: an alias for `Reg<GPIO_CFGCTL5_...
Rust
0
0..0xFF - where 0 means that the received power was /// less than 10 dB above the selected receiver sensitivity. This value is not given in dBm, /// but can be converted. See the nrf52840 Product Specification Section 6.20.12.4 /// for details. ed_threshold: u8, }, } /// IEEE 802.1...
Rust
0
// Pending compaction bytes if let Some(pending_compaction_bytes) = engine.get_property_int_cf(handle, ROCKSDB_PENDING_COMPACTION_BYTES) { STORE_ENGINE_PENDING_COMACTION_BYTES_VEC .with_label_values(&[name, cf]) .set(pending_compaction_bytes as i6...
Rust
0
combined with `mod_mgmt::allocate_section_pages()`. fn allocate_debug_section_pages(elf_file: &ElfFile, kernel_mmi_ref: &MmiRef) -> Result<(MappedPages, Range<VirtualAddress>), &'static str> { let mut ro_bytes = 0; for sec in elf_file.section_iter() { // Skip non-"debug" sections. if sec.get_na...
Rust
0
index. /// Calling this or `next_answer` again will give the same answer. fn peek_answer(&mut self, should_continue: impl Fn() -> bool) -> AnswerResult<C>; /// Gets the next answer for a given goal, incrementing the answer index. /// Calling this or `peek_answer` again will give the next answer. f...
Rust
0
ized) } } <gh_stars>100-1000 #[macro_export] macro_rules! compose { ( $last:expr ) => { $last }; ( $head:expr, $($tail:expr), +) => { compose_two($head, compose!($($tail),+)) }; } pub fn compose_two<A, B, C, G, F>(f: F, g: G) -> impl Fn(A) -> C where F: Fn(A) -> B, G: Fn(B) -> C, { ...
Rust
0
rror("save_png expects a matplotlib Figure or Axes") figure.savefig(target, dpi=dpi, bbox_inches="tight") return target def save_model( model: Any, filename: str = "model.joblib", *, run_id: str, base_dir: str | Path | None = None, subdir: str | Path | None = None, ) -> Path: """P...
Python
1
one_queue and put it in the appropriate place on the main image. # This loop is happening while the other processes are still working on their tasks. # You'll see that these logging statements get print out as the stamp images are still # being drawn. for i in range(ntot): result, info, proc = d...
Python
1
for HoursMinutesSeconds { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{}ʰ{}ᵐ{:.3}ˢ", self.hours, self.minutes, self.seconds) } } #[cfg(test)] mod tests { use super::*; use assert_approx_eq::assert_approx_eq; #[test] fn from_degrees() { asser...
Rust
0
_config(config_path, path, remote, true) } else { Ok(()) } } fn build_changelog(config: &Config, path: &Path, unreleased: bool) -> Result<()> { let changelog = Changelog::read_from_dir(config, path)?; log::info!("Success!"); if unreleased { println!("{}", changelog.render_unreleased...
Rust
0
n deregister(&self, fd: RawFd) -> io::Result<()> { // PORT_SOURCE_FD is 4 syscall!(port_dissociate(self.ep, 4, fd as usize)).map(|_| ()) } } fn interests_to_evport(interests: Interests) -> i32 { let mut kind = 0; if interests.is_readable() { kind = kind | POLLIN; } if inte...
Rust
0
]: OsQueue::reregister /// [readable]: Interests::READABLE /// [`TcpStream` interests]: crate::net::TcpStream::INTERESTS /// /// # Notes /// /// Unless otherwise specified, the caller should assume that once an /// `Evented` handle is registered with a `OsQueue` instance, it is bound to ...
Rust
0
plot(info, "CIFAR Scenario 2", figname="cifar_scenario2", subsample=[(2, 2), (3, 2)], minimal=True) def cifar_scenario3(): info = np.load("./metrics/cifar_scenario3.pkl", allow_pickle=True) make_plot(info, "CIFAR Scenario 3", figname="cifar_scenario3", minimal=True) def synthetic_scenario3_m2():...
Python
1
aws_smithy_types::Number::NegInt((*var_1055).into()), ); } #[allow(unused_mut)] let mut scope_1056 = writer.prefix("Ipv6Prefix"); if let Some(var_1057) = &input.ipv6_prefixes { let mut list_1059 = scope_1056.start_list(true, Some("item")); for item_1058 in var_1057 { ...
Rust
0
""" 实物 cron: 0 0 10 * * * new Env("悦临平") app 悦临平 的 手机尾号后四位#电话#密码 以#拼接 eg: 8888#18888888888#888999 多账号以 "回车" 或者 多变量 隔开 青龙变量为 ylp_ck 环境必须为 python 3.10 debian版青龙 安装ddddocr依赖 两个文件必须在同一目录 使用青龙上传 必须点击退出保存 不支持arm """ import asyncio from ysl_ylp import * print(""" 正在运行脚本:【悦临平】V1.0 📢 请认真阅读以下声明 【免责声明】 📌 脚本文件仅用于测...
Python
1
rame() self.history_force_Coeffs_df = pd.DataFrame() self.info_list = [] for f_name in os.listdir(self.foam_root_path): if re.search(r"^\d+\.?\d*", f_name): if (f_name != "0") and (f_name != self.cfd_init_time_str): shutil.rmtree("/".join([self.foa...
Python
1
bits & !(0x03 << 16)) | (((value as u32) & 0x03) << 16); self.w } } #[doc = "Reader of field `SENSITIVE_DMA_APBPERI_LC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_1`"] pub type SENSITIVE_DMA_APBPERI_LC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_1_R = crate::R<u8, u8>; #[doc = "Write proxy for field `SENSITIVE_DMA_APBPERI_LC_PMS_CON...
Rust
0
import os import time from dotenv import load_dotenv import google.generativeai as genai import datetime from google.generativeai import caching # Load environment variables from .env file load_dotenv() model="gemini-1.5-flash-001" # model="gemini-1.5-pro-001" # Get the API key from environment variables api_key = o...
Python
1
#!/usr/bin/env python from vtkmodules.vtkIOImage import vtkImageReader2Factory from vtkmodules.vtkInteractionImage import vtkImageViewer import vtkmodules.vtkInteractionStyle import vtkmodules.vtkRenderingFreeType import vtkmodules.vtkRenderingOpenGL2 from vtkmodules.util.misc import vtkGetDataRoot VTK_DATA_ROOT = vtkG...
Python
1
import configparser parser = configparser.ConfigParser() parser.read_file(open('config/config.ini')) url = parser.get('url', 'base_path')
Python
1
{ type TimeoutHeap = TimeoutHeap; #[inline(always)] fn state() -> &'static KernelState { &KERNEL_STATE } const INTERRUPT_HANDLERS: &'static cfg::InterruptHandlerTable = &cfg::InterruptHandlerTable { storage: &INTERRUPT_HANDLE...
Rust
0
import os import torch from transformers import pipeline from datasets import load_dataset from transformers import AutoTokenizer, AutoModelForCausalLM # Select the model that you want to test # checkpoint = "bigcode/starcoder" # checkpoint = "ise-uiuc/Magicoder-S-DS-6.7B" # checkpoint = "WizardLM/WizardCoder-15B-V1....
Python
1
import matplotlib.pyplot as plt from utilities import FileReader def plot_errors(filename): headers, values=FileReader(filename).read_file() time_list=[] first_stamp=values[0][-1] for val in values: time_list.append(val[-1] - first_stamp) fig, axes = plt.su...
Python
1
for item in calendar: if item['type'] == 'watering': history.append({ 'date': item['schedule'].get('last_watered'), 'type': 'Watering', 'plant': item['schedule']['plant_name'], 'details': f"Frequency: {i...
Python
1
direction: FftDirection, _phantom: std::marker::PhantomData<T>, rotate: Rotate90F64, twiddle1re: float64x2_t, twiddle1im: float64x2_t, twiddle2re: float64x2_t, twiddle2im: float64x2_t, twiddle3re: float64x2_t, twiddle3im: float64x2_t, twiddle4re: float64x2_t, twiddle4im: floa...
Rust
0
class Annotation: """ An annotation is extra information that may or may not be displayed to the end-user, depending on the context. For example gobject annotations will be displayed for the C language, but hidden in python, and interpreted instead. """ def __init__(self, name, argument=No...
Python
1
distances = [] total = 0 for day in range(1, 5): for dist in distances: total += dist print(f"Avg: {total / len(distances)}")
Python
1
ls = datasets_info.nuScenes_general_thing_labels stuff_labels = datasets_info.nuScenes_general_stuff_labels elif dataset_type == "kitti360": ignore_labels = {"unlabeled", "unknown construction", "unknown vehicle", "unknown object"} thing_labels, stuff_labels = get_things_stuff_split_kitti360...
Python
1
ine] #[cfg_attr(test, assert_instr(v128.load32_splat))] #[target_feature(enable = "simd128")] #[doc(alias("v128.load32_splat"))] pub unsafe fn v128_load32_splat(m: *const u32) -> v128 { transmute(simd::u32x4::splat(*m)) } /// Load a single element and splat to all lanes of a v128 vector. #[inline] #[cfg_attr(test,...
Rust
0
#[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always...
Rust
0
filter = paddle.to_tensor(conv_filter.numpy()) scale = paddle.to_tensor(bn_scale.numpy()) bias = paddle.to_tensor(bn_bias.numpy()) mean = paddle.to_tensor(bn_mean.numpy()) var = paddle.to_tensor(bn_var.numpy()) sdaa_output = paddle_sdaa.custom_fused_conv_bn( ...
Python
1
BtreeEntry, BtreeRangeIter, PageNumber, Storage}; use crate::types::{RedbKey, RedbValue, WithLifetime}; use crate::AccessGuard; use std::cell::Cell; use std::marker::PhantomData; use std::ops::RangeBounds; use std::rc::Rc; pub struct Table<'s, K: RedbKey + ?Sized, V: RedbValue + ?Sized> { storage: &'s Storage, ...
Rust
0
use self::{ cigar::get_cigar, data::get_data, quality_scores::get_quality_scores, read_name::get_read_name, sequence::get_sequence, }; *record.reference_sequence_id_mut() = get_reference_sequence_id(&mut src)?; *record.position_mut() = get_position(&mut src)?; let l_read_name = Non...
Rust
0
q[i] = j ^ (((res1 >> j) & 1) << sh) for i in range(24): # copy (initial) * p * (final) to p p[i] = q[i] # It remains to compute the 3 middle layers. They must compute # the permutation i -> p[i] with p[i] = i (mod 8). E.g. for i=0 # we do the following transpositions, if (0, 8, 1...
Python
1
pub const CRUXSMALL_OR_KISS: &str = r#" {b} ___ ({w}.· {b}| ({m}<> {b}| / {w}__ {b}\\ ( {w}/ \\ {b}/| {m}_{b}/\\ {w}__){b}/{m}_{b}) {m}\/{b}-____{m}\/"#; // "CRUX"* // CRUX // Colors: [4, 5, 7, 6] pub const CRUX: &str = r#" {b} odddd oddxkkkxxdoo ddcoddxxxdoool xdclodod olol ...
Rust
0
88 = object.key("QuickConnectIds").start_array(); for item_89 in var_87 { { array_88.value().string(item_89.as_str()); } } array_88.finish(); } if let Some(var_90) = &input.tags { let mut object_91 = object.key("Tags").start_object(); ...
Rust
0
provider.operations_num += 1; } match &op.event { AirnodeEvent::ProviderCreatedA { provider_id: _, admin: _, xpub, } => { let mut provider = AirnodeState::default(); ...
Rust
0
from .client import SubtitleClient from .models import ( SubtitleSearch, SubtitleUploadForm, SubtitleLanguage, SubtitleInfo ) __all__ = [ 'SubtitleClient', 'SubtitleSearch', 'SubtitleUploadForm', 'SubtitleLanguage', 'SubtitleInfo' ]
Python
1
/// extern crate uom; /// use uom::si::{f32::*, length::meter, area::square_meter}; /// /// let x = Leaf::new() /// .name("x") /// .value(Length::new::<meter>(2.0)) /// .build(); /// let y = Leaf::new() /// .name("y") /// .value(Length::new::<meter>(1.0)) /// .build(); /// let res = x * y; /// ...
Rust
0
elf, BufRead}; use std::sync::mpsc::{self, TryRecvError}; extern crate num_cpus; // def fib_gen(): // a, b = 0, 1 // while True: // yield a // a, b = b, a + b // n = 1000000 // f = fib_gen() // for _ in range(n): // next(f) /// /// Source from: /// https://vladris.com/blog/2018/02/11/fi...
Rust
0
descriptor.set_vertex_function(library.new_function_with_name("vertex_project")); pipeline_descriptor.set_fragment_function(library.new_function_with_name("fragment_flatcolor")); // pipelineDescriptor.colorAttachments[0].pixelFormat = MTLPixelFormatBGRA8Unorm; // pipelineDescriptor.depthAttachme...
Rust
0
""" Help: search "Extensions" in wiki """ from TDStoreTools import StorageManager TDF = op.TDModules.mod.TDFunctions class BaseMix: """ BaseMix description """ def __init__(self, ownerComp): self.ownerComp = ownerComp self.toxStore = parent.sm.op('base_tox') def Setbank(self, bank, tox, store=parent.sm.op...
Python
1
m { // Token-matching ordering names can use specialized work. ($typ:ty as $uint:ident $(as $usz:ident)?, Lsb0; $( $a:expr, $b:expr, $c:expr, $d:expr, $e:expr, $f:expr, $g:expr, $h:expr, )*) => {{ const ELEM: $uint = $crate::__ty_from_bytes!( $uint, Lsb0, [$($crate::macros::internal::u8_from_le_bits( $...
Rust
0
i_l) }, ) } #[no_mangle] pub extern "C" fn wire_handle_complex_struct(port: i64, s: *mut wire_MyTreeNode) { FLUTTER_RUST_BRIDGE_HANDLER.wrap( WrapInfo { debug_name: "handle_complex_struct", port: Some(port), mode: FfiCallMode::Normal, }, move ...
Rust
0
 ,3`c@syddlmZWnek r-eZnXddlmZddlmZddlmZddlm Z ddlm Z ddlm Z ddlm Z d gZ d efd YZd efd YZdefdYZdefdYZdefdYZdefdYZde...
Python
1
cancels = [submit_event_1, submit_event_2] ) reset_event = reset_prompts_button.click( lambda a,b,c,d,e,f,g,h,i,j: [a,b,c,d,e,f,g,h,i,j], inputs = prompt_defaults, outputs = prompt_inputs ) def make_prompt_template(): d = AgentOobaVars["directives"].copy()...
Python
1
ck() def applyDockerMode(self, senderName=str()): if self.mutex.tryLock() == False: #print('skipped applyDockerMode') #print(' mutex.tryLock()= ', False) #print(' sender= ', senderName) #print('') return self.setFloating(False) ...
Python
1
*x = fib(500); }) ); } #[test] fn scales_o_one() { println!(); let stats = bench_scaling(|_| thread::sleep(Duration::from_millis(10)), 1); println!("O(N): {}", stats); assert_eq!(stats.scaling.power, 0); println!(" error: {:e}", sta...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Cropman Console ~~~~~~~~~~~~~~~ Face-aware image cropper application (console interface). :copyright: (c) 2014 by Ming YANG. :license: WTFPL (Do What the Fuck You Want to Public License). Usage: app-console.py <input-image> <target-widt...
Python
1
f"📊 No new votes since last update (timestamp: {latest_vote_timestamp})" ) with open(meta_path, "w") as f: json.dump(meta, f, indent=2) print("✅ Saved meta.json") print(f"Done! Files written to {outdir}") datasets_path = Path("data/data...
Python
1
from llmebench.datasets import CT22AttentionworthyDataset from llmebench.models import AzureModel from llmebench.tasks import AttentionworthyTask def metadata(): return { "author": "Mohamed Bayan Kmainasi, Rakif Khan, Ali Ezzat Shahroor, Boushra Bendou, Maram Hasanain, and Firoj Alam", "affiliatio...
Python
1
_CICR::ADC_DCCTL4_CIC_HIGH } } #[doc = "Values that can be written to the field `ADC_DCCTL4_CIC`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum ADC_DCCTL4_CICW { #[doc = "Low Band"] ADC_DCCTL4_CIC_LOW, #[doc = "Mid Band"] ADC_DCCTL4_CIC_MID, #[doc = "High Band"] ADC_DCCTL4_CIC_HIGH, } i...
Rust
0
hexadecimal string #[display("hex")] Hex, /// Binary script source encoded as Base64 string #[display("base64")] Base64, /// Miniscript string or descriptor #[display("miniscript")] Miniscript, /// Miniscript string or descriptor #[display("policy")] Policy, /// Strin...
Rust
0
import torch from Baselines.B3_separate.Player.b3_player_model import B3PlayerModel from Enums.classification_level import ClassificationLevel from Abstracts.base_model import _BaseModel from Modules.custom_max_pool import CustomMaxPool from torch import nn class B3ImgModel(_BaseModel): def __init__(self, pretrai...
Python
1
# -*- coding: utf-8 -*- # Author: Lawlite # Date: 2018/10/20 # Associate Blog: http://lawlite.me/2018/10/16/Triplet-Loss原理及其实现/#more # License: MIT import tensorflow as tf def _pairwise_distances(embeddings, squared=False): ''' 计算两两embedding的距离 ------------------------------------------ Args: ...
Python
1
LASS_UNDERSHOOT: once_cell::sync::Lazy<&'static str> = once_cell::sync::Lazy::new(|| unsafe { CStr::from_ptr(ffi::GTK_STYLE_CLASS_UNDERSHOOT) .to_str() .unwrap() }); #[doc(alias = "GTK_STYLE_CLASS_VERTICAL")] pub static STYLE_CLASS_VERTICAL: once_cell::sync::Lazy<&'static str> = ...
Rust
0
ic[ent_start][-1] tri_type_id = tri_dic[tri_idx][-1] valid_args = self.event_cons.get_constraint_arg_types(ent_type_id, tri_type_id) if valid_args and role_type in valid_args: pred_args.append(arg) self.clear() return losses, loss_ro...
Python
1
/trap.wasm", // ExecutableType::Wasmtime, // VwArch::X64, // ) // } // #[test] // fn wasmtime_wasm_fib_wasm_dwarf5() { // full_test_helper( // "./veriwasm_public_data/wasmtime/bin/wasm/fib-wasm-dwarf5.wasm", // ExecutableType::Wasmtime, // VwArch::X64, // ) // } // ...
Rust
0
_0_PMS_0`"] pub type SENSITIVE_DMA_APBPERI_BACKUP_PMS_CONSTRAIN_SRAM_WORLD_0_PMS_0_R = crate::R<u8, u8>; #[doc = "Write proxy for field `SENSITIVE_DMA_APBPERI_BACKUP_PMS_CONSTRAIN_SRAM_WORLD_0_PMS_0`"] pub struct SENSITIVE_DMA_APBPERI_BACKUP_PMS_CONSTRAIN_SRAM_WORLD_0_PMS_0_W<'a> { w: &'a mut W, } impl<'a> SENSITIV...
Rust
0
from diffusion import translate from loaders import anime_loader, human_loader from train import get_model import configs import matplotlib.pyplot as plt def imshow(tensor, n=2): tensor = tensor.cpu() b, c, w, h = tensor.shape r = n c = n fig, ax = plt.subplots(r, c, figsize=(10,10)) for i in range(r): ...
Python
1
check = response.json() except json.JSONDecodeError: print(f"{red}❌ Phản hồi không hợp lệ (không phải JSON):") print(response.text) continue else: print(f"{red}❌ Phản hồi rỗng. Có thể AUTH không đúng.") ...
Python
1
############################################################## result = frgnmem_trade_estimate( fid_cond_mrkt_div_code="J", fid_cond_scr_div_code="16441", fid_input_iscd="0000", fid_rank_sort_cls_code="0", fid_rank_sort_cls_code_2="0" ) print(result) ###############################################...
Python
1
# when result = block.run( url="https://some.com", method="POST", query_parameters={"a": "b"}, headers={"c": "d"}, json_payload={"e": "f"}, json_payload_operations={"e": [StringToUpperCase(type="StringToUpperCase")]}, form_data={"field": "value"}, form...
Python
1
# Copyright 2017 - Nokia # # 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 agreed to in writing, software...
Python
1
nput[type!=hidden], button, select, textarea, fieldset, optgroup, option, fieldset):not(:disabled) ''' ).process_selectors(flags=FLG_PSEUDO | FLG_HTML) # CSS pattern for `:required` CSS_REQUIRED = CSSParser( 'html|*:is(input, textarea, select)[required]' ).process_selectors(flags=FLG_PSEUDO | FLG_HTML) # CSS pa...
Python
1
# id 940200250 (Arcana : Cavernous Cavern), field 940200250 sm.lockInGameUI(True, False) sm.removeAdditionalEffect() sm.blind(True, 255, 0, 0, 0, 500) sm.sendDelay(500) sm.zoomCamera(0, 2000, 0, -740, 180) sm.forcedFlip(True) sm.spawnNpc(3003313, -867, 115) sm.showNpcSpecialActionByTemplateId(3003313, "summon", 0) sm.s...
Python
1
#!/usr/bin/env python3 import ir_model # # The same operator can be defined using different sets of attributes # because some attributes have default values. The purpose of this code # is to use equal python sets of attributes for the same operators, so we # can detect duplicates and avoid testing the same shapes mor...
Python
1
`_aiidasubmit.sh`), stdin file (`aiida.in`), and internal AiiDA info (`.aiida/`). - `outputs/`: Contains files retrieved by the parser (e.g., `aiida.out`, `_scheduler-stdout.txt`, `_scheduler-stderr.txt`). - `node_inputs/`: Contains repositories of input data nodes linked...
Python
1
highlightbackground=self.colors["border"], activebackground=self.colors["btn_bg"], activeforeground=self.colors["btn_fg"]) for widget in self.buttons_frame.winfo_children(): if isinstance(widget, tk.Button): ...
Python
1
] pub ramn67: crate::Reg<ramn67::RAMN67_SPEC>, #[doc = "0x190 - Embedded RAM"] pub ramn68: crate::Reg<ramn68::RAMN68_SPEC>, #[doc = "0x194 - Embedded RAM"] pub ramn69: crate::Reg<ramn69::RAMN69_SPEC>, #[doc = "0x198 - Embedded RAM"] pub ramn70: crate::Reg<ramn70::RAMN70_SPEC>, #[doc = "0...
Rust
0
import pytest from preshed.maps import PreshMap import random def test_insert(): h = PreshMap() assert h[1] is None h[1] = 5 assert h[1] == 5 h[2] = 6 assert h[1] == 5 assert h[2] == 6 def test_resize(): h = PreshMap(4) h[4] = 12 for i in range(10, 100): value = int(i...
Python
1
# Compute the moving average of a list using a sliding window of size k import math def movingAverage(nums, k): res = [] for i in range(len(nums) - k+1): window = nums[i:i+k] avg = sum(window)/k res.append(avg) return res print("========== Moving Average =============") nums = [...
Python
1
import os import re import json # from humanevalpack import create_all_tasks, create_task # create_all_tasks() def extract_ccpp_code(text, item, ): code_block = re.search(rf"```(?:[Cc](?:pp|\+\+|PP)?)?(.*?)\n```", text, flags=re.DOTALL) if code_block is None: code_block_pattern = re.compile(rf"(\n....
Python
1
chargers, rho, u_max, n_runs, random_mult, return_type='df', rng=default_rng(100) ) # plot_charger_timelines( # fname='incumbent_soln.csv', # zero_time=datetime(2024, 4, 3) # ) # if try_full: # solve_full_problem_gurobi( # trips=list(case_data['sigma'].keys...
Python
1
"""Constants for the laundrify tests.""" from homeassistant.const import CONF_CODE VALID_AUTH_CODE = "999-001" VALID_ACCESS_TOKEN = "validAccessToken1234" VALID_ACCOUNT_ID = "1234" VALID_USER_INPUT = { CONF_CODE: VALID_AUTH_CODE, }
Python
1
, 24: Y} impl_sql_tuple! { 0: A, 1: B , 2: C, 3: D, 4: E, 5: F, 6: G, 7: H, 8: I, 9: J, 10: K, 11: L, 12: M, 13: N, 14: O, 15: P, 16: Q, 17: R, 18: S, 19: T, 20: U, 21: V, 22: W, 23: X, 24: Y, 25: Z} extern crate futures; use error::QuicksilverError; use futures::{Async, Future, Poll}; use futures::future::{JoinAll, j...
Rust
0
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # 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 applica...
Python
1
, }; // Enable older test code to automatically access the inner database via Deref coercion. impl Deref for ZebraDb { type Target = DiskDb; fn deref(&self) -> &Self::Target { self.db() } } impl ZebraDb { /// Returns the inner database. /// /// This is a test-only method, because it a...
Rust
0
let config_file = "tests/resources/OPTIONS-000001"; let opts_res = FullOptions::load_from_file(config_file, None, false); assert!(opts_res.is_ok()); opts_res.unwrap() }; assert_eq!(full_opts.cf_descriptors.len(), 2); let cf_default_name = "default"; assert!( full...
Rust
0
re in my.cnf file:: #: #: DATABASES = { #: 'default': { #: 'ENGINE': 'django.db.backends.mysql', #: 'OPTIONS': { #: 'read_default_file': '/home/pytition/my.cnf', #: 'init_command': "SET sql_mode='STRICT_TRANS_TABLES'", #: }, #: } #: } DATABASES =...
Python
1
, OperationCanceled> { let mut sum = 0; for val in values { try!(ct.result()); sum = sum + val; thread::sleep(time::Duration::from_secs(1)); } Ok(sum) } fn main() { let cts = CancellationTokenSource::new(); cts.cancel_after(time::Duration::from_millis(1500)); assert_...
Rust
0
#[doc = "*Required features: `\"Win32_NetworkManagement_WindowsFilteringPlatform\"`*"] pub const IPSEC_PFS_2: IPSEC_PFS_GROUP = 2i32; #[doc = "*Required features: `\"Win32_NetworkManagement_WindowsFilteringPlatform\"`*"] pub const IPSEC_PFS_2048: IPSEC_PFS_GROUP = 3i32; #[doc = "*Required features: `\"Win32_NetworkMana...
Rust
0
s to the point cloud. for _ in 0..1_000 { let point = self.generator.next(); self.pointcloud.push(point, rand::random()); } } } } impl Default for GraphicsManager { fn default() -> Self { let eye = Point3::new(0.0f32, 0.4, 0.0); l...
Rust
0
tYearFactory()) offer = factories.CollectiveStockFactory( collectiveOffer__provider=venue_provider.provider, collectiveOffer__venue=venue_provider.venue, collectiveOffer__institution=deposit.educationalInstitution, ).collectiveOffer with patch("pcapi.core.edu...
Python
1
_id = pdf_dev_locate_font(name, (pt_size * dev_unit_dviunit()) as spt_t); if (*font).font_id < 0i32 { _tt_abort( b"MPOST: No physical font assigned for \"%s\".\x00" as *const u8 as *const i8, font_name, ); } 0i32 } unsafe extern "C" fn save_font() { let mut curren...
Rust
0
ap_or(0); let is_decoder = config.is_decoder; let pad_token_id = config.pad_token_id; let dropout = Dropout::new(config.hidden_dropout_prob); let num_attention_heads = config.num_attention_heads; let attention_head_size = config.attention_head_size; let all_head_size = ...
Rust
0
MONTHS = ['', 'января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'] EMOJI_BY_INT = { 0: "0️⃣", 1: "1️⃣", 2: "2️⃣", 3: "3️⃣", 4: "4️⃣", 5: "5️⃣", 6: "6️⃣", 7: "7️⃣", 8: "8️⃣", 9: "9️⃣", }
Python
1