text
string
label_name
string
labels
int64
"[0] as u16) << 8 | b"cr"[1] as u16, /// cs - Chance compositions Chance = (b"cs"[0] as u16) << 8 | b"cs"[1] as u16, /// ct - Cantatas Cantata = (b"ct"[0] as u16) << 8 | b"ct"[1] as u16, /// cy - Country music Country = (b"cy"[0] as u16) << 8 | b"cy"[1] as u16, /// cz - Canzonas Canzona = (b"cz"[0] as u16) << 8...
Rust
0
def add(a,b): return a+b def sub(a,b): return a-b def mul(a,b): return a*b def divide(a,b): if b==0: print("MATH ERROR\n") return else: return a/b def modulo(a,b): return a%b def main(): while True: print("1.ADD 2.SUBRACT 3.MULTIPLY 4.DIVIDE...
Python
1
numSerialize, EnumDeserialize, PartialEq, Eq, Clone, Copy, Debug)] //! enum Airport { //! #[enumscribe(str = "LHR")] //! Heathrow, //! #[enumscribe(str = "LGW")] //! Gatwick, //! #[enumscribe(str = "LTN")] //! Luton, //! } //! //! #[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] //! struc...
Rust
0
import mido import tkinter as tk from tkinter import filedialog, messagebox import os from collections import defaultdict, Counter def midi_quantize(midi_path, debug=False, optimize_bpm=True): """ 分别对于左右手(左右手可以通过C4 上下进行分隔): 对于当前同时按下的音符(按下时间间隔短),他们的时值统一到下一个音符被按下的时间 注意只能拉伸尾端,音符的头端不能被动,相当于不能改按下事件 opt...
Python
1
# Definir la ruta que recibe los webhooks de Telegram. from fastapi import APIRouter, HTTPException, Depends from app.models.telegram.TelegramModel import TelegramWebhookRequest from app.controllers.telegram.TelegramController import TelegramController import logging # Configurar logger logger = logging.getLogger(__n...
Python
1
cluded.append(p.resolve()) kept: list[Path] = [] def _is_excluded(rel_posix: str) -> bool: import fnmatch as _fn name = rel_posix.split("/")[-1] for ex in cfg.exclude: # direct relpath match if _fn.fnmatch(rel_posix, ex): ...
Python
1
from app.repositories.coin_repository import CoinRepository from datetime import datetime, timedelta class CoinService: @staticmethod def get_all_coins(): """ Retrieve all unique coins from price_history. """ coins = CoinRepository.get_all_coins() coin_list = [{"symbol":...
Python
1
end(req().body(AsyncBody::Empty).unwrap()) .await .err() .unwrap(); assert_eq!( error .cause() .downcast_ref::<RemoteError>() .unwrap() .status(), &...
Rust
0
iter; use rt_defs::Word; use std::collections::BTreeMap; pub use emulator::code::opcode::*; pub use emulator::code::pointer::*; /// Code array stores opcodes/jump table offsets and args encoded as `LTerm` pub type Code = Vec<Word>; /// A slice to a code array pub type RefCode<'a> = &'a [Word]; /// Tagged word...
Rust
0
# 每处理10篇文献发送一次进度更新 if (i + 1) % 10 == 0: progress = min(10 + int((i + 1) / len(papers) * 40), 50) update_search_progress(session_id, 'excel_export_progress', f"正在处理数据 ({i + 1}/{len(papers)})...", progress) # 创建DataFrame ...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing import List, Optional from ..._models import BaseModel __all__ = ["UsageTotal", "Data", "DataMetrics"] class DataMetrics(BaseModel): file_quantity_sum_max: Optional[int] = None """a FileQuantitySumMax is max s...
Python
1
e = r.at(0)?.as_val()?; let succeed_data = r.at(1)?.as_val()?; let error_message = r.at(2)?.as_val()?; let method = r.at(3)?.as_val()?; let service_name = r.at(4)?.as_val()?; Ok(ReceiptResponse { service_name, method, response: ServiceResponse...
Rust
0
from gymnasium.envs.registration import register register( id="VizdoomBasic-v0", entry_point="vizdoom.gymnasium_wrapper.gymnasium_env_defns:VizdoomScenarioEnv", kwargs={"scenario_file": "basic.cfg"}, ) register( id="VizdoomCorridor-v0", entry_point="vizdoom.gymnasium_wrapper.gymnasium_env_defns:V...
Python
1
*mut c_void as i64 ; eh_frame_cie: ; .dword 0x14 ; .dword 0x00 ; .dword 0x00527a01 ; .dword 0x011e7c01 ; .dword 0x001f0c1b ; eh_frame_fde: ; .dword 0x14 ; .dword 0x18 ; fde_address: ; .dwo...
Rust
0
Sampler states define texture sampling operations such as texture addressing and texture filtering. /// Some sampler states set-up vertex processing, and some set-up pixel processing. /// Sampler states can be saved and restored using stateblocks (see [State Blocks Save and Restore State (Direct3D 9)]). /// /// [State...
Rust
0
ialize_network(graph, net, unsupported) #TODO: Remove this line when POT updates to using of rt_info add_quantization_statistics(graph, net) add_net_rt_info(net, meta_info) #TODO: Remove this line when POT updates to using of rt_info add_quantization_info_section(net, meta_info) xml_string =...
Python
1
_rwlock_t = 0 as *mut _; pub const PTHREAD_MUTEX_ERRORCHECK: ::c_int = 1; pub const PTHREAD_MUTEX_RECURSIVE: ::c_int = 2; pub const PTHREAD_MUTEX_NORMAL: ::c_int = 3; pub const PTHREAD_MUTEX_STRICT_NP: ::c_int = 4; pub const PTHREAD_MUTEX_DEFAULT: ::c_int = PTHREAD_MUTEX_STRICT_NP; pub const EVFILT_AIO: i16 = -3; pub...
Rust
0
80, 0x61, 0x01, 0x00, 0x0a, 0x81, 0x54, 0x81, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x02, 0x19, 0x16, 0x90, 0x83, 0x73, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff...
Rust
0
t_replica_logger(|log| { let state_manager = FakeStateManager::new(); let xnet_payload_builder = get_xnet_payload_builder_for_test(state_manager, log); // Empty state (no stream for `SUBNET_1`). let state = ReplicatedState::new_rooted_at( subnet_test_id(1), Subne...
Rust
0
@DeprecationWarning class TaaSampleRanker(): """ TaaSampleRanker评估给定的tokens、要变形的idx和所有变形方法的candidates的对抗样本质量: 1. 用LM ranker计算在idx处应填入的词,用于排序candidates 2. 将各对抗样本代入本地的defence model来评估TAA samples的质量 3. 最后结合上述得分完成最终排序,可以选得分最高的作为最终的对抗样本。 """ def __init__(self, lm_ranker, defence_model): self.lm_ranker = l...
Python
1
ChatBedrockConverse( # aws_access_key_id = os.environ["AWS_ACESS_KEY"], # aws_secret_access_key = os.environ["AWS_SECRET_KEY"], # region_name = "us-east-2", # provider = "anthropic", # model_id="arn:aws:bedrock:us-east-2:288380904485:inference-profile/us.anthr...
Python
1
if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument('--filename') args = parser.parse_args() if args.filename: np_load_old = np.load np.load = lambda *a, **k: np_load_old(*a, allow_pickle=True, **k) data = np.load(open(args.filename, 'rb'), encoding=...
Python
1
= requests.get(next_url, auth=auth) for feature in page.json()['features']: yield feature def ft_iterate(api_key, item_type, product_bundle_type, quality_type, geom, start_date, end_date, cloud_cover): search_json = search_payload(item_type, product_bundle_type, quality_type, geom, star...
Python
1
} } impl AddAssign<OcTreeLeaf> for OcTreeLeaf { fn add_assign(&mut self, rhs: Self) { self.red_acc += rhs.red_acc; self.green_acc += rhs.green_acc; self.blue_acc += rhs.blue_acc; self.color_count += rhs.color_count; } } #[derive(Debug, Clone)] enum OcTreeNode { Leaf(Oc...
Rust
0
mpy( floydDitherspeed(inputs_bd[i].detach().cpu().numpy(), float(opt.squeeze_num))).cuda()) else: inputs_bd = torch.round(inputs_bd / 255.0 * (squeeze_num - 1)) / (squeeze_num - 1) * 255 inputs_bd = np_4d_to_tensor(inputs_bd, opt) targets_bd =...
Python
1
(item_fn.sig.ident.clone(), fn_attributes); } } Ok(WovenImplBlock { woven_block: parsed_input, main_attributes: main_attributes, woven_fns: woven, }) } fn process_custom_attributes<W: ParseAttributes, R, F: Fn(W::Type) -> R>( attrs: &mut Vec<syn::Attribute>, f: F, )...
Rust
0
import unittest from migen import * from migen.sim import run_simulation from ovhw.dummy_source import DummySource class TestBench(Module): def __init__(self): from ovhw.cmdproc import CmdProc class ff: def __getattr__(self, attrname): if not attrname in self.__dict__:...
Python
1
} } } pub(crate) fn derive(errors: &Errors, input: syn::DeriveInput) -> Result<TokenStream, ()> { let attr = TextAttr::new(errors, &input); match attr.mode { None => { errors.push(syn::Error::new_spanned( input.ident, "static_xml(mode) must be specifi...
Rust
0
*variable), WeechatVariable::Author(_) => variables.insert("author", *variable), WeechatVariable::Description(_) => variables.insert("description", *variable), WeechatVariable::Version(_) => variables.insert("version", *variable), WeechatVariable::License...
Rust
0
import argparse from tqdm import tqdm import torch import os from local_model.pipe import LocalStableDiffusionPipeline from diffusers import DDIMScheduler, UNet2DConditionModel def main(args): torch.set_default_dtype(torch.bfloat16) used_dtype = torch.bfloat16 device = "cuda" if torch.cuda.is_available()...
Python
1
ub fn crypto_sign_ed25519( sm: *mut u8, smlen: *mut c_ulonglong, m: *const u8, mlen: c_ulonglong, sk: *const [u8; crypto_sign_ed25519_SECRETKEYBYTES]) -> c_int; pub fn crypto_sign_ed25519_open( m: *mut u8, mlen: *mut c_ulonglong, sm: *const u8, ...
Rust
0
resource: Result<Talent, _> = serde_json::from_str(&payload); let resource = resource.unwrap(); assert_eq!( resource.desired_roles, vec![ RolesExperience { role: "C/C++ Engineer".into(), experience: "2..4".into() }, RolesExperience { role: "DevOps"...
Rust
0
t(interactioncontext: HINTERACTIONCONTEXT, contextproperty: INTERACTION_CONTEXT_PROPERTY, value: u32) -> ::windows_sys::core::HRESULT; #[doc = "*Required features: 'Win32_UI_InteractionContext'*"] pub fn SetTapParameterInteractionContext(interactioncontext: HINTERACTIONCONTEXT, parameter: TAP_PARAMETER, value: ...
Rust
0
from ..utils.utils import * class Text: """ Text Definition in SPLayout. Parameters ---------- start_point : Point Start point of the DoubleBendConnector. text : string Characters that you want to put on the layout. size : int The size of the characters. horizon...
Python
1
from __future__ import annotations import typing import pydantic from telegram_pydantic import types from telegram_pydantic.utils import base_type_discriminator # ChannelParticipant - Layer 181 ChannelParticipant = typing.Annotated[ typing.Union[ typing.Annotated[ types.ChannelParticipant, ...
Python
1
(feature = "launchd")] mod launchd; #[cfg(feature = "launchd_overrides")] mod launchd_overrides; pub struct EtcHostsReader {} #[cfg(feature = "etc_hosts")] impl EtcHostsIface for EtcHostsReader { fn get_hosts_file(&self) -> Option<String> { let mut s = String::new(); File::open("/etc...
Rust
0
ue tuple, eg: [(key, value), ...] return results def _parse_series_key(series): serieskey = _get_child(series, _SERIES_KEY) key_values = serieskey.iter(_VALUE) keys = [(key.get("id"), key.get("value")) for key in key_values] # return list of key/value tuple, eg: [(key, value), ...] return keys...
Python
1
e(mut p) = env::var_os("SYSTEMROOT").map(PathBuf::from) { p.push(r"System32\wsl.exe"); if p.is_file() { return Ok(p); } } // no dice Err(Error::from(ErrorKind::WSLNotFound)) } /// Options for WSL invocation. pub struct WSLOptions { /// Mode after the command exits. ...
Rust
0
collect(), ), ( 2, [(String::from("version_suffix"), String::from("+arm64"))] .iter() .cloned() .collect(), ), ( 3, ...
Rust
0
BidLimitMMOnly,trading_pair,12000*UNIT,(2*UNIT)/10), Error::<TestRuntime>::ErrorIsNotMarketMaking); // assert_noop!(DEXModule::submit_order(Origin::signed(alice),OrderType::AskLimitMMOnly,trading_pair,5000*UNIT,(2*UNIT)/10), Error::<TestRuntime>::ErrorIsNotMarketMaking); }); // Error Test (BidLimitMMOn...
Rust
0
}) .next() .is_none(); if can_process { nodes.remove(graph.node_weight(o).unwrap()); workqueue.push_back((o, time + w.0)); new_...
Rust
0
# -*- coding: utf-8 -*- """ rebalancing.py ~~~~~~~~~~~~~~ # TODO | Add module description """ import numpy as np from tesseract import spatial from tesseract.evaluation import Stage class Rebalancer(Stage): def alter_wrapper(self, clf, X_train, y_train, t_train, X_test, y_test, t_test):...
Python
1
> { // self.print_type(lhs_ty); // self.s.space(); // self.word_space("="); // self.print_type(rhs_ty); unimplemented!(); } } } // panic!(res); res } fn fun_to_json( ident: &symbol::Ident, fndecl: ...
Rust
0
match conn.query( "Select count(*) from NFT where (reserved_to_wallet_address=$1 and reserved=true and (in_process or reserved_until > now())) or assigned_to_wallet_address=$2", &[&String::from(wallet_address),&String::from(wallet_address)], ) { Ok(reservation_count) => { if ...
Rust
0
!("broadcasted! with response {:?}", response); if let Some(time) = wait_timeout { self.wait_for_tx(response, time).await } else { Ok(response) } } /// Simulates the provided array of messages and returns /// a fee object with the gas amount actually used ...
Rust
0
dPiece::King2, // King2 HandPiece::Rook2, // Rook2 HandPiece::Bishop2, // Bishop2 HandPiece::Gold2, // Gold2 HandPiece::Silver2, // Silver2 HandPiece::Knight2, // Knight2 HandPiece::Lance2, // Lance2 H...
Rust
0
name; println!("<{}>: {}", first_name, vtm.text); telegrambot::spawn( api.send_message(&SendMessage::new(vtm.message.chat.id(), format!("Hi, {}! You just wrote '{}'", first_name, vtm.text))) .map(|_| {}) .map_err(|_| {}) ); }) .start() .unwrap(); } use std::syn...
Rust
0
""" Global event management for MediaHub application. This module provides centralized event handling for graceful shutdown across all components. """ import threading import signal import os from MediaHub.utils.logging_utils import log_message # Global events for coordinating shutdown across all components terminate...
Python
1
ystem4 started."); sleep(Duration::from_millis(1000)).await; log::info!("Subsystem4 stopped."); // This subsystem would end normally but takes too long and therefore // will time out. Ok(()) } async fn subsys5(_subsys: SubsystemHandle<MyError>) -> Result<(), MyError> { log::info!("Subsystem5 s...
Rust
0
import numpy as np import opytimizer.math.random as r from opytimizer.optimizers.misc import nds from opytimizer.spaces import pareto def test_nds_params(): new_nds = nds.NDS() assert new_nds.n_pareto_points == 0 def test_nds_params_setter(): new_nds = nds.NDS() try: new_nds.n_pareto_poin...
Python
1
_rotation: Matrix3::look_at(vec3(1.0, 0.0, 1.0), vec3(0.0, 1.0, 0.0)), camera_d: 1.0, // d, Distance from camera to viewport viewport_size: vec2(1.0, 1.0), // vw, vh spheres: vec![ Sphere { center: vec3(0.0, -1.0, 3.0), radius: 1.0, ...
Rust
0
32 = 130400; pub const __IPHONE_13_5: u32 = 130500; pub const __IPHONE_13_6: u32 = 130600; pub const __TVOS_9_0: u32 = 90000; pub const __TVOS_9_1: u32 = 90100; pub const __TVOS_9_2: u32 = 90200; pub const __TVOS_10_0: u32 = 100000; pub const __TVOS_10_0_1: u32 = 100001; pub const __TVOS_10_1: u32 = 100100; pub const _...
Rust
0
yle: style::PathStyle::new(Some(style::Stroke::new(tool_data.primary_color, 5.)), Some(style::Fill::none())), } .into() } <gh_stars>0 extern crate day20; use std::fs::File; use std::io::{BufRead, BufReader}; use day20::*; fn main() { let file = BufReader::new(File::open("input.txt").expect("file not found")); ...
Rust
0
if sys.platform == 'darwin' and ( dir.startswith('/System/') or ( dir.startswith('/usr/') and not dir.startswith('/usr/local/'))): shared = os.path.join(sysroot, dir[1:], shared_f) dylib = os.path.join(sysroot, dir[1:], dylib_f) stati...
Python
1
} <reponame>Soare-Robert-Daniel/cripto-lab-2020-2021 #![allow(dead_code)] use text_io::read; fn putere_modul(a: usize, i: usize, p: usize) -> usize { let mut result = 1; for _ in 0..i { result = (result % p) * a; } return result % p; } fn gamal_tabel() { let p: usize = read!(); let p...
Rust
0
vals = nurbs(x0, x1, x2) ax.plot(vals[:, 0], vals[:, 1], vals[:, 2], color) x0 = nm.linspace(ga0[0], ga0[-1], n_points) for x1 in ga1: for x2 in ga2: vals = nurbs(x0, x1, x2) ax.plot(vals[:, 0], vals[:, 1], vals[:, 2], color) return a...
Python
1
> { fn as_ref(&self) -> &T { &**self } } impl<T: ?Sized + fmt::Display> fmt::Display for Arc<T> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { fmt::Display::fmt(&**self, f) } } impl<T: ?Sized + fmt::Debug> fmt::Debug for Arc<T> { fn fmt(&self, f: &mut fmt::Formatter<'...
Rust
0
ize: usize, asid: *const pt_asid, ip: u64, context: *mut ::std::os::raw::c_void, ) -> ::std::os::raw::c_int, >; extern "C" { #[doc = " Set the memory callback for the traced memory image."] #[doc = ""] #[doc = " Sets \\@callback for reading memory. The callback is used for addre...
Rust
0
m<Item = Result<(PartitionedFile, Statistics)>>, file_schema: SchemaRef, limit: Option<usize>, ) -> Result<(Vec<PartitionedFile>, Statistics)> { let mut result_files = vec![]; let mut total_byte_size = 0; let mut null_counts = vec![0; file_schema.fields().len()]; let mut has_statistics = false;...
Rust
0
CTL_CONTEXT: CRYPTUI_WIZ_IMPORT_SUBJECT_OPTION = 3u32; #[doc = "*Required features: 'Win32_Security_Cryptography_UI'*"] pub const CRYPTUI_WIZ_IMPORT_SUBJECT_CRL_CONTEXT: CRYPTUI_WIZ_IMPORT_SUBJECT_OPTION = 4u32; #[doc = "*Required features: 'Win32_Security_Cryptography_UI'*"] pub const CRYPTUI_WIZ_IMPORT_SUBJECT_CERT_S...
Rust
0
n PyUnicode_Contains(container: *mut PyObject, element: *mut PyObject) -> c_int; pub fn PyUnicode_IsIdentifier(s: *mut PyObject) -> c_int; #[cfg(not(Py_LIMITED_API))] pub fn PyUnicode_AsUnicodeCopy(unicode: *mut PyObject) -> *mut Py_UNICODE; } <filename>jni-android-sys/src/gen...
Rust
0
# Desenvolva um programa em Python para calcular a média de notas de alunos em uma disciplina. O programa deve solicitar ao usuário o número de alunos e, em seguida, para cada aluno, pedir o nome e três notas. Utilize um loop 'for' para iterar sobre os alunos e suas notas. # Além disso, implemente uma estrutura condic...
Python
1
Point>>(iter: I) -> Self { let mut wire = Wire::new(Point::new(0.0, 0.0), Point::new(0.0, 0.0)); wire.layout.shape.points = iter.into_iter().collect::<Vec<Point>>(); wire } } impl std::str::FromStr for Wire { type Err = error::Error; fn from_str(s: &str) -> Result<Wire, error::Erro...
Rust
0
mul_extension(product, diff); } constraints.push(product); if j < midpoint { combined_low_limbs = builder.mul_add_extension(base, combined_low_limbs, this_limb); } else { combined_high_limbs ...
Rust
0
#Brute Force Approach to find the length of the longest subarray with zero sum #Time Complexity: O(n^2) #Space Complexity: O(1) def SubarrayWithZeroSum(nums): max_Length = 0 for i in range(len(nums)): sum = nums[i] for j in range(i+1,len(nums)): sum += nums[j] if sum == ...
Python
1
config: &HashMap<&str, &str>, p: &str) -> i32 { config.get(p).unwrap().parse::<i32>().unwrap() } fn param_bool(config: &HashMap<&str, &str>, p: &str) -> bool { config.get(p).unwrap().parse::<bool>().unwrap() } fn param_float(config: &HashMap<&str, &str>, p: &str) -> Flt { config.get(p).unwrap().parse::<Flt>().u...
Rust
0
.cond_embed_dim = cond_embed_dim else: raise NotImplementedError( "Generator model name [%s] is not recognized" % G_netG ) if model_type == "palette": denoise_fn = PaletteDenoiseFn( model=model, cond_embed_dim=cond_embed_dim, ref_embed_ne...
Python
1
let called = Arc::new(AtomicBool::new(false)); let called_ = Arc::clone(&called); cluster .sim .rl() .get_node_router(1) .send_command( put_req, Callback::Write(Box::new(move |resp: WriteResponse| { called_.store(true, Ordering::SeqCst)...
Rust
0
import flet as ft import data_list #order 저장용 클래스 class Orders: def __init__(self, name, price): self.name = name self.price = price def main(page: ft.Page): page.window.width=768 page.window.height=1366 page.padding = 50 page.horizontal_alignment=ft.MainAxisAlignment.CENTER pa...
Python
1
#!/usr/bin/env python3 """ Start Automated Document Processing Processes all queued documents using Celery workers """ import sys import os # Add current directory to path sys.path.append('.') from workers.automated_document_processor import ( process_single_document, process_batch_documents, process_a...
Python
1
pl<'a> iter::DoubleEndedIterator for EscapeAscii<'a> { fn next_back(&mut self) -> Option<u8> { self.inner.next_back() } } #[stable(feature = "inherent_ascii_escape", since = "1.60.0")] impl<'a> iter::ExactSizeIterator for EscapeAscii<'a> {} #[stable(feature = "inherent_ascii_escape", since = "1.60.0")] ...
Rust
0
e sha2::Digest; if Self::required_gas(input)? > target_gas { return Err(ExitError::OutOfGas); } let cost = Self::required_gas(input)?; if cost > target_gas { Err(ExitError::OutOfGas) } else { let output = sha2::Sha256::digest(input).to_vec();...
Rust
0
ribStyle_EnduranceReduction, kAttribStyle_InversePercent, kAttribStyle_ResistanceDistance, } default_val!(AttribStyle, kAttribStyle_None); /// Rank of a villain. The "level" here is for conning purposes. #[derive(Debug, TryFromPrimitive)] #[repr(u32)] pub enum VillainRank { VR_NONE, /// -1 level VR...
Rust
0
import pytest from langchain.memory import ConversationBufferMemory from langchain_core.messages import HumanMessage, AIMessage from voice_stream.core import single_source, map_step, fork_step, array_sink, empty_sink from voice_stream.integrations.langchain import ( langchain_load_memory_step, langchain_save_m...
Python
1
# Copyright (c) 2009-2010 Denis Bilenko. See LICENSE for details. """A few utilities for raw greenlets. .. warning:: This module is deprecated. Use :class:`gevent.Greenlet` instead. .. note:: These functions do not support *timeout* parameter. """ import warnings warnings.warn("gevent.rawgreenlet is depre...
Python
1
} } } use crate::messages::submessages::submessage_header::SubmessageHeader; use crate::messages::submessages::submessage::EntitySubmessage; use crate::messages::submessages::submessages::*; use speedy::{Context, Writer, Writable}; #[derive(Debug, PartialEq)] pub struct SubMessage { pub header: Submessa...
Rust
0
from each tree until you cannot, i.e., you will stop when you have to pick from a third fruit type. Write a function to return the maximum number of fruits in both the baskets. Example 1: Input: Fruit=['A', 'B', 'C', 'A', 'C'] Output: 3 Explanation: We can put 2 'C' in one basket and one 'A' in the other from the s...
Rust
0
1.95); var b = Math.floor(-3.01); var c = Math.floor(3.01); "#; eprintln!("{}", forward(&mut engine, init)); let a = forward_val(&mut engine, "a").unwrap(); let b = forward_val(&mut engine, "b").unwrap(); let c = forward_val(&mut engine, "c").unwrap(); assert_eq!(a.to_num(...
Rust
0
#[doc = "`write(|w| ..)` method takes [traceclk::W](traceclk::W) writer structure"] impl crate::Writable for TRACECLK {} #[doc = "Pin configuration for TRACECLK"] pub mod traceclk; #[doc = "Pin configuration for TRACEDATA\\[0\\] and SWO\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::gene...
Rust
0
import requests INSTAGRAM_ACCESS_TOKEN = "your-instagram-access-token" def fetch_instagram_influencer(username): """Fetch influencer stats from Instagram.""" url = f"https://graph.facebook.com/v18.0/{username}?fields=followers_count,media_count,media{{like_count,comments_count}}&access_token={INSTAGRAM_A...
Python
1
nderer) robot = Panda(sim, block_gripper=False, base_position=np.array([-0.6, 0.0, 0.0]), control_type=control_type) task = Stack(sim, reward_type=reward_type) super().__init__( robot, task, render_width=render_width, render_height=render_height, ...
Python
1
text<'_>) -> Poll<T> { self.get_pin().poll(cx) } } impl<T> Future for ReusableBoxFuture<T> { type Output = T; /// Poll the future stored inside this box. fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<T> { Pin::into_inner(self).get_pin().poll(cx) } } // The future sto...
Rust
0
from Py4GWCoreLib.enums import outpost_name_to_id, explorable_name_to_id # 1) IDs _6_templeoftheages_to_fishermenshaven_ids = { "outpost_id": 138, } # 2) Outpost exit path _6_templeoftheages_to_fishermenshaven_outpost_path = [ (-4908, 17096), (-5198, 16120), (-5483, 15161), ] # 3) Segments _6_templeo...
Python
1
lueOrder::RED), (-30.0, 0.5, IndicesValueOrder::RED), ( -15.0, (f64::SQRT_3 - 1.0) / (f64::SQRT_3 + 1.0), IndicesValueOrder::RED, ), (0.0, 0.0, IndicesValueOrder::RED), ( 15.0, (f6...
Rust
0
() { return Err(RefractError::Decode); } maybe_die_dec( &unsafe { JxlDecoderSubscribeEvents( dec, JxlDecoderStatus::BasicInfo as i32 | JxlDecoderStatus::ColorEncoding as i32 | JxlDecoderStatus::FullImage as i32 ) } )?; maybe_die_dec(&unsafe { JxlDecoderSetKeepOrientation(d...
Rust
0
ision (HLE). /// /// [Intel's documentation](https://software.intel.com/en-us/cpp-compiler-developer-guide-and-reference-xtest). #[inline] #[target_feature(enable = "rtm")] #[cfg_attr(test, assert_instr(xtest))] pub unsafe fn _xtest() -> u8 { x86_xtest() as _ } /// Retrieves the parameter passed to [`_xabort`] whe...
Rust
0
gy_name: Nome da estratégia principal api: Instância da API IQ Option session: Sessão de trading filter_config: Configuração dos filtros (opcional) Returns: StrategyFilterSystem configurado ou estratégia simples se não há filtros """ # Se não há configuração de filtr...
Python
1
always)] pub fn variant(self, variant: ADC12IE13_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "Interrupt disabled"] #[inline(always)] pub fn adc12ie13_0(self) -> &'a mut W { self.variant(ADC12IE13_A::ADC12IE13_0) } #[doc = "Interrupt enabled"] ...
Rust
0
from numpy import fft import math import matplotlib.pyplot as plt def lerp(t, a, b): return a + (b - a) * t def normalize(a, d = 1): return list(map(lambda p: [p[0]/d, p[1]/d], a)) def scale(a, scale): return list(map(lambda p: [p[0]*scale, p[1]*scale], a)) def offset(a, offset): return list(map(lam...
Python
1
self.todos.retain(|todo| !todo.completed); rid::post(Reply::RemovedCompleted(req_id)); } CompleteTodo(id) => { self.update_todo(id, |todo| todo.set_completed(true)); rid::post(Reply::CompletedTodo(req_id, id.to_string())); } ...
Rust
0
class Solution: def countComponents(self, n: int, edges: List[List[int]]) -> int: ans = 0 graph = [[] for _ in range(n)] seen = set() for u, v in edges: graph[u].append(v) graph[v].append(u) def dfs(u: int, seen: Set[int]) -> None: for v in graph[u]: if v not in seen: ...
Python
1
not have permission to mint an asset. NoMintPermission, /// The origin does not have permission to burn an asset. NoBurnPermission, /// Total issuance got overflowed after minting. TotalMintingOverflow, /// Free balance got overflowed after minting. FreeMintingOverflow, /// Total issuance got underflow...
Rust
0
mma = data['Lemma'].get(lemma_id) stem_id = morpheme['Stem_ID'] stem = data['Stem'].get(stem_id) if not lemma: print(f"Warning: Lemma with id {lemma_id} not found for morpheme {morpheme['id']}") continue if not stem: print(f"Warning: Stem with id {stem...
Python
1
data.serialize(&mut *proposal_info.data.borrow_mut())?; Ok(()) } use super::{get_and_notify, Collector}; use binary_install::Cache; use chrono::DateTime; use failure::{self, ResultExt}; use install::InstallMode; use stamps; use std::path::PathBuf; use target; // Keep it up to date with each `wasm-pack` release. /...
Rust
0
![Interval::PI.convex_hull(i!(3.0) * Interval::FRAC_PI_4)], Dac, ) ); test!(f, y, i!(0.0), (vec![Interval::FRAC_PI_2], Trv)); let y = i!(-1.0, 1.0); test!( f, y, i!(-1.0), ( vec![ ...
Rust
0
process.run(npm_install_cmd, shell=True, cwd=temp_dir, capture_output=True, text=True) if npm_result.returncode != 0: print(f"[ERROR] Failed to install Mocha/Chai: {npm_result.stderr}") return f"NPM setup failed: {npm_result.stderr}", {"coverage": "No...
Python
1
31_921_044_282_247_773_79_e-6, -0.000_198_412_698_412_046_454_654_947, ) .mul_add(s.0, 0.008_333_333_333_333_180_562_019_22); let x = (1.).add_checked((-0.166_666_666_666_666_657_414_808).add_checked_as_doubled(u * s.0) * s); let u = t.mul_as_f(x); if ((ql as isize) & 2) == 0 { ...
Rust
0
ec>( &self, state_root: &Hash256, slot: Option<Slot>, ) -> Result<Option<BeaconState<E>>, Error> { if let Some(slot) = slot { if slot < self.get_split_slot() { self.load_archive_state(state_root) } else { self.hot_db.get_state(s...
Rust
0
fn rx_flush(&self) -> RX_FLUSH_R { RX_FLUSH_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bits 8:11 - Receive FIFO Threshold. These bits define the RX_FIFO interrupt threshold."] #[inline(always)] pub fn rx_thresh(&self) -> RX_THRESH_R { RX_THRESH_R::new(((self.bits >> 8) & 0x0f) as...
Rust
0
import math import pygame import sys import random import copy from heapq import heappush, heappop # Константы для отображения GRID_SIZE = 40 CELL_SIZE = 15 WINDOW_SIZE = (GRID_SIZE * CELL_SIZE, GRID_SIZE * CELL_SIZE) # Цвета WHITE = (255, 255, 255) BLACK = (0, 0, 0) RED = (255, 0, 0) GREEN = (0, 255, 0) BLUE = (0, 0...
Python
1