text
string
label_name
string
labels
int64
mod encryption_should { use super::*; #[test] fn encrypt_without_error() { let result = encrypt(b"Hello, World!"); if let Ok(d) = result { println!("{:?}", d); } else { panic!(); } } #[test] fn decrypt_to_correct_string() { ...
Rust
0
stimator_checks` once we are able # to construct meta-estimator instances def test_support_missing_values(MultiClassClassifier): # smoke test to check that pipeline OvR and OvO classifiers are letting # the validation of missing values to # the underlying pipeline or classifiers rng = np.random.RandomSt...
Python
1
from pydantic import BaseModel, Field from typing import Optional, Dict, Any, List from datetime import datetime from enum import Enum class PostStatus(str, Enum): DRAFT = "draft" SCHEDULED = "scheduled" PUBLISHING = "publishing" PUBLISHED = "published" FAILED = "failed" class Platform(str, Enum):...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2025 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
let index = heap.push(&first); let second = SomeStruct { some_value: 3 }; heap.push(&second); let third = SomeStruct { some_value: 1 }; heap.push(&third); let changed = SomeStruct { some_value: 2 }; heap.change_item(index, &changed); assert!(!heap.is_empty()); ...
Rust
0
6); } sliced } pub fn into_inner(self) -> Box<[u32; 256]> { self.heights } pub fn as_inner(&self) -> &[u32; 256] { &self.heights } } impl Index<LayerPosition> for ColumnHeightMap { type Output = u32; fn index(&self, index: LayerPosition) -> &u32 { &self.heights[index.zx() as usize] } } impl Inde...
Rust
0
} <reponame>Fair-Exchange/safecoin-program-library<filename>feature-proposal/program/src/instruction.rs<gh_stars>0 //! Program instructions use crate::{state::AcceptanceCriteria, *}; use borsh::{BorshDeserialize, BorshSchema, BorshSerialize}; use safecoin_program::{ instruction::{AccountMeta, Instruction}, ms...
Rust
0
# Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. # Symbol Value # I 1 # V 5 # X 10 # L 50 # C 100 # D 500 # M 1000 # For example, 2 is written as II in Roman numeral, just two ones added togeth...
Python
1
def __init__(self, *args, **kwds): """ Constructor. Any message fields that are implicitly/explicitly set to None will be assigned a default value. The recommend use is keyword arguments as this is more robust to future message changes. You cannot mix in-order arguments and keyword arguments. ...
Python
1
fault(); static ref pi2: Interval = Interval::new(PI/2., PI/2.); static ref pi: Interval = Interval::new(PI, PI); static ref mipi :Interval = Interval::new(-PI, -PI); // same as pi after normalization static ref mipi2 :Interval = Interval::new(-PI/2., -PI/2.); // Single quadrant...
Rust
0
9 => return sapp_keycode_SAPP_KEYCODE_W, 120 => return sapp_keycode_SAPP_KEYCODE_X, 121 => return sapp_keycode_SAPP_KEYCODE_Y, 122 => return sapp_keycode_SAPP_KEYCODE_Z, 49 => return sapp_keycode_SAPP_KEYCODE_1, 50 => return sapp_keycode_SAPP_KEYCODE_2, 51 => return sapp_...
Rust
0
import sys from collections import deque input=sys.stdin.readline def bfs(land_1,land_2,mid): visit=[False]*(n+1) q=deque() while q: current=q.popleft if current==land_2: return True #도착점 도달하면 True반환 #################################################### n,m=map(int,input().split()) gr...
Python
1
8) -> PadAdapter<'a, 'b> { PadAdapter { fmt: fmt, on_newline: true, levels: levels, } } fn new(fmt: &'a mut fmt::Formatter<'b>) -> PadAdapter<'a, 'b> { PadAdapter::new_levels(fmt, 1) } } impl<'a, 'b: 'a> Write for PadAdapter<'a, 'b> { fn write...
Rust
0
ear. reversed_move_1 = self._create_credit_note(inv=invoice_1, line_vals={'quantity': 1}, credit_note_date=date(2023, 12, 20), post=False) self.assertTrue(reversed_move_1.l10n_in_reversed_entry_warning) # Case 2: Credit note created before 30th November (August 1, 2023) # Expected: The ...
Python
1
import base64 from pdf2image import convert_from_path def pdf_to_base64(pdf_path: str) -> list: """ Konvertiert die Seiten einer PDF-Datei in Base64-codierte PNG-Bilder. :param pdf_path: Pfad zur PDF-Datei. :return: Liste von Base64-codierten Strings der Bilder. """ try: # PDF in Bild...
Python
1
L1OpticalFlow_delete, cv_PtrOfSuperres_DualTVL1OpticalFlow_get_inner_ptr, cv_PtrOfSuperres_DualTVL1OpticalFlow_get_inner_ptr_mut } impl PtrOfSuperres_DualTVL1OpticalFlow { #[inline] pub fn as_raw_PtrOfSuperres_DualTVL1OpticalFlow(&self) -> *const c_void { self.as_raw() } #[inline] pub fn as_raw_mut_PtrOfSuperre...
Rust
0
# Loading Libraries import os import json import faiss from llama_index.core import Document, VectorStoreIndex, SimpleDirectoryReader, StorageContext from llama_index.vector_stores.faiss import FaissVectorStore def get_articles(text): """ This function splits the regulation text into documents (articles) but als...
Python
1
hat library call **libpmem** for them. //! //! > This is **not** an official port of the NVM Library. //! > //! > The official **libpmem** documentation can be found at: [http://pmem.io/nvml/libpmem/](http://pmem.io/nvml/libpmem/) extern crate libc; use ::libc::{size_t, mode_t}; use ::libc::{c_void, c_char, c_int, c_...
Rust
0
FnOnce<A> { /// Output of the function type Output; /// Call the function fn call_once(self, arg: A) -> Self::Output; } /// Substitution for FnMut trait family in stable and beta channels /// In nightly consider to use "nightly" feature and FnMut trait family pub trait HetFnMut<A>: HetFnOnce<A> { ...
Rust
0
add_entity((0, 2), entity.clone()).map(|r| id_map.insert((0, 2), r.0))); let _ = row2.1.map(|entity| g.add_entity((1, 2), entity.clone()).map(|r| id_map.insert((1, 2), r.0))); let _ = row2.2.map(|entity| g.add_entity((2, 2), entity.clone()).map(|r| id_map.insert((2, 2), r.0))); (g, id_map) } #[derive(Clon...
Rust
0
If udev rules or permissions are wrong, some probes might not be listed." )] pub list_probes: bool, #[structopt(name = "disable-progressbars", long = "disable-progressbars")] pub disable_progressbars: bool, #[structopt( name = "reset-halt", long = "reset-halt", help =...
Rust
0
Error> { self.as_str().marshal(ctx) } } impl Signature for &str { #[inline] fn signature() -> crate::signature::Type { String::signature() } #[inline] fn alignment() -> usize { String::alignment() } #[inline] fn sig_str(sig: &mut SignatureBuffer) { St...
Rust
0
DMA_OUTFIFO_EMPTY_ERR_INT_RAW_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 0"] #[inline(always)] pub fn spi_dma_infifo_full_err_int_raw(&self) -> SPI_DMA_INFIFO_FULL_ERR_INT_RAW_R { SPI_DMA_INFIFO_FULL_ERR_INT_RAW_R::new((self.bits & 0x01) != 0) } } impl W { #[doc = "Bit 20"] ...
Rust
0
_base_ = [ '../_base_/datasets/scannet-3d.py', '../_base_/models/votenet.py', '../_base_/schedules/schedule-3x.py', '../_base_/default_runtime.py' ] # model settings model = dict( bbox_head=dict( num_classes=18, bbox_coder=dict( type='PartialBinBasedBBoxCoder', num_s...
Python
1
)")] IndexError, #[error("This shouldn't happen...")] EmptyOption, } #![feature(test)] extern crate bip_bencode; extern crate test; #[cfg(test)] mod benches { use bip_bencode::{BencodeRef, BDecodeOpt}; use test::Bencher; #[bench] fn bench_nested_lists(b: &mut Bencher) { let bencod...
Rust
0
n use crate::sys::cpg as ffi; use std::collections::HashMap; use std::os::raw::{c_void, c_int}; use std::sync::Mutex; use std::string::String; use std::ffi::{CStr, CString}; use std::ptr::copy_nonoverlapping; use std::slice; use std::fmt; // General corosync things use crate::{CsError, DispatchFlags, Result, NodeId};...
Rust
0
import json import os from pathlib import Path def get_prev_problem_id(available_problems: list, current_problem_id: int): """Get the previous problem ID from the available problems list""" sorted_problems = sorted(available_problems) current_idx = sorted_problems.index(int(current_problem_id)) return...
Python
1
]; let mut constant_hcf = Vec::new(); for i in 0..16 { constant_hcf.push(get_loop_poly(i).0); } assert_eq!(constant_hcf, hcfs); } } } } // Copyright (c) Microsoft Corporation. // Licensed under th...
Rust
0
::fs; use std::mem; use std::io::{Write}; use std::path::{Path, PathBuf}; use std::sync::atomic::{AtomicUsize, Ordering}; use clang::*; use clang::completion::*; use clang::source::*; use libc::{c_int}; //================================================ // Macros //================================================ m...
Rust
0
CONTROLL: usize = 0; mod frame_type { pub const MASK: u8 = (1 << SIZE) - 1; pub const OFFSET: u8 = 0; pub const SIZE: u8 = 3; } mod security_enabled { pub const MASK: u8 = (1 << SIZE) - 1; pub const OFFSET: u8 = super::frame_type::OFFSET + super::frame_type::SIZE; pub const SIZE: u8 = 1; } mod...
Rust
0
from flask_login import current_user from applications.common.utils.validate import xss_escape from applications.extensions import db from applications.models import AdminLog def login_log(request, uid, is_access): info = { 'method': request.method, 'url': request.path, 'ip': request.remo...
Python
1
nent if self._second_opponent is not None and second_min_cycle < 1000: self._second_opponent_reach_cycle = second_min_cycle if self._fastest_opponent is not None and min_cycle < 1000: self._opponent_reach_cycle = min_cycle def predict_teammate(self, wm: 'WorldModel'): ...
Python
1
metric") ); let terms = segment_reader.search_regex("__tagkey", ".*").unwrap(); println!( "tag keys bitmap {:?}", segment_reader.get_tagkeys_bitmaps(terms) ); let terms = segment_reader.search_regex("__metric", ".*").unwrap(); println!( "metrics bitmap {:?}", se...
Rust
0
al shell fork every shell draw. */ /* BASH INIT SCRIPT We use PROMPT_COMMAND and the DEBUG trap to generate timing information. We try to avoid clobbering what we can, and try to give the user ways around our clobbers, if it's unavoidable. A bash quirk is that the DEBUG trap is fired every time a command runs, even ...
Rust
0
angle] pub unsafe extern "C" fn histogram_reset(ptr: *mut Histogram<u64>) { let histogram = { assert!(!ptr.is_null()); &mut *ptr }; histogram.reset(); } /// Get the count stored in the `histogram` for value #[no_mangle] pub unsafe extern "C" fn histogram_count(ptr: *mut Histogram<u64>, valu...
Rust
0
<$encoding>::decode(encoded, &mut outbuf).unwrap(); assert_eq!(decoded, &data[..i]); let elen = <$encoding>::encode(&data[..i], &mut inbuf).unwrap().len(); let buf = &mut inbuf[..elen]; let decoded = <$encoding>::decode_in_place(buf).unwrap(); ...
Rust
0
rman", "ger", "deu", "de", "french", "fre", "fra", "vietnamese", "vie", "vi", "swedish", "swe", "sv", "chinese", "chi", "zho", "zh", "indonesian", "ind", "id", "korean", "kor", "ko", "spanish", "spa", "es", "thai", "tha", "th", "filipino", "fil", "chinese-traditional" ]; const TA...
Rust
0
x]) .chain(iter::once(["limit".into(), "0".into()])) .collect() } fn all_jobs_passed(jobs: ApiList<TestHostJob>, profile: &ServerProfile, term: &Term) -> bool { jobs.objects .into_iter() .flat_map(|x| x.step_results.into_iter().map(|(_, b)| b)) .fold(true, |state, check| { ...
Rust
0
ault, Deserialize, Clone)] #[storage(VecStorage)] pub struct Card { pub value: i8, pub name: String, pub effect_description: String, } #[derive(Component, Debug, Default, Deserialize, Clone)] #[storage(VecStorage)] pub struct Enemy { pub name: String, pub health: i8, pub attack: i8, pub ope...
Rust
0
# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
# Code generated by Lark OpenAPI. import lark_oapi as lark from lark_oapi.api.board.v1 import * def main(): # 创建client client = lark.Client.builder() \ .app_id(lark.APP_ID) \ .app_secret(lark.APP_SECRET) \ .log_level(lark.LogLevel.DEBUG) \ .build() # 构造请求对象 request: T...
Python
1
in(run)?; let split_map = self.split_shortmap(run.category_locator)?; self.add_splits(run_id, &run.timing, &split_map)?; Ok(()) } fn add_main<T>(&mut self, run: &history::Run<GcID, T>) -> Result<i64> { self.query_add_run.execute(named_params![ ":is_completed": run.w...
Rust
0
[ 0x00, 0x00, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9, 0, 10, 0, 11, 0, 12, 0, 13, 0, ]; let header = Header::new(&bytes[..]); assert!(header.is_err()); let headererr = header.unwrap_err(); assert_eq!(headererr, HeaderError::NotMZ); } {...
Rust
0
from app import create_app, db from app.models import Association from app.models import Utilisateur import unicodedata import random from datetime import date _, app = create_app() # Activer le contexte de l'application with app.app_context(): # Liste des associations à créer bde = Association...
Python
1
aves the same as `ETHSender::sign_new_tx`, but does not affect nonce. /// This method should be used to create expected tx copies which won't affect /// the internal `ETHSender` state. pub(in crate) async fn create_signed_tx( id: i64, eth_sender: &ETHSender<MockDatabase>, operation: &Operation, deadline...
Rust
0
ize) -> Self; fn try_new(addr: usize) -> Option<Self> where Self: Sized; fn addr(&self) -> usize; } pub struct ObjectWrapper(pub usize); impl_object!(ObjectWrapper); use crate::core::prelude::*; use azure_core::headers::add_optional_header; use azure_core::headers::request_id_from_headers; use azure_core::pre...
Rust
0
record( &mut rpass, &ctx.global_uniform_binding, &ctx.camera_binding, &self.volume_texture.bind_group, ); } ctx.queue.submit(Some(encoder.finish())); } } fn main() -> Result<()> { let event_loop = EventLoop::with_user_...
Rust
0
import sqlalchemy from sqlalchemy.ext.asyncio import AsyncSession from types_ import * from ..bot import bot from db.session_delivery import session_delivery from infrastructure.enums import * from db.utils import * from misc.static_text.english import * import json from typing import List def prepare_ad_field_da...
Python
1
import json from selenium import webdriver from BrowserNavigator.browserNavigator import BrowserNavigator class CookieManager: @staticmethod def save_cookies(browser): print("Saving cookies") data = browser.get_cookies() with open('cookie.json', 'w') as cookies_file: json....
Python
1
self): """插件卸载时调用""" if self.app: logger.info("正在停止微信消息转发框架...") self.app.stop() logger.info("微信消息转发框架已停止") def main(): """主函数 - 独立运行模式""" logger.info("="*50) logger.info("🤖 微信消息转发框架 v1.0") logger.info("📱 基于wxauto库和OneBotV11协议") ...
Python
1
anon_id: e.anon_id.unwrap_or_default(), nick: String::from_utf8_lossy(&e.anon_nick.unwrap_or_default()).to_string(), portrait_index: e.head_portrait.unwrap_or_default(), bubble_index: e.bubble_id.unwrap_or_default(), expire_time: e.expire_time.unwrap_or_defaul...
Rust
0
GET_HEIGHT); let switch_width = switch_height * SWITCH_WIDTH_RATIO; let knob_size = switch_height - 2. * SWITCH_PADDING; let on_pos = switch_width - knob_size / 2. - SWITCH_PADDING; let off_pos = knob_size / 2. + SWITCH_PADDING; // move knob to right position...
Rust
0
&SRTConfig) -> String { let time_string = match srt_config.timestamp_format { SRTTimestampFormat::NumberOfSeconds => { ((time.hours) * 3600 + (time.minutes) * 60 + (time.seconds)).to_string() } }; srt_config .timestamp_template_string .replace("{ts}", &time_stri...
Rust
0
ons of rays padding (float): Padding which is applied to the unit cube eps (float): The epsilon value for numerical stability ''' batch_size, n_pts, _ = ray0.shape device = ray0.device # calculate intersections with unit cube (< . , . > is the dot product) # <n, x - p> = <n, ray0 +...
Python
1
ng_beats = target_beat - current_beat current_time += (remaining_beats * 60.0 / get_previous_bpm(i, sorted_bpms)) return current_time else: if i == 0: beat_duration = bpm_beat - current_beat prev_bpm = bpm_value else: ...
Python
1
#[doc = "16: `10000`"] XIP_MAIN_CONTESTED = 16, #[doc = "17: `10001`"] XIP_MAIN = 17, #[doc = "18: `10010`"] ROM_CONTESTED = 18, #[doc = "19: `10011`"] ROM = 19, } impl From<PERFSEL2_A> for u8 { #[inline(always)] fn from(variant: PERFSEL2_A) -> Self { variant as _ } } #[d...
Rust
0
ectory, "vocab%d.enc" % enc_vocabulary_size) dec_vocab_path = os.path.join(working_directory, "vocab%d.dec" % dec_vocabulary_size) create_vocabulary(enc_vocab_path, train_enc, enc_vocabulary_size, tokenizer) create_vocabulary(dec_vocab_path, train_dec, dec_vocabulary_size, tokenizer) # Create token ids...
Python
1
(&mut self) -> &mut [Box<InitializedVectorOperator>] { &mut self.vector_sources } } impl InitializedOperator<RasterResultDescriptor, TypedRasterQueryProcessor> for InitializedAddXOperator { fn query_processor(&self) -> Result<TypedRasterQueryProcessor> { let typed_raster_processor = self.ra...
Rust
0
# -*- coding: utf-8 -*- # ------------------------------------------------------------------------------ # # Copyright 2018-2021 Fetch.AI 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 ...
Python
1
mmon_prefix='file:///a/', example_uris=['file:///a/thing-1.txt', \ 'file:///a/thing-2.txt', 'file:///a/thing-3.txt'])] """ def uri_scheme(uri: str): return uri.split(":", 1)[0] for scheme, uri_grouper in groupby(sorted(uri_samples), uri_scheme): uris = list(uri_grouper) # Use the ...
Python
1
nnot parse response body {}", error ))), Ok(body) => match std::str::from_utf8(body.as_ref()) { Ok(str) => Ok(str.to_string()), Err(error) => Err(ErrorCode::LogicalError(format!( "Cannot from utf8 {}", error ...
Rust
0
'Vereenvoudig', 'am': 'ቀለል ያለ', 'ar': 'المبسطة', 'as': 'সৰলীকৃত', 'ast': 'simplificáu', 'az': 'sadələşmiş', 'az-Arab': 'ساده\u200cلنمیش', 'az-Latn': 'sadələşmiş', 'be': 'спрошчанае кітайскае', 'be-tarask': 'спрошчанае кітайскае', 'bg': 'опростена', 'blo': 'aburoka', 'bn': 'সরলীকৃত', 'bo': 'རྒྱ་ཡིག་གསར་པ།', 'br': 'eeuna...
Python
1
""" Uses a trace function to switch greenlets at unexpected times. In the trace function, we switch from the current greenlet to another greenlet, which switches """ import greenlet g1 = None g2 = None switch_to_g2 = False def tracefunc(*args): print('TRACE', *args) global switch_to_g2 if switch_to_g2: ...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2017 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
( upload.get_adjusted_unit(unit).to_string(), upload_total.get_adjusted_unit(unit).to_string(), download.get_adjusted_unit(unit).to_string(), download_total.get_adjusted_unit(unit).to_string(), ) } ...
Rust
0
# Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT license. # # Setting up the HAR data for EMI-RNN. It is assumed that the data has already # been downloaded and is placed in downloadDir. import subprocess import os import numpy as np import sys from helpermethods import * if __nam...
Python
1
bution.unit_deviance", "glum.tweediedistribution.unit_deviance_derivative": "https://glum.readthedocs.io/en/latest/glm.html#glum.TweedieDistribution.unit_deviance_derivative", "glum.tweediedistribution.unit_variance": "https://glum.readthedocs.io/en/latest/glm.html#glum.TweedieDistribution.unit_variance", "...
Python
1
n() { let len: usize = rng.gen_range(1, blake2s_simd::KEYBYTES + 1); let key_buf = &[1; blake2s_simd::KEYBYTES]; params.key(&key_buf[..len]); } params.last_node(rng.gen()); params } fn with_random_inputs_blake2s(mut f: impl FnMut(&[blake2s_simd::Params], &[&[u8]])) { let mut rng...
Rust
0
, pub BRUR8: u32, pub LAR8: u32, pub TBR8: u32, pub MAR8: u32, pub MDR8: u32, pub ISR9: u32, pub IFCR9: u32, pub ESR9: u32, pub CR9: u32, pub TCR9: u32, pub BNDTR9: u32, pub SAR9: u32, pub DAR9: u32, pub BRUR9: u32, pub LAR9: u32, pub TBR9: u32, pub MA...
Rust
0
/// regions that cannot (edge) and can (center) be reäligned. The center /// slice is then reäligned to `U`, and the edge slices produced from *that* /// are merged with the edge slices produced by the domain check. /// /// This results in edge pointers returned from this function that correctly /// handle parti...
Rust
0
+ ' of space.') else: print('WARNING: You are downloading all ScanNet ' + RELEASE_NAME + ' scans of type ' + file_types[0]) print('Note that existing scan directories will be skipped. Delete partially downloaded directories to re-download.') print('***') print('Press any key ...
Python
1
{ if child_size.0 > size.0 { offset.0 = (offset.0 + old_child_size.0 - child_size.0).min(0.0); } else { offset.0 = 0.0; } } ScrollMode::Auto => { // todo: refa...
Rust
0
# (©)Codexbotz # Recode by @mrismanaziz # t.me/SharingUserbot & t.me/Lunatic0de import asyncio from pyrogram import Client, filters from pyrogram.errors import FloodWait from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message from bot import Bot from config import ADMINS, CHANNEL_ID, DISABLE_C...
Python
1
#_*_coding:utf-8_*_ __author__ = 'jidong' from django.conf.urls import patterns, include, url urlpatterns = patterns('iuser.views', url(r'^user/$', 'user', name='user'), url(r'^user/list/$', 'user_list', name='user_list'), url(r'^user/add/$', 'user_add', name='user_add'), url(r'^user/edit/$', 'user_e...
Python
1
} }<reponame>cryscan/ceramic<filename>src/systems/kinematics.rs use std::ops::Neg; use amethyst::{ assets::{PrefabData, ProgressCounter}, core::{ ArcThreadPool, bundle::SystemBundle, math::{Point3, UnitQuaternion, Vector3}, transform::{Parent, Transform, TransformSystemDesc}...
Rust
0
# Copia o elimina """ Crear un programa que copie o elimine los elementos de una lista """ fruit_list = ["Fresa","Naranja","Mango","Pera"] tutor = { "Nombre":"David", "Edad":29, "Cursos":["Python","Java","Javascript"] } new_list = fruit_list.copy() print(new_list) new_dictionary = tutor.copy() print(ne...
Python
1
import os import math import json import shutil from tqdm import tqdm import requests import websocket import json import time # 从环境中获取访问密钥 ACCESS_TOKEN = os.getenv('ACCESS_TOKEN') if not ACCESS_TOKEN: raise Exception("请设置环境变量 ACCESS_TOKEN") BASE_URL = 'https://api.tgkwai.com' # 上传附件 def upload_attachment(fil...
Python
1
"24Hours", "Delay", "Home", "24HoursMute", "HomeDelay", "Off", ], "type": "enum", }, "iconname": "icon-a_fan_au...
Python
1
is=1) # (4096, 6, 51) if monotone_diffusion: diff_amplitudes = np.sort(rand(n_bvals, num_mmbg), 0) diff_amplitudes = diff_amplitudes[::-1, :] else: diff_amplitudes = rand(n_bvals, num_mmbg) mmbg_peaks = diff_amplitudes * mmbg_peaks signalOut = np.sum(mmbg_peaks, axis=-1) sig...
Python
1
眠指定毫秒数后,继续运行 Stop(Result<()>), //关闭当前执行器 Ok, //执行成功 }//! Syntax Tree library used throughout the rust analyzer. //! //! Properties: //! - easy and fast incremental re-parsing //! - graceful handling of errors //! - full-fidelity representation (*any* text can be precisely represented as ...
Rust
0
_dimensions[index + 1])) * U64::VALUE_SIZE as u64; dimension_size = dimension_size * db_dimensions[index + 1]; } key_file_size } fn calculate_database_size(db_dimensions: &[u64], n_dimensions_linked: u64) -> u64 { db_dimensions[db_dimensions.len() - 1] * n_dimensions_linked * U64::VALUE_SIZE as u6...
Rust
0
""" --- title: "MLP-Mixer: An all-MLP Architecture for Vision" summary: > This is an annotated implementation/tutorial of MLP-Mixer: An all-MLP Architecture for Vision in PyTorch. --- # MLP-Mixer: An all-MLP Architecture for Vision This is a [PyTorch](https://pytorch.org) implementation of the paper [MLP-Mixer: An ...
Python
1
.takes_value(true), ) .arg( clap::Arg::with_name("oiv-manifest") .long("oiv-manifest") .value_name("file") .help("Where to write the GTAV .oiv manifest.") .takes_value(true), ) .arg( c...
Rust
0
::new(); ureq::get(&format!("{}/wasmots/getwasm", opts.host)) .call()? .into_reader() .read_to_end(&mut wasm_bytes)?; let store = Store::default(); let module = Module::new(&store, wasm_bytes)?; let state = wasi::WasiState::new("hello_world") .stdin(Box::new(wasi::Pipe:...
Rust
0
# This summarizer is used for `./datasets/compassbench_v1_knowledge/compassbench_v1_knowledge_gen` compassbench_v1_knowledge_names = [ 'compassbench_v1_knowledge-common_knowledge-single_choice_cn_circular', 'compassbench_v1_knowledge-humanity-single_choice_cn_circular', 'compassbench_v1_knowledge-natural_sc...
Python
1
wn modifiers "{}"'. format(set(modifiers) - known_modifiers)) special_keys = { 27: 'escape', 9: 'tab', 8: 'backspace', 13: 'enter', 127: 'del', 271: 'enter', 273: 'up', 274: 'down', ...
Python
1
# SPDX-License-Identifier: BSD-2-Clause # Copyright Sphinx Confluence Builder Contributors (AUTHORS) from tests.lib.testcase import ConfluenceTestCase class TestConfluenceConfigPrevNext(ConfluenceTestCase): @classmethod def setUpClass(cls): super().setUpClass() cls.dataset = cls.datasets / '...
Python
1
apper.has_no_result() { node_subset.nodes().par_iter().for_each(|&source| { graph.out(source).par_iter().for_each(|&target| { if mapper.check(target) { mapper.update(source, target); } }) }); } else { *node_subset = ...
Rust
0
import json from ..models.news import NewsModel def handler(event, context): """Lambda handler for getting all news articles""" try: news_model = NewsModel() items = news_model.get_all() return { 'statusCode': 200, 'headers': { 'Access-Co...
Python
1
from django import forms from django.contrib.auth.forms import UserCreationForm, AuthenticationForm from django.contrib.auth.models import User class SignUp(UserCreationForm): password1 = forms.CharField(label='Password', widget=forms.PasswordInput(attrs={'class':'form-control'})) password2 = forms.CharFi...
Python
1
), |c| &mut c.graphics) } /// What egui outputs each frame. pub fn output(&self) -> RwLockWriteGuard<'_, Output> { RwLockWriteGuard::map(self.write(), |c| &mut c.output) } pub(crate) fn frame_state(&self) -> RwLockWriteGuard<'_, FrameState> { RwLockWriteGuard::map(self.write(), |c|...
Rust
0
import os import shutil import pytest from unittest.mock import patch from pdf_to_csv import is_pdf, is_pdf_password_protected, extract_table_from_pdf @pytest.fixture() def output_folder(): folder = "test/output" os.makedirs(folder, exist_ok=True) yield folder shutil.rmtree(folder) def test_is_pdf(...
Python
1
([f64::NAN, 900.0]); /// // /// let b = m128d::from_array([-0.1, f64::NAN]); /// // /// assert_eq!(round_m128d_s::<{ round_op!(Nearest) }>(a, b).to_array(), [0.0, 900.0]); /// assert_eq!(round_m128d_s::<{ round_op!(NegInf) }>(a, b).to_array(), [-1.0, 900.0]); /// // /// let b = m128d::from_array([2.4, f64::NAN]); /// /...
Rust
0
# # Solved Problems in Geostatistics # # ------------------------------------------------ # Script for lesson 4.2 # "Bootstrap & Spatial Bootstrap" # ------------------------------------------------ import sys sys.path.append(r'../shared') from statistics import * from numpy import * from geo import * from decl_grid ...
Python
1
import pytest import torch from ..model_manager import ModelManager from ..schema import SDSampler, HDStrategy from ..tests.utils import check_device, get_config, assert_equal, current_dir @pytest.mark.parametrize("device", ["cuda", "mps"]) @pytest.mark.parametrize("sampler", [SDSampler.ddim]) def test_sd_match_hist...
Python
1
) .arg(Arg::with_name(ARG_FILES).multiple(true).takes_value(true)) .get_matches_from(args); let mut inputs: Vec<Input> = matches .values_of(ARG_FILES) .map(|v| { v.map(|i| { if i == "-" { Input::Stdin(StdinKind::Explicit) ...
Rust
0
<'a> NH for RefNode<'a> { fn into_arc(self) -> Node { self.convert(|d| d.0.clone()) } fn as_ref(&self) -> RefNode { self.borrow(|d| *d) } fn view(&self) -> AstView<Arc<str>, NbtdocLang> { self.view() } } #[derive(Debug, PartialEq, Eq)] pub struct DerefRef<'a, D>(&'a D)...
Rust
0
8, ) } #[doc = "Bits 16:17"] #[inline(always)] pub fn sensitive_dma_apbperi_uchi0_pms_constrain_sram_world_1_pms_2( &self, ) -> SENSITIVE_DMA_APBPERI_UCHI0_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_2_R { SENSITIVE_DMA_APBPERI_UCHI0_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_2_R::new( ((...
Rust
0
zx_pager_create(options.bits(), &mut out) }; ok(status)?; Ok(Pager::from(unsafe { Handle::from_raw(out) })) } /// See [zx_pager_create_vmo](https://fuchsia.dev/fuchsia-src/reference/syscalls/pager_create_vmo) pub fn create_vmo( &self, options: VmoOptions, port: &Port...
Rust
0
papers.lock().unwrap().len() ); } Err(e) => { log::info!( "An error occurred during papers database update. The error: {}", e ); } } std::thread::sleep( ...
Rust
0