text
string
label_name
string
labels
int64
internal /// state (like further [`SwrContext::convert`] calls) will may change the /// number of samples current function returns for the same number of input /// samples. pub fn get_out_samples(&self, in_samples: i32) -> i32 { unsafe { ffi::swr_get_out_samples(self.as_ptr() as _, in_samples) ...
Rust
0
(), false), ]; Instruction::new(id(), &StakeInstruction::Deactivate, account_metas) } pub fn process_instruction( _program_id: &Pubkey, keyed_accounts: &mut [KeyedAccount], data: &[u8], ) -> Result<(), InstructionError> { solana_logger::setup(); trace!("process_instruction: {:?}", data); ...
Rust
0
########################################################################## # # Copyright (c) 2007, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistribu...
Python
1
us_code}") print(f"服务器响应内容: {response.text}") if response.status_code == 200: result = response.json() print("投票成功!") print(f"投票索引: {result.get('vote_index')}") return True else: error_msg = ...
Python
1
String; /// Parse `ReplicationRuleStatus` from XML struct ReplicationRuleStatusParser; impl ReplicationRuleStatusParser { fn parse_xml<T: Peek + Next>(tag_name: &str, stack: &mut T) -> Result<ReplicationRuleStatus, XmlParseError> { try!(start_element(tag_name, stack)); let obj = try!(characters(sta...
Rust
0
Optional( CONF_EXCHANGE_PRECISION, default=default_exchange_precision ): int, } ), errors=errors, ) class CannotConnect(HomeAssistantError): """Error to indicate we cannot connect.""" class InvalidAuth(HomeAssistantError...
Python
1
import uproot import numpy as np import pandas as pd from itertools import combinations def get_px(pt,phi): return pt*np.cos(phi) def get_py(pt,phi): return pt*np.sin(phi) def get_pz(pt,eta): return pt*np.sinh(eta) def get_energy(pt,eta,mass): return np.sqrt(pt**2 * np.cosh(eta**2 + mass**2)) def i...
Python
1
|| format!("{} is {}", actual_factoid, raw_description), PhantomData::<fn(&Factoid) -> String>, ), )?, "+=" => learn_helper( command.source_nick, &actual_factoid, &config, existing_factoid, &db, FactoidEn...
Rust
0
import pyttsx3 Hindi= pyttsx3.init() Hindi.say("hey my name is dhiraj kumar") Hindi.runAndWait()
Python
1
print("Guerras mundiales Z!Bratt Pip en fichero: hellogit2.py")
Python
1
let p = r.at(t); Some(HitRecordstatic { p, normal: Vec3::new(1.0, 0.0, 0.0), t, front_face: true, mat_ptr: &(self.phase_function), u: 0.0, v: 0.0, }) } fn bounding_box(&self, time0: f64, time1: f64) -> Option<Aa...
Rust
0
#encoding = utf-8 import os, sys sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), '../'))) sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), '../../'))) sys.path.append(os.path.abspath(os.path.join(os.path.abspath(__file__), '../../../'))) sys.path.append(os.path.abspath(os...
Python
1
import numpy as np import trimesh import mcubes from typing import List def create_grid_points_from_bounds(minimun, maximum, res, scale=None): if scale is not None: res = int(scale * res) minimun = scale * minimun maximum = scale * maximum x = np.linspace(minimun[0], maximum[0], res) ...
Python
1
1b = leftturn(u1, state.p1prev, state.q2); let line_2a = leftturn(u2, state.p1, state.q2prev); let line_2b = leftturn(u2, state.p1, state.q2); if line_1a != line_1b && line_1a != -1 && line_1b != -1 || line_2a != line_2b && line_2a != -1 && line_2b != -2 {...
Rust
0
class Solution: def equalDigitFrequency(self, s: str) -> int: BASE = 11 HASH = 1_000_000_007 counts: list[dict] = [] # counts[i] := the counter map of s[0..i] count = collections.Counter() pows = [1] # pows[i] := BASE^i % HASH # hash[i] = the hash of the first i letters of s, where hash[i] =...
Python
1
import numpy as np a = np.arange(10, 35).reshape(5, 5) print(a) # [[10 11 12 13 14] # [15 16 17 18 19] # [20 21 22 23 24] # [25 26 27 28 29] # [30 31 32 33 34]] col_swap = a[:, [3, 2, 4, 0, 1]] print(col_swap) # [[13 12 14 10 11] # [18 17 19 15 16] # [23 22 24 20 21] # [28 27 29 25 26] # [33 32 34 30 31]] co...
Python
1
*v = *d; } data }; let mut output = Plane::wrap(vec![0u8; 4 * 4], 4); dispatch_predict_intra( *mode, *variant, &mut output.as_region_mut(), tx_size, bit_depth, &ac, *angle, &edge_buf,...
Rust
0
; let ratio = smr + off_center; let x = smr * angle.cos() + off_center * (angle * smr / small_radius).cos(); let y = smr * angle.sin() - off_center * (angle * smr / small_radius).sin(); P2::new(x, y) / ratio ...
Rust
0
import numpy as np import matplotlib.pyplot as plt import wave from scipy.io.wavfile import write # 设置参数 T = 0.025 # 每个符号位的时间,单位s f = 2000 # 频率 framerate = 48000 # 采样率 QPSK_signal = 0 # ASCII码->二进制 def ascii_to_bits(ascii_string): binary_string = ''.join(format(ord(char), '08b') for char in ascii_string) ...
Python
1
driver.find_element(By.CLASS_NAME, "complete-header").text assert confirmation_message == "THANK YOU FOR YOUR ORDER", f"Checkout failed for item: {item_title}" # return_home = driver.find_element(By.CLASS_NAME, "btn_secondary") # return_home.click() driver.get("https://www.saucedemo.com...
Python
1
except Exception: failed += 1 self.log.exception( "[🎭] Role sync Error: add_roles failed member_id=%s roles=%s", m.id, [f"{r.id}:{r.name}" for r in missing] ) dt = (time.perf_counter() - t0) * 1000 self....
Python
1
y_from(vers_pt & 0b0000_1111)?; // next 16 bis are sign let sign = buf.get_u16(); if sign != Self::SIGN { return Err(PacketParseError::BadKeySign(sign)); } // next 6 bits is reserved, then two bits of KF let key_flags = KeyFlags::from_bits_truncate(buf.get_...
Rust
0
#!/usr/pkg/bin/python3.13 # # Time-stamp: <2025/03/14 12:37:34 (UT+08:00) daisuke> # ########################################################################### # # importing modules # # importing argparse module import argparse # importing socket module import socket #############################################...
Python
1
st()[0][0] except Exception as e: msg = str(e) print(e) if "Parser exception" not in msg and "Binder exception" not in msg and "Interrupted" not in msg: exceptions.append((query, msg)) continue try: res_G1 = client_G1.run(query).get...
Python
1
import unittest import pandas as pd from pandas.testing import assert_frame_equal from styleframe import StyleFrame, Styler, Container, Series, utils class SeriesTest(unittest.TestCase): @classmethod def setUpClass(cls): cls.pandas_series = pd.Series((None, 1)) cls.sf_series = Series((Contai...
Python
1
generating an interrupt based on COMPR1."] DIS = 0, #[doc = "1: Enable counter/timer A1 to generate an interrupt based on COMPR1."] EN = 1, } impl From<TMRA1IE1_A> for bool { #[inline(always)] fn from(variant: TMRA1IE1_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `TMRA1IE...
Rust
0
rse()?) } Ok(ports) } #[derive(Debug, Clone)] struct Bridge { ports: Vec<Port>, used_pins: HashSet<Port>, next_pin: usize, value: usize, } impl Bridge { fn new(start: Port) -> Bridge { let ports = vec![start]; let next_pin = start.other(0); let used_pins = [start]....
Rust
0
::from(unidi + 8)), Err(Error::StreamLimitError) ); } #[test] fn remote_stream_limits_new_stream_client() { remote_stream_limits(Role::Client, 1, 3); } #[test] fn remote_stream_limits_new_stream_server() { remote_stream_limits(Role::Server, 0, 2); } ...
Rust
0
TERPMASK, CHIPSIZEX, CHIPSIZEY, SSM, SSM1, SX, SY, offset2vx_1, offset2vx_2, offset2vy_1, ...
Python
1
can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fie...
Rust
0
* dx_o; if close_to_zero(denominator, INTERSECTION_CLOSE_EPS) { return IntersectCalcResult::ParallelLineSegs; } let dx0_so = self.p0.x - other.p0.x; let dy0_so = self.p0.y - other.p0.y; let t = (dy0_so *...
Rust
0
("input file name missing"); fs::read_to_string(input_file)? .lines() .map(str::parse) .collect::<Result<_, _>>() .map_err(Into::into) } #[cfg(test)] mod tests { use super::*; const MAP: &str = "L.LL.LL.LL LLLLLLL.LL L.L.L..L.....
Rust
0
.Error, {"error": str(e)}) return utils.build_ret(ErrorMsg.Success, ret_data) delete_domain_fields = ns.model('deleteAssetDomain', { '_id': fields.List(fields.String(required=True, description="数据_id")) }) @ns.route('/delete/') class DeleteARLAssetDomain(ARLResource): @auth @ns.expect(delete_d...
Python
1
::V2, } } fn gen_testing_manager( handle_func: Arc<dyn Fn(Vec<String>) -> RespVec + Send + Sync + 'static>, config: ServerProxyConfig, ) -> TestMetaManager { let config = Arc::new(config); let client_factory = Arc::new(DummyClientFactory::new(handle_func.clone())); ...
Rust
0
from dataclasses import dataclass from pathlib import Path from typing import Union import torch import torch.nn as nn from envs import TorchEnv, WorldModelEnv from models.actor_critic import ActorCritic, ActorCriticConfig, ActorCriticLossConfig from models.diffusion import Denoiser, DenoiserConfig, SigmaDistribution...
Python
1
alize, Clone, Eq, PartialEq, Debug)] pub struct Ctrl { pub nametable_select: Option<u8>, pub address_increment_vertical: bool, pub sprite_pattern_table_high: bool, pub bgd_pattern_table_high: bool, pub sprite_size_large: bool, pub ppu_output_to_ext: bool, pub gen_nmi: bool, } impl Ctrl { ...
Rust
0
s .axis_iter_mut(Axis(0)) .map(|mut tile_sum| { tile_sum.par_map_inplace(|e| *e *= fft_normalisation); Field { values: tile_sum.to_owned(), pitch: sp_step, } }) .collect() } pub(crate) fn div_up(num: usize, denom: usize...
Rust
0
toBox, SquatJumpsInAndOut, WeightedAlternatingJumpLunge, WeightedCrossKneeStrike, WeightedDepthJump, WeightedFrontKneeStrike, WeightedHighBoxJump, WeightedIsometricExplosiveJumpSquat, WeightedJumpSquat, WeightedLateralLeapAndHop, WeightedLateralPlyoSquats, WeightedLateralSlid...
Rust
0
as j in first i elements // dp[i][j]=dp[i-1][j] // dp[i][j]=dp[i-1][j] + dp[i-1][j-nums[i]] if j>=nums[i] let mut dp = vec![vec![0; sum as usize + 1]; 1 + nums.len()]; dp[0][0] = 1; for i in 1..(nums.len() + 1) { let val = nums[i - 1]; for j in 0..=neg_s...
Rust
0
Equipment>, } impl ClientBoundPacket for C47EntityEquipment { fn encode(self) -> PacketEncoder { let mut buf = Vec::new(); buf.write_varint(self.entity_id); for slot in self.equipment { buf.write_varint(slot.slot); if let Some(slot) = slot.item { buf....
Rust
0
?; self.outgoing.decrypt(decipher, Sender::Responder)?; Ok(()) } } use clap::values_t; use clap::ArgMatches; use crate::caesar; use crate::io; pub fn run(matches: ArgMatches) { let text = get_text(&matches); let output = process_text(&matches, &text); if matches.is_present("output") {...
Rust
0
, Copy, Clone)] pub struct xcb_get_input_focus_cookie_t { pub sequence: ::std::os::raw::c_uint, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct xcb_get_input_focus_request_t { pub major_opcode: u8, pub pad0: u8, pub length: u16, } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct xcb_get_input_f...
Rust
0
]) /// .build(); /// ``` /// /// [`builder`]: SelectBuilder pub fn select<N: Into<String>>(name: N) -> SelectBuilder<'static> { SelectBuilder::new(name.into()) } /// Prompt that allows the user to select from a list of options with indices /// /// The choices are represe...
Rust
0
ges=messages ) # Extract the assistant's message from the response assistant_message = response['choices'][0]['message']['content'] # Append assistant's message to history st.session_state.history.append({ "message": assistant_message, "is_user": False }) # Take user inpu...
Python
1
* 62_000., 23.); self.cal_2 = CalPt::new(0.4, -5. * 62_000., 23.); self.cal_3 = None; } /// Set calibration to a sensible default for phosphate, with unit mg/L pub fn cal_phosphate_default(&mut self) { self.cal_1 = CalPt::new(0.25, -2. * 62_000., 23.); self.cal_2 = CalPt::n...
Rust
0
from .quantization import pack_i4, unpack_i4, asym_quant_dequant, sym_quant_dequant from .hadamard import ( matmul_hadU_cuda, random_hadamard_matrix, apply_exact_had_to_linear)
Python
1
"Nc1ccn([C@H]2C[C@H](O)[C@@H](COP(O)(O)=O)O2)c(=O)n1", # 2'-deoxycytosine 5'-monophosphate "Cc1cn([C@H]2C[C@H](O)[C@@H](COP(O)(=O)Oc3ccc(cc3)[N+]([O-])=O)O2)c(=O)[nH]c1=O", # p-nitrophenyl thymidine 5'-monophosphate "N1(C2=C(C(N)=NC(=N2)N)N=C1)[C@@H]3O[C@H](COP([O-])([O-])=O)[C@H](C3)O", # 2-amino-2...
Python
1
""", r"Undefined identifier 'c2' in expression", 8, 15, "c2[0]", ), ( """ OPENQASM 3.0; include "stdgates.inc"; qubit[2] q; bit[2] c; h q; measure q->c; ...
Python
1
sf.write(path, y, args.sample_rate) # Generate audio by slerping between two diffusion generated RAVE latents. def interpolate_seeds(model, rave, args, seed): with torch.no_grad(): torch.manual_seed(seed) z_length = args.latent_length * args.length_mult rave_dims = get_latent_dim(rave) ...
Python
1
# Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class StockMove(models.Model): _inherit = "stock.move" def _l10n_in_get_product_price_unit(self): self.ensure_one() if line_id := self.sale_line_id: if qty := line_id.product_uom_qt...
Python
1
-> &'a mut W { self.bit(false) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits &= !(1 << 1); self.w.bits |= ((value as u8) & 1) << 1; self.w } } #[doc = r"Value of the field"] pub struct USB_RXCSRH...
Rust
0
KeyNameLength], pub alias: [c_char; XkbKeyNameLength], } #[derive(Debug, Clone, Copy, PartialEq)] #[repr(C)] pub struct _XkbKeyNameRec { pub name: [c_char; XkbKeyNameLength], } #[derive(Debug, Clone, Copy, PartialEq)] #[repr(C)] pub struct _XkbNamesRec { pub keycodes: Atom, pub geometry: Atom, pub symbols: ...
Rust
0
import asyncio import os import random from datetime import timedelta from typing import AsyncIterable from streamstore import S2 from streamstore.schemas import Record from streamstore.utils import append_inputs_gen ACCESS_TOKEN = os.getenv("S2_ACCESS_TOKEN") MY_BASIN = os.getenv("MY_BASIN") MY_STREAM = os.getenv("M...
Python
1
clubhouse_url(&self, url: &mut Url) -> () { url.query_pairs_mut() .append_pair("token", &self.clubhouse_api_token); } /// Given a `hyper::Request`, check it is authorized /// /// # Arguments /// /// * `req` - A hyper request pub fn validate_bouncer_authorization(&self, r...
Rust
0
, "42", "my-val"]); let mut blynk = Blynk::new("abc".to_string()); let handler: EventsHandler = Default::default(); blynk.set_handler(handler); blynk.process(msg).unwrap(); assert_eq!(42, blynk.handler().unwrap().pin_num); assert_eq!("my-val", blynk.handler().unwrap().d...
Rust
0
Location), b"11" => Some(PartyRole::OrderOriginationTrader), b"12" => Some(PartyRole::ExecutingTrader), b"13" => Some(PartyRole::OrderOriginationFirm), b"14" => Some(PartyRole::GiveupClearingFirm), b"15" => Some(PartyRole::CorrespondantClearingFirm), ...
Rust
0
r_find_module_shimrr-rrrrr.Xs r.c@s(eZdZdZddZddZddZdS) Loaderz'Abstract base class for import loaders.cCsdS)zReturn a module to initialize and into which to load. This method should rais...
Python
1
eval_pred[data_name]['predictions'].append(calculate_logits(data_item)) eval_pred[data_name]['label_ids'].append(data_item['label']) for data_name in eval_pred.keys(): ans = eval.compute_single_metrics( utils.SimpleNamespace( predictions=np.concatenate...
Python
1
1.0, 2.0, 3.0], /// vec![1.0, 0.0, 1.0, 0.0], /// vec![5.0, 5.0, 5.0, 5.0]]); /// /// let zero_matrix = lingebra::Matrix::zeroes(3, 4); /// let result = &matrix + &zero_matrix; /// assert_eq!(result, matrix) ///...
Rust
0
6,T7,T8,T9,T10,T11) { fn pop_back(self) -> (Self::Last,Self::Init) { (self.11,(self.0,self.1,self.2,self.3,self.4,self.5,self.6,self.7,self.8,self.9,self.10)) } } // ================================= // === Conversion Tuple -> HList === // ================================= impl From<()> for hlist::t...
Rust
0
ository.create.assert_not_called() apt_signer.sign.assert_not_called() def test_error_handled_when_create_repository_failed(self): # Given timer, apt_repository, apt_signer, observer, directory_service, config = create_components() apt_repository.create.side_effect = Exception('Repo...
Python
1
self.assertEqual(res, datetime.timedelta().max) res = yield ctx.eval('datetime.timedelta().resolution', evaltype=EVALTYPE_CODE) self.assertEqual(res, datetime.timedelta().resolution) @tornado.testing.gen_test def test_partial(self): yield self.resetTables() t...
Python
1
n = int(input()) data = [] for i in range(n): inp = input().split() data.append((inp[0], *map(int, inp[1:]), n - i - 1)) data.sort(key=lambda a: a[1] * 1000000 + a[2] * 10000 + a[3] * 100 + a[4]) for i in data: print(i[0])
Python
1
import time from utils.screenshot import * from utils.click import * from utils.rolls import * from utils.rarity import * from utils.paths import resource_path from handler.state import * CONST_RESET_BUTTON_PATH = resource_path("template/reset_button.png") def run_task(roll_type, line_count, orange_bool, tainted_bo...
Python
1
nfos) chunk = ChatCompletionChunk(model=model, choices=choices, usage=None) logger.debug(chunk) yield f"data: {chunk.model_dump_json(by_alias=True)}\n\n" choices = [ ChatCompletionStreamingChoice( index=i, ...
Python
1
impl<'a> WriteBinary<&Self> for HmtxTable<'a> { type Output = (); fn write<C: WriteContext>(ctxt: &mut C, table: &HmtxTable<'a>) -> Result<(), WriteError> { ReadArrayCow::write(ctxt, &table.h_metrics)?; ReadArrayCow::write(ctxt, &table.left_side_bearings)?; Ok(()) } } impl<'a> Hmt...
Rust
0
o older PIL versions img1 = image1.resize((width, height), Image.LANCZOS) img2 = image2.resize((width, height), Image.LANCZOS) # Convert to RGB if needed if img1.mode != 'RGB': img1 = img1.convert('RGB') if img2.mode != 'RGB': img2 = img2....
Python
1
adients)) ) for accum_gradient, gradient in zip(self._gradients, gradients): accum_gradient.assign_add(gradient, read_value=False) self._accum_steps.assign_add(1) def reset(self): """Resets the accumulated gradients on the current replica.""" if not self._gr...
Python
1
&first_msg, &ks)?; let (vs, second_msg) = AHPForPLONK::verifier_second_round(vs, rng)?; let third_oracles = AHPForPLONK::prover_third_round(ps, &second_msg, &ks)?; let (vs, third_msg) = AHPForPLONK::verifier_third_round(vs, rng)?; let polynomials: Vec<_> = index .iter() ...
Rust
0
in32api.GetLastError()) def testVkKeyScan(self): # hopefully ' ' doesn't depend on the locale! self.assertEqual(win32api.VkKeyScan(" "), 32) def testVkKeyScanEx(self): # hopefully ' ' doesn't depend on the locale! self.assertEqual(win32api.VkKeyScanEx(" ", 0), 32) def test...
Python
1
ytes { match (self.state, b) { (Before, b'|') => self.state = InsideFirst, (Before, _) => {}, (InsideFirst, b'|') => self.state = After, (InsideFirst, b) => if let Some(n) = unhex(b)? { self.state = InsideSecond(n); ...
Rust
0
ponent_direct(entity, Rotation::new(yaw, pitch)); m.add_component_direct(entity, Velocity::new(0.0, 0.0, 0.0)); m.add_component_direct(entity, TargetPosition::new(x, y, z)); m.add_component_direct(entity, TargetRotation::new(yaw, pitch)); m.add_component_direct( entity, ...
Rust
0
itor, &_i.brace_token.span)), variants: FoldHelper::lift(_i.variants, |it| _visitor.fold_variant(it)), } } #[cfg(feature = "derive")] pub fn fold_data_struct<V: Fold + ?Sized>(_visitor: &mut V, _i: DataStruct) -> DataStruct { DataStruct { struct_token: Token![struct](tokens_helper(_visitor, &_i....
Rust
0
_mut_slice()); let hss_parameter = [ HssParameter::new(LmotsAlgorithm::LmotsW2, LmsAlgorithm::LmsH5), HssParameter::new(LmotsAlgorithm::LmotsW2, LmsAlgorithm::LmsH5), ]; b.iter(|| { let _ = keygen::<Sha256_256>(&hss_parameter, &seed, None); }); } ...
Rust
0
# -*- coding: utf-8 -*- ############################################################################## # Copyright (C) 2009-TODAY odooai.cn Ltd. https://www.odooai.cn # Author: Ivan Deng,300883@qq.com # You can modify it under the terms of the GNU LESSER # GENERAL PUBLIC LICENSE (LGPL v3), Version 3. # S...
Python
1
"CredentialSubject": [ { "name": "id", "type": "string" }, ], "Proof": [ { "name": "@context", "type": "string" }, { "name": "verificationMethod", "type": "string" }, { "name": "created", "type": "string" }, { "nam...
Rust
0
CommandError::from("Invalid option.")), }; } let data_read = ctx.data.read().await; let pool = data_read.get::<ConnectionPool>().unwrap(); if toggle { if let Ok(r) = sqlx::query!( "SELECT can_change_na FROM config WHERE guild_id = $1", msg.guild_id.unwrap().0 as...
Rust
0
_id, category_id)] pub struct CrateCategory { crate_id: i32, category_id: i32, } impl Category { pub fn encodable(self) -> EncodableCategory { let Category { crates_cnt, category, slug, description, created_at, .. } = s...
Rust
0
$ptr:expr $(, $replace:expr )* ) => { { use utils::locale::LOCALE; let default = format!( "Unknown error or info message, please fix in local.json `({})`", $ptr ); #[allow(unused_mut)] let mut s = match LOCALE.pointer(...
Rust
0
se std::path::Path; #[cfg(target_arch = "x86")] #[cfg(target_feature = "sse3")] use std::arch::x86::*; #[cfg(target_arch = "x86_64")] #[cfg(target_feature = "sse3")] use std::arch::x86_64::*; #[cfg(target_feature = "sse3")] const ALIGN_BYTE: usize = 16; #[cfg(not(target_feature = "sse3"))] const ALIGN_BYTE: usize =...
Rust
0
import codecs import bert_score.score as score import pdb import nltk # f= codecs.open('conll_des_title_rank_full_revised.txt','r', errors='ignore') # f= codecs.open('wnut16_des_title_rank_full_revised_all.txt','r', errors='ignore') f= codecs.open('en_retrieval.txt','r', errors='ignore') # f= codecs.open('test.txt','r'...
Python
1
import cv2 import numpy as np import configparser from hx711 import HX711 from opencvYOLO import opencvYOLO # Load configuration from pos.ini config = configparser.ConfigParser() config.read('pos.ini') # Initialize the YOLO model using the opencvYOLO class yolo = opencvYOLO(modeltype=config['yoloModel']['modeltype'],...
Python
1
filtering on a specific tag pub fn get_stories_by_tag( &self, tag: &str, by_date: bool, page: usize, time_offset_in_secs: Option<u64>, ) -> Result<Vec<Story>> { let story_limit = CONFIG .get() .unwrap() .client .sto...
Rust
0
} if let Some(v) = self.ovr.max { qos.max = v; } qos.sanitize(); Some(qos) } pub fn apply(&self, rctx: &mut RunCtx) -> Result<()> { // This should be called before rctx is started. assert!(!rctx.agent_running()); // Apply the calculated...
Rust
0
## Copyright (c) 2023 unSkript, Inc ## Written by Doug Sillars and ChatGPT ## All rights reserved. ## import pprint from typing import Dict from pydantic import BaseModel, Field from beartype import beartype class InputSchema(BaseModel): instance: str = Field( title='EC2 Instance', description='...
Python
1
########################################################################## # # Copyright 2008-2010 VMware, Inc. # All Rights Reserved. # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software withou...
Python
1
class Util: isLauncherRunning = False system = any os = '' def clearTerminal(os): if os == 'cls': _ = Util.system('cls') else: _ = Util.system('clear')
Python
1
from langchain_core.prompts import PromptTemplate from langchain_google_genai import ChatGoogleGenerativeAI from langchain_chroma import Chroma from langchain_google_vertexai import VertexAIEmbeddings from langchain_core.output_parsers import StrOutputParser from langchain_c...
Python
1
# -*- coding: utf-8 -*- """WebScrapingandDataVisualization.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1vlSi4YDfSJIMUoKRToOrw0HAcaJr4cpa """ # Vivian Luu # 3/24/2024 # One of the issues with webscraping is that if you are constantly pinging a...
Python
1
_ => unreachable!(), }; ll_parse_multerm(val, input) } Token::RPar => Ok((Some(val), input)), Token::Op(_) | Token::EOI => Ok((Some(val), input)), _ => Err(MexeError::UnexpectedToken), } } fn ll_parse_factor(input: &[Token]) -> Result<(Option<...
Rust
0
_SYMBOL_MASK: u32 = 2; pub const JS_GPN_PRIVATE_MASK: u32 = 4; pub const JS_GPN_ENUM_ONLY: u32 = 16; pub const JS_GPN_SET_ENUM: u32 = 32; pub const JS_PARSE_JSON_EXT: u32 = 1; pub const JS_WRITE_OBJ_BYTECODE: u32 = 1; pub const JS_WRITE_OBJ_BSWAP: u32 = 2; pub const JS_WRITE_OBJ_SAB: u32 = 4; pub const JS_WRITE_OBJ_REF...
Rust
0
_eq_arr2!( arr2(&[[4.0, 5.5], [4.0, 5.5], [4.0, 5.5]]), x.gradient().clone() ); assert_rel_eq_arr2!( arr2(&[[1.0, 1.0, 1.0], [4.0, 4.0, 4.0]]), w.gradient().clone() ); } } <gh_stars>0 // Converted from the tests for uBPF <https://github.com/iov...
Rust
0
# Copyright 2015-2016 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """The fabric handler for the WebSocket connection.""" from maasserver.forms.fabric import FabricForm from maasserver.models.fabric import Fabric from maasserver.permissions ...
Python
1
fn variant(&self) -> RUN1_A { match self.bits { false => RUN1_A::STOP_, true => RUN1_A::RUN_, } } #[doc = "Checks if the value of the field is `STOP_`"] #[inline(always)] pub fn is_stop_(&self) -> bool { *self == RUN1_A::STOP_ } #[doc = "Checks if...
Rust
0
at, str]]]], output_path: str): try: with open(output_path, "w", encoding="utf-8") as f: for (start, end, text, words) in segments: f.write(f"[{start:.2f} - {end:.2f}] {text}\n") for w_start, w_end, w_text in words: f.write(f" ({w_start:.2f}...
Python
1
not to update // `ledger.claimed_rewards` in this case. let era_payout = <ErasValidatorReward<T>>::get(&era).ok_or_else(|| { Error::<T>::InvalidEraToReward .with_weight(T::WeightInfo::payout_stakers_alive_staked(0)) })?; let controller = Self::bonded(&validator_stash).ok_or( Error::<T>::NotStash.wit...
Rust
0
from utils.api_client import fetch_pokemon_data from qubo_solver.qubo_matrix import generate_qubo_matrix from qubo_solver.qubo_solver import solve_qubo from visualization.qubo_heatmap import visualize_qubo_matrix from visualization.team_distribution import visualize_team_distribution # Import the team distribution vis...
Python
1
Clone, Default, Serialize, Deserialize)] pub struct ChainHeader { pub cut_off: ChainTimestamp, } <gh_stars>100-1000 // Copyright 2018 The Grin Developers // // 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 cop...
Rust
0
""" Define las rutas (endpoints) para operaciones relacionadas con usuarios en la API de Caja Plus. Términos clave: - Blueprint: Permite modularizar rutas en Flask, agrupando endpoints relacionados bajo un mismo prefijo. - Endpoint: URL a la que se puede acceder desde el frontend para realizar una acción (registrar, o...
Python
1
range(self.n): multi_list.append(i + (self.mpc_instance.layer_ID) * self.n) def multicast(msg): for i in range(self.n): send(multi_list[i], msg) self.tagvars[tag]['io'] = [send, recv, multicast] self.tagvars[tag]['in_share_recovery'] = False ...
Python
1