text
string
label_name
string
labels
int64
mn(md: &mut impl Write, versions: u64, max : u64) -> io::Result<()> { let mut anything = false; let mut bit = 0; while bit < 64 { if (1<<bit) & versions != 0 { // Found a set bit! if anything { write!(md, ", ")? } anything = true; ...
Rust
0
ght, gast.Name): anno.setanno(binary_comparison, SAFE_BOOLEAN_OPERAND, True) if op_tree: self._expect_simple_symbol(right) op_tree = self._as_function( 'ag__.and_', (op_tree, binary_comparison), args_as_lambda=True) else: op_tree = binary_comparison left = r...
Python
1
from puepy import Application, Page, Component, t from puepy.router import Router app = Application() app.install_router(Router, link_mode=Router.LINK_MODE_HASH) pets = { "scooby": {"name": "Scooby-Doo", "type": "dog", "character": "fearful"}, "garfield": {"name": "Garfield", "type": "cat", "character": "lazy...
Python
1
+ AsPrimitive<TI>, { let len = K::mr() * K::nr(); let v: Vec<TC> = (0..len).map(|f| f.as_()).collect(); let bias: Vec<TI> = (0..K::nr()).map(|f| f.as_()).collect(); let found = fused_ops::<K, TA, TB, TC, TI>(&*v, &[FusedKerSpec::PerColMul(bias.as_ptr())]); ...
Rust
0
errors["base"] = "invalid_auth" except NoHomes: errors["base"] = "no_homes" except Exception: # pylint: disable=broad-except _LOGGER.exception("Unexpected exception") errors["base"] = "unknown" if not errors: ...
Python
1
#[derive(Debug, Serialize, Deserialize)] pub struct HdfsRackCreateParams { /// Array of IP ranges. Clients from one of these IP ranges are served by corresponding nodes from ip_pools array. #[serde(rename = "client_ip_ranges")] pub client_ip_ranges: Option<Vec<String>>, /// Array of IP pool names to u...
Rust
0
: MachineDesc) -> fn(BuiltinType) -> isize { a.builtinSize } fn ptrSize(a: MachineDesc) -> isize { a.ptrSize } fn voidSize(a: MachineDesc) -> isize { a.voidSize } fn iAlign(a: MachineDesc) -> fn(IntType) -> isize { a.iAlign } fn fAlign(a: MachineDesc) -> fn(FloatType) -> isize { a.fAlign } fn builti...
Rust
0
().to_string_lossy().to_string(); let hkcu = RegKey::predef(HKEY_CURRENT_USER); let env = hkcu .open_subkey("Environment") .with_context(|_| ErrorDetails::ReadUserPathError)?; let path: String = env .get_value("Path") .with_context(|_| ErrorDetails...
Rust
0
in, scoring=scoring, cv=5) for scoring_measure, scores_arr in scores_final_lr.items(): print(scoring_measure, ":\t%f (+/- %f)" % (scores_arr.mean(), scores_arr.std()*2)) # scores_final_rf = cross_validate(final_rf, X_train, y_train, scoring=scoring, cv=5) # for scoring_measure, scores_arr in scores_final_rf...
Python
1
v: &TypeEnv) -> bool { has_type(expr, tenv).map_or(false, |t| t == *typ) } #[derive(Debug, Clone, PartialEq)] pub enum TypeError { CannotResolveType(String), SyntaxUnaryArgumentTypeMismatch(String, String, String), } impl std::fmt::Display for TypeError { fn fmt(&self, f: &mut std::fmt::Formatter) -> ...
Rust
0
\xc7;\x94|\xa4w\xe9\xfc5\xe7\x7f\x10\ \x7fb?\x1b\xcb\x7f\xa6\xea\x9e\x05\xf8\x95>\x92\xb6p\ G\x17\xd9\xe7Vd\x9d{\x9c\xa9\x1dx=\xe8\x946\ \x8af\xd4\xe9a\xe7\xd6\xc7\xba\xe8\xdf\x17\xfc/\xe2\x88\ \x97m\xfd\xbd\xbb+me\x9f\xe4\xe4}y\xeb]\x95\ \xad\xff\x00\x9b\x12\xcbo\xb6X\x9b\xf8\x91\xb7/\xe9^\ -\x7f\xfb9\xf8\xc2\xef\xc1\...
Python
1
rs/')[1].split('.')[0]) #print('Dic. Judge:', code, role) #print() ans2 = code[:4] assert(ans1 == ans2) return { "E/I": {"result": ans1[0], "score": {"E": energy_value, "I": 100 - energy_value}}, "S/N": {"result": ans1[1], "score": {"S": 100 - mind_value, "N": mind_v...
Python
1
..) .ok_or(ParseError::InsufficientData)?; Ok((result, remaining)) } } /// Opcode for the Capable request pub const CAPABLE_REQUEST: u8 = 1; #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub struct CapableRequest; impl CapableRequest { /// Serialize this request into bytes for the provided c...
Rust
0
, n_jobs, n_workers ); let mut as_ratio: f64 = 16.0 / 9.0; let mut i_wid: i32 = 400; let mut i_hit: i32 = (i_wid as f64 / as_ratio) as i32; const SAMPLES: i32 = 3000; //500 const MAXDEEP: i32 = 50; //50 let mut list = Hitlist::new(); let mut lookfrom = Vec3::new(13.0, 2.0, 3.0); l...
Rust
0
from pallas.tools.encoders.octal import OctalEncoder from pallas.tools.encoders.decimal import DecimalEncoder from pallas.tools.encoders.base64 import Base64Encoder from pallas.tools.encoders.hex import HexEncoder from pallas.tools.decoders.octal import OctalDecoder from pallas.tools.decoders.decimal import DecimalDeco...
Python
1
[{ts_sub1_starformattime}]" if ts_sub1_starformattime else "") + "".join( [word.text for word in lyrics_line.words if word.text != ""], ) if ts_sub1_starformattime and lyrics_format == LyricsFormat.VERBATIMLRC: lrc_text += f"[{ts_sub1_starformattim...
Python
1
const DISPID_DOM_DOCUMENTTYPE_ENTITIES: u32 = 132u32; #[doc = "*Required features: 'Win32_Data_Xml_MsXml'*"] pub const DISPID_DOM_DOCUMENTTYPE_NAME: u32 = 131u32; #[doc = "*Required features: 'Win32_Data_Xml_MsXml'*"] pub const DISPID_DOM_DOCUMENTTYPE_NOTATIONS: u32 = 133u32; #[doc = "*Required features: 'Win32_Data_Xm...
Rust
0
; } ScanMode::Normal => { if char == '"' { mode = ScanMode::DoubleQuote; quote_index = index; } else if char == '\\' && cfg!(not(windows)) { mode = ScanMode::Escape; } else if char == '\''...
Rust
0
_tx: &mpsc::UnboundedSender<String> ) { let twitter_token_clone = twitter_token.clone(); let mongo_client_clone = mongo_client.clone(); let analyze_tweets_tx_clone = analyze_tweets_tx.clone(); let _ = task::spawn(async move { while let Some(handle) = process_handle_rx.recv().await { ...
Rust
0
result.append(chr((ord(char) - ord('a') + 13) % 26 + ord('a'))) elif char.isupper(): result.append(chr((ord(char) - ord('A') + 13) % 26 + ord('A'))) else: result.append(char) return "".join(result) "A function to convert rgb value to hexadecimal" def rgbToHexa(*rgb): result = "" # result ...
Python
1
xfe53); keysyms.insert("dead_perispomeni", 0xfe53); keysyms.insert("dead_macron", 0xfe54); keysyms.insert("dead_breve", 0xfe55); keysyms.insert("dead_abovedot", 0xfe56); keysyms.insert("dead_diaeresis", 0xfe57); keysyms.insert("dead_abovering", 0xfe58); keysyms.insert("dead_doubleacute", 0xfe59); keysym...
Rust
0
10 = 9, FFTW_RODFT11 = 10, } #[repr(C)] #[derive(Debug, Default, Copy, Clone, Hash, PartialOrd, Ord, PartialEq, Eq)] pub struct fftw_iodim_do_not_use_me { pub n: ::std::os::raw::c_int, pub is: ::std::os::raw::c_int, pub os: ::std::os::raw::c_int, } #[test] fn bindgen_test_layout_fftw_iodim_do_not_use_me...
Rust
0
"""Sets the isp of this TargetInfoForGetTaskResultOutput. :param isp: The isp of this TargetInfoForGetTaskResultOutput. # noqa: E501 :type: str """ self._isp = isp @property def region(self): """Gets the region of this TargetInfoForGetTaskResultOutput. # noqa: ...
Python
1
'static = ()> = StorageDoubleMap< _, Blake2_128Concat, T::CurrencyId, Blake2_128Concat, T::RewardId, SignedFixedPoint<T, I>, ValueQuery, >; #[pallet::pallet] #[pallet::without_storage_info] pub struct Pallet<T, I = ()>(_); // The pallet's di...
Rust
0
portDispatcher.jobFinished(id(self)) cbFun = stateInfo['cbFun'] cbCtx = stateInfo['cbCtx'] if cbFun: cbFun(self, requestId, None, rspPdu, cbCtx) return wholeMsg def _timerCb(self, timeNow): for requestId, stateInfo in tuple(self._pendingReqs.it...
Python
1
ar from N on /// /// * Before the newer sync, this will be the content of the sources: /// * cache: A, B, D', E, F'', G , H✓, I✓, J✓, M, N✓, O, P' , R /// * server: A, C, D, E', F', G✓, H , I', K✓, M✓, N , O, P✓, Q /// /// Hence, here is the expected result after the sync: /// ...
Rust
0
const LIBRADOS_OP_FLAG_FADVISE_DONTNEED = 32; const LIBRADOS_OP_FLAG_FADVISE_NOCACHE = 64; } } impl AllocFlags { pub fn clear(&mut self) { self.bits = 0; // The `bits` field can be accessed from within the // same module where the `bitflags!` macro was invoked. } } bi...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import os from datetime import datetime, timedelta from flask import Flask, session, request from utils.config import Config from utils.logging_config import setup_logging # 不再需要导入file_manager from models.database import Database from controllers.vocabulary_controller impo...
Python
1
listener) .take(1) .respond_with(|_ctx, request| futures::future::ready(Ok(request))) .unit_error() .boxed() .compat(), ); let conn = tarpc_json_transport::connect(&addr).await?; let client = &mut client::new::<u32, u32, _>(client::Config::default...
Rust
0
# -*- coding: utf-8 -*- """Caliopen cassandra objects related to user.""" from __future__ import absolute_import, print_function, unicode_literals import logging import uuid from cassandra.cqlengine import columns from caliopen_storage.store.model import BaseModel from caliopen_main.pi.objects import PIModel log = ...
Python
1
import os os.system('cls') def remove_vowels(string): vowels = "AEIOUaeiou" result = "" for char in string: if char not in vowels: result += char return result # Get input from user input_string = input("Enter a string: ") output_string = remove_vowels(input_string) # Print output ...
Python
1
} total_battles = 0; } let battles = BATTLES.swap(0, Ordering::Relaxed); fitness[0] += FITNESS_00010.swap(0, Ordering::Relaxed); fitness[1] += FITNESS_11020.swap(0, Ordering::Relaxed); fitness[2] += FITNESS_21030.swap(0, Ordering::Relaxed); fitness...
Rust
0
_dir.normalized()); emission = emission + colour * scene.sample_lights(hit.pos, n1, rng); colour = colour * radiance(scene, &new_ray, depth, rng, false); }, Material::Specular => { let reflection = ray.direction - hit.normal * 2.0 * hit.normal.dot(...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
self.y = (x * s) + (y * c) + center.y; } pub fn copy(&mut self, v: &Vector2) { self.x = v.x; self.y = v.y; } } //! Renders the QR code to different outputs. //! //! Outputs to a string representation and svg are supported. use crate::matrix::{Matrix, Module}; use std::num::ParseIntError; use std::str::From...
Rust
0
' }, 'zillow_properties_listing': { 'dataset_id': 'gd_lfqkr8wm13ixtbd8f5', 'url_patterns': [r'zillow\.com/homedetails/'], 'keywords': ['zillow', 'real estate', 'property listing'], 'required_params': ['url'], 'description': 'Zillow property lis...
Python
1
if config.delete_alias(alias_name): print(f"✅ Alias '{alias_name}' removed") else: print(f"❌ Alias '{alias_name}' not found", file=sys.stderr) sys.exit(1) else: print(f"❌ Unknown alias command: {args[0]}", file=sys.stderr) print(" Available commands:...
Python
1
str=input("Enter a string: ") upper=0 lower=0 for i in range(len(str)): #to lower case letter if(ord(str[i])>=97 and ord(str[i])<=122): lower+=1 #to upper case letter elif(ord(str[i])>=65 and ord(str[i])<=90): upper+=1 print('Lower case letters= ',lower) print('Upper case ...
Python
1
list_of_book = [ '장화홍련전', '가락국 신화', '온달 설화', '금오신화', '이생규장전', '만복자서포기', '수성지', '백호집', '원생몽유록', '홍길동전', '장생전', '도문대작', '옥루몽', '옥련몽', ] rental_list = [ '장생전', '원생몽유록', '이생규장전', '장화홍련전', '수성지', '백호집', '난중일기', '홍길동전', '만복자서포기', ] ...
Python
1
holebody_dataset(data_mode='bottomup') self.assertEqual(len(dataset), 4) self.check_data_info_keys(dataset[0], data_mode='bottomup') # test bottomup testing dataset = self.build_coco_wholebody_dataset( data_mode='bottomup', test_mode=True) self.assertEqual(len(datase...
Python
1
_dash = input.next_unchecked(); let end = self.parse_single_or_escaped_class(input)?; if !end.is_single() { // start is a single char, end is a class; add both individually, and dash. class.add_other(start); ...
Rust
0
result += "趋势:短期上升趋势\n" elif latest['收盘'] < current_ma5 < prev_ma5: result += "趋势:短期下降趋势\n" else: result += "趋势:震荡整理\n" return result except Exception as e: return f"获取港股历史数据失败: {str(e)}" ...
Python
1
[u8; 16]) -> Vec<u8> { // Generate the key encrypting key from the passphrase, caching it in the struct // https://github.com/Haivision/srt/blob/2ef4ef003c2006df1458de6d47fbe3d2338edf69/haicrypt/hcrypt_sa.c#L69-L103 // the reference implementation uses the last 8 (at max) bytes of the salt. Sou...
Rust
0
.0 OR MIT #[kani::proof] fn main() { let mut x = 1; add_two(&mut x); assert!(x == 3); } fn add_two(x: *mut u32) { unsafe { *x += 2; } } use apollo_router::configuration::Configuration; use apollo_router::get_dispatcher; use apollo_router_core::{ prelude::*, Context, Object, PluggableRou...
Rust
0
{ quote! { static CELL: #bevy_reflect_path::utility::NonGenericTypeInfoCell = #bevy_reflect_path::utility::NonGenericTypeInfoCell::new(); CELL.get_or_set(|| { #generator }) } }; let (impl_generics, ty_generics, where_clause) = generics.split_f...
Rust
0
android.com/reference/android/icu/util/Calendar.WeekData.html#firstDayOfWeek) pub fn firstDayOfWeek<'env>(&'env self) -> i32 { unsafe { let env = __jni_bindgen::Env::from_ptr(self.0.env); let (class, field) = env.require_class_field("android/icu/util/Calendar$WeekData...
Rust
0
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> { let this = self.project(); match Fs::poll(this.completion, this.futures, this.outputs, cx) { Poll::Pending => Poll::Pending, Poll::Ready(()) => Poll::Ready(unsafe { //SAFETY: Validity of this operation is directly required by [`J...
Rust
0
s-thread awakener, used by `Awakener`. //! - `Signals`: process signal handler, used in `Signals`. #[cfg(unix)] mod unix; #[cfg(unix)] pub use self::unix::*; /// Size of stack allocated system events array. const EVENTS_CAP: usize = 128; use crate::Vector; use core::ops::{Mul, Sub}; use num_traits::Zero; impl<T> Ve...
Rust
0
s_ref() { "tcp_listen" => { let port = file .port .expect("Config file `tcp_listen` has no `port` field set"); let addr = file.addr.clone().unwrap_or_else(|| ":::".to_string()); let stdlistener = ...
Rust
0
return used_tags def _extract_emotional_tags(self, emotional_dim: Dict, used_tags: Dict, search_strategy: Dict): """提取情感相关的使用标签""" if emotional_dim.get('subcategories'): # 新的二级标签结构 for sub_key, subcategory_data in emotional_dim['subcategories'].items(): ...
Python
1
(global)).ok().unwrap(); } pub(crate)fn reset(&self, defaults: bool)->bool{//true if initialized suspended self.set_stop_reason(if self.start_suspended && defaults {StopReason::Suspended} else {StopReason::None}); self.get_flags().set_runnable_relaxed(true); self.start_suspended } ...
Rust
0
feed(2), (10 + 20 + 2) / 3); assert_eq!(a.feed(100), (10 + 20 + 2 + 100) / 4); assert_eq!(a.feed(111), (10 + 20 + 2 + 100 + 111) / 5); assert_eq!(a.feed(200), (20 + 2 + 100 + 111 + 200) / 5); assert_eq!(a.feed(250), (2 + 100 + 111 + 200 + 250) / 5); assert_eq!(a.feed(-25), (100 +...
Rust
0
rng: StdRng, solves_per_thread: usize, thread_num: usize, } impl ThreadData { fn from_seed(seed: [u8; 32], solves_per_thread: usize, thread_num: usize) -> ThreadData { ThreadData { best_log_probabilities: Vec::new(), best_total_log_probability: f32::NEG_INFINITY, ...
Rust
0
") { Some(v) => Some(String::from_str(v.to_str().unwrap()).unwrap()), None => None, }; output.ssekms_key_id = match response.headers().get("x-amz-server-side-encryption-aws-kms-key-id") { ...
Rust
0
#!/usr/bin/env python3 # Copyright (C) 2024 Checkmk GmbH - License: GNU General Public License v2 # This file is part of Checkmk (https://checkmk.com). It is subject to the terms and # conditions defined in the file COPYING, which is part of this source code package. """Redfish temperature checks""" from cmk.agent_bas...
Python
1
from setuptools import find_packages, setup import os from glob import glob package_name = 'frenet_odom_republisher' setup( name=package_name, version='0.0.0', packages=[package_name], data_files=[ ('share/ament_index/resource_index/packages', ['resource/' + package_name]), ...
Python
1
} } impl From<VecM::<u8>> for Uint514 { #[must_use] fn from(x: VecM::<u8>) -> Self { Uint514(x) } } impl AsRef<VecM::<u8>> for Uint514 { #[must_use] fn as_ref(&self) -> &VecM::<u8> { &self.0 } } impl ReadXdr for Uint514 { #[cfg(feature = "std")] fn read_xdr(r: &mut...
Rust
0
count); let store = Rc::new(RefCell::new(Store::new(state))); store.borrow_mut().msg(&Msg::SetPath(path)); let router = make_router(Rc::clone(&store)); store.borrow_mut().set_router(Rc::clone(&router)); App { store, router } } pub fn from_state_json(json: &str) -> Ap...
Rust
0
{0xd1f46578ec96ee3c, "u7u6by7dkvr3", 66.611895402, 17.264541819}, {0x00c3f6566ef36c50, "031zdpmfyeq5", -83.016325168, -166.192988382}, {0x62809327e37dd7e3, "db0969z3grcy", 0.229682641, -55.426913403}, {0x85e0b112587c75e8, "hrhc24ksgjuy", -50.392066561, 17.936002645}, {0xe1e74c5b6dbd87c9,...
Rust
0
s. If you # find a slight drop in performance, you can set a larger # `nms_pre` than before. score_thr = cfg.get('score_thr', 0) results = filter_scores_and_topk( scores, score_thr, nms_pre, dict(bbox_pred=bbox_pred, priors=priors)) ...
Python
1
for {} {{ fn into_dart(self) -> support::DartCObject {{ vec![ {} ].into_dart() }} }} impl support::IntoDartExceptPrimitive for {} {{}} ", s.name, body, s.name, ) }...
Rust
0
self.buf.read(total_bytes) # convert raw data to image try: mask = Image.frombuffer( "1", # 1 bpp im.size, # (w, h) mask_data, # source chars "raw", # raw decoder ...
Python
1
it; use ed25519_zebra::{ Signature, SigningKey as Ed25519PrivateKey, VerificationKey as Ed25519PublicKey, }; use ucan::crypto::KeyMaterial; pub const ED25519_MAGIC_BYTES: [u8; 2] = [0xed, 0x01]; pub fn bytes_to_ed25519_key(bytes: Vec<u8>) -> Result<Box<dyn KeyMaterial>> { let public_key = Ed25519PublicKey::...
Rust
0
RefCell::new(None)); /// Register a `DispatchPool` on the calling thread. /// /// Any prior instance is returned. This consumes the pool by value, but it can /// be cloned beforehand to preserve an owned handle. pub fn register_dispatch_pool(pool: DispatchPool) -> Option<DispatchPool> { POOL.with(|p| p.replace(So...
Rust
0
#EXERCÍCIO 58: Melhore o jogo do DESAFIO 028 onde o computador vai "pensar" em um número entre 0 e 10. Só que agora o jogador vai tentar adivinhar até acertar, mostrando no final quantos palpites foram necessários para vencer. from time import sleep from random import randint num = int(input('escolha um número de 0 à ...
Python
1
import pytest from upstash_redis import Redis @pytest.fixture(autouse=True) def flush_sorted_set(redis: Redis): sorted_set = "sorted_set" redis.delete(sorted_set) yield redis.delete(sorted_set) def test_zadd(redis: Redis): sorted_set = "sorted_set" # Add members with their respective score...
Python
1
# # elbow_distance = 0.4 # # elbow_torso_distance = 0.4 # # contact # feet_contact_forces = -0.01 # # vel tracking # tracking_lin_vel = 0. # tracking_ang_vel = 0. # vel_mismatch_exp = 0.5 # lin_z; ang x,y # low_speed = 0...
Python
1
POLICY { fn clone(&self) -> Self { *self } } #[doc = "*Required features: `\"Win32_System_Power\"`*"] pub type POWER_ACTION_POLICY_EVENT_CODE = u32; #[doc = "*Required features: `\"Win32_System_Power\"`*"] pub const POWER_FORCE_TRIGGER_RESET: POWER_ACTION_POLICY_EVENT_CODE = 2147483648u32; #[doc = "*Req...
Rust
0
maximum extra number of cycles to get a valid image. Default: 1000. """ METAINFO: dict = dict(from_file='configs/_base_/datasets/aic2goliath.py') def parse_data_info(self, raw_data_info: dict) -> Optional[dict]: """Parse raw COCO annotation of an instance. Args: ra...
Python
1
"] pub type IRQ_MASKS = i32; pub use self::IRQ_MASKS as IRQ_MASK; #[doc = "< I2C interrupt mask (DSi ARM7)"] pub const IRQ_I2C: IRQ_MASKSAUX = 64; #[doc = "< Sdmmc interrupt mask (DSi ARM7)"] pub const IRQ_SDMMC: IRQ_MASKSAUX = 256; #[doc = "! values allowed for REG_AUXIE and REG_AUXIF"] pub type IRQ_MASKSAUX =...
Rust
0
number of entries (`capacity`) and /// `max_chunk_length`. Any chunks longer than `max_chunk_length` will not /// be cached. The maximum memory usage of this cache can be calculated as /// `capacity * max_chunk_length`, although the actual memory usage will /// likely be much smaller as many chunks are...
Rust
0
n get_info() -> &'static MemoryInfo { unsafe { MEM_INFO.assume_init_mut() } } /// Prints the memory mapping. pub fn print_entries() { let mem_info = get_info(); debug_assert!(!mem_info.memory_maps.is_null()); crate::println!("--- Memory mapping ---"); crate::println!("<begin> <end> <type>"); let mut t = mem...
Rust
0
mple_data/Euro2k_json' # ext = 'json' # def listFD(url, ext=''): # page = requests.get(url).text # soup = BeautifulSoup(page, 'html.parser') # return [url + '/' + node.get('href') for node in soup.find_all('a') if node.get('href').endswith(ext)] # files = [] # github_url = 'htt...
Python
1
lueError("Invalid resource type") def can_write_practitioner_booking(self, obj, user, facility): facility_orgs = FacilityOrganizationUser.objects.filter( user=obj, organization__facility=facility ).values("organization__parent_cache", "organization_id") cache = [facility.default...
Python
1
# Copyright 2021 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
full")] pub fn fold_generic_method_argument<F>( f: &mut F, node: GenericMethodArgument, ) -> GenericMethodArgument where F: Fold + ?Sized, { match node { GenericMethodArgument::Type(_binding_0) => { GenericMethodArgument::Type(f.fold_type(_binding_0)) } GenericMethodA...
Rust
0
""" phi.py Class definition for all LLMs derived from PhiForCausalLM. """ from typing import Optional, Sequence, Type import torch from torch import nn as nn from transformers import PhiForCausalLM from transformers.models.phi.modeling_phi import PhiDecoderLayer from models.backbones.llm.base_llm import HFCausalLLMB...
Python
1
_is_even_script_tx, &issue_tx]).unwrap(); let genesis_block = BlockBuilder::default() .transaction(load_is_even_script_tx) .transaction(issue_tx.clone()) .compact_target(DIFF_TWO.pack()) .dao(dao) .build(); let consensus = ConsensusBuilder::default() .cellbase_m...
Rust
0
sim_path = os.path.join(datadir, sim) fname = os.path.join(sim_path, "TwoPunctures.bbh") bbh_meta = parse_nr_metadata(fname) M1 = bbh_meta["initial-bh-puncture-adm-mass1"] M2 = bbh_meta["initial-bh-puncture-adm-mass2"] D = abs(bbh_meta["initial-bh-position1x"] - bbh_meta["initial...
Python
1
SetDistance(3250, 0) OP_6C(322000, 0) OP_6E(345, 0) OP_0D() ChrTalk( 0x0008, ( '#2440340958V#3S射击!', TxtCtl.Enter, ), ) OP_7C(0, 200, 3000, 100) CloseMessageWindow() CreateThread(0x0101, 0x01, 0x00, func_0C_1D02) Sleep(100) Creat...
Python
1
direction = command_split[0]; let magnitude: i32 = (*command_split[1]) .parse() .expect("Error parsing magnitude"); match direction { "forward" => horizontal_pos += magnitude, "up" => vertical_pos -= magnitude, "down" => vertical_pos += magnit...
Rust
0
/ Loope_rel8_16_CX 0x0000_00E1,// Loope_rel8_32_CX 0x0000_00E1,// Loope_rel8_16_ECX 0x0000_00E1,// Loope_rel8_32_ECX 0x0000_00E1,// Loope_rel8_64_ECX 0x0000_00E1,// Loope_rel8_16_RCX 0x0000_00E1,// Loope_rel8_64_RCX 0x0000_00E2,// Loop_rel8_16_CX 0x0000_00E2,// Loop_rel8_32_CX 0x0000_00E2,// Loop_rel8_16_ECX ...
Rust
0
e.base_dtype) lr = (lr_t * math_ops.sqrt(1 - beta2_power) / (1 - beta1_power)) # \\(m := beta1 * m + (1 - beta1) * g_t\\) m = self.get_slot(var, "m") m_t_slice = beta1_t * array_ops.gather(m, indices) + (1 - beta1_t) * grad m_update_op = resource_variable_ops.resource_scatter_update(m.handle, ...
Python
1
of // the Software, and to permit persons to whom the Software // is furnished to do so, subject to the following // conditions: // // The above copyright notice and this permission notice // shall be included in all copies or substantial portions // of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WAR...
Rust
0
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = "j. F Y" TIME_FORMAT = "G:i" DATETIME_FORMAT = "j. F Y G:i" YEAR_MONTH_FORMAT = "F Y" MONTH_DAY_FORM...
Python
1
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # from lcm.datasets.sentence_splitting import ( ResplitSentenceSplitter, deescape_special_chars, filter_empty_string, remove_emojis, remove_non_printable_chars, resplit, ) def test_remove_emojis(): assert remov...
Python
1
import os import subprocess import torch import torch.distributed as dist def setup_distributed(backend="nccl", port=None): """AdaHessian Optimizer Lifted from https://github.com/BIGBALLON/distribuuuu/blob/master/distribuuuu/utils.py Originally licensed MIT, Copyright (c) 2020 Wei Li """ num_gpus...
Python
1
# AutoInput Core Module # 공통 핵심 로직과 기본 클래스들 __version__ = "1.0.0" __author__ = "AutoInput Team" from .base.scraper import BaseScraper from .base.authenticator import BaseAuth from .base.browser import BrowserManager from .utils.patterns import PatternMatcher __all__ = [ 'BaseScraper', 'BaseAuth', 'Brows...
Python
1
glob::GlobError) -> Self { LdSoConfError::Glob(e) } } /// Parse the `ld.so.conf` file on Linux pub fn parse_ld_so_conf( path: impl AsRef<Path>, root: impl AsRef<Path>, ) -> Result<Vec<String>, LdSoConfError> { let path = path.as_ref(); let root = root.as_ref(); let conf = fs::read_to_s...
Rust
0
work_cmd.append('1') if not xml_found: work_cmd.append('-xml-input') work_cmd.append(xml_input) if n_best_out: work_cmd.append('-n-best-list') work_cmd.append(os.path.join(work_dir, 'nbest.{}'.format(i))) work_cmd.append(str(n_best_size)) ...
Python
1
self.polys.iter().map(|it| -> &'a dyn CollidableWrapperTrait{it}) .chain(self.lines.iter().map(|it| -> &'a dyn CollidableWrapperTrait{it})) .chain(self.circles.iter().map(|it| -> &'a dyn CollidableWrapperTrait{it})) .chain(self.points.iter().map(|it| -> &'a dyn CollidableWrappe...
Rust
0
rch = self.configer.sub_arch from lib.models.backbones.hrt.hrt_config import MODEL_CONFIGS if arch == "vit_base": arch_net = vit_base_patch16(pretrained=False, load_pos_embed=True) # arch_net.init_weights(self.configer.pretrained_backbone) if self.configer.pretrain...
Python
1
cargo::print_warning(format_args!( "esp-idf version ({major}.{minor}.{patch}) not officially supported by `esp-idf-sys`. \ Supported versions are 'master', 'release/v4.4', 'release/v4.3', 'v4.4(.X)', 'v4.3.2'.", )); &[] } E...
Rust
0
es_declaraciones("entero nombre;") { /// Ok((next_input, res)) => res, // parseo éxitoso /// Err(err) => err, // error en parseo /// }; /// ``` pub fn variables(input: &str) -> IResult<&str, &str> { tuple((ws, alt((variable_normal, variable_compuesta)), ws, tag(";"), ws)) (input) .map(|(next_input, _res)| { ...
Rust
0
mp dev = event['dev'] sector = event['sector'] nr_sector = event['nr_sector'] tid = event['tid'] # An even rwbs indicates read operation, odd indicates write if event['rwbs'] % 2 == 0: operation = IORequest.OP_READ else: operation = IOReque...
Python
1
episode + 1) % 25 == 0: rate = rate / 25.0 vis.plot("success_rate", rate) if rate >= max_rate: agent.save(f"D:/book/first semester/IRMAC/20240318/DRL-on-robot-arm-master/result/{rate}") max_rate = rate ...
Python
1
uts.len(), witnesses.len(), &layers); let (proof, output) = ZKLinearGKRProof::prover::<_>(&params, &circuit, &inputs, &witnesses, rng); let p_time = p_start.elapsed(); println!("[Libra] Prove time : {:?}", p_time); let mut proof_bytes = vec![]; proof.serialize(&mut proof_bytes).unwrap...
Rust
0
import numpy as np def mapping(x_adim,y_adim): x_step = x_adim # x yönünde x birim ilerlendiğinde yeni harita y_step = y_adim # y yönünde y birim ilerlendiğinde yeni harita matris_dosya="sonuc_matrisi.txt" lidar_dosya="veri.txt" # Dosyayı oku with open(matris_dosya, "r") as dosya: sat...
Python
1
(); if can_add { top_level_names.insert(top_level_name); } } top_level_names } pub(crate) fn is_a_parent_of<P: AsRef<Path>>(parent: P, child: P) -> bool { let parent = parent.as_ref(); let child = child.as_ref(); child.starts_with(parent) && !parent.starts_with(child) }...
Rust
0
Arc::new(prog.externals.clone()), } } } impl From<capnp::Error> for expressions::Error { fn from(err: capnp::Error) -> expressions::Error { err.to_string().into() } } impl From<async_std::future::TimeoutError> for expressions::Error { fn from(_err: async_std::future::TimeoutError) -> ...
Rust
0