text
string
label_name
string
labels
int64
def words_in_sentence(sentence): """ You are given a string representing a sentence, the sentence contains some words separated by a space, and you have to return a string that contains the words from the original sentence, whose lengths are prime numbers, the order of the words in the new strin...
Python
1
elope(&'a mut self) -> &'a mut [T]; fn get_ro_envelope(&'a self) -> &'a [T]; fn get_channels(&self) -> cpal::ChannelCount; } /// Number of samples to combine to produce comparatively low sampling rate /// envelope, and for other calculations where lower sampling rate makes sense /// for efficiency. const DOWNS...
Rust
0
#!/usr/bin/env python3 """ 🔐 Bitget API 配置脚本 安全配置Bitget交易所API密钥 """ import os import sys from pathlib import Path # 添加项目根目录到Python路径 sys.path.insert(0, str(Path(__file__).parent)) from src.config.api_config_manager import APIConfigManager from loguru import logger def setup_bitget_api(): """配置Bitget API""" ...
Python
1
import re import requests from selectolax.parser import HTMLParser from utils.utils import headers, region def vlr_rankings(region_key): url = "https://www.vlr.gg/rankings/" + region[str(region_key)] resp = requests.get(url, headers=headers) html = HTMLParser(resp.text) status = resp.status_code ...
Python
1
def average(n): '''given some numbers and their sum is divided by no. of given numbers''' average=sum(n)/len(n) return average n=list(map(int,input().split())) print(average(n)) print(average.__doc__)
Python
1
h::Path, time::Duration}; use sync::AccountSynchronizer; pub async fn handle<C: AsRef<Path>>( client: exocore::client::Client, node_dir: C, opt: &cli::Options, ) { let conf_path = node_dir.as_ref().join(&opt.conf); let config = Config::from_file(conf_path).expect("Failed to parse config"); let ...
Rust
0
{ Self(data.len() as i16) } } impl HotlineProtocol for FieldSize { fn into_bytes(self) -> Vec<u8> { let Self(value) = self; value.to_be_bytes().into() } fn from_bytes(bytes: &[u8]) -> BIResult<Self> { let (bytes, value) = be_i16(bytes)?; Ok((bytes, Self(value)))...
Rust
0
R` is the filter for which measurements can become Exemplars. """ OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION = ( "OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION" ) """ .. envvar:: OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION The :envvar:`OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTO...
Python
1
点乱。', TxtCtl.Enter, ), ) CloseMessageWindow() ChrTalk( 0x000C, ( '#0030010979V#026F嗯……', TxtCtl.Enter, TxtCtl.Clear, '#0030010980V#026F…………………………', TxtCtl.Enter, ), ) CloseMessageWindow() C...
Python
1
def are_levels_safe(levels: list[int]) -> bool : level_diffs = [y - x for x, y in zip(levels[1::], levels[::1])] levels_are_all_increasing_or_decreasing = (all(level_diff > 0 for level_diff in level_diffs) or all( level_diff < 0 for level_diff in level_diffs)) level_diffs_in_range = all(1 <= abs(l...
Python
1
#!/usr/bin/python # -*- coding: utf-8 -*- import tornado.web import tornado.ioloop from r3.app.handlers.healthcheck import HealthcheckHandler from r3.app.handlers.stream import StreamHandler from r3.app.handlers.index import IndexHandler from r3.app.utils import kls_import class R3ServiceApp(tornado.web.Application)...
Python
1
) => { Ok(Async::Pending) } GeneratorState::Complete(e) => { this.done = true; e.into_result().map(|()| Async::Ready(None)) } } }) } } //! Tests auto-converted from "sass-spec/spec/core_fu...
Rust
0
 c@sP dZddlZdejfdYZdejfdYZdejfdYZd eejfd YZd eejfd YZd Zeje dZ e j idd6dd6dd6dd6dd6dd6dd6dd6dd 6d!d"6d#d$6d%d&6d'd(6d)d*6d+d,6d-d.6d/d0...
Python
1
eature(const_mut_refs)] //! //! use const_format::{call_debug_fmt, formatc}; //! //! // Positional argument //! assert_eq!(formatc!("{}", |fmt| fmt.write_ascii_repeated(b'a', 4) ), "aaaa"); //! //! // Named argument //! assert_eq!(formatc!("{foo}", foo = |fmt| fmt.write_ascii_repeated(b'0', 10) ), "0000000000"); //! //...
Rust
0
nstrument: updowncounter Unit: {thread} """ PROCESS_RUNTIME_JVM_CLASSES_LOADED = "process.runtime.jvm.classes.loaded" """ Number of classes loaded since JVM start Instrument: counter Unit: {class} """ PROCESS_RUNTIME_JVM_CLASSES_UNLOADED = ( "process.runtime.jvm.classes.unl...
Python
1
N = int(input()) costs = [] for _ in range(N): cost = list(map(int, input().split())) costs.append(cost) # dp의 상태: dp[i][j]에서 i는 집의 번호 (0번 부터 시작), j는 색깔 0: R, 1: G, 2: B # i번 째 집이 현재 R을 선택했다면 dp[i][0]에 토탈값이 저장됨 (단 최솟값으로) # dp의 값: dp[i][j] = 현재까지 진행된 비용의 토탈값 dp = [[0] * 3 for _ in range(N)] # unpacking dp[...
Python
1
inprogress=0 self.initialized=False if self.valuecount == 1: self.vtype = rpieGlobals.SENSOR_TYPE_SINGLE elif self.valuecount == 2: self.vtype = rpieGlobals.SENSOR_TYPE_DUAL elif self.valuecount == 3: self.vtype = rpieGlobals.SENSOR_TYPE_TRIPLE elif self.valuecount == 4: self.vtype = rpieGloba...
Python
1
from odoo import fields, models from odoo.exceptions import UserError class PaymentAcquirer(models.Model): _inherit = "payment.acquirer" provider = fields.Selection(selection_add=[("boleto-inter", "Boleto Banco Inter")], ondelete = { 'boleto-inter' : 'set default' }) class PaymentTransaction(models.Model):...
Python
1
ame = "__LUMEN_ATOM_TABLE_SIZE"] pub static NUM_ATOMS: c_uint; /// This symbol is defined in the compiled executable, /// and provides a pointer to the atom table, or more specifically, /// a pointer to the first pointer in the atom table. The atom table /// is an array of pointers to null-terminat...
Rust
0
ite(true) .open(temp.as_path()) .unwrap(); let r = OpenOptions::new() .read(true) .write(false) .open(temp.as_path()) .unwrap(); let mut writer = BufWriter::new(w); let mut reader: Box<dyn RafsIoRead> = Box::new(r); ...
Rust
0
{ pub state : VrrpVrState, pub master_adv_int : u16, pub skew : u16, pub master_down_int : u16, pub mac : MacAddress, pub tracking : VrrpVrTracking, } // Implementation for vrrp_vr_track_if #[derive(Debug, Clone, Serialize, Deserialize, Default)] pub struct VrrpVrTrackIf { pub sw_if_index : Interface...
Rust
0
me generation #node._name = "{}:{}".format( node.lower._name, node.upper._name ) node._name = "?:?" def visit_Num( self, node ): # Name generation node._name = str( node.n ) self.stack.append( node ) #------------------------------------------------------------------------ # Self #--------------...
Python
1
381, DensePolynomial<Fr>>; type PlonkInst = Plonk<Fr, Blake2s, PC>; pub fn ks() -> [Fr; 4] { [ Fr::one(), Fr::from(7_u64), Fr::from(13_u64), Fr::from(17_u64), ] } pub fn circuit() -> Composer<Fr> { let mut cs = Composer::new(); ...
Rust
0
b fn color_text_defocus() -> ColorId {uid!()} pub fn color_text_selected_focus() -> ColorId {uid!()} pub fn color_text_deselected_focus() -> ColorId {uid!()} pub fn color_text_selected_defocus() -> ColorId {uid!()} pub fn color_text_deselected_defocus() -> ColorId {uid!()} } pub fn set_widget_style(cx:...
Rust
0
ormal[System`SparseArray[System`Automatic, dims_List, default_, data_List]]""" its = [ListExpression(n) for n in dims.elements] table = Expression(SymbolTable, default, *its) table = table.evaluate(evaluation) # Now, apply the rules... for item in data.elements: pos, ...
Python
1
ginia) (us-east-1)</p> /// </li> /// <li> /// <p>US West (Oregon) (us-west-2)</p> /// </li> /// <li> /// <p>Asia Pacific (Sydney) (ap-southeast-2)</p> /// </li> /// <li> /// <p>EU (Ireland) (eu-west-1)</p> /// </li> /// </ul> ...
Rust
0
# -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- # ex: set softtabstop=4 shiftwidth=4 tabstop=4 expandtab: # # Author(s): Peter Kazanzides # Created on: 2005-12-31 # # (C) Copyright 2005-2007 Johns Hopkins University (JHU), All Rights # Reserved. # --- begin cisst license - do not edit --- # # Th...
Python
1
}, numbers::{NonNegative, PositiveReal}, }; /// Interface complexity level. /// /// This logical stream parameter specifies the guarantees a source makes about /// how elements are transferred. Equivalently, it specifies the assumptions a /// sink can safely make. /// /// # Examples /// /// ```rust /// use til_que...
Rust
0
(35), &())?; /// db.put(&mut wtxn, &BEI64::new(0), &())?; /// db.put(&mut wtxn, &BEI64::new(42), &())?; /// /// // you can iterate over database entries in order /// let rets: Result<_, _> = db.iter(&wtxn)?.collect(); /// let rets: Vec<(BEI64, _)> = rets?; /// /// let expected = vec![ /// (BEI64::new(0), ()), /// ...
Rust
0
Safe: checked is_none above } /// Abort an interrupt-driven receive. fn receive_abort_interrupt(&self) -> Result<(), ErrorCode> { if self.rx_status.get() != USARTStateRX::Idle { self.rx_status.set(USARTStateRX::AbortRequested); Err(ErrorCode::BUSY) } else { ...
Rust
0
outCreateFlags = VkFlags; pub type VkPipelineCacheCreateFlags = VkFlags; pub type VkPipelineCreateFlags = VkFlags; pub type VkPipelineShaderStageCreateFlags = VkFlags; pub type VkShaderModuleCreateFlags = VkFlags; pub type VkAccessFlags = VkFlags; pub type VkDependencyFlags = VkFlags; #[repr(C)] pub struct VkInstanceO...
Rust
0
der_path = f'{self.settings.training_dir}/{folder}' if os.path.exists(folder_path): for file in os.listdir(folder_path): file_path = os.path.join(folder_path, file) if os.path.isfile(file_path): os.remove(fil...
Python
1
label_text3.text = "{:.2f}V".format(voltages[2]) label_text4.text = "{:.2f}V".format(voltages[3]) # Update gauge levels (assuming max voltage is 5V and scaling to 100) gauge1.level = int((voltages[0] / 5.0) * 100) gauge2.level = int((voltages[1] / 5.0) * 100) gauge3....
Python
1
"""自我纠错RAG系统的节点实现 本模块包含LangGraph中各个节点的实现,包括: - 查询预处理节点 - 智能检索节点 - 文档相关性评分节点 - 查询重写节点 - 答案生成节点 - 答案验证节点 - 答案纠错节点 - 路由决策节点 """ # 导入所有节点函数 try: from .preprocessing import preprocess_query_node except ImportError: preprocess_query_node = None try: from .retrieval import intelligent_retrieval_node, grade_docu...
Python
1
iter, last_ptr: last_ptr, last_dim: last_dim, life: PhantomData, } } macro_rules! chunk_iter_impl { ($iter:ident, $array:ident) => ( impl<'a, A, D> $iter<'a, A, D> where D: Dimension { fn get_subview(&self, iter_item: Option<*mut A>) ...
Rust
0
-> Result<String> { Ok( request .header_names() .map(|key| format!("{}: {}", key, request.header(key).unwrap())) .collect::<Vec<String>>() .join("\n"), ) } pub fn server() -> tide::Server<()> { let mut server = tide::new(); server.at("/").get(endpoint); server } // bmi use std::i...
Rust
0
&tree, // tree &[&parent_commit]) // parents } fn fetch(path: &Path, config: Config) -> Result<(), git2::Error> { let state = RefCell::new(State { progress: None, total: 0, current: 0, path: None, newline: false, }); let repo = Repository::open(pat...
Rust
0
match parent_node { rustc_hir::Node::Item(rustc_hir::Item { kind: rustc_hir::ItemKind::Impl(impll), .. }) => match &impll.self_ty.kind { rustc_hir::TyKind::Path(QPath::Resolved( None, rustc_hir::Path { res: rustc_hir::def::Res::Def(_, self_def...
Rust
0
print('Hoàng Thanh Kiếm MSSV 235752021610003') # File: main.py import mymath as mt # Nhập module mymath với tên tắt là mt # Danh sách các giá trị values = [2, 4, 6, 8, 10] # Tính bình phương của từng giá trị trong danh sách print('Squares:') for v in values: print(mt.square(v)) # Gọi hàm square từ mymath (sử d...
Python
1
hsch4_duty: crate::Reg<hsch4_duty::HSCH4_DUTY_SPEC>, #[doc = "0x5c - "] pub hsch4_conf1: crate::Reg<hsch4_conf1::HSCH4_CONF1_SPEC>, #[doc = "0x60 - "] pub hsch4_duty_r: crate::Reg<hsch4_duty_r::HSCH4_DUTY_R_SPEC>, #[doc = "0x64 - "] pub hsch5_conf0: crate::Reg<hsch5_conf0::HSCH5_CONF0_SPEC>, ...
Rust
0
pub struct _USB2_CHRG_DETECT_TOG; #[doc = "`read()` method returns [usb2_chrg_detect_tog::R](usb2_chrg_detect_tog::R) reader structure"] impl crate::Readable for USB2_CHRG_DETECT_TOG {} #[doc = "`write(|w| ..)` method takes [usb2_chrg_detect_tog::W](usb2_chrg_detect_tog::W) writer structure"] impl crate::Writable for U...
Rust
0
""" Usage: python merge_lora.py --base_model_path [BASE-MODEL-PATH] --lora_path [LORA-PATH] """ import argparse from peft import PeftModel from transformers import AutoTokenizer, AutoModelForCausalLM def merge_lora(base_model_name, lora_path_list): base_model = AutoModelForCausalLM.from_pretrained(base_model_nam...
Python
1
slice = r.slice(3..8).iter_chars(); assert_eq!(Some(('l', 3)), slice.next()); assert_eq!(Some(('o', 4)), slice.next()); assert_eq!(Some(('\u{a9}', 5)), slice.next()); assert_eq!(Some(('w', 7)), slice.next()); assert_eq!(Some(('o', 8)), slice.next()); assert_eq!(None, sl...
Rust
0
seek(&err_pos).unwrap(); assert_matches!( reader.next().unwrap(), Err(Error::InvalidSep { found: b'~', pos: ErrorPosition { line: 7, id: Some(_), }, }) ...
Rust
0
Fluence Labs Limited * * 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,...
Rust
0
let mut batch = DefaultBatch::default(); batch.records.push(record_msg); partition_request.partition_index = replica.partition; partition_request.records.batches.push(batch); topic_request.name = replica.topic.to_owned(); topic_request.partitions.push(partition_request); request.acks = 1;...
Rust
0
# Copyright 2012-2018 Canonical Ltd. This software is licensed under the # GNU Affero General Public License version 3 (see the file LICENSE). """Tests for the get-named-conf command.""" from argparse import ArgumentParser import io from maastesting.testcase import MAASTestCase from provisioningserver.dns.commands....
Python
1
print("小说自动视频制作工具 - 交互式启动") print("="*60) # 选择小说文件 novels = self.list_novels() if not novels: print("❌ 在 data/novels/ 目录中没有找到小说文件") print("请将 .txt 格式的小说文件放入该目录") return print("\n📚 可用的小说文件:") for i, novel in enume...
Python
1
().expect("create temp dir"); let public = &tmp_dir.path().join("public"); site.set_output_path(&public); b.iter(|| site.render_taxonomies().unwrap()); } #[bench] fn bench_render_paginated(b: &mut test::Bencher) { let mut site = setup_site("small-blog"); let tmp_dir = tempdir().expect("create temp ...
Rust
0
stake_authority, false), AccountMeta::new(*validator_stake_list, false), AccountMeta::new(*stake_account, false), AccountMeta::new(*burn_from, false), AccountMeta::new(*pool_mint, false), AccountMeta::new_readonly(sysvar::clock::id(), false), AccountMeta::new_readonly(*to...
Rust
0
Number of validation samples lr_gamma = 0.001 # Added learning rate gamma parameter lr_decay = 0.75 # Added learning rate decay parameter print("momentum", momentum) print("K", K) print("batch_size", batch_size) print("lr", lr) print("lr_gamma", lr_gamma) print("lr_decay", lr_decay)...
Python
1
Edit::Insert('\r')); dbg!(&buffer); expecteds.push(buffer.clone()); arb::TestEdit::apply(&mut buffer, TestEdit::Insert('\n')); arb::TestEdit::apply(&mut buffer, arb::TestEdit::Delete); assert_text_buffer_eq_ignoring_history!(&buffer, &expecteds[1]); arb::TestEdit::apply(&mut buffer, arb::TestEd...
Rust
0
""" Test Portuguese NIF & CC """ from pii_manager import PiiEnum, PiiEntity from pii_manager.api import PiiManager TEST = [ # A valid NIF ( "Meu NIF é PT 123 456 789", "Meu NIF é <GOV_ID>", [PiiEntity(PiiEnum.GOV_ID, 10, "PT 123 456 789", "pt", "Portuguese NIF")], ), # A NIF wi...
Python
1
""" Unit tests for featurebyte.core.timedelta """ import pytest from typeguard import TypeCheckError from featurebyte.core.timedelta import to_timedelta from featurebyte.enum import DBVarType from featurebyte.query_graph.enum import NodeType from tests.util.helper import get_node @pytest.mark.parametrize( "unit...
Python
1
from django.contrib.auth import get_user_model from rest_framework import serializers from .models import Book User = get_user_model() class UserSerializer(serializers.ModelSerializer): displayed_name = serializers.SerializerMethodField() class Meta: model = User fields = ["id", "username",...
Python
1
assert_eq!( range_multiple_step.iter().collect::<Vec<usize>>(), vec![5, 10, 15, 20, 25, 30, 35, 40, 45] ); } #[test] fn test_range_eq() { let range1 = Range::new(0, 10, 1); let range2 = Range::new(0, 10, 1); let range3 = Range::new(5, 10, 1); ...
Rust
0
", ["centroid", "medoid"]) def test_hdbscan_error_precomputed_and_store_centers(store_centers): """Check that we raise an error if the centers are requested together with a precomputed input matrix. Non-regression test for: https://github.com/scikit-learn/scikit-learn/issues/27893 """ rng = np....
Python
1
# Remove 'avg_' prefix clean_metric = metric[4:].replace('_', ' ').title() row[clean_metric] = f"{metrics[metric]:.3f} ± {metrics[f'std_{metric[4:]}']:.3f}" rows.append(row) tables['overall_performance'] = pd.DataFrame(rows) # Table 2: Scenar...
Python
1
}; } pub fn ProcessEvents(&self, events: &[EpollEvent]) { for e in events { let fd = e.U64 as i32; let event = e.Event as EventMask; self.Notify(fd, event) } } pub fn InitPollHostEpoll(&self, hostEpollWaitfd: i32) { self.lock().epollfd ...
Rust
0
(prompt) all_prompts.append({'text': txt, 'experiment': 'witte2024safe_exploration/', 'participant': ID, 'age': data.loc[data["ID"] == ID, "age"].unique().item(), 'gender': gender, 'STICSA': data....
Python
1
ddr as usize % (1 * 1024)] = data } Region::GamePak0Lo | Region::GamePak0Hi => { *cycles += self.sysctl.gamepak_cycles[0].byte.get(seq); self.gamepak_write8(addr, data, true); } Region::GamePak1Lo | Region::GamePak1Hi => { *...
Rust
0
he gradient and Voronoi cells are used for # stratification. :class:`.Kriging` class is used with :class:`.Gaussian` correlation # model. #%% from UQpy.sampling import GradientEnhancedRefinement refinement = GradientEnhancedRefinement(strata=strata, runmodel_object=rmodel, surrogate=K) z = RefinedStratifiedSampling(...
Python
1
of a value. These will be left alone and skipped. Enums: CommonCharactersToIgnoreValueValuesEnum: Common characters to not transform when masking. Useful to avoid removing punctuation. Fields: charactersToSkip: Characters to not transform when masking. commonCharactersToIgnore: Common characte...
Python
1
cjpeg_source_ptr, ) -> crate::jmorecfg_h::JDIMENSION /* This version is for reading raw-byte-format PGM files with any maxval and converting to extended RGB */ { let mut source: ppm_source_ptr = sinfo as ppm_source_ptr; let mut ptr: crate::jpeglib_h::JSAMPROW = 0 as *mut crate::jmorecfg_h::JSAMPLE; let m...
Rust
0
alled once /// to avoid aliasing `&mut` references (which is undefined behavior). //The whole physical memory is mapped at the offset physical_memory_offset unsafe fn active_level_4_table(physical_memory_offset: VirtAddr) -> &'static mut PageTable { use x86_64::registers::control::Cr3; let (level_4_frame, _) =...
Rust
0
y. Currently, disabling this feature will always result in a compilation error. It is intended to add `alloc`-only support to regex in the future. ### Performance features * **perf** - Enables all performance related features. This feature is enabled by default and will always cover all features that improve ...
Rust
0
y_top #body_bottom } } }) } fn check_redundant_ocall_id(methods: &[OcallMethod]) -> Result<()> { let mut ids = Vec::new(); for method in methods { if ids.contains(&method.id) { return Err(syn::Error::new_spanned( &method.method.sig, ...
Rust
0
from langchain_community.utilities.google_trends import GoogleTrendsAPIWrapper __all__ = ["GoogleTrendsAPIWrapper"]
Python
1
it is possible for the below division to // return NaN instead of +inf, in the case where (1.0 - s) rounds down to zero. return FreeCoordinate::INFINITY; } else if ds < 0.0 { // Simplify to positive case only. // Note that the previous condition eliminated the case of negative zero....
Rust
0
let next_total_cost = total_cost + costs_by_alpha(&half_edge.edge_costs, &alpha); if next_total_cost < my_costs[next_node] { my_costs[next_node] = next_total_cost; previous[next_node] = Some(half_edge.edge_id); self.touched_nodes.push(next_node); ...
Rust
0
src = os.path.join(args.download_dir, src) dst = os.path.join(args.download_dir, dst) if not os.path.isdir(dst): os.symlink(src, dst) per_symlink('ILSVRC2015/Annotations/VID/train/ILSVRC2015_VID_train_0000', 'ILSVRC2015/Annotations/VID/train/a') per_symlink('ILSVRC2015/Annotat...
Python
1
py_match = _only_source_rev_file.match(filename) if not py_match: return None py_filename = py_match.group(1) if scriptdir.sourceless: is_c = py_match.group(2) == "c" is_o = py_match.group(2) == "o" else: is_c = is_o = False ...
Python
1
ders, 7) OVER () AS last_week FROM daily_orders ORDER BY day "###); // sort does not leak out of groups let query: Query = parse( r###" from daily_orders sort day group month (sort num_orders | window expanding:true (derive...
Rust
0
r = Repr>, Dst: LabelledGeneric<Repr = Repr>, { <Dst as LabelledGeneric>::convert_from(src) } /// Converts from one type into another assuming that their labelled generic representations /// can be sculpted into each other. /// /// The "Indices" type parameter allows the compiler to figure out that the two rep...
Rust
0
pr(BigInteger384([ 0x85c9f989e1461f03, 0xa2e33c333449a1d6, 0x41e461154a7354a3, 0x9ee53e7e84d7532e, 0x1c202d8ed97afb45, 0x51d3f9253e2516f, ])), Fq::from_repr(BigInteger384([ 0xa7348a8b511aedcf, 0x143c215d8176b...
Rust
0
); let cached_teams = cached.publisher_teams(crate_name); if let (Some(pub_users), Some(pub_teams)) = (cached_users, cached_teams) { bar.set_prefix("Loading cache"); users.insert(crate_name.clone(), pub_users); teams.insert(crate_name.clone(), pub_teams); } el...
Rust
0
val.is_truthy()).wrap(), } } fn logic(&mut self, data: LogicData, _pos: SourcePos) -> Result<Box<dyn Value>> { let left = pass_msg!(data.lhs.accept(self)?).is_truthy(); Bool::new(match data.op { LogicOperator::And => if left { pass_msg!(data.rhs.accept(self)?).is_truthy() } else { false }, LogicOperator:...
Rust
0
file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "def...
Python
1
; /// Results of message handling operations. pub type Result<T> = core::result::Result<T, DispatchError>; /// Connector trait: Connects enum dispatcher for messages with the contract. pub trait MessageDispatcher { /// The contract's message dispatcher type. type Type; } /// Connector trait: Connects enum di...
Rust
0
Q\x80\ \xca\x14\xfb?\x14\xf3\xf2E+\x00{j7\xcfw\xd3\ \x99\xc5\xba>\x90/\x86\x7fv[wn\xd1}\x8f\xff\ 2t\x0c\xa02\x99^6{y\xc3\xc5\xc5\xba|\xd1\ \x0a\x80\xcb\xfe\xaeX\xd7\x06\xf2\xc5\xf0\xcf\xeew;7\ \xebc\xbfx\xbb\xf6\xf4?\x1d:\x0aP\xb1<\xb2\xa2\ m\xd2\x8b\xf2\x10\xe0\xcc\x15S\xa7G\xe6\xbf.\xc6\xb5\ \x81|1\xfc\xb3c\xf8\x03\x...
Python
1
(()), } } } } <gh_stars>1-10 use std::fs::File; use std::io::Read; use std::io::Seek; use std::io::SeekFrom; use std::ops::Index; use std::ops::IndexMut; #[derive(Copy, Clone)] pub enum MemSection { Vram, RomBank0, } pub const REGION_TILEDATA_UNSIGNED_BEG: u16 = 0x8000; pub const REGIO...
Rust
0
_log(); } loop { unsafe { asm!("cli"); let main_queue = global::main_queue(); if main_queue.len() == 0 { asm!("sti"); asm!("hlt"); continue; } let msg: Message = main_queue.remove(0); ...
Rust
0
rite the -Aunused in compiletest-rs if have_fullmir() { flags.push("-Zmiri-start-fn".to_owned()); } if opt { flags.push("-Zmir-opt-level=3".to_owned()); } else { flags.push("-Zmir-opt-level=0".to_owned()); // For now, only validate without optimizations. Inlining breaks ...
Rust
0
e_symbol(&h1, &dk.p) * legendre_symbol(&h1, &dk.q); while jacobi_symbol != -1 { h1 = bigint::sample_range(&one, &(&ek.n - &one)); jacobi_symbol = legendre_symbol(&h1, &dk.p) * legendre_symbol(&h1, &dk.q); } let secret = bigint::sample_below(&S); let h2 = h1.powm(&...
Rust
0
Box::new( Exp::Begin( vec![ mk_set_op(mk_var(x1), Binop::Plus, mk_var(x1), mk_num_lit(35)) , mk_mset(mk_var(...
Rust
0
do not want to probe the service here as it might not be available on app startup match url.username() { Some(_) => Ok(Service::locked_rtsp(mac, socket_addr, Some(path))), None => Ok(Service::rtsp(mac, socket_addr, path)), } } /// Parse a given HTTP URL and return an MJPEG service, a LockedMJP...
Rust
0
True config.restart_from_best = given_config.restart_from_best # copy over new num_epochs and lr schedule config.num_epochs = given_config.num_epochs config.lr_schedule = given_config.lr_schedule else: print("Config: %s" % config_to_str(config)) # 将config配置参数转化为str,并print ...
Python
1
isable=import-error, unused-import # noqa: F401 from diffusers.models import transformers as diffusers_transformers # pylint: disable=import-error, unused-import # noqa: F401 from diffusers.models import controlnets as diffusers_controlnets # pylint: disable=import-error, unused-import # noqa: F401 ...
Python
1
URegisters, value: u8) { regs.set_accumulator(value); regs.set_x(regs.accumulator()); } pub(crate) fn lax_indirect_x(regs: &mut CPURegisters, mem: &RamController) -> i32 { let address = mode::indexed_indirect(regs, mem); lax(regs, mem.read8(address)); 6 } pub(crate) fn lax_indirect_y(regs: &mut C...
Rust
0
os.path.exists( db_response): task_state(code=ErrorCode.INTERNAL_ERROR.value, state='知识库未建立或中途异常,已自动反馈研发。请重新建立知识库。') return # try: retriever = cache.get(fs_id=fs_id, config_path=configpath, work_dir=workdir)...
Python
1
}.txt') if os.path.exists(prompt_path): continue fill_prompt(template, substitute_dict, prompt_path) answer_path = os.path.join(question_folder, 'answer.txt') with open(answer_path, 'w') as f: f.write('\n...
Python
1
ay( [[-1.564, -0.992, 0.101], [-0.724, 0.176, 0.402], [-1.205, 1.374, -0.42 ], [ 0.709, -0.132, 0.051], [ 1.001, -1.213, -0.403], [ 1.66 , 0.795, 0.243], [-1.281, -1.723, 0.736], [-2.509, -0.741, 0.351], [-0.796, 0.411, 1.464], [-1.133, 1....
Python
1
.len() { return Err(Error::OutOfBound); } let mut writer = Cursor::new(&mut self.data); writer.seek(SeekFrom::Start(addr as u64))?; writer.write_u64::<LittleEndian>(value)?; Ok(()) } fn store_bytes(&mut self, addr: usize, value: &[u8]) -> Result<(), Error> { ...
Rust
0
"""UIUpdateManager のテスト""" import unittest from unittest.mock import Mock, MagicMock from src.ui.ui_update_manager import UIUpdateManager, get_ui_update_manager from src.ui.ui_component_base import DummyPartyUIComponent from src.character.party import Party from src.character.character import Character class TestUIU...
Python
1
#!/usr/bin/python3 for num1 in range(0, 8): for num2 in range(num1 + 1, 10): print('{:d}{:d}'.format(num1, num2), end=', ') print('{:d}{:d}'.format(num1 + 1, num2))
Python
1
ity entity.""" _name_suffix = "Sensitivity" unique_id_suffix = "sensitivity" _update_key = "sensitivity" _attr_entity_category = EntityCategory.CONFIG _attr_options = list(SENSITIVITY_TO_DECONZ) TYPE = SELECT_DOMAIN @property def current_option(self) -> str | None: """Return ...
Python
1
lf, url: &str) -> Result<&mut Self> { self.listen_flags(url, Default::default()) } /// Listen for connections to specified URL. See [nng_listen](https://nng.nanomsg.org/man/v1.2.2/nng_listen.3). fn listen_flags(&mut self, url: &str, flags: SocketFlags) -> Result<&mut Self> { unsafe { ...
Rust
0
import random import numpy as np from character_configurations import random_10_vs_10, archer_10_vs_10 from game_constants import GRID_ROWS, CELL_SIZE, MOVEMENT_DELAY, \ GRID_COLUMNS from player_character import PlayerCharacter from trees import Tree1, Tree2 from weapon import Arrow class GameState: def __i...
Python
1
for (disk_id, disk) in DISK_SERVICE.lock().iter() { // match disk { // DiskType::ATA(ref drive) => { // match Ext2Filesystem::read_from(drive) { // Err(_) => {}, // Ok(fs) => { // ...
Rust
0
1usize); } impl Clone for RenderModel_ControllerMode_State_t { fn clone(&self) -> Self { *self } } #[repr(C)] #[derive(Debug, Copy)] pub struct NotificationBitmap_t { pub m_pImageData: *mut ::std::os::raw::c_void, pub m_nWidth: i32, pub m_nHeight: i32, pub m_nBytesPerPixel: i32, } #[test] fn bind...
Rust
0