text
string
label_name
string
labels
int64
); assert_ok!(result); assert_eq!( CredentialRegistry::cred_by_id(&id), Some(Credential { id: id.clone(), owner: owner, hash: hash, registered: now, props: None }) ); ...
Rust
0
tags.as_ptr() as *const _ as *const _, tags.len(), ); (dst, n) } }*/ } impl PartialEq for FontData { fn eq(&self, other: &Self) -> bool { unsafe { ffi::blFontDataEquals(self.core(), other.core()) } } } impl Drop for FontData { #[inline] fn...
Rust
0
led::Led; use kernel::hil::time::{Alarm, AlarmClient, ConvertTicks}; use kernel::process::{Error, ProcessId}; use kernel::processbuffer::{ReadOnlyProcessBuffer, ReadableProcessBuffer}; use kernel::syscall::{CommandReturn, SyscallDriver}; use kernel::ErrorCode; use kernel::errorcode::into_statuscode; use core::cell::Ce...
Rust
0
import numpy as np import pytest from pysisyphus.helpers import geom_loader from pysisyphus.intcoords.setup import get_fragments import pysisyphus.linalg_affine3 as aff3 from pysisyphus.wrapper import jmol def test_reflect_cycle(): """Reflect phenyl-fragment on plane containing the other atoms.""" geom = ge...
Python
1
a,b=12, 13 c,b=a*2, a/2 print(a,b,c)
Python
1
estCase( name="create_entire_for_loop_line", test_case_core=YEARLY_RETURNS_FOR_LOOP_ANALYSIS, prefix=""" def calculate_percent_change(current_value, previous_value): return (current_value - previous_value) / previous_value percent_changes = [] """, suffix=""" current_close = ret...
Python
1
let mut file_writer = File::create(&file_path) .map_err(|e| amend_io_error(e, format!("failed to create {:?}", file_path)))?; file_writer .write_all(&r.content) .map_err(|e| amend_io_error(e, format!("failed to write to {:?}", file_path)))?; file_writer ...
Rust
0
(), name: "test".to_string(), team: "earth".to_string(), }]; let state = cmds.iter().fold(state, |state, cmd| { Match::handle_command(&state, &cmd) .unwrap() .iter() .fold(state, |state, evt| Match::apply_event(&state, ...
Rust
0
#!/usr/bin/env python # -*- coding:utf-8 -*- """ Date: 2025/9/9 14:57 Desc: 中国外汇交易中心暨全国银行间同业拆借中心-基准-外汇市场-外汇掉期曲线-外汇掉漆 C-Swap 定盘曲线 https://www.chinamoney.org.cn/chinese/bkcurvfsw """ import ssl import pandas as pd import requests from requests.adapters import HTTPAdapter class LegacySSLAdapter(HTTPAdapter): def i...
Python
1
''' 6) Задача со *, реализовать функцию создания такого файлика кодом, где можно задать кол-во строк в файле и кол-во цифр.''' import random def create_file(*, file_name: str, line_amount_c: int, digit_amount_c: int) -> None: remaining_digits = digit_amount_c digit_amount_line = int(remain...
Python
1
elif clause.lower().endswith(" desc"): clause = clause.rsplit(" ")[0] reverse = True # Order by columns must be in select clause if clause in query["select"]: results = sorted(results, key=operator.itemgetter(clause), reverse=reverse) ...
Python
1
""" Test the pretty printing of snippet: it should align arrows even for the already existing parameter. """ import GPS from gs_utils.internal.utils import * EXPECTED = """ Obj.Do_Nothing (D => "Hello", AAAAAAAAAAAAA => Integer, BBBBBBB => Float) end Main; """ @run_test_driver def run_test(): GPS.Preference(...
Python
1
::Spanned}; mod keyword { syn::custom_keyword!(hiddencrate); syn::custom_keyword!(add_extra_genesis); syn::custom_keyword!(extra_genesis_skip_phantom_data_field); syn::custom_keyword!(config); syn::custom_keyword!(build); syn::custom_keyword!(get); syn::custom_keyword!(map); syn::custom_keyword!(double_map); ...
Rust
0
erifier(v, pos) } } impl flatbuffers::SimpleToVerifyInSlice for FromInclude {} // struct Unused, aligned to 4 #[repr(transparent)] #[derive(Clone, Copy, PartialEq)] pub struct Unused(pub [u8; 4]); impl std::fmt::Debug for Unused { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct(...
Rust
0
4) < 1e-9) assert (abs(step.times[1]-0.9) < 1e-9) # 2) dt = 0.01 ms, min_delay = 0.01 ms dt = 0.01 sim.setup(timestep=dt, min_delay=dt) cells = sim.Population(1, sim.IF_curr_exp(v_thresh=-55.0, tau_refrac=5.0, v_rest=-60.0)) # 2.1) Negative time value with pytest.raises(ValueError): ...
Python
1
e = self._handle_error(e, fpname, lineno, line) optname = self.optionxform(optname.rstrip()) if self._strict and (sectname, optname) in elements_added: raise configparser.DuplicateOptionError( sectname, optname...
Python
1
midterms = [80, 91, 78] finals = [98, 89, 53] students = ["dan", "ang", "kate"] # final_grades = {'dan':98, 'ang':91, 'kate':78} # final_grades = [max(pair) for pair in zip(midterms,finals)] # final_grades = {t[0]:max(t[1],t[2]) for t in zip(students,midterms,finals)} final_grades = zip( students, map(lambda pair...
Python
1
c = "*Required features: `\"Win32_Storage_FileServerResourceManager\"`*"] pub const FsrmPropertyValueType_Literal: FsrmPropertyValueType = 1i32; #[doc = "*Required features: `\"Win32_Storage_FileServerResourceManager\"`*"] pub const FsrmPropertyValueType_DateOffset: FsrmPropertyValueType = 2i32; #[doc = "*Required feat...
Rust
0
body.amount, })); } Err(error::ErrorBadRequest(Error::from( ErrorKind::InvalidParameter, ))) } // Get Exchange Offers #[derive(Serialize, Deserialize, Debug, Copy, Clone)] struct CounterParty { token_address: Address, amount: u64, address: Option<Address>, } #[derive(Serializ...
Rust
0
.binary_search(&i) { self.data.insert(loc, i); } self } fn put0(&mut self, i: usize) -> &mut Self { BOUNDS_CHECK!(i < self.size()); let i = try_cast(i); if let Ok(loc) = self.data.binary_search(&i) { self.data.remove(loc); } self ...
Rust
0
trajectories=trajectories[None], traversal_coordinates=traversal_coordinates[None], ) for ( pi, trajectory_probabilities, visited_edges, trajectories, traversal_coordinates, ) i...
Python
1
# test_fonts.py - ทดสอบฟอนต์ที่อัปโหลด import os import sys from PIL import Image, ImageDraw, ImageFont # ตั้งค่า encoding สำหรับ Windows if sys.platform == 'win32': sys.stdout.reconfigure(encoding='utf-8') def test_all_fonts(): """ทดสอบฟอนต์ทั้งหมดในโฟลเดอร์ fonts""" fonts_dir = 'fonts' output_dir = ...
Python
1
t_iter(&cells, hash.pack()).next(); if sudt_cell.is_none() { return Err(MercuryError::LackSUDTCells(hex::encode( cell.cell_output.lock().calc_script_hash().raw_data(), )) .into()); } let...
Rust
0
, 0x38, 0x76, 0x53, 0x12, 0x37, 0xfd, 0x80, 0x27, 0xac, 0x8e, 0x47, 0x15, 0xa1, 0x2, 0xaf, 0x3a, ]); let nonce = Nonce::from_public_slice(&[ 0x85, 0x7b, 0x50, 0x7d, 0xb5, 0x2f, 0xa9, 0x77, 0x4f, 0x86, 0xca, 0xfc, 0xe3, 0xcd, 0xdb, 0x73, ]); let msg = ByteSeq::from_public_slice(&[...
Rust
0
rameters(): if hasattr(v, 'ds_id'): with deepspeed.zero.GatheredParameters(_z3_params_to_fetch([v ]), enabled=zero_stage_3): v_p = v.data.cp...
Python
1
executable_in_workspace(&temp_pkg_id, &ws) == Some(target_build_dir(&ws).join_many(["mockgithub.com", "catamorphism", "test_pkg_version", "test_pkg_v...
Rust
0
: -27, /// ECDH ES w/ HKDF - generate key directly ECDH_ES_HKDF_512: -26, /// ECDH ES w/ HKDF - generate key directly ECDH_ES_HKDF_256: -25, /// SHAKE-128 256-bit Hash Value SHAKE128: -18, /// SHA-2 512-bit Hash truncated to 256-bits SHA_512_256: -17, ...
Rust
0
} } pub fn init_globals(&mut self, env: &Environment) { (0..env.globals_index).into_iter().for_each(|i| { let var_id = env.globals_symbols[&i]; let var = env.symbol_table.get_var_by_id(var_id); let addr = Address(var.index.unwrap()); let var_type = var.v...
Rust
0
Ok(p) => Some(format!("{}", p.display())), Err(e) => { log_error!("{}", e); None } }; origen::initialize( Some(verbosity), vec![], exe, Some(built_info::PKG_VERSION.to_string()), ); let version = match STATUS.is_app_present { ...
Rust
0
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt" from __future__ import unicode_literals import frappe from frappe.utils import cint def boot_session(bootinfo): """boot session - send website info if guest""" bootinfo.custom_css = frap...
Python
1
*y + 1, y(0) = 0") print("解析解: y(t) = 0.5*(1 - exp(-2*t))") # 使用API方式 solver_api = ImprovedEulerSolver(use_api=True) t_eval = np.linspace(0, 2, 100) result_api = solver_api.solve(example1, (0, 2), [0], t_eval=t_eval) # 使用手动实现 solver_manual = ImprovedEulerSolver(use_api=False) r...
Python
1
parser.add_argument('--batch-size', type=int, default=128, help='the batch size') parser.add_argument('--lr', type=float, default=.1, help='the initial learning rate') parser.add_argument('--model-prefix', type=str, help='the prefix of the...
Python
1
{ "question": "线性回归中,用来评估模型拟合优度的指标是____。", "user_answer": "R²", "correct_answer": "R²(决定系数)", "is_correct": True, "analysis": "R²(决定系数)是评估线性回归模型拟合优度的重要指标,它表示模型能够解释的方差占总方差的比例,取值范围为0到1,越接近1表示模型拟合效果越好。", "knowledge_point": "机器...
Python
1
width=300, default_height=150) elif box.style['width'].unit == '%': # See https://drafts.csswg.org/css-sizing/#intrinsic-contribution width = 0 else: assert width.unit == 'px' width = width.value return adjust(box, outer, width) def flex_min_content_width(context, box, oute...
Python
1
E70014; pub const STATUS_SPACES_UNSUPPORTED_VERSION: NTSTATUS = 0xC0E70015; pub const STATUS_SPACES_CORRUPT_METADATA: NTSTATUS = 0xC0E70016; pub const STATUS_SPACES_DRT_FULL: NTSTATUS = 0xC0E70017; pub const STATUS_SPACES_INCONSISTENCY: NTSTATUS = 0xC0E70018; pub const STATUS_SPACES_LOG_NOT_READY: NTSTATUS = 0xC0E70019...
Rust
0
= work.publication_date: entry.events.append(describe_publication_event(work, with_date=False, placeholder=True)) # amendment for amendment in amendments: description_description = _('Revised by') if amendment.verb == 'revised' else _('Amended by') description = Time...
Python
1
# 3 - Cálculo de IMC: # Crie um programa que calcule o Índice de Massa Corporal (IMC). # Peça ao usuário para digitar seu peso e altura, armazene em # variáveis e calcule o IMC. print('------------- IMC --------------') imc = 0 p = float(input('Digite o seu peso: ')) a = float(input('Digite a altura: ')) imc = p / (...
Python
1
population with individuals. pub trait HeuristicPopulation: Display + Send + Sync { /// A heuristic objective type. type Objective: HeuristicObjective; /// A solution type. type Individual: HeuristicSolution; /// Adds all individuals into the population, then sorts and shrinks population if necess...
Rust
0
# -*- coding: utf-8 -*- from ...intunecdlib.BaseBackupModule import BaseBackupModule class WindowsEnrollmentProfilesBackupModule(BaseBackupModule): """A class used to backup Intune Windows enrollment profiles Attributes: CONFIG_ENDPOINT (str): The endpoint to get the data from LOG_MESSAGE (st...
Python
1
llm.bind_tools(tools) query = input("\nEnter a query for the LLM: ") or "What tools do you have available?" print("\nSending query to LLM...") result = await llm_with_tools.ainvoke(query) print("\nLLM Response:") ...
Python
1
le of how pro! contract should /// call substrate runtime `RandomnessCollectiveFlip::random_seed`. /// Define the operations to interact with the substrate runtime #[pro::chain_extension] pub trait FetchRandom { type ErrorCode = RandomReadErr; /// Note: this gives the operation a corresponding func_id (1101 i...
Rust
0
} fn skill_ref(&self) -> &dyn SkillAbility { &self.skill } fn burst_ref(&self) -> &dyn SpecialAbility { &self.burst } fn na_mut(&mut self) -> &mut dyn SpecialAbility { &mut self.na } fn ca_mut(&mut self) -> &mut dyn SpecialAbility { &mut self.ca } fn skill_mut(&mut self) -> &mut dyn SkillAbility { ...
Rust
0
lt; use log::{debug, warn}; use rosc::OscPacket; use std::collections::HashMap; #[derive(Clone, Debug, Hash, PartialEq, Eq)] pub struct OscPath { path: String, } impl OscPath { pub fn new(path: String) -> Self { Self { path: path } } } /// The OSC handler uses a pi-blaster instance and a map of p...
Rust
0
nt_admin_only_access: assert "@has_grant_role(RoleEnum.ADMIN)" in decorators elif rule.endpoint in routes_with_expected_member_only_access: assert "@has_grant_role(RoleEnum.MEMBER)" in decorators elif rule.endpoint in routes_with_expected_is_mhclg_user_access: assert ...
Python
1
let local_garage = create_garage(&config)?; let garage = Arc::new(Mutex::new(local_garage)); let http = http::listen(garage.clone(), args.http_port); let client = Arc::new(Client::builder().timeout(Duration::from_secs(10)).build()?); let sync = sync::poll(client, garage, config.secondary_hosts); let _ = join!(...
Rust
0
"""Tests for frontend's LoRANSAC verifier. Authors: John Lambert """ import unittest import tests.frontend.verifier.test_verifier_base as test_verifier_base from gtsfm.frontend.verifier.loransac import LoRansac class TestLoRansacForEssentialMatrix(test_verifier_base.TestVerifierBase): """Unit tests for the LoRA...
Python
1
# ============================================================================================ # PROBLEM B5 # # Build and train a neural network model using the Daily Max Temperature.csv dataset. # Use MAE as the metrics of your neural network model. # We provided code for normalizing the data. Please do not change the...
Python
1
4 => State::DfuDnbusy, 5 => State::DfuDnloadIdle, 6 => State::DfuManifestSync, 7 => State::DfuManifest, 8 => State::DfuManifestWaitReset, 9 => State::DfuUploadIdle, 10 => State::DfuError, other => State::Other(other), ...
Rust
0
-x64.tar.gz", "7ef1f7dae52a3ec99cda9cf29e655bc6e61c2c48e496532d83d9f17ea108d5d8", ); #[cfg(all(target_os = "linux", target_arch = "aarch64"))] pub(crate) const BIN_INFO: (&str, &str) = ( "-linux-arm64.tar.gz", "784ede0c9faa4a71d77659918052cca39981138edde2c799ffdf2b4695c08544", ); #[cfg(all(target_os = "ma...
Rust
0
通过req.method()和req.uri().path()来识别方法和请求路径 match (req.method(), req.uri().path()) { (&Method::POST, "/") => { // 这里需要完整的body,所以需要等待全部的stream并把它们变为bytes info!("Recieved a download request!"); let full_body = hyper::body::to_bytes(req.into_body()).await?; let par...
Rust
0
"""true 是 false 否 :rtype: bool """ return self._Exist @Exist.setter def Exist(self, Exist): self._Exist = Exist @property def RequestId(self): """唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :rtype: str ...
Python
1
haskdt = False if isinstance(obj, numpy.ndarray): return NumpyAdapter(obj) elif isinstance(obj, scipy.sparse.csr_matrix) or isinstance(obj, scipy.sparse.csc_matrix): return ScipyAdapter(obj) elif haselem and isinstance(obj, El.Matrix): return ElMatrixAdapter(obj) elif hase...
Python
1
/// /// [`Spi`]: struct.Spi.html pub fn set_bits_per_word(&mut self, bits_per_word: u8) { self.bits_per_word = bits_per_word; } /// Gets the state of Slave Select change for this segment. pub fn ss_change(&self) -> bool { self.cs_change == 1 } /// Changes Slave Select's beh...
Rust
0
lf { variant as _ } } #[doc = "Reader of field `PINT_RULE`"] pub type PINT_RULE_R = crate::R<u8, PINT_RULE_A>; impl PINT_RULE_R { #[doc = r"Get enumerated values variant"] #[inline(always)] pub fn variant(&self) -> PINT_RULE_A { match self.bits { 0 => PINT_RULE_A::ENUM_NS_NP,...
Rust
0
import typing from collections import OrderedDict from difflib import SequenceMatcher from typing import Dict import torch from torch import nn def similarity(a: str, b: str) -> float: """ similarity returns a similarity score between the provided strings. """ return SequenceMatcher(None, a, b).ratio...
Python
1
: None, vocab: None, } } } pub struct DatasetSnapshotBuilder<'a: 'b, 'b> { fbb_: &'b mut flatbuffers::FlatBufferBuilder<'a>, start_: flatbuffers::WIPOffset<flatbuffers::TableUnfinishedWIPOffset>, } impl<'a: 'b, 'b> DatasetSnapshotBuilder<'a, 'b> { #[inline] pub fn add_name(&mut s...
Rust
0
<i32> { let mut nodes = self.yaml_nodes.lock().unwrap(); let v: serde_yaml::Value = match nodes.get(node) { Some(v) => v.clone(), None => return Ok(1), }; let v = match v.as_mapping() { Some(v) => v, None => return Ok(1), }; ...
Rust
0
ial conflicts:") if high_conflicts: print(f" {self.colors['high']}HIGH: {high_conflicts} conflicts{self.colors['reset']}") if medium_conflicts: print(f" {self.colors['medium']}MEDIUM: {medium_conflicts} conflicts{self.colors['reset']}") if low_confli...
Python
1
(); exit(0); } // this conditional check for the --sysroot flag is there so users can call // `clippy_driver` directly // without having to pass --sysroot or anything let mut args: Vec<String> = orig_args.clone(); if !have_sys_root_arg { args.exte...
Rust
0
: &'a mut Vec<MatrixCell>, rows: usize, cols: usize) -> Self { matrix.resize(rows * cols, MatrixCell::default()); ScoreMatrix { matrix, rows, cols } } #[inline] fn get_score(&self, row: usize, col: usize) -> i32 { self.matrix[row * self.cols + col].score } #[inline] fn ...
Rust
0
lable cores #workpool.updateCoreNumber(3) print('Adding more jobs...') # Give the pool some more work to do for i in range(1, 4): workpool.addJob(["test1", i]) time.sleep(0.05) workpool.addJob(["long time", 99]) print('Closing the pool...') # Wait for everything to fini...
Python
1
get{1}ObjectWriter().writeValueAsString(obj);", "\t".repeat(indent), id)?; writeln!(w, "{}}}", "\t".repeat(indent - 1))?; writeln!(w)?; } Ok(()) } fn write_reader_writer_converter(ids: &Vec<String>, indent: usize, w: &mut dyn Write) -> std::io::Result<()> { for id in ids { writeln!...
Rust
0
# Volatility # Copyright (C) 2007-2013 Volatility Foundation # # This file is part of Volatility. # # Volatility 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 o...
Python
1
_stdout_tty: bool, ) -> std::io::Result<Self> { let buffer = if download { Buffer::Stderr } else if let Some(output) = output { let file = std::fs::File::create(&output)?; Buffer::File(file) } else if is_stdout_tty { Buffer::Stdout } el...
Rust
0
use super::View as _; self.ui(ui); }); } } impl super::View for About { fn ui(&mut self, ui: &mut egui::Ui<'_>) { use egui::special_emojis::{OS_APPLE, OS_LINUX, OS_WINDOWS}; ui.heading("egui"); ui.label(format!( "egui is an immediate mod...
Rust
0
l and get output `sub_seq_out`. If the loss calculation process needs to use the complete output, we have to gather the `sub_seq_out` in all sp ranks during forward propagation and split the grad during backward propagation. 2. Why we need grad scale? Here is a simple case. -------- SP 1 -----...
Python
1
from instabot import Bot bot=Bot() bot.login(username='hello4565925',password='denusharma5656') bot.follow('xx.__kanha__.xx__') bot.upload_photo("path",caption="i love python") bot.unfollow('xx.__kanha__.xx__') bot.send_message("i love python with [username]") followers=bot.get_user_followers("username") for follower i...
Python
1
tml/VkDebugUtilsMessengerCallbackDataFlagsEXT.html) /// /// currently reserved for future use. VkDebugUtilsMessengerCallbackDataFlagsEXT {} } flag_bits! { /// [VkAndroidSurfaceCreateFlagsKHR](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkAndroidSurfaceCreateFlagsKHR.html) /// /// c...
Rust
0
} lines[i].0 ^= 1; i = (i as i32 + lines[i].1) as usize; } ACC => { acc += lines[i].1; i += 1; } _ => { lines[i].0 ^= 1; let (succeed, res) = can_succeed(&lines, i...
Rust
0
import os from pyportable_installer import full_build def main(full_pack=False): _precheck(full_pack) if full_pack: conf = full_build('pyproject.json', { 'build': { 'attachments': { './requirements_offline': 'assets,dist:build/{name}', ...
Python
1
_ => { return Err(EmuException::UnexpectedError); }, } Ok(()) } add_dst_src!(32, rm32, imm32); or_dst_src!(32, rm32, imm32); adc_dst_src!(32, rm32, imm32); sbb_dst_src!(32, rm32, imm32); and_dst_src!(32, rm32, imm32); sub_dst_src!(32, rm32, imm32); xor_dst_src!(32, rm32,...
Rust
0
import json from typing import Any, Type, TypeVar from pydantic import BaseModel from pydantic.version import VERSION as PYDANTIC_VERSION PYDANTIC_V2 = PYDANTIC_VERSION.startswith("2.") Model = TypeVar("Model", bound="BaseModel") if PYDANTIC_V2: import pydantic_core to_jsonable_python = pydantic_core.to_j...
Python
1
ialEq, Eq)] pub struct Parameters; impl ModelParameters for Parameters { type BaseField = Fq3; type ScalarField = Fr; /// COFACTOR = /// 175548354538878611674427047546668725918694771203200445971421007028038950011698749612409857482338946628597815114015550863876572901917459952718360037209476002314439828...
Rust
0
from threading import Thread from loguru import logger from app.loopd import GraphLoopBuilder from app.services.cache import get_cache from app.services.decorators import time_sleep_after from app.services.ecstasy import EcstasyAPI from app.services.elastic import ElasticAPI from app.services.graph_writter import wri...
Python
1
power_density = cli::get_value_from_param_file_argument_with_default( reader, arguments, "min-total-power-density", "min_beam_en", &|min_beam_en| min_beam_en * U_E / U_T, DCPowerLawAccelerationConfig::DEFAULT_MIN_TOTAL_POWER_DENSITY, ); let min_depletion_distance...
Rust
0
_le_bytes_mod_order(&fr_modulus_bits); let modulus_fp_elem = FpElem::new(&modulus_in_f, m, two_power_m)?; let non_native_field_info = NonNativeFieldInfo::<F> { m, two_power_m, modulus_in_f, modulus_fp_elem, }; // vk let vk_vars = m...
Rust
0
alized paths. """ assert isinstance(paths, list), paths return [normalize_path(p, parent) for p in paths] def normalize_path(path: str, parent: str = os.curdir) -> str: """Normalize a single-path. :returns: The normalized path. """ # NOTE(sigmavirus24): Using os.path.sep and os.pa...
Python
1
import zmq import cv2 import numpy as np HOST = "192.168.11.17" PORT = 12345 NUM_CAMS = 2 sockets = [] context = zmq.Context() for i in range(0, NUM_CAMS): socket = context.socket(zmq.REQ) # connect to the video publish socket socket.connect(f"tcp://{HOST}:{PORT}") sockets.append(socket) print(...
Python
1
# Fichier __init__.py pour le package services # Ce package contient tous les services métier de l'application """ Package contenant tous les services métier de l'application. Les services métier contiennent : - La logique de l'application (règles de gestion) - L'orchestration des différentes opérations - Les traitem...
Python
1
# Pretty-printers for bounds registers. # Copyright (C) 2013-2018 Free Software Foundation, Inc. # 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 3 of the License, or # (at your o...
Python
1
in_thread: thread::current().id(), }); Some((Universe { buffer: None }, provided.into())) } /// Level of multithreading supported by this MPI universe /// /// See the `Threading` enum. /// /// # Examples /// See `examples/init_with_threading.rs` pub fn threading_support() -> Threading { unsafe { w...
Rust
0
_CLASS. pub const DT_MIPS_DELTA_CLASS_NO: u32 = 0x7000_0018; /// Delta C++ class instances. pub const DT_MIPS_DELTA_INSTANCE: u32 = 0x7000_0019; /// Number of entries in DT_MIPS_DELTA_INSTANCE. pub const DT_MIPS_DELTA_INSTANCE_NO: u32 = 0x7000_001a; /// Delta relocations. pub const DT_MIPS_DELTA_RELOC: u32 = 0x7000_001...
Rust
0
cts3) box = ax.get_position() #box.height*0.75 #box.y0 + box.height * 0.32 ax.set_position([box.x0, box.y0 + box.height*0.09, box.width, box.height*0.75]) #bbox_to_anchor=(0.5, 1.6) leg = plt.legend(loc='upper center', bbox_to_anchor=(0.5, 1.35), handler_map={matplotlib.lines.Line2D: SymHandler()}, fontsiz...
Python
1
# Generated by Django 4.2.12 on 2024-09-05 11:17 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('grocery', '0011_rename_product_vendor_product'), ] operations = [ migrations.AddField( model_name='vendor', name='e...
Python
1
aggregate_event = recordings[0].domain_event notification = recordings[0].notification tracking = Tracking(bank_accounts.name, notification.id) with self.assertRaises(IntegrityError): email_process.process_event(aggregate_event, tracking) def test_filter_received_notification...
Python
1
urn w def __call__(self, xs, ys, inds=None, return_all_ws=False): xs, ys = xs.cpu(), ys.cpu() if inds is None: inds = range(ys.shape[1]) else: if max(inds) >= ys.shape[1] or min(inds) < 0: raise ValueError("inds contain indices where xs and ys are not...
Python
1
, INDIRECT, INCIDENTAL, // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT // (INCLUDI...
Rust
0
#!/usr/bin/python3 # -*- coding:utf-8 -*- # # @name : EmailAll - Email Information Gathering Tools # @url : http://github.com/Taonn # @author : Tao. (Taonn) from prettytable import PrettyTable from emailall.config import settings import json class Output(object): def __init__(self): self.emails = No...
Python
1
one cell member. DepGroup, } impl Default for DepType { fn default() -> Self { DepType::Code } } impl From<DepType> for core::DepType { fn from(json: DepType) -> Self { match json { DepType::Code => core::DepType::Code, DepType::DepGroup => core::DepType::DepGr...
Rust
0
.add_user(self.user_to_add.clone()) } } #[derive(Debug, Serialize, Deserialize)] pub struct RemoveUser { /// Metadata about this action. pub metadata: TabUserActionMetadata, /// [UserID](UserID) of the [User](User) to remove from the [Tab](Tab). pub user_id: UserID, } impl RemoveUser { pub fn ...
Rust
0
// println!("{}", tree); tree.insert(15); // println!("{}", tree); // 30 // | 16 // | | 15 // | 44 // | | 39 // | | 76 } #[test] fn right_rotation() { let mut tree = AVLTree::<i32>::new(); tree.insert(-44); tree.insert...
Rust
0
dones.iter() { writeln!(file, "DONE: {}", done).unwrap(); } for deleted in deleteds.iter() { writeln!(file, "DELETED: {}", deleted).unwrap() } } // TODO(#2): add new items to TODO // TODO(#4): edit the items // TODO(#5): keep track of date when the item was DONE // TODO(#6): undo system //...
Rust
0
import asyncio from pyrogram.enums import ChatMemberStatus from pyrogram.errors import ( ChatAdminRequired, InviteRequestSent, UserAlreadyParticipant, UserNotParticipant, ) from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup from TOSUMUSIC import YouTube, app from TOSUMUSIC.music imp...
Python
1
# -*- coding: utf-8 -*- # vStream https://github.com/Kodi-vStream/venom-xbmc-addons # https://www.pstream.net/e/xxxxx import base64 import json from resources.hosters.hoster import iHoster from resources.lib.comaddon import isMatrix from resources.lib.handler.requestHandler import cRequestHandler from resources.lib.pa...
Python
1
def exclusive_group(group, name, default, help): destname = name.replace('-', '_') subgroup = group.add_mutually_exclusive_group(required=False) subgroup.add_argument(f'--{name}', dest=f'{destname}', action= 'store_true', help=f"{help} (use '--no-{name}' to disable)") subgroup.add_argument(f'--n...
Python
1
_name_lit, } = lane_data; quote! { let buffer_size = exec_conf.action_buffer.clone(); let (lifecycle_tx, event_rx) = tokio::sync::mpsc::channel(buffer_size.get()); let lifecycle = #lifecycle::create(configuration); let event_stream = tokio_stream::wrappers::ReceiverStream::new(e...
Rust
0
# Draw eyes (X eyes when dead, normal when alive) if self.alive: eye_size = 3 pygame.draw.circle(screen, BLACK, (x * GRID_SIZE + 5, y * GRID_SIZE + 5), eye_size) pygame.draw.circle(screen, BLACK, ...
Python
1
loss_fct = CrossEntropyLoss() shift_logits = shift_logits.view(-1, self.config.vocab_size) shift_labels = shift_labels.view(-1) # Enable model/pipeline parallelism shift_labels = shift_labels.to(shift_logits.device) loss = loss_fct(shift_logits, shi...
Python
1
string, } #[test] fn bindgen_test_layout_str_list_type() { assert_eq!( ::std::mem::size_of::<str_list_type>(), 16usize, concat!("Size of: ", stringify!(str_list_type)) ); assert_eq!( ::std::mem::align_of::<str_list_type>(), 8usize, concat!("Alignment of ", str...
Rust
0
d::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue for PageResponse { fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef { ::protobuf::reflect::ReflectValueRef::Message(self) } } static file_descriptor_prot...
Rust
0