text
string
label_name
string
labels
int64
# WIKILINKS AND EMBEDDED FILES: regex that includes any aliases # group 0 captures embedded link; group 1 is everything inside [[]] WIKILINK_REGEX = r'(!)?\[{2}([^\]\]]+)\]{2}' # TAGS TAG_INCLUDE_NESTED_REGEX = r'(?<!\()(?<!\\)#{1}([A-z]+[0-9_\-]*[A-Z0-9]?[^\s]+(?![^\[\[]*\]\]))\/?' TAG_MAIN_ONLY_REGEX = r'(?<!\()#{1}...
Python
1
import os for person_id in os.listdir(image_dir): person_image_dir = os.path.join(image_dir, person_id, "SPO") person_landmark_dir = os.path.join(landmark_dir, person_id, "SPO") person_meta_dir = os.path.join(meta_dir, person_id, "SPO") if not (os.path.isdir(person_image_dir) and os.path.isdir(person_...
Python
1
[macro_use] extern crate nom; use std::str; use std::collections::HashMap; use std::fmt; use nom::{Offset, space, Needed, IResult, Err}; /// The WArc `Record` struct #[derive(Clone)] pub struct Record { // lazy design should not use pub /// WArc headers pub headers: HashMap<String, String>, /// Content...
Rust
0
c fn connect(&self) -> Result<Connection, anyhow::Error> { let params = self.params.as_ref().map_err(Clone::clone)?; Ok(params.connect() .race(self.print_warning(params)) .await?) } pub async fn connect_with_cert_verifier( &self, verifier: Arc<dyn ServerCertVerif...
Rust
0
lse)); let handle = thread::spawn({ let stop = stop_spinner.clone(); move || { let spinner = ProgressBar::new(10000); spinner.set_style( ProgressStyle::default_spinner() .tick_chars("⠁...
Rust
0
stardust::payload::milestone::MilestoneId { type Error = Error; fn try_from(value: proto::MilestoneId) -> Result<Self, Self::Error> { let bytes: [u8; stardust::payload::milestone::MilestoneId::LENGTH] = value.id.try_into().map_err(|_| Error::InvalidBufferLength)?; Ok(stardust::payl...
Rust
0
nt.list_tools() if tools_result and hasattr(tools_result, "tools"): for tool in tools_result.tools: if tool.name == tool_name: # Check if the tool description mentions images or screenshots if hasattr(tool, "description") an...
Python
1
while wallet.get_balance()? < 100_000 { std::thread::sleep(Duration::from_millis(1_000)); wallet.sync(noop_progress(), None)?; println!("syncing done on party {} -- checking balance", id); } let wallet = GunWallet::new(wallet, gun_db); Ok((wallet, keychain)) } macro_rules! setup_te...
Rust
0
} v } } /// The same as `upgrade_all`, except it clears the list before return. pub fn take_all(&self) -> Vec<Handle<T>> { let v = self.upgrade_all(); v.iter().for_each(|h| Handle::detach(&h)); v } } impl<T> Default for WeakList<T> { fn default() -> Self...
Rust
0
PxVehicleClutchData() { assert_eq!(std::mem::size_of::<PxVehicleClutchData>(), 16); } #[derive(Clone, Copy)] #[repr(C)] pub struct PxVehicleTireLoadFilterData { pub mMinNormalisedLoad: f32, pub mMinFilteredNormalisedLoad: f32, pub mMaxNormalisedLoad: f32, pub mMaxFilteredNormalisedLoad: f32, ...
Rust
0
: i64, #[serde(rename = "badgeColor")] pub badge_color: String, pub views: i64, pub follows: i64, } ////////////// // 240P 极速 仅mp4方式支持 pub const VIDEO_QUALITY_240P: VideoQuality = VideoQuality { code: 6 }; // 360P 流畅 pub const VIDEO_QUALITY_360P: VideoQuality = VideoQuality { code: 16 }; // 480P 清晰 ...
Rust
0
: &js_sys::Uint8Array) -> Vec<u8> { let mut v = a.to_vec(); heapsort(&mut v); v } #[wasm_bindgen] pub fn heapsort_float64array(a: &js_sys::Float64Array) -> Vec<f64> { let mut v = a.to_vec(); heapsort(&mut v); v } #[wasm_bindgen] pub fn heapsort_float32array(a: &js_sys::Float32Array) -> Vec<f32...
Rust
0
ion, SimulateSwapOperationsResponse}; use crate::test_constants::campaign_manager::CAMPAIGN_MANAGER; use crate::test_constants::governance::GOVERNANCE; use crate::test_constants::TERRASWAP_ROUTER; pub type CustomDeps = OwnedDeps<MockStorage, MockApi, WasmMockQuerier>; /// mock_dependencies is a drop-in replacement fo...
Rust
0
doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub const WAVE_FORMAT_MPEG: u32 = 80u32; #[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub const WAVE_FORMAT_MPEG4_AAC: u32 = 41222u32; #[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"] pub const WAVE_FORMAT_MPEGLAYER3: u32 = 85u32; #[...
Rust
0
v.lower() in ('yes', 'true', 't', 'y', '1'): return True elif v.lower() in ('no', 'false', 'f', 'n', '0'): return False else: raise argparse.ArgumentTypeError('Boolean value expected.') def import_class(name): components = name.split('.') mod = __import__(components[0]) # impo...
Python
1
ize)>, bed_path_list: Vec<String>, file_snp_indexer: FileSnpIndexer, } impl PlinkColChunkIter { pub fn new( file_num_snps: Vec<(usize, PlinkSnpType)>, range: OrderedIntegerSet<usize>, num_snps_per_iter: usize, num_people: usize, bed_path_list: Vec<String>, ) -> P...
Rust
0
.iter() .map(|it| match it { GenericParam::Type(tp) => { let mut tp = tp.clone(); tp.bounds.push(parse_quote!( 'a )); GenericParam::Type(tp) } _ => it.clone(), ...
Rust
0
import requests from django.core.management.base import BaseCommand from io import BytesIO from PIL import Image import logging import sys logger = logging.getLogger(__name__) handler = logging.StreamHandler(sys.stdout) handler.setLevel(logging.DEBUG) formatter = logging.Formatter('%(levelname)s - %(message)s') handle...
Python
1
on dtype: Data type for tensors include_boundary_points: If True, create points both inside and outside the grid expand: Number of times to replicate points when creating boundary samples Returns: tuple: (primal_grid_batch, dual_grid_batch, jagged_points) """ grid, grid_d, p...
Python
1
import logging from telethon import TelegramClient, events from telegram import Bot from telegram.ext import Updater, CommandHandler import asyncio # Set up logging logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO) # Telegram API credentials API_ID = '24158657' API...
Python
1
DockerManager::destroy_node(&node)?; } Ok(()) } } impl fmt::Display for Topology { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "\n Topo -")?; write!(f, "\n Hosts:")?; for host in &self.hosts { write!(f, " {}", &host)?; } ...
Rust
0
""" Funções com Parâmetro (de entrada) - Funções que recebem dados para serem processados dentro da mesma; se a gente pensar em um programa qualquer, geralmente temos: entrada -> processamento -> saída Se a gente pensar em uma função, já sabemmos que temos funções que: - Não possuem entrada; - Não possuem s...
Python
1
/// Future type for use in client calls. pub type ClientFuture<T> = Box<FutureExtra<Item = T, Error = Error> + Send>; /// Future trait with extra helper methods. pub trait FutureExtra: Future { fn wait(self) -> Result<Self::Item, Self::Error> where Self: Sized; } impl<F: Future> FutureExtra for F { ...
Rust
0
// Problem: First Unique Character in a String // Difficulty: EASY // LeetCode URL: https://leetcode.com/problems/first-unique-character-in-a-string/ // Date: 2024-09-29 class Solution: def firstUniqChar(self, s: str) -> int: if len(s)==1: return 0 d={} for i in range(len(s)): ...
Python
1
borrowed_fd(fd), out(&mut storage), by_mut(&mut addrlen), ]), ))?; Ok(decode_sockaddr(&storage.assume_init(), addrlen)) } } #[inline] pub(crate) fn bind_v4(fd: BorrowedFd<'_>, addr: &SocketAddrV4) -> io::Result<()> { #[cfg(not(target_...
Rust
0
h-Hans': '亚洲', 'zh-Hant': '亞洲', 'zu': 'i-Asia'}, '143': {'af': 'Sentraal-Asië', 'am': 'መካከለኛው እሲያ', 'ar': 'وسط آسيا', 'as': 'মধ্য এছিয়া', 'ast': 'Asia Central', 'az': 'Mərkəzi Asiya', 'az-Cyrl': 'Мәркәзи Асија', 'az-Latn': 'Mərkəzi Asiya', 'be': 'Цэнтральная Азія', 'be-tarask': 'Цэнтральная Азія', 'bg': 'Централна...
Python
1
f { Self::Any => None, Self::V4(c) => Some(c.network_length()), Self::V6(c) => Some(c.network_length()), } } /// IP family of the contained address ([`Ipv4`] or [`Ipv6`]). /// /// returns [`None`] for [`Any`] /// /// [`Any`]: Self::Any /// [`Ipv4`]: Family::Ipv4 /// [`Ipv6`]: Family::Ipv6 pub fn fa...
Rust
0
let rdiag_exp = Vector3::new(-44.068129073061407, 29.147349299100057, 0.); let rdiag_out = Vector3::from_iterator(lls.upper_r.slice_range(..3, ..3).diagonal().iter().copied()); assert_relative_eq!(rdiag_out, rdiag_exp); let diag = Vector3::new(2.772724292099739, 0.536656314599949, 0.089442719...
Rust
0
WordFontColor(self): """文字水印的颜色,值为HEX颜色代码 注意:此字段可能返回 null,表示取不到有效值。 :rtype: str """ return self._MarkWordFontColor @MarkWordFontColor.setter def MarkWordFontColor(self, MarkWordFontColor): self._MarkWordFontColor = MarkWordFontColor @property def MarkWordFontTyp...
Python
1
import tempfile from urllib.request import urlretrieve import chromadb from llama_index.core import Settings, SimpleDirectoryReader, StorageContext, VectorStoreIndex from llama_index.llms.openai import OpenAI from llama_index.vector_stores.chroma import ChromaVectorStore from opentelemetry.exporter.otlp.proto.http.tra...
Python
1
$$ |__/ /$$__ $$ | $$ // | $$ \ $$ /$$$$$$ /$$$$$$ /$$ /$$$$$$$ | $$ \__//$$ /$$ /$$$$$$$| $$ /$$ // | $$$$$$$ /$$__ $$|____ $$| $$| $$__ $$| $$$$ | $$ | $$ /$$_____/| $$ /$$/ // | $$__ $$| $$ \__/ /$$$$$$$| $$| $$ \ $$| $$_/ | $$ | $$| $$ | $$...
Rust
0
else { first_num = y; second_num = x; } remainder = first_num % second_num; while remainder != 0{ first_num = second_num; second_num = remainder; remainder = first_num % second_num; } second_num }//see: https://github.com/rust-lang/cargo/issues/8010 #![cfg_attr(feature = "quiet", allow(war...
Rust
0
stum_arc::{ViewFrustumArc, ViewFrustumObject}; use crate::visibility::visibility_object_arc::{CullModel, VisibilityObject, VisibilityObjectArc}; use crate::visibility::ObjectId; use parking_lot::{RwLock, RwLockReadGuard}; use rafx_visibility::{ModelHandle, VisibilityWorldArc, ZoneHandle}; use slotmap::SlotMap; use slot...
Rust
0
t((index * 3)..(index * 3 + 3)) .unwrap_or(&[0.0; 3]); let tex_coord: &[f32] = model .mesh .texcoords .get((index * 2)..(index * 2 + 2)) .unwrap_or(&[0.0; 3]); Vertex { ...
Rust
0
s=False,dereference=True) parentid = parentimage.dbid if parentid not in newimages.keys(): newimagedata = self.copyImage(parentimage) newimages[parentid] = newimagedata else: newimagedata = newimages[parentid] newtarget = leginondata.AcquisitionImageTargetData(initializer=target) ...
Python
1
tise l2vpn evpn", "vrf site-2", "address-family ipv4 unicast", "no advertise l2vpn evpn", ] result = self.execute_module(changed=True) self.assertEqual(set(result["commands"]), set(commands)) def test_nxos_bgp_vrf_af_advertise_l2vpn_evpn_replaced(self): ...
Python
1
/fix = -1 ?? let mut message: *mut DmtxMessage = dmtxDecodeMatrixRegion(decoded, region, -1); if !message.is_null() { let ptr = (*message).output; let len = (*message).outputIdx; output = Vec::with_capacity(len as usize); for...
Rust
0
xt: &str) { use clipboard::{ClipboardContext, ClipboardProvider}; let mut clip: ClipboardContext = ClipboardProvider::new().unwrap(); clip.set_contents(solution).unwrap(); } <filename>compiler/src/ast/module.rs use super::definition::Definition; use super::expression::Expression; use crate::types::Type; use...
Rust
0
pty, but it inherits brand, model, and move() from Vehicle. The Boat and Plane classes also inherit brand, model, and move() from Vehicle, but they both override the move() method. Because of polymorphism we can execute the same method for all classes. ----------------------------------------------------------------...
Python
1
from django.urls import path from polls.views import home urlpatterns = [ path('', home, name='home'), ]
Python
1
r_agent1) assert fingerprint1 == fingerprint1_repeat def test_risk_level_calculation(self, anomaly_service): """測試風險等級計算""" # 測試不同風險分數對應的等級 test_cases = [ (1.0, RiskLevel.LOW), (4.0, RiskLevel.MEDIUM), (7.0, RiskLevel.HIGH), (9.5, ...
Python
1
not(target_os = "macos")))] pub fn required_extension_names() -> Vec<*const i8> { use ash::extensions::khr::XlibSurface; vec![Surface::name().as_ptr(), XlibSurface::name().as_ptr()] } /// Get required instance extensions. /// This is macos specific. #[cfg(target_os = "macos")] pub fn required_extension_names()...
Rust
0
# (C) Copyright 2005-2021 Enthought, Inc., Austin, TX # All rights reserved. # # This software is provided without warranty under the terms of the BSD # license included in LICENSE.txt and may be redistributed only under # the conditions described in the aforementioned license. The license # is also available online at...
Python
1
::ToolOptions; use crate::Color; use serde::{Deserialize, Serialize}; #[derive(PartialEq, Clone, Deserialize, Serialize, Debug)] pub struct FrontendDocumentDetails { pub is_saved: bool, pub name: String, pub id: u64, } #[impl_message(Message, Frontend)] #[derive(PartialEq, Clone, Deserialize, Serialize, Debug)] pu...
Rust
0
# from https://github.com/openai/guided-diffusion/blob/8fb3ad9197f16bbc40620447b2742e13458d2831/guided_diffusion/image_datasets.py import math import random import numpy as np from PIL import Image def center_crop_arr(pil_image, image_size): """ Center cropping implementation from ADM. https://github.com/...
Python
1
get_invalid_mailboxcs   cC`sFt}x0|r;|ddkr;y#t|\}}|j|WnYtjk rd}|dtkrt|\}}| s|ddkr|j||jjtj dqt |d\}}|dk r|g|d*n|j||jj...
Python
1
if not update_result["status"]: return public.returnResult(status=False, msg=update_result["msg"]) return public.returnResult(msg="删除成功!") # 2024/4/18 下午10:26 设置全局gzip def set_global_gzip(self, get): ''' @name 设置全局gzip @param get: @return: ...
Python
1
q=True, a_nodata=0) ds_optfile = ImageTools.gdal_merge(optfile=optfile, q=True, a_nodata=0) # Array of shape (4, 4): expected = np.array([[2, 2, 2, 2], ...
Python
1
Graphics}; use opengl_graphics::{GlGraphics, OpenGL}; use piston::event_loop::*; use piston::input::*; use piston::window::WindowSettings; use piston_window::AdvancedWindow; mod lsystem_draw; mod lsystem_generate; use lsystem_draw::*; pub struct Parameters { // params for rule generation min_rules: usize, ...
Rust
0
_client().get_header(block_hash.pack())) .map(Into::into) .expect("get_deposit_header"); (txo, header) }) .collect() } fn minimal_unlock_point(&self, out_point: &OutPoint) -> EpochNumberWithFraction { let node = self.node; ...
Rust
0
yncClient() as client: response = await client.post( url, headers=headers, json=data, timeout=600 ) response.raise_for_status() # 检查 HTTP 错误状态 return GeminiResponseWrapper(response.json()) except Exception: raise ...
Python
1
#!/usr/bin/env python """ Pangrams Challenge Description: The sentence 'A quick brown fox jumps over the lazy dog' contains every single letter in the alphabet. Such sentences are called pangrams. You are to write a program, which takes a sentence, and returns all the letters it is missing (which prevent it from bei...
Python
1
import os from portkey_ai import Assistants, Messages, Portkey, Uploads # Initialize the Portkey client portkey = Portkey( api_key=os.environ.get("PORTKEY_API_KEY"), virtual_key=os.environ.get("OPENAI_VIRTUAL_KEY"), ) file_to_upload_path = "./tests/configs/threads/sample.pdf" def test_upload_file_and_query(...
Python
1
ertConfigData.from_dict(validated_data) return Response(DBConfigHandler(base_conf).save_module_deploy_info(dbconfig_level_data, upsert_config_data)) @common_swagger_auto_schema( operation_summary=_("查询层级(业务、模块、集群)配置详情"), request_body=serializers.GetLevelConfigDetailSerializer(), tag...
Python
1
// This triangle has side lengths len_a, len_b, len_c, and the opposite // respective angles are alpha, beta, gamma. let sq_a = len_a * len_a; let sq_b = len_b * len_b; let gamma = PI * (1.0 - (d as f64) / (n as f64)); let sq_c = sq_a + sq_b - 2.0 * len_a * len_b * gamma....
Rust
0
#!/usr/bin/python3 import time import random import threading import signal import sys from enum import Enum import time from threading import Thread, Lock import RPi.GPIO as GPIO def log(msg): f = open("log.txt", "a", 1) f.write(datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")) f.write(",") f.wri...
Python
1
roperties_in() + "\n" + &test_brushes_in() + "\n}" } pub fn test_entity_out() -> Entity { Entity { properties: test_properties_out(), brushes: test_brushes_out(), } } pub fn test_map_in() -> String { test_entity_in() + "\n" + &test_entity_in() } pub fn test_map_out() -> Map { Map::new...
Rust
0
pgradeable.png")) return((name, version, _(description), state, upgradeablepng, divpng)) else: installablepng = LoadPixmap(cached=True, path=resolveFilename(SCOPE_CURRENT_PLUGIN, "SystemPlugins/SoftwareManager/installable.png")) return((name, version, _(description), state, installablepng, divpng)) def bui...
Python
1
# Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2015 Antonio Espinosa <antonio.espinosa@tecnativa.com> # Copyright 2015 Javier Iniesta <javieria@antiun.com> # Copyright 2020 Tecnativa - Manuel Calero # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo.exceptions impor...
Python
1
for file in files: _copy(file, osp.join(sdk_python_package_dir, 'mmdeploy_runtime')) # copy onnxruntime if 'ort' in cfg['cmake_cfg']['MMDEPLOY_TARGET_BACKENDS']: copy_onnxruntime( cfg, osp.join(sdk_python_package...
Python
1
Long, /// An account isn't named. Unnamed, } /// The lookup table for names. #[pallet::storage] pub(super) type NameOf<T: Config> = StorageMap<_, Twox64Concat, T::AccountId, (Vec<u8>, BalanceOf<T>)>; #[pallet::pallet] #[pallet::generate_store(pub(super) trait Store)] pub struct Pallet<T>(_); #[pallet::...
Rust
0
<(), String> { let args = match matches.value_of("FLAKE") { None => vec!["flake", "metadata", "--json"], Some(flake) => vec!["flake", "metadata", "--json", flake], }; let output = Command::new("nix") .args(args) .output() .map_err(|err| format!("Error: failed to quer...
Rust
0
").expect("Valid"); let bob_id = <Account as Identifiable>::Id::new("bob", "test").expect("Valid"); let alice_xor_id = <Asset as Identifiable>::Id::new( AssetDefinitionId::new("xor", "test").expect("Valid"), AccountId::new("alice", "test").expect("Valid"), ); let ...
Rust
0
<T>(local) .ok_or(ErrorKind::NotFound)?; map_entry(branch, &entry, remote, plugins) } pub fn list<T: Branch + StableAbi>( branch: &T, plugins: &CPluginStore, ) -> Result<HashMap<String, DirEntry>> { let mut ret = vec![]; plugins.entry_list::<T>( (&mut |(name, entry): (&str, &Mappi...
Rust
0
sweep_intrins=None, scaled_pixel_size=None, scale_depth_factor=1000.0, ): # self.eval() inv_intrinsics = torch.inverse(sweep_intrins) pixel_size = torch.norm( torch.stack( [inv_intrinsics[..., 0, 0], inv_intrinsics[..., 1, 1]], dim=-1 ...
Python
1
Looking for a BIP32 path of the Dash address related to the masternode collateral.<br>' \ 'This may take a while (<a href="break">break</a>)....' ctrl.dlg_config(dlg_title="Looking for address", show_progress_bar=False) ctrl.display_msg(msg) def check_break_scanning(): nonlocal break_scan...
Python
1
tensor Input wavs. Shape should be (batch, channels, timesteps). layers : list[int], optional Layers of RVQ should return quantized result. The default is all layers. Returns ------- quantized_list : list[torch.tensor] Quantized of required layers. ...
Python
1
, y)][e] = 0.0; } } } main.samples += source.samples; source.samples = 0; }; for s in 0..render_task.samples { let mut seed : XSeed = base_rng.gen(); let (i, mut worker_target) = task_rx.recv().unwrap(); let p...
Rust
0
= rect.x; sy = rect.y + rect.height } else if anchor as libc::c_uint == XDG_POSITIONER_ANCHOR_BOTTOM_RIGHT as libc::c_int as libc::c_uint { sx = rect.x + rect.width; sy = rect.y + rect.height } *root_sx = sx; *root_sy = sy; } #[no_mangle] ...
Rust
0
a ds @s.dZddlZGdddZddZddZdS) z Basic subprocess implementation for POSIX which only uses os functions. Only implement features required by setup.py to build C extension modules when subprocess is unavailable. setup.py is not used on Windows. Nc...
Python
1
_base_ = [ 'mmcls::resnet/resnet18_8xb32_in1k.py', '../../deploy_cfgs/mmcls/classification_openvino_dynamic-224x224.py' ] _base_.val_dataloader.batch_size = 32 test_cfg = dict( type='mmrazor.PTQLoop', calibrate_dataloader=_base_.val_dataloader, calibrate_steps=32, ) global_qconfig = dict( w_o...
Python
1
_at == None, right.deleted_at == None) # noqa q = q.filter(EntitySet.collection_id == collection_id) q = q.filter(EntitySet.type == EntitySet.PROFILE) q = q.filter(EntitySet.id == left.entityset_id) q = q.filter(EntitySet.id == right.entityset_id) q = q.filter( or_(left.judgement == Judgeme...
Python
1
phases == total_phases and total_phases > 0: print("🎉 ALL PHASES COMPLETED SUCCESSFULLY!") print("🎊 Your complete pipeline is working perfectly!") elif successful_phases > 0: print("⚠️ Some phases completed successfully, check failed phases above.") else: print("❌ No phases com...
Python
1
{ let m = order.mesh.read(); cmd.bind_mesh(&m); cmd.draw(m.index_count(), 0); } } } } } fn record_skybox(cmd: &Commands, uniforms: &Uniforms, camera: &Camera, builtins: &Builtins) { cmd.bind_shader(&builtins.skyb...
Rust
0
(get_db) ): """ Начинает сессию присоединения к очереди (публичный эндпоинт) """ service = QRQueueService(db) try: result = service.start_join_session( token=request.token, ip_address=http_request.client.host if http_request.client else None, user_age...
Python
1
Command { LssCommand { message: format!("#{}{}{}{}\r", id, cmd, val, modifier.to_msg()), } } pub fn with_param_modifiers( id: u8, cmd: &str, val: i32, modifiers: &[CommandModifier], ) -> LssCommand { LssCommand { message: forma...
Rust
0
ECORATIONS['error']} Error {ASCII_DECORATIONS['error']}[/bold {COLOR_PALETTE['error']}]", border_style=COLOR_PALETTE["error"], box=DEFAULT_BOX, expand=False, padding=(1, 2) ) self._console.print("") ...
Python
1
l\x20my\x20active\x20l\ inked\x20external\x20accounts;\x20may\x20be\x20requested\x20to\x20return\ \x20the\x20access\x20token\x1a5\x82\xb5\x181A\x20service\x20to\x20manage\ \x20and\x20link\x20to\x20external\x20accounts2\xa4\x02\n\x0eEmbeddedClie\ nt\x12\xc1\x01\n\x16AuthorizeCurrentDevice\x12/.CEmbeddedC...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- ############################################################################### # Copyright Kitware Inc. # # 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 ...
Python
1
ing().contains("power underflow")); } #[test] fn set_is_empty_when_all_sectors_removed() { let mut set = ExpirationSet::empty(); assert!(set.is_empty()); assert_eq!(set.len(), 0); set.add( &on_time_sectors(), &early_sectors(), &on_time_pledge(), &active_power(), ...
Rust
0
c6553ceeb" ); } #[test] fn picks_correct_hashing_method() { let data_smaller_than_chunk_size = vec![]; assert!(!Digest::should_hash_with_chunks( data_smaller_than_chunk_size )); let data_bigger_than_chunk_size = vec![0; ChunkWithProof::CHUNK_SIZE_BYTES *...
Rust
0
point mass and getting infinite likelihood at any datapoint. Defaults to 0.01. It is called `variance flooring` in standard HMM literature. optimizer (str): Optimizer to use for training. Defaults to `adam`. optimizer_params (dict): Parameters for the optimizer. Defau...
Python
1
HOME", "MOBILE", "WORK"] } } impl AsRef<str> for PhoneNumberType { fn as_ref(&self) -> &str { self.as_str() } } /// <p>The values that indicate whether a pin is always required (YES), never required (NO), /// or OPTIONAL.</p> /// <ul> /// <li> /// <p>If YES, Alexa will always ask for a meeting pin....
Rust
0
aluations: print(evaluation) optimisedHyperParams = findOptimalSpecs(evaluations) print("#" * 50) print(f"Optimal hyper parameters after {counter} round: ", optimisedHyperParams) # Evaluating the accuracy on the validation set after optimising hyperparameter result = Parallel(n_jobs=4)(delay...
Python
1
max(catalog_symbol, key=catalog_symbol.count) else: catalog_mark = False break elif catalog_mark and catalog_symbol is not None: # 上一页是目录,这一页也是; 使用前两行,防止目录跨行 line_text += ( line_chars_to_text(segment_line...
Python
1
EveryDay { step: self.step, tz: self.tz, until: Some(dt.clone()), hour: self.hour, minute: self.minute, second: self.second, } } } impl<TZ, UntilTZ> Job for EveryDay<TZ, UntilTZ> where TZ: Clone + TimeZone + Send + Sync, UntilTZ: Clone + TimeZone + Send + Sync, ...
Rust
0
""" def sqr(x): return x ** 2 l = (1, 2, 3, 4, 5) res = map(sqr, l) """ l = list(range(1, 11)) print(f"l :{l}") res = list(map(lambda x: x ** 2, l)) print(f"res :{res}") print("-" * 60) # sort these months using a map function # ---------------------------------------- months = ['dec', 'oct', 'jul', 'nov', 'au...
Python
1
""" Welcome to the encoding dance! In a nutshell, text columns are actually a proxy class for byte columns, which just encode/decodes contents. """ from mitmproxy.tools.console import signals from mitmproxy.tools.console.grideditor import col_bytes class Column(col_bytes.Column): def __init__(self, heading, enco...
Python
1
info>, #[account(mut)] pub metadata_edition_mark_pda: AccountInfo<'info>, pub metadata_new_mint_authority: Signer<'info>, // PDA of recipe and master mint pub metadata_master_token_owner: AccountInfo<'info>, pub metadata_master_token_account: AccountInfo<'info>, pub metadata_new_update_...
Rust
0
ical_date.strftime('%U') }}" echo "Quarter: {{ 'Q' + ((logical_date.month - 1) // 3 + 1)|string }}" """, dag=dag ) # Loop templating example loop_templating = BashOperator( task_id='loop_templating_example', bash_command=""" echo "Processing multiple items:" {% for item in ['database', 'api...
Python
1
งด้วย[14][4][15]\n", "สาธารณรัฐจีน มีลักษณะเป็นกลุ่มเกาะ ภูมิประเทศติดกับทะเล ไม่ติด", "กับประเทศใดเลย ห่างจากเกาะทางทิศเหนือและทิศตะวันตกเป็นสาธารณรัฐ", "ประชาชนจีน ทิศใต้เป็นประเทศฟิลิปปินส์และทะเลจีนใต้ ส่วนทิศ", "ตะวันออกเป็นมหาสมุทรแปซิฟิก\n", "ในปี ค.ศ. 1638 หลังการพ่ายแพ้ข...
Rust
0
from MarcaAguaTexto.Controller.controller import Controller from MarcaAguaTexto.Model.model import Model from MarcaAguaTexto.View.view import View # Main if __name__ == "__main__": model = Model() #view = View(model) controller = Controller(model) view = View(on_submit_callback=controller.receber_dado...
Python
1
search::Query; use search::schema::Schema; use index::metadata::IndexMetadata; #[derive(Debug, Clone)] pub struct QueryBuildContext<'a> { pub index_metadata: Option<&'a IndexMetadata>, score_required: bool, } impl<'a> QueryBuildContext<'a> { pub fn new() -> QueryBuildContext<'a> { QueryBuildCo...
Rust
0
b', 1, requires=['app.1']), context=self.context) app = Stack( definition=generate_definition( 'app', 1, requires=['db.1']), context=self.context) with self.assertRaises(GraphError) as expected: build_graph([Step(vpc, None), Step(db, None)...
Python
1
match term_map.0.binary_search_by_key(&ck, |(k, _)| *k) { Ok(i) => { let (_, terms) = term_map.0.get_mut(i).unwrap(); terms.push(term.clone()); } Err(_) => { term_map.0.push((ck, vec![term.clone()]));...
Rust
0
""" Contains a method that defines the initial placement of container registries based on the well-known Best Fit algorithm.""" # EdgeSimPy component builder helpers from edge_sim_py.dataset_generator.builder_helpers import provision_container_registry def best_fit_registries(container_registry_specifications: list, ...
Python
1
s( response, _( "Select a valid choice. That choice is not one of the available choices." ), ) self.assertContains( response, '<input class="bootstrap-switch" name="email_settings-0-auto_to_case_owner" ' 'type="check...
Python
1
# Process links and return year-to-URL mapping return self.process_season_links(season_links) if __name__ == "__main__": # Configure logging logging.basicConfig( level=logging.INFO, format="%(asctime)s - %(levelname)s - %(message)s" ) # Example usage wikipedia_url...
Python
1
from flask_sqlalchemy import SQLAlchemy from authlib.integrations.sqla_oauth2 import ( OAuth2ClientMixin, OAuth2TokenMixin, OAuth2AuthorizationCodeMixin ) db = SQLAlchemy() class User(db.Model): id = db.Column(db.Integer, primary_key=True) username = db.Column(db.String(40), unique=True) def...
Python
1
amount }else { amount * 2 } } <filename>src/main.rs //! A practice implementation of something so that I can learn Rust language in a more //! practical manner. Just checking the best practices on how to use the language itself //! and checking this way of documentation. Seems nice. use std:...
Rust
0