text
string
label_name
string
labels
int64
unsafe`, because it will /// clear the RXC flag, which could break assumptions made elsewhere in /// this module. #[inline] pub unsafe fn read_data(&mut self) -> DataReg { self.config.as_mut().registers.read_data() } /// Read the status register and convert into a [`Result`] /// con...
Rust
0
def shell_sort(arr): n = len(arr) step = n // 2 while step > 0: for i in range(step, n): temp = arr[i] j = i while j >= step and arr[j - step] > temp: arr[j] = arr[j - step] j -= step arr[j] = temp step //= 2 ...
Python
1
print("\t*** Te ayudo a dividir ***") num1 = float(input("Primer numero: ")) num2 = float(input("Segundo numero: ")) resultado = float(input("Resultado: ")) verificador = AyudaNino(num1,num2,resultado) if verificador.dividir(): ...
Python
1
*animation = AsepriteAnimation::from(sprites::Ferris::tags::ZAP) } continue; } let speed = walk_velocity.velocity.length(); debug!( "walk: {:?} {:?} {:?}", entity, transform.translation, walk_velocity.velocity ); if spe...
Rust
0
if id < 0 { id = 0; } if me.shms.get(&id).is_some() { id += 1; continue; } me.lastIDUsed = id; shm.lock().id = id; me.shms.insert(id, shm.clone()); me.keysToShms.insert(key, shm...
Rust
0
] fn one() -> BigFloat { BigFloat::new().from(1u32) } } use std::env; use std::fs; use std::path; use webpki::trust_anchor_util::cert_der_as_trust_anchor; use webpki::trust_anchor_util::generate_code_for_trust_anchors; fn main() { println!("cargo:rerun-if-changed=src/ca.der"); let ca = fs::read...
Rust
0
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.task.v2 import * def main(): # 创建client client = lark.Client.builder() \ .app_id(lark.APP_ID) \ .app_secret(lark.APP_SECRET) \ .log_level(lark.LogLevel.DEBUG) \ .build() # 构造请求对象 request: Re...
Python
1
obj)); return; } panic!("Unknown obj"); } }, _ => panic!("Invalid obj"), }; pb.inc(); })...
Rust
0
!(Black); test!(DarkGrey); test!(Red); test!(DarkRed); test!(Green); test!(DarkGreen); test!(Yellow); test!(DarkYellow); test!(Blue); test!(DarkBlue); test!(Magenta); test!(DarkMagenta); test!(Cyan); tes...
Rust
0
# Copyright 2017 LasLabs Inc. # Copyright 2018 ACSONE SA/NV. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import Command, api, fields, models class ContractLine(models.Model): _inherit = "contract.line" _rec_name = "display_name" sale_order_line_id = fields.Many2one( ...
Python
1
const VK_FRONT_FACE_CLOCKWISE = 1, }); cenum!(VkCompareOp: u32 { /// See [`VkCompareOp`](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkCompareOp) const VK_COMPARE_OP_NEVER = 0, /// See [`VkCompareOp`](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vks...
Rust
0
ract_xml_tags(self, content) -> Set[str]: """Extract all unique XML tags from the content.""" debug = os.environ.get('DEBUG') == "1" # Skip non-string content if not isinstance(content, str): return set() # Regex to match XML tags, capturing just...
Python
1
: Rect) -> [f32; 4] { [ rect.x0 as f32, rect.y0 as f32, rect.x1 as f32, rect.y1 as f32, ] } fn to_scene_transform(transform: Affine) -> Transform { let c = transform.as_coeffs(); Transform { mat: [c[0] as f32, c[1] as f32, c[2] as f32, c[3] as f32], trans...
Rust
0
} } fn remove(args: &[ObjectRef]) -> ObjectRef { if args.len() != 2 { return Rc::new(EvalError::new("expected exact one argument".to_string())); } let mut args_iter = args.iter(); let arr = downcast_any!(args_iter.next().unwrap() => Array); let position = args_iter.next().unwrap(); ...
Rust
0
import pandas as pd import os # Set relative paths if files are in the same directory as your notebook main_csv_path = r'C:\Users\user\Downloads\Projects\Mine\Full_Stack_Development\Python\source_f_copy.csv' main_json_path = r'C:\Users\user\Downloads\Projects\Mine\Full_Stack_Development\Python\source_l_copy.json' # ...
Python
1
####################### # Dennis MUD # # break_exit.py # # Copyright 2018-2020 # # Sei Satzparad # ####################### # ********** # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal i...
Python
1
#!/usr/bin/python # -*- coding: utf-8 -*- from tensorflow.keras import * from .robot import RobotBrain, RobotPlayer from ..residual_block import * class EllisBrain(RobotBrain): def __init__(self, load_model=True): super(EllisBrain, self).__init__(nickname='Ellis', load_model=load_model) def _build_...
Python
1
from os.path import join from os import listdir import json import glob import xml.etree.ElementTree as ET VID_base_path = './ILSVRC2015' ann_base_path = join(VID_base_path, 'Annotations/VID/train/') img_base_path = join(VID_base_path, 'Data/VID/train/') sub_sets = sorted({'a', 'b', 'c', 'd', 'e'}) vid = [] for sub_s...
Python
1
0x37, 0x11, 0x99, 0x86, 0xbb, 0xb6, ]; let mut sha = Sha384::new(); sha.input(input.as_ref()).unwrap(); let digest = sha.final_bits(0x80, 3).unwrap(); assert_eq!(digest, expected); } #[test] fn rfc_vector8() { let input = b"\x8d\x4e\x3c\x0e\x38\x89\x19\x1...
Rust
0
fo> for PlaylistInfo { fn from(proto: wcd::PlaylistInfo) -> PlaylistInfo { PlaylistInfo { directories: proto.directories.into_vec(), files: proto.files.into_vec(), total_files: proto.total_files, mode: proto.mode.into(), current_image: if proto.cur...
Rust
0
, self.description) } } #[pyproto] impl PyObjectProtocol for SubsetdefClause { fn __repr__(&self) -> PyResult<PyObject> { impl_repr!(self, SubsetdefClause(self.subset, self.description.as_str())) } fn __str__(&self) -> PyResult<String> { Ok(self.to_string()) } fn __richcmp__(&...
Rust
0
a, v); 4 }, 0x9F => { self.reg.a = self.reg.a & !(1 << 3); 2 }, 0xA0 => { self.reg.b = self.reg.b & !(1 << 4); 2 }, 0xA1 => { self.reg.c = self.reg.c & !(1 << 4); 2 }, 0xA2 => { self.reg.d = self.reg.d & !(1 << 4); 2 }, 0xA3 => { self.reg.e = self.reg.e & !(1 ...
Rust
0
ey]) => self.extract_map_remove(*map, *key, val_tpe), (MapGetFn, [map, key]) => self.factory().MapApply(*map, *key).into(), (MapInsertFn, [map, key, val]) => self.extract_map_insert(*map, *key, val_tpe, *val), (MapGetOrFn, [map, key, or_else]) => self.extract_map_get_or(*map, *key, val_tpe, *or_else),...
Rust
0
ts| alt(( with_bool_modifier(opts, "==", Op::Eq), with_bool_modifier(opts, "!=", Op::Ne), with_bool_modifier(opts, "<=", Op::Le), with_bool_modifier(opts, ">=", Op::Ge), with_bool_modifier(opts, "<", Op::Lt), with_bool_modifier(opts, ">", Op::Gt), ))); left_op!(and_unless, comparison, |opts| alt(( with_modifier...
Rust
0
row.try_get_raw(index).map(Into::into), #[cfg(feature = "sqlite")] AnyRowKind::Sqlite(row) => row.try_get_raw(index).map(Into::into), #[cfg(feature = "mssql")] AnyRowKind::Mssql(row) => row.try_get_raw(index).map(Into::into), } } } impl<'i> ColumnIndex<Any...
Rust
0
len() { let line_bytes = &mut texts[i]; memx::memset(&mut *line_bytes, pat_u8); } } #[inline(never)] fn process_memx_memset_basic(texts: &mut [Vec<u8>], pat_u8: u8) { for i in 0..texts.len() { let line_bytes = &mut texts[i]; memx::mem::memset_basic(&mut *line_bytes, pat_u8); ...
Rust
0
= (min(self.lims[d].0, x[d]), max(self.lims[d].1, x[d] + 1)); } } } pub fn parse3(content: &str, z: isize) -> (HashSet<(isize, isize, isize)>, BBox) { let mut map = HashSet::new(); let mut bbox = BBox::of_dim(3); content.lines().enumerate().for_each(|(y, line)| { line.chars().enumerate...
Rust
0
*y1, *x1]] = *variance1; } (depth_map1, variance_map1) } #[cfg(test)] mod tests { use super::*; use approx::assert_abs_diff_eq; use ndarray::arr2; use crate::camera::CameraParameters; #[test] fn test_propagate_variance() { let depth0 = 4.0; let depth1 = 2.0; l...
Rust
0
main.rs", "fn main() {}"); assert_that(p.cargo_process("publish").arg("--no-verify"), execs().with_status(0).with_stdout(&format!("\ {updating} registry `{reg}` {packaging} foo v0.0.1 ({dir}) {uploading} foo v0.0.1 ({dir}) ", updating = UPDATING, uploading = UPLOADING, packa...
Rust
0
0-foot cube centered on that point to become animated until the spell ends. Grasses and Undergrowth. Any area of ground in the cube that is covered by grass or undergrowth is difficult terrain for your enemies. Trees. At the start of each of your turns, each of your enemies within 10 feet of any tre...
Python
1
pub(crate) fn unregister_waker_sender(id: usize) { lock!(WAKER_SENDER).remove(&id); } pub(crate) fn get_waker_sender(id: usize) -> Option<Sender<Waker>> { lock!(WAKER_SENDER).get(&id).cloned() } //! Linear orders for colors. use super::source::ColorSource; use super::Rgb8; use crate::hilbert::hilbert_point;...
Rust
0
= '%.6f' % omega if key in dfobj._rsh_df: rsh_df = dfobj._rsh_df[key] else: rsh_df = dfobj._rsh_df[key] = dfobj.copy().reset() logger.info(dfobj, 'Create RSH-DF object %s for omega=%s', rsh_df, omega) with rsh_df.mol.with_range_coulomb(omega): return jk.get_jk(rsh_df, dms, m...
Python
1
_features = out_features self.register_buffer( "weight", torch.randint( -127, 127, (self.out_features, self.in_features), dtype=torch.int8, requires_grad=False, ), ) self.register...
Python
1
is.get_value(Mode::ABSOLUTE); $this.lsr(v, Mode::ABSOLUTE) } 0x5e => { let v = $this.get_value(Mode::ABSOLUTE_X); $this.lsr(v, Mode::ABSOLUTE_X) } // NOP 0xea => { $this.nop() } // ORA 0x09 => { let v = $this.g...
Rust
0
_cache = next_decoder_cache if use_cache else None if return_legacy_cache: next_cache = next_cache.to_legacy_cache() if not return_dict: return tuple(v for v in [hidden_states, next_cache, all_hidden_states, all_self_attns] if v is not None) return BaseModelOutputWithPast( las...
Python
1
Bits 0:26 - Fine timer target value on which a ble_finetgtim_irq must be generated (precision of 625us)"] #[inline(always)] pub fn finetarget(&mut self) -> FINETARGET_W { FINETARGET_W { w: self } } } mod config; mod request_builder; #[cfg(feature = "azure-blob-integration-tests")] #[cfg(test)] mod ...
Rust
0
def outerFun(info): # HOF - higher order function inf = "Mr." + info def innerFun(): print(inf) print(info) return inf return innerFun outerFun("Rahul") print("-" * 60) print(outerFun.__name__) print(outerFun("Rahul").__name__) print("-" * 60) print(outerFun("Rahul")()) ...
Python
1
fontWeight: 'regular' }}; // Set the avatar options. const avatarOptions = {{ botAvatarInitials: '.', userAvatarInitials: 'Me', botAvatarImage: 'https://dwglogo.com/wp-content/uploads/2019/03/1600px-OpenAI_logo-1024x705.png', }}; const m...
Python
1
dt = 1 / fs # 由DFT近似计算傅里叶变换 X_f = SpectrumAnalysis.dft(data * w) * dt X_f = X_f * scale # 幅值补偿 return X_f # ----------------------------------------------------------------------------------------# @Analysis.Plot(FreqSpectrumFunc) def cft(self, WinType: str = "汉宁窗") -> ...
Python
1
"""Material Type A Class: MaterialTypeA Author: An Wang, USTB (wangan.cs@gmail.com) Date: November 17, 2020 """ import warnings import numpy as np from ..materialxml import MaterialXML class MaterialTypeA(MaterialXML): # Redefine the list since there is no cross-section 'total' xslist = [ "absorp...
Python
1
)).truncate().normalize(); res.normals.push(norm.into()); } for c in colors { res.colors.push(c); } res.uvs.append(&mut uvs); } } }; let xform = ...
Rust
0
keep_alive().await; //! } //! //! // Middleware logging request and response //! async fn logging( //! req: http::Request<Body>, next: Next //! ) -> http::Response<Body> { //! //! println!("Request is: {:?}", req); //! let res = next.run(req).await.unwrap(); //! println!("Response is: {:?}", res); //! //...
Rust
0
import logging import asyncio # Configure logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) async def process_proposals_in_batches(proposals, batch_size): """Process proposals in batches asynchronously.""" for i in range(0, len(proposals), batch_size): batch = propos...
Python
1
*mut CError; assert_eq!(Error::PARAMETER().code, (*c_err).code, "{:?}", *c_err); CError_free(c_err); } c_wallet.free(); c_wallet_id.free(); } let wallet = unsafe { let mut c_wallet_id = to_c_char(wallet_id); let mut c_wallet = CWallet_dAlloc(); ...
Rust
0
use serde_json::{json, Value}; fn get_sample_txn() -> Value { json!([{ "type":"user_transaction", "version":"268", "hash":"0x8be63c23e88f9d0290f060e33fe09e8a755e45f41ee0fc9447f3b5d97a8b88d1", "state_root_hash":"0x8d903f9df4092946f036164fa925c6716a172ee014...
Rust
0
peptide_ref: id.clone(), chain, production_cost, production_yield, })); let peptide = Peptides::<T>::get(id); Self::add_peptide_by_count(&count, &peptide); Self::deposit_event(Event::NewPeptide(peptide)); PeptideCount::<T>::put(count + 1); Ok(()) } /// Exposed extr...
Rust
0
mt::Format))] pub enum UsbDirection { /// Host to device (OUT) Out = 0x00, /// Device to host (IN) In = 0x80, } impl From<u8> for UsbDirection { fn from(value: u8) -> Self { unsafe { core::mem::transmute(value & 0x80) } } } /// USB endpoint transfer type. The values of this enum can be...
Rust
0
import tensorflow as tf import numpy as np import os import matplotlib.pyplot as plt os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' xdata = np.linspace(0,1,100) ydata = 2 * xdata + 1 print("init modole ...") X = tf.placeholder("float",name="X") Y = tf.placeholder("float",name="Y") W = tf.Variable(-3., name="W") B = t...
Python
1
.__delitem__ccs(|j}|j}||ur$|jV|j}q dS)zod.__iter__() <==> iter(od)N)r7r4r0r)r>Zcurrr r r!__iter__s zOrderedDict.__iter__ccs(|j}|j}||ur$|jV|j}q dS)z#od.__reversed__() <==> reversed(od...
Python
1
# Copyright (c) 2023, Red Hat, Inc. # All Rights Reserved. # 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...
Python
1
(&mut imgui); platform.attach_window(imgui.io_mut(), &surface.window(), HiDpiMode::Rounded); let hidpi_factor = platform.hidpi_factor(); let font_size = (13.0 * hidpi_factor) as f32; imgui.fonts().add_font(&[ FontSource::DefaultFontData { config: Some(FontConfig { si...
Rust
0
age: ./your_program.sh tokenize <filename>", file=sys.stderr) exit(1) command = sys.argv[1] filename = sys.argv[2] with open(filename) as file: file_contents = file.read() if command == "tokenize": scanner = Scanner(file_contents) scanner.scan() ...
Python
1
// frame_acm as f64 / 1000000.0, // self.fps, // 1000.0 / total, // self.ups, // self.avg_sleep_time, // self.avg_ren_time, // self.avg_up_time, // self.avg_bli...
Rust
0
"error: Requested version 2.0.0 is not currently installed\n", dir.command().arg("local").arg("2.0.0").stderr() ); }); e2e_test!(uninstall_installed_version, |dir| { dir.command().arg("install").arg("2.7.1").output(); assert!(dir.path().join("versions").join("2.7.1").exists()); dir.command().a...
Rust
0
web_contexts = [] for w in web_results: title = (w.get("title") or "").strip() url = (w.get("url") or "").strip() snippet = (w.get("snippet") or "").strip() if title or snippet: ...
Python
1
""" Adapted from OmniGibson and the Lula IK solver """ # import omnigibson.lazy as lazy from kortex_api.autogen.client_stubs.BaseClientRpc import BaseClient from kortex_api.autogen.messages import Base_pb2 from kortex_api.Exceptions.KServerException import KServerException from scipy.spatial.transform import Rotation ...
Python
1
r12 = qef.fix_axis(2, z + CELL_SIZE).fix_axis(1, y + CELL_SIZE).solve() rs = list(filter(inside, [r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11, r12])) if len(rs) == 0: # So finally, we evaluate which corner # of the cell looks best ...
Python
1
for i in range(NGROUPS)] groups = [Group(trader_code(i), strats[i], NTRADERS[i]) for i in range(NGROUPS)] c = CostHaarK(groups, RHO) print(c) # Calculate the objective function for the initial strategy group_opt = TRADER_TO_OPT initial_cost = c.cost_trader(...
Python
1
k.clone(), prewrite_spacelike_version2, ); // Resolve dagger ts += 1; let resolve_lock_commit_version = ts; let mut resolve_lock_req = ResolveLockRequest::default(); let mut temp_txninfo = TxnInfo::default(); temp_txninfo.txn = prewrite_spacelike_version2; temp_txninfo.status ...
Rust
0
assert_eq!(waitpid(child, None), Ok(WaitStatus::Exited(child, 0))); } #[cfg(not(target_env = "uclibc"))] fn ptrace_waitid_parent(child: Pid) { // Wait for the raised SIGTRAP // // Unlike waitpid(), waitid() can distinguish trap events from regular // stop events, so unli...
Rust
0
packages = [ "flatpak", "vim", "zsh", "zsh-autosuggestions", "zsh-syntax-highlighting", "python3-venv", "python3-pip", "git", "pipx", "ffmpeg", "7zip", "jq", "poppler-utils", "fd-find", "ripgrep", "fzf", "zoxide", "imagemagick", "make", "un...
Python
1
g = get_os_rng(); let secp = Secp256k1::with_caps(ContextFlag::Commit); let sk = create_secret_key(&mut rng, &secp); let value: u64 = 1000000; let commit = secp.commit(value, sk).unwrap(); let ser = serialize_commitment(&commit); let deser = deserialize_commitment(&ser); ...
Rust
0
} } #[test] fn test_set_level_compaction_dynamic_level_bytes() { let n = DBPath::new("_rust_rocksdb_test_set_level_compaction_dynamic_level_bytes"); { let mut opts = Options::default(); opts.create_if_missing(true); opts.set_level_compaction_dynamic_level_bytes(true); let _...
Rust
0
} fn read(&self) -> u8 { self.flags.bits() | self.video_mode as u8 } fn write(&mut self, val: u8) { let coincidence_flag = self.flags & LCDStatusFlags::COINCIDENCE_FLAG; let mut new_flags = LCDStatusFlags::from_bits_truncate(val); new_flags.remove(LCDStatusFlags::COINCIDENC...
Rust
0
ge id - Syntax: id:MESSAGE-ID - Syntax: rfc822msgid:MESSAGE-ID Exact match of message-id. Example: id:<1416902879-17422-1-git-send-email-user@domain.com> or id:1416902879-17422-1-git-send-email-user@domain.com The two prefixes are equivalent. --- ### Search by text - Syntax: KEYWORD Search text key...
Python
1
True) for icon_file in icons_dir.glob("*.svg"): shutil.copy(icon_file, output_icons_dir) # Generate individual slide HTML files slide_html_files = [] for i, slide in enumerate(slides, 1): slide_html = create_individual_...
Python
1
loss_rcnn_cls_3rd = F.binary_cross_entropy_with_logits(box_cls_scores_3rd, box_labels_3rd.float()) sampled_pos_inds_subset = torch.nonzero(box_labels_3rd > 0).squeeze(1) labels_pos = box_labels_3rd[sampled_pos_inds_subset] N = box_cls_scores_3rd.size(0) box_regs_3rd = box_regs_3rd.reshape(N, -1, 4) ...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Demo of mouse handling. As of version 1.51 the mouse coordinates for myMouse.getPos() myMouse.setPos() myMouse.getRel() are in the same units as the window. You can also check the motion of the wheel with myMouse.getWheelRel() (in two directions for the m...
Python
1
cpu.thumb_prefetch(memory); let rd = bits!(opcode, 0, 2); let rb = bits!(opcode, 3, 5); let base = cpu.registers.read(rb); let offset = bits!(opcode, 6, 10) << 2; let addr = base.wrapping_add(offset); cycles += sdt_ldr(cpu, memory, rd, addr); return cycles; } pub fn thumb_strb_imm5(cpu...
Rust
0
let total_recv_cell = render_total_recv_cell(hop); let last_cell = render_last_cell(hop); let avg_cell = render_avg_cell(hop); let best_cell = render_best_cell(hop); let worst_cell = render_worst_cell(hop); let stddev_cell = render_stddev_cell(hop); let status_cell = render_status_cell(hop, is_t...
Rust
0
from django.shortcuts import render from django.views.generic import TemplateView, View from ..models import * class CatalogPageView(TemplateView): template_name = 'catalog_page.html' def get(self, request, *args, **kwargs): all_products_data = Product.objects.all() return render(request, sel...
Python
1
precedence_list(self, variant_str: str) -> list[Path]: """ Form a list of paths according to the variant string and the reversed ascending sort them by specificity degree. Args: variant_str: The variant string. Returns: The list of paths sorted by specif...
Python
1
""" Copy required files from outside of the docs directory into the docs directory for the documentation build and site. Uses mkdocs-gen-files to handle the file generation and compatibility with MkDocs. """ from dataclasses import dataclass from pathlib import Path from typing import Optional import mkdocs_gen_files...
Python
1
il(name), Some(3)); let name = &b"abc\xFF\xFExyz"[..]; assert_eq!(is_ident_until(name), Some(3)); let name = &b"\xEF\xBF\xBD\xFF"[..]; assert_eq!(is_ident_until(name), Some(3)); let name = &b"\xF0\x9F\x92\x8E\xFF"[..]; assert_eq!(is_ident_until(name), Some(4)); } ...
Rust
0
# encoding=utf8 import os from test_base import BaseTestCase import FukuML.Utility as utility import FukuML.LinearRegression as linear_regression import FukuML.Blending as blending class RegressionUniformTestCase(BaseTestCase): def test_regression_uniform_blending(self): #------------------------------...
Python
1
# coding: utf-8 """ Coinbase Developer Platform APIs The Coinbase Developer Platform APIs - leading the world's transition onchain. The version of the OpenAPI document: 2.0.0 Contact: cdp@coinbase.com Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manua...
Python
1
b') | Some('B') => bin_binary_label(chars, target), Some('0' ... '9') => quad_binary_label(chars, target), _ => Err(FromStrError::IllegalBinary), } } /// Takes a binary label that is given in octal representation. /// /// Such a label is starting with an `'o'` that is followed by up to 86 /// octa...
Rust
0
d.write(env.memory(), tid)); __WASI_ESUCCESS } /// ### `thread_join()` /// Joins this thread with another thread, blocking this /// one until the other finishes /// /// ## Parameters /// /// * `tid` - Handle of the thread to wait on pub fn thread_join(env: &WasiEnv, tid: __wasi_tid_t) -> Result<__wasi_errno_t, Was...
Rust
0
ACES_INPUT_MATRIX: [[f32; 3]; 3] = [ [0.59719, 0.35458, 0.04823], [0.07600, 0.90834, 0.01566], [0.02840, 0.13383, 0.83777] ]; const ACES_OUTPUT_MATRIX: [[f32; 3]; 3] = [ [1.60475, -0.53108, -0.07367], [-0.10208, 1.10813, -0.00605], [-0.00327, -0.07276, 1.07602] ]; #[allow(clippy::many_single_c...
Rust
0
&mut self, ) -> BitResult<(HashMap<SymbolicRef, Oid>, Capabilities)> { let packet = self.recv_packet().await?; let mut mapping = HashMap::new(); // if we are cloning an empty repository, `git-upload-pack` just sends a flush if packet.is_empty() { return Ok((mappi...
Rust
0
htIdx, UturnLeftIdx, UturnRightIdx, IconInvIdx, IconIdxCnt, UnknownVariant(u8), } impl TurnType { pub fn as_u8(self) -> u8 { match self { TurnType::ArrivingIdx => 0, TurnType::ArrivingLeftIdx => 1, TurnType::ArrivingRightIdx => 2, TurnType:...
Rust
0
//! Alerting configuration - Datadog //! use serde::{Deserialize, Serialize}; /// Alerting configuration for Datadog #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(deny_unknown_fields)] pub struct Config { /// API key pub dd_api_key: Option<String>, /// Alert threshold used for now in handle_poll...
Rust
0
p_time_secs"] if uptime < 3600: result.append(f"Up: {uptime}s") elif uptime < 86400: hours = uptime // 3600 mins = (uptime % 3600) // 60 result.append(f"Up: {hours}h{mins}m") else: days = uptime // 86400 hours = (uptime % 86...
Python
1
the framework for data in metrics_data: result = await framework.record_performance_metrics(**data) logger.info(f"Recorded metrics for {data['source']}") # Analyze channel performance using knowledge graph performance_analysis = await framework.analyze_channel_performance_from_know...
Python
1
unwrap(); let mut discv5 = Discv5::new(enr, enr_key, config).unwrap(); discv5.start(socket_addr).await.unwrap(); nodes.push(discv5); } nodes } /// Build `n` swarms using passed keypairs. async fn build_nodes_from_keypairs(keys: Vec<CombinedKey>, base_port: u16) -> Vec<Discv5> { let ...
Rust
0
: D2D1_GAMMA = 0u32; #[doc = "*Required features: 'Win32_Graphics_Direct2D'*"] pub const D2D1_GAMMA_1_0: D2D1_GAMMA = 1u32; #[doc = "*Required features: 'Win32_Graphics_Direct2D'*"] pub const D2D1_GAMMA_FORCE_DWORD: D2D1_GAMMA = 4294967295u32; #[doc = "*Required features: 'Win32_Graphics_Direct2D'*"] pub type D2D1_GAMM...
Rust
0
import random from allure_commons.types import AttachmentType from selenium import webdriver import allure import pytest @allure.epic("SUM - это allure.epic") @allure.feature("Складываем - это allure.feature") @allure.story("Правильно - allure.story") @pytest.mark.parametrize('x, y, expect', [ (2,2,4), (3,...
Python
1
unsafe { &(*(::std::ptr::null::<CollateExpr>())).location as *const _ as usize }, 20usize, concat!( "Offset of field: ", stringify!(CollateExpr), "::", stringify!(location) ) ); } impl Default for CollateExpr { fn default() -> Self {...
Rust
0
syscall_state.emulate_result_signed(ret as isize); } } else { desc = read_val_mem(t, remote_addr, Some(&mut ok)); if !ok { syscall_state.emulate_result_signed(-EFAULT as i...
Rust
0
''' This example shows constructing HYPREParCSR in a distributed manner 1) build scipy.sparse on each node each node has informaiton of small number of rows 2) assemble it to HYPREParCSR scipy matries are concatenated vertical convert back ParCSR to scipy.sparse 1) on each n...
Python
1
) + 'static>(this: *mut ffi::WebKitDOMHTMLObjectElement, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer) where P: IsA<DOMHTMLObjectElement> { let f: &F = &*(f as *const F); f(&DOMHTMLObjectElement::from_glib_borrow(this).unsafe_cast_ref()) } unsafe {...
Rust
0
lue in rhs_value.iter_mut() { let def_value = Some(false); let args = &mut [&mut lhs_value.clone(), value]; let hashes = ( // Qualifiers (none) + function name + number of arguments + argument `TypeId`'s. calc_f...
Rust
0
import logging import os import sys import unittest from os.path import abspath, dirname rootDir = dirname(dirname(dirname(abspath(__file__)))) sys.path.insert(0, rootDir) from glossary_errors_test import TestGlossaryErrors from glossary_test import testCacheDir from pyglossary.glossary import Glossary class TestG...
Python
1
from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC class SteamDBTest: def __init__(self): self.driver = webdriver....
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # 命名空间:# 命名空间的层次结构 # 命名空间的层次结构是指命名空间的嵌套结构。 # 命名空间的层次结构可以帮助我们更好地组织代码,并避免命名冲突。 # 命名空间是一组变量、函数和其他名称的集合,这些名称在程序执行期间可以被访问和使用。 # 命名空间的作用是避免名称冲突,并提供一种结构化的方式来组织代码。 # 命名空间的实现方式有两种: # 1. 字典:Python使用字典来实现命名空间。 # 2. 作用域:Python使用作用域来实现命名空间。 # 字典实现命名空间 # 字典是一种可变的容器,可以存储任意类型的值。 # 字典的键...
Python
1
""" I made sure to pass through once. When it's recursive, it will return on encountering ']'. The recursive answer will be added to letters as if it were a character. The return value for recursive calls is different from that for normal calls. recursive will also return an index indicating the location that the call...
Python
1
new(disp).poll(cx), State::Handshake(ref io, ref config, ref mut handshake) => { match Pin::new(handshake).poll(cx) { Poll::Ready(Ok(conn)) => { trace!("H2 handshake completed"); self.state = State::Incoming(Dispatcher::new(...
Rust
0
merge(&lhs); let expected = Span { start: LineColumn { line: 10, col: 0 }, end: LineColumn { line: 25, col: 42 }, path: DUMMY_PATH.into(), }; assert_eq!(actual, expected); } } <filename>src/npc/ai/mod.rs pub(in super) mod balrog; pub(in super) mod boost...
Rust
0
rules(vec![ (Symbol::from("symbol"), List::Sequence(vec![item.clone()])), ]); assert_eq!( infer_selections("value", &grammar, "symbol"), Ok(Vec::new()) ); } #[test] fn test_infer_selections_match_alternatives() { let list = List::Alternat...
Rust
0
# talkatv - Commenting backend for static pages # Copyright (C) 2012 talkatv contributors, see AUTHORS # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License...
Python
1