text
string
label_name
string
labels
int64
} } } else { Ok(hostname.to_string()) } } /// Returns the fully qualified domain name of the running machine. pub fn fqdn() -> Option<String> { let result = dns_lookup::get_hostname().and_then(|hostname| lookup_fqdn(&hostname)); if let Err(ref e) = result { debug!("...
Rust
0
[&( // e(c^r vector form, h^delta) E::G1Prepared::from(proof.agg_c), E::G2Prepared::from(pvk.vk.delta_g2), )]) }, // 5. compute the middle part of the final pairing equation, the one // with the public inp...
Rust
0
"""Test empty string validation for required string properties""" import sys sys.path.insert(0, '/root/hypothesis-llm/envs/troposphere_env/lib/python3.13/site-packages') from hypothesis import given, strategies as st import troposphere.codeartifact as codeartifact from troposphere import Tags # Test all required str...
Python
1
pub const XrResult_XR_ERROR_SESSION_NOT_STOPPING: XrResult = -29; pub const XrResult_XR_ERROR_TIME_INVALID: XrResult = -30; pub const XrResult_XR_ERROR_REFERENCE_SPACE_UNSUPPORTED: XrResult = -31; pub const XrResult_XR_ERROR_FILE_ACCESS_ERROR: XrResult = -32; pub const XrResult_XR_ERROR_FILE_CONTENTS_INVALID: XrResult...
Rust
0
import os import math import random import functools import numpy as np import paddle import cv2 from PIL import Image, ImageEnhance random.seed(0) np.random.seed(0) DATA_DIM = 224 BUF_SIZE = 102400 mean = [0.485, 0.456, 0.406] std = [0.229, 0.224, 0.225] def resize_short(img, target_size): percent = float(ta...
Python
1
import reflex as rx import proyecto_link.constants as const from proyecto_link.components.link_button import link_button from proyecto_link.components.title import title from proyecto_link.components.newsletter import newsletter from proyecto_link.styles.styles import Color, Spacing def courses_links() -> rx.Componen...
Python
1
# Copyright (c) Alibaba, Inc. and its affiliates. import unittest from PIL import Image from modelscope.outputs import OutputKeys from modelscope.pipelines import pipeline from modelscope.utils.constant import Tasks from modelscope.utils.test_utils import test_level class TrafficSignDetectionTest(unittest.TestCase...
Python
1
.map(|p| p.get()) .unwrap_or(-1.0) } fn PropertiesWindow(&mut self, hwndParent: *mut HWND__) -> i32 { let args = PropertiesWindowArgs { parent_window: NonNull::new(hwndParent), }; self.delegate.properties_window(args) } fn GetSamples(&mut se...
Rust
0
for t in discovered_tokens): discovered_tokens.append(token_data) if len(discovered_tokens) >= limit: return discovered_tokens ...
Python
1
_success"); Ok(()) } <filename>src/compile_model/encoded_tables.rs // FIXME: switch back to BTreeMap for table ordering use std::collections::HashMap; use std::cmp::Ordering; use std::borrow::Cow; use std::hash::{ Hash, Hasher }; use endian_codec::{PackedSize, EncodeBE}; use crate::*; use crate::Tag; use ...
Rust
0
"Male" => 4.0, 73.47, 2.; "Mamoudzou" => -12.8, 45.23, 420.; "Managua" => 12.1, -86.33, 50.; "Manama" => 26.17, 50.5, 2.; "Manila" => 14.67, 121.05, 21.; "Maputo" => -25.97, 32.53, 44.; "Maseru" => -29.3, 27.5, 1628.; "Masqat" => 23.62, 58.6, 8.; ...
Rust
0
M", "CMR", "CAN", "CYM", "CAF", "TCD", "CHL", "CHN", "CXR", "CCK", "COL", "COM", "COG", "COD", "COK", "CRI", "CIV", "HRV", "CUB", "CUW", "CYP", "CZE", "DNK", "DJI", "DMA", "DOM", "ECU", "EGY", "SLV", "GNQ", "ERI", "EST", "SWZ", "ETH", "FLK", "FRO", "FJI", "FIN", "FRA", "GUF", "PYF", "ATF", "GAB", "GMB",...
Rust
0
(code) mock_control.assert_called_once_with("Arm", code) @pytest.mark.asyncio async def test_async_alarm_arm_home(self, alarm_entity: InceptionAlarm) -> None: """Test async_alarm_arm_home method.""" code = "1234" with patch.object(alarm_entity, "_alarm_control") as mock_con...
Python
1
from apps.lfi.detection import detect def test_detect_empty(): assert detect('http://example') == []
Python
1
>= 16 { // 从指针中读取128位整数,组成一个128位的向量(可以转化为int8x16、int32x4等形式的向量) let invec = _mm_loadu_si128(src.as_ptr() as *const _); // 将该128位向量类型转化为int8x16类型的向量,并将其中每个元素和二进制数00001111进行与操作 let masked1 = _mm_and_si128(invec, and4bits); // 将该128位向量类型转化为int8x16类型的向量,再将每个元素逻辑右移4位,随后将其中每个...
Rust
0
always in a root company Ensure that accounts and account groups from a same company tree match """ branch_company = self.env['res.company'].create({ 'name': 'Branch Company', 'parent_id': self.env.company.id, }) parent_group = self.env['account.gro...
Python
1
( body_model_cfg, dtype=dtype) if self.predict_face: # The number of expression coefficients num_expression_coeffs = self.model.num_expression_coeffs self._num_expression_coeffs = num_expression_coeffs expression_mean = torch.zeros([num_expression_coef...
Python
1
prev_seq_id: None, asks: Vec::new(), bids: Vec::new(), snapshot, json: msg.to_string(), }; let raw_orders = if snapshot { // snapshot serde_json::from_value::<Vec<[f64; 3]>>(data).unwrap() } else { // update let raw_order = serde_json:...
Rust
0
from .bleu.bleu import Bleu from .cider.cider import Cider from .meteor.meteor import Meteor from .rouge.rouge import Rouge from .spice.spice import Spice from .wmd.wmd import WMD def eval(gts,res): scorer = Bleu(n=4) s1, _ = scorer.compute_score(gts, res) scorer = Cider() s2, _ = scorer.compute_s...
Python
1
DEPTH_STENCIL_LAYOUTS, 1, "VK_KHR_separate_depth_stencil_layouts"]; vk_ext![KHR_UNIFORM_BUFFER_STANDARD_LAYOUT, 1, "VK_KHR_uniform_buffer_standard_layout"]; vk_ext![KHR_BUFFER_DEVICE_ADDRESS, 1, "VK_KHR_buffer_device_address"]; vk_ext![KHR_DEFERRED_HOST_OPERATION...
Rust
0
ut vm = Vec::with_capacity(x.len() * n); for v in x.iter() { for i in 0..n { vm.push(v.powi(i as i32)); } } vm } /// Given a vector of length n, creates n stacked duplicates, resulting in a square [Toeplitz /// matrix](https://en.wikipedia.org/wiki/Toeplitz_matrix). This funct...
Rust
0
activation, this, base_proto, &args, ExecutionReason::Special, self.callback, ) } else { Ok(Value::Undefined) } } } #[derive(Debug, Copy, Clone, Collect)] #[collect(no_drop)] pub struct Scrip...
Rust
0
::mixer::open_audio(frequency, format, channels, chunk_size)?; let _mixer_context = sdl2::mixer::init( InitFlag::MP3 | InitFlag::FLAC | InitFlag::MOD | InitFlag::OGG, )?; sdl2::mixer::allocate_channels(4); println!("query spec => {:?}", sdl2::mixer::query_spec()); let sound_file_path = Path:...
Rust
0
) => l.color, Light::DirectionalLight(l) => l.color, Light::SpotLight(l) => l.color, } } pub fn set_color(&mut self, red: f32, green: f32, blue: f32, alpha: f32) { match self { Light::PointLight(light) => light.set_color([red, green, blue, alpha]), ...
Rust
0
= size_of::<$ty>() as u64 * RAND_BENCH_N; } }; } macro_rules! distr_duration { ($fnn:ident, $distr:expr) => { #[bench] fn $fnn(b: &mut Bencher) { let mut rng = Pcg64Mcg::from_entropy(); let distr = $distr; b.iter(|| { let mut accum =...
Rust
0
crate core; extern crate time; extern crate winit; extern crate tobj; use std::path::Path; use core::traits::Updateable; pub struct SceneManager { renderables: Vec<Box<tobj::Model>> } impl SceneManager { pub fn new() -> SceneManager { SceneManager { // ToDo: Setup the object and it's st...
Rust
0
_DESC { pub TypeName: ::windows_sys::core::PCSTR, pub Class: super::Direct3D::D3D_SHADER_VARIABLE_CLASS, pub Type: super::Direct3D::D3D_SHADER_VARIABLE_TYPE, pub Elements: u32, pub Members: u32, pub Rows: u32, pub Columns: u32, pub PackedSize: u32, pub UnpackedSize: u32, pub Stri...
Rust
0
ext(); let last = ca.into_iter().flatten().next_back(); match (first, last) { (Some(first), Some(last)) => { let first = match tu { TimeUnit::Milliseconds => offset.add_ms(first), TimeUnit::Nanoseconds => offset....
Rust
0
Event::Char('7') => Direction::NorthWest, Event::Char('8') => Direction::North, Event::Char('9') => Direction::NorthEast, // vi keys Event::Char('h') => Direction::West, Event::Char('j') => Direction::South, Event::Char('k') => Direction::North, ...
Rust
0
, siervos todos del Señor, *"), b: String::from("los que de noche están de pie en la casa del Señor.") }, PsalmVerse { number: 2, a: String::from("Eleven las manos hacia el santuario, y bendigan al Señor. *"), b: String::from("El Señor que hizo los cielos y la tierra, te bendiga desde ...
Rust
0
""" Revision ID: 0307_delete_dm_datetime Revises: 0306_letter_rates_price_rise Create Date: 2019-10-08 10:57:54.824807 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql revision = "0307_delete_dm_datetime" down_revision = "0306_letter_rates_price_rise" def upgrade(): ...
Python
1
_storage::dump::<_, Vec<u8>>(db2, FILE_METADATA) .unwrap() .iter() .map(|s| serde_json::from_slice(s.as_ref()).unwrap()) .collect(); assert_eq!(value1, value2); assert_eq!( account_repo::get_account(db1).unwrap(), account_repo::get_account(db2).unwrap() ); ...
Rust
0
vector::Vector, matrix::{ Matrix, transformation::*, }, }; #[test] fn multiplying_by_a_translation_matrix() { let t = translation(5.0, -3.0, 2.0); let p = Point::new(-3.0, 4.0, 5.0); assert_eq!(Point::new(2.0,1.0,7.0), t * p); } ...
Rust
0
.join(f'label {label} w. {n_samples} samples' for label, n_samples in label_samples)})." ) for split_name, train_data in few_shot_train_splits.items(): results_path = create_results_path(dataset, split_name, output_path) if os.path.exists(results_path) and not args.override_...
Python
1
e56ad934c3e1088115bcbf1af8b405fd0de94cdf301f9192cc 2781de00617e568b14b7235cc1189265811ea354031ea39b62e31a104f181c01d3dae 4b8 KE1: b61bfe5997b644e9654b7796203831ea9b9e86499c17db3331a40673832c9729 05603c1acb64ea417c0dabaab858a5f9da046d4a0cdbf092034c00451ccdc6e1ee835 5c91d5ed7aa5ea75b8a730ba8dc45f6b41ae9713e6aa7126211346e...
Rust
0
# Copyright 2024 Bytedance Ltd. and/or its affiliates # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law ...
Python
1
s sent by the client or browser as the origin of the request. It is set through an `Origin` header. * **Access-Control-Allow-Methods**: This specifies the allowed options for requests from that domain. This will generally be all available methods. * **Access-Control-Expose-Headers**: This will contain the headers t...
Python
1
# We compute the baseline baseline = [] for t in range(max_length): b = self.baseline_model(trajectories["frame"][:, t]) baseline.append(b.unsqueeze(1)) baseline = torch.cat(baseline, dim=1).squeeze(-1) # Now, we have a B x T tensor # We compute the baseline lo...
Python
1
from fastapi import APIRouter from pydantic import BaseModel router = APIRouter(prefix="/router1-router-teste") # class ContaPagarResponse(BaseModel) # pass @router.get("/") def router1_test(): return [ {"contas1": "contas123"}, {"contas1": "contas123"}, ]
Python
1
fn compile_grad(&self, target: T) -> Result<Self::CompiledJacobian, Self::Error> { let g = self.0.compile_grad(target)?; Ok(Double(self.0.clone()).mul(g)) } } impl<X: fmt::Display> fmt::Display for Square<X> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "({})^2", self....
Rust
0
_TOKEN. Occurs once a user auth token expires. InvalidAuthToken, /// Code 1002 - INVALID_PARTNER_LOGIN. auth.partnerLogin auth.userLogin. Can also occur for a /// user login. InvalidPartnerLogin, /// Code 1003 - LISTENER_NOT_AUTHORIZED. station.getPlaylist - Pandora One Subscription or /// Trial...
Rust
0
; } } fn scroll_region(&mut self, top: u64, bot: u64, left: u64, right: u64, rows: i64, cols: i64) { let y_iter: Box<dyn Iterator<Item = i64>> = if rows > 0 { Box::new((top as i64 + rows)..bot as i64) } else { Box::new((top as i64..(bot as i64 + rows)).rev()) ...
Rust
0
te_only() && desc.len() > 0 { let buf = desc_chain .memory() .get_slice(desc_addr, desc.len() as usize) .map_err(NetQueuePairError::GuestMemory)? .as_ptr(); let...
Rust
0
import requests import json # Test the root endpoint print("Testing root endpoint...") response = requests.get('http://127.0.0.1:8000/') print(f"Status: {response.status_code}") print(f"Response: {response.json()}") print() # Test GET /strategies (should be empty initially) print("Testing GET /strategies...") respons...
Python
1
indices = torch.full_like(A, -1, dtype=torch.long) # Indices of elements in B used for C # Step 1: Fix positions for exact matches for i in range(M): a = A[i].item() if a in B: pos_in_b = (B == a).nonzero(as_tuple=True)[0].item() C[i] = a indices[i] = po...
Python
1
[doc = "Reader of field `DRAM1_POWER`"] pub type DRAM1_POWER_R = crate::R<bool, DRAM1_POWER_A>; impl DRAM1_POWER_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> DRAM1_POWER_A { match self.bits { false => DRAM1_POWER_A::DRAM1_POWER_DISABLE, ...
Rust
0
onnection = try_mut_from_ptr!(conn); let guard = match userdata_push(conn.userdata, conn.log_callback) { Ok(g) => g, Err(_) => return rustls_result::Panic, }; let result = match conn.as_mut().process_new_packets() { Ok(()) => rustls_result::Ok, Err...
Rust
0
def print_times_table(): for i in range(1, 10): for j in range(1, 10): print(f"{i} * {j} = {i * j}") print_times_table()
Python
1
, e: &Ed) -> dot::LabelText { LabelText::html(format!( r#"<font face="{}" color="{}" point-size="{}"> {}</font>"#, self.font, self.edge_colour, self.edge_label_size, e.2 )) } // fn edge_style(&self, e: &Ed) -> dot::Style { // Style::Solid // } fn edge_colo...
Rust
0
# # You are painting a wall. The instructions on the paint can says that 1 can of paint can cover 5 square meters of wall. Given a random height and width of wall, calculate how many cans of paint you'll need to buy. # number of cans = (wall height x wall width) ÷ coverage per can. # e.g. Height = 2, Width = 4, Cover...
Python
1
except Exception as e: continue await self.send_daily_forwarded_count() with open(self.history, 'w+', encoding='utf-8') as f: self.checkbox['links'] = list(set(links))[-self.checkbox["today_count"]:] self.checkbox['sizes'] = list(set(sizes))[-self.checkbox["today...
Python
1
ensions?"); } //Print help message if no arguments were given if any_arg { let (output_path, output_ty, output_fmt) = output; Ok(Some(Options { inputs, merge_op, output_path, output_ty, output...
Rust
0
prelude::{html, Component, ComponentLink, Html, Properties, ShouldRender}, services::ConsoleService, Callback, }; use linked_data::mime_type::MimeTyped; use cid::Cid; type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>; pub struct Image { pub image_cid: Cid, pub ipfs: IpfsServic...
Rust
0
inuation { fn apply(self: Box<Self>, vlu: Exp) -> ERes { ERes::Stop(vlu) } } pub fn eval(ex: Expr, env: EnvRef) -> Exp { let evaluator = Rc::new(Evaluator::new()); evaluator.push_continuation(Box::new(HaltContinuation)); let mut result = Evaluator::eval(evaluator.clone(), ex, env); loo...
Rust
0
Point { x: fold.loc - (dot.x - fold.loc), y: dot.y, }); } } else if fold.axis == 'y' { let dots = points_clone.iter().filter(|p| p.y > fold.loc).copied().collect::<Vec<_>>(); points_clone = points_clone.into_iter().filter(|p| p.y < fold.loc).collec...
Rust
0
': 4, 'n': 3, 'o': 2, 'p': 3, 'q': 3, 'r': 2, 's': 2, 't': 2, 'u': 3, 'v': 2, 'w': 3, 'x': 2, 'y': 2, 'z': 2, 'A': 3, 'B': 3, 'C': 3, 'D': 3, 'E': 2, 'F': 2, 'G': 3, 'H': 3, 'I': 1, 'J': 1, 'K': 3, 'L': 2, 'M': 4, 'N': 3, 'O': 3, 'P': 3, 'Q': 3, 'R': 3, 'S': 2, 'T': 2, 'U': 3, 'V': 3, 'W': 4, 'X': 3, 'Y': 3, 'Z': 2, ' ...
Python
1
from odoo import models class StockPicking(models.Model): _inherit = "stock.picking" def send_to_shipper(self): self.ensure_one() if self.carrier_id: self.carrier_id._ensure_valid_shipping(self) return super().send_to_shipper()
Python
1
(offset, val) } fn w16(&mut self, offset: u32, val: u16) -> MemResult<()> { (**self).w16(offset, val) } } }; } impl_memfwd!(Box<dyn Memory>); impl_memfwd!(&mut dyn Memory); impl<T> Memory for Option<T> where T: Memory, { fn r32(&mut self, offset...
Rust
0
int(difflib.SequenceMatcher(a=hashes1, b=hashes3).ratio()) print(difflib.SequenceMatcher(a=hashes2, b=hashes3).ratio()) s2.show() h.hashPitch = False h.hashDuration = True h.hashOffset = True hashes1 = h.hashStream(s1) hashes2 = h.hashStream(s2) ...
Python
1
tokens} > limited_token_nums: {limited_token_nums}") new_docs.append(doc) verified_table_ids.append(table_doc_id) continue else: debug_logger.info(f"Incomplete table_doc: {table_doc_id}") new_docs.append(...
Python
1
import json import subprocess import tomllib import urllib.request with open("Cargo.toml", "rb") as f: cargo_toml = tomllib.load(f) crate_version = cargo_toml["package"]["version"] print("Detected crate version " + crate_version) index_url = "https://index.crates.io/x8/6_/x86_64" for line in urllib.request.urlope...
Python
1
// enable or reset $SPIX apb2.enr().modify(|_, w| w.$spiXen().set_bit()); apb2.rstr().modify(|_, w| w.$spiXrst().set_bit()); apb2.rstr().modify(|_, w| w.$spiXrst().clear_bit()); // FRXTH: RXNE event is generated if the F...
Rust
0
t(hfile, "", "Initialize the path") fprint(hfile, init_method + "(const std::string& description);") open_namespace(hfile, api_name) for item in data["apis"]: if "operations" in item: for oper in item["operations"]: fprint(hfile, 'static const path_holder ', getitem(oper,...
Python
1
#!/usr/bin/env python from pylib_essentials.schism_file import read_schism_hgrid_cached import geopandas as gpd import numpy as np from copy import deepcopy from shapely.geometry import Point gd1 = read_schism_hgrid_cached('Original/hgrid.ll.dem_loaded.gr3') gd2 = read_schism_hgrid_cached('BlueTopo/hgrid.ll.dem_loade...
Python
1
__author__ = 'mangate' import cPickle from model import Model import process_data_mr import process_data_tweets import process_data_sst1 import process_data_sst2 import process_data_subj import process_data_trec import process_data_politeness2 import process_data_opi import process_data_irony import tensorflow as tf ...
Python
1
fn default() -> Self { OutputMode::Stereo } } /// Stereo to mono blend level #[derive(Debug, Clone, Copy, PartialEq)] pub enum StereoToMonoBlendLevel { /// 19–37 RSSI dBμV (–12 dB) Dbuv19_37, /// 25–43 RSSI dBμV (–6 dB). Dbuv25_43, /// 31–49 RSSI dBμV (default) Dbuv31_49, /// 3...
Rust
0
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://w...
Python
1
Output { let source = (data.0).0.as_ref(); if source.as_luma8().is_some() { let result = match source.as_luma8() { None => imageproc::noise::gaussian_noise(&source.to_luma(), data.1, data.2, data.3), Some(x) => imageproc::noise::gaussian_noise(x, data.1, data....
Rust
0
sequence of tokens (strings for sub-words) in a single string.""" out_string = "".join(tokens).replace(SPIECE_UNDERLINE, " ").strip() return out_string def save_vocabulary(self, save_directory): """ Save the sentencepiece vocabulary (copy original file) and special tokens file ...
Python
1
![0; 8]; let bytes = XSalsa20::xsalsa20_20_256(k0, k1, v, m); let mut r = [0; 8]; for i in 0..8 { r[i] = bytes[i]; } le_u64(r) } // XSalsa20/20 256-bit pub fn xsalsa20_20_256(mut k0: [u8; 16], mut k1: [u8; 16], v: [u8; 24], m: Vec<u8>) -> Vec<u8> { ...
Rust
0
import pandas as pd import numpy as np from scipy import stats import matplotlib.pyplot as plt import seaborn as sns # Step 1: 读取基因距离数据 file_path = 'distance.nm.min.csv' # 替换为你的文件路径 data = pd.read_csv(file_path) # Step 2: 读取 Superpopulation 信息文件 superpop_file = 'distance.sub.nm.min.samples' # 替换为你的文件路径 superpop_dat...
Python
1
# 3. Basic Operations # Arithmetic operations # There are different types of arithmatic operations: # # +, -, /, //, *, **, % # num1 = 5 # num2 = 2 # print("num1 + num2 : ", num1 + num2) # print("num1 - num2 : ", num1 - num2) # print("num1 / num2 : ", num1 / num2) # print("num1 // num2 : ", num1 // num2) # p...
Python
1
SentinelRules and BucketLeapArray is used for monitor // BucketLeapArray is per resource, and SlidingWindowMetric support only read operation. #[derive(Debug)] pub struct SlidingWindowMetric { bucket_len_ms: u32, sample_count: u32, interval_ms: u32, inner: Arc<BucketLeapArray>, } // all the methods ar...
Rust
0
import openai from sqlalchemy import create_engine import pandas as pd from datetime import datetime, timedelta # Initialize OpenAI API and database connection openai.api_key = "YOUR_API_KEY" engine = create_engine('postgresql+psycopg2://user:password@host/dbname') # Define stock data fetching function def fetch_sto...
Python
1
t) of t_periph_info := ("); counter = 1 for device, has_more in lookahead(data): if device["type"] != "block": continue; dev_id = device["name"].upper(); dev_id = re.sub(r'-', '_', dev_id); dev_id = dev_id.ljust(16)[:16]; if counter > 1: print(" ...
Python
1
import os import subprocess import sys import json import requests def get_system_arch(): arch = subprocess.check_output(['uname', '-m']).decode().strip() return arch.replace('aarch64', 'arm64').replace('x86_64', 'amd64') def network_test(parm1, proxy_num=9): proxy_arr = [] check_url = "" if parm1...
Python
1
# DExTer : Debugging Experience Tester # ~~~~~~ ~ ~~ ~ ~~ # # Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. # See https://llvm.org/LICENSE.txt for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception """Abstract Base class for controlling deb...
Python
1
from detrex.config import get_config from ..models.dino_swin_large_384 import model # get default config dataloader = get_config("common/data/coco_detr.py").dataloader optimizer = get_config("common/optim.py").AdamW lr_multiplier = get_config("common/coco_schedule.py").lr_multiplier_36ep train = get_config("common/tra...
Python
1
< 2 || len > raw.len() { return Err(MessageParseError::Malformed); } let (mut payload, rest) = raw.split_at(len); payload = &payload[2..]; let mut fds = fds; let arguments = signature .iter() .map(|argtype| { if let ArgumentT...
Rust
0
# -*- coding: utf-8 -*- """ Created on Sat May 4 11:19:00 2024 @author: JBN """ import pygame import time import random # Initialize pygame pygame.init() pygame.font.init() WIDTH, HEIGHT = 1000, 400 WIN = pygame.display.set_mode((WIDTH, HEIGHT)) FONT = pygame.font.SysFont("comicsans", 30) pygame.display.set_caption...
Python
1
"replication")] if let Some(storage) = self.replication_storage().await.as_mut() { storage.map_primary(|storage| storage.push(event.into_owned())); } Ok(()) } } #[cfg(test)] mod tests { use crate::node::{ replication::{ primary::storage::PrimaryStorage,...
Rust
0
Python 3.12.3 (tags/v3.12.3:f6650f9, Apr 9 2024, 14:05:25) [MSC v.1938 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license()" for more information. print("hello everyone") hello everyone num =7 print(num) 7 type(num) <class 'int'> num=3.5 type(num) <class 'float'> >>> num =a Traceback (most recent...
Python
1
plication domain,so that a QueryInterface is performed on each call. Get: SandboxInterop(self: AppDomainSetup) -> bool Set: SandboxInterop(self: AppDomainSetup)=value """ ShadowCopyDirectories=property(lambda self: object(),lambda self,v: None,lambda self: None) """Gets or sets the names of the directories co...
Python
1
__version__ = "1.0" from meshroom.core import desc from meshroom.core.utils import VERBOSE_LEVEL class SfMFilter(desc.CommandLineNode): commandLine = "aliceVision_sfmFilter {allParams}" size = desc.DynamicNodeSize("inputFile") category = "Utils" documentation = """This node allows select views from S...
Python
1
= 1; z += 1; // Since x is now smaller, it gains one hydrogen and y gains two. g.atoms_mut()[z] = 1; *g.bonds_mut().get_mut(x, z) = 1; *g.bonds_mut().get_mut(z, x) = 1; z += 1; g.atoms_mut()[z] = 1; *g.bonds_mut().get_mut(y, z) = 1; *g.bonds_mut...
Rust
0
nclick(Some(closure.as_ref().unchecked_ref())); closure.forget(); }}; ($element_1_id: expr, $function_ident: ident, $arg_1: expr, $arg_2: expr, $arg_3: expr) => {{ let closure = Closure::wrap(Box::new(move || { $function_ident($arg_1, $arg_2, $arg_3); }) as Box<dyn FnMut()>);...
Rust
0
value = container_registry)): with patch("cura.Settings.ExtruderManager.ExtruderManager.getInstance", MagicMock(return_value = extruder_manager)): intents = intent_manager.getCurrentAvailableIntents() for intent, quality in intents: intent_...
Python
1
a_model.state_dict(), meta_path) # Save model weights if using boosting if self.config['ensemble_method'] == 'boosting': weights_path = f"{path}_weights.pt" torch.save(self.model_weights, weights_path) # Save configuration config_path = f"{path}_...
Python
1
help = "Number of tipsets requested over chain exchange (default is 200)" )] pub req_window: Option<i64>, #[structopt( long, help = "Number of tipsets to include in the sample that determines what the network head is" )] pub tipset_sample_size: Option<u8>, #[structopt( lo...
Rust
0
} } impl R { #[doc = "Bit 0 - Force on all NVM supplies. Also see the internal section in the NVMC chapter."] #[inline(always)] pub fn forceonnvm(&self) -> FORCEONNVM_R { FORCEONNVM_R::new((self.bits & 0x01) != 0) } } impl W { #[doc = "Bit 0 - Force on all NVM supplies. Also see the int...
Rust
0
# Python script to search the udev file system for devices # Copyright (C) 2005 Tim Blechmann # # 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 op...
Python
1
f_deposit: Box::new(|address, ticker, amount| { let adapter = super::BalancesAdapter::<T>::new(); adapter.deposit(address, ticker, amount) }), f_withdraw: Box::new(|address, ticker, amount| { let adapter = super::BalancesAdapter...
Rust
0
from zipfile import ZipFile, ZIP_DEFLATED from pathlib import Path, PureWindowsPath, PurePath self_path = Path(__file__).resolve() dir_path = self_path.parent zip_path = dir_path / "Constellations.zip" ignore = [ "screenshots/", ".git/", "*.psd", "*.disabled", self_path.name, zip_path.name, ...
Python
1
fe fn on_scan_req_report( _ble_evt: *const raw::ble_evt_t, _gap_evt: &raw::ble_gap_evt_t, ) { } pub(crate) unsafe fn on_sec_info_request( _ble_evt: *const raw::ble_evt_t, _gap_evt: &raw::ble_gap_evt_t, ) { } pub enum ConnectableAdvertisement<'a> { ScannableUndirected { adv_data: &'a [u8], ...
Rust
0
obParser; use pegasus_server::JobRequest; use runtime::graph::element::{Edge, Vertex, VertexOrEdge}; use runtime::graph::property::{DefaultDetails, DynDetails}; use runtime::graph::ID; use runtime::process::record::{Entry, Record, RecordElement}; use runtime::IRJobCompiler; static INIT: Onc...
Rust
0
4] yy = yy.cuda() pred = get_eval_pred(model=model, x=xx, strategy=args.strategy, T=T, times=[]).view(len(xx), *(S, ) * d, T, num_channels) pred = torch.nn.functional.interpolate(pred.permute(time_permute_inds), size=time_int_size, mode="trilinear").permute(time_unpermute_inds) ...
Python
1
to the same (new) location, with no gaps in the resulting sequence. /// Resulting remap table maps old vertices to new vertices and can be used in [remap_vertex_buffer]/[remap_index_buffer]. /// /// To remap vertex buffers, you will need to call [remap_vertex_buffer] for each vertex stream. /// /// Note that binary equ...
Rust
0
r in range(3) for c in range(3)) def new_game(): global player player = "X" label.config(text="X's turn") for row in range(3): for col in range(3): buttons[row][col].config(text="", bg="#F0F0F0") window = Tk() window.title("Tic-Tac-Toe Unbeatable ") player = "X" buttons = [[0,0,0],...
Python
1
gt.loadRes(str(json_result_file)) if coco_results else COCO() # coco_dt = coco_gt.loadRes(coco_results) coco_eval = COCOeval(coco_gt, coco_dt, iou_type) # 2019.04.29 add for print per class mAP if catId: coco_eval.params.catIds = [catId] coco_eval.evaluate() coco_eval.accumulate() ...
Python
1
:ErrorBackend, -3 => InitError::ErrorInternal, value => InitError::__Unknown(value), } } } impl ErrorDomain for InitError { fn domain() -> Quark { unsafe { from_glib(ffi::clutter_init_error_quark()) } } fn code(self) -> i32 { self.to_glib() } fn...
Rust
0