text
string
label_name
string
labels
int64
{ self.$msystem .as_ref() .ok_or_else(|| anyhow!("{} config is missing.", stringify!($msystem))) } }; } impl Config { config_getter! { msys2 } config_getter! { mingw64 } config_getter! { ucrt64 } config_getter! { clang64 } config_getter! { cl...
Rust
0
# We have a duplicate in inference.models.aliases - please maintain both (to have aliasing work in both libraries) REGISTERED_ALIASES = { "yolov8n-640": "coco/3", "yolov8n-1280": "coco/9", "yolov8s-640": "coco/6", "yolov8s-1280": "coco/10", "yolov8m-640": "coco/8", "yolov8m-1280": "coco/11", ...
Python
1
temp_s, Branching0fromFtoA::Done, Branching0fromFtoB::Done, Branching0fromFtoC::Done, Branching0fromFtoD::Done, Branching0fromFtoE::Done ); s.close() } fn recurs_f(s: EndpointF) -> Result<EndpointF, Box<dyn Error>> { let s: EndpointMoreF = choose_mpst_f_to_a...
Rust
0
let show_final_air_date = show_result.last_air_date.format("%B %-e, %Y").to_string(); let show_studios = if show_result.studios.is_empty() { "N/A".to_string() } else { show_result.studios.iter().map(|s| &s.name).join("\n") }; let show_poster_url = show_result.poster_path.unwrap();...
Rust
0
, pub(crate) delta: f32, pub(crate) normalized_pos: f32, pub(crate) last_normalized_pos: f32, pub(crate) strain_time: f32, } impl<'o> DifficultyObject<'o> { #[inline] pub(crate) fn new( base: &'o CatchObject, last: &'o CatchObject, half_catcher_width: f32, clo...
Rust
0
, 6, 7, 8, 9, /* padding */ 0, 0, 0]); } #[test] fn push_u8_u16_alignment() { let mut b = flatbuffers::FlatBufferBuilder::new(); b.push(1u8); b.push(2u16); check(&b, &[2, 0, 0, 1]); } #[test] fn push_u8_u32_alignment() { let mut b = flatbuffers::FlatBuff...
Rust
0
from game.engine.dealer import Dealer from game.players import BasePokerPlayer def setup_config(max_round, initial_stack, small_blind_amount, ante=0): return Config(max_round, initial_stack, small_blind_amount, ante) def start_poker(config, verbose=2): config.validation() dealer = Dealer(config.sb_amoun...
Python
1
protocol; #[derive(Debug, StructOpt)] struct App { #[structopt(subcommand)] mode: Mode, #[structopt(long)] address: SocketAddr, #[structopt(default_value = "tcp")] protocol: Protocol, } #[derive(Debug, StructOpt)] enum Mode { Send { message: String }, Listen, } #[derive(Debug, Struct...
Rust
0
_ => unreachable!(), }.ok_or(errno::ENODEV)?; let mut guard = dev.lock(true); guard.get_mut().get_handle().read(off as _, buff) }, } } fn write(&mut self, off: u64, buff: &[u8]) -> Result<usize, Errno> { match &self.content { FileContent::Regular => { let location = self.location.as_r...
Rust
0
ing> for loragw::Spreading { fn from(other: Spreading) -> loragw::Spreading { match other { Spreading::SF7 => loragw::Spreading::SF7, Spreading::SF8 => loragw::Spreading::SF8, Spreading::SF9 => loragw::Spreading::SF9, Spreading::SF10 => loragw::Spreading::SF10...
Rust
0
ether/creating-authentication-middleware-actix-rust-react/ async fn auth(req: actix_web::HttpRequest) -> actix_web::Result<actix_files::NamedFile> { log::debug!("[auth] request headers: {:?}", req.headers()); let path_buf:std::path::PathBuf = std::path::PathBuf::from("static/auth.html"); Ok(actix_files::NamedFile::o...
Rust
0
les.push(input_file); self.input_files.len() - 1 } pub fn get_code_ref(&self, code_id: CodeId) -> CodeRef { CodeRef { file: code_id, input_files: self, } } /// Gets the input file with this id pub fn get_input(&self, code_id: CodeId) -> &Code { ...
Rust
0
""" bot_commands.py - Bot komutları ayarlama fonksiyonu Telegram'da görünecek komut listesini ayarlar. """ import logging from telegram import BotCommand logger = logging.getLogger(__name__) async def set_bot_commands(bot): """Bot komutlarını Telegram'da görünür hale getirir.""" commands = [ BotComma...
Python
1
ProtobufTypeBytes>( "signature", |m: &TronSignedTx| { &m.signature }, |m: &mut TronSignedTx| { &mut m.signature }, )); fields.push(::protobuf::reflect::accessor::make_singular_field_accessor::<_, ::protobuf::types::ProtobufTypeB...
Rust
0
import sqlite3 from pynput.mouse import Listener as MouseListener, Button from pynput.keyboard import Listener as KeyboardListener, Key import ocr x,y = 2008,1412 """ Right mouse clicked at (2507, 1404) Right mouse clicked at (2529, 1407) Right mouse clicked at (2530, 1427) """ conn = sqlite3.connect('coordinates.db'...
Python
1
json::serialize::JsonObjectWriter::new(&mut out); crate::json_ser::serialize_structure_update_model_input(&mut object, input); object.finish(); Ok(smithy_http::body::SdkBody::from(out)) } pub fn serialize_operation_update_route( input: &crate::input::UpdateRouteInput, ) -> Result<smithy_http::body::Sdk...
Rust
0
level": 1, "id": "tests.fixtures.nesting.Class", "html": IsStr(), "name": "Class", "data-toc-label": "Class", "children": [ { "level": 2, "id": "tests.fixtures.nesting.Class.method", "...
Python
1
/ ``` /// /// The second form of `span_of!` returns a sub-slice which starts at one field, and ends at another. /// The general pattern of this form is: /// /// ```ignore /// // Exclusive /// span_of!(Struct, member_a .. member_b) /// // Inclusive /// span_of!(Struct, member_a ..= member_b) /// /// // Open-ended ranges...
Rust
0
to_8(input, key, seed) } else if input.len() != 0 { hash_64_1_to_3(input, key, seed) } else { 0 } } ////////////////////////////////////////////////////////////////////////// /// Medium keys /// /////////////////////////////////////////...
Rust
0
# verification_utils.py from django.core.validators import validate_email from django.core.exceptions import ValidationError import dns.resolver from smtplib import SMTPServerDisconnected, SMTPConnectError, SMTPResponseException import smtplib import socket import logging import time import csv def verify_email_synta...
Python
1
#=========================================================================== # # UnitDblFormatter # #=========================================================================== """UnitDblFormatter module containing class UnitDblFormatter.""" #==========================================================================...
Python
1
if len(infer.ids) != 0: # 假设有其他结果 # 获取rdk_colors的最后一个颜色 last_color = rdk_colors[-1] for class_id, score, bbox in zip(infer.ids, infer.scores, infer.bboxes): x11, y11, x22, y22 = bbox # 绘制边界框 if class_id == 0: ...
Python
1
rdns update failed: {message}")] RdnsUpdateFailed { message: String }, #[error("rnds deletion failed: {message}")] RdnsDeleteFailed { message: String }, #[error("rnds entry already exists: {message}")] RdnsAlreadyExists { message: String }, #[error("reset failed: {message}")] ResetFailed { m...
Rust
0
from typing import Optional from one_dragon.base.conditional_operation.atomic_op import AtomicOp from zzz_od.auto_battle.auto_battle_context import AutoBattleContext from zzz_od.auto_battle.auto_battle_state import BattleStateEnum class AtomicBtnChainRight(AtomicOp): def __init__(self, ctx: AutoBattleContext, p...
Python
1
_magic, )); } Ok(master) } pub fn master_count() -> Result<usize> { let master = Self::open(0, MasterAccess::ReadOnly)?; let mut module_info = ec::ec_ioctl_module_t::default(); ioctl!(master, ec::ioctl::MODULE, &mut module_info)?; Ok(module_info.maste...
Rust
0
forms_dict.items(): # print(k, np.shape(v)) # print(len(global_speed), end='|') # print(max(global_speed), end='|') # print(len(speed), end='|') # print(max(speed)) # print() # break plt.figure(figsize=(15,4)) plt.plot(global_cmd_speed); plt.plot(glo...
Python
1
# main.py import cv2 from deepface import DeepFace import time import winsound from patients import patients from llm_triage import evaluate_patient cap = cv2.VideoCapture(0, cv2.CAP_DSHOW) REVIEW_INTERVAL = 10 # 10-second reviews last_review_time = time.time() patient_ids = list(patients.keys()) current_patient_idx ...
Python
1
import pixhawk as px from pymavlink import mavutil import time connection = mavutil.mavlink_connection('/dev/ttyACM0', baud = 115200) i = 0 # time1 = time.time() connection.mav.heartbeat_send(mavutil.mavlink.MAV_TYPE_SUBMARINE, mavutil.mavlink.MAV_AUTOPILOT_INVALID, 0, 0, 0) while 1: ...
Python
1
import os from pynput import keyboard import tkinter as tk from tkinter import ttk import gui # Keyboared instruction # # print("Press <Alt>+<Shift>+z: Decrease Brightness") # print("Press <Alt>+<Shift>+a: Increase Brightness") # Updateding cuurent windows brightness # def getCurrentBrightness(): command = "power...
Python
1
0 * (-bi)) y1 = int(y0 + 1000 * (ai)) x2 = int(x0 - 1000 * (-bi)) y2 = int(y0 - 1000 * (ai)) cv2.line(imgshow, (x1, y1), (x2, y2), color, 1) # 得到直线中的两个点,方便计算直线方程 def theta_rho_to_xxyy(theta, rho): ai = np.cos(theta) bi = np.sin(theta) x0 = ai * rho y0 = ...
Python
1
ub struct HelpState { area: ScreenArea, // where the help is drawn } impl HelpState { pub fn new(screen: &Screen) -> HelpState { let mut state = HelpState { area: ScreenArea::new(1, 1, 1), }; state.resize_area(screen); state } fn build_verbs_table(&self, text...
Rust
0
_language_identifier("En-uS", Some("en"), None, Some("US"), None); assert_parsed_language_identifier("eN-lAtN-uS", Some("en"), Some("Latn"), Some("US"), None); assert_parsed_language_identifier("ZH_cyrl_hN", Some("zh"), Some("Cyrl"), Some("HN"), None); } #[test] fn test_serialize_langid() { let langid: Lan...
Rust
0
# Load cache data if self.cached_range.end > 0: cache_nodes_mask = (nodes >= self.cached_range.start) & (nodes < self.cached_range.end) cache_request_nodes = torch.masked_select(nodes, cache_nodes_mask) cache_part_orders = torch.masked_select(input_orders, cache_nodes_mask) ...
Python
1
#(©)MrGhostsx import os import logging from dotenv import load_dotenv from logging.handlers import RotatingFileHandler load_dotenv() #Bot token @Botfather TG_BOT_TOKEN = os.environ.get("TG_BOT_TOKEN", "") #Your API ID from my.telegram.org APP_ID = int(os.environ.get("APP_ID", "")) #Your API Hash from my.telegram.o...
Python
1
_many_messages() { run_test(|| { assert_noop!( Pallet::<TestRuntime, DefaultInstance>::receive_messages_proof( Origin::signed(1), TEST_RELAYER_A, Ok(vec![message(1, REGULAR_PAYLOAD)]).into(), u32::MAX, 0, ), Error::<TestRuntime, DefaultInstance>::TooManyMessagesInTheProof, )...
Rust
0
ptions """ # Inputs shape embedding_matrices_shapes = [(98, 30), (100, 30)] # Create embedding matrices embedding_matrices = [np.random.normal(size=shape) for shape in embedding_matrices_shapes] # Sequence length lower than 1 with pytest.raises(ValueError) as excinfo: ContextualDynami...
Python
1
); /// /// // check eigen-decomposition (similarity transformation) of a /// // symmetric matrix with real-only eigenvalues and eigenvectors /// let a_copy = Matrix::from(&data); /// let lam = Matrix::diagonal(&l_real); /// let mut a_v = Matrix::new(m, m); /// let mut v_l = Matrix::new(m, m); /// let mut err = Matrix::...
Rust
0
c3 = Rgb565::from(c2); assert_eq!(c, c3); } for b in 0..=Rgb565::MAX_B { let c = Rgb565::new(0, 0, b); let c2 = Rgb888::from(c); let c3 = Rgb565::from(c2); assert_eq!(c, c3); } } /// Calls the given function with every combi...
Rust
0
path) = &config.patch_settings.trilogy_iso { Some(crate::extract_flaahgra_music_files(&path)?) } else { None } } else { None }; let config = config; let mut banner = Some(ConfigBanner { game_name: Some(String::from("Metroid Prime")), deve...
Rust
0
u8>, bytes: impl AsRef<[u8]>) -> EncodeResult<()> { let bytes = bytes.as_ref(); let len = bytes.len(); if len <= std::u8::MAX as usize { buffer.push(len as u8); buffer.extend(bytes); Ok(()) } else { Err(EncodeError::TooManyBytes) } } /// Convert a `std::net::IpAddr` ...
Rust
0
&FetchThumbnailsRequest { photo_guids })? .recv_json::<FetchThumbnailsResponse>(), )? // ...and then process the result. .items .into_iter() .map(|(k, v)| (k, v.as_url())) .collect(); Ok(result) } // // Types corresponding to the externally-defined JSON format // /// Request bo...
Rust
0
String>, body: Vec<String>, source: Vec<String>, created_on: Vec<String> } /// /api/docs-to-csv #[get("/api/docs-to-csv")] pub fn documents_to_csv_json(cookies: Cookies, db: State<Database>) -> Json<UserDocCsvList> { let query_doc = match get_username_from_cookie(&db, cookies.get(JWT_NAME)) { So...
Rust
0
self.clearModel() out_f = os.path.join(cfg.RENDERING.BLENDER_TMP_DIR, 'tmp.obj') occupancy = pred > thresh vertices, faces = voxel2mesh(occupancy) with contextlib.suppress(IOError): os.remove(out_f) write_obj(out_f, vertices, faces) # Load the obj ...
Python
1
_global_destroy, self.ptr); // free the user data let data = Box::from_raw(self.data); drop(data); } } } pub(crate) unsafe extern "C" fn global_bind<I: Interface>( client: *mut wl_client, data: *mut c_void, version: u32, id: u32, ) { // safety of this...
Rust
0
-> RQResult<()> { let req = self.engine.read().await.build_delete_online_push_packet( self.uin().await, push.svrip(), Bytes::from(push.push_token.unwrap_or_default()), pkt_seq as u16, vec![], ); let _ = self.send(req).await?; i...
Rust
0
-like control. Make sure to call `Cursor::release` to remove the capture. A control that has captured the mouse will receive mouse events even if the mouse is not hovering it. Will panic if the control handle passed to the method is not a window or if the control is not yet initialized. ...
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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
"""Exporter Engine.""" from __future__ import annotations import logging from configparser import ConfigParser from typing import Dict, List from TEx.exporter.exporter_base import BaseExporter from TEx.exporter.pandas_rolling_exporter import PandasRollingExporter from TEx.models.facade.finder_notification_facade_enti...
Python
1
ute type", "info": "Whether to use mixed precision training (fp16 or bf16)."}, "ru": {"label": "Тип вычислений", "info": "Использовать ли обучение смешанной точности fp16 или bf16."}, "zh": {"label": "计算类型", "info": "是否使用混合精度训练(fp16 或 bf16)。"}, }, "batch_size": { "en": {"label": "Batch s...
Python
1
import asyncio import logging from collections.abc import AsyncIterable from slimrpc.context import Context from slimrpc.examples.simple.types.example_pb2 import ExampleRequest, ExampleResponse from slimrpc.examples.simple.types.example_pb2_slimrpc import ( TestServicer, add_TestServicer_to_server, ) from slim...
Python
1
example.rs` and `package.api.another_example.rs` /// result will look like this: /// /// If ['OUT_DIR'] won't work for you (when you set [tonic_build] to save files /// in other directory or for some other reason) you can set 'TIP_OUT_DIR' environment variable /// to point on the directory you need /// /// ```rust ///...
Rust
0
"room_graph": G, "room_table": room_table } def save_table_as_image(self, table_data, output_path): """将表格保存为图片 Args: table_data (list): 表格数据 output_path (str): 输出图像的保存路径 """ if not table_data: return ...
Python
1
l_metrics (list): 额外需要收集的指标列表,可能包含 'fp64', 'fp32', 'fp16' 返回: dict: 包含所有收集到的指标的字典 """ metrics = {} gpu_data_list = [] # 确保是列表,避免 None additional_metrics = additional_metrics or [] # 先根据要提交的任务算出总任务数 num_tasks = 1 if 'CPU' in additional_metrics: num_tasks += 2 # cpu_u...
Python
1
import pandas # Read and work with a file named 'words.csv' df = pandas.read_csv('words.csv') print(df) # This will display first few rows from the words.csv file
Python
1
from __future__ import division, print_function import numpy import batman from transitleastsquares import transitleastsquares if __name__ == "__main__": print("Starting test: uncertainties...", end="") numpy.random.seed(seed=0) # reproducibility # Create test data start = 48 days = 365.25 * 3 ...
Python
1
"Self\.", NoExpand("")); // Module|Address. ~> Module|Address:: let contents = replace!(contents, r"(([A-Z]\w*)|(\}\})|(0x\d+))\.", "$1::"); // add fun keyword to functions let contents = replace!( contents, r"(((public|native| )*))(\w+\(.*\).*\{)", |cap: &Captures| format!("{}fu...
Rust
0
.len() > 3 { None } else { Some(s) }), ))), )), ))(input) } pub fn parse_amount<'a>(input: &'a str) -> IResult<&'a str, Amount> { map_res( tuple(( digit1, opt(preceded( char('.'), map...
Rust
0
ivLoss(reduction='batchmean') print("Training DEC...") for epoch in range(30): model.train() total_loss = 0 for batch in pretrain_loader: x_batch = batch[0].to(device) _, z = model(x_batch) q = clustering_layer(z) p = target_distribution(q).detach() loss = kl_loss(to...
Python
1
y = {}", self.simplify)); if self.simplify && self.tolerance != config::DEFAULT_TOLERANCE { lines.push(format!("tolerance = \"{}\"", self.tolerance)); } } match self.query_limit { Some(ref query_limit) => lines.push(format!("query_limit = {}", query_li...
Rust
0
} #[test] fn use_vowel_letter_spoofing_092() { assert_eq!( shape( "tests/fonts/in-house/46669c8860cbfea13562a6ca0d83130ee571137b.ttf", "\u{11680}\u{116B4}", "", ), "u11680=0+500|\ uni25CC=0+500|\ u116B4=0+500" ); } #[test] fn use_v...
Rust
0
اسراو: %s', 'cy': 'Enw anhysbys: “%s”.', 'cs': 'Neznámý název: „%s“.', 'da': 'Ukendt navn: “%s”.', 'de': 'Unbekannter Name: „%s“.', 'dsb': 'Njeznate mě: “%s”.', 'el': 'Άγνωστο όνομα: “%s”.', 'eo': 'Nekonata nomo: „%s”.', 'es': 'Nombre desconocido: «%s».', 'et': 'Tundmatu nimi: „%s”.', 'eu': 'Izen ezezaguna: “%s”.', 'f...
Python
1
""" - This module is responsible for handling the /admin command """ from pyrogram.enums import ChatType from pyrogram.types import Message from sqlalchemy.orm import Session from .utils import Utils from database import DbClient async def handle_admin_command(update: Message, session: Session) -> None: """ ...
Python
1
#查找出数组中重复奇数次的一个整数。空间复杂度O(1) def odd_showup(data): eor=0 for item in data: eor^=item #一个位上两个相同的值异或,结果为0 所以偶数个数字会相互抵消 return eor #查找出数组中重复奇数次的两个整数。空间复杂度O(1) def odd_showup_two(data): eor1=0 for item in data: eor1^=item oct2bin(eor1) rightmost_set_bit = eor1 & -eor1 # ...
Python
1
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.corehr.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
".to_vec(), b"200".to_vec())], vec![]); assert_eq!(resp.status_code().ok().unwrap(), 200); } { // Extra headers => still works let resp = Response::new( 1, vec![(b":status".to_vec(), b"200".to_vec()), ...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not ...
Python
1
OL_LIB.avail_oprs_type_: if type_ == AOL_LIB.int: nums.append(int(char)) else: ops.append(char) if not len(nums) == 0 and not len(ops) == 0: if len(nums) == len(ops) + 1: result = sel...
Python
1
from typing import List, Optional from app.core.context import MediaInfo from app.db.systemconfig_oper import SystemConfigOper from app.schemas import FilterRuleGroup, CustomRule from app.schemas.types import SystemConfigKey class RuleHelper: """ 规划帮助类 """ @staticmethod def get_rule_groups() -> ...
Python
1
.""" self.runner_obj.start_test() self.runner_obj.parse_results() class BgMonitor: """Bg Monitor Test. This util initialize back ground monitor and use BgRunner to runs TestUtils in back ground. This class help to start, stop and restart the monitors at different test stages i.e back ...
Python
1
for old_comic in old_comics: old_path = old_comic.pop("path") old_comic_values[old_path] = old_comic return MappingProxyType(old_comic_values) def extract_metadata(self, status=None) -> int: """Extract comic metadata into memory.""" count = 0 self.metad...
Python
1
(&self) -> &'static str { <$searcher>::name() } fn short_name(&self) -> &'static str { $short_name } fn best_move(&self, board : Board, depth : u16) -> Move { <$searcher>::best_move(board.pleco_board, depth) } } }; } implement_algorithm_trait!(MinMaxAlgorithm, pleco::bots::ParallelMiniMaxSearcher, ...
Rust
0
) << 1), (((3 << 3) + 1) << 2) - 1, (((7 << 2) - 1) << 2), ((((3 << 2) + 1)) << 3) + 1, (7 << 4), (3 << 5) + (1 << 1), (7 << 4) - 1, (3 << 5) + 1, (7 << 4) + (1 << 1), (((3 << 3) + 1) << 2), (5 << 4) + (1 << 1), (((3 << 3) + 1) << 2) + 1, (3 << 5) + 1, (((3 << 3) + 1) << 2), (((1 << 4) + 1) << 1), (((3 << 3) - 1) << 2)...
Python
1
quad.object, ENCODED_DEFAULT_GRAPH, )) }), ) } else { self.store .encoded_quads_for_pattern(subject, predicate, object, graph_name) } } pub fn encoder<'a>(...
Rust
0
to_workspaces(window: &mut Window, workspaces: &[Workspace]) -> bool { for workspace in workspaces { if snap_to_workspace(window, &workspace) { return true; } } false } fn snap_to_workspace(window: &mut Window, workspace: &Workspace) -> bool { if should_snap(window, workspac...
Rust
0
print("\033[34m", "Welcome to your adventure story simulator!", "\033[37m") print( "First, I am going to ask you some questions to personalise this story for you." ) print() print("\033[32m") userName = input("What is your name?: ") print("\033[31m") worstEnemy = input("Who is your worst enemy?: ") print("\033[33m"...
Python
1
, LivingRoom = 5, StoneRoom = 6, Auditorium = 7, ConcertHall = 8, Cave = 9, Arena = 10, Hangar = 11, CarpettedHallway = 12, Hallway = 13, StoneCorridor = 14, Alley = 15, Forest = 16, City = 17, Mountains = 18, Quarry = 19, Plain = 20, ParkingLot = 21, ...
Rust
0
# -*- coding: utf-8 -*- # Part of the PsychoPy library # Copyright (C) 2012-2020 iSolver Software Solutions (C) 2021 Open Science Tools Ltd. # Distributed under the terms of the GNU General Public License (GPL). import psychopy.logging as logging try: from psychopy_eyetracker_pupil_labs.pupil_labs.pupil_core.pupi...
Python
1
 :Xc@sdgZddlZddlZddlZddlZddlZddlZddlZddl Zddl m Z m Z m Z ddlmZddlmZddlmZddlmZddlmZdd lmZdd lmZddlZd Zd Zd Ze e!fZ"d...
Python
1
= Navigator::new(scene, &camera); let logger = Logger::new("ShapeView"); let theme_manager = theme::Manager::from(&scene.style_sheet); let theme1 = theme::Theme::new(); theme1.set("base_color", color::Rgba::new(0.0, 0.0, 1.0, 1.0)); theme1.set("animation.duration", 0.5); theme1.set("graph.nod...
Rust
0
//////// // // // // // // //////// // // // // // /// //////// "#; const C: &str = r#" ****** **////** ** // /** /** //** ** //****** ////// "#; const C_SHARP: &str = r#" ****** **////** ** ** ** // ************ /** ///**////**/ /*...
Rust
0
import pytest from pysisyphus.calculators.AnaPot import AnaPot from pysisyphus.cos.GrowingString import GrowingString from pysisyphus.cos.NEB import NEB from pysisyphus.optimizers.SteepestDescent import SteepestDescent from pysisyphus.optimizers.StringOptimizer import StringOptimizer from pysisyphus.optimizers.RFOptim...
Python
1
urn around | head | bow @unique class RobotBuiltInMotion(Enum): """机器人内置动作 :meta private: """ #重置 reset = "reset" #举手 handsUp = "raise" #蹲下 crouch = "crouch" #挑衅 comeOn = "come on" #舒展手 stretch = "stretch" #摆手 wave = "wave" #弯腿 bend = "bend" #行走 ...
Python
1
from __future__ import annotations import zlib from io import BytesIO import pytest from PIL import Image, ImageFile, PngImagePlugin TEST_FILE = "Tests/images/png_decompression_dos.png" def test_ignore_dos_text(monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.setattr(ImageFile, "LOAD_TRUNCATED_IMAGES", T...
Python
1
""" Copyright (C) 2015- enen92 This file is part of screensaver.atv4 - https://github.com/enen92/screensaver.atv4 SPDX-License-Identifier: GPL-2.0-only See LICENSE for more information. """ import xbmcaddon import xbmcgui addon = xbmcaddon.Addon() addon_path = addon.getAddonInfo("path") addon_icon = addo...
Python
1
listen::listen_task(listen_sock, lookup_sock, query_map, route, tx).await } }); let lookup_handle = tokio::spawn({ let lookup_sock = lookup_sock.clone(); let tx = tx.clone(); async move { lookup::lookup_task(lookup_sock, tx).await } }); let reply_handle = tokio::spawn({ ...
Rust
0
for j in range(num_agents): # goal_points[j] = [9999, 9999] # agent[j].EXIT = False agent[j].Perception_PR = 0 # agent[j].Max_Perception_Angle = 360 # agent[j].count_rerotation = 0 ...
Python
1
([ DiscriminatorS(use_spectral_norm=True), DiscriminatorS(), DiscriminatorS(), ]) self.meanpools = nn.ModuleList([ AvgPool1d(4, 2, padding=2), AvgPool1d(4, 2, padding=2) ]) def forward(self, y, y_hat): y_d_rs = [] y...
Python
1
&& (((*strm).last_mid_delivered as uint16_t as libc::c_int - (*control).mid as uint16_t as libc::c_int) as uint16_t as libc::c_uint) < (1u32) << 15i32) as libc::c_int } != 0 { /* The incoming sseq is behind where we last delivered? */ ...
Rust
0
_type_dec), "::", stringify!(refcount) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<lysc_type_dec>())).fraction_digits as *const _ as usize }, 24usize, concat!( "Offset of field: ", stringify!...
Rust
0
cx leal 1f, %edx 1: sysenter movl %ebp, %ecx popl %ebp" : "={bx}" (badge), "={si}" (info.words[0]), "={di}" (msg0), "={cx}" (msg1) : "{bx}" (dest), "{si}" (msgInfo.words[0]), "{di}" (msg0), "{cx}" (...
Rust
0
from typing import List def separate_paren_groups(paren_string: str) -> List[str]: """ Input to this function is a string containing multiple groups of nested parentheses. Your goal is to separate those group into separate strings and return the list of those. Separate groups are balanced (each open brace...
Python
1
import re from typing import Annotated, List, Union import sqlalchemy as sa import sqlalchemy.orm as orm from msgspec import Meta, Struct, to_builtins from sqlalchemy.ext.orderinglist import ordering_list from nextgisweb.env import Base, gettext from nextgisweb.resource import Resource, ResourceGroup, SAttribute, Se...
Python
1
# ext/babelplugin.py # Copyright (C) 2006-2016 the Mako authors and contributors <see AUTHORS file> # # This module is part of Mako and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """gettext message extraction via Babel: http://babel.edgewall.org/""" from babel.messages.extr...
Python
1
key(&server_private_key); let query_a = pack_unsigned_query(b"top secret data", &server_public_key).unwrap(); let query_b = pack_unsigned_query(b"top secret data", &server_public_key).unwrap(); // Check that each query has a different secret assert_ne!(query_a.1.as_bytes().to_vec(), query_b.1.as_bytes...
Rust
0
, matches.len()); let m = matches.iter().nth(0).unwrap(); assert_eq!(m.pattern, "Sequence"); assert_eq!(m.start, 0); assert_eq!(m.end, 9); assert_eq!(m.token, "123456789"); match m.data { MatchData::Sequence{ref name, ref space, ref ascending} => { assert_eq!(*name, "digits")...
Rust
0
import numpy as np from typing import List, Union, Dict import pandas as pd try: from typing import Literal except ImportError: from typing_extensions import Literal from finworld.registry import AGENT from finworld.task import TaskType from finworld.utils import TimeLevel, TimeLevelFormat @AGENT.register_mo...
Python
1
uest" in folder: model_request_file = file_name.replace(".py", "") model_request_class = class_name if "model/response" in folder: model_response_file = file_name.replace(".py", "") model_response_class = class_name # __init__.py 파일 내용...
Python
1
of, which is usually so high that you absolutely must not set //! sink input volume to 100% unless the the user explicitly requests that (note that usually you //! shouldn’t set the volume anyway if the user doesn’t explicitly request it, instead, let //! PulseAudio decide the volume for the sink input). With flat volu...
Rust
0
#solution K, S = input().split() K = int(K) S = list(S) N = len(S) F = 0 change = lambda x: "1" if x == "0" else "0" if K == 2: A = "01" * (N // 2) + ("0" if N % 2 != 0 else "") B = "10" * (N // 2) + ("1" if N % 2 != 0 else "") count_A = sum(1 for a, s in zip(A, S) if a != s) count_B = sum(1 for b, s i...
Python
1
ith_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [spi_idr](spi_idr) module"] pub type SPI_IDR = crate::Reg<u32, _SPI_IDR>; #[allow(missing_docs)] #[doc(hidden)] pub struct _SPI_IDR; #[doc = "`write(|w| ..)` meth...
Rust
0