text
string
label_name
string
labels
int64
l[None, ...] + t_rel[None,...] @ n_ref.reshape(num_pts,1,3) / d))@torch.linalg.inv(K) return mat_homography def warp_patches(idx_patches_xy, homography): '''Warp patches from reference image to source images Args: idx_patches: N*M*M*2, xy index coordinates (numpy array) homography: N*3*3, f...
Python
1
0x00000002; pub const DOT11_STATUS_UNSUPPORTED_PRIORITY: NDIS_STATUS = 0x00000004; pub const DOT11_STATUS_UNSUPPORTED_SERVICE_CLASS: NDIS_STATUS = 0x00000008; pub const DOT11_STATUS_UNAVAILABLE_PRIORITY: NDIS_STATUS = 0x00000010; pub const DOT11_STATUS_UNAVAILABLE_SERVICE_CLASS: NDIS_STATUS = 0x00000020; pub const DOT...
Rust
0
here we show how to use these weights with existing API def block2symbol(block): data = mx.sym.Variable("data") sym = block(data) args = {} auxs = {} for k, v in block.collect_params().items(): args[k] = mx.nd.array(v.data().asnumpy()) return sym, args, auxs mx_sym, args, auxs = block2...
Python
1
self.recover_stmt(); } /// Parses `ident (COLON expr)?`. fn parse_expr_field(&mut self) -> PResult<'a, ExprField> { let attrs = self.parse_outer_attributes()?; self.collect_tokens_trailing_token(attrs, ForceCollect::No, |this, attrs| { let lo = this.token.span; ...
Rust
0
)?, unexpected => { return Err(Loc(Error::Unexpected(unexpected), self.pos.last())) } }; iri.push(c) } Some(c) => { if matches!( c, '\u{00}'..='\u{20}' | '<' | '>' | '"' | '{' | '}' | '|' | '^' | '`' | '\\' ) { return Err(Loc(Error::Unexpected(Some(c)), ...
Rust
0
G: avifChannelIndex = 1; pub const AVIF_CHAN_B: avifChannelIndex = 2; pub const AVIF_CHAN_Y: avifChannelIndex = 0; pub const AVIF_CHAN_U: avifChannelIndex = 1; pub const AVIF_CHAN_V: avifChannelIndex = 2; pub type avifChannelIndex = ::std::os::raw::c_uint; extern "C" { pub fn avifVersion() -> *const ::std::os::raw:...
Rust
0
#[test] fn coordinatesys() { let conn = init_testing(); use self::coordinate_system_descriptions::columns::{ c1_label, c1_reversed, c1_unit, c2_label, c2_reversed, c2_unit, c3_label, c3_reversed, c3_unit, id, name, srs_type, }; use self::coordinate_system_descriptions::dsl::coordinate_...
Rust
0
, } impl FancyKeypad { fn up(&self) -> FancyKeypad { use FancyKeypad::*; match *self { Three => One, Six => Two, Seven => Three, Eight => Four, A => Six, B => Seven, C => Eight, D => B...
Rust
0
ss, self.fs, a(b, 0), 0.0, BQFParam::Q(0.707)); self.rl2 = BiquadFilter::new(BQFType::LowPass, self.fs, a(b, 1), 0.0, BQFParam::Q(0.707)); self.rl3 = BiquadFilter::new(BQFType::LowPass, self.fs, a(b, 2), 0.0, BQFParam::Q(0.707)); self.rl4 = BiquadFilter::new(BQFType::LowPass, self.fs, a(b, 3), 0...
Rust
0
} /// Generates a DiskInfo for Windows and unix systems /// /// Runs system_information/src/cpp/disk to get total, /// free, and in use space for the C or / filesystems. pub fn get_disk_info(fs: &str) -> DiskInfo { let mut path = std::env::current_dir().unwrap(); path.push("src"); path.push("cpp"); pat...
Rust
0
m_size1 is not None: args.im_size1 = [int(s) for s in args.im_size1.split(',')] if len(args.im_size1) == 1: args.im_size1 = args.im_size1[0] if args.im_size2 is not None: args.im_size2 = [int(s) for s in args.im_size2.split(',')] if len(args.im_size2) == 1: ar...
Python
1
}", n); Ok(()) } <reponame>jneem/scribl<filename>widget/src/toggle_button.rs<gh_stars>10-100 use druid::kurbo::Vec2; use druid::widget::prelude::*; use druid::widget::LabelText; use druid::{theme, Data, Insets, Point, RenderContext, Size, WidgetExt, WidgetPod}; use crate::{Icon, Shadow, TooltipExt}; /// A [`Togg...
Rust
0
], ids=[ "lowercase-true", "capital-True", "numeric-1", "text-yes", "text-on", "lowercase-false", "capital-False", "numeric-0", "text-no", "text-off", ], ) def test_trace_include_sensitive_data_follows_env_value(env_value, expected,...
Python
1
ch: int) -> None: """ Train the VAE for one epoch. Args: epoch (int): Current epoch number. """ global steps model.train() train_loss = 0 for batch_idx, (data, _) in enumerate(train_loader): data = data.to(device) optimizer.zero_grad() recon_batch, q_z = ...
Python
1
: 100.0, currency: Currency::Euro, }, ), ( "10 $", Money { amount: 10.0, currency: Currency::Dollar, }, ), ( "42.4 DOLLAR", ...
Rust
0
{'name': 'F2', 'barcode': '1', 'company_id': company_a.id}, # Forbidden, collides with BC2 {'name': 'F3', 'barcode': '2', 'company_id': company_b.id}, # Forbidden, collides with A1 {'name': 'F4', 'barcode': '3', 'company_id': company_a.id}, # Forbidden, colli...
Python
1
d) // 2, 0) d_end = min(d_start + dd, d) # Crop or pad the tensor tensor = tensor[h_start:h_end, w_start:w_end, d_start:d_end] pad_h_before = (dh - tensor.size(0)) // 2 pad_h_after = dh - tensor.size(0) - pad_h_before pad_w_before = (dw - tensor.size(1)) // 2 p...
Python
1
.takes_value(true) .default_value("./config.yaml") .help("The path to the configuration file.")) .subcommand(SubCommand::with_name("toot") .about("Generate a toot and print it in the console.") .arg(Arg::with_name("post") ...
Rust
0
any(|b| b == '.') { Err(anyhow!( "{} does not contain decimal point", context::string(name, term) ) .into()) } else { // Erlang does not track the d...
Rust
0
import cv2 import numpy as np # Load the dress with alpha channel dress_path = r'C:\Users\rupin\Downloads\EY Hackathon\tshirt.png' dress = cv2.imread(dress_path, cv2.IMREAD_UNCHANGED) # Load Haar cascades for face and upper body face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_de...
Python
1
if p == 0.0: return tokens num_tokens = len(tokens) n = int(math.ceil(num_tokens * p)) noise_indices = torch.randperm(num_tokens + n - 2)[:n] + 1 noise_mask = torch.zeros(size=(num_tokens + n,), dtype=torch.bool) noise_mask[noise_indices] = 1 result = torch....
Python
1
, ) def finalize(self): """ Signals that this field's vocab can be built. """ super().finalize() if self._num_of_classes is None: self.fixed_length = self._num_of_classes = len(self.vocab) if self.use_vocab and len(self.vocab) > self._num_of_clas...
Python
1
} Ok(Async::Ready(None)) } }use crate::*; /// A WinRT method parameter pub enum Param<'a, T: RuntimeType> { Borrowed(&'a T), Owned(T), } impl<'a, T: RuntimeType> Param<'a, T> { pub fn abi(&mut self) -> T::Abi { match self { Param::Borrowed(value) => value.abi(), ...
Rust
0
RG_LOG_LEVEL, ARG_OUTPUT_TYPE}; use current::CurrentCmd; use flush::FlushCmd; use huber_common::model::config::Config; use huber_common::result::Result; use info::InfoCmd; use install::InstallCmd; use repo::RepoCmd; use reset::ResetCmd; use search::SearchCmd; use self_update::SelfUpdateCmd; use show::ShowCmd; use simpl...
Rust
0
<li> <p>"JP" - JAPAN</p> </li> /// <li> <p>"KZ" - KAZAKHSTAN</p> </li> /// <li> <p>"KR" - KOREA</p> </li> /// <li> <p>"LV" - LATVIA</p> </li> /// <li> <p>"LI" - LIECHTENSTEIN</p> </li> /// <li> <p>"LT" - LITHUANIA</p> </li> /// <li> <p>"LU" - LUXEMBOURG</p> </li> /// <li> <p>"MK" - MACEDONI...
Rust
0
0, 1080) # Set window size to 1920x1080 pixels driver.get('https://www.moontok.io/listings/presales') while True: if GetTokenFromPage(driver): pagination = WebDriverWait(driver, 10).until( EC.presence_of_all_elements_located((By.CLASS_NAME, 'moontok-1sm...
Python
1
# Use a generator expression to capitalize the strings in a list of strings whose length is at least 5. Use a single print invocation to print all the capitalized strings as a set. strings = ["four", "score", "and", "seven", "years", "ago"] capitalized = (string.capitalize() for string in strings if len(string) >= 5)...
Python
1
https://www.zhaopin.com/sou/jt7000700010000?order=4", "工程招投标": "https://www.zhaopin.com/sou/jt2000100030000?order=4", "房产销售": "https://www.zhaopin.com/sou/jt19000200040000?order=4", "房地产销售总监": "https://www.zhaopin.com/sou/jt7000800010000?order=4", "地产招投标总监": "https://www.zhaopin.com/sou/jt7000800020000?...
Python
1
from typing import List class Solution: def spiralOrder(self, matrix: List[List[int]]) -> List[int]: return self.spiral_build(matrix, len(matrix), len(matrix[0]), 0, 0, 'lt') def spiral_build(self, board: List[List[int]], m_row: int, n_col: int, beg_i, beg_j, corner_st: str = 'lt') \ -> L...
Python
1
())); } if self.fit_to_width.has_value() { attributes.push(("fitToWidth", self.fit_to_width.get_value_string())); } if self.horizontal_dpi.has_value() { attributes.push(("horizontalDpi", self.horizontal_dpi.get_value_string())); ...
Rust
0
param_value, param_id_str, param_ptr, ); } } // Make sure everything starts out in sync if let Some(sample_rate) = sample_rate { param_ptr.update_smoother(sample_rate, true); } } // The plugin can...
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.model_get_exchange_announcements_response_announcements_item import ( ...
Python
1
""" This module is responsible for automatic processing of provider callback data (asynchronous transaction updates). """ from django.db.transaction import atomic from django.http import Http404 from django.shortcuts import get_object_or_404 from django.urls import path from django.urls import re_path from django.views...
Python
1
asurement outcome of qubit 0 : %i" % int(m0)) print("[>] measurement outcome of qubit 1 : %i" % int(m1)) # reinitialize the qubits to |00> print("[+] reinitializing circuit to |00> ...") qc.run_circuit("init") # noisy execution of the circuits print("[+] noisy execution of the circuits...") for i in range(0,10): ...
Python
1
import ply.lex as lex tokens = ( 'LAMBDA', # Token for the lambda symbol 'DOT', # Token for the dot symbol 'VAR', # Token for variables (a-z) 'NUMBER', # Token for numbers (0-9) 'LPAREN', # Token for left parenthesis 'RPAREN', # Token for right parenthesis ) # Regular express...
Python
1
# coding: utf-8 # ============================================================================= # Ural Is Homepage Unit Tests # ============================================================================= from ural import is_homepage DEFAULT_TESTS = [ ("https://www.lemonde.fr/", True), ("https://www.lemonde.f...
Python
1
"Landroid/icu/lang/UCharacter$UnicodeBlock;\0"); env.get_static_object_field(class, field) } } /// public static final [AEGEAN_NUMBERS_ID](https://developer.android.com/reference/android/icu/lang/UCharacter.UnicodeBlock.html#AEGEAN_NUMBERS_ID) pub const AEGEAN_NUMBE...
Rust
0
epare_chatml_sample(row.to_dict(), tokenizer) ret.append((input_tokens, label_tokens, audio_contents, speaker_id)) return ret def prepare_chatml_dataframe(df, tokenizer, num_process=16): if num_process is None: return prepare_chatml_dataframe_single_process(df, tokenizer) else: num...
Python
1
wheel.step_pin.set_high().unwrap(); } let mut queue = WHEEL_EVENT_Q.split().0; queue.enqueue(WheelEvent{ id: wheel.id, dir: wheel.is_dir_pin_high}).ok(); } if wheel.timeout.0 > (500 * 1000).ns().0 { ...
Rust
0
r=NotifyBlueSky.quote(user, safe=""), password=self.pprint( self.password, privacy, mode=PrivacyMode.Secret, safe="" ), params=NotifyBlueSky.urlencode(params), ) @staticmethod def parse_url(url): """Parses the URL and returns enough arguments ...
Python
1
after the quit event of the window is called. fn quit_event(&mut self) {} /// Gets the current mouse position. fn mouse_position(&self) -> Point; /// Is called if active state of the window is changed. fn active(&mut self, active: bool); /// Runs the inner logic of the shell adapter. fn ...
Rust
0
mouse_pos, delta, manager } } } pub struct RenderParams<'a> { pub gl: &'a WebGlRenderingContext, pub manager: &'a ContainerManager } impl<'a> RenderParams<'a> { pub fn new(gl: &'a WebGlRenderingContext, manager: &'a ContainerManager) -> RenderParams<'a> { Ren...
Rust
0
] //! to acquire an [`EventLoopProxy`][event_loop_proxy] and call its [`send_event`][send_event] method. //! //! See the root-level documentation for information on how to create and use an event loop to //! handle events. //! //! [create_proxy]: crate::event_loop::EventLoop::create_proxy //! [event_loop_proxy]: crate:...
Rust
0
pace('_'); assert !is_whitespace('\u0000'); } #[test] fn test_to_digit() { assert to_digit('0', 10u) == Some(0u); assert to_digit('1', 2u) == Some(1u); assert to_digit('2', 3u) == Some(2u); assert to_digit('9', 10u) == Some(9u); assert to_digit('a', 16u) == Some(10u); assert to_digit('A', 1...
Rust
0
import ekeko from ekeko.backtrader.broker import ( Account, BrokerBuilder, Order, OrderBuilder, Position, ) from ekeko.backtrader.engine import BaseStrategy, Engine from ekeko.backtrader.optimizer import Optimizer from ekeko.backtrader.screener import TrivialScreener from ekeko.data_loader import Yf...
Python
1
repo, username }, Some(secret)) => { format!("https://{}:{}@{}", username, secret, repo) } (GitRepo::HttpsPrivate { .. }, None) => { panic!("No PAT or password provided for private repository.") } } } } ///////////////////////////////////...
Rust
0
o); if common.len() >= 12 { return Some((o, common)); } } None } fn manhatten_distance(p1: &Pos, p2: &Pos) -> i64 { let (x, y, z) = sub_pos(p1, p2); i64::abs(x) + i64::abs(y) + i64::abs(z) } fn solve(puzzle: &[Vec<Pos>]) -> (usize, i64) { let mut fixed_scanners = ...
Rust
0
ng code draw = ImageDraw.Draw(image) # draw boxes on the image image_width, image_height = image.size if normalized_to_pixel: bboxes = [ ( int(y * image_height), int(x * image_width), int(h * image_height), int(w * ima...
Python
1
Cszf|jr8tj}tjdkrd|dtj7}n,|jdkrLd}n|jdkr`d}nd}Wnt y|d}Yn0d |j j |fS) N MainThread|rNonerSomeOtherThreadSomeOtherProcessrXz<%s(owner=%s)>) r_is_miner rGr( threadingcurrent_threadrV_countrYrZrK)r,...
Python
1
stringTitulo: str= 'CRUD' stringCrudLogger: str= 'CRUDLogger'
Python
1
a do@sLdZddlTddgZdZdZdZdZdZd Zd Z e fd dZ e fd dZ d S)zTerminal utilities.)*setraw setcbreakcCst|}|tttBtBtBtB@|t<|tt@|t<|t t t B@|t <|t t B|t <|t ...
Python
1
{ lazy_static! { static ref RE: Regex = Regex::new(r"<x=(-?\d+), y=(-?\d+), z=(-?\d+)>").unwrap(); } RE.captures_iter(input).filter_map(|cap| { Some(Vec3( cap.get(1)?.as_str().parse().ok()?, cap.get(2)?.as_str().parse().ok()?, cap.get(3)?.as_str().parse()...
Rust
0
"rgb_multistep_orig": rgb_multistep_orig.permute(0, 2, 3, 1), } ) if self.cfg.guidance_type == "vsd": guidance_out.update( { "loss_train_phi": loss_train_phi, } ) return guidance_out def up...
Python
1
from causallearn.graph.Graph import Graph class AdjacencyConfusion: """ Compute the adjacency confusion between two graphs. """ __adjFn = 0 __adjTp = 0 __adjFp = 0 __adjTn = 0 def __init__(self, truth: Graph, est: Graph): """ Compute and store the adjacency confusion b...
Python
1
= 1: img = F.interpolate( img, size=self._input_size, mode='bilinear', align_corners=False) for gt_bbox in gt_bboxes: gt_bbox[..., 0::2] = gt_bbox[..., 0::2] * scale_x gt_bbox[..., 1::2] = gt_bbox[......
Python
1
l_script = os.path.join(gcloud_dir, "install.sh") subprocess.run([install_script, "--quiet"], check=True) # Update shell-profile with gcloud PATH bin_dir = os.path.join(gcloud_dir, "bin") update_shell_profile(bin_dir) except subprocess.CalledProcessError as e: print(f"Comma...
Python
1
s: url_manager(svo_url, "Serveo") if lx_success and tunneler.lower() in [ "loclx", "lx" ]: masking(lx_url) elif lhr_success and tunneler.lower() in [ "localhostrun", "lhr" ]: masking(lhr_url) elif cf_success and tunneler.lower() in [ "cloudflared", "cf" ]: ...
Python
1
max_norm, group_size=group_size, ) # Test intercompatibility between implementations. py_mx_q_input = py_quantize_mx4(input, group_size) py_mx_output = py_dequantize_mx4(py_mx_q_input, group_size) triton_mx_q_input = fp32_to_mx4(input, group_size, use_triton=T...
Python
1
usize { self.2 - self.1 } } #[derive(Clone)] pub struct Byte32Vec(molecule::bytes::Bytes); impl ::core::fmt::LowerHex for Byte32Vec { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { use molecule::hex_string; if f.alternate() { write!(f, "0x")?; ...
Rust
0
PacketType::ComConnect => 0x0b, PacketType::ComProcessKill => 0x0c, PacketType::ComDebug => 0x0d, PacketType::ComPing => 0x0e, PacketType::ComTime => 0x0f, PacketType::ComDelayedInsert => 0x10, PacketType::ComChangeUser => 0x11, ...
Rust
0
"timezone": "America/Los_Angeles" }, "Oklahoma": { "cities": ["Oklahoma City", "Tulsa", "Norman", "Broken Arrow", "Lawton", "Edmond", "Moore"], "timezone": "America/Chicago" }, "Connecticut": { "cities": ["Bridgeport", "New Haven", "Stamford", "Hartford", "Waterbury", "Norwalk",...
Python
1
import os import setuptools about = {} here = os.path.abspath(os.path.dirname(__file__)) with open(os.path.join(here, "pipelines", "__version__.py")) as f: exec(f.read(), about) with open("README.md", "r") as f: readme = f.read() required_packages = ["sagemaker==2.93.0"] extras = { "test": [ "...
Python
1
t_eq!( Operations::new( 3, 4, vec![ Microcode::SetProgramStatusFlagState(ProgramStatusFlags::Carry, true), Microcode::SetProgramStatusFlagState(ProgramStatusFlags::Negative, false), Microcode::SetProgramStatusFlagState(ProgramSt...
Rust
0
::from_iter( vec![("comment".to_owned(), bencode_elem!("none"))].into_iter(), )) ) } #[test] fn extract_file_extra_fields_none() { assert_eq!(File::extract_file_extra_fields(HashMap::new()), None) } } #[cfg(test)] mod torrent_read_tests { // @note: `read...
Rust
0
' 167: 198, # 'І' 168: 199, # '®' 169: 200, # '©' 170: 201, # '™' 171: 202, # 'Ђ' 172: 203, # 'ђ' 173: 204, # '≠' 174: 205, # 'Ѓ' 175: 206, # 'ѓ' 176: 207, # '∞' 177: 208, # '±' 178: 209, # '≤' 179: 210, # '≥' 180: 211, # 'і' 181: ...
Python
1
.find(|r| r.is_err()) { Some(error) => error, None => { match results.find(|r| r.as_ref().unwrap_or(&PollerState::Busy) == &PollerState::Busy) { Some(busy) => busy, None => PollResult::Ok(PollerState::Idle), } } } } //! [![GitHub Workfl...
Rust
0
cket( node=self, output_name=output_name, type_codename=(type_to_codename(expected_type)), ) for output_name, expected_type in self.ordered_output_type_map.items() } ### gather the rects of the output sockets in a list ### ...
Python
1
( "global_i32".to_string(), HostValue::Global(create_glbal( WasmValue::I32(666), GlobalType { content_type: Type::I32, mutable: false, }, )), ); module.insert( "global_i64".to_string(), HostValue::Global(...
Rust
0
cument should have a body") } /// provides access to the window Performance api pub fn performance() -> web_sys::Performance { window() .performance() .expect("should have performance on window") } /// return the instantaneous time pub fn now() -> f64 { performance().now() } #![feature(no_core...
Rust
0
hickness(mil)' def tb_T_MouseEnter(self, sender, e): self.lb1.Content='Trace Thickness(mil)' def calculate(self, sender, e): try: w=float(self.textBox1.Text) dk=float(self.tb_dk.Text) d=float(self.textBox.Text) h=float(self.tb_H.Text) ...
Python
1
# Webhook/webhook_server.py from flask import Flask, request, abort from linebot.v3 import WebhookHandler from linebot.v3.messaging import Configuration, ApiClient, MessagingApi from linebot.v3.webhooks import MessageEvent, TextMessageContent, PostbackEvent from linebot.v3.messaging import TextMessage, QuickReply, Qui...
Python
1
#Write a Python program that checks if a given number is a prime number or not. If it's prime, print "Prime", # otherwise print "Not Prime". num = int(input("Enter a number: ")) is_prime = True if num > 1: for i in range(2, num): if num % i == 0: is_prime = False break else: is_...
Python
1
torch.load(self.bigvgan_path, map_location="cpu") self.bigvgan.load_state_dict(vocoder_dict["generator"]) self.bigvgan = self.bigvgan.to(self.device) # remove weight norm on eval mode self.bigvgan.remove_weight_norm() self.bigvgan.eval() print(">> bigvgan weights restore...
Python
1
h it was created."] #[doc = " - The size must be page aligned. See ::zeVirtualMemQueryPageSize."] #[doc = " - The application may call this function from simultaneous threads."] #[doc = " - The implementation of this function must be thread-safe."] #[doc = ""] #[doc = " @returns"] #[...
Rust
0
recv_msg(&mut self.1[..bytes_read]) .map_err(|e| { warn!(self.4, "ccp_read_msg error"; "code" => ?e); }) .unwrap_or_else(|_| ()); self.3 += 1; if self.3 == 1 { self.2.send(())?; } Ok(minion::LoopState::Continue) } } mo...
Rust
0
ub content_finder_conditions: ContentFinderConditions, } #[derive(Debug, Deserialize)] pub struct ContentFinderConditions { #[serde(rename = "ContentFinderCondition.ClassJobLevelRequired")] pub class_job_level_required: u64, #[serde(rename = "ContentFinderCondition.ClassJobLevelSync")] pub class_job_level_sync...
Rust
0
# High-confidence keywords if any(keyword in title_lower for keyword in ['psa', 'bgs', 'cgc']): confidence += 0.2 if any(keyword in title_lower for keyword in ['first edition', '1st edition']): confidence += 0.15 if any(keyword in title_lower for ...
Python
1
mut (*(*(*conn).crtc).primary).surf, buffer_age); } unsafe extern "C" fn drm_connector_commit(mut output: *mut wlr_output) -> bool { let mut conn: *mut wlr_drm_connector = get_drm_connector_from_output(output); let mut drm: *mut wlr_drm_backend = get_drm_back...
Rust
0
y RustLr #![allow(dead_code)] #![allow(unused_variables)] #![allow(non_snake_case)] #![allow(non_camel_case_types)] #![allow(unused_parens)] #![allow(unused_mut)] #![allow(unused_assignments)] extern crate RustLr; use RustLr::{Parser,RGrule,Stateaction}; pub fn make_parser() -> Parser<i64> { let mut parser1:Parser<i...
Rust
0
generic constructor ([`Closure::from_fn_const`]). // FIXME: See above impl<T: FnOnce(usize) + Copy + Send + 'static> const IntoClosureConst for (usize, T) { fn into_closure_const(self) -> Closure { #[inline] unsafe extern "C" fn trampoline_usize_spec<T: FnOnce(usize)>(env: ClosureEnv) { ...
Rust
0
; /// We want to allow different kinds of span classifiers to have /// different sets of span kinds, and to be able to invent new ones /// without needing to list them all here. Additionally we want /// deciding what to do when presented with values of this type to /// be up to individual clients of the `editor` cr...
Rust
0
_file = str(sanitized_file).replace(".jsonl", "_eval_results.json") if not os.path.exists(cache_file): print(f"Cache file not found: {cache_file}") exit() with open(cache_file, 'r') as file: cache_json = json.load(file) print(cache_json.keys()) # U...
Python
1
n="store", dest="maxdepth", help="Maximum depth of submodules to show in the TOC (default=4)", type="int", default=4) parser.add_option("-r", "--dry-run", action="store_true", dest="dryrun", help="Run the script without creating the files") parser.add_option("-f", "--force", action="store_true", dest="force", h...
Python
1
> EventStream<E>; fn once<E: Event>(&self) -> EventOnce<E>; } impl EventTargetExt for web_sys::EventTarget { fn add_event_listener<E: Event>(&self, mut f: impl FnMut(E) + 'static) -> ListenerHandle { let closure = Closure::wrap(Box::new( move |e| f(E::from_event(e)) ) as Box<dyn FnM...
Rust
0
""" Obstacle Avoider Virtual Base # from abc import ABC, abstractmethod. """ # Author Lukas Huber # Mail lukas.huber@epfl.ch # Created 2021-09-13 # License: BSD (c) 2021 # from abc import ABC, abstractmethod from abc import ABC, abstractmethod import warnings import numpy as np from numpy import linalg as LA from va...
Python
1
2), rhs.extract(3), rhs.extract(0), -rhs.extract(1) ); let p3 = Simdf32x4::splat(lhs.extract(3)) * Simdf32x4::new( -rhs.extract(3), -rhs.extract(2), rhs.extract(1), rhs.extract(0) ); (p0 + p1 + p2 + p3).into() } } ...
Rust
0
); assert_eq!( unsafe { &(*(::std::ptr::null::<_TMPQHeader>())).dwRawChunkSize as *const _ as usize }, 108usize, concat!( "Offset of field: ", stringify!(_TMPQHeader), "::", stringify!(dwRawChunkSize) ) ); assert_eq!( un...
Rust
0
maths=40 science=70 hindi=50 english=66 sum=maths+science+hindi+english p=(sum/400)*100 round_p=round(p, 3) print("Raj's percentage is {}" .format(round_p),"%")
Python
1
. #[inline(always)] pub unsafe fn on_error(max_channel: usize) { interrupt::free(|cs| { (0..max_channel) .map(|chan| Channel::new(chan)) .filter(|chan| chan.is_error()) .flat_map(|channel| { let waker = WAKERS[channel.channel()].borrow(cs); ...
Rust
0
res.try_extend_from_slice(&value.to_be_bytes()).unwrap(); res } iced_x86::OpKind::Immediate32 => { let value = instr.immediate32(); res.try_extend_from_slice(&value.to_be_bytes()).unwrap(); res } iced_x86::OpKind::Immediate64 => ...
Rust
0
{GossipListenAddr, GOSSIP_DEFAULT_PORT}; use sup::error::{Error, Result, SupError}; use sup::feat; use sup::http_gateway; use sup::manager::{Manager, ManagerConfig}; use sup::util; use sup::VERSION; /// Our output key static LOGKEY: &'static str = "MN"; static RING_ENVVAR: &'static str = "HAB_RING"; static RING_KEY_E...
Rust
0
from dataclasses import dataclass import mock import pytest from pathy import Pathy, get_client from . import azure_testable from .conftest import ENV_ID AZURE_ADAPTER = ["azure"] @pytest.mark.parametrize("adapter", AZURE_ADAPTER) @pytest.mark.skipif(not azure_testable, reason="requires azure") def test_azure_rec...
Python
1
n for building //! [`Version`] struct from string and some helper data structures and functions. //! //! # Examples //! //! Parsing `Version` from string and checking its fields: //! //! ``` //! use semver_parser::version; //! //! # fn try_main() -> Result<(), String> { //! let version = version::parse("1.2.3-alpha1")?...
Rust
0
), ), } } else { ErrorOutputType::HumanReadable(color) }; let unparsed_crate_types = matches.opt_strs("crate-type"); let crate_types = parse_crate_types_from_list(unparsed_crate_types) .unwrap_or_else(|e| early_error(error_format, &e[..])); let mut lint_opts =...
Rust
0
}); __bindgen_bitfield_unit.set(2usize, 1u8, { let __zdiv: u16 = unsafe { ::std::mem::transmute(__zdiv) }; __zdiv as u64 }); __bindgen_bitfield_unit.set(3usize, 1u8, { let __ovrfl: u16 = unsafe { ::std::mem::transmute(__ovrfl) }; __ovrfl as u64 ...
Rust
0
理 for i in range(0, len(items), self.batch_size): batch = items[i:i + self.batch_size] print(f"\n📦 处理第{(i // self.batch_size) + 1}批,共{len(batch)}个项目") # 处理当前批次 batch_tasks = [ self.process_item(item['id'], item['time']) ...
Python
1
one) -> datetime: """ 获取上一年的日期 Parameters ---------- dt : datetime | None, optional 待获取上一年的日期, 默认为当前日期, by default None Returns ------- datetime 表示上一年同一天的 datetime 对象 """ if dt is None: dt = cls.local_n...
Python
1
Total]; let mut levelOffset = vec![0; maxLevel]; let mut Lnm = (0..numBoxIndexLeaf) .map(|_| vec![Complex::new(0f64, 0f64); numCoefficients]) .collect::<Vec<_>>(); let mut LnmOld = (0..numBoxIndexLeaf) .map(|_| vec![Complex::new(0f64, 0f64); numCoefficients]) .collect::<Vec<_>>(); ...
Rust
0
IHBhcnR5IGlzIGp1bXBpbmc=".as_ref()) .unwrap(), encoding::from_base64( b"<KEY> .as_ref(), ) .unwrap(), encoding::from_base64( b"MDAwMDAyUXVpY2sgdG8gdGhlIHBvaW50LCB0byB0aGUgcG9pbnQsIG5vIGZha2luZw==".as_ref(...
Rust
0
use std::{iter::FromIterator, path::PathBuf}; let res_path = PathBuf::from_iter(&[env!("CUBISM_CORE"), "Samples/Res"]); let textures = load_textures(window); let mut haru = core::Model::from_bytes(&std::fs::read(&res_path.join("Haru/Haru.moc3")).unwrap()[..]) .expect("Failed to load mo...
Rust
0