text
string
label_name
string
labels
int64
reg.x[2]); } #[test] fn test_lb() { let mut reg = RegisterFile::new(); let mut vec: Vec<u8> = vec![0, 1, 2, 3, 4, 5, 6, 7]; let elf = Elf::new(&vec); let mem = Memory::new(&mut vec, &elf); // lb r2, 4(r1) let inst: u32 = inst_lb(2, 4, 1); reg.x[1] = 0...
Rust
0
:ident!( $($args2:tt)* )) => ( flat_map!(__impl $i, $submac!($($args)*), $submac2!($($args2)*)); ); ($i:expr, $submac:ident!( $($args:tt)* ), $g:expr) => ( flat_map!(__impl $i, $submac!($($args)*), call!($g)); ); ($i:expr, $f:expr, $submac:ident!( $($args:tt)* )) => ( flat_map!(__impl $i, call!($f),...
Rust
0
arse::<u32>() .map_err(|_| "the `major` field must be a non-negative integer")?; let minor = fields .next() .ok_or("the `minor` field is missing")? .parse::<u32>() .map_err(|_| "the `minor` field must be a non-negative integer")?; let patch = fields .next() .ok_or("the `patch` field is missin...
Rust
0
ocNetworks(IEnumDot11AdHocNetworksVtbl): IUnknown(IUnknownVtbl) { fn Next( cElt: ULONG, rgElt: *mut *mut IDot11AdHocNetwork, pcEltFetched: *mut ULONG, ) -> HRESULT, fn Skip( cElt: ULONG, ) -> HRESULT, fn Reset() -> HRESULT, fn Clone( ppEnum: *mut *mut IEnu...
Rust
0
.collect(), ); } } } Self { map: output } } } } impl FromStr for RiskLevelMap { type Err = RiskLevelMapFromStrError; fn from_str(s: &str) -> Result<Self, Self::Err> { Ok(Sel...
Rust
0
((*surface).resource, ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED as libc::c_int as uint32_t, b"xdg_surface must have a role\x00" as *const u8 as *const libc::c_char); return } l...
Rust
0
self.centroids } } impl<'a, F: Float, R: Rng + Clone, D: Data<Elem = F>, T: Targets> Fit<'a, ArrayBase<D, Ix2>, T> for KMeansHyperParams<F, R> { type Object = Result<KMeans<F>>; /// Given an input matrix `observations`, with shape `(n_observations, n_features)`, /// `fit` identifies `n_clusters` c...
Rust
0
API possibilites (as //! that is taken care of in the API tests), but instead focus on entire user workflows use std::net::{Ipv4Addr, SocketAddrV4, TcpListener}; use bindle::client::Client; use bindle::testing; struct TestController { pub client: Client, server_handle: std::process::Child, // Keep a han...
Rust
0
(), fmt::Error> { match *self { CalendarComponent::Todo(ref todo) => todo.fmt_write(out), CalendarComponent::Event(ref event) => event.fmt_write(out), CalendarComponent::Venue(ref venue) => venue.fmt_write(out), CalendarComponent::Other(ref other) => other.fmt_wri...
Rust
0
#!/usr/bin/env python3 import click import json import time import sys import os from datetime import datetime import pyautogui import Quartz import AppKit from typing import Dict, List, Any, Optional, Tuple import threading import signal from pynput import keyboard from coordinate_helper import CoordinateRecorder, Scr...
Python
1
eed to set - 60-100 (percent)"), ), ) .subcommand( SubCommand::with_name("fan") .about( "Reports or sets the speed of the fan. This can be set between 25% and 100%.", ) .arg( Arg::with_nam...
Rust
0
}); // Write result will be send by this channel. match receiver.recv() { Ok(ret) => ret, Err(err) => { error!( self.inner.options.info_log.as_ref().unwrap(), "recv failed: {}", err ); ...
Rust
0
accum }*/ #[derive(Clone)] pub struct Perlin { pub ranvec: Vec<Vec3>, // pub ranfloat: Vec<f64>, pub perm_x: Vec<i32>, pub perm_y: Vec<i32>, pub perm_z: Vec<i32>, } pub fn permute(p: &mut Vec<i32>, n: i32) { for i in (0..n).rev() { let i = i as usize; let target = random::<us...
Rust
0
from pudzu.charts import * from pudzu.sandbox.bamboo import * atlas = pd.read_csv("datasets/countries.csv").split_columns('country', "|").explode('country').set_index("country") df = pd.read_csv("datasets/demographics_greek.csv") def rlabel(r): return Image.from_text(str(df.year[r]), sans(16), padding=(0,2)) def...
Python
1
} let mut id = id.into_iter(); let id1 = id.next().unwrap(); // cannot fail let id2 = id.next().unwrap(); // cannot fail Some((id1, id2)) } else { None }; let info = if let Some(info) = trailer_dict.remove(&b"Info"[..]) { Some(Ref::downcast(...
Rust
0
import numpy as np import harmonica as hm import verde as vd import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from matplotlib import cm plt.rcParams['font.family'] = 'SimHei' plt.rcParams['axes.unicode_minus'] = False def main(): # 保持原有参数设置 region = (-1000, 1000, -1000, 1000) shape...
Python
1
no_main] #![no_std] use linux_io::{Stderr, Stdout}; use linux_sys::sched_param; use panic_stderr as _; use ufmt::uwriteln; use ufmt_utils::{consts, Ignore, LineBuffered}; // `$ getconf PAGE_SIZE` const PAGE_SIZE: u64 = 4096; const STACK_SIZE: u64 = 4 * PAGE_SIZE; #[linux_rt::entry] fn main() { let mut stdout = L...
Rust
0
.y ); assert_eq!( msg.z, 65, "incorrect value for z, expected 65, is {}", msg.z ); } _ => panic!("Invalid message type! Expected a MsgVelECEFDepA"), }; let frame = sbp::to_...
Rust
0
_field_accessor::<_, ::protobuf::types::ProtobufTypeMessage<super::errorpb::Error>>( "error", IngestResponse::get_error_for_reflect, IngestResponse::mut_error_for_reflect, )); ::protobuf::reflect::MessageDescriptor::new::<Ingest...
Rust
0
D4RL AntMaze environments.""" if env_name == 'offline_ant_umaze': env = gym.make('antmaze-umaze-v2') elif env_name == 'offline_ant_umaze_diverse': env = gym.make('antmaze-umaze-diverse-v2') elif env_name == 'offline_ant_medium_play': env = gym.make('antmaze-medium-play-v2') elif env_name == 'offlin...
Python
1
= history_tracking_instance.tracking_fields["tracking_fields"] if track_fields: delta_changes = filter_history(delta_changes, track_fields) return delta_changes def history_tracking(request, obj_id, **kwargs): model = kwargs.get("model") decorator_strings = kwargs.get("decorat...
Python
1
_TEXT_TYPE_FLOAT: WS_XML_TEXT_TYPE = 8i32; #[doc = "*Required features: `\"Win32_Networking_WindowsWebServices\"`*"] pub const WS_XML_TEXT_TYPE_DOUBLE: WS_XML_TEXT_TYPE = 9i32; #[doc = "*Required features: `\"Win32_Networking_WindowsWebServices\"`*"] pub const WS_XML_TEXT_TYPE_DECIMAL: WS_XML_TEXT_TYPE = 10i32; #[doc =...
Rust
0
#!/usr/bin/env python2 ## -*- coding: utf-8 -*- ## ## Output: ## ## $ ./simplification.py ## Expr: (bvxor (_ bv1 8) (_ bv1 8)) ## Simp: (_ bv0 8) ## ## Expr: (bvor (bvand (_ bv1 8) (bvnot (_ bv2 8))) (bvand (bvnot (_ bv1 8)) (_ bv2 8))) ## Simp: (bvxor (_ bv1 8) (_ bv2 8)) ## ## Expr: (bvor (bvand (bvnot (_ ...
Python
1
= "linux"), not(target_arch = "powerpc")))] pub(crate) const ISIG: tcflag_t = 0o000001; #[cfg(all(any(target_os = "android", target_os = "fuschia", target_os = "linux"), target_arch = "powerpc"))] pub(crate) const ISIG: tcflag_t = 0x00000080; #[cfg(any(target_os = "dragonfly", target_os = "freebsd", target_os = "ios",...
Rust
0
s.path.join(dst_path, "test") val_path = os.path.join(dst_path, "val") if not os.path.exists(os.path.join(dst_path, "train")): os.makedirs(os.path.join(dst_path, "train")) if not os.path.exists(os.path.join(dst_path, "test")): os.makedirs(os.path.join(dst_path, "test")) if not os.path.ex...
Python
1
eResourceInfo::test_layout(); } <filename>all/problem_into_maybe/src/main.rs #![ feature( specialization ) ] mod from_maybe; use from_maybe::*; fn main() { let u32 : u32 = 13; let u64 : u64 = u32.into(); println!( "u64 : {}", u64 ); let u8 : u8 = u32 as u8; println!( "u8 : {}", u8 ); let u8 : Option< u8 >...
Rust
0
_name_key[mni+8:mni+12]) except ValueError: try: radius = float(model_name_key[mni+8:mni+11]) except ValueError: raise ValueError("Problem with parsing the ...
Python
1
# Copyright 2024 Patryk Pyczko (APSL-Nagarro)<ppyczko@apsl.net> # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). from odoo import api, fields, models class RepairOrder(models.Model): _inherit = "repair.order" timesheet_ids = fields.One2many( "account.analytic.line", "repair_order_id"...
Python
1
res } } } #[doc(hidden)] // NOTE: Needs be public for RawCollectorImpl pub unsafe trait DynTrace { fn trace(&mut self, visitor: &mut MarkVisitor); } unsafe impl<T: Trace + ?Sized> DynTrace for T { fn trace(&mut self, visitor: &mut MarkVisitor) { let Ok(()) = self.trace(visitor...
Rust
0
#!/usr/bin/env python3 # This script is run the first time any action is performed after the repository # is cloned. If you are reading this because the automatic initialization failed, # skip down to the section headed "INITIALIZATION STEPS". from sh import git import datetime import re import sys from urllib.parse ...
Python
1
r x, y in zip(fpr, tpr)] }] # 添加配置信息 result['chart_config'] = { 'title': 'ROC曲线', 'subtitle': f'AUC = {roc_auc:.4f}', 'xLabel': 'False Posi...
Python
1
. last_delay_ms: u32, /// The lowest allowable delay (in msec). low_bound_ms: u32, } /// Lowest possible lower bound, in milliseconds. // We're doing this in MS, and Tor does it in seconds, so I'm // multiplying the minimum by 1000 here. const MIN_LOW_BOUND: u32 = 1000; /// Largest possible lower bound, i...
Rust
0
remainder : ind.text.get(1..).unwrap(), }) } else { Err(PErr { pos : ind.pos }) } }, None => Err(PErr { pos : ind.pos })...
Rust
0
minha_string = "xx_xxxxx_0001_ABCDE_TESTE_INTRODUCAO_VIDEO" partes = minha_string.split("_") ultimo_elemento = partes.pop() print(f"A última parte é: {ultimo_elemento}")
Python
1
ne] pub fn read(&self) -> R { R { bits: self.register.get(), } } #[doc = r" Writes to the register"] #[inline] pub fn write<F>(&self, f: F) where F: FnOnce(&mut W) -> &mut W, { let mut w = W::reset_value(); f(&mut w); self.register....
Rust
0
ts: Dict[str, Any], **kwargs: Any ) -> Any: """ Run when chain starts running. on_chain_start runs multiple times during a chain execution. To make sure that it's only called once, we keep a bool state `_checked`. If not `self._checked`, we call limit with `request_ratelimit...
Python
1
::new(*col, 0), Point2::new(*col, grid.height()), 1, 10, "#fd5600", None, ); } for row in 0..grid.num_rows() { //for y in (grid.get_row_top(row), grid.get_row_bottom(row)) { let mut render_line = |y: u32| { renderer...
Rust
0
#!/usr/bin/env python3 import unittest from artemis.modules.runtime_configuration.nuclei_configuration import SeverityThreshold class TestSeverityThreshold(unittest.TestCase): """Test suite for the SeverityThreshold enum.""" def test_enum_values(self) -> None: """Test that the enum contains all expe...
Python
1
structure"] impl crate::Writable for KEY0 {} #[doc = "Key0"] pub mod key0; #[doc = "Key1\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg:...
Rust
0
t') scalemat = np.eye(4) mesh.vertices = mesh.vertices @ scalemat[:3, :3].T + scalemat[:3, 3] mesh = refuse(mesh, poses, K) out_mesh_path = args.output_mesh o3d.io.write_triangle_mesh(out_mesh_path, mesh) print(f"Saved tsdf mesh to {out_mesh_path}") mesh = trimesh.load(args.output_mesh) scale_matrix = np.lin...
Python
1
)*100, running_loss/len(train_dataloader), (val_accuracy/len(val_dataloader))*100, (val_f1_score/len(val_dataloader))*100, val_loss/len(val_dataloader) ) ) log.info(f"Learning Rate: {optimizer.param_...
Python
1
hen compiled without features=std"); } #[cfg(feature="std")] fn divans_new_decompressor_without_custom_alloc(to_box: DivansDecompressorState) -> *mut DivansDecompressorState{ alloc_util::Box::<DivansDecompressorState>::into_raw(alloc_util::Box::<DivansDecompressorState>::new(to_box)) } #[no_mangle] pub unsafe ex...
Rust
0
return "$%s\\cdot 10^{%d}$" % ( coefficient, int(exponent), ) return "$%s$" % scientific return value.replace("_", "\\_").replace("%", "\\%") mime_type = "application/x...
Python
1
self.scenario_folders = scenario_folders self.reinitialize() def reinitialize(self): # Structure: {scenario_id : {cav_1 : {timestamp1 : {yaml: path, # lidar: path, cameras:list of path}}}} self.scenario_database = OrderedDict() self.all_links_files=OrderedDict() ...
Python
1
˒4v{>ۅl~aT^ɖ ui\ j+.NW\#%q=?rNn1yMڧb #3I77t~FKeTrbKeo**"^W/3NjdMΉskwmt"SsnRD'ʋi%/??ncʹ qS`t8c̺6f;m{C.v[LM+Z9 7ٍPY?n e(K l:QfؼI%%޹x":5OFFa Q8GAJ)\բKfAWvQYWA*‹FnSЈi?ns:`SKe<0YImږ{2WRY*aeBi3ĈZFz}Y7)p\#@öz`$N@ 6P_eP/~UDㆍϣk~[A1A~e_^D2{;FI!c'-2qU?rC{3Ǝa^m:#L_B/{ mlsXk'䦱I/˾^t...
Python
1
step, batch in enumerate(eval_dataloader): with torch.no_grad(): outputs = model(**batch) loss = outputs.loss losses.append(accelerator.gather(loss.repeat(args.per_device_eval_batch_size))) losses = torch.cat(losses) losses = losses[: len(eval_datase...
Python
1
// RequestKind::PeerInfo => ("getpeerinfo", None), // RequestKind::Banned => ("listbanned", None), // RequestKind::RawTransaction(t, b) => ( // "getrawtransaction", // Some(Self::format_raw_transaction(t, b)), // ), // // Reque...
Rust
0
unwrap()); } }<filename>src/graphics/rock.rs<gh_stars>100-1000 pub struct RockGraphics; // to see fast parsing, uncomment next line and comment out following one: // use a::b; use a::b::c; pub fn mk_pass(name: ~str, op: @fn(&str) -> ~str) -> Pass { let op = Cell(op); Pass { name: copy name, f: ...
Rust
0
rc/print.rs use crate::{config, modules, sh, Segment}; use std::iter::once; pub fn prompt<T, U>(shell: &str, args: &Vec<config::Segment>, f: T) where T: Fn(usize, (&Segment, &Segment, &Segment)) -> U, U: IntoIterator<Item = (String, String, String)>, { let v: Vec<_> = once(Segment::default()) .chai...
Rust
0
import random from datetime import datetime, timedelta from .simulator_strategy import SimulatorStrategy from ..models.config.sensor_config import SensorConfig from ..models.raw_data.parking_raw_data import ParkingRawData class ParkingSimulatorStrategy(SimulatorStrategy): def __init__(self, sensor_name: str, co...
Python
1
.voted_ballot { os.write_tag(4, ::protobuf::wire_format::WireTypeLengthDelimited)?; os.write_raw_varint32(v.get_cached_size())?; v.write_to_with_cached_sizes(os)?; }; os.write_unknown_fields(self.get_unknown_fields())?; ::std::result::Result::Ok(()) } ...
Rust
0
my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; } if let Some(ref v) = self.PermissibleManual.as_ref() { let len = v.compute_size(); my_size += 1 + ::protobuf::rt::compute_raw_varint32_size(len) + len; } if let Some(ref v) = self.Permissibl...
Rust
0
::TEXTURE_COMPRESSION_BC`] must be enabled to use this texture format. Bc3RgbaUnormSrgb, /// 4x4 block compressed texture. 8 bytes per block (4 bit/px). /// 8 color pallet. 8 bit R. [0, 255] converted to/from float [0, 1] in shader. /// /// Also known as RGTC1. /// /// [`Features::TEXTURE_CO...
Rust
0
def read_polinom(filename): coefs = {} with open(filename, "r") as f: for line in f: power, coef = map(float, line.split()) coefs[int(power)] = coef return coefs def derivative(coefs): derivative_poly = {} for power, coef in coefs.items(): if power > 0: ...
Python
1
kground_color(REBECCAPURPLE) assert_action_performed_with(widget, "set background color", color=REBECCAPURPLE) def test_deprecated_widget_argument(widget): """The widget argument to TogaApplicator is deprecated.""" with pytest.warns(DeprecationWarning): TogaApplicator(widget) def test_widget_al...
Python
1
from nbodykit import setup_logging from nbodykit.mpirng import MPIRandomState from numpy.testing import assert_array_equal import numpy from mpi4py import MPI import pytest setup_logging("debug") @pytest.mark.parametrize("comm", [MPI.COMM_WORLD,]) @pytest.mark.mpi def test_mpirng_large_chunk(comm): rng = MPIRando...
Python
1
\x35\x25\x35\x35\x2d\x35" "\x25\x76\x35\x2d\x35\x39\x52\x69\x50\x25\x4a\x4d\x4e\x55\x25" "\x35\x32\x31\x2a\x2d\x74\x74\x74\x5a\x2d\x36\x5a\x74\x30\x2d" "\x25\x32\x6a\x38\x50\x25\x4a\x4d\x4e\x55\x25\x35\x32\x31\x2a" "\x2d\x75\x75\x43\x75\x2d\x43\x6f\x41\x30\x2d\x39\x64\x30\x34" "\x50\x25\x4a\x4d\x4e\x55\x25\x35\x32\x31\...
Python
1
ver_path = os.path.join(os.path.abspath(self.SERVER_PATH),"NetLogoControllerServer.jar") xmx = psutil.virtual_memory().available / 1024 / 1024 / 1024 xms = "-Xms" + str(int(math.floor(xmx - 2))) + "G" xmx = "-Xmx" + str(int(math.floor(xmx))) + "G" preferHeadless = "-Dorg.nlogo.preferHead...
Python
1
Emitting)?; [[broadcasts_processing]] for msg in broadcasting.iter_mut() { broadcast::<E, C>(msg, control).await?; } scope.call().await; Ok(()) }"#; pub const MODULE_WITHOUT_BROADCAST: &str = r#"use super::{ broadcast, events, identification, producer::Control, protocol, unbound_pack, Co...
Rust
0
the event event_type=HistoryEventType.DEPOSIT, event_subtype=HistoryEventSubType.DEPOSIT_ASSET, counterparty=NO_ACCOUNTING_COUNTERPARTY, rule=BaseEventSettings( taxable=True, count_entire_amount_spend=True, count_cost_basis_pnl=True, accou...
Python
1
rsa_2048_private_key.pk8. pub const X509_BAD_MISSING_SERIAL: &[u8] = include_bytes!("der/x509_bad_missing_serial.bin"); #[rustfmt::skip] /// Generated from x509_ok_unknown_noncritical.tbs. /// Signed with ./../../crypto/testdata/rsa_2048_private_key.pk8. pub const X509_OK_UNKNOWN_NONCRITICAL: &[u8] = include_bytes!("d...
Rust
0
] fn test_fold_arithmetic3() { fold("x = null * undefined", "x = NaN"); fold("x = null * 1", "x = 0"); fold("x = (null - 1) * 2", "x = -2"); fold("x = (null + 1) * 2", "x = 2"); fold("x = null ** 0", "x = 1"); } #[test] #[ignore] fn test_fold_arithmetic3_2() { fold("x = (-0) ** 3", "x = -0.0");...
Rust
0
.map_err(|e| JsValue::from(format!("{}", e)))?; Poll::Ready(if chunk_size > 0 { Some(Ok(Uint8Array::from(&this.chunk[..chunk_size]).into())) } else { None }) } } #[pin_project(project = SinkWriterProj)] pub(crate) struct SinkWriter<S: Sink<JsValue, Error =...
Rust
0
) { 0 => crate::private::cstr_to_slice(buf as _).len() as _, r => r, } }) } } // TODO // mbedtls_x509write_crt_set_version // mbedtls_x509write_crt_set_ns_cert_type // mbedtls_x509write_crt_set_authority_key_identifier // mbedtls_x509write_crt_set_subject_key_...
Rust
0
ate tid. """ logger.debug("Finding messaging template with id '{}'", template_id) try: messaging_template = get_template_by_id(db, template_id) return MessagingTemplateWithPropertiesDetail( id=template_id, type=messaging_template.type, content=messaging_t...
Python
1
-non-interactive") .arg("--schema-dir=tests/migrations/db1/modified1") .assert().code(0); SERVER.admin_cmd() .arg("migration").arg("log") .arg("--from-fs") .arg("--schema-dir=tests/migrations/db1/modified1") .arg("--newest-first") .arg("--limit=1") .as...
Rust
0
Def as *mut class::ClassDef; let vtable = VTableBox::new(clsptr, &vtable_entries); cls_def.vtable = Some(vtable); ensure_display(vm, &mut cls_def); id } fn ensure_display<'ast>(vm: &VM<'ast>, cls_def: &mut ClassDef) -> usize { let vtable = cls_def.vtable.as_mut().unwrap(); // if subtype_disp...
Rust
0
ndidate in poll_parameters.get_candidates().get_candidate() { let mut counting_part = CountingPart::new(); counting_part .set_blinding_c2(point_to_bytes(&RistrettoPoint::default())); let mut new_pair = StringToCountingPartPair::new(); new_pair.set_key(cand...
Rust
0
from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.ruleset import Ruleset T = TypeVar("T", bound="RulesetsMixin") @_attrs_d...
Python
1
p::try_from(data[2]).unwrap(), ks_to_gain: SignedLevel::from(data[3]), velocity_curve: VelocityCurve::try_from(data[4]).unwrap(), // 0~11 maps to enum velocity_depth: VelocityDepth::from(data[5]), } } fn to_bytes(&self) -> Vec<u8> { vec![ if self....
Rust
0
value as u32 & 0x01); self.w } } impl R { #[doc = "Bits 5:31"] #[inline(always)] pub fn sf_aes_status(&self) -> SF_AES_STATUS_R { SF_AES_STATUS_R::new(((self.bits >> 5) & 0x07ff_ffff) as u32) } #[doc = "Bit 4"] #[inline(always)] pub fn sf_aes_pref_busy(&self) -> SF_AES_PR...
Rust
0
let mut search: Search = Default::default(); search.constraints.phids = Some(lookup); search.attachments.projects = self.resolve_projects; Some(search) }; (search, cached) } }; search::Search::...
Rust
0
ENDERPASS_2_SPEC_VERSION: u32 = 1; pub const VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME: &'static [u8; 26usize] = b"VK_KHR_create_renderpass2\0"; pub const VK_KHR_shared_presentable_image: u32 = 1; pub const VK_KHR_SHARED_PRESENTABLE_IMAGE_SPEC_VERSION: u32 = 1; pub const VK_KHR_SHARED_PRESENTABLE_IMAGE_EXTENSION_NA...
Rust
0
pub struct FieldExprNode<R: TreeRoot<RaTypes> = OwnedRoot> { pub(crate) syntax: SyntaxNode<R>, } pub type FieldExpr<'a> = FieldExprNode<RefRoot<'a>>; impl<R1: TreeRoot<RaTypes>, R2: TreeRoot<RaTypes>> PartialEq<FieldExprNode<R1>> for FieldExprNode<R2> { fn eq(&self, other: &FieldExprNode<R1>) -> bool { self.sy...
Rust
0
3 * batch_size, # Ensures a minimum amount of shuffling of examples. min_after_dequeue=1000) return images, sparse_labels def run_training(): """Train MNIST for a number of steps.""" # Tell TensorFlow that the model will be built into the default Graph. with tf.Graph().as_default(): # ...
Python
1
')[1].split(', ')[1].split('s with')[0]), 'driver_id':line.split('driverId ')[1].split('\n')[0], 'user_id':line.split('Pickup succeeded for ')[1].split(' ')[0], 'origin':line.split('startNodeId ')[1].split(',')[0], 'destination':line.split('destinationNo...
Python
1
#coding:utf8 import torch import torchvision from PIL import Image, ImageDraw import numpy as np img_tensor = torch.zeros((1, 3, 800, 800)).float() print(img_tensor.shape) #Out: torch.Size([1, 3, 800, 800]) img_var = torch.autograd.Variable(img_tensor) model = torchvision.models.vgg16(pretrained=False) fe = list(mo...
Python
1
_args.n_candidate_gen_per_text if transcription: if "speech" not in model_args.model_name_or_path: print( "Warning: You choose to perform Text-to-Speech by providing the transcription. However you do not choose the correct model name (audioldm2-speech-gigaspeech or audioldm2-spe...
Python
1
rd_infer(self, x): x = self.conv1(x) for block in self.block: block.switch_to_deploy() if self.block is not None: x = self.block(x) return x def onnx_AdaptiveAvgPool2d(x, output_size): stride_size = np.floor(np.array(x.shape[-2:]) / output_size).astype(np.in...
Python
1
he value that was last added when adding new notes" } """ def __init__(self, name, order, **kwargs): self.name = name self.order = order d = next(iter(default['col']['models'].values()))['flds'][0].copy() d.update( name=self.name, o...
Python
1
ersion. Please use `from diffusers.models.unets.unet_2d_blocks import KCrossAttnUpBlock2D`, instead." deprecate("KCrossAttnUpBlock2D", "0.29", deprecation_message) # can potentially later be renamed to `No-feed-forward` attention class KAttentionBlock(KAttentionBlock): deprecation_message = "Importing `KAtten...
Python
1
.bits { 0 => Some(REG_GPIO_28_DRV_A::DISABLED), 1 => Some(REG_GPIO_28_DRV_A::ENABLED), _ => None, } } #[doc = "Checks if the value of the field is `DISABLED`"] #[inline(always)] pub fn is_disabled(&self) -> bool { **self == REG_GPIO_28_DRV_A::DISABLED ...
Rust
0
import paramiko import threading import time from datetime import datetime def monitor_device(host, username, command, log_file_path): try: # Use paramiko's Transport object to create a connection transport = paramiko.Transport((host, 22)) # Port 22 is standard for SSH # Connect to the h...
Python
1
try": "Entity", "Population (historical)": "Population"}) result_df = interpolated # Merge population data with interpolated dataframe result_df = result_df.merge( pop[["Entity", "Year", "Population"]], on=["Entity", "Year"], how="left" ) # Update the Population column, keeping the original values where no match i...
Python
1
ype PublicInputs = PublicInputs; // CONSTRUCTOR // -------------------------------------------------------------------------------------------- fn new(trace_info: TraceInfo, pub_inputs: PublicInputs, options: ProofOptions) -> Self { let degrees = vec![ TransitionConstraintDegree::with_c...
Rust
0
, MessageType::MsgBeat)]); let data: Vec<u8> = Vec::from("force follower"); tt.send(vec![new_message_with_entries( 3, 3, MessageType::MsgProp, vec![new_entry_with_data(data.clone())], )]); tt.send(vec![new_message(3, 3, MessageType::MsgBeat)]); assert_eq!(tt.peers...
Rust
0
ck these files"}, {"type": "file", "content": "file1_content"}]}, {"role": "user", "content": [{"text": "And this one too"}, {"type": "file", "content": "file2_content"}]}, {"role": "user", "content": [{"text": "Thanks!"}]} ] body = { "event": { "text...
Python
1
from tkinter import * def output(data): root = Tk() w, h = root.winfo_screenwidth(), root.winfo_screenheight() root.title("runway allocation") root.minsize(width=400, height=400) root.geometry("%dx%d+0+0" % (w, h)) root.configure(background="#1b262c") l=Label(root,text="RUNWAYS ALLOCATED",bg="#1b262c",fg='#3282...
Python
1
et's make sure one //! can not reach it directly through the Internet. From the dialing client test that you can not //! connect on Layer 4 (TCP): //! //! ``` bash //! telnet $RELAY_SERVER_IP 4001 //! ``` //! //! ## Connecting to the listening client from the dialing client //! //! ``` bash //! RUST_LOG=info ./client -...
Rust
0
trix([[rhs]])) == (lhs >= rhs) # np.array-VariableMatrix for lhs, rhs in args: assert bool(np.array([[lhs]]) < VariableMatrix([[rhs]])) == (lhs <= rhs) assert bool(np.array([[lhs]]) <= VariableMatrix([[rhs]])) == (lhs <= rhs) assert bool(np.array([[lhs]]) > VariableMatrix([[rhs]])) == (...
Python
1
import pandas as pd import streamlit as st # Set up file paths for historical and today's data history_file = "History.xlsx" today_file = 'Today.xlsx' # Streamlit UI title st.title('Data Comparison: History vs Today') # Input for the lower and upper limits upper_limit = st.number_input('Enter the Upper limit :', min...
Python
1
ncurrent background writes. fn sync(&mut self) -> Result<protocol::SyncStats, anyhow::Error>; // Estimate how many chunks we have stored, the implementation is free to // make a rough guess to increase performance. One trick is sampling // a single address prefix. fn estimate_chunk_count(&mut self)...
Rust
0
lass Example { @dec static enumconfwrite = 1; @dec static enumconf = 2; @dec static enumwrite = 3; @dec static enum = 4; @dec static confwrite = 5; @dec static conf = 6; @dec static write = 7; @dec static _ = 8; } const inst = new Example(); expect(Example).toHaveProperty("decor...
Rust
0
ewer_transform" in dataset_metadata and "viewer_initial_pose" in dataset_metadata: viewer_initial_pose_ws = apply_transform(invert_transform(dataset_metadata["viewer_transform"], has_scale=True), dataset_metadata["viewer_initial_pose"]) camera_center = torch.tensor(viewer_initial_pose_ws[:3, 3],...
Python
1
.mount("/", routes![index, submit]) .attach(Template::fairing()) .mount("/", FileServer::from(relative!("static"))) } use log::{error, info}; use seed::{prelude::*, *}; use serde::{Deserialize, Serialize}; use serde_json::Value; const ALL_CARGOS: &str = "cargo"; const CARGO_DETAILS: &str = "det...
Rust
0
;" ); } <gh_stars>0 use super::{State, StateIdx, DFA}; use fxhash::FxHashMap; #[derive(Debug)] pub enum Trans<A> { Accept(A), Trans(StateIdx), } /// Removes accepting states with no transitions, makes the transitions to those states accepting. // TODO: We need to turn RHSs into identifiers by introducing...
Rust
0
import sys, os, shutil, inspect; CURRENTDIR = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe()))); ROOT = os.path.dirname(CURRENTDIR); sys.path.append(ROOT); from api.apt import Apt; from api.systemctl import Systemctl; from api.distro import Distro; from api.process import Process; from api.log...
Python
1
from torch_geometric.graphgym.register import register_config from yacs.config import CfgNode as CN @register_config('cfg_sub') def set_cfg_sub(cfg): r''' This function sets the default config value for customized options :return: customized configuration use by the experiment. ''' # example argu...
Python
1
zipped_agents("app", &all_agents, &[dna]) .await .unwrap(); conductors.exchange_peer_info().await; (conductors, all_agents, apps) } use cli_table::{print_stdout, Cell, Style, Table}; use itertools::join; use furiosa_device::blocking::{get_status_all, list_devices}; use furiosa_device::{Device,...
Rust
0
/// The length of the Ed25519Signature pub const LENGTH: usize = ed25519_dalek::SIGNATURE_LENGTH; /// Serialize an Ed25519Signature. pub fn to_bytes(&self) -> [u8; ED25519_SIGNATURE_LENGTH] { self.0.to_bytes() } /// Deserialize an Ed25519Signature without any validation checks (malleab...
Rust
0