text
string
label_name
string
labels
int64
from datetime import datetime, timezone, timedelta import logging from telegram.ext import CommandHandler from commands.feriados.utils import ( get_feriados, prettify_feriados, filter_past_feriados, next_feriado_message, read_limit_from_args, ) logger = logging.getLogger(__name__) def feriadosa...
Python
1
<< 5); self.w } } #[doc = "Reader of field `GPIO_FUNC85_IN_SEL`"] pub type GPIO_FUNC85_IN_SEL_R = crate::R<u8, u8>; #[doc = "Write proxy for field `GPIO_FUNC85_IN_SEL`"] pub struct GPIO_FUNC85_IN_SEL_W<'a> { w: &'a mut W, } impl<'a> GPIO_FUNC85_IN_SEL_W<'a> { #[doc = r"Writes raw bits to the field"...
Rust
0
pub fn wupmc14(&mut self) -> WUPMC14_W { WUPMC14_W { w: self } } #[doc = "Bit 15 - Wakeup pin mode for LLWU_Pn"] #[inline(always)] pub fn wupmc15(&mut self) -> WUPMC15_W { WUPMC15_W { w: self } } #[doc = "Bit 16 - Wakeup pin mode for LLWU_Pn"] #[inline(always)] pub fn wupmc16(&mut self) -> WU...
Rust
0
ame = OsString::from("x"); let filename2 = filename.clone(); let old_ts = time::Timespec::new(0, 0); ds.expect_get() .once() .with(eq(FSKey::new(root_ino, ObjKey::Inode))) .returning(move |_| { let inode = Inode { size: 0, nlink: 2, ...
Rust
0
target, value } => { let value = to_bit_36(*value); let value = mask .iter() .zip(value) .map(|(m, v)| match m { BitmaskBit::Zero => false, BitmaskBit::One => true, ...
Rust
0
_rows { let t = counts[r]; counts[r] = l; l += t; r += 1; } let mut pos: Vec<usize> = vec![0; num_rows]; let mut result: Vec<char> = vec!['\0'; s.len()]; r = 0; reversed = true; for c in s.chars() { result[count...
Rust
0
01010101010101010101010101010101010101010101010101010101"; Hash256::from_hex(&a).unwrap(); } #[should_panic] #[test] fn test_hex_long() { let a = "02020202020202020202020202020202020202020202020202020202020202020202024444020202020202"; Hash256::from_hex(&a).unwrap(); } }//! ...
Rust
0
ved_item = list.get(1); assert!(retrived_item.is_some()); assert_eq!(2 as i32, *retrived_item.unwrap()); } #[test] fn get_by_index_in_string_list() { let mut list_str = LinkedList::<String>::new(); list_str.add("A".to_string()); list_str.add("B".to_string()); ...
Rust
0
Ref, PKeyCtxRef}; use error::ErrorStack; #[cfg(ossl110)] use ffi::{EVP_MD_CTX_new, EVP_MD_CTX_free}; #[cfg(any(ossl101, ossl102))] use ffi::{EVP_MD_CTX_create as EVP_MD_CTX_new, EVP_MD_CTX_destroy as EVP_MD_CTX_free}; pub struct Signer<'a> { md_ctx: *mut ffi::EVP_MD_CTX, pkey_ctx: *mut ffi::EVP_PKEY_CTX, ...
Rust
0
'ၣ', '↺', 'Ӿ', '𐣾', '𐬙', '\u{f35}', '𒿂', '𑅢', '𐀍', '𐐂', '㊨', 'ඨ', '𑨍', '𑫜', '🢒', 'ῴ', 'ର', '🎥', '誠', '𐅒', '🝥', 'ឞ', 'ꑀ', '𑃚', '𑀂', '𒈺', 'ꬤ', '4', '𓄈', '𐔵', 'ច', 'ꐕ', '𓋽', '\u{73c}', '𛱡', '𐫶', 'ꬓ', '\u{e4e}', '𝈌', '𐴟', '🅦', '𒌑', '嵃', 'ℛ', '🗅', '\u{e01b3}', '𒆩', '㔕', 'ḱ', '𝋰', '...
Rust
0
ruct", "super", "trait", "true", "try", "type", "typeof", "union", "unsafe", "unsized", "use", "virtual", "where", "while", "yield", ]; fn to_identifier(id: &str) -> String { if KWORDS.contains(&id) { format!("{}_", id) } else { id.replace("-", "_") } } #[cfg(test)] mod tests { use...
Rust
0
Ucg[U[5(a8U4[U5-nU4[U5-n[[[XU55$[ XU5$)Nr)tuplelenmaprZrt)rurvrobUserNameTupleresultCLSIDTuples r!rZrZh[...
Python
1
nes, kernel_size=3, padding=1, bias=False)), nn.ReLU(inplace=True), nn.BatchNorm2d(planes), SpectralNorm(nn.Conv2d(planes, planes, kernel_size=3, padding=1, bias=False)), nn.ReLU(inplace=True), nn.BatchNorm2d(planes), ECALayer(planes), ) ...
Python
1
s to reduce the chance of losing events to a full channel. let flush_under_capacity = config.event_buffer_capacity / 2; let recorder = config .recording_path .as_ref() .map(|path| Recorder::new(path).expect("creating recorder")); let server = Server { ...
Rust
0
e chrono::naive::NaiveDateTime; use serde::{Deserialize, Serialize}; use uuid::Uuid; #[cfg(feature = "backend")] use crate::schema::funding; #[cfg(feature = "backend")] use crate::schema::funding_history; #[cfg_attr( feature = "backend", derive(juniper::GraphQLEnum), graphql(description = "Field to use wh...
Rust
0
from fastapi import FastAPI, Request, Form, Depends, HTTPException from fastapi.responses import HTMLResponse from fastapi.templating import Jinja2Templates from fastapi.staticfiles import StaticFiles import os from typing import List, Dict, Any, Optional import json # Templates directory templates_dir = os.path.join(...
Python
1
# Copyright 2025 - Oumi # # 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, softw...
Python
1
(3코트))','안성맞춤소프트테니스구장(테니스구장(4코트))','안성맞춤소프트테니스구장(테니스구장(5코트))','안성맞춤소프트테니스구장(테니스구장(6코트))','안성맞춤소프트테니스구장(테니스구장(7코트))','안성맞춤소프트테니스구장(테니스구장(8코트))'] desired_reservation_time_list = ['06:00~08:00', '08:00~10:00', '10:00~12:00', '12:00~14:00', '14:00~16:00', '16:00~18:00', '18:00~20:00', '20:00~22:00'] desired...
Python
1
then 42 false then 99 x "; test_script(script, Number(99.0)); } #[test] fn match_multiple() { let script = r#" x = 11 match x % 3, x % 5 0, 0 then "Fizz Buzz" 0, _ then "Fizz" _, 0 then "Buzz" _ then x "#; test_script(script, Number(11.0)); ...
Rust
0
from django.db import migrations def convert_charfield_to_json(apps, schema_editor): Game = apps.get_model('games', 'Game') for game in Game.objects.all(): # تبدیل mechanics if game.mechanics and game.mechanics.strip(): # اگر رشته خالی نیست # فرض می‌کنیم رشته‌ها با کاما جدا شدن (م...
Python
1
.encoding, "strict") self.append(strdata) elif key[0] == BINPERSID[0]: pid = self.stack.pop() # Only allow persistent load of storage if type(pid) is not tuple and not type(pid) is not int: raise UnpicklingError( ...
Python
1
>>, // } } #[cfg_attr(feature = "fuzz", derive(Arbitrary))] #[derive(Clone, PartialEq)] pub enum AssignmentOp { Assign, Merge, } impl fmt::Display for AssignmentOp { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { use AssignmentOp::*; match self { Assign => writ...
Rust
0
pub fn tatb(self) -> &'a mut W { self.variant(SYNCT4_A::TATB) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x03 << 8)) | (((value as u32) & 0x03) << 8); self.w } } #[doc = "Synchron...
Rust
0
"Wallet backend load test", ); } #[test] pub fn fragment_batch_load_test() { let mut faucet = startup::create_new_account_address(); let (mut jormungandr, _) = startup::start_stake_pool( &[faucet.clone()], &[], ConfigurationBuilder::new() .with_slots_per_epoch(...
Rust
0
import numpy as np from numpy.linalg import norm def vec2unit_vec(vec): return vec / norm(vec) # thresholds values based on percentiles # so values above get set to pos_val, values below get set to neg_val, and in between get set to middle_val def threshold_vector_by_pct(vector, pct_cutoff=90, pos_val=1, neg_val...
Python
1
from __future__ import annotations from abaqus.DisplayGroup.Leaf import Leaf from abaqus.DisplayGroup.LeafFromDatums import LeafFromDatums from abaqus.DisplayGroup.LeafFromDisplayGroup import LeafFromDisplayGroup from abaqus.DisplayGroup.LeafFromGeometry import LeafFromGeometry from abaqus.DisplayGroup.LeafFromInstanc...
Python
1
cility_data.type >= 0: zone_cid = facility_data.type # 供电策略的调整 now_power_strategy = cache.rhodes_island.power_supply_strategy.get(zone_cid, 0) now_power_strategy_adjust = game_config.config_supply_strategy[now_power_strategy].adjust # 设施路径名 room_full_str_list = [] # TODO 厨房,因为没有单独设施id所以用...
Python
1
Params) -> Option<&LeftSpecToRightSpec> { match (p.program_options.exec_set_env, &p.left_to_right) { (true, &L2rUser::ReadFrom(ref x)) => Some(&**x), _ => None, } } #[derive(Debug, Clone)] pub struct Cmd(pub String); impl Specifier for Cmd { fn construct(&self, p: ConstructParams) -> PeerCo...
Rust
0
_base_ = 'yolov5_s-v61_syncbn_8xb16-300e_coco.py' # fast means faster training speed, # but less flexibility for multitasking model = dict( data_preprocessor=dict( type='YOLOv5DetDataPreprocessor', mean=[0., 0., 0.], std=[255., 255., 255.], bgr_to_rgb=True)) train_dataloader = dict...
Python
1
apb: &mut <Usart as rcc::RccBus>::Bus, ) -> Self where Usart: Instance, Tx: TxPin<Usart>, Rx: RxPin<Usart>, Config: Into<config::Config>, { use config::*; let config = config.into(); // Enable USART peripheral for any further interaction. ...
Rust
0
ype Error: std::fmt::Display; /// Called when X-Plane loads this plugin /// /// On success, returns a plugin object fn start() -> Result<Self, Self::Error>; /// Called when the plugin is enabled /// /// If this function returns an Err, the plugin will remain disabled. /// /// The de...
Rust
0
1").1, vec![1] ); assert_eq!( process_with_input("3,12,6,12,15,1,13,14,13,4,13,99,-1,0,1,9", "0").1, vec![0] ); assert_eq!( process_with_input("3,12,6,12,15,1,13,14,13,4,13,99,-1,0,1,9", "1").1, vec![1] ); assert...
Rust
0
expected_output: &str, ) { let regexp = RegExpBuilder::from(&test_cases) .with_conversion_of(&[Feature::Repetition, Feature::Space]) .with_escaping_of_non_ascii_chars(false) .build(); test_if_regexp_is_correct(regexp, expected_output, &test_cases); test_if_regexp_matches_test_cas...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'In-App Purchases', 'category': 'Hidden/Tools', 'version': '1.1', 'summary': 'Basic models and helpers to support In-App purchases.', 'description': """ This module provides standard tools (...
Python
1
day7/src/load.rs #[cfg(target_arch = "x86")] use std::arch::x86::*; #[cfg(target_arch = "x86_64")] use std::arch::x86_64::*; #[repr(align(32))] struct A { data: [f64; 8], } unsafe fn m256d_to_slice(x: __m256d) -> [f64; 4] { let mut s = [0.0; 4]; _mm256_storeu_pd(s.as_mut_ptr(), x); s } unsafe fn prin...
Rust
0
R](tcd3_daddr::R) reader structure"] impl crate::Readable for TCD3_DADDR {} #[doc = "`write(|w| ..)` method takes [tcd3_daddr::W](tcd3_daddr::W) writer structure"] impl crate::Writable for TCD3_DADDR {} #[doc = "TCD Destination Address"] pub mod tcd3_daddr; #[doc = "TCD Signed Destination Address Offset\n\nThis registe...
Rust
0
e[1] / frame.rgb.shape[0] server.scene.add_camera_frustum( f"/frames/t{i}/frustum", fov=fov, aspect=aspect, scale=0.15, image=frame.rgb[::downsample_factor, ::downsample_factor], wxyz=tf.SO3.from_matrix(frame.T_world_camera[:3, :3]).wxyz, ...
Python
1
the condition is False rayPath.append([outputBeamMatch[tmpBeamName], tmpBeamName, oeStr, gBeamName]) elif len(re.findall(('double'), methStr)) +\ len(re.findall(('multiple'), methStr)) > 0: ...
Python
1
&line); Some(Instruction::from(line)) } else { None } }) .collect(), ) } pub fn run(matches: ArgMatches) -> io::Result<()> { if matches.is_present("REMOVE_PCDATA_FUNCDATA") && !matches.is_present("TRIM_GOROUTINE") {...
Rust
0
= state.clone(); Response::builder().html(|o| templates::talkindex_html(o, state.talks.clone())) } #[instrument(skip(state))] pub async fn post_view(name: String, state: Arc<State>) -> Result<impl Reply, Rejection> { let mut want: Option<Post> = None; for post in &state.talks { if post.link == fo...
Rust
0
import tkinter as tk from tkinter import messagebox class AplikasiKeuangan: def __init__(self, root): self.root = root self.root.title("Aplikasi Pencatat Keuangan") self.saldo = 0 # Label dan Entry untuk jumlah self.label_jumlah = tk.Label(root, text="Jumlah:") sel...
Python
1
Model, table=True): # type: ignore t2: str = "bar" Model.migrate(autogenerate=True) assert len(list(versions.glob("*.py"))) == 5 with nextpy.data.model.session() as session: with pytest.raises(sqlalchemy.exc.OperationalError) as errctx: # type: ignore session.exec(sqlmodel.se...
Python
1
in_dataiter.provide_data, label_shapes=train_dataiter.provide_label, shared_module=mod) for i_epoch in range(num_epoch): train_dataiter.reset() for i_iter, batch in enumerate(train_dataiter): batch.data[0] = mx.nd.array(Scaler.transform(batch.data[0].asnumpy())) mod.forward(batch) mod.backw...
Python
1
tapes.append(form_filler_tape) else: logger.debug( f"Successfully continued tape {form_filler_tape.metadata.id} with {form_filler_tape.metadata.n_added_steps} steps" ) predicted_tapes.append(form_filler_tape) counters = { "total_input_tapes": len...
Python
1
uper().set_affected_address(addresses_set) def apply(self, state: State, state_container: StateContainer) -> bool: address_state = state_container.addresses_state[self.addr_from] address_state.update_balance(state_container, self.fee, subtract=True) state_contain...
Python
1
uffle_ratio**2)), ) reshaped_tensor = reshaped_tensor.transpose(0, 2, 1, 3) output_tensor = reshaped_tensor.reshape(batch_size, -1, reshaped_tensor.shape[-1]) return output_tensor def interpolate(pos_embed, size, mode="cubic", align_corners=False): """ MLX implementation of PyTorch's F.interp...
Python
1
4(o), }, OutputDto::Nft(o) => TypedOutput { output: OutputDto_::T5(o), }, }; output.serialize(serializer) } } /// Describes all the different address types. #[derive(Clone, Debug)] pub enum AddressDto { /// An Ed25519 address. Ed25519(Ed25...
Rust
0
pe='FormatBundleMap'), dict(type='Collect3D', keys=['img'], meta_keys=( 'location', 'token', 'ego2img', 'sample_idx', 'ego2global_translation', 'ego2global_rotation', 'img_shape', 'scene_name')) ] DATA_ROOT = './data/nuscenes' ANN_ROOT = './cache/annotations/' # configs for evaluation code # DO NO...
Python
1
import json from redis._parsers.helpers import pairs_to_dict from redis.commands.vectorset.utils import ( parse_vemb_result, parse_vlinks_result, parse_vsim_result, ) from ..helpers import get_protocol_version from .commands import ( VEMB_CMD, VGETATTR_CMD, VINFO_CMD, VLINKS_CMD, VSIM_...
Python
1
# -*- coding:utf-8 -*- import numpy as np import matplotlib as mpl import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D from scipy.stats import multivariate_normal # 多元正态分布 from sklearn.mixture import GaussianMixture # GMM Gaussian Mixture Model from sklearn.metrics.pairwise import pairwise_dista...
Python
1
import cv2 import numpy as np import os def crop_silhouette(image): coords = cv2.findNonZero(image) # Find white pixels if coords is None: return image # No silhouette detected x, y, w, h = cv2.boundingRect(coords) cropped = image[y:y+h, x:x+w] return cropped def resize_silhouette(image,...
Python
1
# Copyright 2017 Battelle Energy Alliance, 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed t...
Python
1
a5]\ *\xe8\xb73\xe1\x96M\xfd\x110\x9e\xba\xf1\x18\x03\xe6\ R\x80\xa5\x90\x0d\x9f\xb6/\xee<g\xd7\xdf\xf0P{\ \xf4g~\x81\xed\xbc\xfb=v\xf3\xab\x7f\xdd6\xc7\x81\ \x0d\xe9\xe3\x96\xf6\xd7\xab\x0dk#@;\xd8\x85(*\ /\x12\xe3\xccXH\xcb\xd5\xac \xaf\xd4=\xefD\x18\ J\x0b\x94\x15x\xea\xd1/\xdc?\xd6\x98\xd1w\x8cO\ \xd1+X\x8e\xdc\xb1...
Python
1
#[derive(Clone)] pub struct Client { endpoint: String, credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>, scopes: Vec<String>, pipeline: azure_core::Pipeline, } #[derive(Clone)] pub struct ClientBuilder { credential: std::sync::Arc<dyn azure_core::auth::TokenCredential>, endpoin...
Rust
0
random_device::read(dest) } // Read a single byte from `/dev/random` to determine if the OS RNG is // already seeded. NetBSD always blocks if not yet ready. fn test_initialized(&mut self, dest: &mut [u8], _blocking: bool) -> Result<usize, Error> { static ...
Rust
0
).code, b"X\n"); assert_eq!(pp("#define TRUE 0\n#ifndef TRUE\nX\n#else\nY\n#endif").unwrap().code, b"Y\n"); assert_eq!(pp("#if 0\n#define X Y\n#endif\nX").unwrap().code, b"X"); assert_eq!(pp("#if 1\n#define X Y\n#else\n#define X Z\n#endif\nX").unwrap().code, b"Y"...
Rust
0
import sys from typing import List # import asyncio import uvicorn import websockets from fastapi import FastAPI, HTTPException from AloneChat import __version__ as __main_version__ from AloneChat.core.client.command import CommandSystem from ..core.message.protocol import Message SERVER_ADDR = "localhost" SERVER_PO...
Python
1
", error_message); } /// Returns true if program should exit with success status fn run() -> Result<bool> { // Parse arguments let opt = args::get_options(); use simplelog::LevelFilter; simplelog::TermLogger::init( if opt.quiet { LevelFilter::Error } else { mat...
Rust
0
"""Tests for neurodsp.spectral.variance.""" from neurodsp.tests.tsettings import FS from neurodsp.spectral.variance import * ################################################################################################### ############################################################################################...
Python
1
def matchById(event): return lambda x: x.id==event.id
Python
1
#[doc = "`write(|w| ..)` method takes [tcd_doff::W](tcd_doff::W) writer structure"] impl crate::Writable for TCD_DOFF {} #[doc = "TCD Signed Destination Address Offset"] pub mod tcd_doff; #[doc = "TCD Current Minor Loop Link, Major Loop Count (Channel Linking Disabled)\n\nThis register you can [`read`](crate::generic:...
Rust
0
opy_loss = entropy.mean() loss = pg_loss - ent_coef * entropy_loss + v_loss * vf_coef optimizer.zero_grad() loss.backward() nn.utils.clip_grad_norm_(agent.parameters(), max_grad_norm) optimizer.step() if target_kl is not None:...
Python
1
# Reset matching state self.sequence_index = 0 self.token_buffer = [] self.text_buffer = "" # Return content based on current state if self.current_state == "think": return DeltaMessage(reasoning_content=buffere...
Python
1
e::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [alarm0](alarm0) module"] pub type ALARM0 = crate::Reg<u32, _ALARM0>; #[allow(missing_docs)] #[doc(hidden)] pub struct _ALARM0; #[doc = ...
Rust
0
"sim_total": float(round(sim_total, 2)), # The caller can pass “live” rates to also compute current_like if desired; # for the KPI dial you usually only need sim_total and comparisons made by caller. "by_tier": [{"tier": t, "thb": float(round(v, 2))} for t, v in zip(by_tier["tier"], by_ti...
Python
1
instance: ::protobuf::lazy::Lazy<CatchPokemonResponse> = ::protobuf::lazy::Lazy { lock: ::protobuf::lazy::ONCE_INIT, ptr: 0 as *const CatchPokemonResponse, }; unsafe { instance.get(|| { CatchPokemonResponse { status: ::std::option::...
Rust
0
elf, loc, l, parent, name="_name", keyword=True): screen = slast.SLScreen(loc) screen.name = l.require(l.word) screen.parameters = renpy.parser.parse_parameters(l) self.parse_contents(l, screen, can_tag=True) keyword = dict(screen.keyword) screen.modal = keyword.get(...
Python
1
busy(&self) -> BUSY_R { BUSY_R::new(((self.bits >> 3) & 0x01) != 0) } #[doc = "Bits 1:2 - 2:1\\] Software should not rely on the value of a reserved. Writing any other value than the reset value may result in undefined behavior."] #[inline(always)] pub fn reserved0(&self) -> RESERVED0_R { ...
Rust
0
s"), snippet(cx, rhs.span, "rhs") ), }; let help = format!( "because `{}` is the {} value for this type, {}", snippet(cx, culprit.expr.span, "x"), match cu...
Rust
0
from django.urls import path, include from rest_framework import routers from quickstart import views router = routers.DefaultRouter() router.register(r'users', views.UserViewSet, basename='user') router.register(r'groups', views.GroupViewSet, basename='group') router.register(r'comments', views.CommentViewSet, basen...
Python
1
PJ, out_values: *mut f64, value_count: ::std::os::raw::c_int, emit_error_if_incompatible: ::std::os::raw::c_int, ) -> ::std::os::raw::c_int; } extern "C" { pub fn proj_coordoperation_create_inverse(ctx: *mut PJ_CONTEXT, obj: *const PJ) -> *mut PJ; } extern "C" { pub fn proj_concatop...
Rust
0
import os import requests from dotenv import load_dotenv load_dotenv(override=True) TG_URL = os.getenv("TG_URL") TG_API_KEY = os.getenv("TG_API_KEY") def send_message(text, chat_id): """ Отправляет текстовое сообщение в указанный чат Telegram. Args: text: Текст сообщения для отправки. ...
Python
1
{'class_name': regularizer.__class__.__name__, 'config': regularizer.get_config()} if type(layer) == keras.layers.BatchNormalization: layer_config['config']['momentum'] = 0.9 layer_config['config']['epsilon'] = 1e-5 model = keras.models.Model.from_config(model...
Python
1
/// Invalid parameter InvalidParameter = -1, /// Buffer too small BufferTooSmall = -2, /// Memory error MemoryError = -3, /// General error GeneralError = -4, } /// 3DES subkeys #[derive(Copy, Clone)] #[repr(C)] pub struct DesSubKey([u8; 16]); /// 3DES keys #[derive(Copy, Clone)] pu...
Rust
0
(obj, "tags", set(tags)) return obj return decorator @contextmanager def register_lookup(field, *lookups, lookup_name=None): """ Context manager to temporarily register lookups on a model field using lookup_name (or the lookup's lookup_name if not provided). """ try: for looku...
Python
1
inta) rootb = find_root(pointb) if roota != rootb: group_mask[rootb] = roota # group_mask[pointb] = roota # group_mask[pointa] = roota return def find_root(pointa): root = pointa while group_mask.get(root) != -1: root = group_m...
Python
1
# Tests support for UserTransform on representations. # There's no UI to set UserTransform and only mechanism is to use Python. # This work was supported by CEA/DIF - Commissariat a l'Energie Atomique, # Centre DAM Ile-De-France, BP12, F-91297 Arpajon, France from paraview import smtesting from paraview.simple import...
Python
1
coins = [7, 2, 20, 24, 9, 24, 29, 6, 32, 26, 17, 61, 33, 14, 12, 20, 15, 34, 60, 18, 18, 37, 25, 9, 9, 21, 24, 30, 28, 3, 21, 32, 13, 10, 4, 2, 33, 36, 13, 24, 27, 7, 21, 4, 8, 17, 22, 3, 21, 12] tax = {28: 10, 36: 13, 18: 13, 17: 8, 24: 3, 37: 19, 60: 16, 13: 5, 14: 8, 30: 18, 20: 5, 27: 16, 26: 11, 2: 2, 21: 3, 7: 7...
Python
1
# Copyright 2015 Ufora 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 the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to i...
Python
1
Color::new(tm_intensity, 0.0, 0.0), desat_amount.powf(params.desaturation), ); tm_col.blend(desat_col, tm_lum.clamp(0.0, 1.0).powf(params.crosstalk)) } } /// Parameters for the [`LottesTonemapper`] #[repr(C)] #[derive(Clone, Copy, Debug, PartialEq)] #[cfg_attr(feature = "with-serde", d...
Rust
0
ate: bool, } impl StateMachine { pub fn new() -> StateMachine { StateMachine { // _transitions: Vec::new(), _initial: State::new("null"), _current: State::new("null"), _propagate: false, } } pub fn propagate(&self) -> bool { self._propagate } }<reponame>ZetaNumbers/minimal-rust-psvita-example u...
Rust
0
state: HandshakeState::New, ecdhe: Random.generate()?, nonce: *nonce, remote_ephemeral: Public::default(), remote_nonce: H256::zero(), remote_version: PROTOCOL_VERSION, auth_cipher: Bytes::new(), ack_cipher: Bytes::new(), }) } /// Start a handshake pub fn start<Message>(&mut self, io: &Io...
Rust
0
from robyn import Request from common.page_info import Page async def page_handler(request: Request) -> Page: page = Page() query_params = request.query_params try: page.page = int(query_params.get("page", '1')) page.size = int(query_params.get("size", '20')) except ValueError: ...
Python
1
oint # MAGIC - Deploy realtime model endpoint to perform RAG and provide Q&A capabilities # MAGIC # MAGIC Lakehouse AI is uniquely positioned to accelerate your GenAI deployment. # MAGIC # COMMAND ---------- # MAGIC %md # MAGIC ## Next: Deploying our GenAI Assistant application to end users with Databricks Lakehouse ...
Python
1
rld_to_camera(verts, RT)[..., :3] verts_clip = self.world_to_clip(verts, None, None, image_size, mvp=full_proj) tri = faces.int() rast_out, rast_out_db = dr.rasterize(self.glctx, verts_clip, tri, image_size) faces = faces.int() fg_mask = torch.clamp(rast_out[..., -1:], 0, 1).boo...
Python
1
# Usando métodos em dicionários contatos = { "guilherme@gmail.com": {"nome": "Guilherme", "telefone": "3333-2221"}, "giovanna@gmail.com": {"nome": "Giovanna", "telefone": "3443-2121"}, "chappie@gmail.com": {"nome": "Chappie", "telefone": "3344-9871"}, "melaine@gmail.com": {"nome": "Melaine", "telefone"...
Python
1
d.table(), &option.ignore) } /// Replace strings before convert fn before_convert(text: &str, convert: Vec<(&str, &str)>) -> String { let mut converted = text.to_string(); convert .iter() .for_each(|(b, a)| converted = converted.replace(b, a)); converted } /// Convert strings refers conver...
Rust
0
impl Params { /// Parse incoming `Params` into expected types. pub fn parse<D>(self) -> Result<D, Error> where D: DeserializeOwned, { let value = match self { Params::Array(vec) => Value::Array(vec), Params::Map(map) => Value::Object(map), Params::No...
Rust
0
<T>, [T], Func = dyn Fn(&StorageUnit<T>) -> &[T]>, ) ), ( &'a mut [T], MapMut, ( MutBorrowed<'a, U>: MapMut<dyn Any, StorageUnit<T>, Func = dyn Fn(&mut dyn Any) -> &mut StorageUnit<T>>, <MutBorrowed<'a, U> as MapMut<dyn Any, StorageUnit<T>>>::Output: MapMut<StorageUnit<T>...
Rust
0
from __future__ import annotations from .common import DeviceOpOverrides, register_device_op_overrides class MPSDeviceOpOverrides(DeviceOpOverrides): def device_guard(self, device_idx: int) -> str: assert device_idx == 0 return "torch._ops.contextlib.nullcontext()" def set_device(self, devic...
Python
1
h of design elements and the code files to create traceability links, using the provided document link context to inform your decisions. --- **Source Design Elements (To trace FROM):** ```json {source_str} ``` --- **All Code Files (Potential trace TO):** ```json {code_str} ``` --- **Document Traceability Context (D->D...
Python
1
, 8.0); assert_eq!(x[[41, 1]], 318.0); assert_eq!(x[[41, 2]], 150.0); assert_eq!(x[[41, 3]], 4096.0); assert_eq!(x[[41, 4]], 13.0); assert_eq!(x[[41, 5]], 71.0); assert_eq!(x[[41, 6]], 1.0); } } <gh_stars>1-10 //! Glow tessellation implementation. use luminance::back...
Rust
0
ize - 1 } else { rng.gen_range(0..surfeit_bound) }; let a = NonNativeFieldGadget::<SimulationF, ConstraintF>::alloc_random( cs.ns(|| "alloc random a"), rng, surfeit_a, ) .unwrap(); assert!(a.check(), "rando...
Rust
0
-> !, arg: usize) -> Box<Context> { ContextImpl::new_kernel(entry, arg) }mod cache; mod client; mod style; mod view; mod window; use super::errors; pub use self::view::View; pub use self::client::Client as ViewClient; <gh_stars>0 //! A map based on an [association list](https://en.wikipedia.org/wiki/Association_...
Rust
0
number:UInt64], statistics: [read_rows: 1, read_bytes: 8]", }, ]; for test in tests { let ctx = try_create_cluster_context( ClusterDescriptor::new() .with_node("Github", "www.github.com:9090") .with_node("dummy_local", "127.0.0.1:9090") ...
Rust
0
args.num_target_layers, detail=False, path_db=path_wikisql, st_pos=0, dset_name='dev', EG=args.EG) pr...
Python
1
return pd.DataFrame() return return get_data_parallel(codes).result() no_stocks = len(look_up) if(show_progress): clear_output(wait=True) print(f'Gathering detailed data for {no_stocks} stocks ...') # ga...
Python
1
Date::from_ymd(2021, 09, 11).and_hms_milli(21, 40, 40, 123)), actual ); Ok(()) } #[test] fn date_proto_set_milliseconds() -> Result<(), Box<dyn std::error::Error>> { let mut engine = Context::new(); let actual = forward_dt_local( &mut engine, "let dt = new Date(2020, 06, 08, 0...
Rust
0
import jwt from datetime import datetime, timedelta, timezone SECRET_KEY = "9uf309d039ue09u" ALGORITHM = "HS256" def create_jwt_token(username: str): payload = { "sub": username, "extra": 'Other useful information', "iat": datetime.now(tz=timezone.utc), "exp": datetime.now(tz=timez...
Python
1
` feature can only be built for the `xtensa-esp32s2-espidf` target." ); #[cfg(all(feature = "esp32s3_usb_otg", not(esp32s3)))] compile_error!( "The `esp32s3_usb_otg` feature can only be built for the `xtensa-esp32s3-espidf` target." ); #[cfg(not(any( feature = "kaluga_ili9341", feature = "esp32_ili9341", ...
Rust
0