text
string
label_name
string
labels
int64
ed_by_density: IndexMap::< ConstraintDensity, Vec<Constraint<F>> > = IndexMap::new(); for constraint in instance.constraints.iter() { if let Some(batch) = constraints_batched_by_density.get_mut(&constraint.density) { batch.push(constraint.clone()); } else { ...
Rust
0
from data_processing.crawler.crawler import Crawler from database import database from data_processing.summary_and_embedding.summary_and_embedding import SummaryAndEmbedding from database.opensearch.create_opensearch import CreateOpensearch from properties import Properties class Main: def main(): # 1. ...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. import torch # copy from https://github.com/openppl-public/ppq/blob/master/ppq/quantization/measure/norm.py # noqa: E501 def torch_snr_error(y_pred: torch.Tensor, y_real: torch.Tensor, reduction: str = 'mean') -> torch.Tensor: ...
Python
1
ConfigUpdate::ServiceUpdate(service) => { let mut matchers = Vec::new(); for filter in service.filters { if let FilterSetting::ACL(acl) = filter { matchers.push(ACLMatcher::new(&acl)); } } ...
Rust
0
u32, pub RPR1: u32, pub FPR1: u32, pub SECCFGR1: u32, pub PRIVCFGR1: u32, pub RTSR2: u32, pub FTSR2: u32, pub SWIER2: u32, pub RPR2: u32, pub FPR2: u32, pub PRIVCFGR2: u32, pub SECCFGR2: u32, pub EXTICR1: u32, pub EXTICR2: u32, pub EXTICR3: u32, pub EXTICR4: ...
Rust
0
start = self.nhc_fields_start(); 0xf0b0 + (data[start] & 0xff) as u16 } _ => unreachable!(), } } /// Return the checksum. pub fn checksum(&self) -> Option<u16> { if self.checksum_field() == 0b0 { // Th...
Rust
0
if let Some(opr) = self.opr { match opr { algebra_pb::logical_plan::operator::Opr::GroupBy(non_key_group) => { Ok(Box::new(non_key_group)) } _ => Err(ParsePbError::from("algebra_pb op is not a fold op").into()), } } else...
Rust
0
ce_grid, alpha=0.4, cmap='viridis', edgecolor='none' ) # 标签与颜色条 ax.set_xlabel('Housing Age') ax.set_ylabel('Homeowner Income') fig.colorbar(scatter, ax=ax, label='House Price(*10k)') plt.title('Layer:64*32*16') plt.show() # fig = plt.figure() # ax = fig.add_subplot(111, projection='3d') # # 使用 y 值...
Python
1
# Mide las utilidades con las variables de precio, utilidad y gastos totales. # Función para validar que sea número el input def verifica_int(valor): try: int(valor) return True except ValueError: return False #función principal def utilidadesV1 (): while True: #para h...
Python
1
a g@s<ddlZddlZddZddZddZdd Zd d ZdS) NcCsRtt|||}|d|dd|d|dd}|dkrN|d|SdS)Nr)absgeometry_utils orientation)abpcrossZ ab_len_sqr JC:\Users\user26.10.2020\Pych...
Python
1
iscontinuity=discontinuity, acceleration=min(TEST_ACCELERATIONS), speed=discontinuity, ) if passed: good_settings.append([current, discontinuity, None, None]) for i, vals in enumerate(good_settings): current, discontinuity, _, _ = vals ...
Python
1
value_contribution_msat; let value_contribution_msat = cmp::min(available_value_contribution_msat, $next_hops_value_contribution); // Includes paying fees for the use of the following channels. let amount_to_transfer_over_msat: u64 = match value_contribution_msat.checked_add($next_hops_fee_msat) { ...
Rust
0
GBE_ADVTXD_DTYP_DATA: u32 = 0x00300000; /* Adv Data Descriptor */ pub const IXGBE_ADVTXD_DCMD_EOP: u32 = IXGBE_TXD_CMD_EOP; /* End of Packet */ pub const IXGBE_ADVTXD_DCMD_IFCS: u32 = IXGBE_TXD_CMD_IFCS; /* Insert FCS *...
Rust
0
thread_id: 1, }, Event { event_kind: "Query".into(), label: "EventB".into(), additional_data: &[], timestamp: SystemTime::UNIX_EPOCH + Duration::from_secs(6), timestamp_kind: TimestampKind::End, threa...
Rust
0
import chainer import chainer.functions as cf import neural_renderer def look(vertices, eye, direction=None, up=None): """ "Look at" transformation of vertices. """ assert (vertices.ndim == 3) xp = chainer.cuda.get_array_module(vertices) if direction is None: direction = xp.array([0,...
Python
1
_and_kind { None => { // don't have information about the kind, request explicit annotation // NB We still need to typeck the body, so assume `FnMut` kind just for that let kind = ty::FnMutClosureKind; check_closure(fcx, expr, kind, decl, body...
Rust
0
ttom_corner: style.split.as_ref().and_then(|l| l.right_corner), }, (false, false, false, false) => Border { top: style.split.as_ref().map(|l| l.main), bottom: style.split.as_ref().map(|l| l.main), left: Some(style.inner_split_char), left_top_corner: style....
Rust
0
Release" { target = Path::new(&current_dir).join("target/release"); } else { target = Path::new(&current_dir).join("target/debug"); } let dest = env::var("OUT_DIR").unwrap(); let mut file = File::create(&Path::new(&dest).join("bindings.rs")).unwrap(); Registry::new(Api::Gles2, (2, ...
Rust
0
Box::new(move |cpu| cpu.mpu.dcache_invalidate()), (15, 0..=2) => unimplemented!(), _ => { warn!("STUBBED: Cache control register write; reg2={}, op2={}", cpreg2, op2); mknop() }, } } fn write_c9_arm9(&mut self, op2: usize, cpreg2: usize, val: u32) { match (cpreg2, op2) ...
Rust
0
creation //! because it is created from read-only transaction and cursor that are kept //! live as long as the iterator is live. // // In order to store these parent/child/sibling/cousin relationships under // the same struct it's necessary to use unsafe operation as the borrow checker // won't allow it. use crate::lm...
Rust
0
_POINTTOMULTIPOINT = 4, }} ENUM! {enum INTERNAL_IF_OPER_STATUS { IF_OPER_STATUS_NON_OPERATIONAL = 0, IF_OPER_STATUS_UNREACHABLE = 1, IF_OPER_STATUS_DISCONNECTED = 2, IF_OPER_STATUS_CONNECTING = 3, IF_OPER_STATUS_CONNECTED = 4, IF_OPER_STATUS_OPERATIONAL = 5, }} pub const MIB_IF_TYPE_OTHER: IFTYP...
Rust
0
class User: def __init__(self, first_name: str, last_name: str, driving_license_number: str): self.first_name = first_name self.last_name = last_name self.driving_license_number = driving_license_number self.rating: float = 0 self.is_blocked: bool = False @property ...
Python
1
ava_package_name(cn.louispeng.imagefilter.renderscript) // lomo效果 #include "Clamp.rsh" // set from the java SDK level rs_allocation gIn; rs_allocation gOut; rs_script gScript; float3 gPaintBorderColor; // Should be in the range [0, 10]. float gSize = 1.0f; // Magic factors // Static variables static uint32_t _wid...
Rust
0
, 2, 3, 4, 5] on_kv_pre: self.add(5, 'pre') on_kv_applied: self.add(5, 'applied') on_kv_post: self.add(5, 'post') root_widget: root base_widget: root name: 'second child' some_value: first_child.another_value...
Python
1
dges_distribution if self.edge_length(edge_id) > min_gap + VEHICLE_LENGTH) if initial_config.edges_distribution == 'all': available_edges = [ edge for edge in self.get_edge_list() if self.edge_length(edge) > min_gap + VEHICLE_LENGTH] else:...
Python
1
"TCP" => Some(Protocol::Tcp), "UDP" => Some(Protocol::Udp), _ => None, } } } impl fmt::Display for Protocol { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match *self { Protocol::Tcp => write!(f, "tcp"), Protocol::Udp => wri...
Rust
0
alize() { require(self.inc_a); require(self.inc_b); assert self.counter == 2; } } #[inductive(tr_inc_a)] fn tr_inc_a_preserves(self: X, post: X) { } #[inductive(tr_inc_b)] fn tr_inc_b_preserves(self: X, post: X...
Rust
0
} } /// Build a CSV serializer with a default configuration that writes data to /// `ser`. /// /// Note that the CSV serializer is buffered automatically, so you should not /// wrap `ser` in a buffered writer. /// /// # Example /// /// ``` /// use std::error::Error; ...
Rust
0
, } pub(crate) fn typ_of_node<'tcx>(bctx: &BodyCtxt<'tcx>, id: &HirId) -> Typ { mid_ty_to_vir(bctx.ctxt.tcx, bctx.types.node_type(*id)) } pub(crate) fn implements_structural<'tcx>( tcx: TyCtxt<'tcx>, ty: &'tcx rustc_middle::ty::TyS<'tcx>, ) -> bool { let structural_def_id = tcx .get_diagnostic...
Rust
0
ERS, SPCAT_RECOPROFILES, SPMMSYS_AUDIO_IN_TOKEN_ID, SPMMSYS_AUDIO_OUT_TOKEN_ID, SPCURRENT_USER_LEXICON_TOKEN_ID, SPTOKENVALUE_CLSID, SPTOKENKEY_FILES, SPTOKENKEY_UI, SPTOKENKEY_ATTRIBUTES, SPTOKENKEY_RETAINEDAUDIO, SPTOKENKEY_AUDIO_LATENCY_WARNING, SPTOKENKEY_AUDIO_LATENCY_TR...
Rust
0
} #[test] fn test_six_byte_sequence_lowest_single_byte() { test(b"\xFC\x80\x80\x80\x80\x80", "������"); } // Non-shortest forms for highest single-byte (U+007F) #[test] fn test_two_byte_sequence_highest_single_byte() { test(b"\xC1\xBF", "��"); } #[test] fn test_three_byte_sequence_highest_single_byte() { ...
Rust
0
doc = " Creates a new edge in the contour and returns its reference."] #[link_name = "\u{1}__ZN7msdfgen7Contour7addEdgeEv"] pub fn msdfgen_Contour_addEdge2(this: *mut msdfgen_Contour) -> *mut msdfgen_EdgeHolder; } extern "C" { #[doc = " Adjusts the bounding box to fit the contour."] #[link_name = "\u{1}...
Rust
0
se = gst::Promise::new_with_change_func(move |promise| { let app = upgrade_weak!(app_clone); if let Err(err) = app.on_answer_created(promise) { app.post_error(format!("Failed to send SDP answer: {:?}", err).as_str()); } ...
Rust
0
deo_description (str): The description of the video. gpt_model (str): The GPT model to use for summarization. Returns: str: Summarized video description. """ steps_logger.info(f"Started summarizing video description. Video Description: {video_description[:100]}...") contents = [{"type":...
Python
1
# infer with commit id 5d5e0327916959d832d95ffbef5f484efc93d799 of https://github.com/jrgillick/laughter-detection import git import os import subprocess import sys from tgt_to_json import main as tgt_to_json def get_audio_file_path(referenced_paper, audio_dir, audio_id): if referenced_paper == "McCowan2005": ...
Python
1
(); let mut jsonfile = File::open(forest_path)?; jsonfile.read_to_string(&mut json)?; let forest: HoughPrediction = serde_json::from_str(&json)?; info!("Loading image ..."); let img_file = File::open(depth_path)?; let depth = Arc::new(read_depth(img_file)?); let rgb = load_related_rgb(&*dep...
Rust
0
n::from_millis(100)).await; }; let task2 = async { let _guard = Lock::fnew(1, map.clone()).await.await; delay_for(Duration::from_millis(100)).await; }; let task3 = async { let _guard = Lock::fnew(2, map.clone()).await.await; delay_for(Durat...
Rust
0
NOT LIMITED TO, // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS // SOFTWARE, EVEN...
Rust
0
|opt| -> Result<CliState> { info!("Starcoin opts: {:?}", opt); let connect = opt.connect.as_ref().unwrap_or(&Connect::IPC(None)); let (client, node_handle) = match connect { Connect::IPC(ipc_file) => { if let Some(ipc_file) = ipc_file { ...
Rust
0
# Copyright (C) 2001-2016 Alan W. Irwin # Polar plot demo. # # This file is part of PLplot. # # PLplot is free software; you can redistribute it and/or modify # it under the terms of the GNU Library General Public License as published # by the Free Software Foundation; either version 2 of the License, or # (at ...
Python
1
moons_1d.push_back((p, v)); } // apply velocity for (ref mut p, v) in moons_1d.iter_mut() { *p += *v; } cnt += 1; if *moons_1d == init_state { break cnt; } ...
Rust
0
# Time: O((n - m) * m) # Space: O((n - m) * m) import collections class Solution(object): def movesToStamp(self, stamp, target): M, N = len(stamp), len(target) q = collections.deque() lookup = [False]*N result = [] A = [] for i in xrange(N-M+1): made,...
Python
1
); /* build 2^n */ let mut imm0 = _mm256_cvttps_epi32(fx); // another two AVX2 instructions /*imm0 = _mm256_add_epi32(imm0, __m256i::from_bits(u32x8::splat(0x7f))); imm0 = _mm256_slli_epi32(imm0, 23);*/ /*let (mut a, mut b): (__m128i, __m128i)...
Rust
0
*; use std::process::{Command, Stdio}; #[test] fn test_run_help() -> Result<()> { let mut cmd = Command::cargo_bin("coreos-diskimage-rehydrator")?; cmd.arg("--help") .stdout(Stdio::null()) .stderr(Stdio::null()); let s = cmd.status()?; assert!(s.success()); Ok(()) } <gh_stars>1000+ ...
Rust
0
robot_x, robot_y, robot_heading = robot_pos # ✅ Draw bounding box around AprilTag cv2.polylines(frame, [np.int32(tag_corners)], isClosed=True, color=(0, 255, 0), thickness=2) # ✅ Display info on the image center = np.mean(tag...
Python
1
lifetimes)] async fn index_ssr<'reg>( data: Data, Extension(tm): Extension<Arc<template::TemplateManager<'reg>>>, ) -> Result<Html<String>, HttpError> { tm.render("auth", &data).map(Html).map_err(Into::into) } async fn index_api(data: Data) -> Result<Json<Data>, HttpError> { Ok(Json(data)) } #[derive(...
Rust
0
mark.parametrize("framework", ["test_framework"]) class TestBaseScheduled(BaseScheduledTest): pass class BaseUpdateImpl(BaseUpdate): def __init__( self, update_frequency: float = 0.0, min_frequency: float = -1.0, **kwargs ): super().__init__(update_frequency, min_frequency, **kwargs) @py...
Python
1
# -*- coding: UTF-8 -*- '''================================================= @Author :zhenyu.yang @Date :2021/1/4 10:47 AM ==================================================''' import cv2 import os import numpy as np from multiprocessing import Pool src = '/home/users/zhenyu.yang/data/output/moire_single_exp/' src ...
Python
1
pub fn cairo_text_path(cr: *mut cairo_t, utf8: *const c_char); pub fn cairo_rel_curve_to(cr: *mut cairo_t, dx1: c_double, dy1: c_double, dx2: c_double, dy2: c_double, dx3: c_double, dy3: c_double); pub fn cairo_rel_line_to(cr: *mut cairo_t, dx: c_double, dy: c_double); pub fn cairo_rel_move_to(cr: *mut cair...
Rust
0
#!/usr/bin/env python # Generate an outcast incast traffic matrix. # python gen_outcast_incast.py <nodes> <conns1> <conns2> <flowsize> <randseed> # Parameters: # <nodes> number of nodes in the topology # <conns1> number of active connections to the incast destination # <conns2> number of active connections fro...
Python
1
lf.addr.broadcast(event.into(), params)) } } #[doc(hidden)] impl From<Addr<broker::ServiceBroker>> for ServiceBroker { fn from(addr: Addr<broker::ServiceBroker>) -> Self { Self { addr } } } extern crate js_parser_rs; use js_parser_rs::lexer::enums::{TokenType, LiteralType, RegexIdentifier}; use js...
Rust
0
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.linear_model import LinearRegression from sklearn.metrics import mean_squared_error from sklearn.impute import SimpleImputer import datetime # Charger les données à partir du fichier CSV data = pd.read_csv("donnees.csv") # Préparati...
Python
1
"static")] # This production code might break development mode, so we check whether we're in DEBUG mode if not DEBUG: # Tell Django to copy static assets into a path called `staticfiles` (this is specific to Render) STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles") # Enable the WhiteNoise storage backen...
Python
1
args.time_of_interest, ); } /// `ta_cleanup` implements the `ta-cleanup` option using [`cleanup_tas`] for support. #[cfg(feature = "std")] pub fn ta_cleanup(pe: &PkiEnvironment<'_>, args: &Pittv3Args) { let ta_folder = if let Some(ta_folder) = &args.ta_folder { ta_folder } else { pr...
Rust
0
h('cceditar/<int:pk>/', EditarCentrosDeCustos.as_view(), name='editar_centro_de_custos'), path('ccdetalhe/<int:pk>/', DetalhesCentroDeCusto.as_view(), name='detalhe_centro_de_custo'), path('ccexcluir/<int:pk>/', DeletarCentrosDeCustos.as_view(), name='deletar_centro_de_custo'), path('planos/', Lis...
Python
1
path = tempdir.path().join("outs"); let args = Args { flag_nthreads: 2, arg_bam: "test/lr21.bam".to_string(), arg_output_path: tmp_path.to_str().unwrap().to_string(), flag_gemcode: false, flag_lr20: false, flag_cr11: false, fla...
Rust
0
udio_embeddings) return similarity def embed_speaker(wavs, **kwargs): raise NotImplemented() def plot_embedding_as_heatmap(embed, ax=None, title="", shape=None, color_range=(0, 0.30)): import matplotlib.pyplot as plt if ax is None: ax = plt.gca() if shape is None: height = int(n...
Python
1
utor: &Executor<'_, Ctx, WundergraphScalarValue>, query: BoxedQuery<'a, Self, DB, Ctx>, ) -> Result<Vec<juniper::Value<WundergraphScalarValue>>, Error> where DB: HasSqlType< SqlTypeOfPlaceholder<Self::FieldList, DB, Self::PrimaryKeyIndex, Self::Table, Ctx>, >, Ctx: Wu...
Rust
0
*" => "*const types::EGLAttrib", "const EGLattrib *" => "*const types::EGLAttrib", // Due to a typo in khronos_api/api_angle/scripts/egl_angle_ext.xml - see brendanzab/gl-rs#491 "EGLConfig" => "types::EGLConfig", "EGLConfig *" => "*mut types::EGLConfig", "EGLContext" => "types::EGLConte...
Rust
0
d.com/reference/android/view/View.html#LAYOUT_DIRECTION_LTR) pub const LAYOUT_DIRECTION_LTR : i32 = 0; /// public static final [LAYOUT_DIRECTION_RTL](https://developer.android.com/reference/android/view/View.html#LAYOUT_DIRECTION_RTL) pub const LAYOUT_DIRECTION_RTL : i32 = 1; /// publi...
Rust
0
import sys import os from . import ZipFile, ZIP_DEFLATED def main(args=None): import argparse description = 'A simple command-line interface for zipfile module.' parser = argparse.ArgumentParser(description=description) group = parser.add_mutually_exclusive_group(required=True) group.add_argument...
Python
1
_pulse::internal::stream_dim(); let a = model.add_source("a", f32::fact(&[s]).into()).unwrap(); model .wire_node( "pad", Pad::new(vec![(1, 0)], PadMode::Constant(Arc::new(Tensor::from(-1f32)))), &[a], ) .unwrap(); model.auto_outputs().unwrap(); ...
Rust
0
disabled is by including /// <service-name>=false in config.ini pub const CONFIG_ENABLE_SERVICES_BY_DEFAULT: bool = true; /// The collector run interval. A collection cycle will run every N ms. pub const CACHE_COLLECTOR_RUN_INTERVAL_SECS: u64 = 60 * 15; // 15 minutes /// CLI progress bar format. pub const UPLOAD_PROG...
Rust
0
_str_precision_preservation(self): # Whole numbers should have precision 0 assert Quantity.from_str("100").precision == 0 assert Quantity.from_str("1000000").precision == 0 # Decimal places should determine precision assert Quantity.from_str("100.0").precision == 1 asse...
Python
1
rollup_fn([0.1, 0.2, 0.2, 0.45, 0.0, 0.0, 0.0]) == ( URSIDAE_FAMILY, pytest.approx(0.5), "classifier+rollup_to_family", ) # Test rollups with geofencing. rollup_fn = lambda scores: roll_up_labels_to_first_matching_level( labels=predictions, ...
Python
1
"""Module to represent a Sanaadi Pratyaya""" from dataclasses import dataclass, field from utils import Khanda, KhandaType @dataclass class Sanaadi(Khanda): """Class to represent a Krt Pratyaya""" moola: str = field(default=None) mukhya: Khanda = field(default=None) uchchaarana: list = field(defaul...
Python
1
dim = ucum::$unit<$type>; }; ($type:ty, $dim:ident, [$d0:ident, $d1:ident, $d2:ident, $d3:ident, $d4:ident, $d5:ident, $d6:ident]) => { pub type $dim = UCUM< $type, tarr![ typenum::$d0, typenum::$d1, typenum::$d2, ty...
Rust
0
.write(); data.insert::<DatabaseConnection>(Arc::new(Mutex::new(database_pool))); } // Run the bot or print the connection errors, if any. if let Err(reason) = client.start() { println!("Failed to connect: {:?}", reason); } } // Copyright 2020 <NAME> // // Licensed under the Apache Lice...
Rust
0
# -*- coding: utf-8 -*- from __future__ import unicode_literals import click import re import requests import semantic_version class Requirement(object): """ Steps: 1. Try to get name and version 2. Get details from PyPI 3. Compare Versions """ def __init__(self, requirement): se...
Python
1
} } fn init(mut cx: FunctionContext) -> JsResult<JsUndefined> { unsafe { INIT.call_once(|| { DICTIONARY = Some(ChineseDictionary::new()); }); } return Ok(cx.undefined()); } fn classify(mut cx: FunctionContext) -> JsResult<JsString> { let input = cx.argument::<JsString>(0)?.value(); unsafe { return matc...
Rust
0
id) -> hash_sig_t; } extern "C" { pub fn rte_hash_lookup_bulk_data( h: *const rte_hash, keys: *mut *const ::std::os::raw::c_void, num_keys: u32, hit_mask: *mut u64, data: *mut *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int; } extern "C" { pub fn rte_hash_look...
Rust
0
child_text = f"{token.lemma_} {child.text}" if child_text not in head_texts: head_texts.add(child_text) heads.append( KnowledgeHead( text=child_text, ...
Python
1
# Read what Abhinav showed abhinav_choice = input() # Read what Anjali showed anjali_choice = input() # Check the result of the game if abhinav_choice == anjali_choice: print("Tie") elif abhinav_choice == "Rock" and anjali_choice == "Scissors": print("Abhinav Wins") elif abhinav_choice == "Scissors" and anjal...
Python
1
attributes and methods within the class. ctx : SystemVerilogParser.For_initializationContext The `ctx` parameter in the `forInitialization2ApanImpl` function is of type `SystemVerilogParser.For_initializationContext`. This parameter is used to access information related to the for loop initializati...
Python
1
result = RandomSeedFuture::new(1_000_000_000).await; println!( "{:?} generated a 1 GB random seed in {}s", std::thread::current().id(), start.elapsed().as_secs_f64() ); result } /// Linux random data source const SOURCE: &str = "/dev/random"; /// Data container for the future struc...
Rust
0
#!/usr/bin/python # convert LLVM GenSubtargetInfo.inc for Capstone disassembler. # by Nguyen Anh Quynh, 2019 import sys if len(sys.argv) == 1: print("Syntax: %s <GenSubtargetInfo.inc> <architecture>" %sys.argv[0]) sys.exit(1) f = open(sys.argv[1]) lines = f.readlines() f.close() arch = sys.argv[2] print(""...
Python
1
# DO NOT EDIT: This file is automatically generated by fauxgen. # Any changes made to this file will be overwritten. import datetime from typing import Any, TypedDict import fauxgen as f class ChildModelRecord(TypedDict): """A data structure representing ChildModel entries.""" id: int name: str age:...
Python
1
i2c_csr.wo(utra::i2c::EV_STATUS, foo); let bar = i2c_csr.rf(utra::i2c::EV_STATUS_STATUS); i2c_csr.rmwf(utra::i2c::EV_STATUS_STATUS, bar); let mut baz = i2c_csr.zf(utra::i2c::EV_STATUS_STATUS, bar); baz |= i2c_csr.ms(utra::i2c::EV_STATUS_STATUS, 1); i2c_csr.wfo(utra::i2c::...
Rust
0
type ConstantVariables = HashMap<Variable, Expression>; trait DetermineConstants { fn determine_constants(&self) -> ConstantVariables; } impl DetermineConstants for Program { fn determine_constants(&self) -> ConstantVariables { let mut constants = HashMap::new(); self.nodes().iter().for_eac...
Rust
0
x, eval_var, eval_fn, eval_asm)?) { (expr::Value::Integer(ref lhs), expr::Value::Integer(ref rhs)) => { match op { expr::BinaryOp::Add => Ok(expr::Value::make_integer(lhs + rhs)), expr::BinaryOp::Sub => Ok(expr::Value::make_integer(lhs - rhs)), expr::BinaryOp::Mul ...
Rust
0
assert_eq!("/bank-sample/_bulk", req.url.as_ref()); } } // Copyright 2016 The Rust Project Developers. See the COPYRIGHT // file at the top-level directory of this distribution and at // http://rust-lang.org/COPYRIGHT. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // http://www.a...
Rust
0
output, _ = multiGPU_CLIP(model_image, model_text, model, _images, text_tokens, None) loss = criterion(output, target) loss.backward() grad = delta.grad.detach() d = delta[:, :, :, :] g = grad[:, :, :, :] x = X[:, :, :, :] if norm == "l_inf": d ...
Python
1
(); assert!(contains("Listing current settings from environment variables and command line options in yaml format").eval(stdout)); Ok(()) } #[test] #[cfg_attr(not(feature = "integration_tests"), ignore)] #[cfg(target_os = "linux")] fn test_list_default_conf() -> io::Result<()> { let file_path = Path::new(...
Rust
0
by sending the first EDHOC message, everything after that will be // handled in the main receiver loop like in the server. After that, the // client will also respond to any ARP and ICMP packets it receives. let req = oscore.go(&mut tx).unwrap(); uprintln!(tx, "Sending the first EDHOC packet"); upr...
Rust
0
_arn { scope_1093.string(var_1094); } Ok(()) } #[allow(unused_mut)] pub fn serialize_structure_crate_model_federated_authentication_request( mut writer: aws_smithy_query::QueryValueWriter, input: &crate::model::FederatedAuthenticationRequest, ) -> Result<(), aws_smithy_http::operation::Serializ...
Rust
0
eq!(uplink_pulse.event_count, 10); assert_eq!(uplink_pulse.command_count, 10); }; let node_task = async move { let NodePulse { uplinks } = node_pulse_rx.recv().await.expect("No pulse sent to lane"); let WarpUplinkPulse { link_count, event_count, comma...
Rust
0
sync move { stream.fold($one, Mul::mul).await } ) } } )*); ($($a:ty)*) => ( integer_product!(@impls 1, $($a)*); integer_product!(@impls Wrapping(1), $(Wrapping<$a>)*); ); } macro_rules! float_product { ($($a:ty)*) => ($( impl Product for $a { fn p...
Rust
0
n(names)} names found for nc={nc} dataset in {data}' # check is_coco = data.endswith('coco.yaml') and nc == 80 # COCO dataset # Model pretrained = weights.endswith('.pt') if pretrained: # 等待主线程加载预训练权重,如果本地没有,则下载 with torch_distributed_zero_first(RANK): weights = attempt_do...
Python
1
The settings table doesn't exists create_tables(&pool); } conn.execute( "INSERT INTO settings (key, value) VALUES('db_version', $1)", &[&"1"], ).expect("Unable to add db_version to settings"); update_db_from(1, &pool); } else { let versio...
Rust
0
_point as i32) .max(u8::min_value() as i32) .min(u8::max_value() as i32) as u8 } pub fn quantize_linear_f32_i8(x: f32, scale: f32, zero_point: i32) -> i8 { (((x * scale).round() as i32) + zero_point as i32) .max(i8::min_value() as i32) .min(i8::max_value() as i32) as i8 } element_w...
Rust
0
let __jni_args = []; let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env); let (__jni_class, __jni_method) = __jni_env.require_class_method("java/nio/Buffer\0", "arrayOffset\0", "()I\0"); __jni_env.call_int_method_a(self.0.object, __jni_method, __jni_args.as...
Rust
0
parse_bindgen ==> apis /// subgraph analysis /// typedef[typedef analysis] /// pod[POD analysis] /// apis ==> typedef /// typedef ==> pod /// podapis(APIs with POD analysis) /// pod ==> podapis /// fun[Function materialization analysis] /// podapis ==> fun /// funapis(APIs w...
Rust
0
incoming() { let stream = match stream { Ok(s) => s, Err(_) => { continue; } }; thread::spawn(|| handle_client(stream)); } } fn handle_client(mut stream: TcpStream) { // Auth if !auth(&mut stream) { return; } // mea...
Rust
0
c { Rpc { inner: self.inner, owner: false, } } } unsafe impl Send for Rpc {} impl Rpc { pub fn new( context: &AppContext, nexus: &Nexus, rpc_id: u8, sm_handler: extern "C" fn(c_int, ffi::SmEventType, ffi::SmErrType, *mut c_void), ...
Rust
0
# Check if the replied message was sent by the bot if replied_message.sender_id == bot_id: # Forward the reply message to the group await client.forward_messages(group_id, event.message) # Send additional information sender = await event.g...
Python
1
from odoo import models, fields class EstatePropertyTag(models.Model): _name = "estate.property.tag" _description = "Real Estate Property Tag" _order = "name" name = fields.Char(string="Tag", required=True) color = fields.Integer() sql_constraints = [ ('unique_property_tag_name', 'UN...
Python
1
_EVENTS: i32 = 1; // Don't be clever const EPOLL_TIMEOUT_MILLIS: i32 = 10000; // 10 seconds const MAX_USB_REPORT_SIZE: usize = 64; // Needs to match the report descriptor we set outside let mut ff_can_write = false; let mut ff_write_buffer_filled = false; let mut bb_array_usb_read = [0u8; MAX_U...
Rust
0
icyStored(Vec<u8>, u64), CertificationCodeStored(Vec<u8>, u64), } ); decl_error! { pub enum Error for Module<T: Trait> { NoneValue, StorageOverflow, CannotCreateNode, NodeNotExists, CannotDeleteNode, FarmExists, FarmNotExists, CannotDeleteFarm, EntityWithNameExists, EntityWithPubkeyExists, ...
Rust
0
data.num_graphs, 3)).to(data['ligand'].x.device), torch.zeros((data.num_graphs, 3)).to(data['ligand'].x.device) center_pos.index_add_(0, index=data['ligand'].batch, source=data['ligand'].pos) center_pos = center_pos / torch.bincount(data['ligand'].batch).unsqueeze(1) edge_vec = data['ligand'].p...
Python
1
:Server::builder() .add_service(EspyServer::new(handler::espy::EspyImpl::build(keys).await?)) .serve(format!("[::1]:{}", opts.port).parse()?) .await?; Ok(()) } <reponame>badboy/semantic-rs-win<filename>src/main.rs #![cfg_attr(feature = "dev", allow(unstable_features))] #![cfg_attr(feature =...
Rust
0