text
string
label_name
string
labels
int64
eq(&self, other: &Literal) -> bool { use Literal::*; match (self, other) { (Null, Null) => true, (Boolean(a), Boolean(b)) => a == b, (Number(a), Number(b)) => { a.as_parts() == b.as_parts() }, (String(a), String(b)) => a == b, _ => false } } } impl Eq for Literal {} impl Hash for Literal...
Rust
0
""" Unit tests for functions within the nlpengine/main.py file. """ from unittest import TestCase from random import seed from nlpengine.main import ( _create_gold_dict, _doc_to_example_text_list, _join_text_components, _split_into_train_and_evaluation_data, _score_evaluation_data_performance, ) ...
Python
1
ex:expr) => { PublicKey::from_str($hex).unwrap() }; } macro_rules! lk { ($pk:expr) => { LocalPubkey { key: $pk, ..LocalPubkey::dumb_default() } }; } fn core_for_tests() -> BoltChannel { let local_payment...
Rust
0
# Copyright (c) 2020 DDN. All rights reserved. # Use of this source code is governed by a MIT-style # license that can be found in the LICENSE file. from django.core.management.base import BaseCommand, CommandError import os import sys import settings class Command(BaseCommand): help = """Perform some basic ch...
Python
1
from menu import Menu, MenuItem from coffee_maker import CoffeeMaker from money_machine import MoneyMachine menu = Menu() maker = CoffeeMaker() money = MoneyMachine() while(True): drink = input(" What would you like? (espresso, cappuccino, latte): ") if drink == 'q' or drink == 'quit': break if drink == 'r...
Python
1
import glob import os, sys sys.path.append(os.getcwd()) import numpy as np input_folder = "data/kitti_split1/video_demo" image_folder = os.path.join(input_folder, "image_2") calib_folder = os.path.join(input_folder, "calib") p2_npy_folder = os.path.join(input_folder, "p2") R_rect_00 = [9.999454e-01, 7.259129e-03, ...
Python
1
from ...symbols import ORTH from ...util import update_exc from ..tokenizer_exceptions import BASE_EXCEPTIONS _exc = {} for orth in [ "Adm.", "Art.", "art.", "Av.", "av.", "Cia.", "dom.", "Dr.", "dr.", "e.g.", "E.g.", "E.G.", "e/ou", "ed.", "eng.", "etc...
Python
1
}; let i_type = match dim { 1...32 => format!("::bobbin_bits::R{}", dim), 64 => format!("::bobbin_bits::U6"), 128 => format!("::bobbin_bits::U7"), 256 => format!("::bobbin_bits::U8"), _ => panic!("Unsupported dim value for {}...
Rust
0
# Send transaction tx_hash = await self.web3.web3.eth.send_raw_transaction( signed_tx.raw_transaction ) tx_hex = tx_hash.hex() # Wait for transaction receipt receipt = await self.web3.web3.eth.wait_for_transaction_receipt(tx_hash) ...
Python
1
(|c| difference.push(format!("ADD {} {}", c, tmp_col_map.get(c).unwrap()))); to_drop.for_each(|c| difference.push(format!("DROP {}", c))); intersection.for_each(|c| { if tmp_col_map.get(c) != imi_col_map.get(c) { difference.push(format!("MODIFY {} {}", c, tmp_col_map.get(c).unwrap())); ...
Rust
0
gnal power on voiced frames only.""" if signal.numel() == 0 or periodicity.numel() == 0 or periodicity.sum() == 0: return signal.pow(2).mean() if signal.numel() > 0 else torch.tensor(0.0) periodicity_mask = (periodicity > 0).squeeze() # Create a sample-level mask sample_mas...
Python
1
], # same groups as label_schema_1 ) label_schema_3 = LabelSchema( id_=fxt_mongo_id(23), project_id=fxt_project_identifier.project_id, label_groups=[ label_group_1, label_group_3, ], # different groups from label_schema_1 ...
Python
1
RATOR: u8 = 0xff; fn encode(&self) -> Vec<u8>; } impl EncodeKey for Uuid { fn encode(&self) -> Vec<u8> { self.as_u128().to_be_bytes().to_vec() } } impl EncodeKey for &RequestedKeyInfo { fn encode(&self) -> Vec<u8> { [ self.room_id.as_bytes(), &[Self::SEPARATOR],...
Rust
0
cfg_attr(not(test), no_std)] #![warn(missing_docs)] pub mod led; pub mod pb; pub use stm32wlxx_hal as hal; use hal::{ cortex_m::interrupt::CriticalSection, gpio::{self, pins, Output, OutputArgs, PinState}, }; /// RF switch. #[derive(Debug)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub struct Rf...
Rust
0
mage.shape[1:] != noise.shape[1:]: image = utils.common_upscale(image.to(device), noise.shape[-1], noise.shape[-2], "bilinear", "center") noise_level = torch.tensor([noise_level], device=device) if noise_augment > 0: image, noise_level = self.noise_augmentor(image.to(device), no...
Python
1
let f_names_offset = file.read_u64()?; // lists to string table entry let string_table_offset = file.read_u64()?; // string table let mut model_lod_cache: HashMap<u64, ModelLod> = HashMap::new(); let read_model_group = |file: &mut F, model_group_offset| { file.seek_noop(mo...
Rust
0
E: max_ctx = model.config.max_seq_len if job["length"] > max_ctx: print (f" !! Warning: Reducing calibration length to model max context: {max_ctx}") job["length"] = max_ctx if job["measurement_length"] > max_ctx: print (f" !! Warning: Reducing measurement calibration length to model...
Python
1
r): Path to the output directory num_samples (int): Number of samples to visualize """ rttm_list = list(Path(input_dir).glob("*.rttm")) idx_list = np.random.permutation(len(rttm_list))[:num_samples] print(f"Visualizing {num_samples} random samples") for idx in idx_list: rttm_file = r...
Python
1
typehandle> // Note that this is the max of base type excluding modifiers ELEMENT_TYPE_MAX = 0x22, // first invalid element type ELEMENT_TYPE_MODIFIER = 0x40, ELEMENT_TYPE_SENTINEL = 0x01 | CorElementType::ELEMENT_TYPE_MODIFIER as isize, // sentinel for varargs ELEMENT_TYPE_PINNED = 0x05 | CorElem...
Rust
0
8") fake_sub_content = b"WEBVTT\n\n\n1\n00:01:47.250 --> 00:01:50.500\n`hello." with self.assertRaises(StreamlitAPIException) as e: st.video( fake_video_data, subtitles={ "English": fake_sub_content, "": "", # empty su...
Python
1
nse, ReassociationRequest, ReassociationResponse, ProbeRequest, Beacon, Ack, Reserved, Unknown } impl FrameType { fn new(ty: u8, subty: u8) -> Self { match (ty, subty) { (0, 0) => Self::AssociationRequest, (0, 1) => Self::AssociationResponse, (...
Rust
0
api::{ trace::futures::FutureExt, Context, HttpTextFormat, Key, Span, SpanKind, TraceContextExt, TraceContextPropagator, Tracer, }, global, sdk, }; use std::collections::HashMap; use std::env; use std::error::Error; use std::time::Duration; use tokio::process::Command; use tokio::time::delay...
Rust
0
from llmebench.datasets import OSACT4SubtaskBDataset from llmebench.models import OpenAIModel from llmebench.tasks import HateSpeechTask def metadata(): return { "author": "Mohamed Bayan Kmainasi, Rakif Khan, Ali Ezzat Shahroor, Boushra Bendou, Maram Hasanain, and Firoj Alam", "affiliation": "Arab...
Python
1
(1, 0., 0, 52.430195, 42, 0., 0., 1. , 7.0+24.0j , 1363540), (2, 0., 0, 304.43646 , 58, 0., 0., 1. , 20.0+21.0j , 787323), (3, 0., 0, 299.42108 , 52, 0., 0., 1. , 12.0+35.0j , 787332), (4, 0., 0, 39.4836 , 28, 0., 0., 9.182192, ...
Python
1
self.save_data["groups"][group_str] = {} if file_path not in self.save_data["groups"][group_str]: self.save_data["groups"][group_str][file_path] = {} current_ignore = self.save_data["groups"][group_str][file_path].get('ignore', False) self.save_data["gro...
Python
1
kBehavior, ) -> Result<usize, String> { let mut used_bytes: usize = 0; let mut fingerprints_by_expired_ago = BinaryHeap::new(); self.aged_fingerprints( EntryType::File, &mut used_bytes, &mut fingerprints_by_expired_ago, )?; self.aged_fingerprints( EntryType::Directory, ...
Rust
0
} } macro_rules! copy_fold { ($t:ty) => { impl ::fold::Fold for $t { type Result = Self; fn fold_with(&self, _folder: &mut ::fold::Folder, _binders: usize) -> ::errors::Result<Self::Result> { ...
Rust
0
import contextlib from .py39 import import_helper @contextlib.contextmanager def isolated_modules(): """ Save modules on entry and cleanup on exit. """ (saved,) = import_helper.modules_setup() try: yield finally: import_helper.modules_cleanup(saved) vars(import_helper).setde...
Python
1
; assert_eq!(4, block.count_occupieds(0, 4)); assert_eq!(SLOTS_PER_BLOCK, block.count_occupieds(0, SLOTS_PER_BLOCK)); assert_eq!( SLOTS_PER_BLOCK - 1, block.count_occupieds(0, SLOTS_PER_BLOCK - 1) ); assert_eq!( SLOTS_PER_BLOCK - 2, ...
Rust
0
test)] mod tests { use super::get_proxy_uri; #[test] fn get_proxy_uri_recognizes_https_proxy() { let proxy_val = "https://example.com" .to_string() .parse::<hyper::Uri>() .unwrap() .to_string(); assert_eq!( get_proxy_uri(Some(prox...
Rust
0
there to be any bloodshed.", "Je ne veux tout simplement pas qu'il y ait une effusion de sang."), ("I just thought that you wouldn't want to go.", "J'ai simplement pensé que vous ne voudriez pas y aller."), ("I plan to go. I don't care if you do or not.", "Je prévois d'y aller. Ça m'est égal que vous y alliez a...
Python
1
tx.set(c, Stat::maxhp, card.health as i32); ctx.set(c, Stat::hp, card.health as i32); ctx.set(c, Stat::atk, card.attack as i32); ctx.setCrea(owner, index as i32, c); } } } Self::cell => { ctx.transform(c, card::As(ctx.get(c, Stat::card), card::MalignantCell)); data.amt = 0; }...
Rust
0
icklabels([]) ax.set_yticklabels([]) ax.tick_params(bottom=False, left=False) ax.spines['top'].set_visible(False) ax.spines['right'].set_visible(False) ax.spines['bottom'].set_visible(False) ax.spines['left'].set_visible(False) self.fig = fig self.ax = ax ...
Python
1
# Passo a passo do projeto # Passo 1: Entrar no sistema da empresa # https://dlp.hashtagtreinamentos.com/python/intensivao/login import pyautogui import time # pyautogui.write -> escrever um texto # pyautogui.press -> apertar 1 tecla # pyautogui.click -> clicar em algum lugar da tela # pyautogui.hotkey -> combin...
Python
1
from peewee import * from app.modules.db.db_model import connect # Get the migrator for the current database migrator = connect(get_migrator=True) def upgrade(): # Add ignore_ssl_error columns to smon_smtp_check and smon_http_check tables try: migrate( migrator.add_column('smon_smtp_check...
Python
1
ts look like this: // Bit index: 7 6 5 4 3 2 1 0 // z1 y1 x1 0 0 0 0 0 // // Now look at the grid indices that correspond to these Morton indices! In the first case, the grid index looks like this: // Bit index: 7 6 5 4 3 2 1 0 // ...
Rust
0
import random import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import LSTM, Dense, Activation from tensorflow.keras.optimizers import RMSprop # Download the dataset filepath = tf.keras.utils.get_file('shakespeare.txt','https://storage.googleapis.com...
Python
1
as u8) } #[doc = "Bits 24:27 - FlexBus Signal Group 2 Multiplex control"] #[inline(always)] pub fn group2(&self) -> GROUP2_R { GROUP2_R::new(((self.bits >> 24) & 0x0f) as u8) } #[doc = "Bits 28:31 - FlexBus Signal Group 1 Multiplex control"] #[inline(always)] pub fn group1(&self...
Rust
0
Two(handCards) actionList['ThreePair'] = self.CreateThreePair(handCards) actionList['TwoTrips'] = self.CreateTwoTrips(handCards) actionList['Straight'] = self.CreateStraight(handCards) actionList['StraightFlush'] = self.CreateStraightFlush(handCards) actionList['Bomb'] = self.Cre...
Python
1
</> } } } /// Properties for the `TokenInput` component. #[derive(Debug, Clone, Default, PartialEq, Properties)] pub struct TokenInputProperties { #[prop_or_default] pub component_ref: ComponentRef<TokenInput>, #[prop_or_default] pub onchange: Callback<Option<UntrustedToken<'sta...
Rust
0
# Program to check if a number is prime or not num = 409 # To take input from the user #num = int(input("Enter a number: ")) # prime numbers are greater than 1 if num > 1: # check for factors for i in range(2,num): if (num % i) == 0: print(num,"is not a prime number") print(i,"time...
Python
1
nt .post(&auth_url) .header("Content-Type", "application/jose+json") .body(serde_json::to_string_pretty(&jws)?) .send()?; let (nonce, mut challenge): (Nonce, ChallengeAuthorisation) = extract_payload_and_nonce(response)?; challenge.nonce = no...
Rust
0
""" Query environments example. This example shows how to use query environments with different retrieval models. The query() method supports the same arguments as Index.query(); see query.py. """ import pyndri import sys if len(sys.argv) <= 1: print('Usage: python {0} <path-to-indri-index>'.format(sys.argv[0]))...
Python
1
If any of the above fail, the exception text is printed and the node returns a status of `FAILURE`. Otherwise the node returns `SUCCESS`. If you want to use a language model to make decisions, consider looking at the `CompletionConditionNode`. """ try: input_text = ...
Python
1
`\"Win32_System_Diagnostics_Debug\"`*"] pub const SSRVACTION_EVENT: u32 = 3u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const SSRVACTION_EVENTW: u32 = 4u32; #[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"] pub const SSRVACTION_HTTPSTATUS: u32 = 6u32; #[doc = "*Requi...
Rust
0
"""This is a model to manage the files of the current session.""" import os import pickle from lexos.helpers import constants from lexos.managers.file_manager import FileManager from lexos.managers.session_manager import session_folder from lexos.models.base_model import BaseModel class FileManagerModel(BaseModel): ...
Python
1
= X_new_group[:, :, 0:controllable_dim] - gradient_constrain # check if the controllable variable exceeds the boundary X_new_group = check_control_constraint(X_new_group, controllable_dim, X_upper_bound, X_lower_bound) y_new_group = model.predict(X_ne...
Python
1
Slice, M: IcmpMessage<I, B>> IcmpPacketRaw<I, B, M> { /// Get the ICMP message. pub fn message(&self) -> &M { &self.header.message } } /// An ICMP packet. /// /// An `IcmpPacket` shares its underlying memory with the byte slice it was /// parsed from, meaning that no copying or extra allocation is ...
Rust
0
def CountGroups(self, circles: list[Circle]) -> int: """원 목록이 주어지면 원 그룹의 수를 반환한다.""" total_groups = 0 visited = set() adjacency_dict = self.ConstructAdjacencyDict(circles) for circle in circles: if circle in visited: continue self.DFS(circle, adjacency_dict, visited) ...
Python
1
class Menu: def __init__(self, Requests, log, presences): self.Requests = Requests self.log = log self.presences = presences def get_party_json(self, GamePlayersPuuid, presencesDICT): party_json = {} for presence in presencesDICT: if presence["puuid"] in Game...
Python
1
st'): """ It takes a list of masks(n,h,w) and returns a list of segments(n,xy) Args: masks (torch.Tensor): the output of the model, which is a tensor of shape (batch_size, 160, 160) strategy (str): 'concat' or 'largest'. Defaults to largest Returns: segments (List): list of segment m...
Python
1
import pandapower as pp # Create an empty network net = pp.create_empty_network() # Create buses bus1 = pp.create_bus(net, vn_kv=20, name="Bus 1") bus2 = pp.create_bus(net, vn_kv=20, name="Bus 2") bus3 = pp.create_bus(net, vn_kv=20, name="Bus 3") # Create bus elements pp.create_ext_grid(net, bus1, vm_pu=1.02, name="...
Python
1
thon('def f(): print(<char*>0)') # optional - sage.misc.cython sage: @fork ....: def g(): f() sage: print("this works"); g() # optional - sage.misc.cython this works... <BLANKLINE> ---------------------------...
Python
1
t = time.time() # Search the optimal mask head_grads, neuron_grads = collect_mask_grads( model, full_head_mask, full_neuron_mask, sample_dataloader, ) teacher_constraint = get_pruning_schedule(target=args.constraint, num_iter=2)[0] if args.metric == "mac": tea...
Python
1
1_f64(x, eps, λ, x1, x2, segment); let mut Δ_2 = 0.0; for &p in primes.iter() { let mut m = 1i64; let mut power = p; while power < x2 / p { m += 1; power *= p; if power < x1 { Δ_2 += 1.0 / m as f64; } else { ...
Rust
0
rng)?; //只是标记了’哪些多项式‘会在哪个点open let query_set = AHPForPLONK::verifier_query_set(&vs); fs_rng.absorb(&proof.evaluations); let epsilon = F::rand(&mut fs_rng); //接口? //qs中的多项式的label排序,然后和proof里对应的值 组合在一起 let evaluations = { let mut evaluation_labels: Vec...
Rust
0
+= reader.num_docs(); readers.push(reader); } } if max_doc >= MAX_DOC_LIMIT { let err_msg = format!( "The segment resulting from this merge would have {} docs,\ which exceeds the limit {}.", max_doc, MAX_DOC_LIMIT ...
Rust
0
t(tela, BRANCO, (x-2, y-2, largura_caixa+4, altura_caixa+4), 3) if desbloqueada: tela.blit(skin["texturas"]["cabeca"], (x + 20, y + 20)) tela.blit(skin["texturas"]["corpo"], (x + 20, y + 40)) tela.blit(skin["texturas"]["corpo"], (x + 20, y + 60)) tela.blit(skin["...
Python
1
) = storage; for item in &ast.items { let (body, name) = match item { Item::Program(ref p) => (&p.body, &p.name.value), _ => unimplemented!(), }; let symbol = symbols .get(name) .expect("the symbol t...
Rust
0
in symbol_buffer0.iter() { cdf0a.blend(*sym, Speed::MED); cdf0b.blend(*sym, Speed::MED); assert_cdf_eq(cdf0a, cdf0b); } assert_cdf_similar(&cdf0a.average(cdf1a, (1<<BLEND_FIXED_POINT_PRECISION)>>2), &cdf0b.average(cdf1b, (1<<BLEND_FIXED_POINT_PRECISION)>>2)); for sym in symbol_buffe...
Rust
0
n(3, c, initial_size, initial_size) import matplotlib.image as mpimg from skimage.transform import resize x = mpimg.imread('../group/testimage.jpeg').transpose((2, 0, 1))[np.newaxis, 0:c, :, :] x = x / 255.0 x = resize( x, (x.shape[0], x.shape[1], initia...
Python
1
) new_hdr_bin_len = len(raw(new_hdr)) if register and isinstance(new_hdr, HPackLitHdrFldWithIncrIndexing): # noqa: E501 self.register(new_hdr) # The new header binary length (+ base frame size) must not exceed # the maximum frame size or it w...
Python
1
P_SLP_TIMER_EN_R { ULP_CP_SLP_TIMER_EN_R::new(((self.bits >> 24) & 0x01) != 0) } #[doc = "Bit 28 - SDIO active indication"] #[inline(always)] pub fn sdio_active_ind(&self) -> SDIO_ACTIVE_IND_R { SDIO_ACTIVE_IND_R::new(((self.bits >> 28) & 0x01) != 0) } #[doc = "Bit 29 - sleep wak...
Rust
0
://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permiss...
Rust
0
a5\xf3)\xcbDx#>\xf3\x95\xf6\xf1\ \xd5\xce\xe5\xdf\xc5\xf3\xdc\xe2\xb7\x07vehqL\x80\ \x88\x1e\xf6Nf\x22\xd2LBY\x94L\xa4(\x91w\ d\x99\xa1=\x0e\xc2L\xd2VL\xbeE\x93\x1c>\xfd\ \x9e\xdd$b\xb2\x8f\xf0\x10s\xf8\xa7\x098\x15\x82\x19\ y\xa34\x11\x8a\xc9j\x0ay5\xd6\x00\xc6\x96\x83\xde\ \xd7\xd1&p\x91T\x9f\xe4S<q\xa2\x8b\xf9\x0b=\...
Python
1
(status_code=status.HTTP_400_BAD_REQUEST, detail=str(e)) except Exception as e: logger.error(f"回滾遷移失敗: {e}") raise HTTPException( status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail="回滾遷移失敗" ) @router.get( "/migrations/{migration_id}/status", response_model=Dict[s...
Python
1
"""Motion planning module tests."""
Python
1
"Extracts administrative boundaries of OSM pbf files and produces polygon files compatible with Osmosis.", ) .setting(AppSettings::ArgRequiredElseHelp) .arg( Arg::with_name(INPUT_ARG) .short("f") .long("file") .value_name("filename")...
Rust
0
import re def tokenize_code(code): # 定义一个正则表达式模式,用于匹配代码中的标识符、关键字、数字等 pattern = re.compile(r'\b\w+\b') # 使用正则表达式找到所有匹配的部分 tokens = pattern.findall(code) return tokens
Python
1
_time_for_current_post, crosslink_time, crosslink_1_id, name_channel_id, crosslink_2_id, crosslink_3_id, crosslink_4_id, crosslink_5_id): if crosslink: crosslink_time_for_current_post = post_time_for_current_post + timedelta(hours=crosslink_time) print...
Python
1
import requests from langchain.tools import StructuredTool from pydantic.v1 import BaseModel, Field class CVEQuery(BaseModel): query: str = Field(description="要搜索的 CVE 编号") def cve_search(query: str) -> str: """根据查询搜索 CVE 信息""" url = f"https://cve.circl.lu/api/cve/{query}" # 修正 URL response = request...
Python
1
'"' { ident.write_char(char::from(self.cur_ch)).unwrap(); self.read_char(); } ident } fn read_single_line_comment(&mut self) -> String { self.read_char(); // Go over opening quote let mut comm = String::new(); while self.cur_ch != b'\n' && self.cu...
Rust
0
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.""" from typing import TYPE_CHECKING from importlib import import_module import builtins import sys if TYPE_CHECKING: from .globals import Globals, GlobalsTypedDict __all__ = ["Globals", "GlobalsTypedDict"] _dynamic_imports: dict[str, str] = { ...
Python
1
snowf[t,:,:] = ds.SNOWNC[t,:,:]-ds.SNOWNC[t-1,:,:] snowf = (snowf/1000.0)*(Constants.water_density/density_fresh_snow) dso = add_variable_along_timelatlon(dso, snowf, 'SNOWFALL', 'm', 'Snowfall') # Compute slope & aspect from HGT DX = ds.attrs.get('DX').astype("float") DY = ds.attrs.get('DY').a...
Python
1
<Primitive>>, Write<'a, UI>, Read<'a, Mouse>, WriteExpect<'a, ThreadPin<TextData<'static>>>, WriteExpect<'a, ThreadPin<WorldTextData<'static>>>, Write<'a, AppState>, ReadExpect<'a, MacroGame>, ); fn run(&mut self, data: Self::SystemData) { let ( ...
Rust
0
if license_file_analysis and license_file_analysis.get("licenses"): copyright_notice = await construct_copyright_notice_async( await get_github_last_update_time(api, owner, repo, resolved_version), owner, repo, resolved_ve...
Python
1
-6 DIR_PATH = os.path.dirname(os.path.realpath(__file__)) OUT_PRFX = "RESULT_test_run-ctmrg_d3-rvb" ANSATZE= [("IPESS","IPESS_KAGOME_D3_RVB.in"),\ ("IPESS_PG","IPESS_PG_KAGOME_D3_RVB.in")] def setUp(self): args.j1= 1.0 args.bond_dim=3 args.chi=18 args.GLOBALARGS_...
Python
1
""" MusicPicker v1.2 - 歌曲筛选复制工具 主程序入口,包含新的播放列表生成器和比较器功能 """ from translator import Translator, detect_system_language from music_processor import MusicProcessor from metadata_processor import MetadataProcessor from playlist_generator import PlaylistGenerator from playlist_comparator import PlaylistComparator from gui i...
Python
1
trace!("Spawning bot from structure"); let spawn = match spawn_queue.get_mut(intent.spawn_id) { Some(x) => x, None => { debug!("structure does not have spawn queue component"); continue; } }; if spawn.queue.len() > 20 {...
Rust
0
::Fast => true, OutputSlewRate::Slow => false, }; match self.id().group { DynGroup::Bank0 => unsafe { &(*pac::PADS_BANK0::ptr()) }.gpio[num] .modify(|_, w| w.slewfast().bit(slewfast)), DynGroup::Qspi => qspi_write_slew(num, slewfast), }; }...
Rust
0
ionMultiply((rs_quaternion*) buf2025, *(float*)buf2026); rsQuaternionMultiply((rs_quaternion*) buf2027, (const rs_quaternion*) buf2028); rsQuaternionNormalize((rs_quaternion*) buf2029); rsQuaternionSet((rs_quaternion*) buf2030, *(float*)buf2031, *(float*)buf2032, *(float*)buf2033, *(float*)buf2034); rsQ...
Rust
0
AWS Lambda Instrumentation]: https://docs.honeycomb.io/getting-data-in/integrations/aws/aws-lambda/ #[derive(Debug)] pub struct Builder<R> { reporter: R, sample_rate: Option<u32>, service_name: &'static str, } impl Builder<StdoutReporter> { /// Returns a new `Builder` that reports data to stdout pu...
Rust
0
nding to a range from 185.20 Ohms to /// 3697.12 Ohms. Calculated using `fn make_lookup()` below. pub const LOOKUP_VEC_PT1000: LookupTable<'static, u32> = LookupTable { min: -200, step: 20, data: &[ 18520, 27096, 35543, 43876, 52110, 60256, 68325, 76328, 84271, 92160, 100000, 107794, ...
Rust
0
32>, pub tex_coord: Rect<u32>, pub advance: f32, } impl CharInfo { /// Create an empty CharInfo pub fn new() -> CharInfo { CharInfo { rect: Default::default(), tex_coord: Default::default(), advance: 0.0, } } /// Create CharInfo from data ...
Rust
0
// Find all datapoints beyond threshold let mut elevated_points: Vec<usize> = vec![]; for (index, data_point) in input.iter().enumerate() { if *data_point > const_config.sync_point_threshold { elevated_points.push(index) } if *data_point > 5f64 { println!("WHAT...
Rust
0
pay_date": "2018-12-05", "strike_fraction": 1.15170375, "strike_date": { "date": "2018-06-08", "time_of_day": "Close" }, "strike_time": { "date": "2018-06-08", "day_fraction": 0.8 } } }"###); } #[test] fn european_tagged_serde_dedup_error_if_missing() { ...
Rust
0
# (c) Meta Platforms, Inc. and affiliates. Confidential and proprietary. # pyre-strict from typing import Tuple, Union import torch from captum._utils.typing import Tensor from tests.helpers import BaseTest def assert_attribution_delta( test: BaseTest, inputs: Union[Tensor, Tuple[Tensor, ...]], attribut...
Python
1
it perminantly to behave as NSS } <gh_stars>0 pub mod piece; pub mod piece_type; // Imports use rand::Rng; use self::piece::Piece; use self::piece_type::PieceType; use utility::point::Point; use utility::matrix::Matrix; /// /// This module should represent a piece_factory. /// /// /// This func...
Rust
0
from cvzone.HandTrackingModule import HandDetector import cv2 cap = cv2.VideoCapture(0) cap.set(3, 720) cap.set(4, 720) detector = HandDetector(maxHands=2, detectionCon=0.8, minTrackCon=0.5) startDist = None scale = 0 cx, cv = 500,500 while True: success, img = cap.read() hands, img = detector.findHands(img...
Python
1
class Solution: def longestIdealString(self, s: str, k: int) -> int: dp = [0] * 27 n = len(s) for i in range(n - 1, -1, -1): cc = s[i] idx = ord(cc) - ord('a') maxi = float('-inf') left = max((idx - k), 0) right = min((idx + k), 2...
Python
1
s::gui_output::GuiOutput; use crate::imp::structs::gui_point::GuiPoint; pub fn start_loop<P : AsRef<Path>, F : FnMut(GuiOutput) -> GuiInput + 'static>(font_path : P, input : GuiInput, interaction : F) { let mut window: PistonWindow = WindowSettings::new( "test_window", [1280, 720] ) ....
Rust
0
from django.db import models class historia_valor(models.Model): titulo = models.CharField(max_length=200, verbose_name="Título") conteudo = models.TextField(verbose_name="Conteúdo") imagem = models.ImageField(upload_to='sobre_nos_images/%Y/%m/%d/', verbose_name="Imagem") valores = models.TextField(ver...
Python
1
ugin, Metrics}; use derive_more::Add; use serde_derive::Serialize; use std::str::FromStr; use std::time::SystemTime; #[derive(Default, PartialEq, Debug, Clone, Serialize, Add)] pub struct LaMetrics { load_average: f64, } impl LaMetrics { pub fn divide(self, divisor: f64) -> Self { Self { l...
Rust
0
(_) => { /* all is good */ }, Operand::Immediate(_) => bug!("const eval gave us an Immediate"), } } op_to_const(&ecx, op, normalize) }).map_err(|err| { let (trace, span) = ecx.generate_stacktrace(None); let err = ConstEvalErr { error: err, ...
Rust
0
d_strong_corr = np.std(np.abs(strong_corr_values)) # 检查是否提供了特征重要性 importance = kwargs.get('importance') if importance is None: # 默认使用方差作为重要性指标 importance = self.data.var().to_dict() # 计算重要性的变异系数(标准差/均值) importance_values = list(importance.values()) ...
Python
1
import os import platform import re from datetime import datetime import time import psutil from flask import Blueprint, render_template, jsonify from applications.common.utils.rights import authorize admin_monitor_bp = Blueprint('adminMonitor', __name__, url_prefix='/admin/monitor') # 系统监控 @admin_monitor_bp.get('/'...
Python
1
TA.AUDIO_TIME, ) # visual: 10 1-sec clips, 3 views per clip, 32 frames per view, 3 x 128 x 128 frame return visual_seqs, audio_seq def forward( self, source: List[Tuple[Tensor, Tensor]] ) -> Dict[str, Union[Tensor, List[Tensor]]]: """ Replace this function run a...
Python
1
5d, 0x63, 0x49, 0xfe, 0x98, 0x69, 0x6c, 0x1c, 0x4d, 0x9a, 0x67, 0x11, 0x24, 0xde, 0x40, 0xc5, 0x31, 0x71, 0xa4, 0xb2, 0x82, 0xb7, 0x69, 0xb7, 0xc6, 0x96, 0xcd, ]; let privkey = secp256k1::SecretKey::from_slice(&[ 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, ...
Rust
0
o_pr.contains_key(character) { println!("{} is not found", character); } let char_prs = char_to_pr.get(character).unwrap(); num_of_prs_for_all_chars += char_prs.len(); match phonetic { Some(phonetic) => { num_of_phonetic_compounds += 1; num_of_prs_for_phonetics += char_prs.len(); // the phonet...
Rust
0
ExtensionValue { #[asn(key = 203)] Id_CSG_Id(CSG_Id), #[asn(key = 235)] Id_Cell_Access_Mode(Cell_Access_Mode), #[asn(key = 291)] Id_DCN_ID(DCN_ID), #[asn(key = 171)] Id_ExtendedRNC_ID(ExtendedRNC_ID), #[asn(key = 108)] Id_GERAN_Classmark(GERAN_Classmark), #[asn(key = 250)] ...
Rust
0