text
string
label_name
string
labels
int64
import os import sys import pygame def fix_font_issue(): """Fix the Telugu font issue by using a system font instead""" print("Attempting to fix Telugu font issue using system fonts...") # Initialize pygame pygame.init() pygame.font.init() # Get the absolute path to the game directory...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.model import BaseRequest from lark_oapi.core.enum import HttpMethod, AccessTokenType from .add_enum_option_common_data_meta_data_request_body import AddEnumOptionCommonDataMetaDataRequestB...
Python
1
import random import time import streamlit as st # Streamed response emulator def response_generator(): response = random.choice( [ "Hey there! Need help? Check out my fun YouTube channel 'CodingIsFun': https://youtube.com/@codingisfun!", "Hi! What's up? Don't forget to subscribe ...
Python
1
"#, ]; assert!(!log_entries .into_iter() .map(|e| LogEntryFrom::from_str(e)) .any(|r| r.is_err())); } } mod support; use self::support::*; use tracing::{self, subscriber::with_default, Level}; use tracing_subscriber::{ filter::{EnvFilter, LevelFilter}, pr...
Rust
0
f update_key(k: str, v: str): if not k in keys.keys(): gr.Info(f"{k} created!") keys[k] = v return gr.update( value=keys ) ...
Python
1
ast_builder.pat().build_path(resume_path) } else { ast_builder.pat().enum_().build(resume_path) .with_pats(pats) .build() } }; let internal_path = self.state_path(block, StateKind::Internal); let co...
Rust
0
status_ack) async def handle_command_result(self, robot_id, data): """处理命令执行结果""" command_id = data.get('command_id') result = data.get('result') message = data.get('message', '') self.logger.info(f"🔧 机器人 {robot_id} 命令执行结果: {result} - {message}") ...
Python
1
ettimeofday(tv_u: *mut timeval_t) -> Result<(), Error> { check_mut_ptr(tv_u)?; let tv = time::do_gettimeofday(); unsafe { *tv_u = tv; } Ok(()) } const MAP_FAILED: *const c_void = ((-1) as i64) as *const c_void; #[no_mangle] pub extern "C" fn occlum_mmap( addr: *const c_void, length...
Rust
0
None); for (i, &j) in self.0.iter().enumerate() { assert!(r[j].is_none()); r[j] = Some(i); } Permutation(r.into_iter().flatten().collect()) } } impl<F: Clone> LinearOperator<F> for Permutation { fn op(&self, vec: &[F]) -> Vec<F> { let n = self.0.len(); ...
Rust
0
<T> = (depth, ipix + i).into(); result.push(rng.0); target_val = target_val.sub(subcell_val); i += One::one(); } assert!(i < four && target_val >= V::zero()); //if i < four && target_val > V::zero() { result = recursive_descent( depth, ipix + i, max_depth, subcell_val...
Rust
0
`]. /// Returns the [`Response`] with the specified attributes if the operation was successful, or a [`ContractError`] if the contract was not created /// ## Params /// * **deps** is the object of type [`DepsMut`]. /// /// * **env** is the object of type [`Env`]. /// /// * **_info** is the object of type [`MessageInfo`...
Rust
0
u.read(0x4015) & 0b0000_0100, 0b0000_0100); apu.write(FRAME_COUNTER_REGISTER, 0x00); apu.write(FRAME_COUNTER_REGISTER, 0x00); assert_eq!(apu.read(0x4015) & 0b0000_0100, 0b0000_0100); } #[test] fn writing_0x00_into_0x4017_should_not_clock_triangle_channel_linear_counter() { l...
Rust
0
rmatError(unittest.TestCase): def test_errors(self): def test_ncl(): input_shape = (1, 2, 3, 4) pad = paddle.to_tensor(np.array([2, 1, 2, 1]).astype('int32')) data = ( np.arange(np.prod(input_shape), dtype=np.float64).reshape( ...
Python
1
Value::SingleQuotedString("test".to_string()))) }), op: BinaryOperator::And, right: Box::new(BinaryOp { left: Box::new(MapAccess { column: Box::new(Identifier(Ident::new("string_value"))), keys: vec![Expr...
Rust
0
1_u32), Some(&vec![1_i32, 2, 3])); } #[test] fn test_get() { let mut bst: BST<u32, i32> = BST::new(); bst.put(1_u32, -1_i32); assert_eq!(bst.get(&1_u32), Some(&-1_i32)); assert_eq!(bst.get(&10_u32), None); assert_eq!(bst[&1_u32], -1_i32); } #[test] #[sho...
Rust
0
_name), self.choices.field.label_from_instance(obj)) for obj in self.choices.queryset.using(self.db).filter( **{"%s__in" % to_field_name: selected_choices} ) ) for option_value, option_label in choices: selected = str(option_value) in value and ( ...
Python
1
map_err(|s| anyhow!(s))?; let (view, doc) = current!(cx.editor); let success = doc.later(view.id, uk); if !success { cx.editor.set_status("Already at newest change"); } Ok(()) } fn write_quit( cx: &mut compositor::Context, args: &[Cow<str>], event: PromptEvent, ) -> anyhow::Res...
Rust
0
from solution import * from solution import kthSmallest, TreeNode def create_bst_from_levels(elements): if not elements: return None root = TreeNode(elements[0]) queue = [root] i = 1 while i < len(elements): current = queue.pop(0) if elements[i] is not None: cur...
Python
1
raise def merge_and_save_symbols(self, sp500_df: pd.DataFrame, nasdaq100_df: pd.DataFrame) -> None: """Merge SP500 and NASDAQ100 DataFrames and save to configured file. Args: sp500_df: DataFrame with SP500 symbols and their addition dates nasdaq100_df: DataFram...
Python
1
// to stress truncation issues from u64 <-> u32 mapping of the // abstraction. let input = vec![("esp", 32u32), ("eip", 1600)].into_iter().collect(); let stack = vec![0; 1600]; let mut walker = TestFrameWalker::new(stack, input); // Addition! walker.caller_regs....
Rust
0
_service_impl; pub mod launch_as_process; pub mod launch_as_thread; pub mod sandboxed_execution_controller; #[macro_use] extern crate failure; pub extern crate wagyu_bitcoin as bitcoin; pub extern crate wagyu_ethereum as ethereum; pub extern crate wagyu_model as model; pub extern crate wagyu_monero as monero; pub exte...
Rust
0
_t = x_ts[:, i] x_t = r_t[0] y_t = r_t[1] r_dot_t = x_dot_ts[:, i] x_dot_t = r_dot_t[0] y_dot_t = r_dot_t[1] r_offset = np.array([2 * L, 0]) r_t_norm = np.linalg.norm(r_t) r_diff_norm = np.linalg.norm(r_t - r_offset) q_1_i = np.arctan2(y_t, x_t) ...
Python
1
#Name: Colin Opitz #Class: 6th Hour #Assignment: HW22 #1. Create a class containing a def function that inits self and 3 other attributes for store items (stock, cost, and weight). class Items: def __init__(self, stock, cost, weight): self.stock = stock self.cost = cost self.weight = weight...
Python
1
}; let variant = match state.variant { Cow::Owned(ref variant) => variants.get(variant), Cow::Borrowed(variant) => variants.get(variant), } .unwrap(); let mut model = Model::load(&variant.model, assets, &mut atl...
Rust
0
pe, context.config) .tactic(tactic) .trailing_separator(trailing_separator) .ends_with_newline(tactic.ends_with_newline(context.config.indent_style())) .preserve_newline(true); (write_list(&item_vec, &fmt)?, tactic) }; let args = if tactic == DefinitiveLi...
Rust
0
Given let mut vocab_file = tempfile::NamedTempFile::new()?; write!(vocab_file, "{{\"hello\": 1,\n \"world\": 0,\n \"\": 2,\n \"!\": 3\n}}")?; let path = vocab_file.into_temp_path(); let gpt2_vocab = Gpt2Vocab::from_file(path.to_path_buf().to_str().unwrap()); // When & Then ...
Rust
0
import time def read_hex_value(filename): with open(filename, 'r') as file: hex_value = file.read().strip() return int(hex_value, 16) def calculate_hex_diff(new_value, old_value): return round((new_value - old_value) *64 / (1024 * 1024), 1) def print_decimal_value(desp, value1): print(f...
Python
1
error("'{function}' fonksiyonu sadece {expected} parametresini kabul ediyor")] #[strum(message = "140")] FunctionExpectedThatParameterType { function: String, expected: String }, #[error("Doğrulama başarısız (Sol: {left:?}, sağ: {right:?})")] #[strum(message = "141")] Assert...
Rust
0
~"HOME", ~"/home/MountainView"); setenv(~"USERPROFILE", ~"/home/PaloAlto"); assert os::homedir() == some(~"/home/MountainView"); option::iter(oldhome, |s| setenv(~"HOME", s)); option::iter(olduserprofile, |s| setenv(~"USERPROFILE", s)); } // Issue...
Rust
0
DETACH DELETE n """ tx.run(delete_query) tx.commit() with session.begin_transaction() as tx: schema_delete_query = """ SHOW ALL CONSTRAINTS YIELD name RETURN name """...
Python
1
import json import warnings from collections.abc import AsyncGenerator import uvicorn from acp_sdk.models import Message from acp_sdk.server import Context, RunYield, RunYieldResume, agent, create_app from dotenv import load_dotenv from fastapi.responses import HTMLResponse from frontend.landing_page import render_la...
Python
1
distances = (0, 1, 2, 3, 4, 5, 4, 3, 2, 1) # Cheapest insertion - often better than nearest neighbor def christofides_approx(points, start_pos=None): if start_pos: cur_x, cur_y = start_pos else: cur_x = get_pos_x() cur_y = get_pos_y() if not points: return [] # Start with closest point min_dis = 20 fir...
Python
1
import cv2 import time import numpy as np import os import logging import time from src.mumu_adb import MuMuADB from src.monitoring import MuMuMonitor class QuitMailOperation: def __init__(self, adb_path="D:\\Program Files\\Netease\\MuMuPlayer-12.0\\shell\\adb.exe", adb_port="16384"): self.adb_path, self.a...
Python
1
pixel values, [0,255]). (default 5) /// - aprilTagDeglitch: should the thresholded image be deglitched? Only useful for very noisy images. (default 0) /// - aprilTagQuadDecimate: Detection of quads can be done on a lower-resolution image, improving speed at a /// cost of pose accuracy and a slight decrease in detect...
Rust
0
(b" EMC"); } /* The name transform_info is misleading. * I'll put this here for a moment... */ /* Physical dimensions * * If those values are given, images will be scaled * and/or shifted to fit within a box described by * those values. */ /* transform matrix */ /* user_bbox */ pub unsafe fn pdf_dev_reset_globa...
Rust
0
from flask import Flask, request, jsonify, render_template, redirect, url_for import json import os import requests from datetime import datetime import pytz from bs4 import BeautifulSoup from dotenv import load_dotenv from search_engine import WebSearch from response_processor import ResponseProcessor import traceback...
Python
1
def dfs(scr_ptrs: list[int], dst: list[int], starting_node: int) -> list[int]: """we take a matrix in CRS format as an input and we return levels for all elements""" assert ( 0 <= starting_node < len(scr_ptrs) ), f"Staring node not among the {len(scr_ptrs)} nodes of input" ### init levels l...
Python
1
# -*- coding: utf-8 -*- from typing import List from django.core.management.base import BaseCommand from django.core.management.utils import get_random_secret_key from django_extensions.management.utils import signalcommand class Command(BaseCommand): help = "Generates a new SECRET_KEY that can be used in a pro...
Python
1
str = "k"; /// Path construction /// Move to point pub(crate) const OP_PATH_CONST_MOVE_TO: &str = "m"; /// Straight line to the two following points pub(crate) const OP_PATH_CONST_LINE_TO: &str = "l"; /// Cubic bezier over four following points pub(crate) co...
Rust
0
# Find closed loop i1, i2 = -1, -1 i = len(track) while True: i -= 1 if i == 0: return False pass_through_start = ( track[i][0] > start_alpha and track[i - 1][0] <= start_alpha ) if pass_through_start and i2 == -1: i2 = i ...
Python
1
""" Frontend package for CPU Scheduler Simulator Contains GUI components and visualization tools """
Python
1
LEN: self.signing.sig_count += 1 if self.signing.secret_key is not None: accept_signature = False if signature_len == MAVLINK_SIGNATURE_BLOCK_LEN: sig_ok = self.check_signature(msgbuf, srcSystem, srcComponent) accept_signature = sig_ok ...
Python
1
for_interaction(self) -> Tuple[bool, str]: """Determine if now is a good time for interaction""" if self.current_presence == PresenceState.AWAY: return False, "User is away" if self.current_presence == PresenceState.GAMING: return False, "User is gaming" if sel...
Python
1
ACK => 1, Peice::WHITE => -1, Peice::EMPTY => 0, } } pub fn draw(&self) { let ctx = &self.context; let game = &self.game; //draw background // ctx.begin_path(); ctx.set_fill_style(&JsValue::from_str("#009933")); ctx.fill_rect(0.0, ...
Rust
0
bprocess.PIPE, stderr=subprocess.PIPE, text=True ) print("\n▶ 等待服务启动...") # 等待服务启动 max_retries = 5 for i in range(max_retries): try: time.sleep(2) # 增加等待时间到2秒 ...
Python
1
cpServers"][server_name]["isActive"] = False return self._save_config(config) def enable_server(self, server_name: str) -> bool: """Re-enable a previously disabled server by setting isActive to True Args: server_name: Name of the server to enable Returns: ...
Python
1
nce_test .with_community_token_deposit(&realm_cookie) .await; governed_token_cookie.transfer_token_owner = false; // Act let err = governance_test .with_token_governance_using_instruction( &realm_cookie, &governed_token_cookie, &token_owner_recor...
Rust
0
12 { dp[i+1][nex][k] += dp[i][j][k]; dp[i+1][nex][k] %= mod_number; } }, _ => unreachable!(), } } } } } for i in 0....
Rust
0
'ha': 'Nepali', 'he': 'נפאלית', 'hi': 'नेपाली', 'hi-Latn': 'Nepali', 'hr': 'nepalski', 'hsb': 'nepalšćina', 'hu': 'nepáli', 'hy': 'նեպալերեն', 'ia': 'nepalese', 'id': 'Nepali', 'ig': 'Nepali', 'is': 'nepalska', 'it': 'nepalese', 'ja': 'ネパール語', 'jmc': 'Kyinepali', 'jv': 'Nepal', 'ka': 'ნეპალური', 'kab': 'Tanipalit', 'ka...
Python
1
# themselves from the list of open files for (dir, files) in list(open_files.values()): for f in list(files): f.close() while len(open_files) > 0: (k, v) = open_files.popitem() (dir, files) =...
Python
1
import sys # 촌수를 계산하기 위한 DFS 함수 def DFS(start,end,visited): # target1부터 target2를 탐색해나감 stack =[start] visited[start]=1 while stack: now = stack.pop() # target2를 찾은 경우 함수 종료 if now == end: return visited[now]-1 # 인접리스트 탐색 for next in connection[now]: ...
Python
1
olumn for columns::Orphans {} impl ColumnName for columns::Orphans { const NAME: &'static str = ORPHANS_CF; } impl TypedColumn for columns::Orphans { type Type = bool; } impl SlotColumn for columns::Root {} impl ColumnName for columns::Root { const NAME: &'static str = ROOT_CF; } impl TypedColumn for colum...
Rust
0
k semantic mask gt_semantic_seg = gt_semantic_seg.astype(np.int64) assert -1 not in np.unique(gt_semantic_seg).astype(np.int) results['gt_semantic_seg'] = gt_semantic_seg results['seg_fields'] = ['gt_semantic_seg'] # add panoptic_seg in "vps encoded format" for evaluation use --...
Python
1
_PRESENT = 1 << 7, // Descriptor privilege level const FLAGS_DPL_RING_0 = 0b00 << 5, const FLAGS_DPL_RING_1 = 0b01 << 5, const FLAGS_DPL_RING_2 = 0b10 << 5, const FLAGS_DPL_RING_3 = 0b11 << 5, // Is system descriptor const FLAGS_TYPE_SYS = 0 << 4, const ...
Rust
0
ext(), Some(Token { kind: TokenType::Colon, buf: Buffer::Span(Span { first: 8, end: 9 }), }) ); assert_eq!( it.next(), Some(Token { kind: TokenType::String, buf: Buffer::Span(Span { first: 10, end: 16 }), }) ); asser...
Rust
0
'a> $c<'a> { pub fn new(connection: &'a Connection, $($req_field: $req_type),*) -> $c<'a> { $c { connection: connection, $( $req_field: $req_field,)* $( $opt_field: $opt_default,)* } ...
Rust
0
trait Copy {} type ptr = *const u64; impl Copy for i8 {} impl Copy for i16 {} impl Copy for i32 {} impl Copy for i64 {} impl Copy for ptr {} macro_rules! check { ($func:ident $ty:ident $class:ident) => { #[no_mangle] pub unsafe fn $func(x: $ty) -> $ty { let y; asm!("{} = ...
Rust
0
PyTorch `torch.Tensor` objects. - `'np'`: Return NumPy `np.ndarray` objects. - `'jax'`: Return JAX `jnp.ndarray` objects. Returns: [`BatchEncoding`]: A [`BatchEncoding`] with the following fields: - **input_ids** -- List of token ids to be fed to ...
Python
1
Clone)] pub struct Message { timestamp: DateTime<Utc>, source: String, tags: BTreeMap<String, String>, metrics: BTreeMap<String, PayloadValue>, } impl Message { pub fn new(source: &str) -> Message { Message { timestamp: Utc::now(), source: String::from(source), ...
Rust
0
`name` | /// /// Note: the type `T` in the table above needs to implement `syn::parse::Parse`. /// /// With the above type as P (`bool` and `Flag` are excluded), you can also use the following types. /// /// | field type | effect | /// | -------------------- | -------...
Rust
0
0, extra_env={SHARD_INDEX_ENV_VAR: '0', TOTAL_SHARDS_ENV_VAR: '10'}, ) def _GetXmlOutput( self, gtest_prog_name, extra_args, extra_env, expected_exit_code ): """Returns the XML output generated by running the program gtest_prog_name. Furthermore, the program's exit code must be e...
Python
1
""" Многочлен P(x)=a_nx^n+a_(n−1)x^n−1+...+a_1x+a_0 с целыми коэффициентами можно представить в виде списка. При этом, если ai=0, то соответствующий элемент не включается в список. На рисунке показано общее представление многочлена и пример для S(x)=−5x_6+3x_2−x+7: Необходимо описать тип данных, соответствующий пред...
Python
1
strateHostFunctions>, Box< dyn CreateInherentDataProviders< RTestBlock, (), InherentDataProviders = ( FudgeInherentTimestamp, sp_consensus_babe::inherents::InherentDataProvider, sp_authorship::InherentDataProvider<RTestHeader>, FudgeDummyInherentRelayParachain<RTestHeader>, ), >, >, (...
Rust
0
le Safari/537.36{rc([f' OPR/{str(rr(10,80))}.{str(rr(0,1))}.{str(rr(1000,6999))}.{str(rr(10000,69999))}',f' HeyTapBrowser/{str(rr(6,49))}.{str(rr(7,8))}.{str(rr(2,40))}.{str(rr(1,9))}',f' OPT/{str(rr(1,2))}.{str(rr(0,9))}',f' PHX/{str(rr(4,14))}.{str(rr(0,9))}',f' T5/2.0 bdbrowser_i18n/{str(rr(4,7))}.{str(rr(0,19))}.{s...
Python
1
ResolvedTransaction { transaction: &transaction, resolved_deps: Vec::new(), resolved_inputs: vec![ResolvedOutPoint::cell_only(CellMeta { block_number: Some(30), cellbase: true, ..CellMeta::from(&CellOutput::new( capacity_bytes!(50), ...
Rust
0
# Copyright 2024 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, s...
Python
1
"""Main script to extract content from a PDF.""" from factory.extraction_factory import ExtractionFactory def main(): """Run the content extraction process.""" pdf_path = "19225-UNIT 3-notes.pdf" # Input PDF output_path = "unit3_output.txt" # Output text file print("Select an extraction method:"...
Python
1
info = ("Ernesto", "Ortega Adame", 18, "OEAE050920HDGRDRA9") Nombre, Apellidos, Edad, Curp = info print(Nombre) print(Apellidos) print(Edad) print(Curp)
Python
1
import pandas as pd import requests from bs4 import BeautifulSoup as bs def scrape_tablerows(): """This function scrapes the tablerows related to our target elements. Our target element here are the events of hactoberfest. Returns: tablerows[list]: A list of tablerows of our taget elements. ...
Python
1
generator.process(smiles)[1:] return features except ImportError: pass """ Custom features generator template. Note: The name you use to register the features generator is the name you will specify on the command line when using the --features_generator <name> flag. Ex. python train.py ... --features_ge...
Python
1
----Render Images from Habitat-Sim-----") with open(os.path.join(config["save_path"], 'render_config.yaml'), 'w') as outfile: yaml.dump(config, outfile, default_flow_style=False) start_time = time.time() total_render_num = Ts_cam2world.shape[0] for i in range(total_render_num): if i ...
Python
1
RawOp, regs: &mut Registers) { regs[raw.c] = regs[raw.a] * regs[raw.b]; } pub fn muli(raw: RawOp, regs: &mut Registers) { regs[raw.c] = regs[raw.a] * raw.b; } pub fn banr(raw: RawOp, regs: &mut Registers) { regs[raw.c] = regs[raw.a] & regs[raw.b]; } pub fn bani(raw: RawOp, regs: &mut Registers) { re...
Rust
0
s => Cell { ch: '"', fg: Color::Green, bg: Color::Black, bold: false, }, Tile::Tree => Cell { ch: '#', fg: Color::Green, bg: Color::Black, bold: false, }, ...
Rust
0
nks)) relevant_links += links self.seen_links.update(relevant_links) else: filtered_links = [ link for link in links if self._is_same_domain(link, source_url) ...
Python
1
white = [255, 255, 255] red = [255, 0, 0] green = [0, 255, 0] blue = [0, 0, 255] grey = [90, 90, 90] yellow = [255, 255, 0] purple = [255, 0, 255] orange = [255, 165, 0] dark_red = [139, 0, 0] light_pink = [255, 182, 193] hot_pink = [255, 105, 180] dark_turquoise = [0, 206, 209] deep_sky_blue = [0, 191, 255] off = [0,...
Python
1
format: Option<String>, pub table_rows: Option<u64>, pub avg_row_length: Option<u64>, pub data_length: Option<u64>, pub max_data_length: Option<u64>, pub index_length: Option<u64>, pub data_free: Option<u64>, pub auto_increment: Option<u64>, // pub create_time: Option<u64>, // pub up...
Rust
0
2; pub const CONF_ASPECT_4_3: _bindgen_ty_10 = 0; pub const CONF_ASPECT_16_9: _bindgen_ty_10 = 1; pub type _bindgen_ty_10 = u32; pub const CONF_SENSORBAR_BOTTOM: _bindgen_ty_11 = 0; pub const CONF_SENSORBAR_TOP: _bindgen_ty_11 = 1; pub type _bindgen_ty_11 = u32; pub type conf_pad_device = _conf_pad_device; #[repr(C, pa...
Rust
0
zero_message = [0u8; 64]; let pre_images: Vec<Vec<u8>> = (0..total_size).map(|_| zero_message.to_vec()).collect(); let mut current = hash(&zero_message); let mut offset = 0usize; let mut layer_size = total_size as usize; // XXX: On 32 bit architectures, this `as` cast may silently tru...
Rust
0
import matplotlib.pyplot as plt # Explicitly set the backend to 'Agg' to handle environments that may not be set up for interactive plotting plt.switch_backend('Agg') # Data for the pie chart fruit_labels = ['Apples', 'Oranges', 'Bananas'] fruit_sizes = [35, 45, 20] fruit_explode = (0.1, 0, 0) # Explode the 'Apples'...
Python
1
0., 0., 1.]] ); let transform_wr = arr2( &[[1., 0., 0., 3.], [0., 1., 0., 3.], [0., 0., 1., 10.], [0., 0., 0., 1.]] ); let e_key = calc_key_epipole(&transform_wk, &transform_wr); assert_eq!(e_key, arr1(&[0.3, 0.3])); ...
Rust
0
hoto_stats[date_key] yearly_stats[year]['photo_days'] += 1 current_date += timedelta(days=1) # 生成年度统计表格 markdown_content.append("| 年份 | 总天数 | 拍照天数 | 未拍天数 | 总照片数 | 拍照率 |") markdown_content.append("|------|--------|----------|----------|----------|...
Python
1
# Copyright (c) 2017 The University of Manchester # # 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 ...
Python
1
= True if self.convertWord2BitBase(value=int(recv_str_ary[0]), index=0) == 1 else False # 自動モード出力 # self.origin = True if self.convertWord2BitBase(value=int(recv_str_ary[0]), index=1) == 1 else False # 原点復帰完了 # self.seq_run = True if self.convertWord2BitBase(value=int(recv_str_ary[0]), index=2) ...
Python
1
Result<Vec<T>> where T: CRUDEnable; async fn list_by_wrapper<T>(&self, context_id: &str, w: &Wrapper) -> Result<Vec<T>> where T: CRUDEnable; async fn list_by_ids<T>(&self, context_id: &str, ids: &[T::IdType]) -> Result<Vec<T>> where T: CRUDEnable; } #[async_trait] impl CRUD for Rbatis { /// save one entit...
Rust
0
{Constrain, Constrainable, Solvable}, progress::BasicProgress, algorithm::Status as PlanningStatus, a_star, motion::{ Trajectory, Motion, collide::CircleCollisionConstraint, se2::{ self, Rotation, timed_position::{Waypoint, DifferentialDriveLineFollow}, ...
Rust
0
t) zps.append(zp) scales.append(scale) # cutouts_in.append((this_image-zp)/wt) cutouts_in.append(this_image) cutouts_in = torch.stack(cutouts_in)#.to(dtype=torch.complex128) centroids = torch.stack(centroids)#.to(dtype=torch.complex...
Python
1
os") sys.stdout.flush() with torch.no_grad(): global_info["model"], global_info["preprocess"] = clip.load(CLIP_VERSION, device=global_info["device"]) if global_info["multi_thread"] is not None: max_num_workers = mp.cpu_count() num_workers = min(max_num_workers,10) ...
Python
1
rt to ndarray float, take average over all frames background = result[camera].asArray().astype(float).mean(axis=0) camDevice = manager.getDevice(camera) expChan = camDevice.getExposureChannel() trigChans = camDevice.getTriggerChannels(expChan['device']) if trigChans['input'] is ...
Python
1
_MemDefault", || create_memdefault()); } #[test] #[cfg(feature = "encoder")] fn fmt_nondec_memminimum_32() { formatter_test_nondec(32, "Masm", "NonDec_MemMinimum", || create_memminimum()); } #[test] fn fmt_memalways_64() { formatter_test(64, "Masm", "MemAlways", false, || create_memalways()); } #[test] fn fmt_memd...
Rust
0
#c01 15 print all color from color list1 not contained in color list2. #create color list given as user input,use list comprehension list1=[i for i in input("enter the colors in list1: ").split()] list2=[i for i in input("enter the colors in list2: ").split()] result=[i for i in list1 if i not in list2] print("colors ...
Python
1
B[n1, n2] = np.dot(e1, e2) B[n2, n1] = B[n1, n2] B[:-1, :-1] /= np.abs(B[:-1, :-1]).max() # Build residual vector resid = np.zeros(self.diis_size + 1) resid[-1] = -1 # Solve pulay equations ci = np.linalg.solve(B, resid) # Calculate new ampli...
Python
1
ns) .set_directory(directory) .pick_file().await; file_handle.map(get_path).flatten() } #[cfg(not(target_arch = "wasm32"))] pub async fn select_file( save: bool, filetype: FileType, base_dir: Option<PathBuf>, ) -> Option<String> { let (filter_name, extensions) = filetype.filter_nam...
Rust
0
p_source tables: - name: abcd - name: efgh - name: ijkl """ abcd_sql = """ select * from {{ source("top_source", "abcd") }} """ efgh_sql = """ select * from {{ source("top_source", "efgh") }} """ ijkl_sql = """ select * from {{ source("top_source", "ijkl") }} """ models_yml = """ models: - n...
Python
1
new(texture))); true }, None => false } } fn get_ref(&self, name: &'static str) -> Option<TextureRc> { self.textures.find(&name).map(|rc| rc.clone()) } }use query_engine_tests::*; #[test_suite(schema(schema))] mod uuid_create_graphql { use indoc:...
Rust
0
&self, offset: Offset, config: ConsumerConfig, ) -> Result<impl Stream<Item = Result<Record, FluvioError>>, FluvioError> { let consumers = self .strategy .selection(self.pool.clone()) .await? .into_iter() .map(|(topic, partition)| P...
Rust
0
eError('Only one column for labels is allowed.') bad_data = [column for column in labels if labels[column].dtype.name not in PANDAS_DTYPES] if not bad_data: return labels.values else: error_report = ["'" + str(column) + "' type=" + str(labels[column].dtype....
Python
1
# -*- coding: utf-8 -*- """ Created on Wed Sep 10 23:51:02 2025 @author: jwang Problem Description: There are n children standing in a line. Each child is assigned a rating value given in the integer array ratings. You are giving candies to these children subjected to the following requirements: ...
Python
1
here](https://www.researchgate.net/publication/316558298_Date_Algorithms). /// /// ```rust /// # use time::{Date, macros::date}; /// assert_eq!(Date::from_julian_day(0), Ok(date!(-4713 - 11 - 24))); /// assert_eq!(Date::from_julian_day(2_451_545), Ok(date!(2000 - 01 - 01))); /// assert_eq!(Date:...
Rust
0
} //error if no more progress can be made to reduce error if val_best.abs() < 1E-12 { break; } let coeff = magnitude(&error) / val_best; // println!("val_best: {}, mag err: {}, coeff:{}", val_best, magnitude(&error), coeff ); if used[ idx_best ].is_none...
Rust
0
, C214(bool), C215(bool), C216(bool), C217(bool), C218(bool), C219(bool), C220(bool), C221(bool), C222(bool), C223(bool), C224(bool), C225(bool), C226(bool), C227(bool), C228(bool), C229(bool), C230(bool), C231(bool), C232(bool), C233(bool)...
Rust
0