text
string
label_name
string
labels
int64
} #[cfg(feature = "atsam4e")] MainClock::Crystal12Mhz => { switch_main_clock_to_external_12mhz(pmc); #[cfg(feature = "usb")] { // Set up the PLL for 240MHz operation (12 MHz * (20 / 1) = 240 MHz) // 240 MHz can be used to gener...
Rust
0
import io import pytest from pandas.compat._optional import import_optional_dependency import pandas as pd import pandas._testing as tm from pandas.tests.io.excel import xlrd_version from pandas.util.version import Version from pandas.io.excel import ExcelFile from pandas.io.excel._base import inspect_excel_format ...
Python
1
# Enter your code here. Read input from STDIN. Print output to STDOUT en_num = int(input()) en_set = map(int, input().split()) fr_num = int(input()) fr_set = list(map(int, input().split())) count = 0 for num in en_set: if num not in fr_set: count += 1 print(count)
Python
1
ring(format!("logs/{}/{}", krate.name, krate.version)) { // Skip crates if a log exists and rerun-when=never if let RerunWhen::Never = args.rerun_when { return false; } let previous_lockfile = contents.rsplit("cat Cargo.loc...
Rust
0
() array([[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], dtype=int8) >>> # Constructing a matrix using ijv format >>> row = np.array([0, 3, 1, 0]) >>> col = np.array([0, 3, 1, 2]) >>> data = np.array([4, 5, 7, 9]) >>> coo_matrix((data, (row, col)), shape=(4, 4)).toarray() ...
Python
1
rary::arbitrary(g)), _ => unreachable!() } } } impl fmt::Debug for Message { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_tuple("Message") .field(&self.0) .field(&hex::encode(&self.1)) .finish() } } impl Arbitrary for Messag...
Rust
0
"0.1 -c select 1;", cur=cur) assert not clear_mock.called next(watch_gen) assert clear_mock.called clear_mock.reset_mock() next(watch_gen) assert clear_mock.called clear_mock.reset_mock() @dbtest def test_watch_query_bad_arguments(): """Test different incorr...
Python
1
"""CLIP/BERT 임베딩과 촉각 잠재벡터를 결합하는 단순 융합 모듈.""" from typing import Any, Mapping import numpy as np import torch import torch.nn.functional as F from .embedders import VTCEmbedder from app.utils.path import ModelPathsDict from .tactile import load_tactile_encoder class ConcatenationFusion: """이미지·텍스트·촉각 임베딩을 단순 결합...
Python
1
attach(api_handler::WakeUpDbConn::fairing()) .attach(rocket_cors::CorsOptions::default() .allowed_origins(AllowedOrigins::some_exact(&[ "http://localhost:8080", "https://owly.duckdns.org", ])) .to_cors() .expect("Error while configu...
Rust
0
um_rounded_up :usize = last_octet_partial + $octetnum; let bit_cursor_after = ($selfarg.bit_cursor + $bitnum) % 8; if ($selfarg.bit_cursor + $bitnum) as usize > 8 * octetnum_rounded_up { /*println!("Reading {} bits (octetnum={}, last_partial={}, total_touched={}+1)", $bitnum, $octetnum, last_octet_partial, ...
Rust
0
-counter pub num_null_check: c_int, // OP_NULL_CHECK_START/END id counter pub num_comb_exp_check: c_int, // combination explosion check pub num_call: c_int, // number of subexp call pub capture_history: c_uint, // (?@...) flag (1-31) pub bt_mem_start: c_uint, // need backtrack f...
Rust
0
Module::create(Origin::signed(account_id))); assert_noop!(KittiesModule::breed(Origin::signed(other_account_id), parent1_kitty_id, parent2_kitty_id), Error::<Test>::NotEnoughBalanceForStaking); }); } #[test] fn sell_works() { new_test_ext().execute_with(|| { let account_seller: u64 = 1; let kitty_id =...
Rust
0
ize, ConsolidatedTapeAssociation = b'9' as isize, ExchangeSymbol = b'8' as isize, IsoCountryCode = b'7' as isize, IsoCurrencyCode = b'6' as isize, RicCode = b'5' as isize, IsinNumber = b'4' as isize, Common = b'G' as isize, } impl FIXValue for SecurityIDSource { fn from_bytes(bytes: &[u...
Rust
0
nt<'info, StakingCounter>, #[account(mut, seeds=[PREFIX.as_bytes(), args.artifact_class_mint.as_ref(), args.artifact_mint.as_ref(), &args.index.to_le_bytes(), &staking_mint.key().as_ref()], bump=args.artifact_mint_staking_bump)] artifact_mint_staking_account: UncheckedAccount<'info>, #[account(mut, constrai...
Rust
0
= Point3::from_homogeneous(v2_vp).unwrap(); for i in 0..height { for j in 0..width { let pixel = Point3::new((i as f32) + 0.5, (j as f32) + 0.5, 0.0); let mut w = raster::barycentric_coords(&v0, &v1, &v2, &pixel); if (w[0] >= 0.0) && (w[1] >= 0.0) &&...
Rust
0
lphas_cumprod_t = extract(self.sqrt_one_minus_alphas_cumprod, t, x.shape) sqrt_alphas_cumprod_t = extract(self.sqrt_alphas_cumprod, t, x.shape) sqrt_alphas_cumprod_t_m_1 = torch.sqrt(extract(self.alphas_cumprod_prev, t, x.shape)) sqrt_one_minus_alphas_cumprod_t_m_1 = torch.sqrt(1 - extract(self....
Python
1
} rc.fill(alive, &self.live_brush); let mut grid = BezPath::new(); for row in 0..=self.height { let y = (row as f32 * cell_height) + 1.; self.start_point.x = 0.; self.start_point.y = y as f64; self.end_point.x = self.pixel_width as f64; ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Pyrate - Optical raytracing based on Python Copyright (C) 2014-2020 by Moritz Esslinger moritz.esslinger@web.de and Johannes Hartung j.hartung@gmx.net and Uwe Lippmann uwe.lippmann@web.de and Th...
Python
1
re(self) def duplicates_store(self): return MongoDuplicatesStore(self) def conversation_store(self): return MongoConversationStore(self) def sets_store(self): return MongoSetsStore(self) def maps_store(self): return MongoMapsStore(self) def rdf_store(self): ...
Python
1
write_bars_test(source, "L:1/4\n[=C=E=G]z3|\n", 4); } #[test] fn triplet_chords() { // TODO(claire): This and similar tests should be able to be expressed as a single triplet of 1/2 notes let source = "voice A {} play A { :| C C C ; :| E E E ; :| G G G }"; write_bars_test(sour...
Rust
0
(wai, stu, Some((17.0, vec![vec![wai, stu]]))), // end (end, opp, Some((30.0, vec![vec![end, bac, opp]]))), (end, bac, Some((22.0, vec![vec![end, bac]]))), (end, wai, Some((8.0, vec![vec![end, wai]]))), (end, end, Some((0.0, vec![vec![]]))), (end, dea, Some((23.069, vec...
Rust
0
#!/usr/bin/python # # Copyright (c) 2015 EMC Corporation # All Rights Reserved # import zk_utils import argparse import sys import os CONFIG_KIND = '/config' DT_CONFIG_KIND = 'DT_KIND_CONFIG' # TODO: move all to 'ObjectService' folder? DATA_SVC_KIND = 'DataSvc' DATA_SERVICE_KIND = 'DataService' OBJECT_SERVICE_KIND =...
Python
1
alizedFaker<V> where V: AsSqlValue, { fn transform_with_faker(&self) -> TransformResult { Ok(Some(V::sql_value(self.localized_fake()))) } fn set_defaults_for_faker(&mut self, defaults: &TransformerDefaults) { if self.locale().is_none() { self.set_locale(Some(defaults.locale)...
Rust
0
ize = "frameStyle6")] FrameStyle6, /// Soft Edge Photo Frame #[strum(serialize = "frameStyle7")] FrameStyle7, } /// This simple type determines if the Embedded object is re-colored to reflect changes to the color schemes. #[derive(Debug, Clone, Copy, PartialEq, EnumString)] pub enum OleObjectFollowColo...
Rust
0
assert!(config.window_time() == 300); config.set_window_time(500); config.set_limit(100); config.set_ip_addr_limit(25); assert!(config.window_time() == 500); assert!(config.limit() == 100); assert!(config.ip_addr_limit() == 25); } } textgen.ListNode textgen.MarkovTe...
Rust
0
ddress); self.add_cycles(CALL_EXTRA_CYCLES); } } fn call_if_parity_even(&mut self, address: u16) { if self.read_flag(Intel8080Flag::Parity) { self.call(address); self.add_cycles(CALL_EXTRA_CYCLES); } } fn call_if_parity_odd(&mut self, address...
Rust
0
) ) if role.dept_check_strictly else True, ) .order_by(SysDept.parent_id, SysDept.order_num) ) ) .scalars() .all() ) return role_...
Python
1
::<Iban>("iban", obj); let balance = extract_value::<u128>("balanceCL", obj); Self::new( iban, balance, 0 ) }, _ => return None, }; Some(iban_account) } } /// Unpeq request template /// /// # Arguments /// /// `account_id` - Sender of the unpeq request /// `amount`...
Rust
0
let account_handle = crate::block_on(async { self.account_manager.get_account(account_id).await })?; Ok(AccountHandle { account_handle }) } /// Gets the account associated with the given identifier. fn get_accounts(&self) -> Result<Vec<AccountHandle>> { let account_handles = crate::...
Rust
0
import sqlite3 def criar_conexao(): conexao = sqlite3.connect("DataBase.db") return conexao def executar(comando): try: with criar_conexao() as conexao: cursor = conexao.cursor() cursor.execute(comando) except sqlite3.Error as e: print(f"Erro ao executar o {coma...
Python
1
import pj2_clfs_zhihu.config as conf import numpy as np import word2vec def emb2npz(emb_file_path, emb_dict_path): """将txt格式的embedding转为字典格式, 并将<PAD>和<UNK>加入""" emb = word2vec.load(emb_file_path) vec = emb.vectors word2id = emb.vocab_hash word2id['<PAD>'] = len(word2id) pad_row = [0] * vec.sh...
Python
1
=WORK_RAM_ACTIVE_BANK_END => Ok( MappedAddress::WorkRamActiveBank(addr - WORK_RAM_ACTIVE_BANK_START), ), ECHO_RAM_START..=ECHO_RAM_END => { error!("Attempted to access echo RAM {:#06X}", addr); Err(()) } SPRITE_ATTRIBUTE_TABLE_START..=SPRITE_ATTRIBUTE_...
Rust
0
import pandas as pd from dotenv import load_dotenv # Load variables from .env file load_dotenv() csv_path = "data/raw/customers-10000.csv" df = pd.read_csv(csv_path) print(df.shape) from langchain_experimental.agents.agent_toolkits import create_pandas_dataframe_agent from langchain_openai import ChatOpenAI llm =...
Python
1
(rwlock) => match rwlock.into_inner() { Ok(u) => Ok(u), Err(_) => Err(PoisonedThreadError::default()), }, Err(_) => Err(PoisonedThreadError::default()), } } } pub trait BatchSpawnable<ReturnValue:Send+'static, ExtraInput:Send+'static, ...
Rust
0
fn default() -> GridFlow { GridFlow::Unset } } /// template rule in `Grid` columns an rows pub enum GridTemplate { FitContent(Unit), Inherit, Initial, MinMax(Unit, Unit), None, Plain(Vec<Unit>), Repeat(i32, Unit), SubGrid, Unset, } impl Default for GridTemplate { ...
Rust
0
import spacy import numpy as np # Carrega o modelo de linguagem do spaCy para o português nlp = spacy.load("pt_core_news_lg") # Frases que serão analisadas doc1 = nlp("Cachorros gostam de brincar no parque.") doc2 = nlp("Cachorros gostam de brincar no parque.") # Função para calcular a similaridade do cosseno entre ...
Python
1
impl ::core::marker::Copy for USER_MODALS_INFO_1006 {} impl ::core::clone::Clone for USER_MODALS_INFO_1006 { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub struct USER_MODALS_INFO_1007 { pub usrmod1007_primary: ::window...
Rust
0
import unicodedata import string import contextlib __all__ = ('BannedWords',) class BannedWords: def filtre_message(self, message, encoding): """filter characters of the specified encoding from the message""" return unicodedata.normalize('NFD', message).encode(encoding, 'ignore').decode("utf8").s...
Python
1
Task>>, task_queue: Arc<SegQueue<TaskId>>, task_cache: Arc<Mutex<BTreeMap<TaskId, &'a Task>>>, marker: core::marker::PhantomData<&'a ()>, } impl<'a> Executor<'a> { pub fn new() -> Self { Self { tasks: UnsafeCell::new(Vec::new()), task_queue: Arc::new(SegQueue::new()),...
Rust
0
.rate(102400u64) .build() .unwrap()]) .build() .unwrap(); Io::apply(&tmp, &blkio).expect("apply blkio"); let content = fs::read_to_string(throttle).unwrap_or_else(|_| panic!("read riops content")); assert_eq!("8:0 riops=102400", c...
Rust
0
import cv2 import numpy as np import argparse import matplotlib import time import os from gtts import gTTS from playsound import playsound import pygame pygame.mixer.init() score=0 # Opencv DNN net = cv2.dnn.readNet("dnn_model\yolov4-tiny.cfg", "dnn_model\yolov4-tiny.weights") model = cv2.dnn_DetectionModel(net) m...
Python
1
#!/usr/bin/env python # coding: utf-8 # In[ ]: class employe: def __init__(self,nom,prenom,salaire): self.__nom=nom self.__prenom=prenom self.__salaire=salaire @property def nom(self): return self.__nom @nom.setter def nom(self,nom): self.__nom=nom @property def prenom(self): re...
Python
1
import hashlib import hmac import random import time from base64 import urlsafe_b64encode, urlsafe_b64decode from django.conf import settings __all__ = [ 'get_signed_message', 'get_valid_message', ] ### HMAC signed messages # Messages are signed using installation secret. # # Signature is calculated from cu...
Python
1
import os import tempfile import re import argparse from tqdm import tqdm parser = argparse.ArgumentParser() parser.add_argument("--txt", type=str) parser.add_argument("--lid", type=str) parser.add_argument("--dst", type=str) parser.add_argument("--model", type=str) args = parser.parse_args() UROMAN_PL = args.model +...
Python
1
k1` /// /// `VEX.L0.F2.0F.W0 93 /r` /// /// `AVX512BW` /// /// `16/32/64-bit` VEX_Kmovd_r32_k, /// `KMOVQ r64, k1` /// /// `VEX.L0.F2.0F.W1 93 /r` /// /// `AVX512BW` /// /// `64-bit` VEX_Kmovq_r64_k, /// `KORTESTW k1, k2` /// /// `VEX.L0.0F.W0 98 /r` /// /// `AVX512F` /// /// `16/32/64-bit` VEX_...
Rust
0
bool { if self.win_number.is_some() { return true; } for line in self.tiles.iter_mut() { for tile in line { if tile.num == num { tile.marked = true; break; } } } let bing...
Rust
0
# Copyright (c) 2021, Sangchun Ha. 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 applicable la...
Python
1
::operation_deser::parse_get_findings_report_account_summary_error(response) } else { crate::operation_deser::parse_get_findings_report_account_summary_response(response) } } } /// <p>Get the current configuration for anomaly notifications for a profiling group.</p> #[derive(std::defaul...
Rust
0
pi_id = request.data.get('upi_id', None) # Make UPI ID optional user = User.objects.get(id=user_id) # Create payment transaction transaction = PaymentTransaction.objects.create( user=user, razorpay_order_id=razorpay_order_id, razorpay_paymen...
Python
1
buf.put_u8(3)), FromWrite::Error(c) => { buf.put_u8(4); <Chars as Pack>::encode(c, buf) } } } fn decode(buf: &mut impl Buf) -> Result<Self> { match buf.get_u8() { 0 => Ok(FromWrite::Published), 1 => Ok(FromWrite::Un...
Rust
0
s: Any) -> int: for handler in logging.root.handlers[:]: logging.root.removeHandler(handler) logging.basicConfig(stream=sys.stdout, format='%(levelname)-4s: [%(asctime)s] %(filename)s:%(lineno)-03s:\t%(message)s', datefmt='%Y%m%d-%H:%M:%S', ...
Python
1
chairmen' import f8s01nl9ngf as azh30pd8tzc, ggt3s8_ug8d raise None '# swamp_constitution_multisystem -> capacitors_ticks_chairmen' '# swamp_constitution_multisystem -> capacitors_ticks_chairmen' global e5ybb_b4370 del hs87all1a4_ from ynk5d9nm61s import af2al4z6lia, y02fswv12c2 as wjfyxqtl0...
Python
1
if enumeration.get_conformers(): # default running mode is to score incoming conformers without changing their configurations for conformer in enumeration.get_conformers(): all_conformers.append(conformer) else: all_con...
Python
1
import winsound import loguru class SoundUtils: @staticmethod def play_sound(sound_file: str): """ Play a sound file using the winsound module. :param sound_file: Path to the sound file. """ try: winsound.PlaySound(sound_file, winsound.SND_FILENAME) ...
Python
1
= Button(text='Search',command=find_password,width=8,foreground=THREE,background=ONE,font=F) # To search about the website's password Search.grid(row=1,column=2) Submit = Button(text='Submit',command = display,width=39,foreground=THREE,background=ONE,font=F) #submi...
Python
1
for acceptance, i.e., probability to accept a markov step from Energy E to Energy E_new is min[1.0, exp{m_beta * (E_new - E)}] | /// | `step_size` | is used for each markov step, i.e., `ensemble.m_steps(stepsize)` is called | /// /// * will return Err if `energy` is nan or `m_beta` is not finite p...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (c) 2021 Intel Corporation # # 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 # # Unl...
Python
1
----- graph : scipy.sparse.csr_matrix Input graph existing_edges : set Set of existing edges as (i,j) where i < j Returns: -------- list List of new 2-hop edges as (i,j) where i < j """ n = graph.shape[0] new_edges = [] # For each node i for ...
Python
1
# Inference code generated from the JSON schema spec in @huggingface/tasks. # # See: # - script: https://github.com/huggingface/huggingface.js/blob/main/packages/tasks/scripts/inference-codegen.ts # - specs: https://github.com/huggingface/huggingface.js/tree/main/packages/tasks/src/tasks. from dataclasses import d...
Python
1
ox::new(VMError::CantRepresentAsDouble)), } } else { Err(Box::new(VMError::NotANumber { got: other.dyn_objtype(vm), })) } } fn double_div(&self, vm: &VM, other: Val) -> Result<Val, Box<VMError>> { if let Some(rhs) = other.as_isize(vm) ...
Rust
0
# # Copyright 2021-2023 Basislager Services # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distri...
Python
1
import torch import torch.nn.functional as F import numpy as np from dice_loss import dice_coeff import scipy.io as io import torchvision from PIL import Image #from torch.utils.tensorboard import SummaryWriter from Metrics import accuracy_score from Metrics import diceCoeff_avr from Metrics import diceCoeff_panck fro...
Python
1
fahrtrichtung, Zweileiter::KonstanteSpannung { fahrtrichtung, .. } => fahrtrichtung, }; Ok(fahrtrichtung.einstellen(neue_fahrtrichtung.into())?) } pub fn umdrehen(&mut self) -> Result<(), Error> { self.geschwindigkeit(0)?; sleep(STOPPZEIT); let fahrtrichtung...
Rust
0
_index_t; if (*l_cstr_index).tile_index.is_null() { opj_free((*l_cstr_index).marker as *mut libc::c_void); opj_free(l_cstr_index as *mut libc::c_void); return 0 as *mut opj_codestream_index_t; } if (*(*p_j2k).cstr_index).tile_index.is_null() { opj_free((*l_cstr_index).tile_index as *mut libc::c_vo...
Rust
0
rs: *mut IDL_RASTER_DEF, bReverse: IDLBool_t) -> (); pub fn IDL_RasterImage(data: *mut UCHAR, nx: IDL_ULONG, ny: IDL_ULONG, x0: IDL_ULONG, y0: IDL_ULONG, xsize: IDL_ULONG, ysize: IDL_ULONG, secondary: *mut IDL_TV_STRUCT, ...
Rust
0
#Tools menu tools_menu = tk.Menu(self, tearoff=False) tools_menu.add_command( label="Update Weather Data", command=self.callbacks['update_weather_data'] ) tools_menu.add_command( label="Upload CSV to corporate REST", command=self.call...
Python
1
'a_g' """ if limit < 2: raise ValueError("limit must be greater than or equal to 2.") if split is None: split = limit // 2 split = min(split, len(text) // 2) if len(text) > limit: text = f"{text[:split]}{separator}{text[-split:]}" return text def repr_shorten( v...
Python
1
# Copyright (c) 2022 PaddlePaddle 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 appli...
Python
1
ully", ); let tjson: serde_json::Value = serde_json::from_str(&tjson_string).expect("aes_pmac_siv.tjson parses successfully"); let examples = &tjson["examples:A<O>"].as_array().expect( "aes_pmac_siv.tjson examples array", ); examples .into_it...
Rust
0
from __future__ import annotations import logging import sys from typing import Any from loguru import logger from ravyn.conf.enums import EnvironmentType from ravyn.types import LifeSpanHandler from ..configs.settings import AppSettings async def start_database(): ... async def close_database(): ... class In...
Python
1
from .BiLSTM import BiLSTMLayer from .tconv import TemporalConv
Python
1
.visit_mvar(v), } } /// Calls function `f` on all expression metavariables. pub fn on_mvars(&self, f: impl FnMut(ExprMVarId)) { struct Visitor<F>(F); impl<'a, F: FnMut(ExprMVarId)> ExprVisit<'a> for Visitor<F> { fn visit_mvar(&mut self, e: ExprMVarId) { self.0(e) } } self.visit(&mut Vis...
Rust
0
# Copyright 2022 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Shopinvader API Sale Loyalty", "summary": """ FastAPI services to add coupons and loyalties to carts.""", "version": "16.0.1.1.2", "license": "AGPL-3", "author": "ACSONE SA/NV", "web...
Python
1
oes not propagate down. Null(bool), /// Do not serialize empty objects as indicated by the `Empty` trait. /// /// If the `bool` flag is set to `true`, this applies to all descendants recursively; if it is /// set to `false`, this only applies to direct children and does not propagate down. Empt...
Rust
0
_keys="image_meta_dict", meta_key_postfix="meta_dict", nearest_interp=False, to_tensor=True, ), # AsDiscreted(keys="pred", argmax=True, to_onehot=3), AsDiscreted(keys="pred", argmax=True, to_onehot=3), AsDiscreted(keys="label", to_onehot=3), # ...
Python
1
{Deserialize, Serialize}; use crate::settings::{ MaskSettings, ModelSettings, PetSettings, PetSettingsCount, PetSettingsSum, PetSettingsSum2, PetSettingsTime, PetSettingsUpdate, }; use xaynet_core::{ common::{RoundParameters, RoundSeed}, crypto::{ByteObject, EncryptKeyPair}, ...
Rust
0
The type identifier for this item. eg, SDESCNAME for canonical name description. /// /// Type zero or SDESEnd is interpreted as the end of an item list and cannot be used. pub sdes_type: SdesType, /// Text is a unicode text blob associated with the item. Its meaning varies based on the item's Type. ...
Rust
0
"""L-System Functions """ import numpy as np def set_lsys_string(axiom, rules, n): """ Generates a string of characters based on the axiom and rules. Parameters: axiom (str): The starting string. rules (dict): A dictionary of rules to apply to the string. n (int): The number of iterations to ...
Python
1
import os import logging import pytest from ase import Atoms from ion_CSP.identify_molecules import identify_molecules, molecules_information # 配置日志 logging.basicConfig(level=logging.INFO, format="%(levelname)s: %(message)s") def create_gjf_file(path: str, filename: str, atoms: Atoms): """手动创建临时的GJF文件""" fil...
Python
1
macro_rules! catch { ($x:expr) => { (||-> Result<_, Box<dyn std::error::Error>>{Ok($x)})(); } } macro_rules! try_input{ ($($r:tt)*) => {input_basic!{try, $($r)*}} } macro_rules! input{ ($($r:tt)*) => {input_basic!{unwrap, $($r)*}} } macro_rules! input_basic { ($mode:ident, str = $s:expr, $(...
Rust
0
ELINESTATE_PS_OUTPUT_TYPE_MISMATCH: D3D12_MESSAGE_ID = 677i32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"] pub const D3D12_MESSAGE_ID_CREATEGRAPHICSPIPELINESTATE_OM_RENDER_TARGET_DOES_NOT_SUPPORT_LOGIC_OPS: D3D12_MESSAGE_ID = 678i32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"] pu...
Rust
0
from ultralytics import YOLO import cv2 model = YOLO("yolov8n.pt") img=cv2.imread("00.jpg") results = model(img, classes=0) clss = results[0].boxes.cls.cpu().tolist() boxess = results[0].boxes.xyxy.cpu().tolist() i=0 for box, clss in zip(boxess, clss): cv2.rectangle(img, (int(box[0]), int(box[1])), (int(bo...
Python
1
; annotations.insert(KUSTD_ORIGIN_NAMESPACE.to_owned(), namespace.clone()); // Remove annotations if let Some(keys) = annotations.get(KUSTD_REMOVE_ANN_ANN).cloned() { for key in keys.split(",") { annotations.remove(key.trim()); } } } // R...
Rust
0
z = Vec::with_capacity(num_wire_values_at_z as usize); for _ in 0..num_wire_values_at_z { let p = read_fr(&mut reader)?; wire_values_at_z.push(p); } let num_wire_values_at_z_omega = reader.read_u64::<BigEndian>()?; let mut wire_values_at_z_omega = Vec::with_capac...
Rust
0
urses.c.id == users_with_ratings.c.id ).offset(skip).limit(limit).all() # Преобразование результатов в список схем UserStats stats = [] for result in results: stats.append(schemas.UserStats( user_id=result.user_id, full_name=result.full_name, total_course...
Python
1
"""Example of keys derivation using BIP32 (ed25519 curve based on SLIP-0010).""" from bip_utils import Bip32Slip10Ed25519, Bip39MnemonicGenerator, Bip39SeedGenerator, Bip39WordsNum, SolAddrEncoder # Generate random mnemonic mnemonic = Bip39MnemonicGenerator().FromWordsNumber(Bip39WordsNum.WORDS_NUM_24) print(f"Mnemo...
Python
1
const__InputArrayR_const__InputOutputArrayR_const__OutputArrayR_double" => "+_variance", "cv_PCA_PCA_const__InputArrayR_const__InputArrayR_int_double" => "+_with_variance", "cv_PCA_backProject_const_const__InputArrayR_const__OutputArrayR" => "+_to", "cv_PCA_project_const_const__InputArrayR_const__OutputArrayR" => "+...
Rust
0
_val::RawVal; #[derive(Debug, Clone)] pub enum Expr { ColName(String), Func(FuncType, Box<Expr>, Box<Expr>), Const(RawVal), } #[derive(Debug, Copy, Clone)] pub enum FuncType { Equals, LT, GT, And, Or, Add, Subtract, Multiply, Divide, RegexMatch, Negate, } use ...
Rust
0
n filter.""" data = np.random.rand(7, 1000) p = PreferredPhase() p.filter(256, data, 'phase') p.filter(256, data, 'amplitude') def test_fit(self): """Test function fit.""" data = np.random.rand(100, 1000) p = PreferredPhase() pha = p.filter(256, data,...
Python
1
::weapons::get_static_data; use crate::weapon::weapon_name::WeaponName; use crate::weapon::weapon_static_data::WeaponStaticData; struct WeaponMetaDataForJS { name: String, chs: String, star: usize, t: String, effect: String, configs: Vec<String>, } #[derive(Template)] #[template(path = "weapon...
Rust
0
huffle (bool): Set to ``True`` to have the data reshuffled at every epoch (default: ``False``). drop_last (bool): Set to ``True`` to drop the last incomplete batch, if the dataset size is not divisible by the batch size. If ``False`` and the size of dataset is not divisible by the batch si...
Python
1
") .join("libxul.so.dbg"), "https://symbols.mozilla.org/libxul.so/CA89B171348FDEF3A6A365AC6CDF07BF0/libxul.so.dbg.gz", FileType::Gzip, )?; prepare( big_fixtures_dir() .join("android64-ci") .join("libxul.so.dbg"), "https://symbols.mozilla.org/li...
Rust
0
b10, 0), ]; tests .into_iter() .try_for_each(|(from_bits, to_bits, bit_index)| { let ops = vec![ DecompOp::Rotation { from_bits, to_bits, bit_index, ...
Rust
0
GROUP_CREATE_INFO_NV: Self = StructureType(1_000_165_011); } #[doc = "Generated from \'VK_NV_ray_tracing\'"] impl StructureType { pub const ACCELERATION_STRUCTURE_INFO_NV: Self = StructureType(1_000_165_012); } #[doc = "Generated from \'VK_NV_ray_tracing\'"] impl ShaderStageFlags { pub const RAYGEN_NV: Self = S...
Rust
0
fetch(pc: U15, memory: &Memory) -> (U15, Option<Op>) { let word = memory.read_address(pc); let mut res = (pc + 1, None); if let WmWord::Constant(op_code) = word { let op_code = op_code.to_u16(); match op_code { //Opcodes wich have no additional operand //HALT, RET, NO...
Rust
0
++++++++++++++ /// + _ + [] + /// +++++++++++++++++++++++++++++ /// + true + [First] + /// +++++++++++++++++++++++++++++ /// + true + [Second(true)] + /// +++++++++++++++++++++++++++++ /// + false + [_] + /// +++++++++++++++++++++++++++++ /// + _ + [_, _, tail @ ..] +...
Rust
0
ool_objects def validate_tool_calling(response: dict[str, Any], request_tool_param: dict) -> ToolValidationResult: """Validate that the response from the LLM called tools corrected. 1. Check if any tool was called. 2. Check if the tools called were valid (names match) 3. Check if all the required argu...
Python
1
#!/usr/bin/env python import rospy import tf from geometry_msgs.msg import PointStamped, TransformStamped, PoseStamped #PoseStamped added to support vrpn_client from crazyflie_driver.srv import UpdateParams def onNewTransform(pose): global msg global pub global firstTransform if firstTransform: ...
Python
1
_dir() { return Err(chain_error!(e, "failed to acquire new consuming directory")); } } } let ret = append_subdirectory(consuming); if ret.is_dir() { Ok(Some(ret)) } else { Ok(None) } } /// Attempts to remove the "consuming" subdirectory of `paren...
Rust
0
compression_encodings: self.send_compression_encodings, } } } impl<T: Watch> Clone for _Inner<T> { fn clone(&self) -> Self { Self(self.0.clone()) } } impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> { fn fmt(&self, f: &mut std::fmt::Formatter...
Rust
0