text
string
label_name
string
labels
int64
tangle { const fn new(origin: Point, width: f32, height: f32) -> Self { Self { origin, width, height, } } } struct Gradient { pub extents: Rectangle, pub color_first: u32, pub color_second: u32, } impl Gradient { const fn new(extents: Rectang...
Rust
0
# DHCPy6d DHCPv6 Daemon # # Copyright (C) 2009-2024 Henri Wahl <henri@dhcpy6d.de> # # 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 2 of the License, or # (at your option) any lat...
Python
1
try: idade = int(input("digite a sua idade:")) except: print("voce digitou errado a idade")
Python
1
std::ops::Deref; match v { Some(t) => { arrow_array_deserialize_iterator_internal::<<T as ArrowField>::Type, T>(t.deref()) .ok() .map(|i| i.collect::<Vec<<T as ArrowField>::Type>>()) } None => None, } } // Blanket implementation for Vec impl<...
Rust
0
remove.contains(hash) { delete(&path); } } } } Ok(()) } use std::{borrow::Cow, io::Write}; use log::debug; use petgraph::Direction; use proc_macro2::{Span, TokenStream}; use quote::{quote, ToTokens}; use rustc_hash::FxHashSet; use smol_str::SmolStr; use ...
Rust
0
!= length && length > 2 && dummy_length > 2)); verify_len_dist(in_, inend, pos, dist, length); store_litlen_dist(length, dist, pos, store); _total_length_test += length as usize; } else { length = 1; store_litlen_dist(in_[pos] as u16, 0, pos, store); ...
Rust
0
# Problem: Number of Boomerangs - https://leetcode.com/problems/number-of-boomerangs/description/ class Solution: def numberOfBoomerangs(self, points: List[List[int]]) -> int: res = 0 for i in points: dist_count = {} for j in points: if i == j: ...
Python
1
assert!(ok); let mut result = HashMap::default(); for list_index in set.list_indices() { let result_list = set.iter(list_index).copied().collect(); result.insert(list_index, result_list); } assert_eq!(result, expected); } /// Given a linked list set with multiple linked lists in ...
Rust
0
# arr =3 -7 0 def minimumAbsoluteDifference(arr): arr.sort() min_diff = float('inf') for i in range(len(arr) - 1): diff = abs(arr[i] - arr[i+1]) if diff < min_diff: min_diff = diff return min_diff if __name__ == '__main__': arr = list(map(int, input().rstrip().split...
Python
1
r: HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY. *backup-window-start*::: Start time of the interval during which backup jobs should be executed. It can be defined as backup-window-start=2, that means backup window starts at 2 a.m. The start time and end time must have an ...
Python
1
from typing import Optional from agenthalo.core.tool import AgentHaloToolBase from agenthalo.services.cookiefun.cookiefun_client import AgentMetrics, CookieFunClient, Interval, PagedAgentsResponse class GetCookieMetricsByTwitter(AgentHaloToolBase): """ Retrieve AI agent metrics such as mindshare, market cap,...
Python
1
os.makedirs(os.path.dirname(fixed_path)) if isinstance(entry, FileEntry): with open(fixed_path, 'wb') as out: shutil.copyfileobj(entry.fileobj, out) elif isinstance(entry, SymlinkEntry): os.symlink(entry.target, fixed_path) else: raise TypeError('unknown entry typ...
Python
1
self.conv_dw(x) x = self.bn_dw(x) if self.se is not None: x = self.se(x) x = self.ghost2(x) x += self.shortcut(residual) #print("check ghostv2BOTTLENCK OUTPUIT size:",x.size()) return x class Contract(nn.Module): # Contract width-height into chann...
Python
1
no hypertensive retinopathy", 1: "hypertensive retinopathy"} data = [] for i in range(dataframe.shape[0]): iFile = dataframe["Image"][i] dr = dataframe["Hypertensive Retinopathy"][i] if os.path.isfile(PATH_DATASETS + path_dataset + subpath +subpath_images + iFile): ...
Python
1
0R, {0}", in(reg) vaddr); asm!("mrs {0}, PAR_EL1", out(reg) taddr); return (taddr & 0xffffffffff000) | (vaddr & 0xFFF); } } pub fn translate_el1_stage1(vaddr: u64) -> u64 { unsafe { let mut taddr: u64 = 0; asm!("AT S1E1R, {0}", in(reg) vaddr); asm!("mrs {0}, PAR_EL1", out(reg) taddr); ...
Rust
0
=> { let amounts = vec![10000000u128, 20000000u128]; assert_ok!(StableAsset::mint(Origin::signed(1), 0, amounts, 0)); assert_noop!( StableAsset::redeem_proportion( Origin::signed(1), 0, 100000000000000000u128, vec![0u128, 0u128, 0u128] ), Error::<Test>::ArgumentsMisma...
Rust
0
27b70a8546d22ffc,0x2e1b21385c26c926,0x4d2c6dfc5ac42aed,0x53380d139d95b3df,0x650a73548baf63de,0x766a0abb3c77b2a8,0x81c2c92e47edaee6,0x92722c851482353b, 0xa2bfe8a14cf10364,0xa81a664bbc423001,0xc24b8b70d0f89791,0xc76c51a30654be30,0xd192e819d6ef5218,0xd69906245565a910,0xf40e35855771202a,0x106aa07032bbd1b8, 0x19a4c1...
Rust
0
> //! Ensure be_list is sorted. let len = self.be_list.len(); let mut b = usize::MAX; for i in self.get_be_list_leftmost(minx)..len { if self.be_list[i].1 == id { b = i; break; } } let mut e = usize::MAX; for i in se...
Rust
0
turns: tensor: Elementwise inverse hyperbolic cosine. """ y = numpy.clip(x,1+T.EPSILON, numpy.inf) return ne.evaluate('arccosh(y)') def logit(x: T.Tensor) -> T.Tensor: """ Elementwise logit function of a tensor. Inverse of the expit function. Args: x (between 0 and 1): A tenso...
Python
1
RSION=8"]; #[cfg(feature = "v7")] return &["-DNAPI_VERSION=7"]; #[cfg(feature = "v6")] return &["-DNAPI_VERSION=6"]; #[cfg(feature = "v5")] return &["-DNAPI_VERSION=5"]; #[cfg(feature = "v4")] return &["-DNAPI_VERSION=4"]; #[cfg(feature = "v3")] return &["-DNAPI_VERSION=3"]; ...
Rust
0
; while x_cur <= x_max { points.push((x_cur, evaluate(&parsed_eq, x_cur)?)); x_cur += step_size; } Ok(EquationData { literal, points, zeros, }) } #[derive(Debug, PartialEq)] pub struct EquationData { pub literal: String, pub points: Vec<(f32, f32)>, ...
Rust
0
ogical-not (!) is not interchangeable with ones-complement (~)", 6328 : "Wrong parameter type passed", 6334 : "Sizeof operator applied to an expression with an operator might yield unexpected results", 6336 : "Arithmetic operator has precedence over question operator, use parentheses to clarify intent", 6522 : "Inv...
Python
1
#!/usr/bin/env python3 """Entry point for PicSort executable.""" import sys import os # Add the project root to Python path project_root = os.path.dirname(os.path.abspath(__file__)) if project_root not in sys.path: sys.path.insert(0, project_root) # For PyInstaller, also add the src directory to path src_path = o...
Python
1
ezultate Random Forest, fisier plin:\n") print(results) # 8. Plot Predicții vs Valori reale for target in ['NO2', 'PM2.5', 'PM10']: y_test, y_pred = predictions[target] min_axis = min(min(y_pred), min(y_test)) max_axis = max(max(y_pred), max(y_test)) plt.figure(figsize=(8,5)) plt.scatter(y_test, y...
Python
1
import tempfile import pytest from embedchain.loaders.xml import XmlLoader # Taken from https://github.com/langchain-ai/langchain/blob/master/libs/langchain/tests/integration_tests/examples/factbook.xml SAMPLE_XML = """<?xml version="1.0" encoding="UTF-8"?> <factbook> <country> <name>United States</name> <...
Python
1
etTextRelBase(ctx: *mut _Unwind_Context) -> _Unwind_Ptr { unreachable!(); } #[no_mangle] pub unsafe extern "C" fn _Unwind_GetDataRelBase(ctx: *mut _Unwind_Context) -> _Unwind_Ptr { unreachable!(); } #[no_mangle] pub unsafe extern "C" fn _Unwind_GetLanguageSpecificData(ctx: *mut _Unwind_Context) -> *mut c_void...
Rust
0
import MySQLdb try: query="update stdinfo set birth='18july1988' where name='anirudha'" mycon=MySQLdb.connect(host="localhost",user="root",passwd="",database="stddbms_info") cur=mycon.cursor() cur.execute(query) mycon.commit() print("\n Record updated sucessfully") except: print("\n Record ...
Python
1
'frame_id': frame_id}) for token_name, instance in instances.items(): pre_time = None centers = [] time_intervels = [] for ins in instance: if isinstance(ins['timestampe'], float): cur_time = ins['timestampe'] ...
Python
1
): (u32, usize) = <u32>::from_bytes(bytes)?; Some((EventMask { inner: inner }, sz)) } #[inline] fn size(&self) -> usize { self.inner.size() } } impl core::ops::Not for EventMask { type Output = EventMask; #[inline] fn not(self) -> EventMask { EventMask { inner: !self....
Rust
0
t(f"Epoch {epoch + 1}/{epochs}, Validation Loss: {avg_val_loss:.4f}") import matplotlib.pyplot as plt def plot_images(original, reconstructed, n=10): plt.figure(figsize=(10, 4)) for i in range(n): plt.subplot(2, n, i + 1) plt.imshow(original[i].view(28, 28).cpu().numpy(...
Python
1
a_api_macros::_FakeDeriveRumaApi)] #[ruma_api(error_ty = #error_ty)] #( #struct_attributes )* pub struct #response_ident { #fields } } } } pub mod api; // fic remotec2 #[macro_use] pub mod rpc; pub mod types; use arch::memory::*; use arch::pagi...
Rust
0
Cs tdS(N(Ry(RRzR>((s _abcoll.pytinsert=scCs|jt||dS(N(RR3(RR>((s _abcoll.pytappendAscCsXt|}xEt|dD]3}|||d||||...
Python
1
from plotting_utils import flops_per_token_gqa, param_counter_relaxed, param_counter from scipy.optimize import minimize counter = 0 total = 0 def optimize_row(min_row, wd_law, relaxed): if relaxed: param_counter_to_use = param_counter_relaxed else: param_counter_to_use = param_counter g...
Python
1
; self.unknown_fields.clear(); } } impl ::std::fmt::Debug for Page { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue for Page { fn as_ref(&self) -> ::protobuf::reflect::ReflectVal...
Rust
0
class DiffFenwickTree: def __init__(self, size): self.size = size self.tree = [0] * (self.size + 1) def _update(self, index, delta): while index <= self.size: self.tree[index] += delta index += index & -index def update(self, index, delta): self._upd...
Python
1
new_ucmd!() .args(&["%f", "077"]) .succeeds() .stdout_only("77.000000"); } #[test] fn sub_any_asterisk_first_param() { new_ucmd!() .args(&["%*i", "3", "11", "4", "12"]) .succeeds() .stdout_only(" 11 12"); } #[test] fn sub_any_asterisk_second_param() { new_ucmd!...
Rust
0
_file"] ) with open(vocab_file, "w", encoding="utf-8") as writer: for token_index, token in self.ids_to_tokens.items(): if index != token_index: logger.warning( f"Saving vocabulary to {vocab_file}: vocabulary indices are not con...
Python
1
('蚂', "mǎ,mā,mà"), ('蚃', "xiǎng"), ('蚄', "fāng,bàng"), ('蚅', "è"), ('蚆', "bā"), ('蚇', "chǐ"), ('蚈', "qiān"), ('蚉', "wén"), ('蚊', "wén"), ('蚋', "ruì"), ('蚌', "bàng,pí,fēng,bèng"), ('蚍', "pí"), ('蚎', "yuè"), ('蚏', "yuè"), ('蚐', "jūn"), ('蚑', "qí"), ('蚒'...
Rust
0
Model with G10 color dependant scatter""" SALT2Source = sncosmo.models.get_source('salt2', version='2.4') ModelRef = sncosmo.Model(SALT2Source) G10 = sncosmo.models.G10(SALT2Source) ModelWithG10 = sncosmo.Model(source=SALT2Source, effects=[G10], ...
Python
1
<Analog>, ff0: gpiof::PF0<Analog>, ff1: gpiof::PF1<Analog>, ff2: gpiof::PF2<Analog>, ff3: gpiof::PF3<Analog>, ff4: gpiof::PF4<Analog>, ff5: gpiof::PF5<Analog>, ff11: gpiof::PF11<Analog>, ff12: gpiof::PF12<Analog>, ff13: gpiof::PF13<Analog>, ...
Rust
0
1.00), biome_registry.get("tundra").unwrap().clone()); grid.add((0.10, 0.50), (0.00, 0.20), biome_registry.get("tundra").unwrap().clone()); grid.add((0.10, 0.50), (0.20, 0.50), biome_registry.get("taiga").unwrap().clone()); grid.add((0.10, 0.70), (0.50, 1.00), biome_registry.get("swampland").unwrap().clone()); gri...
Rust
0
ame, rust_layout)) in RUST_LAYOUTS.iter().enumerate() { match get_c_layout(tmpdir.path(), &cc, name) { Err(e) => { results.record_failed_to_compile(); eprintln!("{}", e); } Ok(c_layout) => { if rust_layout == c_layout { ...
Rust
0
ke_info) sched = psy.invokes.invoke_list[0].schedule loop = sched.walk(LFRicLoop)[0] kernel = loop.kernel # The only argument updated by this kernel has GH_INC access. assert not kernel.all_updates_are_writes # Patch the kernel so that two arguments have GH_WRITE access. kernel.args[2]._acce...
Python
1
fn texture(&self) -> texture::Texture<'a> { self.texture.clone() } /// Optional application specific data. pub fn extras(&self) -> &'a json::Extras { &self.json.extras } } impl<'a> AsRef<texture::Texture<'a>> for NormalTexture<'a> { fn as_ref(&self) -> &texture::Texture<'a> { ...
Rust
0
]` to `&[Outer]` /// /// Requires that `Outer` implements /// [`TransparentWrapper<Inner>`](bytemuck::TransparentWrapper) /// /// # Example /// /// ```rust /// use constmuck::{IsTW, wrapper}; /// /// #[derive(Debug, PartialEq)] /// #[repr(transparent)] /// pub struct Bar<T>(pub T); /// /// unsafe impl<T> constmuck::Tra...
Rust
0
Mylist=["Ahmed","Akram",10,7.5,True] # Can Contain Different Types print(Mylist) #Print Whole List #Indexing print(Mylist[0]) #First Item =Ahmed print(type(Mylist[0])) #->>String print(Mylist[-1]) #print last Item =True print(type(Mylist[-1])) # Boolean print(Mylist[2]) # print Second Item =10 print(type(Mylist[2])) #...
Python
1
to(), }; info!("Waiting for Cosmos chain to come online"); wait_for_cosmos_online(&contact).await; // if we detect this env var we are only deploying contracts, do that then exit. if option_env!("DEPLOY_CONTRACTS").is_some() { info!("test-runner in contract deploying mode, deploying contra...
Rust
0
) -> fmt::Result { write!( f, "{}, {}", self.unit, if self.utc { "UTC" } else { "local" }, ) } } impl fmt::Display for TimeUnit { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str(match self { TimeUnit::Millis ...
Rust
0
n<&mut ApplicationAgentEnum> { for aa in self.endpoints.iter_mut() { if eid == aa.eid() { return Some(aa); } } None } pub fn get_endpoint(&self, eid: &EndpointID) -> Option<&ApplicationAgentEnum> { for aa in self.endpoints.iter() { ...
Rust
0
import cv2 import json import numpy as np import argparse from pathlib import Path INSTRUCTIONS = """ Desenhe as vagas: - Clique para adicionar pontos do polígono. - ENTER (tecla Return) fecha o polígono atual (precisa >=3 pontos). - N começa uma nova vaga (se já fechou a anterior). - Z desfaz o último ponto. - S salv...
Python
1
, y * 3 + 3)).unwrap(); write!(self.stdout, "\u{2501}\u{2501}\u{2501}{}", cross).unwrap(); } } } fn draw_cursor_cell(&mut self) { let x = self.cursor_x; let y = self.cursor_y; self.draw_cell(x, y); } fn draw_status_bar(&mut self) { l...
Rust
0
starting ADNL packet (bad length)"), display("Bad starting ADNL packet (len == {})", len) } StartingPacketBadPublicKey { description("Bad starting ADNL packet (bad public key)"), } StartingPacketUnknownId { description("Bad starting ADNL packet (unkno...
Rust
0
i] - min_p[i]) as u64) + min( dp[i - 1].0 + ((if max_p[i - 1] >= max_p[i] { max_p[i - 1] - max_p[i] } else { max_p[i] - max_p[i - 1] }) as u64), dp[i - 1].1 + ((if min_p[i - 1] >= max_p[i] { min_p[i - 1] - max_p[i] } else { max_p[i] - min_p[i - 1] }) as u64) ) ...
Rust
0
"Ukraine") & (tb_exp["year"] <= 1990)) | ((tb_exp["country"] == "Belarus") & (tb_exp["year"] <= 1990)) | ((tb_exp["country"] == "Moldova") & (tb_exp["year"] <= 1990)) | ((tb_exp["country"] == "Latvia") & (tb_exp["year"] <= 1990)) | ((tb_exp["country"] == "Lithuania") & (...
Python
1
escape.wiki/w/Halo", }), ); map.insert( "Holy blessing".to_string(), Box::new(Agg { name: "Blessing", wiki_url: "https://oldschool.runescape.wiki/w/Blessing", }), ); } <gh_stars>0 //! 4x4 Matrix #![allow(dead_code)] use crate::pbrt::*; use std::fmt; ...
Rust
0
// } // (false, true, _) => { // console::log_1(&"---- i should clean myself up here!".into()); // } // _ => (), // } }) .forget(); } #[wasm_bindgen(start)] pub fn run() -> Result<(), JsValue> { // let window = web_sys::window().expect...
Rust
0
( _operand_base ) )); assert_eq! (unsafe { & ( * ( 0 as * const xed_inst_s ) ) . _attributes as * const _ as usize } , 10usize , concat ! ( "Alignment of field: " , stringify ! ( xed_inst_s ) , "::" , stringify ! ( _attributes ) )); } impl Clone for x...
Rust
0
from_pixels(37.0), Twips::from_pixels(0.0), true, ); assert_eq!(Some(4), breakpoint3); last_bp += breakpoint3.unwrap() + 1; let breakpoint4 = df.wrap_line( &string[last_bp..], params, Twips...
Rust
0
# Flowkeeper - Pomodoro timer for power users and teams # Copyright (c) 2023 Constantine Kulak # # 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 y...
Python
1
04 05 07 78 52 12 50 77 91 08 * 49 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48 04 56 62 00 * 81 49 31 73 55 79 14 29 93 71 40 67 53 88 30 03 49 13 36 65 * 52 70 95 23 04 60 11 42 69 24 68 56 01 32 56 71 37 02 36 91 * 22 31 16 71 51 67 63 89 41 92 36 54 22 40 40 28 66 33 13 80 * 24 47 32 60 99 03 45 02 44 75 33 53 78 ...
Rust
0
ser, group_names, force, notify, } = remove_groups; if group_names.is_empty() { return Ok(()); } let exit_on_error = group_names.len() == 1; let connection = pool.get()?; let user_profile = internal::user::user_profile_by_uuid(&connection, &user.user_uuid)?; d...
Rust
0
p): stems = {} for stem, stem_sources in mix_map.items(): stems_to_mix = [self.stem_mixture(s) for s in stem_sources] stems_to_mix = [s for s in stems_to_mix if s is not None] stems[stem] = trim_and_mix(stems_to_mix) return stems @property def stems(s...
Python
1
0 top1 = 0 teacher_model, student_model, optimizer, train_loader, val_loader = accelerator.prepare( teacher_model, student_model, optimizer, train_loader, val_loader ) # initial_params = {name: param.clone() for name, param in student_model.named_parameters()} for epoch in tqdm(range(config[...
Python
1
::into)?; let value = if let Value::Value(v) = e.value { V::try_from(*v) } else { V::try_from(e.value) } .map_err(Into::into)?; map.insert(key, value); } Ok(map) } } // TODO: this could be useful // impl<'...
Rust
0
_INT8: &PgType = &PgType { oid: PgTypeId::ArrayInt8 as u32, typname: "_int8", typnamespace: 11, typowner: 10, typlen: -1, typbyval: false, typtype: "b", typcategory: "A", typisprefered: false, typisdefined: true, typrelid: 0, typsubscript: "array_subscript_handler", t...
Rust
0
import streamlit as st import score_criteria as s st.set_page_config(page_title="体测计算器") # 体测计算器界面 st.image("sport.png") st.subheader(":rainbow[体测计算器]") col1, col2 = st.columns(2) with col1: gender = st.selectbox('性别', ('男', '女')) grade = st.selectbox("年级",(1, 2, 3, 4, 5, 6)) jump_rope = st.number...
Python
1
_type("RawGeckoComputedTimingBorrowedOrNull") .blacklist_type("RawGeckoComputedTimingBorrowedMut") .blacklist_type("RawGeckoComputedTimingBorrowedMutOrNull") .blacklist_type("RawGeckoKeyframeListBorrowed") .blacklist_type("RawGeckoKeyframeListBorrowedOrNull") .blacklist_type("Raw...
Rust
0
oose_action(observation) observation_, reward, done, info = env.step(action) ep_r[i_episode] += reward if (env.steps % 500 == 0): print('\nepisode: ', i_episode, 'step: ', env.steps, 'episode reward ', ep_r[i_episo...
Python
1
Status> { let default_path = OsString::from("/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"); self.environment.insert( OsString::from("PATH"), env::var_os("PATH").unwrap_or(default_path), ); if let Some(path) = self.home { s...
Rust
0
mean(loss_list))) # torch.save(self.model.state_dict(), "src/model_pk/bert_bilstm_crf/model.pkl") # torch.save(self.optimizer.state_dict(), "src/model_pk/bert_bilstm_crf/optimizer.pkl") logger.info( "==================== bigru model Evaluate epoch %d on Dev Set ====...
Python
1
from extensions.common.base import * from extensions.models import * class StockTransferOrder(Model): """调拨单据""" number = CharField(max_length=32, verbose_name='编号') out_warehouse = ForeignKey('data.Warehouse', on_delete=PROTECT, related_name='out_stock_transfer_or...
Python
1
t)).group(1),"jazoest":re.search('name="jazoest" value="(.*?)"', str(p.text)).group(1),"uid":idf,"next":"https://p.facebook.com/login/save-device/","flow":"login_no_pin","pass":pw,} koki = (";").join([ "%s=%s" % (key, value) for key, value in p.cookies.get_dict().items() ]) koki+=' m_pixel_ratio...
Python
1
")] { // 64-bit can only be x86-64 true } #[cfg(target_pointer_width = "32")] { lazy_static::lazy_static! { static ref IS_X86_64: bool = { use std::path::PathBuf; #[cfg(target_os = "windows")] { PathBuf::from("srcds_win64.exe").is_file() } #[cfg(target_os = "linux")] { // Check exe...
Rust
0
#!/usr/bin/env python3 # given a directory of images output a list of image -> predictions from PIL import Image, ImageDraw from label_db import LabelDB from scipy.special import expit import argparse import model as m import numpy as np import os import random import util as u parser = argparse.ArgumentParser(forma...
Python
1
ialize; /// This struct contains the auth fields #[derive(Serialize, Deserialize, Debug)] pub struct Auth { pub signature: String, pub key: String, pub passphrase: String, pub timestamp: String, } <gh_stars>1-10 //! # `rquote-core` //! //! This library provides multiple types used across all components...
Rust
0
ops::Range<u32>, //! push_byte: &mut dyn FnMut(u8), //! ) -> Result<(), EmuError> { //! for addr in addr { //! push_byte(self.read8(addr)?) //! } //! Ok(()) //! } //! //! fn write_addrs(&mut self, start_addr: u32, data: &[u8]) -> Result<(), EmuError> { //! ...
Rust
0
import os from dotenv import load_dotenv from flask import Flask from app import database from app.extensions import user_db as db, bcrypt, login_manager def register_blueprints(app): from app import home_page, scores, pictures, users, auth app.register_blueprint(home_page.bp) app.register_blueprint(scor...
Python
1
class Julkaisu: def __init__(self, nimi): self.nimi = nimi def tulosta_tiedot(self): print(f"Nimi: {self.nimi}") class Kirja(Julkaisu): def __init__(self, nimi, kirjoittaja, sivumäärä): super().__init__(nimi) self.kirjoittaja = kirjoittaja self.sivumäärä = sivumäär...
Python
1
cached; #[macro_use] extern crate lazy_static; trait Monad<A> { fn return_(t: A) -> Self; //:: A -> Monad<A> fn bind<MB,B>(m: Self, f: Fn(A) -> MB) -> MB where MB: Monad<B>; //:: Monad<A> -> (A -> Monad<B>)) -> Monad<B> } fn not_curried(p1: u32, p2: u32) -> u32 { p1 + p2 } fn curried(p1: u...
Rust
0
unreachable!("{} was validated to be only b, c or u", ch); }; set_exit_code(exit_code); Ok(()) } } } } pub fn uu_app<'a>() -> App<'a> { App::new(uucore::util_name()) .version(crate_version!()) .override_usa...
Rust
0
to_alipay_dict() else: params['partner_id'] = self.partner_id if self.wifimac: if hasattr(self.wifimac, 'to_alipay_dict'): params['wifimac'] = self.wifimac.to_alipay_dict() else: params['wifimac'] = self.wifimac return p...
Python
1
SHOLD { let mut direction = Vector2::new(0.0, 0.0); if particle.position[0] < pos[0] { direction[0] = -1.0; } else { direction[0] = 1.0; } if particle.position[1] < pos[1] { dire...
Rust
0
# backend/web_scraper.py import re import requests from bs4 import BeautifulSoup from datetime import datetime from urllib.parse import urlparse, parse_qs, unquote import pyparsing as pp from playwright.async_api import async_playwright import openai import logging from dotenv import load_dotenv import os # Загрузка п...
Python
1
# 1. Peptides shared between the current reference and the calibrated run -> update the reference by taking the weighted average fullRt = pd.concat([ref[idx], res[colRt[i]][idx]], axis=1) fullN = pd.concat([refN[idx], res[colN[i]][idx]], axis=1) rt = (fullRt * fullN.values).sum(axis=1) / fullN....
Python
1
ors). :param label: Time-shifted label tensor. Shape: (batch, max_target_length, num_target_factors). :param prepended_source_length: Length of prepended source tokens tensor. Shape: (batch,). """ source_words = source[:, :, 0] all_source_length = (source_words != C.PAD_ID).sum(dim=1) # Shape: (bat...
Python
1
assertIn(troop, player.troops) self.assertTrue(troop.is_home_base) self.assertIsInstance(troop, (player.troop_cls, coc.abc.DataContainer)) self.assertEqual(troop.name, valid_siege_machine_order[index]) def test_heroes(self): player = Player(data=MOCK_SEARCH_PLAYER, clien...
Python
1
; //~^ ERROR no method named `as_deref` found } <reponame>jewlexx/ignoreit<gh_stars>1-10 mod consts; pub use consts::*; pub use crate::cache::get_templates; <reponame>josediegorobles/btctipserver<gh_stars>0 use crate::config::ConfigOpts; use crate::error::Error; use bdk::blockchain::{ log_progress, AnyBlockchain, ...
Rust
0
.index(), signing_package)?; // Compute the per-message challenge. let challenge = challenge::<C>( &group_commitment.0, &key_package.group_public.element, signing_package.message.as_slice(), ); // Compute the Schnorr signature share. let z_share: <<C::Group as Group>::Field...
Rust
0
ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, T...
Rust
0
} #[doc = "Bits 20:23"] #[inline(always)] pub fn rx_pulse_shape_rx_coef6(&mut self) -> RX_PULSE_SHAPE_RX_COEF6_W { RX_PULSE_SHAPE_RX_COEF6_W { w: self } } #[doc = "Bits 16:19"] #[inline(always)] pub fn rx_pulse_shape_rx_coef5(&mut self) -> RX_PULSE_SHAPE_RX_COEF5_W { RX_...
Rust
0
), "::", stringify!(colnames) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<RowExpr>())).location as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(RowExpr), "::", stringify!(locati...
Rust
0
src_logits.shape[1] # # ) # # losses = {"loss_class": loss_class} # # return losses # def loss_boxes(self, outputs, targets, indices, num_boxes): # """Compute the losses related to the bounding boxes, the L1 regression loss and the GIoU loss # targets dicts must...
Python
1
new `X25519KeyAgreementKey2019` method. #[wasm_bindgen(js_name = GenerateX25519)] pub fn generate_x25519() -> WasmMethodContent { Self(WasmMethodContentInner::GenerateX25519) } /// Store an existing X25519 private key and derive a public key from it for a new /// `X25519KeyAgreementKey2019` method. #[...
Rust
0
truct Flag { pub doc: &'static [&'static str], pub short: Option<char>, pub name: &'static str, pub placeholder: Option<&'static str>, pub parser: &'static dyn Parser, } inventory::collect!(Flag); <reponame>csh/amethyst<filename>amethyst_animation/src/ui_transform.rs use amethyst_core::math::zero; ...
Rust
0
from maix import image, camera, display, app, nn, uart import cv2 import sys import struct import math import numpy as np import collections sys.path.append('/root/exam') import serial_protocol comm_proto = serial_protocol.SerialProtocol() device = "/dev/ttyS0" serial = uart.UART(device, 115200) def is_equilateral_tria...
Python
1
"Root user {} created with environment variable credentials", user.email ) } } } #[crate_id="hash-md5#1.0"]; #[feature(globs)]; extern mod hash_digest = "hash-digest"; pub mod hash { pub mod md5 { use std::iter; use hash_digest::hash::digest::*; stat...
Rust
0
pping_add(1)) as u16); // TODO: Wrapping_add here? let mut page_boundary_crossed = false; low = low.wrapping_add(regs.y()); if low < regs.y() { page_boundary_crossed = true; high = high.wrapping_add(1); } AddressingResult { page_boundary_cros...
Rust
0
oup(s) ''' pass def vertex_group_select(): ''' Select all the vertices assigned to the active vertex group ''' pass def vertex_group_smooth(factor: float = 0.5, repeat: int = 1): ''' Smooth weights to the active vertex group :param factor: Factor :type factor: float :param r...
Python
1
# program using function to know odd or even def is_even(n): return n % 2 == 0 print(is_even(6)) #output true
Python
1
mock_orig_dst.outbound_orig_addr = Some(outbound.addr); } env.put(config::ENV_PUBLIC_LISTENER, "tcp://127.0.0.1:0".to_owned()); env.put(config::ENV_CONTROL_LISTENER, "tcp://127.0.0.1:0".to_owned()); env.put(config::ENV_METRICS_LISTENER, "tcp://127.0.0.1:0".to_owned()); env.put(config::ENV_P...
Rust
0