text
string
label_name
string
labels
int64
rnalVersionInfo { type Err = VersionParseError; fn from_str(vs: &str) -> Result<Self, Self::Err> { let versions: Vec<u32> = vs.split('.').map(|s| s.parse::<u32>().unwrap()).collect(); if versions.len() != 3 { return Err(VersionParseError::IncorrectFormat(vs.to_string())); } ...
Rust
0
ool { *self == SRAM_CTRL2_A::DISABLE } #[doc = "Checks if the value of the field is `ENABLE`"] #[inline(always)] pub fn is_enable(&self) -> bool { *self == SRAM_CTRL2_A::ENABLE } } #[doc = "Write proxy for field `SRAM_CTRL2`"] pub struct SRAM_CTRL2_W<'a> { w: &'a mut W, } impl<'a...
Rust
0
self.multiply(&o) } } impl MulAssign<Quat> for Quat { fn mul_assign(&mut self, o: Quat) { *self = self.multiply(&o) } } impl MulAssign<&Quat> for Quat { fn mul_assign(&mut self, o: &Quat) { *self = self.multiply(&o) } } //#######################################################...
Rust
0
_____ // | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | // | Command Class = COMMAND_CLASS_METER(0x32) | // | Command = METER_GET(0x01) | // | Meter Type | ...
Rust
0
ext = self._sanitize_file_paths(text) # 清理系统信息 text = self._sanitize_system_info_in_text(text) return text def _sanitize_stack_trace(self, stack_trace: str) -> str: """清理堆栈跟踪""" if not isinstance(stack_trace, str): stack_trace = str(stack_trace) # 截断过长...
Python
1
if total > 0: print("Pass rate: {}{:.1f}%{}".format( GREEN if passed == total else RED, (passed/total)*100, RESET )) print(f"Total time: {total_time:.3f}s") print(f"Average time: {total_time/total:.3f}s") print(f"Average CPU usage: {total_cpu/t...
Python
1
stable_sorted(temp_dir.to_string()), // Stable sort, else the token_ids will be reorderer in the wrong order })) } else { None }; let parent_to_text_id = if field_config.is_index_enabled(IndexCreationType::ParentToTextID) { Some(Box::new(BufferedIndexWriter::new_for_sorted_id_inserti...
Rust
0
_derive; extern crate chrono; extern crate serde; extern crate serde_json; use chrono::prelude::*; use std::{ cmp::{max, min}, collections::BTreeMap, error, fmt::{self, Display}, fs::{self, File}, io, path::Path, }; #[derive(Clone)] pub struct CheckpointDbError { error_kind: ErrorKind,...
Rust
0
w(hwnd) time.sleep(0.5) # 等待窗口聚焦 parts = x['param'].split(',') click_x = int(parts[0]) click_y = int(parts[1]) long_position = win32api.MAKELONG(click_x, click_y) # 模拟鼠标指针 传送到指定坐...
Python
1
NodeId(unsafe { NonZeroU64::new_unchecked(2) }); const NODE_ID_3: NodeId = NodeId(unsafe { NonZeroU64::new_unchecked(3) }); const NODE_ID_4: NodeId = NodeId(unsafe { NonZeroU64::new_unchecked(4) }); const NODE_ID_5: NodeId = NodeId(unsafe { NonZeroU64::new_unchecked(5) }); #[test] fn parent_and_in...
Rust
0
_xmm_m32 0x4222_0010,// EVEX_Vmovss_xmm_k1z_xmm_xmm 0x4222_0010,// EVEX_Vmovss_xmm_k1z_m32 0x4032_0010,// Movsd_xmm_xmmm64 0x42B2_0010,// VEX_Vmovsd_xmm_xmm_xmm 0x42B2_0010,// VEX_Vmovsd_xmm_m64 0x4272_0010,// EVEX_Vmovsd_xmm_k1z_xmm_xmm 0x4272_0010,// EVEX_Vmovsd_xmm_k1z_m64 0x4002_0011,// Movups_xmmm128_xmm ...
Rust
0
e.g. enums like `VMPublishingOption`) // In the override, we can reuse this default logic via this function // Note: we cannot directly call the default `deserialize_into_config` implementation // in its override - this will just refer to the override implementation itself fn deserialize_default_impl(by...
Rust
0
// s_8 comes into scope takes_ownership(s_8); // s_8's value move into the function .. // ... and so is no longer valid herr // println!("{}", s_8); let x_3 = 5; // x_3 comes into scope make_copy(x_3); // x_3 would move into the function ...
Rust
0
from thoth.app.analyzer.abstract_analyzer import ( AbstractAnalyzer, CategoryClassification, ImpactClassification, PrecisionClassification, ) class ERC721Analyzer(AbstractAnalyzer): """ Detect if a contract is an ERC20 Token and analyze its properties where applicable """ NAME = "ERC7...
Python
1
col1: days_back = st.selectbox("Analysis Period", [30, 60, 90], index=0) with col2: analyze_button = st.button("Analyze Historical Returns", type="primary") if analyze_button: with st.spinner(f"Analyzing last {days_back} days of 2-4 PM performance..."): analysis = premiu...
Python
1
import pyarts3 as pyarts import numpy as np ws = pyarts.workspace.Workspace() # %% Sampled frequency range line_f0 = 118750348044.712 ws.frequency_grid = [line_f0] # %% Species and line absorption ws.absorption_speciesSet(species=["O2-66"]) ws.ReadCatalogData() ws.absorption_bandsSelectFrequencyByLine(fmin=40e9, f...
Python
1
"""搜索工具 提供搜索功能(当前为模拟实现,未来可集成真实搜索API) """ import random from typing import List from ..base import BaseTool, ToolResult, register_tool from ...utils.logger import get_logger logger = get_logger(__name__) @register_tool class SearchTool(BaseTool): """搜索工具 提供搜索功能,当前为演示版本,返回模拟搜索结果 """ def __init__(s...
Python
1
h is False assert FLAGS.start is None assert FLAGS.end is None calendars = FLAGS.calendars.split(',') multi_cal = MultiCalendar(FLAGS.start,FLAGS.end,calendars,FLAGS.today,FLAGS.this_week,FLAGS.this_month,FLAGS.print_details,not FLAGS.remove_grid) # for one day: set start date, end date + 1 ...
Python
1
( sock, opt, value_ptr as *mut c_void, &mut size) }); Ok(value as $ty) } } ) ); getsockopt_num!(c_int, i32); getsockopt_num!(c_uint, u32); getsockopt_num!(int64_t, i64...
Rust
0
''' Escribe un programa que pregunte al usuario su peso en kg y lo almacene en una variable. El programa debe mostrar al final el peso introducido por el usuario. ''' peso = float (input ("Indique su peso en kg: ")) print (f"Su peso es de {peso} kg.")
Python
1
GE_BONUS_PER_UPGRADE.get(&self.type_id()); let extract_weapon_stats = |w: &Weapon| { let damage_bonus_per_upgrade = damage_bonus_per_upgrade.and_then(|bonus| bonus.get(&w.target)); let mut damage = w.damage + (self.attack_upgrade_level() * damage_bonus_per_upgrade.and_then(|bonus| bonus.0).unwrap_or(1...
Rust
0
queue. /// NOTE: It is OK for `on_task` to enqueue more tasks. In this case they're left in the queue /// and will be processed by the *next* call to `dequeue_all`, *not* the current one. pub(crate) fn dequeue_all(&self, on_task: impl Fn(NonNull<TaskHeader>)) { // Atomically empty the queue. ...
Rust
0
.0,b=0): if b==0: return saw_ker_conv0(x,K,s) else: return saw_ker_conv0(x,K,s)+const_ker_conv_valid(x,K,b)# 3N次乘法 if True: S=0.3 B=3 N=10 K=3 x=np.random.randint(-10,10,N).astype(float) # 测试随机信号 #x=np.zeros(N).astype(float) # 测试冲击响应 #x...
Python
1
residue(rr,true); } let (mut md_envset,mut md_varset):(charmm_based_energy::CharmmEnv,charmm_based_energy::CharmmVars) = charmm_based_energy::MDAtom::chain_to_atoms(&mut chain,&parr,true); let mut aligned_atoms:HashSet<usize> = HashSet::new(); for (aii,aa) in md_envset.atoms.iter().enumerate(){ ...
Rust
0
let mut rng: StdRng = SeedableRng::from_seed(SEED); let vec: Vec<_> = (0..n).map(move |_| [rng.gen::<i64>(); 3]).collect(); vec.into() } #[inline] fn make_random_vec_dyn(n: usize) -> VecDyn<DynCloneVTable> { let mut rng: StdRng = SeedableRng::from_seed(SEED); let vec: Vec<_> = (0..n).map(move |_| [...
Rust
0
r_sender_clone = radpar_sender.clone(); // SENDER CLONE &entrypar.widget.connect_changed(move|_| { let new_val: Result<f64, std::num::ParseFloatError> = buffer .get_text() // from buffer .as_str() // parse as string ...
Rust
0
# ----------------------------------------------------------------------------- # Copyright © 2009- The Spyder Development Team # # Licensed under the terms of the MIT License # (see LICENSE.txt for details) # ----------------------------------------------------------------------------- """Provides QtNetworkAuth class...
Python
1
code="NOERROR") resp.check_count(1, "RRSIG") resp = master.dig("cataloged2.", "SOA") resp.check(rcode="NOERROR") resp = slave.dig("cataloged2.", "SOA", dnssec=True) resp.check(rcode="NOERROR") resp.check_count(1, "RRSIG") # Check adding and removing duplicate up = master.update(zone[1]) up.add("bar3.zones.catalog1.", ...
Python
1
t)?.to_string(); messages.truncate(42); assert_eq!( messages, "\ Please input your awaited date: \ Thank you!\ " .to_string() ); Ok(()) } <filename>src/analyses/mod.rs pub mod call_analyzer; pub mod heap_analyzer; pub mod jump_analyzer; pub mod r...
Rust
0
"< device"] pub const ZE_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION: _ze_result_t = _ze_result_t(2013265940); } impl _ze_result_t { #[doc = "< [Validation] kernel argument index is not valid for kernel"] pub const ZE_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX: _ze_result_t = _ze_result_t(2...
Rust
0
inline(always)] pub fn adc_dcctl7_cim(&self) -> ADC_DCCTL7_CIMR { ADC_DCCTL7_CIMR::_from(((self.bits >> 0) & 3) as u8) } #[doc = "Bits 2:3 - Comparison Interrupt Condition"] #[inline(always)] pub fn adc_dcctl7_cic(&self) -> ADC_DCCTL7_CICR { ADC_DCCTL7_CICR::_from(((self.bits >> 2) &...
Rust
0
Server that provides application-specific information. The URL uses the internal hostname, and requires a proxy server for resolution and, possibly, access. """ class StateValueValuesEnum(_messages.Enum): r"""Required. The application state. Values: STATE_UNSPECIFIED: Status is unspecifi...
Python
1
from rest_framework import serializers from .models import User class UserSearilizer(serializers.ModelSerializer): class Meta: model = User fields = '__all__'
Python
1
_string, 'info': all_info} # Optional: save features somewhere if needed all_visual_feature = all_visual_feature.cpu().numpy() all_text_feature = all_text_feature.cpu().numpy() sim = np.dot(all_text_feature, all_visual_feature.T) metrics = compute_metrics(sim) print(metrics...
Python
1
rint!("M-^{}", (x + 64) as char); } else { print!("M-{}", (*b - 128) as char); } } } } } } fn print_tab() { print!("^I"); } #[cfg(test)] mod tests { use super::is_empty; use super::c...
Rust
0
ruct Day8 {} impl Solver<'_> for Day8 { type Generated = Image; type Output = usize; fn generator(input: &str) -> Self::Generated { parse_image(input, 25, 6) } fn part1(image: Self::Generated) -> Self::Output { let layer = image .iter() .min_by_key(|layer| ...
Rust
0
/ let mut crc = CRC::crc6cdma2000_b(); /// crc.digest(b"123456789"); /// # #[cfg(features = "alloc")] /// assert_eq!("0x3B", &crc.to_string()); /// ``` #[inline] pub fn crc6cdma2000_b() -> CRC { CRC::CRCu8(CRCu8::crc6cdma2000_b()) } /// |Check|Poly|Init|Ref|XorOut| /// |---|...
Rust
0
""" Method to verify POST data. <HEX VALUE>...<HEX VALUE> Example: AA BB 00 01 EF 0A 0E EA ... ... """ option = " --get_post_code" self.regex = r"^.+[a-fA-F0-9]+.+\s*" self.set_bic_cmd() self.bic_cmd += option self.ge...
Python
1
0.2", "1.1.1.1", 443, 12345, b"Well, I heard 1.1.1.1 is all the rage", )), None, // sleep Some(build_tcp_packet( "10.0.0.2", "3.3.3.3", 4435, 1337, b"Wait for me!", )), Som...
Rust
0
.to_string()); 99 } else { let id = match args.value_of("GID") { Some(id) => { let id = id.parse::<usize>().unwrap_or_exit(1); if let Some(_group) = sys_groups.get_by_id(id) { eprintln!("useradd: group already exists with gid: {}", id);...
Rust
0
] = &[ "*.tar.gz", ".directory", ".dropbox", ".dropbox.cache", ".git", ".mypy_cache", "_rendered", "target", ]; impl Default for SyncConfig { fn default() -> Self { let home_dir = dirs::home_dir().unwrap(); let mut ignore = GlobSetBuilder::new(); for glob in...
Rust
0
x31, 0xa1, 0x18, 0x6a, 0xc0, 0xdf, 0xc1, 0x7c, 0x98, 0xdc, 0xe8, 0x7b, 0x4d, 0xa7, 0xf0, 0x11, 0xec, 0x48, 0xc9, 0x72, 0x71, 0xd2, 0xc2, 0x0f, 0x9b, 0x92, 0x8f, 0xe2, 0x27, 0x0d, 0x6f, 0xb8, 0x63, 0xd5, 0x17, 0x38, 0xb4, 0x8e, 0xee, 0xe3, 0x14, ...
Rust
0
turn "未知" for keyword in keywords: if not keyword: # 跳过空关键词 continue try: if use_regex: # 使用正则表达式匹配(忽略大小写) if re.search(keyword, message_text, re.IGNORECASE): return keyword else: ...
Python
1
assert_eq!(r0.0, Some(ClosedZone{pba: PBA::new(0, 10), freed_blocks: 5, total_blocks: 10, txgs: TxgT::from(0)..TxgT::from(1), zid: 1})); let (clust, zid) = r0.1.unwrap(); let r1 = pool.find_closed_zone(clust, zid); assert_eq!(r1.0, Some(ClosedZone{pba: PBA::new(0, 30), freed_b...
Rust
0
r, major - 0x60)?; r.seek(SeekFrom::Current(len as _))?; } // Major type 4: an array of data items 0x80..=0x9b => { let len = read_len(r, major - 0x80)?; for _ in 0..len { self.skip(r)?; } ...
Rust
0
# -*- coding: utf-8 -*- import numpy as np import geatpy as ea class Pathological(ea.Problem): # 继承Problem父类 def __init__(self, Dim=30): # Dim : 决策变量维数 name = 'Pathological' # 初始化name(函数名称,可以随意设置) M = 1 # 初始化M(目标维数) maxormins = [1] * M # 初始化maxormins(目标最小最大化标记列表,1:最小化该目标;-1:最大化该目标) ...
Python
1
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------...
Python
1
HashSet<(i64, i64, i64, i64)>) -> u64 { let mut cubes = cubes.clone(); for _ in 0..6 { let mut tmp = cubes.clone(); for cube in &cubes { let neighbors = count_active_neighbors_3d(&cubes, cube); if neighbors != 2 && neighbors != 3 { tmp.remove(cube); ...
Rust
0
-> __jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::icu::lang::UCharacter_UnicodeBlock>> { unsafe { let (class, field) = env.require_class_static_field("android/icu/lang/UCharacter$UnicodeBlock\0", "COMBINING_DIACRITICAL_MARKS\0", "Landroid/icu/lang/UCharacter$U...
Rust
0
ed_value['volatility'].iloc[-1] = volatility # Chained assignment is not allowed soon looped_value.at[looped_value.index[-1], 'volatility'] = volatility # use .at to avoid chained assignment return volatility def eval_info_ratio(looped_value, reference_value, reference_data): """ 信息比率。衡量超额风险带来的超...
Python
1
_str().unwrap()) { return val_error!(errors::Format { path: path.to_string(), detail: "".to_string(), }); } } super::ValidationState::new() } } use std::io::Read; use std::fs::File; pub struct Rom { ...
Rust
0
map } pub struct RequestData<'a> { cookie: HashMap<&'a str, &'a str>, header: HashMap<&'a str, &'a str>, data: HashMap<&'a str, &'a str> } pub unsafe fn dict_to_map(dict:*const Dictionary, map: &mut HashMap<&str, &str>) { if (*dict).map != std::ptr::null() { for i in 0..(*dict).cap { ...
Rust
0
Corrupt(String), // This error case is disabled, as git allows extra garbage in the extra edges list? // #[error("The last entry in commit-graph's extended edges list does is not marked as being terminal")] // ExtraEdgesOverflow, #[error("Could not open commit-graph file at '{}'", .path.display())] ...
Rust
0
1ui64ARB(&self, index: GLuint, x: GLuint64EXT) { match self.glVertexAttribL1ui64ARB_p { Some(f) => f(index, x), None => Self::not_loaded("glVertexAttribL1ui64ARB"), } } #[doc(hidden)] pub fn VertexAttribL1ui64ARB_is_loaded(&self) -> bool { self.glVertexAttribL1ui64ARB_p.is_some() } ///...
Rust
0
> { match load_sk_file(filepath) { Ok(key) => generate_pk_rsa_pkcs1_der_from_rsa_sk(key), Err(err) => Err(Errs::strs("load_sk_file", err)), } } /// 生成RSA公钥 fn generate_pk_rsa_pkcs8_der_from_sk_file<P: AsRef<Path>>(filepath: P) -> Results<Vec<u8>> { match load_sk_file(filepath) { Ok(...
Rust
0
#! -*- coding: utf-8 -*- # 简单的线性变换(白化)操作,就可以达到BERT-flow的效果。 # 测试环境:tensorflow 1.14 + keras 2.3.1 + bert4keras 0.9.7 # 测试任务:GLUE的STS-B。 import numpy as np import scipy.stats from bert4keras.backend import keras, K from bert4keras.tokenizers import Tokenizer from bert4keras.models import build_transformer_model from ber...
Python
1
from drf_yasg.views import get_schema_view from drf_yasg import openapi schema_view = get_schema_view( openapi.Info( title="API de Recrutement", default_version='1', description="Documentation de l'API de gestion des candidats et recruteurs", terms_of_service="https://www.google.com...
Python
1
python")).unwrap(), vec!["Python"] ); } #[test] fn test_shebang_get_languages_env() { assert_eq!( get_languages_from_shebang(Cursor::new("#!/usr/bin/env node")).unwrap(), vec!["JavaScript"] ); } #[test] fn test_shebang_get_languages_mu...
Rust
0
e_stamps}, " f"and number of predicting days: {num_of_predicting_days}") return html.Div(main(meld_na_scores, time_stamps, num_of_predicting_days), style=styles['info']) return html.Div("The predicted MELD scores will be displayed here.", style=styles['info']) # Add CSS for button hover effe...
Python
1
Ace), Card::new(Suite::Hearts, Value::Ace), Card::new(Suite::Clubs, Value::Two), Card::new(Suite::Diamonds, Value::Two), ]; assert_eq!(Hand::FullHouse, determine_high_hand(&cards)); } } <gh_stars>1-10 use serde::Deserialize; use std::{fs, path::Path}; #[derive(Debug, Deserialize, PartialEq)] #[serde(def...
Rust
0
ion, unreal_scale def clear_level_selection(): """ Clears the selection of the current opened level. """ unreal.EditorLevelLibrary().select_nothing() def get_unreal_python_interpreter_path(): """ Returns path where Unreal Python interpreter is located. :return: Unreal Python interprete...
Python
1
c", "difficulty"] ) # Implement retry logic with maximum attempts max_attempts = 3 for attempt in range(max_attempts): try: # Generate response using LLM response = self.llm.invoke(prompt.format(topic=topic, difficulty=difficulty)) ...
Python
1
// Note that the compiler may still treat some of these specially // when possible, e.g. replacing an `=` call with the `Eq` instruction. "+" => ADD = 0, "-" => SUB = 1, "*" => MUL = 2, "^" => POW = 3, "/" => DIV = 4, "//" => FLOOR_DIV = 5, "rem" => REM = 6, "<<" => SHL = 7, ...
Rust
0
import random import matplotlib.pyplot as plt import numpy as np from sklearn.datasets import make_blobs def k_means(k: int, num_samples: int): # generate 3 clusters X, y_true = make_blobs(n_samples=num_samples, centers=k, cluster_std=0.60, random_state=0) # step 1 get random k numbers as initial cent...
Python
1
# If escape is pressed, kill everything. if args[0] == ESCAPE: glutDestroyWindow(window) sys.exit() def main(): global window # For now we just pass glutInit one empty argument. I wasn't sure what should or could be passed in (tuple, list, ...) # Once I find out the right stuff based on reading the Py...
Python
1
import random from time import sleep print('=-' * 20) print('Adivinhe qual número eu estou pensando') print('Dica: è de 0 a 5') print('=-' * 20) ns = random.randint(0, 5) resp = int(input('E ai? Qual é o número?')) print('Conferindo...') sleep(3) if resp == ns: print('Droga você acertou!') else: print('HAHAHA v...
Python
1
mut was_off: i32, mut start_off: i32, mut sx: i32, mut sy: i32, mut scx: i32, mut scy: i32, mut cx: i32, mut cy: i32, ) -> i32 { if (start_off) != 0 { if (was_off) != 0 { stbtt_setvertex( ((&mut *vertices.offset((c_runtime::postInc(&mut num_vertices))...
Rust
0
# Log to tensorboard if available if hasattr(self.model, 'logger') and self.model.logger: for key, value in log_data.items(): self.model.logger.record(key, value) def get_recent_insights(self, limit: int = 5) -> List[Dict[str, Any]]: """Get recent LCM insights about...
Python
1
-automate<gh_stars>0 pub mod filter_type; <reponame>RalfJung/crossbeam<filename>src/seg_queue.rs<gh_stars>0 use std::cell::UnsafeCell; use std::cmp; use std::fmt; use std::mem::{self, ManuallyDrop}; use std::ptr; use std::sync::atomic::Ordering::{Acquire, Relaxed, Release}; use std::sync::atomic::{AtomicBool, AtomicUsi...
Rust
0
rArrrr#s z"Big5DistributionAnalysis.get_orderr<rrr5rrCs rCcs$eZdZfddZddZZS)SJISDistributionAnalysiscs$tt|t|_t|_t|_dSr) r4rHrrrrr...
Python
1
} extern "C" { pub fn cry_rsa_clear(ctx: *mut cry_rsa_ctx); } extern "C" { pub fn cry_rsa_encrypt( ctx: *mut cry_rsa_ctx, out: *mut *mut ::std::os::raw::c_uchar, outlen: *mut size_t, in_: *const ::std::os::raw::c_uchar, inlen: size_t, ) -> ::std::os::raw::c_int; } ex...
Rust
0
opActor) #it's last because its translucent) ren.SetBackground(1, 1, 1) renWin.SetSize(500, 500) camera = vtkCamera() camera.SetClippingRange(.274, 13.72) camera.SetFocalPoint(0.433816, 0.333131, 0.449) camera.SetPosition(-1.96987, 1.15145, 1.49053) camera.SetVie...
Python
1
', '◸', 'ཎ', '㌁', '𖣤', '\u{10a06}', '𖺑', '⸉', '𝇘', 'Ǩ', '𛄀', '𝌯', 'ᙁ', '⾔', '՛', '\u{1ed31}', '凌', '⽼', '𝀗', 'ힸ', '🆫', '𖬄', 'ﻯ', '𑄜', 'ᝥ', 'ⓝ', 'ⓙ', 'ⓕ', '㊠', '𐓯', '𐫑', '\u{1e2cc}', 'ⓡ', '🃣', '𑄃', 'ℏ', '𞢍', '\u{a7ba}', '𝐛', 'জ', '\u{18c6c}', '𞠅', 'ꔗ', '𑩦', '\u{e01e5}', 'ꧭ', '𑍍', 'ይ', '...
Rust
0
Radius), (20, 0, mediumRadius)] rotateCircle6CCW = [(20, 0, smallRadius), (20, 0, smallRadius), (20, 0, smallRadius), (20, 0, smallRadius), (20, 0, smallRadius), (20, 0, smallRadius)] return [rotateCircle1CCW, rotateCircle2CCW, rotateCircle3CCW, rotateCircle4CCW, rotateCircle5CCW, rotateCircle6CCW] def Retur...
Python
1
"SPI1 Control and Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#re...
Rust
0
from pathlib import Path res_path_name = "arknights_mower/resources/" res_path = Path(res_path_name) data = "from typing import Literal\n\nRes = Literal[\n" references = {} for i in res_path.glob("**/*.png"): res_name = i.as_posix() res_name = res_name.replace(res_path_name, "") res_name = res_name.repla...
Python
1
{get_async_pn532, U32Ext}; /// use pn532::Request; /// /// let mut pn532 = get_async_pn532(); /// let future = pn532.process_no_response_async(&Request::INLIST_ONE_ISO_A_TARGET); #[inline] pub async fn process_no_response_async<const M: usize>( &mut self, request: &Request<M>, ...
Rust
0
############################################################################## # Python From Scratch # Author: Nilo Ney Coutinho Menezes # Editora Novatec (c) 2010-2025 - LogiKraft 2025 # Site: https://pythonfromscratch.com # ISBN: 978-85-7522-949-1 (Paperback), 978-85-7522-950-7 (hardcover), 978-85-7522-951-4 (ebook) ...
Python
1
Acc := Acc + (Q + Acc) return (d_0 == 0) ? Q - P : Q One-bit round constraints: S = (P + (b ? T : −T)) + P VBSM gate constraints for THIS witness row • b1*(b1-1) = 0 • b2*(b2-1) = 0 • (xp - xt) * s1 = yp – (2b1-1)*yt • s1^2 - s2^2 = xt - xr • (2*xp + xt – s1^2) * (s1 + s2) = 2*yp • (xp – xr) * s2 = yr + yp • (xr - ...
Rust
0
""" Utils for CMake Author: https://github.com/klivelinux """ import os import utils from string import Template import rtconfig from utils import _make_path_relative class XmakeProject: def __init__(self, env, project): self.env = env self.project = project self.sdkdir = "" self...
Python
1
} } else { true } }; let mut skip_set = HashSet::new(); // Enforce --limit let check_limit = |m: &QueryResult| { if args.limit { ...
Rust
0
from_native(s)), v => Err(format!("Cannot treat {} as String", v)), } } fn from_rt(rt: Self::Rt) -> Value { Value::String(rt.into_native()) } } impl<T: ExecutorValue, E: ExecutorValue> ExecutorValue for Result<T, E> { type Rt = RtResult<T::Rt, E::Rt>; fn into_rt(value:...
Rust
0
# 题目:给你一个字符串 s ,颠倒字符串中 单词 的顺序。字符串 s中可能会存在前导空格、尾随空格或者单词间的多个空格。 # 考察:双指针 快慢指针 字符串综合应用 # 作法:如果用字符串拆分,用辅助内存存储就很简单,该题不希望使用额外内存,所以就只能对字符串下手,即空间复杂度为O(1) # 思路:1.去除多余空格 2.反转整字符串列表 3.反转字符串中的单词 class Solution: def reverseWords(self, s: str) -> str: # 去除多余空格 def del_extra_space(s): left = 0 right = ...
Python
1
import jwt PUBLIC_KEY = u'''-----BEGIN PUBLIC KEY----- MIGbMBAGByqGSM49AgEGBSuBBAAjA4GGAAQBGOtycGkAMpTEDsjFykEywLecIdCX 1QIShxmJB0qJj9K2yFNwJj/eRR6yzIZcHJPZWzQU6Mad62y1MsJ8uOgdZ2sBmkS0 HJtT4FZq/EQbtkHeahsDnSLbFpPfoN/t8hmKrVmDzDRGe3PNl7OQVuzoY2TVSxVK IKmpZ9Pw9/5HOzSmOxs=-----END PUBLIC KEY----- ''' def encode_jwt(payl...
Python
1
&'a mut W { self.variant(ITRIM_A::XTAL32K_ITRIM_160NA) } #[doc = "320 nA startup current"] #[inline(always)] pub fn xtal32k_itrim_320na(self) -> &'a mut W { self.variant(ITRIM_A::XTAL32K_ITRIM_320NA) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe...
Rust
0
, 0x2D11_6341, 0x4C7F_CD58), (r"textures\tx_natural_cavern_wall10.dds", 0x2D11_6341, 0x4C7F_CD68), (r"textures\tx_natural_cavern_wall00.dds", 0x2D11_6341, 0x4C7F_CD78), (r"textures\tx_natural_cavern_wall21.dds", 0x2D11_6341, 0x4C7F_DD58), (r"textures\tx_natural_cavern_wall11.dds", 0x2D11_6341, 0x4C7...
Rust
0
6 = 0x0016; pub const REL_IA64_PCREL60F: u16 = 0x0017; pub const REL_IA64_PCREL60I: u16 = 0x0018; pub const REL_IA64_PCREL60M: u16 = 0x0019; pub const REL_IA64_IMMGPREL64: u16 = 0x001A; pub const REL_IA64_TOKEN: u16 = 0x001B; pub const REL_IA64_GPREL32: u16 = 0x001C; pub const REL_IA64_ADDEND: u16 = 0x001F; pub const ...
Rust
0
che=cache) # noqa t1 = time.time() assert t1 - t0 > time_to_sleep assert g["y"] == 1 assert r == 2 # same inputs, should be cached t0 = time.time() r, t, i, g, l = await run(code_to_cache, globals_=globals_, cache=cache) # noqa t1 = time.time() assert t1 - t0 < time_to_sleep as...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal, TypeAlias __all__ = ["ChatCompletionReasoningEffort"] ChatCompletionReasoningEffort: TypeAlias = Literal["low", "medium", "high"]
Python
1
#Definición class Person: def __init__(self,name,age,alias="\"Undefined alias\""): self.name = name self.age = age self.__alias = alias #__ define la variable como privada, no se puede editar desde fuera self.hellotext = f"Hola {self.name}, tienes {self.age} años." def ...
Python
1
-set, found pending as-set name components: {:?}", comps )), } } } <reponame>merlincinematic/rasn<filename>standards/smime/src/ess.rs<gh_stars>0 //! # Enhanced Security Services use rasn::prelude::*; use rasn_cms::{ContentType, IssuerAndSerialNumber, SubjectKeyIdentifier}; use r...
Rust
0
None => panic!("tried to restore cleared scopes, but none were cleared"), } } ScopeStackOp::Noop => (), } } /// Prints out each scope in the stack separated by spaces /// and then a newline. Top of the stack at the end. pub fn debug_print(&self, repo: &Sc...
Rust
0
if let SampleOutput::Scale(p) = self { *p } else { panic!() } } #[inline] pub fn unwrap_weight(&self) -> f32 { if let SampleOutput::MorphTargetWeight(p) = self { *p } else { panic!() } } } #[repr(transparent)...
Rust
0
# Copyright (c) Saga Inc. # Distributed under the terms of the GNU Affero General Public License v3.0 License. from typing import List import json import os from evals.test_cases.agent_find_and_update_tests.simple import Cell RELATIVE_PATH_TO_NOTEBOOK_FOLDER = 'notebooks' dirname = os.path.dirname(__file__) def g...
Python
1
filter_map(|r| async move { r.ok() }) .boxed(); assert_eq!(Poll::Ready(None), s.poll_next_unpin(cx)); } #[test] fn try_take_while_after_err() { let cx = &mut noop_context(); let mut s = stream::iter(1..=3) .map(Ok) .try_take_while(|_| async move { Err::<_, ()>(()) }) .filter...
Rust
0
request_id_parameter=request_id_parameter, if_tags=_if_tags, lease_id=_lease_id, template_url=self.set_tags.metadata['url'], ) request = _convert_request(request) request.url = self._client.format_url(request.url) pipeline_response = await self._cl...
Python
1
"""frankensteinWebUI URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.11/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home'...
Python
1
rapper around the Python datetime C-API global. Note that this object differs slightly /// from the equivalent C object: in C, this is implemented as a `static PyDateTime_CAPI *`. Here /// this is implemented as a wrapper which implements [`Deref`] to access a reference to a /// [`PyDateTime_CAPI`] object. /// /// In t...
Rust
0
# -*- coding: utf-8 -*- ''' This file can be placed in the simulations directory of a neuroConstruct project and when run it will search in all subdirectories for time.dat, and if it doesn't find it, will try running pullsim.sh, which will attempt to retrieve the saved data from a remotely executed simulation ''' im...
Python
1
l std::ops::Sub for Vec3 { type Output = Self; fn sub(self, rhs: Self) -> Self { Self { x: self.x - rhs.x, y: self.y - rhs.y, z: self.z - rhs.z, } } } impl std::ops::SubAssign for Vec3 { fn sub_assign(&mut self, rhs: Self) { self.x -= rhs.x; ...
Rust
0