text
string
label_name
string
labels
int64
![(k0, v0), (k1, v1)]; mock_range_query(extents) }); ds1.expect_range() .once() .with(eq(FSKey::extattr_range(ino))) .returning(move |_| { mock_range_query(Vec::new()) }); ds1.expect_delete_blob() .once() .withf(move |rid: &RID| blo...
Rust
0
: HashMap<u64, (batch::BatchState, T), fnv::FnvBuildHasher>, } /// Event generated by [`next_event`](BatchesState::next_event). #[derive(Debug)] pub enum BatchesEvent<'a, T> { /// A notification has been extracted from a batch. Notification { /// Notification in question. notification: Notifica...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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 or...
Python
1
for child in &node.children { match child.get_display() { Display::Block => layout_node.children.push(build_layout_tree(child)), Display::Inline => layout_node.children.push(build_layout_tree(child)), Display::InlineBlock => layout_node.children.push(build_layout_tree(child...
Rust
0
.clone(), o!()); let mut opt_logger: Option<Logger> = Some(logger); try_crit!(opt_logger, "SUCCESS: crit"); try_crit!(opt_logger, #"tag", "SUCCESS: crit with tag"); opt_logger = None; try_crit!(opt_logger, "FAILED: crit"); try_crit!(opt_logger, #"tag", "FAILED: crit with ...
Rust
0
String>= None; let coin = Coin::Penny; let quarter_coin = Coin::Quarter(UsState::Alaska); let value = value_in_cents(&coin); let value_2 = value_in_cents(&coin); let quarter = value_in_cents(&quarter_coin); let five = Some(5); let six = plus_one(five); let none = plus_one(No...
Rust
0
" cls.tokenizer = get_tokenizer(DEFAULT_SMALL_MODEL_NAME_FOR_TEST) cls.return_hidden_states = [False, True] cls.use_list_input = [True, False] cls.parallel_sample_nums = [1] @classmethod def tearDownClass(cls): kill_process_tree(cls.process.pid) class TestOpenAIServerW...
Python
1
image_type.tiling()) .initial_layout(image_type.initial_layout()) .usage(image_type.usage()) .sharing_mode(vk::SharingMode::EXCLUSIVE) .samples(vk::SampleCountFlags::TYPE_1); let allocation_info = vk_mem::AllocationCreateInfo { usage: vk_mem::MemoryUsage::GpuOnly, fl...
Rust
0
# ======================================================================= # # Copyright (C) 2020 - 2025 Dominik Willner <th33xitus@gmail.com> # # # # This file is part of KIAUH - Klipper Installation And Update Helper # # https://githu...
Python
1
) } #[cfg(test)] mod tests { use super::*; fn testing(old: i32, new: i32, saving: i32, perc: f64, exp: (i32, i32)) { assert_eq!(nb_months(old, new, saving, perc), exp); } #[test] fn basics_nb_months() { testing(2000, 8000, 1000, 1.5, (6, 766)); testing(12000, 8000, 1000, 1...
Rust
0
, actualCE, exitcode = get_status(statusfile) if j.status == 'submitted': if pid or queue: j.updateStatus('running') if pid: j.backend.id = pid if queue and queue != j.backend.actualqueue: ...
Python
1
value if the server has a <code>CustomDomain</code> specified. /// </p> pub endpoint: std::option::Option<std::string::String>, /// <p>The engine type of the server. Valid values in this release include <code>ChefAutomate</code> and <code>Puppet</code>. /// </p> pub engine: std::option::Option<std::...
Rust
0
/// use ccapi::{CCAPI, NotifyIcon}; /// use std::net::Ipv4Addr; /// /// let ccapi = CCAPI::new(Ipv4Addr::LOCALHOST); /// /// ccapi.notify(NotifyIcon::NotifyInfo, "hello world"); /// ``` pub fn notify(&self, notify_icon: NotifyIcon, message: &str) -> Result<()> { let notify_code ...
Rust
0
": "<NAME>" }, { "id": 2, "name": "<NAME>" } ], "greeting": "Hello, Alberta Gutierrez! You have 10 unread messages.", "favoriteFruit": "apple" }, { "_id": "...
Rust
0
vm.env.get_external_data_status(eid, vid) }), "read_external_data" => func!(|ctx: &mut Ctx, eid: i64, vid: i64, ptr: i64| -> Result<i64, Error> { let vm: &mut vm::VMLogic<E> = unsafe { &mut *(ctx.data as *mut vm::VMLogic<E>) }; let span_size = vm.env.get_spa...
Rust
0
), ) .subcommand( SubCommand::with_name("rm") .about("Delete file from bucket") .arg(Arg::with_name("uri").help("s3 object uri")), ) .subcommand( SubCommand::with_name("info") .about("Print information about Buckets ...
Rust
0
import rclpy from rclpy.node import Node from std_msgs.msg import String """ 创建一个发布者节点 """ class PublisherNode(Node): def __init__(self, name): super().__init__(name) # ROS2节点父类初始化 s...
Python
1
class ConfigEmail : def __init__(self): self.config = {} # 存储配置的字典 self.load_config() # 加载配置 def load_config(self): # 加载配置 self.config = { "emails": [ ("AnthonyKingAK1960@outlook.com", "Anthony312912...
Python
1
); return Err("Window Registration Failed".into()); }; // Create a window based on registered class let handle = CreateWindowExW( 0, // dwExStyle name.as_ptr(), // lpClassName title.as...
Rust
0
import os from dataclasses import dataclass os.system("cls||clear") funcionarios = [] QUANTIDADE_FUNCIONARIOS = 5 @dataclass class funcionario: nome: str nascimento: str RG: int CPF: int def exibir_dados(self): print(f"Nome: {self.nome} \nAutor: {self.nascimento}\n RG: {self.RG}\n Preço:...
Python
1
.components["libspa"].defines = ["_REENTRANT"] self.cpp_info.components["libspa"].set_property("pkg_config_custom_content", f"plugindir=${{libdir}}/spa-{libspa_api_version}") if self.options.with_libalsa: self.cpp_info.components["libspa"].requires.append("libalsa::libalsa") if self....
Python
1
# Copyright 2022 The MIDI-DDSP Authors. # # # 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
import torch import matplotlib.pyplot as plt """ My implementation of a fractal, named Ikeda Map the Ikeda map is a discrete-time dynamical system given by the formula x1 = 1 + u * (x * cos(t) - y * sin(t)) y1 = u * (x * sin(t) + y * cos(t)) t = 0.4 - 6 / (1 + x ** 2 + y ** 2) For u ≥ 0.6, this system has...
Python
1
changed` was called. /// /// The `Ui` will automatically draw to its associated window within the given `Frame`. /// /// If you require more control over where the `Ui` is drawn within the `Frame`, the `draw` /// method offers more flexibility. /// /// This has no effect if the window origin...
Rust
0
ng(margins[3]); (margin_top, margin_right, margin_bottom, margin_left) } _ => (Margin::Fixed(0), Margin::Fixed(0), Margin::Fixed(0), Margin::Fixed(0)), } } // -> (direction, size, wrap, shown) fn parse_preview(preview_option: &str) -> (Direction, Margin, bool...
Rust
0
{-78.75, -73.125, 0.0, 11.25}}, {"69xq1n9v", Box{-35.4712486267, -35.4710769653, -57.2583389282, -57.2579956055}}, {"cjpu", Box{73.828125, 74.00390625, -124.1015625, -123.75}}, {"pmks2611hw", Box{-59.7104895115, -59.7104841471, 152.590677738, 152.590688467}}, {"zd78cuj300z8", Box{57.8102342784, 57.8102344461, 162.5...
Rust
0
rt_eq!(result, data); } #[test] fn test_nostd_get_set_bools_as_u8() { let mut ctx = CTX.write(); ctx.clear_coils(); let mut data_mem = alloc_stack!([bool; CONTEXT_SIZE]); let mut data = FixedVec::new(&mut data_mem); data.push_all(&[ true, true, true, fals...
Rust
0
= Hasher::<224>::hash(b"My Public Key"); /// # assert_eq!( /// # "c123c9bc0e9e31a20a4aa23518836ec5fb54bdc85735c56b38eb79a5", /// # hex::encode(digest) /// # ); /// ``` pub struct Hasher<const BITS: usize>(Blake2b); impl<const BITS: usize> Hasher<BITS> { /// update the [`Hasher`] with the given inputs #[inl...
Rust
0
from flask_wtf import FlaskForm from wtforms import StringField, SubmitField, SelectField, HiddenField, TextAreaField, BooleanField, PasswordField from wtforms.validators import DataRequired, Length, Email, Optional, Regexp class CheckoutForm(FlaskForm): # Billing Address Fields imie_rozliczeniowe = StringFiel...
Python
1
PosLookup::ChainContextPos(ref subtables) => { forall_glyphs_match(match_type, opt_gdef_table, infos, |i, infos| { chaincontextpos( gpos_cache, &lookup_list, opt_gdef_table, match_type...
Rust
0
dir.path().join(r"args\random\") } else { dir.path().join("args/random/") }; let output = util::deno_cmd() .current_dir(util::testdata_path()) .arg("compile") .arg("--unstable") .arg("--output") .arg(&output_path) .arg("./standalone_compiler_ops.ts") .stdout(std::process::Stdio...
Rust
0
: 'تانزانیا', 'blo': 'Taŋsanii', 'bm': 'Tanzani', 'bn': 'তাঞ্জানিয়া', 'br': 'Tanzania', 'brx': 'तान्जानिया', 'bs': 'Tanzanija', 'bs-Cyrl': 'Танзанија', 'bs-Latn': 'Tanzanija', 'ca': 'Tanzània', 'ca-ES-valencia': 'Tanzània', 'ccp': '𑄖𑄚𑄴𑄎𑄚𑄨𑄠', 'ce': 'Танзани', 'ceb': 'Tanzania', 'cgg': 'Tanzania', 'chr': 'ᏖᏂᏏᏂᏯ',...
Python
1
ile}...") results = read_json(result_file) # full pids full_pids = list(results.keys()) if args.number > 0: full_pids = full_pids[:min(args.number, len(full_pids))] print("Number of testing problems:", len(full_pids)) # test pids if args.rerun: test_pids = full_pids els...
Python
1
wo *structural* fields of the type. The widths and placements of each segment are functions of the size of `*const T` and `usize`, and of the alignment of the `T` referent buffer element type. # Fields This section describes the purpose, semantic meaning, and layout of the three logical fields. ## Base Address The ...
Rust
0
.len(), 2); let db = TemporaryDB::new(); let fork = db.fork(); fork.get_proof_entry::<_, u32>("test.entry").set(1); db.merge(fork.into_patch()).unwrap(); let snapshot = execute_scripts(db, start_version, scripts); let entry = snapshot.get_proof_entry::<_, u32>("test.ent...
Rust
0
xception as e: OpenaiErrorHandler().openai_error_handle(error=e, context=openai_context) openai_chat_manager.openai_chat.chat_messages_extend(messages_list=messages_list, context=openai_context) ResponseJob = self.manager.get_job("ResponseJob") callback = Callback( ...
Python
1
pub public_ips_list: Vec<types::PublicIP>, } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, Default, Debug)] pub struct NameContract { pub name: Vec<u8>, } #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Encode, Decode, Debug)] pub enum ContractData { NodeContract(NodeContract), NameContr...
Rust
0
let mut words = words?; // Iterate over every combination of two lines. // 'outer is a loop label so I can break directly out of the outer loop 'outer: for word1 in words.iter() { for word2 in words.iter() { // This block checks if are_close_enough returned a Some instead of a Non...
Rust
0
pub fn new( mass: Mass, vel: Velocity, ang_vel: AngularVelocity, ang_mass: AngularMass, resitution: Resitution, collider: Collider, ) -> Self { Self { vel, mass, ang_vel, ang_mass, resitution, ...
Rust
0
""" Classes from the 'WebUI' framework. """ try: from rubicon.objc import ObjCClass except ValueError: def ObjCClass(name): return None def _Class(name): try: return ObjCClass(name) except NameError: return None WBUFormAutoFillWhiteList = _Class("WBUFormAutoFillWhiteList") ...
Python
1
""" Testing Commands module initialization """ from .testing_cmds import * __all__ = [ 'read_loopback_mode', 'write_loopback_mode', 'ReadLoopbackMode', 'WriteLoopbackMode', ]
Python
1
import random def pilihan(difficulity): if(difficulity=='1'): return 10 if(difficulity=='2'): return 5 if(difficulity=='3'): return 3 else: return None def gamestebakangka(): print("""selamat datang digames tebak angka saya berikan nomor 1-100 coba tebak ...
Python
1
.offset(i); field_offsets.push(offset); if let Variants::Single { index } = ty.variants { if let TyKind::Adt(adt, _) = ty.ty.kind() { let field = &adt.variants[index].fields[i]; field_names.push(field.ident.name.to_ident_string()); } else { ...
Rust
0
{ reg_p0: TRReadWrite<u8>, _reserved_0: [u8; 3usize], reg_p1: TRReadWrite<u8>, _reserved_1: [u8; 3usize], reg_p2: TRReadWrite<u8>, _reserved_2: [u8; 3usize], reg_p3: TRReadWrite<u8>, _reserved_3: [u8; 3usize], _regname: PhantomData<N>, } impl<N: RegisterLongName> BaseReadableRegister...
Rust
0
MODELS.items(): print(model) batchsizes = [1, 16, 32] for batch in batchsizes: for sms in [108]: tot_q = {'mus': 0, 'TFLOP/s': 0, 'GB/s': 0, 'speedup': 0,'memory' : 0, 'TFLOP': 0} tot_d = {'mus': 0, 'TFLOP/s': 0, 'GB/s': 0, 'speedup': 0,'...
Python
1
import csv with open("Ejercicios/Practica9/csv/AlumnosFP.csv", "r", encoding='latin-1') as f: nombres=list(csv.reader(f, delimiter=";")) nombres=nombres[1:] correos=[] for i in nombres: correos.append(i[1]) with open("Ejercicios/Practica9/csv/ListadoAlumnosFP.csv", "r", encoding='latin-1') as...
Python
1
if cx.unreachable { return _Undef(LHS); } B(cx).nswsub(LHS, RHS) } pub fn NUWSub(cx: &Block, LHS: ValueRef, RHS: ValueRef) -> ValueRef { if cx.unreachable { return _Undef(LHS); } B(cx).nuwsub(LHS, RHS) } pub fn FSub(cx: &Block, LHS: ValueRef, RHS: ValueRef) -> ValueRef { if cx.unreachable { retur...
Rust
0
") try: # To open the side bar to get detail information for address and phone number there element.click() print("Clicked") sleep(3) # To move the scroll down self.driver.find_element(By.XPATH, "/html/body/div[1]/div[3]...
Python
1
from datetime import datetime import logging from fastapi import APIRouter, HTTPException from backend.database import collections # Configure logging logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) router = APIRouter() @router.post("/migrate-companies") async def migrate_existing_compan...
Python
1
import os import csv from datetime import datetime from dotenv import load_dotenv from lib.y360_api.api_script import API360 def clear_dep_info_for_users(): # Функция для удаления признака членства пользователя в каком-либо департаменте print('Get all org users from API...') users = organization.get_all_us...
Python
1
without_host_and_version() { assert_eq!( git::message::connect(Service::UploadPack, Protocol::V2, b"hello\\world", None, &[]), "git-upload-pack hello\\world\0\0version=2\0" ) } #[test] fn version_2_without_host_and_version_and_exta_paramete...
Rust
0
alg_name: str, sorting_indices: NDArray, ) -> None: actual = np.array(sorted(data)) x_coords, y_coords = actual[:, 0], np.array(actual[:, 1]) color = next(self.my_colors) plt.plot(x_coords, y_coords[sorting_indices], label=alg_name, color=color) if se...
Python
1
fn test_repr_parse_smaller_than_payload() { let mut bytes = vec![0; 40]; let mut packet = Packet::new_unchecked(&mut bytes[..]); packet.set_version(6); packet.set_payload_len(1); let packet = Packet::new_unchecked(&*packet.into_inner()); assert_eq!(Repr::parse(&packet...
Rust
0
if '{admin}' in NoteText: NoteNames = NoteNames + ' ' + '__{admin}__' NotesNamesList.append(NoteNames) return NotesNamesList else: return NotesNamesList else: return NotesNamesList async def ClearNote(chat_id, note_name): ...
Python
1
string = "AAAAAAAAAAAAABBCCCCDD" string1 = "[(aaaaaaa,bbbbbbb,ccccc,dddddd)]" def runLengthEncoding(string): counter = 0 out = "" for idx in range(len(string)): counter += 1 if idx == len(string) - 1: out += encodeString(string[idx], counter) return out ...
Python
1
seen_titles.add(title) content = strip_html(item.get("text") or item.get("content") or "") if fetch_full_text and item.get("link") and len(content) < 200: full_text = parser_html(item.get("link")) if full_text: content = full_text ...
Python
1
&[&str]) -> zbus::Result<()>; /// GetFilesLocal method fn get_files_local(&self, files: &[&str]) -> zbus::Result<()>; /// GetOldTransactions method fn get_old_transactions(&self, number: u32) -> zbus::Result<()>; /// GetPackages method fn get_packages(&self, filter: u64) -> zbus::Result<()>;...
Rust
0
x<'_, '_>) { if ctx.kernel().as_ref().is_panicked() { spin_loop(); } let mut guard = self.output_buffer.lock(); while guard.w == guard.r.wrapping_add(OUTPUT_BUF) { // Buffer is full. // Wait for flush_output_buffer() to open up space in the buffer. ...
Rust
0
_eq!( runner().ok("@debug(());\ \n@debug(foo, (), bar);\ \n@debug(foo () bar);\ \n@debug((foo: (), bar: baz));"), "" ); } use axum::{ body::BoxBody, http::{header, HeaderValue, Response}, }; use std::convert::Infallible; pub async fn customer_response(...
Rust
0
= "neon_intrinsics", since = "1.59.0")] pub unsafe fn vqdmlals_s32(a: i64, b: i32, c: i32) -> i64 { let x: int64x2_t = vqdmull_s32(vdup_n_s32(b), vdup_n_s32(c)); vqaddd_s64(a, simd_extract(x, 0)) } /// Signed saturating doubling multiply-add long #[inline] #[target_feature(enable = "neon")] #[cfg_attr(test, a...
Rust
0
o), } } FileFormat::Csv { delimiter, quote, escape, header, } } } #![no_std] #![no_main] #![feature(global_asm)] extern crate panic_abort; #[no_mangle] pub unsafe extern "C" fn main() { loop{} } global_asm!(include_str!("boo...
Rust
0
: 1, 'in_resb': True, 'dim': [56, 56, 64, 64, 3, 3]}} st3_di = { 7: {'op': 'conv', 'stride': 1, 'in_resb': True, 'dim': [28, 28, 128, 64, 3, 3]}, 8: {'op': 'conv', 'stride': 1, 'in_resb': True, 'dim': [28, 28, 128, 128, 3, 3]}} st4_di = { 9: {'op': 'conv', 'stride': 1, 'in_resb': True, 'dim': [28, 28, 128, 12...
Python
1
# set is used to store multiple values which contain only unique element, data are store in unstructure way and it is changeable. it is denoted by {} unique_id = {101, 102, 103, 101, 102, 'python'} print(unique_id) p_language = ('PHP', 'Python', 'Javascript', 'Python', 'Python', 1) unique_language = set(p_language) ...
Python
1
############################################################################### # # Tests for XlsxWriter. # # SPDX-License-Identifier: BSD-2-Clause # # Copyright (c) 2013-2025, John McNamara, jmcnamara@cpan.org # from xlsxwriter.workbook import Workbook from ..excel_comparison_test import ExcelComparisonTest class ...
Python
1
map.insert("percent", percent.to_string()); } AptUpgradeEvent::SettingUp { package } => { map.insert("setting_up", package.into()); } AptUpgradeEvent::Unpacking { package, version, over } => { map.insert("unpacking", package.into()); ...
Rust
0
# -*- coding: utf-8 -*- # Create Date: 2024/07/11 # Author: wangtao <wangtao.cpu@gmail.com> # File Name: course_graph/parser/pdf_parser/pdf_parser.py # Description: 定义pdf文档解析器 from .structure_model import * from .ocr_model import * import shortuuid from ..parser import Parser from ..types import Page, Content, Content...
Python
1
""" Look for phrases in a CoNLL-formatted file that are analysed uniformly. """ import plac from collections import defaultdict class Token(object): def __init__(self, line): props = line.split() self.id = int(props[0]) - 1 self.word = props[1] self.pos = props[3].split('^')[-1] ...
Python
1
(f'{gt_key}_path', gt_path)])) return paths def paths_from_folder(folder): """Generate paths from folder. Args: folder (str): Folder path. Returns: list[str]: Returned path list. """ paths = list(scandir(folder)) paths = [osp.join(folder, path) for path in paths] ret...
Python
1
Chipmunk-7.x/Chipmunk-7.0.1-Docs/#ConstraintTypes-cpPivotJoint). pub fn anchor_b(&self) -> CPVect { unsafe { cpPivotJointGetanchorB(self.to_constraint()) } } /// See [Chipmunk Pin Joint](http://chipmunk-physics.net/release/Chipmunk-7.x/Chipmunk-7.0.1-Docs/#ConstraintTypes-cpPivotJoint). pub fn ...
Rust
0
""" 用户服务单元测试 """ import pytest from unittest.mock import Mock, AsyncMock, patch from sqlalchemy.ext.asyncio import AsyncSession from app.services.user_service import UserService from app.models.user import User from app.schemas.user import UserCreate, UserUpdate from app.core.security import get_password_hash, verify_...
Python
1
py.mixer.Sound("beep.mp3").play() score += 10 screen_text("score " + str(score) + " High score" + str(high_score), Cyan, 5, 5) snake_length += 5 if score > int(high_score): high_score = score with ...
Python
1
.find(|&&e| e.tag == "GM-FH-ÞT-1P-ET") .map(|&e| e.form.to_string()), past_ind_second_sg: entries .iter() .find(|&&e| e.tag == "GM-FH-ÞT-2P-ET") .map(|&e| e.form.t...
Rust
0
from enum import Enum, auto from aenum import Enum as AEnum class Particular(Enum):... class DemandParticular(Particular): JOB_TITLE = auto() SKILLS = auto() PHOTO_REQUIREMENT = auto() AGE_MINIMUM = auto() AGE_MAXIMUM = auto() GENDER = auto() SALARY_MINIMUM = auto() SALARY_MAXIMUM = ...
Python
1
on, PrettyConfig::default()).unwrap(), ) .unwrap(); } ui.label("Download the .ron file to build Loadstone locally."); }); } /// Automatically triggers a Loadstone build in Github Actions. By default, this requires a /// personal access token with write access to the main Loa...
Rust
0
f64> { if x == 0.0 { NotNan::new(0.0).unwrap() } else { NotNan::new(x * x.log2()).expect("entropy/plogp returned NaN") } } fn entropy(ids: &[InstanceId], dataset: &dyn RankingDataset) -> NotNan<f64> { if ids.len() == 0 { return NotNan::new(0.0).unwrap(); } let count = ids...
Rust
0
TB_ISBUTTONENABLED: u32 = 1033u32; #[doc = "*Required features: `\"Win32_UI_Controls\"`*"] pub const TB_ISBUTTONHIDDEN: u32 = 1036u32; #[doc = "*Required features: `\"Win32_UI_Controls\"`*"] pub const TB_ISBUTTONHIGHLIGHTED: u32 = 1038u32; #[doc = "*Required features: `\"Win32_UI_Controls\"`*"] pub const TB_ISBUTTONIN...
Rust
0
= ( "A conversation between User and Assistant. The user asks a question, and the Assistant solves it. The assistant " "first thinks about the reasoning process in the mind and then provides the user with the answer. The reasoning " "process and answer are enclosed within <think> </think> and <answer> </ans...
Python
1
pieces: Vec<_> = node.first_leading_trivia().unwrap().pieces().collect(); /// assert_eq!(2, pieces.len()); /// let pieces: Vec<_> = node.last_trailing_trivia().unwrap().pieces().collect(); /// assert_eq!(1, pieces.len()); /// ``` pub fn pieces(&self) -> SyntaxTriviaPiecesIterator<L> { Synta...
Rust
0
.store(true, Ordering::Relaxed); let idml2 = self.inner.idml.clone(); let inner2 = self.inner.clone(); self.inner.fs_trees.with(move |mut guard| { let k = (0..=u32::max_value()).filter(|i| { !guard.contains_key(&TreeID::Fs(*i)) }).nth(0).expect("Maximum nu...
Rust
0
user-level apps, pass [the `me` value](https://marketplace.zoom.us/docs/api-reference/using-zoom-apis#mekeyword) instead of the `userId` parameter. * * After assigning a phone number, you can remove it if you do not want it to be assigned to anyone. * * **Scopes:** `phone:write`, `phone:write:admin`...
Rust
0
imgs_and_coords = utils.mParallel(n_jobs=-1, verbose=30)(delayed(get_pixels_with_coords)(t.geometry.bounds, t.value, utm_crs, min_lonlat_meters, meters_per_pixel, dtype) for _,t in zc.iterrows()) # compute bounding rectangle bounds in meters min_lonlat_meters, max_lonlat_meters = gpd.GeoDataFrame([], ...
Python
1
# Generated by Django 5.0.3 on 2024-05-22 12:40 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('main', '0004_remove_names_id_alter_names_num'), ] operations = [ migrations.CreateModel( name='Infr', fields=[ ...
Python
1
(s) = {s} $ | /// | `Cardinality` | $ p(s) = \begin{cases} 1 & \text{if } s > 0 \\\\ 0 & \text{otherwise} \end{cases} $ | /// /// This method will modify the model - if this is not desired copy the model before invoking /// thi...
Rust
0
pressed_frame: 0xFFFFFFFF, is_down: false, }, ButtonState { button: controller::Y, pressed_frame: 0xFFFFFFFF, is_down: false, }, ButtonState { button: controller::START, pressed_frame: 0xFFFFFFFF, is_down: false, }, ]; struct ButtonSta...
Rust
0
transactions: PendingTransactions = Some(Arc::new(Mutex::new(HashMap::new()))); let filter_pool: Option<FilterPool> = Some(Arc::new(Mutex::new(BTreeMap::new()))); let frontier_backend = open_frontier_backend(config)?; let (grandpa_block_import, grandpa_link) = sc_finality_grandpa::block_import( client.clone...
Rust
0
nal channels case_params = case_params.unsqueeze(-1).unsqueeze(-1) # (B, c, 1, 1) # (B, n_params, h, w) case_params = case_params.expand( -1, -1, inputs.shape[-2], inputs.shape[-1] ) inputs = torch.cat( [inputs, case_params], dim=1 ) # (B, c + n_...
Python
1
const MPP_M = (3) << 11; const MPP_S = (1) << 11; const MPP_U = (0) << 11; /// Machine-mode interrupt enable. const MIE = (1) << 3; } } impl Mstatus { #[inline] pub unsafe fn read() -> Self { let mut x; llvm_asm!("csrr $0, mstatus" : "=r" (x) : : : "v...
Rust
0
Request { /// Peer which has emitted the request. peer: PeerId, /// Name of the protocol in question. protocol: Cow<'static, str>, /// If `Ok`, contains the time elapsed between when we received the request and when we /// sent back the response. If `Err`, the error that happened. result: Result<Duration,...
Rust
0
mut Vec<u8>) -> Result<()> { if self.source_len == self.target_len { return Ok(()); } let mut cursor = VersionedCursor::new(bytes.as_slice()) .map_err(|err| Error::msg(format!("{:?}", err)))?; let mut mutator = Mutator::new(); self.calc_diff(&mut cursor,...
Rust
0
ton)>>(data)(&mut button) } } } } impl Label { /// Create a new label with the given string as its text. /// Note that labels do not auto-wrap their text; they will expand as far as needed /// to fit. pub fn new(_ctx: &UI, text: &str) -> Label { unsafe { let ...
Rust
0
))) } #[derive(Debug, Deserialize, Validate)] pub struct GetMessageQueryParams { #[serde(default = "default_true")] with_content: bool, } async fn get_message( Extension(ref db): Extension<DatabaseConnection>, Path((_app_id, msg_id)): Path<(ApplicationIdOrUid, MessageIdOrUid)>, ValidatedQuery(GetMe...
Rust
0
from typing import Any, Type from gws_core.core.model.model_dto import BaseModelDTO from gws_core.core.utils.utils import Utils from ...core.exception.exceptions.bad_request_exception import \ BadRequestException from .r_field import BaseRField class ModelRfield(BaseRField): """ RField to serialize an...
Python
1
.ArgumentParser(description='MINOS gym wrapper') args = parse_sim_args(parser) sim = RoomSimulator(args) common.attach_exit_handler(sim.sim) try: print('Starting RoomSimulator...') sim.init() print('RoomSimulator started.') interactive_loop(sim, args) except: ...
Python
1
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('api', '0019_auto_20150216_0813'), ] operations = [ migrations.AddField( model_name='event', name='ja...
Python
1
class BIT: def __init__(self, n): self.n = n self.tree = [0] * (n + 1) def update(self, i, val): while i <= self.n: self.tree[i] += val i += self.lowbit(i) def query(self, i): res = 0 while i > 0: res += self.tree[i] ...
Python
1
import pytest from conftest import Apple, Peach, assertIsSubsetOf def test_setattr_readonly(pk): """ We shouldn't be able to set the readonly attributes""" a = Apple(name='a', variety='b') pk.save(a) with pytest.raises(Exception): a._k8s_uid = 'hello' with pytest.raises(Exception): ...
Python
1
def tt_ize(s): return '\\texttt{' + s + '}' if s is not None else ''
Python
1
N_REQUIRED, SslCertificateRequired = MBEDTLS_ERR_SSL_CERTIFICATE_REQUIRED, SslCertificateTooLarge = MBEDTLS_ERR_SSL_CERTIFICATE_TOO_LARGE, SslClientReconnect = MBEDTLS_ERR_SSL_CLIENT_RECONNECT, SslCompressionFailed = MBEDTLS_ERR_SSL_COMPRESSION_FAILED, SslConnEof = MBEDTLS_ERR_SS...
Rust
0
GET, 'http://127.0.0.1:9527/del_session') print(response.text) print(response.cookies) def test_day03_global_hook(self): response = requests.request(self.GET, 'http://127.0.0.1:9527') print(response.text) print(response.headers) def test_day03_abort(self): respo...
Python
1
sIn = dim } if (*cmap).codespace.num.wrapping_add(1_u32) > (*cmap).codespace.max { (*cmap).codespace.max = (*cmap).codespace.max.wrapping_add(10_u32); (*cmap).codespace.ranges = renew( (*cmap).codespace.ranges as *mut libc::c_void, ((*cmap).codespace.max as u64).wrapping_...
Rust
0