text
string
label_name
string
labels
int64
ects should represent irregular characters # with a '#' followed by the symbol's hex number name = NameObject.unnumber(name) for enc in ("utf-8", "gbk"): try: ret = name.decode(enc) return NameObject(ret) except ...
Python
1
EVENT_HANDSHAKE_FAILED_PROTOCOL: u32 = 8192; pub const ZMQ_EVENT_HANDSHAKE_FAILED_AUTH: u32 = 16384; pub const ZMQ_PROTOCOL_ERROR_ZMTP_UNSPECIFIED: u32 = 268435456; pub const ZMQ_PROTOCOL_ERROR_ZMTP_UNEXPECTED_COMMAND: u32 = 268435457; pub const ZMQ_PROTOCOL_ERROR_ZMTP_INVALID_SEQUENCE: u32 = 268435458; pub const ZMQ_P...
Rust
0
scope_4883.boolean(*var_4884); } #[allow(unused_mut)] let mut scope_4885 = writer.prefix("ResourceId"); if let Some(var_4886) = &input.resource_id { scope_4885.string(var_4886); } #[allow(unused_mut)] let mut scope_4887 = writer.prefix("ResourceCidr"); if let Some(var_488...
Rust
0
import matplotlib.pyplot as plt class PlotManager(object): @staticmethod def plot_thd(ax_thd, plot_x, plot_thd): ax_thd.plot(plot_x, plot_thd, linewidth=2, alpha=0.7, color=(63 / 255, 160 / 255, 192 / 255), label='THD') ax_thd.set_xscale('log') ax_thd.set_xlabel("Frequency (Hz)", font...
Python
1
MajorVersion) -> Self { ClassVersion::new(major, 0) } fn new(major: MajorVersion, minor: u16) -> Self { ClassVersion { major, minor } } } #[allow(non_camel_case_types)] #[repr(u16)] #[derive(Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] pub enum MajorVersion { JDK_1_1 = 45, JDK_1_2 = 46, JDK_1_3...
Rust
0
static INIT_STATE: [u64; 8] = [ 0x6a09e667f3bcc908, 0xbb67ae8584caa73b, 0x3c6ef372fe94f82b, 0xa54ff53a5f1d36f1, 0x510e527fade682d1, 0x9b05688c2b3e6c1f, 0x1f83d9abfb41bd6b, 0x5be0cd19137e2179, ]; static K: [u64; 80] = [ 0x428a2f98d728ae22, 0x7137449123ef65cd, 0xb5c0fbcfec4d3...
Rust
0
''' Crea un programa que pida al usuario que introduzca una cadena de texto. Si la cadena de texto contiene la palabra "fiesta", el programa debe imprimir un mensaje que diga "¡Fiesta, fiesta, fiesta!". Si no la contiene, el programa debe imprimir un mensaje que diga "No hay fiesta sin tí :(" ''' entrada = input("¿Qu...
Python
1
"metric": "AUROC", "auroc": auroc, "f_coreset": model.patchcore.f_coreset, "f_reweighting": model.patchcore.f_reweighting, "device": DEVICE, "train_samples": len(train_dataset), "test_samples": len(test_dataset) } with open(RESULTS_FILE_PATH, 'w') as f: ...
Python
1
g_update while self._cache: if next_msg <= time.monotonic(): logger.debug('%r is running after closing for %.1f seconds', self, time.monotonic() - start_time) next_msg = time.monotonic() + msg_update # handle a few events, or ...
Python
1
T)); assert_eq!(from_str::<$T>(""), None); assert_eq!(from_str::<$T>(" "), None); assert_eq!(from_str::<$T>("x"), None); } #[test] pub fn test_parse_bytes() { assert_eq!(FromStrRadix::from_str_radix("123", 10), Ok(123 as $T)); assert_eq!(FromStrRadix::from_str_radix...
Rust
0
te, end_date=last_date) for idx, row in price_data.iterrows(): try: component = self.clean_index_components(data_symbol=row['ts_code'], date=date,hs_300 =hs_300,zz_500 = zz_500,zz_1000 = zz_1000) price_data.at[idx, 'index_component'] = component ...
Python
1
backbone: Union[bool, str] = False, pretrained_path_backbone: str = None, ) -> YoloV3: """ Yolo-V3 model with standard DarkNet-53 backbone; expected input shape is (B, 3, 300, 300) :param num_classes: the number of classes of objects to classify :param pretrained_backbone: True to load pretrain...
Python
1
ed25519(); let peer_id = PeerId::from_public_key(&keypair.public()); let keys_location = fresh::location(); match stronghold .write_p2p_keypair(keypair, keys_location.clone(), fresh::record_hint()) .await .unwrap() { Ok(()) => {} Err(e) => panic!("Unexpected error...
Rust
0
import spotipy from dotenv import load_dotenv load_dotenv() import numpy as np from spotipy.oauth2 import SpotifyOAuth import os sp = spotipy.Spotify( auth_manager=SpotifyOAuth( client_id=os.getenv("SPOTIPY_CLIENT_ID"), client_secret=os.getenv("SPOTIPY_CLIENT_SECRET"), redirect_uri=os.get...
Python
1
un = T::Fun(x.clone(), Box::new(fx.clone()), Box::new(f.clone())); // Γ ⊢ (x:fx → f) c.push_back((ffun_env.clone(), C::WellFormed(Box::new(fx)))); c.push_back((ffun_env.clone(), C::WellFormed(Box::new(ffun.clone())))); // Γ,x:fx ⊢ (fe <: f) c.push_back((ffun_e...
Rust
0
new_test_ext().execute_with(|| { run_to_block(10); let _ = Balances::deposit_creating(&1, 10); assert_ok!(Kitties::create(Origin::signed(1))); assert_eq!( last_event(), TestEvent::kitties_event(Event::<Test>::Created(1u64 , 0)), ); }) } // 测试转让 Kit...
Rust
0
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.bitable.v1 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:...
Python
1
a, 'hir> { fn with_hir_id_owner( &mut self, owner: NodeId, f: impl FnOnce(&mut Self) -> hir::OwnerNode<'hir>, ) { let def_id = self.resolver.local_def_id(owner); let current_attrs = std::mem::take(&mut self.attrs); let current_bodies = std::mem::take(&mut self.bo...
Rust
0
upstream_shas = [c.sha for c in upstream_commits] logging.info("Commits in upstream PR:\n %s", ", ".join(upstream_shas)) sync_shas = [c.sha for c in sync_commits] logging.info("Commits in sync PR:\n %s", ", ".join(sync_shas)) # find latest synced commit, search from the latest ...
Python
1
_shape model.fit(X_train, y_train) y_samples = model.sample_y(X_test, n_samples=n_samples_y_test) assert y_samples.shape == y_test_shape @pytest.mark.parametrize("n_targets", [None, 1, 2, 3]) @pytest.mark.parametrize("n_samples", [1, 5]) def test_sample_y_shape_with_prior(n_targets, n_samples): """C...
Python
1
from typing import List class Solution: def findDifferentBinaryString(self, nums: List[str]) -> str: n = len(nums[0]) # Use a set to store given binary strings for quick lookup nums_set = set(nums) # Generate all possible binary strings of length n def gene...
Python
1
pub fn bit(&self) -> bool { match *self { SPOR::HIGH => true, SPOR::LOW => false, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value: bool) -> SPOR { match value { true => SPOR::HIGH, false => SPOR::LOW, ...
Rust
0
-0.260644, -0.289084, 0.075957, -0.225658, 0.008481, -0.055900, -0.234515, -0.143956, -0.154073, -0.039008, -0.312512, -0.354529, -0.360536, -0.456903, 0.069810, -0.112713, -0.276092, ...
Python
1
# Ref: https://prjunnamed.github.io/prjcombine/xc9500/jtag.html from ...support.bits import * from ...support.bitstruct import * __all__ = [ # IR "IR_EXTEST", "IR_SAMPLE", "IR_INTEST", "IR_ISPEN", "IR_FPGM", "IR_FPGMI", "IR_FERASE", "IR_FBULK", "IR_FVFY", "IR_FVFYI", "IR_ISPEX", "IR_HIGHZ", "IR_USERC...
Python
1
device_operating_mode(&dsn, shark::OperatingMode::Return) .await { Ok(_) => Ok(HttpResponseAccepted(())), Err(e) => Err(HttpError::for_internal_error(e.to_string())), } } pub fn mount(api: &mut ApiDescription<AppCtx>) { api.register(get_devices) .expect("failed to register g...
Rust
0
_(self) -> "Iterator[Morsel[str]]": while False: yield None # type: ignore[unreachable] def __len__(self) -> int: return 0 @property def quote_cookie(self) -> bool: return True def clear(self, predicate: ClearCookiePredicate | None = None) -> None: pass ...
Python
1
(*egl).wl_display = local_display; return 1i32 != 0 } return 0i32 != 0; } #[no_mangle] pub unsafe extern "C" fn wlr_egl_destroy_image(mut egl: *mut wlr_egl, mut image: EGLImage) -> bool { if !(*egl).exts.image_base_khr { return 0i32 != 0 } if ...
Rust
0
def binary_search(ara, left, right, target): if left > right: return -1 while left <= right: mid = (left + right) // 2 if ara[mid] == target: return mid if ara[mid] < target: left = mid + 1 else: right = mid - 1 return -1 # not fo...
Python
1
def minimum_partition(nums): """ 将数组划分为两组,使得两组和的差最小 :param nums: List[int],输入数组 :return: int,两组和的最小差值 """ if not nums: return 0 total = sum(nums) target = total // 2 # 尽量接近总和的一半 # dp[i][j] 表示前i个数能否组成和j n = len(nums) dp = [False] * (target + 1) dp[0]...
Python
1
en time. #[derive(Debug)] pub enum XWaylandEvent { /// The XWayland server is ready Ready { /// Privileged X11 connection to XWayland connection: UnixStream, /// Wayland client representing XWayland client: Client, }, /// The XWayland server exited Exited, } impl<Dat...
Rust
0
=> ["alice"], "friend" => ["bob"]); assert_headers!("friend" => ["alice"], "friend" => ["bob"], "friend" => ["carol"]); assert_headers!("friend" => ["alice"], "friend" => ["bob"], "enemy" => ["carol"]); } extern crate nix; use nix::unistd::{fork,ForkResult}; use std::{thread,time}; use std::process; fn main()...
Rust
0
cliparam_source_path, cliparam_destination_path) for param in bool_params: if param: sysargv.append(param) for param in value_params: if param: sysargv.append(param) sysargv.append("/path/to") if cliparam_no_templater: sysargv.append(cliparam...
Python
1
_string()); })); monitor.handle_packet("0123456789ABCDEF\tdevice\nFEDCBA9876543210\tdevice\n"); monitor.handle_packet("0123456789ABCDEF\tdevice\n"); monitor.handle_packet("0123456789ABCDEF\tdevice\nFEDCBA9876543210\tdevice\n"); let vec = serials.borrow(); assert_eq!(3, v...
Rust
0
import pytest from .test_utils import * from zillion.core import * from zillion.datasource import * def test_mysql_datasource(mysql_wh): metrics = ["cost", "clicks", "transactions"] dimensions = ["partner_name"] result = mysql_wh.execute(metrics, dimensions=dimensions) assert result info(result.d...
Python
1
nore row = await session.execute( Videos.__table__.select().where(Videos.video_hash == video_hash) # type: ignore ) existing = row.first() if existing and existing[Videos.description] and existing[Videos.vlm_process...
Python
1
(0x1fff)), (0x8000, Literal(0x0000)), (0xffff, Literal(0x7fff)), (0x6000, ALU(AluAttributes { opcode: OpT, r2pc: false, t2n: false, t2r: false, n2_at_t: false, r_dir: 0, d_dir: 0 })), (0x6100, ALU(AluAttributes { opcode: OpN, r2pc: false, t2n: false, t2r: false, n2_at_t: ...
Rust
0
default, skip_serializing_if = "Option::is_none")] pub device_password: Option<String>, } impl DataBoxHeavyJobDetails { pub fn new(job_details: JobDetails) -> Self { Self { job_details, copy_progress: Vec::new(), device_password: None, } } } #[doc = "The ...
Rust
0
inpainted_ground, filling_mask, Image.fromarray(ground_depth), "the ground", )[0] return complete_ground_controlled def complete_segments(image, depth_map, skybox, ground, objects): """ Process the image parts. - Sky: Reshape image size, inpaint holes. - Ground: In...
Python
1
alue(&mut cx) as usize; let x = cx.argument::<JsNumber>(2)?.value(&mut cx) as u8; let lock = cx.lock(); b.try_borrow_mut(&lock) .map(|mut slice| slice[i] = x) .or_throw(&mut cx)?; Ok(cx.undefined()) } pub fn write_buffer_with_borrow_mut(mut cx: FunctionContext) -> JsResult<JsUndefined...
Rust
0
"""multiple inheritance occurs when a class inherits from more than one parent class.""" class Parent1: def method1(self): print("Method from Parent1") class parent2: def method2(self): print("Method from Parent2") class Child(Parent1,parent2): def method3(self): print("Method fro...
Python
1
m_hdr.mh_next = (*sp).data; /* Steal off the mbuf */ (*sp).data = 0 as *mut mbuf; /* * For this case, we check the actual socket buffer, since the assoc * is going away we don't want to overfill the socket buffer for a * non-reader */ if ((if (if (*(*stcb).sctp_socket).so_rcv.sb_hiwa...
Rust
0
"""Checks if the matrix is a Hermitian matrix.""" import numpy as np from toqito.matrix_props import is_square def is_hermitian(mat: np.ndarray, rtol: float = 1e-05, atol: float = 1e-08) -> bool: r"""Check if matrix is Hermitian :footcite:`WikiHerm`. A Hermitian matrix is a complex square matrix that is eq...
Python
1
INT0::TOC; pub use super::OTG_HS_DIEPINT0::TXFE; pub use super::OTG_HS_DIEPINT0::TXFIFOUDRN; pub use super::OTG_HS_DIEPINT0::XFRC; } /// OTG device endpoint-2 interrupt register pub mod OTG_HS_DIEPINT2 { pub use super::OTG_HS_DIEPINT0::BERR; pub use super::OTG_HS_DIEPINT0::BNA; pub use super::O...
Rust
0
let rgba = RGBA { red: 255, green: 0, blue: 0, alpha: 0, }; assert_eq!(rgba.as_css_hex(), "#FF000000"); let rgba = RGBA { red: 128, green: 64, blue: 192, alpha: 192, }; assert_eq!(rgb...
Rust
0
}; use anyhow::{anyhow, Context}; use std::env; use std::path::Path; use std::str::FromStr; use std::time::Duration; const DEFAULT_INTERVAL: &'static str = "10m"; pub trait FromEnv: Sized { fn from_env() -> Result<Self>; } pub trait SelfValidation: Sized { fn validate(&self) -> Result<()>; } #[derive(Clone,...
Rust
0
width_input, "height" => height_input, }); let result = plugin.transform(&data); assert!(result.is_ok()); let result = result.unwrap(); let rgb_data = result.rgb; assert!(rgb_data.len() == 68); for x in 0..width_input { let rgb_in = out_copy[x]; let rgb_out = r...
Rust
0
assert self.api is not None async with self.api as api: yield api async def create_remnawave_user( self, db: AsyncSession, subscription: Subscription, *, reset_traffic: bool = False, reset_reason: Optional[str] = None, ) -> Optional[R...
Python
1
Block { fn serialize(&self) -> Vec<u8> { ControlBlock::serialize(&self) } } impl Deserialize for ControlBlock { fn deserialize(bytes: &[u8]) -> Result<Self, encode::Error> { Self::from_slice(bytes) .map_err(|_| encode::Error::ParseFailed("Invalid control block")) } } // Ver...
Rust
0
adcast_static(output_shape) return output_shape def _inverse_event_shape_tensor(self, output_shape): if isinstance(self.scale, tf.linalg.LinearOperatorBlockLowerTriangular): return _cumulative_broadcast_dynamic(output_shape) return output_shape def _cumulative_broadcast_static(event_shape): bro...
Python
1
stLoader().loadTestsFromTestCase(CellTestCase) rot_suite = unittest.TestLoader().loadTestsFromTestCase(RotateMolTestCase) move_suite = unittest.TestLoader().loadTestsFromTestCase(\ AtomsMovedTestCase) check_suite = unittest.TestLoader().loadTestsFromTestCase(\ CheckCellsTestCase) ...
Python
1
# coding: utf-8 __author__ = 'ila' import re import sqlparse class ConvertMySQLToHive(object): def __init__(self, db_name): self.hive_datatype_mapping = { "int": "int", "integer": "int", "bigint": "int", "smallint": "int", "tinyint": "int", ...
Python
1
n /// until runtime. #[derive(Clone)] pub struct Frame { pub(crate) inner: FrameImp, } impl Frame { /// Returns the current instruction pointer of this frame. /// /// This is normally the next instruction to execute in the frame, but not /// all implementations list this with 100% accuracy (but it'...
Rust
0
= [] self.indent = "" def push_tag(self, tag: str): if len(self.open_tags) > 16: return self.open_tags.append(tag) if tag not in NO_INDENT_TAGS: self.indent += " " * INDENT def pop_tag(self, tag: str): if tag in self.open_tags: remove...
Python
1
import os import time from dotenv import load_dotenv from openai import OpenAI client = OpenAI() OpenAI.api_key = os.getenv('OPENAI_API_KEY') from rich.console import Console console = Console() # Load environment variables from .env load_dotenv() # Existing file and assistant information # Get file and assistant IDs...
Python
1
oU32::new(value).unwrap(), tokens); // from signed test(1, &[Token::I8(1)]); test(1, &[Token::I16(1)]); test(1, &[Token::I32(1)]); test(1, &[Token::I64(1)]); test(127, &[Token::I8(127)]); test(32767, &[Token::I16(32767)]); test(2147483647, &[Token::I32(2147483647)]); test(4294967295...
Rust
0
riangle(&mut self.edges[q0_idx], t0_idx, t0a_idx); replace_opposing_vertex(&mut self.edges[q0_idx], k1, pidx); replace_adjacent_triangle(&mut self.edges[q1_idx], t0_idx, t0b_idx); replace_opposing_vertex(&mut self.edges[q1_idx], k0, pidx); replace_adjacent_triangle(&mut self.ed...
Rust
0
n = 10000 # 这里可以自己改 par = [i for i in range(n + 1)] # 初始化 def find_father(x): # 并查集查找函数 if par[x] == x: return x par[x] = find_father(par[x]) # 路径压缩 return par[x] def unite(x: int, y: int): # 并查集组合函数 fx = find_father(x) fy = find_father(y) if fx == fy: return else: ...
Python
1
")); // >>>>>>> Class fields for the "Array" primitive type to be added after this line _self.bind_non_static_method("index_of", (1, 1), index_of as NativeBoundMethod); _self.bind_non_static_method("len", (0, 0), len as NativeBoundMethod); _self.bind_non_static_method("pop", (0, 0), pop as Nati...
Rust
0
!( nothing.ne(Span::test_data(), &value), Ok(Value::Bool { val: true, .. }) )); } } use crate::types::foo; pub fn other() { println!("other"); foo(); } <reponame>AngryLawyer/uo-data-viewer use ggez::graphics::Image; use ggez::Context; use image::{Frame, RgbaImage}; pub fn ...
Rust
0
lementation of PCG pub struct DefaultMultiplier; macro_rules! make_default_mul { ( $( $t:ty => $e:expr);* ) => { $( impl Multiplier<$t> for DefaultMultiplier { #[inline] fn multiplier() -> $t { $e } })* } } make_default_mul!( u8 => 141u8; u16 => 12829u16; u32 => 747_796_405u32; u6...
Rust
0
0xff, 0xff] ); assert_parser_ok!( parse_bitmap(b"BITMAP\nffffffff\naaaaaaaa\nENDCHAR"), vec![0xff, 0xff, 0xff, 0xff, 0xaa, 0xaa, 0xaa, 0xaa] ); assert_parser_ok!( parse_bitmap(b"BITMAP\nff\nff\nff\nff\naa\naa\naa\naa\nENDCHAR"), vec![0xff,...
Rust
0
# import pandas as pd # import os # import random # # Read the CSV files # detections_df = pd.read_csv('labels/detections.csv') # classifications_df = pd.read_csv('labels/classifications.csv') # metadata_df = pd.read_csv('./metadata/image_ids.csv') # classes_df = pd.read_csv('./metadata/classes.csv', header=None, name...
Python
1
# -*- coding: utf-8 -*- ######################################################################### ## This is a samples controller ######################################################################### def editable(): """ example action using the internationalization operator T and flash rendered by vi...
Python
1
_RELATIVE = 1 << D3DSHADER_ADDRESSMODE_SHIFT, }} pub const D3DVS_SWIZZLE_SHIFT: ::DWORD = 16; pub const D3DVS_SWIZZLE_MASK: ::DWORD = 0x00FF0000; pub const D3DVS_X_X: ::DWORD = 0 << D3DVS_SWIZZLE_SHIFT; pub const D3DVS_X_Y: ::DWORD = 1 << D3DVS_SWIZZLE_SHIFT; pub const D3DVS_X_Z: ::DWORD = 2 << D3DVS_SWIZZLE_SHIFT; pub...
Rust
0
to each type constructor. This //! //! Labeled type data is manipulated by reference, the same as with `Ty`s, and the data is stored //! in the same arena as the underlying `Ty`s. use rustc_arena::DroplessArena; use rustc_middle::ty::{Ty, TyKind}; use std::fmt; use std::marker::PhantomData; use crate::type_map; ///...
Rust
0
tls: T, config: ManagerConfig) -> Self where T: MakeTlsConnect<Socket> + Clone + Sync + Send + 'static, T::Stream: Sync + Send, T::TlsConnect: Sync + Send, <T::TlsConnect as TlsConnect<Socket>>::Future: Send, { Self { config, pg_config, ...
Rust
0
"""Tests for the Mopeka integration.""" from homeassistant.helpers.service_info.bluetooth import BluetoothServiceInfo NOT_MOPEKA_SERVICE_INFO = BluetoothServiceInfo( name="Not it", address="aa:bb:cc:dd:ee:ff", rssi=-63, manufacturer_data={3234: b"\x00\x01"}, service_data={}, service_uuids=[],...
Python
1
, 'DiracDelta', 'Heaviside', 'bspline_basis', 'bspline_basis_set', 'interpolating_spline', 'besselj', 'bessely', 'besseli', 'besselk', 'hankel1', 'hankel2', 'jn', 'yn', 'jn_zeros', 'hn1', 'hn2', 'airyai', 'airybi', 'airyaiprime', 'airybiprime', 'marcumq', 'hyper', 'meijerg', 'appellf1', ...
Python
1
#!/usr/bin/env python """ Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/) See the file 'LICENSE' for copying permission """ import re from lib.core.common import Backend from lib.core.convert import getBytes from lib.core.data import conf from lib.core.enums import DBMS from lib.core.exception import...
Python
1
we don't parse the value, just pass it on to `cargo metadata` blindly pub features: Option<String>, pub target: Option<String>, pub manifest_path: Option<PathBuf>, } fn metadata_command(args: MetadataArgs) -> MetadataCommand { let mut command = MetadataCommand::new(); if args.all_features { ...
Rust
0
, } extern crate mmu; use mmu::{hardware, address}; fn main() { // create memory model let mm = hardware::Memory::new(2, 12, 14); // TLB with 4 sets, 4 lines/set let tlb = hardware::TLB::new(4, 4); // dummy virtual addr let va: u64 = 13; // get the vpo let vpo = address::po(&mm, &va); ...
Rust
0
{ fn from(v: Vec<u32>) -> Self { VectorClock(v) } } impl PartialOrd for VectorClock { fn partial_cmp(&self, rhs: &Self) -> Option<Ordering> { let mut expected_ordering = Ordering::Equal; for i in 0..max(self.0.len(), rhs.0.len()) { let ordering = { let l...
Rust
0
import os import json import sys import argparse import pandas as pd PROJECT_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, PROJECT_PATH) def parse_args(): parser = argparse.ArgumentParser() parser.add_argument("-hc", "--hypercategory_mapping", required=True, type=str,...
Python
1
"messages": [ { "role": "user", "content": [ { "type": "text", "text": prompt }, ...
Python
1
SocketDisconnect: logger.info(f"WebSocket客户端断开连接: task_id={task_id}") break except Exception as e: logger.error(f"WebSocket接收消息错误: task_id={task_id}, error={str(e)}") break except Exception as e: logger.error(f"WebSocket错误: task_id=...
Python
1
# Пользователь вводит целое число. Выведите его строку-описание вида "отрицательное четное число", "нулевое число", "положительное нечетное число", # например, численным описанием числа 190 является строка "положительное четное число". Если число не является четным - выведите сообщение "число не является четным" prin...
Python
1
distance_to = np.sqrt(np.min(qs)) return closest_segment, distance_to def getForce(self, point): segments = np.concatenate([self.shelf_lines, self.wall_lines], 0) # Dims: 0=line; 1=start/end; 2=x/y segments = np.array([segments[:, :-1, :], segments[:...
Python
1
urce/target nodes do not exist. Cytoscape will otherwise throw and refuse to load the entire batch. """ with self._lock: nodes_list = list(self._nodes.values()) node_ids = set(self._nodes.keys()) valid_edges: List[Dict[str, Any]] = [] for edge in ...
Python
1
is_ssh_connection(&context) || is_root || config.show_always { let parsed = StringFormatter::new(config.format).and_then(|formatter| { formatter .map_style(|variable| match variable { "style" => { let module_style = if is_root { ...
Rust
0
_base_ = "../base/1x_setting.py" fp16 = dict(loss_scale=512.) model = dict( type='AutoAssign', backbone=dict( type='ResNet', depth=50, num_stages=4, out_indices=(0, 1, 2, 3), frozen_stages=1, norm_cfg=dict(type='BN', requires_grad=False), norm_eval=True, ...
Python
1
As given for cc-pVQZ in Table 6 of [1] assert fundamental == pytest.approx(4162.1, abs=6e-2) assert _1stovertone == pytest.approx(8089.5, abs=7e-2) """ energies_kcal = energies * AU2KCALPERMOL w_kcal = w * AU2KCALPERMOL xs_ang = xs / ANG2BOHR scale = 2.0 # Compare figure to Fig. (3) i...
Python
1
h sequence end (last position with mask == 1) history_idx = history_idx.transpose(1, 0).contiguous() history_idx.scatter_(1, seq_ends.view(-1, 1, 1, 1).expand(-1, 1, self.num_tags, nbest), end_tag.view(-1, 1, 1, nbest).expand(-1, 1, self.num_tags, nbest)) history_idx...
Python
1
# Copyright 2019-2020 Jordi Corbilla. 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 by applicable...
Python
1
::DNSKEY(ref dnskey) => { encoder.with_canonical_names(|encoder| dnskey::emit(encoder, dnskey)) } DNSSECRData::NSEC(ref nsec) => { encoder.with_canonical_names(|encoder| nsec::emit(encoder, nsec)) } DNSSECRData::NSEC3(ref nsec3) => { ...
Rust
0
CTA, CW_USEDEFAULT, HHOOK, HOOKPROC, HWND, KBDLLHOOKSTRUCT, LPARAM, MSG, VK_CONTROL, VK_ESCAPE, VK_F12, WINDOW_LONG_PTR_INDEX, WM_CLOSE, WM_DESTROY, WM_NCCREATE, WM_QUIT, WNDCLASSA, WPARAM, WM_KEYUP, WM_SYSKEYUP, }, Windows::Win32::CoreAudio::{ EDataFlow, ERole, IMMDe...
Rust
0
book)?; Ok(book) } /// Returns the list of expired borrowing periods. #[export] fn lending_overdues(&self, _owner: &Node) -> api::Result<VariantArray> { let result = db::lending::overdues(self.get_db()?)?; Ok(VariantArray::from_iter(result.map(|(book, user)| { Varia...
Rust
0
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
xff\xc0\xd2\xc5\x00\x16Z\x9e98\ \x98\x9c\x14\x81\x92\xa4\xa6\xdco\xb2BA\xd8\x1d\xa5\xed\ \x0c\x1a\xe1\xde\x97w\x7f\xd4YU\xf5\xc2\xd9\x81]\xcd\ \xcd\x07_\xcd\x91i\x86`V\x1a\x8d\xb2K\xc5<\xc8\ \x97\x15\xc9Z\x04\xefH\x99\x10\xaci#\x92\x138E\ \xc6\xe39\xd6A\xb0\xf4c\xce}f\xa9w\xd9\x89\xc6\ \xe9\xf6X\x08Vn.`\xa1E)q\x93!v(\ ...
Python
1
ira.plavox.info/blog/2008/06/_c.html for i in 0..n { for j in (i+1)..n { if mat[(i, i)].is_zero() { // cannot create triangular matrix, falling back return (0 .. n) .map(|i| { self[(i, 0)].clo...
Rust
0
def chekcer(x,y): sum = 0 for i in range(x,y+1): if i % 2 == 0 and i % 3 == 0 and i % 4 != 0: print(i) sum += i return sum print(chekcer(1,20))
Python
1
er + 2.4, key["ddm_min"], color = "cyan", hatch = patterns[2], label = "Min Concept Change (Frontier Drift) (DDM)", ec = "black")) else: # plt.bar(center - 2.4, key["eddm_max"], color = "springgreen", hatch = patterns[0] ,label = "Max Concept Change (Frontier Drift) (EDDM)", ec = "black") ...
Python
1
if (slf.pattern.0.is_some() && *slf.pattern.0.as_ref().unwrap() != t.0) || (slf.pattern.1.is_some() && *slf.pattern.1.as_ref().unwrap() != t.1) || (slf.pattern.2.is_some() && *slf.pattern.2.as_ref().unwrap() != t.2) { conti...
Rust
0
pub(crate) struct TimeNonce { time: DateTime<Utc>, } impl TimeNonce { pub fn new() -> Self { Self { time: Utc::now() } } } impl From<DateTime<Utc>> for TimeNonce { fn from(time: DateTime<Utc>) -> Self { Self { time } } } impl Default for TimeNonce { fn default() -> Self { ...
Rust
0
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init class FlexibleRule(object): _types = { "flexible_early_minutes": int, "flexible_late_minutes": int, } def __init__(self, d=None): ...
Python
1
ation.set_completed_cb(rocket_completed_cb) rocket.animation.set_delay(random.randint(0, 2000)) rocket.animation.set_duration(random.randint(1200, 2400)) rocket.animation.set_values(0, 100) rocket.animation.set_path_cb(lv.anim_path_ease_out) rocket.animation.s...
Python
1
(e.g. '12345678')") if acnt_prdt_cd == "": raise ValueError("acnt_prdt_cd is required (e.g. '01')") if rsvn_ord_rcit_dt == "": raise ValueError("rsvn_ord_rcit_dt is required") if ovrs_rsvn_odno == "": raise ValueError("ovrs_rsvn_odno is required") # tr_id 설정 if env_dv ==...
Python
1
et event5_rc2 = event5_rc1.clone(); let handle5 = notifier.register(move |e: &u32| { *event5_rc2.write().unwrap() = *e; }); assert_eq!(*event5_rc1.read().unwrap(), 0); notifier.notify(999); assert_eq!(*event1_rc1.read().unwrap(), 69); assert_eq!(*event2_rc1.read().unwrap(), 4711); a...
Rust
0
ia_async as fasync, fuchsia_pkg_testing::{pkgfs::TestPkgFs, PackageBuilder}, std::io::{Read, Write}, }; fn ls_simple(d: openat::DirIter) -> Result<Vec<String>, Error> { Ok(d.map(|i| i.map(|entry| entry.file_name().to_string_lossy().into())) .collect::<Result<Vec<_>, _>>()?) } #[fasync::run_singlet...
Rust
0
from fastapi import APIRouter, Depends, HTTPException from fastapi.responses import StreamingResponse from typing import Optional from datetime import datetime, timedelta import io from .... import schemas from ....core.supabase import supabase from ....services.export_service import export_service from ...deps import...
Python
1
ath, meta.len()); } } } mem::forget(watcher); Ok(FsLogSource { sizes, receiver }) } fn map_write_event(&mut self, path: PathBuf) -> Result<FsEvent, Error> { let mut old_size = self.sizes.get(&path).cloned().unwrap_or(0); let meta = path.metad...
Rust
0