text
string
label_name
string
labels
int64
unwind_on: Option<String>, ) -> HashSet<String> { let stream = Deserializer::from_reader(&mut rdr) .into_iter::<Value>() .flat_map(|item| preprocess(item.unwrap(), flatten, &unwind_on)); let mut headers = HashSet::new(); for item in stream { for key in item.as_object().unwrap().k...
Rust
0
end: Span, msg: &str) -> Self { Error { begin, end, msg: msg.to_owned(), } } pub fn new2_owned(begin: Span, end: Span, msg: String) -> Self { Error { begin, end, msg } } pub fn to_compile_error(&self) -> TokenStream { // compile_erro...
Rust
0
ode_num), SUCCESS.message); } #[test] fn test_no_endpoint_error(){ assert_eq!(error_message(&NO_ENDPOINT.code_num), NO_ENDPOINT.message); } #[test] fn test_invalid_option_error(){ assert_eq!(error_message(&INVALID_OPTION.code_num), INVALID_OPTION.message); } #[test] ...
Rust
0
, {}) if isinstance(swing_high, (int, float)) and isinstance( swing_low, (int, float) ): position_info = "" if isinstance(current_position, dict): ...
Python
1
_words .iter() .skip(1) .map(Deref::deref) .collect::<Vec<&str>>() .join(" "); tags.insert(tag_name, tag_value); } SETTINGS_NAME => { ...
Rust
0
size: 0, blk_size: 0, blocks: 0, atime: Timespec { sec: 0, nsec: 0 }, mtime: Timespec { sec: 0, nsec: 0 }, ctime: Timespec { sec: 0, nsec: 0 }, type_: FileType::CharDevice, mode: 0o660, nlinks: 1, uid: 0, ...
Rust
0
} s.push(self.consume_char()?); } if s.is_empty() { Err( match self.error_level { OwsqlErrorLevel::AlwaysOk | OwsqlErrorLevel::Release => OwsqlError::AnyError, OwsqlErrorLevel::Develop => OwsqlError::Message("error: consume...
Rust
0
", fields, file_descriptor_proto() ) }) } } } impl ::protobuf::Clear for ReceivedDeletedBlockInfoProto { fn clear(&mut self) { self.clear_block(); self.clear_status(); self.clear_deleteHint(); self.unkno...
Rust
0
continue; } let last_char = chars_stack .last() .expect("cannot accesss the last char in `chars_stack`"); if last_char == &'\\' { chars_stack.push(ch); ...
Rust
0
many0(map(alt((tag("./"), tag("../"))), PathPart::Part)), separated_list1(tag("."), map(identifier, PathPart::Part)), )), |(span, (mut first, mut second))| { first.append(&mut second); Expression::Path { span, path: first } }, )(input) } fn ne...
Rust
0
# coding: utf-8 """ Klarna Checkout API V3 The checkout API is used to create a checkout with Klarna and update the checkout order during the purchase. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement).\\n\...
Python
1
2; if target_spans[m].0 >= r { ok = m; } else { ng = m; } } if ok > 0 && target_spans[ok - 1].1 == r { Ok(ok) } else { Err(ok) } } }; (...
Rust
0
_input_xi_get_client_pointer_reply`]. /// /// [`discard_reply`]: crate::Xcb::xcb_discard_reply /// [`xcb_input_xi_get_client_pointer_reply`]: Self::xcb_input_xi_get_client_pointer_reply #[inline] pub unsafe fn xcb_input_xi_get_client_pointer( &self, c: *mut xcb_connection_t, ...
Rust
0
aidu_queue.get() @retry(stop_max_attempt_number=5) def sent_ocr(): nonlocal lay_sw try: if lay_sw: time.sleep(random.uniform(1.5, 2.05)) ocr_result = client.basicGeneral(part) return ocr_result excep...
Python
1
"""Module to implement something.""" from typing import Optional from .expansions import ExpansionFailedError from .uritemplate import ExpansionInvalidError, ExpansionReservedError, URITemplate from .variable import Variable, VariableInvalidError __all__ = [ 'URITemplate', 'Variable', 'ExpansionInvalidError...
Python
1
#!/usr/bin/env python import os import sys if __name__ == '__main__': os.environ.setdefault('SERVER_SETTINGS_MODULE', 'mysite.settings') try: from server.core.management import execute_from_command_line except ImportError as exc: raise ImportError( "Couldn't import Server. Are y...
Python
1
from django.contrib import admin from django.contrib.auth.admin import UserAdmin as BaseUserAdmin from .models import User @admin.register(User) class UserAdmin(BaseUserAdmin): model = User list_display = ('username', 'email', 'is_teacher', 'is_staff', 'is_active', 'created_at') list_filter = ('is_teacher...
Python
1
import os import pickle import tkinter as tk from tkinter import messagebox import face_recognition from anti_spoofing.test import test def get_button(window, text, color, command, fg='white'): button = tk.Button( window, text=text, activeba...
Python
1
alse) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bit(self, value: bool) -> &'a mut W { self.w.bits = (self.w.bits & !0x01) | (value as u32 & 0x01); self.w } } #[doc = "Type of memory that burst is carried out on\n\nValue on reset: 0"] #[derive(Clone, Copy, De...
Rust
0
import re from vint.ast.node_type import NodeType from vint.linting.level import Level from vint.linting.policy.abstract_policy import AbstractPolicy from vint.linting.policy_registry import register_policy from vint.ast.dictionary.autocmd_events import AutoCmdEvents @register_policy class ProhibitAutocmdWithNoGroup(...
Python
1
cket.SOCK_STREAM) as s: s.bind(('localhost', port)) return True except OSError: return False async def _start_subprocess(self, port: int) -> HubProcess: """ 通过子进程启动Hub服务器 Args: port: 端口号 Return...
Python
1
"Outbound, Outbound 2" assert state.attributes["upcoming"] == "0, 1, 2, 3" @pytest.mark.parametrize( "client_exception", ( NextBusHTTPError("failed", HTTPError("url", 500, "error", MagicMock(), None)), NextBusFormatError("failed"), ), ) async def test_prediction_exceptions( hass: H...
Python
1
from pyrogram.types import InlineKeyboardButton class Data: generate_single_button = [InlineKeyboardButton("- ابـدا بأستخراج كـود .", callback_data="generate")] home_buttons = [ generate_single_button, [InlineKeyboardButton(text="رجوع", callback_data="home")] ] generate_button = [gen...
Python
1
eration. on return: - :dfn:`exp_mod` problem instance - :dfn:`exp_sim` solver instance """ exp_mod = Extended_Problem() #Create the problem exp_sim = ExplicitEuler(exp_mod) #Create the solver exp_sim.verbosity = 0 exp_sim.report_continuously = True ...
Python
1
ul(u)) } #[no_mangle] pub extern "C" fn alloc() -> *mut u8 { let mut plain_old_memory = Vec::with_capacity(CANVAS_SIZE); let ptr = plain_old_memory.as_mut_ptr(); mem::forget(ptr); ptr } #[no_mangle] pub extern "C" fn paint(buf: *mut u8, width: usize, height: usize) { let canvas = unsafe { std::s...
Rust
0
::fbthrift::Serialize<P> for has_bitwise_ops where P: ::fbthrift::ProtocolWriter, { #[inline] fn write(&self, p: &mut P) { p.write_i32(self.into()) } } impl<P> ::fbthrift::Deserialize<P> for has_bitwise_ops where P: ::fbthrift::ProtocolReader, ...
Rust
0
unwrap(); // Send the response /// /// let message = WebSocketMessage::Text("Hello, client!".to_string()); /// let _ = client.send_message(message); /// /// // ... /// }); ///} /// # } /// ``` ///#Custom implementations /// Rust-WebSocket allows you to use any (sendable) Reader a...
Rust
0
.. }) => { if name.local_name.eq_ignore_ascii_case("flame") { let flame = flame::parse_flame(&mut reader, extract_attributes(attributes)); trace!("{:?}", flame); result.push(flame); } } Ok(XmlEvent::EndD...
Rust
0
test_canonical_json!(0.000001, "1E-6"); test_canonical_json!(5.6, "5.6E0"); test_canonical_json!(0.00000099, "9.9E-7"); test_canonical_json!(0.0000001, "1E-7"); test_canonical_json!(0.000000930258908, "9.30258908E-7"); test_canonical_json!(0.00000000000068272, "6.8272E-1...
Rust
0
s of 0 were not visible. # They will be excluded from value updates used in the splitting criteria. return {"render": rendered_image, "depth": depth, "alpha": alpha, "rendered_normal": rendered_normal, "rendered_albedo": rendered_albedo, "rendered_meta...
Python
1
import os import platform import subprocess import tkinter as tk from tkinter import filedialog, messagebox from extract_robinhood_trades import extract_trades from fill_form_8949 import fill_form def open_file(file_path): """Open a file using the default program, depending on the OS.""" try: system = ...
Python
1
int(0.5+roi2[4]-roi2[2]) # resize masks mask = F.interpolate(mask.unsqueeze(0), size=(h,w), mode = 'bilinear')>0.5*self.num_stages # w, h = mask[0,0,:,:].shape # w, h = masks_out[i, 0, int(roi2[2]):int(roi2[2])+w , int(roi2[1]):int(roi2[1])+h].shape masks_ou...
Python
1
())) } fn setup_logger(log_level: log::LevelFilter) -> Result<(), fern::InitError> { let dispatcher = fern::Dispatch::new() .format(|out, message, record| { out.finish(format_args!( "{}[{}][{}] {}", chrono::Local::now().format("[%Y-%m-%d][%H:%M:%S]"), ...
Rust
0
onst __WASI_SOCK_OPTION_TTL: __wasi_sockoption_t = 23; pub const __WASI_SOCK_OPTION_MULTICAST_TTL_V4: __wasi_sockoption_t = 24; pub const __WASI_SOCK_OPTION_TYPE: __wasi_sockoption_t = 25; pub const __WASI_SOCK_OPTION_PROTO: __wasi_sockoption_t = 26; pub type __wasi_streamsecurity_t = u8; pub const __WASI_STREAM_SECUR...
Rust
0
) .unwrap_or_else(|| unreachable!()), true, ), false => match value < START { true => ( Self::new(END - ((START - value) as u32 % Self::RANGE_SPAN) as i32) ...
Rust
0
iew_out_counts: continue elif not self.view_in_counts: labels_dict[str.capitalize(key)] = f"OUT {value['OUT']}" elif not self.view_out_counts: labels_dict[str.capitalize(key)] = f"IN {value['IN']}" ...
Python
1
from PIL import Image import struct import ctypes img = Image.open('./image.png') (w, h) = img.size[0:2] pix = img.load() buff = ctypes.create_string_buffer(4 * w * h) offset = 0 for j in range(h): for i in range(w): r = bytes((pix[i, j][0],)) g = bytes((pix[i, j][1],)) b = bytes((pix[i, j]...
Python
1
from .base_settings import * from .cors_settings import * from .database_settings import * from .dj_rest_auth_settings import * from .drf_settings import * from .drf_spectacular_settings import * from .email_settings import * from .fcm_django_settings import * from .language_settings import * from .payment_settings imp...
Python
1
_SYSCALL_MASK), msr_entry_default(MSR_LSTAR), // end of x86_64 specific code msr_entry_default(MSR_IA32_TSC), kvm_msr_entry { index: MSR_IA32_MISC_ENABLE, data: u64::from(MSR_IA32_MISC_ENABLE_FAST_STRING), ..Default::default() }, ]; Ms...
Rust
0
InnerBatchArray<Idx, T> where Idx: ArrayIndex, T: Copy { type Shape = (usize, Idx); fn shape(&self) -> (usize, Idx) { (self.batch_sz, self.size.clone()) } } impl<Idx, T> Array for GPUDeviceInnerBatchArray<Idx, T> where Idx: ArrayIndex, T: Copy { type Idx = Idx; fn size(&self) -> Idx { self.size.clo...
Rust
0
import logging from qiskit import IBMQ, QuantumCircuit, transpile from dragonfly import DragonflyAlgorithm from zokrates_pycrypto import generate_post_quantum_proof from typing import List, Tuple, Any class QuantumSwarmConsensus: def __init__(self, quantum_provider: str): IBMQ.load_account() self.b...
Python
1
Ok(()) } } pub fn main() -> Result<(), Box<dyn Error>> { let param = Param::build(arg_matches()); let state = if param.fullscreen { State::fullscreen(TITLE)? } else { State::windowed(TITLE, param.width, param.height)? }; // TODO modulate frames by frame rate, these assum...
Rust
0
import cv2 import numpy as np from ultralytics import YOLO from io import BytesIO from my_logging_script import log_to_json current_file_name = "features/detections/fullcarexistence.py" # Define model paths model_path_windshield = './models/frontwindshield/front-windshield-best.pt' model_path_wheels = "./models/wheels...
Python
1
)], ]) def testSparseFeatures(self): self._testRoundTrip([ example(features=features({"st_c": float_feature([3, 4])})), example(features=features({"st_c": float_feature([])})), example(features=features({"st_d": feature()})), example(features=features({"st_c": float_feature([1...
Python
1
have to specify your API-key using the `key` parameter (see the `param()` /// function for details). /// /// Usually there is more than one suitable scope to authorize an operation, some of which may /// encompass more rights than others. For example, for listing resources, a *read-only* scope will be ...
Rust
0
files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'gumpy.tex', 'gumpy Documentation', 'the gympy developers', 'manual'), ] # -- Options for manual page output --------------------------------------- # On...
Python
1
assert_eq!( decoded_data_2.payload().copy_to_bytes(len), reference_bytes_2 ); } _ => { panic!("Improper framing in test case"); } } match decoded_frame3 { Frame::Data(decoded_da...
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
other child shortcut with a different ID. let shortcut = ShortcutBuilder::new() .set_keys_required(vec![input::Key::LeftShift]) .set_key3(input::Key::G) .set_id(TEST_SHORTCUT_3_ID) .build(); child.register_shortcut(shortcut).await?; let parent_fut = parent.listener.next(); ...
Rust
0
limitations under the License. */ use assert_cmd::prelude::*; use indoc::indoc; use predicates::prelude::*; use std::process::Command; #[test] fn succeeds_with_character_search_option() { let mut chr = init_command(); chr.args(&["--no-paging", "Ä", "@", "$", "ß", "!"]); chr.assert() .success() ...
Rust
0
# https://dmoj.ca/problem/dmopc15c7p2 # 이 문제의 목적에 따라 단어는 공백이 아닌 문자의 최대 연속 그룹 입니다. # 텍스트에서 읽어야 하는 단어 수를 세면 됩니다. # 입력은 오직 소문자와 공백만 포함된 텍스트 입니다. 유일한 제약은 전체 텍스트의 길이가 80자를 넘지 않는 다는것! # 출력은 텍스트 안에 단어의 수 word= input() if not word.islower(): exit(f"{word} != islower") result = word.count(' ') + 1 print(result)
Python
1
""" ================== Get ROI Voxel Mask ================== Get proportion of each voxel that exists within a named ROI (this constitutes a probability map for the ROI, with values ranging from 0-1). Plot this probabilistic roi mask onto a flatmap. In order for this to work, the specified ROI must exist in the ove...
Python
1
n=input() j=input() l='' #k=' ' s=set(n) k=set(j) #print(s) #print(k) if (len(set(n))-len(set(j)))==1: for i in k: if i in s: #print(i) s.remove(i) for i in s: #print(1) print(i) #print(k) # break else: for i in n: if i in j: ...
Python
1
/// $\\phi^\\star(n) = O(\\log(n))$ である。 /// /// # Examples /// ``` /// use nekolib::math::LinearSieve; /// /// let sieve = LinearSieve::new(60); /// assert_eq!(sieve.euler_phi_star(1), 0); /// assert_eq!(sieve.euler_phi_star(35), 5); /// assert_eq!(sieve.euler_phi_star(60), 5); ...
Rust
0
quests of this extension. pub trait ConnectionExt: RequestConnection { fn res_query_version(&self, client_major: u8, client_minor: u8) -> Result<Cookie<'_, Self, QueryVersionReply>, ConnectionError> { query_version(self, client_major, client_minor) } fn res_query_clients(&self) -> Result<Cookie<...
Rust
0
parent = 'single' # parent selection method: 'single' or 'weighted' x = np.loadtxt('evolve.txt', ndmin=2) n = min(5, len(x)) # number of previous results to consider x = x[np.argsort(-fitness(x))][:n] # top n mutations w = fitness(x) - ...
Python
1
0, 0, 0, 0, 0, 0, 0, 0]; if add_trainer { contents[6] |= 0x4; contents.resize(contents.len() + 512, 0xFF); } if ines_file_version == 1 { // prg_rom contents.resize(contents.len() + contents[4] as usize * PRG_ROM_SIZE_FACTOR, 0xEE); ...
Rust
0
/day05.txt"); const MAX_BOARD_SIZE: usize = 990; #[derive(Debug, PartialEq, Eq)] struct Point { x: isize, y: isize, } #[derive(Debug)] struct Segment { a: Point, b: Point, } struct Board(Vec<u8>); struct Parsed { board: Board, segments_straight: Vec<Segment>, segments_diagonal: Vec<Segme...
Rust
0
# Exercise 14 - Stats Report # Given three numbers that represent the number of wins, losses, and draws of a football team, # write a program that generates a report with the following information: # 1- The total number of games played. # 2- The percentage of games won. # 3- The percentage of games lost. # 4- The perce...
Python
1
dns; use libc; use open; use tai::Tai; use uint16; use uint32; extern "C" { static mut response: *mut u8; fn response_addbytes(arg1: *const u8, arg2: u32) -> i32; fn response_addname(arg1: *const u8) -> i32; static mut response_len: u32; fn response_nxdomain(); fn response_rfinish(arg1: i32); ...
Rust
0
import torch from unaiverse.agent import Agent from unaiverse.modules.networks import CNNCNU from unaiverse.networking.node.node import Node # Agent net = CNNCNU(3, cnu_memories=5, return_input=True, seed=42) agent = Agent(proc=net, proc_opts={ 'optimizer': torch.optim.SGD([ ...
Python
1
::rle(self) } } impl<'a, T: Int> Iterator for PrimeFactorsByLookup<'a, T> { type Item = T; fn next(&mut self) -> Option<Self::Item> { let Self { sieve, n } = self; if *n == T::one() { None } else { let p = sieve.lpd(*n); *n /= p; Some(p...
Rust
0
=0. Mode0, /// `Mode1` is CPOL=0, CPHA=1. Mode1, /// `Mode2` is CPOL=1, CPHA=0. Mode2, /// `Mode3` is CPOL=1, CPHA=1. Mode3, } #[derive(Debug, Clone, Copy)] pub enum ClockPhase { SampleLeading, SampleTrailing, } #[derive(Debug, Clone, Copy)] pub enum ClockPolarity { IdleLow, ...
Rust
0
= f.with_max_sample_rate(); const HZ_44100: SampleRate = SampleRate(44_100); if min_r <= HZ_44100 && HZ_44100 <= max_r { format.sample_rate = HZ_44100; } Ok(format) } None => Err(DefaultStreamConfigError::Stream...
Rust
0
.group(3).parse()?, true ) ); b.rule_2("<time-of-day> am|pm", datetime_check!(form!(Form::TimeOfDay(_))), b.reg(r#"([ap])\.?m\.?"#)?, |a, text_match| { let day_period = if text_match.group(1) == "a" { ...
Rust
0
0x1E; const INT_CTRL2: u8 = 0x1F; const DATA_CTRL: u8 = 0x21; const WAKEUP_TIMER: u8 = 0x29; const SELF_TEST: u8 = 0x3A; const WAKEUP_THRESHOLD: u8 = 0x6A; } struct BitFlags; impl BitFlags { const PC1: u8 = 0b1000_0000; const RES: u8 = 0b0100_0000; const DRDYE: u8 = 0b0010_0000; co...
Rust
0
ts_body) pose = swap_coords(pose, 58 + num_keypoints_body, 56 + num_keypoints_body) pose = swap_coords(pose, 61 + num_keypoints_body, 63 + num_keypoints_body) pose = swap_coords(pose, 60 + num_keypoints_body, 64 + num_keypoints_body) pose = swap_coords(pose, 67 + num_keypoints_body, 65 + num_keypoints_b...
Python
1
)](https://doi.org/10.1175/2009MWR2774.1) /// ///# Errors /// ///Returns [`InputError::OutOfRange`] when one of inputs is out of range.\ ///Valid `temperature` range: 253K - 324K\ ///Valid `pressure` range: 100Pa - 150000Pa\ ///Valid `vapour_pressure` range: 0Pa - 10000Pa /// ///Returns [`InputError::IncorrectArgumentS...
Rust
0
pub fn is_noevent(&self) -> bool { **self == WAKEUP0_A::NOEVENT } #[doc = "Checks if the value of the field is `EVENT`"] #[inline(always)] pub fn is_event(&self) -> bool { **self == WAKEUP0_A::EVENT } } impl core::ops::Deref for WAKEUP0_R { type Target = crate::FieldReader<bool, ...
Rust
0
import os import shutil from configs import SCORE_THRESHOLD from server.knowledge_base.kb_service.base import KBService, SupportedVSType, EmbeddingsFunAdapter from server.knowledge_base.kb_cache.faiss_cache import kb_faiss_pool, ThreadSafeFaiss from server.knowledge_base.utils import KnowledgeFile, get_kb_path, get_vs...
Python
1
_MACHINE | item_type::FISHTANK | item_type::SOLAR | item_type::FORGE | item_type::GIVING_TREE | item_type::GIVING_TREE_STUMP | item_type::STEAM_ORGAN | item_type::TAMAGOTCHI | item_type::SEWIN...
Rust
0
pv4Addr, SocketAddr}; //! # use merfolk::Mer; //! # use merfolk_backend_http::Http; //! # use merfolk_frontend_register::Register; //! # fn main() { //! // remote procedure definitions //! fn add(a: i32, b: i32) -> i32 { //! a + b //! } //! fn subtract(a: i32, b: i32) -> i32 { //! a - b //! } //! //! // build the b...
Rust
0
audioRole="dialogue", ) keyword_asset_clip1_today_talks = ET.SubElement( asset_clip1_today_talks, "keyword", start="0s", duration="9700/2500s", value="wipe today", ) marker_asset_clip_today_talks = ET.SubElement( asset_clip1_today_talks, "marker"...
Python
1
import sqlalchemy as sa from ..database import Base class ExchangeRate(Base): """ Модель для хранения информации о курсах валют """ __tablename__ = 'exchange_rate' id = sa.Column(sa.Integer, name='id', primary_key=True, autoincrement=True) exchanger = sa.Column(sa.String, name='exchanger', index=True...
Python
1
'''apport package hook for mariadb-10.2 (c) 2009 Canonical Ltd. Author: Mathias Gug <mathias.gug@canonical.com> ''' import os, os.path from apport.hookutils import * def _add_my_conf_files(report, filename): key = 'MySQLConf' + path_to_key(filename) report[key] = "" for line in read_file(filename).split...
Python
1
class Searcher: def __init__(self, indexname): self.indexname = indexname def search_products(self, client, search_text, logger): search_response = client.search( index=self.indexname, body={ "query": { "bool": { ...
Python
1
MULTISAMPLE_RESOLVE = 0x40000, D3D10_FORMAT_SUPPORT_DISPLAY = 0x80000, D3D10_FORMAT_SUPPORT_CAST_WITHIN_BIT_LAYOUT = 0x100000, D3D10_FORMAT_SUPPORT_MULTISAMPLE_RENDERTARGET = 0x200000, D3D10_FORMAT_SUPPORT_MULTISAMPLE_LOAD = 0x400000, D3D10_FORMAT_SUPPORT_SHADER_GATHER = 0x800000, D3D10_FORMAT_S...
Rust
0
ꥸ', '੦', '𐀸', '𑨟', '𑤡', 'ᨯ', '𐐘', 'ჲ', 'ጘ', 'Ħ', '\u{1dff}', '\u{1920}', 'ﶟ', 'ጙ', '𑌦', '𐙶', '྿', '𑓔', '⏜', '𝐈', '⡐', '𐐗', '🮳', '𘯤', '⋐', '𝇐', '🜓', 'ꐗ', 'ꆼ', '𞺍', '𘪖', '᧱', 'Ỗ', '𝤐', 'ꆫ', '𛰠', '𞄕', 'ᅭ', '㏆', 'ᕥ', '𑑀', '𞺉', 'ℾ', '㌿', 'ꢈ', 'ꩅ', '\u{2006}', 'ᰣ', '𐢫', 'خ', '🫒', '𝗺', ...
Rust
0
""" Constants for customers module. This module contains all constants used across the customers app. Centralizing constants improves maintainability. """ from decimal import Decimal import re # Phone validation PHONE_REGEX = r"^\+?38?0\d{9}$" PHONE_PATTERN = re.compile(PHONE_REGEX) PHONE_FORMATS = [ "+380XXXXXX...
Python
1
# Copyright (c) 2023, Frappe and contributors # For license information, please see license.txt from __future__ import annotations import frappe from frappe.model.document import Document from press.api.client import dashboard_whitelist from press.press.doctype.communication_info.communication_info import get_communi...
Python
1
import numpy as np from gptcache.embedding.base import BaseEmbedding from gptcache.utils import import_paddlenlp, import_paddle import_paddle() import_paddlenlp() import paddle # pylint: disable=C0413 from paddlenlp.transformers import AutoModel, AutoTokenizer # pylint: disable=C0413 class PaddleNLP(BaseEmbeddin...
Python
1
'B1': -0.002438, 'B2': 0.0003103, 'B3': -0.00001246, 'B4': 2.11E-07, 'B5': -1.36E-09, 'C0': 1.01284, 'C1': -0.0128398, 'C2': 0.279317, 'C3': -7.24463, 'C4'...
Python
1
if not self.by_epoch: self.scheduler.step() runner.call_hook('after_train_iter') runner._iter += 1 if self.rank == 0: log_buffer = 'train loss: {:.4f}'.format(loss.item()) log_buffer += ' | data time: {:.4f}'.format(data_time_m....
Python
1
import os import re from typing import Dict, List, Optional, Tuple, Union from modelscope_agent import Agent from modelscope_agent.agent_env_util import AgentEnvMixin from modelscope_agent.llm.base import BaseChatModel from modelscope_agent.llm.utils.function_call_with_raw_prompt import ( DEFAULT_EXEC_TEMPLATE, SP...
Python
1
else if self.cluster_policy.is_empty() { let msg = "field \'cluster_policy\' for \'config\' is empty".to_string(); error!("{}", msg); Err(msg) } else if self.log_config.is_empty() { let msg = "field \'log_config\' for \'config\' is empty".to_string(); ...
Rust
0
tSet {ALL}", "AugmentedScriptSet {Latn}", "AugmentedScriptSet {Grek}", "AugmentedScriptSet {Hanb, Jpan, Kore, Hani}", "AugmentedScriptSet {Jpan, Hira}", "AugmentedScriptSet {Jpan, Kana}", "AugmentedScriptSet {Kore, Hang}", "AugmentedScriptSet {Jpan}", "Aug...
Rust
0
import os from random import randint from subprocess import TimeoutExpired from utils import ( cargo_run, count_files, goto_root, mk_and_cd_tmp_dir, rand_word, write_string, ) def external_bases(): goto_root() mk_and_cd_tmp_dir() os.mkdir("root") os.chdir("root") cargo_run([...
Python
1
) -> Result<Self> { if input.peek(Token![&]) { let ahead = input.fork(); if ahead.call(arg_self_ref).is_ok() && !ahead.peek(Token![:]) { return input.call(arg_self_ref).map(FnArg::SelfRef); } } if input.peek(Token![mut]) || input.peek(Token![self]) { let ahea...
Rust
0
"""Use case for loading a particular email task.""" from jupiter.core.domain.concept.inbox_tasks.inbox_task import ( InboxTask, InboxTaskRepository, ) from jupiter.core.domain.concept.inbox_tasks.inbox_task_collection import ( InboxTaskCollection, ) from jupiter.core.domain.concept.inbox_tasks.inbox_task_s...
Python
1
"spaghetti squash", "acorn squash", "butternut squash", "cucumber", "artichoke", "bell pepper", "cardoon", "mushroom", "Granny Smith", "strawberry", "orange", "lemon", "fig", "pineapple", "banana", "jackfruit", "custard apple", "pomegranate", "ha...
Python
1
= "*Required features: `\"Win32_UI_TabletPC\"`*"] pub const DISPID_PIPLeft: DISPID_PenInputPanel = 6i32; #[doc = "*Required features: `\"Win32_UI_TabletPC\"`*"] pub const DISPID_PIPWidth: DISPID_PenInputPanel = 7i32; #[doc = "*Required features: `\"Win32_UI_TabletPC\"`*"] pub const DISPID_PIPHeight: DISPID_PenInputPane...
Rust
0
ge_attr_nextoken, edge_attr_nextoken_inverse], dim=0).int() return data def encode_y_to_arr(data, vocab2idx, max_seq_len): ''' Input: data: PyG graph object output: add y_arr to data ''' # PyG >= 1.5.0 seq = data.y # PyG = 1.4.3 # seq = data.y[0] data.y...
Python
1
ON BASICS") print("=" * 70) print("Welcome to your first Triton tutorial!") print("This lesson will teach you the fundamentals of GPU programming with Triton.") # Check CUDA availability if not torch.cuda.is_available(): print("\n❌ CUDA not available. Please use a GPU-enabled environmen...
Python
1
from bottle import route, static_file, view, post, request, default_app def chargeandprop(aa_seq): """ Calculates protein net charge and charged AA proportion """ protseq = aa_seq.upper() charge = -0.002 cp = 0 aa_charge = {'C':-.045,'D':-.999,'E':-.998,'H':.091, 'K':1,'R':1,'Y...
Python
1
ager.ui_manager) # Mockが使用されていないことを確認 self.assertFalse(hasattr(window_manager.ui_manager, '_mock_name'), "UIManagerがMockオブジェクトです - 実際のUIManagerが必要") # FacilityMenuWindowを直接作成してテスト facility_config = { 'facility_type': 'guild', ...
Python
1
heItem<T>>> { // Not intended to introduce too much complexity. let mut cache = self.cache.lock() .map_err(|_| Error::internal(ERR_POISONED_THREAD))?; if let Some(pos) = cache.iter() .position(|item| item.id() == id) { // Cache found. let arc = cac...
Rust
0
ermutation matrix and, therefore, contain only -1, 1 or 0 values but {} found in position({}, {}) for element "{}"''' .format(r[i, j], i, j, element) ) # the resulting representation is a quotient repre...
Python
1
mples/cargo.rs use std::sync::{mpsc, Arc, Mutex}; use std::thread; use std::time::Duration; use console::Term; use indicatif::{ProgressBar, ProgressStyle}; use rand::Rng; static CRATES: &[&str] = &[ "console", "lazy_static", "libc", "regex", "regex-syntax", "terminal_size", "libc", "un...
Rust
0
from vending_machine import VendingMachine if __name__ == '__main__': vending_machine = VendingMachine() vending_machine.run() # See PyCharm help at https://www.jetbrains.com/help/pycharm/
Python
1
fClient>, temperature_client: OptionalCell<&'a dyn sensors::TemperatureClient>, } impl<'a> Lis3dshSpi<'a> { pub fn new( spi: &'a dyn spi::SpiMasterDevice, txbuffer: &'static mut [u8; LIS3DSH_TX_SIZE], rxbuffer: &'static mut [u8; LIS3DSH_RX_SIZE], ) -> Lis3dshSpi<'a> { // set...
Rust
0