text
string
label_name
string
labels
int64
*self == UCGLITR::UCGLIT_1 } #[doc = "Checks if the value of the field is `UCGLIT_2`"] #[inline] pub fn is_ucglit_2(&self) -> bool { *self == UCGLITR::UCGLIT_2 } #[doc = "Checks if the value of the field is `UCGLIT_3`"] #[inline] pub fn is_ucglit_3(&self) -> bool { *self ...
Rust
0
let a_ = mat1_csc(); let expected_output = mat1_self_matprod(); let res = &a * &a_; assert_eq!(expected_output, res); let res = (&a_ * &a).to_other_storage(); assert_eq!(expected_output, res); } #[test] fn mul_csr_csvec() { let a = mat1(); l...
Rust
0
# TLE class Solution(object): def findWords(self, board, words): def getNeighbor(i, j): opt = [] if i+1<M: opt.append((i+1, j)) if j+1<N: opt.append((i, j+1)) if i-1>=0: opt.append((i-1, j)) if j-1>=0: opt.append((i, j-1)) return opt ...
Python
1
T::decode_len(&Self::hashed_key()) } } /// A strongly-typed map in storage. /// /// Details on implementation can be found at [`generator::StorageMap`]. pub trait StorageMap<K: FullEncode, V: FullCodec> { /// The type that get/take return. type Query; /// Get the storage key used to fetch a value corresponding to...
Rust
0
""" Add tables to support user and globally restricted searchtags. Revision ID: a49795aa2584 Revises: 882fe6ace5c7 Create Date: 2016-10-01 03:00:22.859648 """ # revision identifiers, used by Alembic. revision = 'a49795aa2584' down_revision = '882fe6ace5c7' from alembic import op import sqlalchemy as sa def upgrad...
Python
1
pub const FsrmPropertyFlags_Orphaned: FsrmPropertyFlags = 1i32; #[doc = "*Required features: `\"Win32_Storage_FileServerResourceManager\"`*"] pub const FsrmPropertyFlags_RetrievedFromCache: FsrmPropertyFlags = 2i32; #[doc = "*Required features: `\"Win32_Storage_FileServerResourceManager\"`*"] pub const FsrmPropertyFlag...
Rust
0
e': label_dict = get_label_dict() name_list = get_file_list('./tmp') #binary_pic(name_list) #tmp_name_list = get_file_list('../data/tmp') # 将待预测的图片名字列表送入predict()进行预测,得到预测的结果及其index final_predict_val, final_predict_index = inference(name_list) final_reco_text =[] ...
Python
1
ble!(u32, wtypes::VT_UI4); storable!(u64, wtypes::VT_UI8); storable!(f32, wtypes::VT_R4); storable!(f64, wtypes::VT_R8); use std::collections::HashMap; use std::sync::Arc; use crate::classfile::{Class, FieldFlags, PrimitiveType}; use crate::liveness::LivenessInfo; use crate::resolve::{ClassEnvironment, ClassId, FieldI...
Rust
0
panic!("failed to create window, {}", e); }); //TODO how the fk do i move this out of here and specify all the lifetimes let world = create_world(); while window.is_open() { if window.is_key_down(Key::Escape) { break; } else if window.is_key_down(Key::Key1) { ...
Rust
0
PO.DAAC OPeNDAP URLs to the granules. :param granule_search_response: the output response of a podaac.granule_search() :type path: :mod:`string` :returns: prints an array of PO.DAAC OPeNDAP URLs. """ soup = BeautifulSoup(granule_search_response, 'html.parser') ...
Python
1
{ pub fn new(data_abstraction_layer: Arc<AbstractionLayer + Send + Sync>) -> Self { TaskProcessorImpl { data_abstraction_layer, } } /// `get_closest_endline` files the endline closest to the end of a given range for input file /// splitting. fn get_closest_endline( ...
Rust
0
&BvmAddr::default(), false, &mut Account::default(), )], &serialize(&StakeOpCode::DelegateStake).unwrap(), 0, ), Err(OpCodeErr::BadOpCodeContext), ); // gets the sub-check...
Rust
0
} } #[cfg(any(not(feature = "asm"), feature = "asm-aarch64"))] mod utils; #[cfg(not(feature = "asm"))] use utils::compress; pub use digest::Digest; use digest::{Input, BlockInput, FixedOutput, Reset}; use digest::generic_array::GenericArray; use digest::generic_array::typenum::{U20, U64}; use block_buffer::BlockB...
Rust
0
import pandas as pd import json from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity, euclidean_distances # get the data from: https://www.kaggle.com/tmdb/tmdb-movie-metadata # load in the data df = pd.read_csv('../large_files/tmdb_5000_movies.csv') # c...
Python
1
Error.html /// [GlueError]: enum.GlueError.html #[cfg(feature = "enable-glue-errors")] #[derive(Clone, Debug, Eq, Error, PartialEq)] pub enum BtrfsUtilError { /// Glue error #[error("{0}")] Glue(GlueError), /// Library error #[error("{0}")] Lib(LibError), } #[cfg(not(feature = "enable-glue-erro...
Rust
0
h = 1 X = [1, 2, 3, 4, 5, 6] Y = [0.571, 0.889, 1.091, 1.231, 1.333, 1.412 ] N = len(X) def side_diff(n: int) -> float: if n + 1 == N: return (Y[n] - Y[n - 1]) / h else: return (Y[n + 1] - Y[n]) / h def mid_diff(n: int) -> float: if n == 0: return (-3 * Y[0] + 4 ...
Python
1
} else { if a < b { return a; } return b; } } pub fn f32_pack(in_sign: i32, in_exp: i32, in_frac: i32) -> u32 { ((in_sign << 31) | ((in_exp & 0x0FF) << 23) | (in_frac & 0x007fffff)) as u32 } pub(crate) fn f32_round_and_pack(in_sign: i32, in_exp: i32, in_frac: i32) -> u32 {...
Rust
0
from appJar import gui def press(btn=None): print(btn) print("names", app.getMenuRadioButton("tester", "names")) print("cb1", app.getMenuCheckBox("tester", "cb1")) print("cb2", app.getMenuCheckBox("tester", "cb2")) print("cb3", app.getMenuCheckBox("tester", "cb3")) app=gui("DEMO") app.add...
Python
1
on<Ordering> { let s1 = self.get_string(); let s2 = other.get_string(); Some(s1.cmp(s2)) } } impl PartialEq for StrType { fn eq(&self, other: &Self) -> bool { let s1 = self.get_string(); let s2 = other.get_string(); s1 == s2 } } #[derive(Eq, Debug, Clone)] s...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2018-2023 OpenEEmeter contributors 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 Unles...
Python
1
.unwrap(); // Complete workflow task and schedule activity and a timer that fires immediately core.complete_workflow_activation( vec![ schedule_activity_cmd( 0, task_q, activity_id, ActivityCancellationType::TryCancel, ...
Rust
0
__author__ = 'katharine' class PebbleHardware(object): UNKNOWN = 0 TINTIN_EV1 = 1 TINTIN_EV2 = 2 TINTIN_EV2_3 = 3 TINTIN_EV2_4 = 4 TINTIN_V1_5 = 5 BIANCA = 6 SNOWY_EVT2 = 7 SNOWY_DVT = 8 SPALDING_EVT = 9 BOBBY_SMILES = 10 SPALDING = 11 SILK_EVT = 12 ROBERT_EVT =...
Python
1
str.as_bytes() { assert_eq!(*byte, b'a'); } } #[test] fn test_file() { // Create the 'big_file' const CONTENTS: &str = "big_file contents...not so big here"; let mut file = File::create(super::FILENAME).expect("create big_file"); file.write_all(CONTENTS.as_bytes()).expect("write to big_file...
Rust
0
ificate_lifetime: Duration, ) -> Result<Self> { // Create vault client let client = Arc::new(vault_api::client::Client::try_new_https( vault_address.to_owned(), vault_certificate, ).chain_err(|| "Failed to create Vault HTTPS client")?); Client::try_new_with_c...
Rust
0
SparseSet::new) .insert(entity, self.$index); )+ } } }; } macro_rules! add_component { ($(($type: ident, $index: tt))*;($type1: ident, $index1: tt) $(($queue_type: ident, $queue_index: tt))*) => { impl_add_component![$(($type, $index))*]; ...
Rust
0
# -*- coding: utf-8 -*- """ 測試覆蓋率追蹤腳本 此腳本用於追蹤和改進測試覆蓋率,包括: - 分析當前測試覆蓋率 - 識別未覆蓋的代碼區域 - 生成覆蓋率報告和可視化 - 提供改進建議 使用方法: python scripts/track_coverage.py [options] 選項: --analyze: 分析當前測試覆蓋率 --identify-gaps: 識別未覆蓋的代碼區域 --visualize: 生成覆蓋率可視化 --suggest: 提供改進建議 --all: 執行所有功能 --output-dir: 指定輸出目錄 --...
Python
1
# Tag: Array, Greedy # Time: O(N) # Space: O(1) # Ref: - # Note: - # You are given an integer array nums of length n. # Your goal is to start at index 0 and reach index n - 1. You can only jump to indices greater than your current index. # The score for a jump from index i to index j is calculated as (j - i) *...
Python
1
dent() { check_single_token("ident", RawTokenKind::Ident); check_single_token("id1en3t", RawTokenKind::Ident); check_single_token("my_ident", RawTokenKind::Ident); check_single_token("__LINE__", RawTokenKind::Ident); check_single_token("_1", RawTokenKind::Ident); } #[test] fn number() { check_s...
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 u...
Python
1
BufReader, BufRead, Error}; use itertools::Itertools; fn main() -> Result<(), Error> { let path = "test.txt"; let input = File::open(path)?; let buffered = BufReader::new(input); let v: Vec<i32> = buffered.lines() .map(|line| line.unwrap().parse::<i32>().unwrap()) .collect(); for r...
Rust
0
_ACCESS_VIOLATION: ::libc::c_uint = 3221225477; pub const MD_EXCEPTION_CODE_WIN_IN_PAGE_ERROR: ::libc::c_uint = 3221225478; pub const MD_EXCEPTION_CODE_WIN_INVALID_HANDLE: ::libc::c_uint = 3221225480; pub const MD_EXCEPTION_CODE_WIN_ILLEGAL_INSTRUCTION: ::libc::c_uint = 3221225501; pub const MD_EXCEPTION_CODE_WIN_NONCO...
Rust
0
# -*- coding:utf-8 -*- import platform def isWindowsSystem(): return 'Windows' in platform.system() def isLinuxSystem(): return 'Linux' in platform.system() def uppercase(): r='' for s in xrange(65,91): r+=chr(s) return r def lowercase(): r='' for s in xrange(97,123): r...
Python
1
} } use crate::objects::HtmlNode; pub trait HtmlQueryable { fn query(&self) -> HtmlQuery; } /// An object which points to the a node in the HTML tree including the path to /// the node to allow looking at parent nodes. pub struct HtmlQueryResult<'a> { /// The path down the tree. /// The node is found b...
Rust
0
logging.info("📝 删除旧模型文件...") try: os.remove('model.pth') logging.info("✅ 旧模型文件已删除") except Exception as e: logging.error(f"❌ 删除旧模型文件失败: {e}") if predictor.train(): logging.info("🎉 模型训练完成!") else: ...
Python
1
from flask import Blueprint, request, jsonify import os import json from config import Config roles_bp = Blueprint('roles', __name__) def validate_bearer_token(): auth_header = request.headers.get('Authorization') if not auth_header: return False, jsonify({"error": "Header Authorization é obrigatório"...
Python
1
"BAA". * * * * Example 2: * * * Input: "AAABBC" * Output: 188 * * * * * * Note: * * * 1 <= tiles.length <= 7 * tiles consists of uppercase English letters. * */ pub struct Solution {} // submission codes start here fn histogram_permutations(buckets: &mut Vec<i32>) -> i...
Rust
0
dresses"]', './/section[@toc]', './/*[@removeInRFC="true"]', # '.;validate_after()', '.;pretty_print_prep()', ] def attribute_rfc_preptime(self, e, p): del e.attrib['prepTime'] def attribute_ol_group(self, e, p): group = e.get('group') start = e.g...
Python
1
rtune Teller (Dark)': 0x66, 'Archery Game': 0x59, 'Mire Shed': 0x5F, 'Dark Desert Hint': 0x62, 'Spike Cave': 0x41, 'Mimic Cave': 0x4F, 'Kakariko Well (top)': 0x80, 'Hyrule Castle Secret Entrance': 0x7D, 'Bat Cave (right)': 0...
Python
1
= 65535; const OFFSET: u8 = 16; self.w.bits &= !((MASK as u32) << OFFSET); self.w.bits |= ((value & MASK) as u32) << OFFSET; self.w } } #[doc = "Values that can be written to the field `GPOCTL3`"] pub enum GPOCTL3W { #[doc = "RAT GPO line 3"] RATGPO3, #[doc = "RAT GPO li...
Rust
0
from flask_restful import Resource from api import api from flask import make_response, jsonify, request from ..schemas import livro_schema from ..models import livro_model from ..services import livro_service class LivroList(Resource): def get(self): livros = livro_service.get_livros() l = livro_s...
Python
1
| MacroError::NotFound(macro_name.to_owned()))?; // Macro already in history (avoid infinite loop!) if history.contains(macro_name) { return Err(MacroError::InfiniteLoop(macro_name.to_owned())); } else { history.insert(macro_name); } // Process macro value while let Some(found) =...
Rust
0
7 19 6 12 4\ "; const INPUT2: &str = "\ 28 33 18 42 31 14 46 20 48 47 24 23 49 45 19 38 39 11 1 32 25 35 8 17 7 9 4 2 34 10 3\ "; #[test] fn part1() { for &(input, expected) in &[ (INPUT1, 35), (INPUT2, 220), ] { let adapters = super::parse_adapters(input.split('\n').map(|line| Ok(line.parse()?))).unw...
Rust
0
}, {'full_amount': -1.5}, ]) def test_donation_invalid(user_client, json): response = user_client.post('/donation/', json=json) assert response.status_code == 422, ( 'Сумма пожертвований должна быть целочисленной и больше 0. ' 'Статус-код должен быть 422.' ) def test_donation_superuser...
Python
1
assign_seq(&mut w_test_0, &seq_0_6, &index(&test_weights_cutouts, &seq_0_6)); let expected = w_test_0.mul(network.node().read().unwrap().mesh().layers()[0].lock().unwrap().tensor.hash_map.get("_SYSTEM_WEIGHTS").unwrap()); assert_eq!(&bincode::serialize(&expected).unwrap(), &bincode::serialize(&ne...
Rust
0
# @copyright Copyright 2019 United States Government as represented by the Administrator of the # National Aeronautics and Space Administration. All Rights Reserved. */ # #trick setup trick.sim_services.exec_set_trap_sigfpe(1) simControlPanel = trick.SimControlPanel() trick.add_external_application(simContr...
Python
1
"""OPENDOX - Automated Documentation Generator""" __version__ = "0.0.1"
Python
1
i) = instr { cslab.take_instr(i) } else { IInv(cslab.push_instr(instr)) } } fn compile_mul(instrs:Vec<Instruction>, cslab:&mut CompileSlab) -> Instruction { let mut out = IConst(1.0); let mut out_set = false; let mut const_prod = 1.0; for instr in instrs { if let IConst(c) = ...
Rust
0
::Operator(operator) => { match (left, operator, right) { (Value::Number(left), Token::Sub, Value::Number(right)) => Value::Number(left - right), (Value::Number(left), Token::Add, Value::Number(right)) => Value::Number(left + right), (Value::Number(left), Token::Mult, Value::Number...
Rust
0
import requests import pandas as pd import time import os def get_time(fmt: str = '%Y年%m月%d日') -> str:#'%Y-%m-%d_%H-%M-%S' ''' 获取当前时间(文件名安全格式) ''' ts = time.time() ta = time.localtime(ts) t = time.strftime(fmt, ta) return t def save_hot_list(folder_path: str = "./listku/processed_listku"...
Python
1
Rtmin = linux_raw_sys::general::SIGRTMIN, } impl Signal { /// Convert a raw signal number into a `Signal`, if possible. pub fn from_raw(sig: i32) -> Option<Self> { match sig as _ { linux_raw_sys::general::SIGHUP => Some(Self::Hup), linux_raw_sys::general::SIGINT => Some(Self...
Rust
0
Into; use nu_engine::CallExt; use nu_protocol::{ ast::Call, engine::{Command, EngineState, Stack}, Category, Example, IntoInterruptiblePipelineData, PipelineData, ShellError, Signature, Span, SyntaxShape, Value, }; #[derive(Clone)] pub struct Skip; impl Command for Skip { fn name(&self) -> &str {...
Rust
0
0 || input > 20 {//Checks to make sure the number is valid return Ok("That is not a valid team".to_string()); } api_url = format!( "https://api.overwatchleague.com/teams/{}", team_ids[(input - 1) as usize].to_string() ); //Creates the url needed to call the correct teams informatio...
Rust
0
mod R {} /// Write-only values (empty) pub mod W {} /// Read-write values (empty) pub mod RW {} } } /// DDRPERFM magic ID register pub mod DDRPERFM_SID { /// SID pub mod SID { /// Offset (0 bits) pub const offset: u32 = 0; /// Mask (32 bits: 0xfffff...
Rust
0
Restart, Allocate, Restart, Allocate, Replace(0, 202), Allocate, Replace(0, 204), Replace(0, 205), Link(0, 209), Allocate, Link(0, 210), Replace(0, 211), Allocate, ...
Rust
0
clustersA = [[], []] for line in open(r"03 - TestWorks\Test11\27var11A.txt"): x, y = [float(i) for i in line.split()] if y > 20 : clustersA[0].append([x,y]) else: clustersA[1].append([x,y]) clustersB = [[], [], []] for line in open(r"03 - TestWorks\Test11\27var11B.txt"): x,y = [float(i...
Python
1
Filter").or(Some(Primitive::Null)).unwrap(), resolve)?; let file_decode_params = Vec::<Dictionary>::from_primitive( dict.remove("FDecodeParms").or(Some(Primitive::Null)).unwrap(), resolve)?; let mut new_filters = Vec::new(); let mut new_file_filters = Vec::...
Rust
0
] pos1 = [ii for ii, v in enumerate(C3) if v == lines[ i ][j]] pos2 = [ii for ii, v in enumerate(C2) if v == lines[i ][j]] pos3 = [ii for ii, v in enumerate(C4) if v == lines[i][j]] if len(pos) == 1 or len(pos1) == 1: ucida1.append(1) elif len(...
Python
1
/ /// `SSE` /// /// `16/32/64-bit` Movntps_m128_xmm = 1107, /// `VMOVNTPS m128, xmm1` /// /// `VEX.128.0F.WIG 2B /r` /// /// `AVX` /// /// `16/32/64-bit` VEX_Vmovntps_m128_xmm = 1108, /// `VMOVNTPS m256, ymm1` /// /// `VEX.256.0F.WIG 2B /r` /// /// `AVX` /// /// `16/32/64-bit` VEX_Vmovntps_m256_ymm ...
Rust
0
PhysicalDeviceSparseImageFormatInfo2 { pub sType: StructureType, pub pNext: *const c_void, pub format: Format, pub typ: ImageType, pub samples: SampleCountFlagBits, pub usage: ImageUsageFlags, pub tiling: ImageTiling, } #[doc(hidden)] #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct PhysicalDevicePush...
Rust
0
actix_web::{web, Result}; use actix_http::{body::Body, Response}; use handlebars::Handlebars; // Custom error handlers, to return HTML responses when an error occurs. pub fn error_handlers() -> ErrorHandlers<Body> { ErrorHandlers::new().handler(StatusCode::NOT_FOUND, not_found) } // Error handler for a 404 Page ...
Rust
0
fn convert_decimals(in_price: usize, in_decimals: usize, out_decimals: usize) -> usize { if in_decimals > out_decimals { in_price / (10usize.pow((in_decimals - out_decimals) as u32)) } else if out_decimals > in_decimals { in_price * (10usize.pow((out_decimals - in_decimals) as u32)) } else ...
Rust
0
""" // @author: ComPleHN // @file: surface3d.vue // @time: 2025/5/29 10:41 // @description: 本文件是对于echarts的 3D曲面 图表的测试 """ # ---------------------------------------------- Surface3d - Surface_wave ---------------------------------------------- import math from typing import Union import pyecharts.options as opts from p...
Python
1
def test_inference_non_square_images(self): device = 'cpu' components = self.get_dummy_components() pipe = self.pipeline_class(**components) pipe.to(device) pipe.set_progress_bar_config(disable=None) inputs = self.get_dummy_inputs(device) image = pipe(**inputs, height=32, width=48).images ...
Python
1
S(ccounter.clone()), S(ccounter.clone()), S(ccounter) ).clone(); }); assert!(result.is_err()); assert_eq!( 1, Rc::strong_count(&counter) ); // ... and with arrays. let ccounter = counter.clone(); let child = std::panic::catch_unwind(move || ...
Rust
0
(max_hop + 1)] arrive_mat = (np.stack(transfer_mat) > 0) for d in range(max_hop, -1, -1): hop_dis[arrive_mat[d]] = d return hop_dis def normalize_digraph(A): Dl = np.sum(A, 0) num_node = A.shape[0] Dn = np.zeros((num_node, num_node)) for i in range(num_node): if Dl[i] > 0: ...
Python
1
# src/test_pipeline.py from models.sql_generator import SQLGenerator from utils.schema_definitions import SchemaDefinition def test_pipeline(): """Test the English-to-SQL pipeline with some sample questions.""" schema_def = SchemaDefinition() sql_generator = SQLGenerator() schema_text = schema_de...
Python
1
'a[i32] { i.numbers.as_ref() } fn name(&self) -> &'static str { "numbers" } } impl<'a> Attr<&'a mut Foo> for Numbers { type Output = &'a mut Vec<i32>; fn get(&self, i: &'a mut Foo) -> &'a mut Vec<i32> { &mut i.numbers } ...
Rust
0
test_arc(_: Arc<Box<dyn T>>) {} pub fn test_rc_box(_: Rc<Box<Box<dyn T>>>) {} } // https://github.com/rust-lang/rust-clippy/issues/8604 mod box_fat_ptr { use std::boxed::Box; use std::path::Path; use std::rc::Rc; use std::sync::Arc; pub struct DynSized { foo: [usize], } struc...
Rust
0
n rejected. - `PROCESSOR_REJECTED_OTHER`: Processor rejected, other. - `REFUNDED`: Refunded. - `REFUNDED_AFTER_CHARGEBACK`: Refunded after chargeback. - `WITHDRAWN`: Withdrawn. - `WON_ARBITRATION`: Won arbitration. - `WON_FIRST_CHARGEBACK`: Won first chargeback. - `WON_PREARBITRATION`: Won p...
Python
1
p"); assert_eq!(section.get_type(), elfio::constant::SHT_PROGBITS); assert_eq!(section.get_flags(), elfio::constant::SHF_ALLOC); assert_eq!(section.get_info(), 0); assert_eq!(section.get_link(), 0); assert_eq!(section.get_addr_align(), 1); assert_eq!(section.get_entry_size(), 0); assert_eq!(...
Rust
0
// e1000 "ice_release_vsi", // ice "vmxnet3_dev_tx_queue_release", // vmxnet3 "virtio_dev_pause", // virtio "softnic_thread_free", // softnic // "ipn3ke_hw_tm_init", // ipn3ke (currently ...
Rust
0
Ok(EtcdClient { client }) } pub async fn put( &self, key: String, val: String, ) -> Result<PutResponse, Box<dyn std::error::Error + Send + Sync + 'static>> { // Put a key-value pair self.client.kv().put(PutRequest::new(key, val)).await } pub async fn...
Rust
0
if 2 == 2 : print("la condition est vraie") age = 30 if age < 10 : print("vous êtes mineur") elif age < 70 : # pas else if() print("vous êtes majeur") elif age < 100 : print("vous êtes retraité") else : print("chiffre invalide") # match => ressemble à switch case # mais il n'y a pas de switch en ...
Python
1
tor_deflection_allowable"] = 1e-4 prob["stator_angle_allowable"] = 1e-3 myones = np.ones(2) prob["lss_diameter"] = 3.0 * myones prob["nose_diameter"] = 2.2 * myones prob["lss_wall_thickness"] = 0.1 * myones prob["nose_wall_thickness"] = 0.1 * myones prob["bedplate_wall_thickness"] = 0.05 * np.ones(4) prob["bear1.D_sha...
Python
1
_log_file) ExecShell(execStr) self.save_config() except: pass finally: if os.path.exists(tip_file): os.remove(tip_file) t = threading.Thread(target=_back_p) t.start() @staticmethod def _...
Python
1
#[test] fn test_fingering() { assert_eq!(Tone::C.to_finger().map(|f| f.to_string()), Some("●\n-\n●\n●\n●\n-\n●\n●\n●\n●\n".to_owned())); assert_eq!(Tone::SC.to_finger().map(|f| f.to_string()), Some("●\n-\n●\n●\n●\n-\n●\n●\n●\n◐\n".to_owned())); assert_eq!(Tone::D.to_finger().map(|f| f.to...
Rust
0
tj||dS)N)rr)r _quantile)r~rrrrqrrrsz DatetimeLikeArrayMixin._quantileaxisr"rAxisInt | NonecK8td|t||jtj|j||d}|||S)a  Return the minimum value of the Array or minimum along an axis. ...
Python
1
from typing import Any, Dict, List, Type, TypeVar, Union from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset T = TypeVar("T", bound="NotificationCreateData") @_attrs_define class NotificationCreateData: """Data of the request schema for create oper...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2015 Google LLC. All Rights Reserved. # # 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 requir...
Python
1
ete: # Then delete from vector store. await _adelete(destination, uids_to_delete) # First delete from record store. await record_manager.adelete_keys(uids_to_delete) num_deleted += len(uids_to_delete) if cleanup == "full" or cleanup ==...
Python
1
"班尼特": ["bennett", "班尼特", "班尼"], "诺艾尔": ["noelle", "诺艾尔"], "菲谢尔": ["fischl", "菲谢尔", "皇女"], "丽莎": ["lisa", "丽莎"], "凯亚": ["kaeya", "凯亚"], "安柏": ["amber", "安柏", "飞行冠军"], "雷泽": ["razor", "雷泽"], "迪奥娜": ["diona", "迪奥娜"], ...
Python
1
raise Exception('Comparing two "tip" versions is undefined') else: raise Exception('Unsupported version comparison: "%s" vs. "%s"' % (self.version, other.version)) def __eq__(self, other): return self.__cmp__(other) == 0 def __hash__(self): return hash(self.version) de...
Python
1
red") .index(1) .required(true)) .arg(Arg::with_name("green") .index(2) .required(true)) .arg(Arg::with_name("blue") .index(3) .required(true))) .subcommand(SubCommand::with_name("flash") .arg(Arg::with_name("red") .index(1) .required(true)) .arg(Arg::with_name("green") ...
Rust
0
(!strvalue.contains("ultrabullet")); } else if strvalue.contains("correspondence") { self.speed = TimeControl::Correspondence; } else { assert!(self.speed == TimeControl::Garbage); // println!("{:?}", strvalue); } } else if key ...
Rust
0
() started"); debug!("Going to call Payment::register"); if let Err(e) = Payment::register_method( PAYMENT_METHOD_NAME, Some(create_payment_address_handler), Some(add_request_fees_handler), Some(parse_response_with_fees_handler), Some(build_get_utxo_request_handler), ...
Rust
0
const GL_MAX_SHADER_BUFFER_ADDRESS_NV: u32 = 36661; pub const GL_NV_shader_buffer_store: u32 = 1; pub const GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV: u32 = 16; pub const GL_NV_shader_storage_buffer_object: u32 = 1; pub const GL_NV_shader_texture_footprint: u32 = 1; pub const GL_NV_shader_thread_group: u32 = 1; pub const ...
Rust
0
from __future__ import absolute_import, division, unicode_literals from . import base class Filter(base.Filter): """Injects ``<meta charset=ENCODING>`` tag into head of document""" def __init__(self, source, encoding): """Creates a Filter :arg source: the source token stream :arg en...
Python
1
ct = lambda path: False if path == user_config else True args = copy.deepcopy(self.arguments) args['--surf-reg'] = 'MSMSulc' args['--MSM-config'] = user_config with pytest.raises(SystemExit): settings = ciftify_recon_all.Settings(args) @patch('ciftify.config.find_cift...
Python
1
import numpy as np import matplotlib.pyplot as plt def uni_v3_pricing_euroexcu_gbm_version_analytic_solution(H, L, r, mu, C, sigma): # 这个版本的S默认为1 para_a = np.log(L)/sigma para_b = np.log(H)/sigma lambda_para = 1/(2-np.sqrt(L)-(1/np.sqrt(H))) part1_1 = lambda_para*(np.sqrt(H)-np.sqrt(L)) part1_...
Python
1
/// /// Unlike linux, you only have **one** user controlled segment, found in `gs`, and you can only set its address. /// /// The limit will always be set to `0xFFFFFFFF`, and adding this offset to a non-zero base address /// means that the resulting address will "wrap around" the address space, and end-up **under** /...
Rust
0
.get_left_child(root).unwrap(); assert_eq!(left_node.value, 5.0); } #[test] fn doc_test_add_right_node() { let mut tree: BinaryTree<f32> = BinaryTree::new(); let root = BinaryTreeNode::new(10.0); let root_index = tree.add_root(root); let right_node = BinaryTreeNode::...
Rust
0
from typing import Dict, List, Optional, Any, Tuple import logging from pathlib import Path # LangChain imports from langchain_text_splitters import MarkdownHeaderTextSplitter, RecursiveCharacterTextSplitter from langchain_core.documents import Document logger = logging.getLogger(__name__) class StructuredChunker: ...
Python
1
cycle cpu.tick(); } cpu.write_memory(self.addr, value) } } pub struct ZeroPageY { addr: u16, value: u8, is_store: bool, } impl ZeroPageY { pub fn init<S, I, M>(cpu: &mut Cpu<S, I, M>) -> Self where S: Screen, I: Input, M: Memory<I, S>, {...
Rust
0
"regency": "Boyolali", "residency": "Surakarta Residency", "province": "Central Java", "prov": "Central Java", "country": "Indonesia", "flag": "🇮🇩" }, "social_media": { "email": "hi@ridwaa...
Python
1
Some(self.value as u8 & 0b0111_1111) } } #[inline] fn size_hint(&self) -> (usize, Option<usize>) { (0, Some($size_hint)) } } } } macro_rules! impl_var_int_encode_usize { ($T:ty) => { impl VarInt...
Rust
0
st.toast("🗑️ 이미지가 삭제되도록 설정되었습니다.") if previous_image_key: should_delete_previous_image = True elif ( st.session_state.get("user_uploaded_file") ...
Python
1
import torch import torch.nn as nn import torch.nn.functional as F class MNIST_MLP(nn.Module): """ global batch_size = 100 """ def __init__(self, num_classes): super(MNIST_MLP, self).__init__() self.layers = nn.ModuleList() self.layers.append(nn.Linear(28*28, 500)) s...
Python
1
def f(text): ls = list(text) ls[0], ls[-1] = ls[-1].upper(), ls[0].upper() return ''.join(ls).istitle()
Python
1
(input: Seq<T>) -> Multiset<T> { decreases(input.len()); // TODO(utaal): when bug fixed, remove len // show we CAN build a multiset constructively from a seq if input.len()==0 { Multiset::empty() } else { multiset_from_seq(input.drop_last()).insert(input.last()) } } #[proof] fn mult...
Rust
0
{ self._tab.get::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'a, flatbuffers::ForwardsUOffset<Action>>>>(ActionList::VT_ACTIONS, None) } } impl flatbuffers::Verifiable for ActionList<'_> { #[inline] fn run_verifier( v: &mut flatbuffers::Verifier, pos: usize ) -> Result<(), flatbuffers::InvalidFl...
Rust
0