text
string
label_name
string
labels
int64
ry (metadata) to be # included in the Vertex AI Model Registry. See for more details # https://cloud.google.com/bigquery/docs/update_vertex#add-existing. # When use deploys the model to an endpoint from the Model Registry then # they can specify an encryption key to further protect the artifacts at ...
Python
1
/// - When a T32 instruction is trapped, it is IMPLEMENTATION DEFINED whether: /// - CV is set to 0 and COND is set to an UNKNOWN value. Software must examine the /// SPSR.IT field to determine the condition, if any, of the T32 instruction. /// - CV is set to 1 and COND is set to...
Rust
0
fulfillment_cx: RefCell::new(<dyn TraitEngine<'_>>::new(tcx)), locals: RefCell::new(Default::default()), deferred_sized_obligations: RefCell::new(Vec::new()), deferred_call_resolutions: RefCell::new(Default::default()), deferred_cast_checks: RefCell::new(Vec::new()...
Rust
0
mem, ) .unwrap(); let resp = zhttppacket::OwnedResponse::parse(msg, 0, scratch).unwrap(); let resp = arena::Rc::new(resp, &resp_mem).unwrap(); assert_eq!(s_to_conn.try_send((resp, 0)).is_ok(), true); assert_eq!(check_poll(executor.step()), None); let data = so...
Rust
0
mt) => visitor.visit_raise_stmt(raise_stmt), Stmt::LetDecl(let_decl_stmt) => visitor.visit_let_decl_stmt(let_decl_stmt), Stmt::FnDecl(fn_decl_stmt) => visitor.visit_fn_decl_stmt(fn_decl_stmt), Stmt::Assign(assign_stmt) => visitor.visit_assign_stmt(assign_stmt), Stmt::Retu...
Rust
0
__all__ = ['PositionalEncoding', 'SinCosPosEncoding', 'positional_encoding'] # Cell import torch from torch import nn import math # Cell def PositionalEncoding(q_len, d_model, normalize=True): pe = torch.zeros(q_len, d_model) position = torch.arange(0, q_len).unsqueeze(1) div_term = torch.exp(torch.arang...
Python
1
ted for jobs that are /// running on EC2 resources. If your container attempts to exceed the memory specified, the container is terminated. /// This parameter maps to <code>Memory</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the /// <...
Rust
0
vironment override os.environ["TEST_PROVIDER_RPS"] = "5.5" try: rps = get_provider_rate_limit("test_provider") assert rps == 5.5 finally: # Clean up del os.environ["TEST_PROVIDER_RPS"] def test_invalid_environment_override(self): ...
Python
1
/build/manifest.json"), } MEDIA_URL = '/media/' MEDIA_ROOT = str(BASE_DIR / 'media') # Default primary key field type # https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.AutoField' WAGTAIL_SITE_NAME = 'My Project' WAGTAILADMIN_BASE_URL = os.environ.get("W...
Python
1
i32, #[serde(skip_serializing_if = "Option::is_none")] pub main_span: Option<crate::opentracing::Span>, } #[cfg(feature = "python")] impl ToPyObject for TestResult { type ObjectType = PyDict; fn to_py_object(&self, py: Python) -> Self::ObjectType { let object = PyDict::new(py); object ...
Rust
0
import os import sys # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Project information ----------------------------------------------------- # https://www.sph...
Python
1
!(i64, &sample, &exp, write_i64); } #[test] fn test_float_data_writer_f32() { let mut writer = VecWriter::new(); let w: &mut dyn Writer = &mut writer; let exp: [u8; 8] = [0x40, 0x49, 0x0f, 0xdb, 0x40, 0x49, 0x0f, 0xdb]; match write_f32(3.14159274101257324 as f32, w) { Ok(_) => (), Err...
Rust
0
as *const c_char, signature: b"\0" as *const u8 as *const c_char, types: unsafe { &types_null as *const _ }, }, ]; pub static mut zwp_fullscreen_shell_mode_feedback_v1_interface: wl_interface = wl_interface { name: b"zwp_fullscreen_shell_mode_feedback_v1\0" as *const u8 as *const c_char, ve...
Rust
0
stD_mdof[i,:] = stD_mdof[0,:]*Ratio_disp # This is for the case that the ultimate displacement is less than # the previous ones. I basically scale the previous displacements # with the same scale of the ultimate displacement rather than ...
Python
1
, B> where T: Eq + Hash + Send + 'static, <B::Pipe as ParallelPipe<U>>::Task: Clone + Send + 'static, B::ReduceA: Clone + Send + 'static, B::ReduceC: Clone, B::Done: Send + 'static, { type Done = IndexMap<T, B::Done>; type Pipe = A; type ReduceA = GroupByReducerA<<B::Pipe as ParallelPipe<U>>::Task, B::ReduceA, ...
Rust
0
j = (input( 'Nismo našli projekciju sa tom šifrom, pokušajte ponovo ili napišite kraj ako želite da odustanete: '). lower().strip()) if kraj == 'kraj': return False while True: seat = input('Unesite sedište projekcije koju želite da ob...
Python
1
import requests import json import os import shutil def get_model_url(): """ 使用 API Key,Secret Key 获取access_token,替换下列示例中的应用API Key、应用Secret Key """ api_key = "qQ1vN7YZaKwjH8M84UgW3rWa" secret_key = "OQVhUmkquHjWhDIBvVRTXxCu0RA1CwjA" url = f"https://aip.baidubce.com/oauth/2.0/token?grant_type...
Python
1
very line as a link if url.endswith(".pdf"): pdf_count += 1 elif ".m3u8" in url: video_count += 1 return total_links, pdf_count, video_count # API_ID = 34567564 # API_HASH = "234567dfgghjkkk" # BOT_TOKEN = "7257874076:AAH-1Q7Q7J9" # Data_collect...
Python
1
from characters import * from decorators import * # Запускаем игру @christmas_tree_decorator def main(): global display_height, display_width player = type_of_character(type) if player is None: return enemies = [] move = 20 # Скорость передвижения spawn_time = 0 # Переменная для появлен...
Python
1
import math def seq(n): P = 1/2 a = 2 for i in range(2,n+1): a *= (i + 1) P *= 1/a return P if __name__ == "__main__": n = int(input("n = ")) print(seq(n)) print(f"\nРезультат: P_{n} = {P}")
Python
1
&mut tmp_material, ) && (shadow_pt - shadow_orig).magnitude() < light_distance { continue; } diffuse_light_intensity += lights[i].intensity * light_dir.dot(N).max(0.); specular_light_intensity += reflect(light_dir, N) .dot(dir) .ma...
Rust
0
as last resolution")] fn test_dispute_with_same_outcome() { let mut contract = init_tests(); testing_env!(get_context(carol(), market_end_timestamp_ns())); contract.resolute_market(0, Some(3), to_dai(5)); contract.dispute_market(0, Some(3), to_dai(10)); } #[test] #[should_panic(expected = "for this version, there...
Rust
0
connect to IPC port. Feelsbadman."); //stream.write(b"\x01C").unwrap(); // config //stream.write(b"\x01?").unwrap(); // ping let mut buf = [0;1]; loop { let bytes_read = stream.read(&mut buf).unwrap(); if bytes_read == 0 { ...
Rust
0
t_probs = self.activation_fct(logits).type(torch.float) probs = out_probs.repeat(1, 2, 1, 1) probs[:, 0, :, :] = 1 - probs[:, 1, :, :] losses = [] for name, func, w in zip(self.loss_names['probs'], self.loss_fct['probs'], self.loss_weights['probs']): _loss, kwargs = func(prob...
Python
1
len()); data.push("DEL".into()); data.extend(self.keys.into_iter().map(Into::into)); RespValue::Array(data) } fn deserialize(resp: RespValue) -> Result<Self::Output, DeserializeError> { match resp { Integer(num) => Ok(num), resp => Err(DeserializeError::...
Rust
0
dmins on every HTTP 500 error. # See http://docs.djangoproject.com/en/dev/topics/logging for # more details on how to customize your logging configuration. LOGGING = { 'version': 1, 'disable_existing_loggers': False, 'handlers': { 'mail_admins': { 'level': 'ERROR', 'class': '...
Python
1
from .ethiopia import load_ethiopia from .sudan import load_sudan from .togo import load_togo, load_togo_eval from .brazil import load_lem_brazil, load_brazil_noncrop from .geowiki_landcover_2017 import load_geowiki_landcover_2017 from .central_asia import load_central_asia from .rwanda import load_rwanda_ceo from .ken...
Python
1
, mut auth: auth::Auth, auth_rules: State<auth::CustomAuth>, mut cookies: Cookies ) -> Result<Json<serde_json::Value>, HecateError> { let conn = conn.get()?; auth_rules.allows_user_create_session(&mut auth, &*conn)?; let uid = auth.uid.unwrap(); let token = user::create_token(&*conn, &uid...
Rust
0
olumns) } fn read_as_batch(rows: &[Vec<u8>], schema: &Schema, row_type: RowType) -> Vec<ArrayRef> { let row_num = rows.len(); let mut output = MutableRecordBatch::new(row_num, Arc::new(schema.clone())); let mut row = RowReader::new(schema, row_type); for data in rows { row.point_to(0, data); ...
Rust
0
"TH" => "Thailand", "TG" => "Togo", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "UG" => "Uganda", "UA" => "Ukraine", "AE" => "United Arab Emirates", "GB" => "United Kingdom", "US" => "Unite...
Rust
0
_file) ) lm_words = [] with open(arpa_file + ".lower", "r") as arpa: for line in arpa: # verify if the line corresponds to unigram if not re.match(r"[-]*[0-9\.]+\t\S+\t*[-]*[0-9\.]*$", line): continue word = line.split("\t")[1] word = w...
Python
1
default_value: ::std::option::Option<::std::string::String>, /// If set, gives the index of a oneof in the containing type's oneof_decl /// list. This field is a member of that oneof. oneof_index: ::std::option::Option<i32>, /// JSON name of this field. The value is set by protocol compiler. If t...
Rust
0
} impl Deltas { pub fn new() -> Deltas { Deltas { head_ffg_reward: 0, head_ffg_penalty: 0, proposer_reward: 0, attester_reward: 0, } } } impl fmt::Display for Deltas { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( ...
Rust
0
#[derive(Serialize, Debug)] struct Benchmark { name: String, throughput: f64, events: f64, } pub fn convert_into_relevant_data(whole_report: WholeReport, commit_hash: &str) -> Result<Data> { let mut benchmarks: Vec<Benchmark> = vec![]; for report in whole_report.reports.bench { // TODO add ...
Rust
0
TECT_RSSI_DET_EN_ABS_A> for bool { #[inline(always)] fn from(variant: RSSI_DETECT_RSSI_DET_EN_ABS_A) -> Self { variant as u8 != 0 } } #[doc = "Reader of field `RSSI_DETECT_RSSI_DET_EN_ABS`"] pub type RSSI_DETECT_RSSI_DET_EN_ABS_R = crate::R<bool, RSSI_DETECT_RSSI_DET_EN_ABS_A>; impl RSSI_DETECT_RSSI...
Rust
0
wned(v.iter().map(|&v| v as f64).collect::<Vec<_>>())), Property::VecF64(ref v) => Some(Cow::Borrowed(v)), _ => None, } } /// Get property value consuming self, with type conversion. pub fn into_vec_i64(self) -> Result<Vec<i64>, Self> { match self { Prope...
Rust
0
contract_txn = await self.contract.functions.sendFrom( self.manager.address, LAYERZERO_CHAINS_ID[self.to_chain], self.manager.address, self.token_id, self.manager.address, ZERO_ADDRES...
Python
1
import cv2 as cv import numpy as np def nothing(x): pass cap = cv.VideoCapture(0) if not cap.isOpened(): print("Camera no work") exit() img = np.zeros((640, 480, 3), np.uint8) cv.namedWindow('isolatedColor') cv.createTrackbar('H','isolatedColor', 0, 195, nothing) cv.createTrackbar('S','isolatedColor', 0,...
Python
1
U_n = U_n(b, 1), V_n = V_n(b, 1), and Δ = b²-4. // An extra strong Lucas pseudoprime to base b is a composite n = 2^r s + Jacobi(Δ, n), // where s is odd and gcd(n, 2*Δ) = 1, such that either (i) U_s ≡ 0 mod n and V_s ≡ ±2 mod n, // or (ii) V_{2^t s} ≡ 0 mod n for some 0 ≤ t < r-1. // // We know gc...
Rust
0
return model.getStatus(), end_time - start_time, objective_value if __name__ == "__main__": seed = 42 parameters = { 'n_vehicles': 150, 'n_zones': 180, 'min_fuel_cost': 1350, 'max_fuel_cost': 1800, 'mean_demands': 2000, 'std_dev_demands': 3000, 'cap...
Python
1
er(peer_a)); } ); // c succeeds now: assert_matches!( handle.recv().await, AllMessages::NetworkBridge( NetworkBridgeMessage::SendRequests( mut reqs, IfDisconnected::ImmediateError ) ) => { let reqs = reqs.pop().unwrap(); let outgoing = match reqs { Requests::StatementFetchin...
Rust
0
#[test] fn ex5() { assert_eq!("312211", process_line("111221")); } } <filename>components/installer-webhook/src/main.rs<gh_stars>1-10 // Copyright 2020 IBM Corp. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // ...
Rust
0
transform coordinates from the lamp frame of reference to the world Scale parameter should generally only be used for photometric_coords """ coords = self.inverse_rotation_matrix @ coords.T coords = (coords / scale).T + self.position if which == "polar": retu...
Python
1
t msg_str; if tx_hash_opt.is_none() { msg_str = json!({ "script_hash": scripthash, "status_hash": new_statushash }).to_string(); } else { let tx_id = hash_from_value(Some(&Value::String(tx_hash_opt.unwrap().to_string()))).chain_err(|| ...
Rust
0
""" Read sensor values using I2C bus This script demonstrates using I2C to read values from DHT12 temperature and humidity sensor. Components: - ESP32-based board - DHT12 temperature and humidity sensor """ from machine import I2C from machine import Pin import time SENSOR_ADDR = 0x5c # DHT12 # Init I2C using pin...
Python
1
assert_eq!(parse_mode(Some("-4".to_owned())).unwrap(), 0o662); assert_eq!(parse_mode(None).unwrap(), 0o666); } use std::prelude::v1::*; quickcheck! { fn check_against_baseline(init: u32, chunks: Vec<(Vec<u8>, usize)>) -> bool { let mut baseline = crc32fast::baseline::State::new(init); let m...
Rust
0
((s+D:\Python27_64\lib\xml\etree\ElementTree.pyt __setitem__scCs|j|=dS(N(R-(RR=((s+D:\Python27_64\lib\xml\etree\ElementTree.pyt __delitem__!scCs|jj|dS(N(R-tappend(RR...
Python
1
32 = -10_000; // Opponent can win const _OPPONENT_LINE_OF_TWO: i32 = -3; // Opponent can setup for win let win_pattern = match player { TOOT => [T, O, O, T], OTTO => [O, T, T, O], }; let mut score = 0; let calculate_window_score = |window: &[(BoardCell, bool)]| -> i32 { let mut own_count = 0; l...
Rust
0
# Sadece sunucudaki yetkililer için komut menüsü. import discord from discord.ext import commands import paginator class ModMenu(commands.Cog): def __init__(self, bot: commands.Bot): self.bot = bot @commands.command() @commands.has_permissions(change_nickname=True) async def mod(self, ctx): ...
Python
1
:handle:vertical { background: #cbd5e0; border-radius: 6px; min-height: 20px; } QScrollBar::handle:vertical:hover { background: #a0aec0; } """ def get_chat_input_style() -> str: """ Get the chat input stylesheet. Returns: str: The chat input sty...
Python
1
m::zeroed() } } } pub type CUipcMemHandle = Struct_CUipcMemHandle_st; pub type Enum_CUipcMem_flags_enum = ::libc::c_uint; pub const CU_IPC_MEM_LAZY_ENABLE_PEER_ACCESS: ::libc::c_uint = 1; pub type CUipcMem_flags = Enum_CUipcMem_flags_enum; pub type Enum_CUmemAttach_flags_enum = ::libc::c_uint; pub const CU_MEM_ATTACH_G...
Rust
0
PLC0415 from django_ca.conf import model_settings # noqa: PLC0415 from django_ca.key_backends.storages.models import StoragesUsePrivateKeyOptions # noqa: PLC0415 self.UsePrivateKeyOptions = StoragesUsePrivateKeyOptions # pylint: disable=invalid-name print("Creating database...", en...
Python
1
} debug!("{} {}", info, self); true } fn internal_fmt(&self) -> String { match &self { Self { model: None, mfg: None, serial: None, } => "any device".to_owned(), Self { model: _...
Rust
0
wind(panic::AssertUnwindSafe(|| runner(&mut subsurface))); self.handle.upgrade().map(|check| { // Sanity check that it hasn't been tampered with. if !check.get() { wlr_log!(L_ERROR, ...
Rust
0
ch_filter = f"(mail={email})" print(f"Searching LDAP with filter: {search_filter}") if not connection.search(LDAP_BASE_DN, search_filter, search_scope=ldap3.SUBTREE): connection.unbind() raise HTTPException(status_code=404, detail=f"Contact with email {email} not found.") if len(co...
Python
1
// Compute dipole fluence rate dipole(r) using Equation (15.27) let phid = INV4_PI / dg * ((-sigma_tr * dr).exp() / dr - (-sigma_tr * dv).exp() / dv); // Compute dipole vector irradiance -\N{}\cdot\dipoleE(r) using // Equation (15.27) let edn = INV4_PI * (zr * (1.0 + sigma_tr * dr) * ...
Rust
0
use self::flatbuffers::Verifiable; v.visit_table(pos)? .visit_field::<u8>(&"id", Self::VT_ID, false)? .visit_field::<GpioPressedMode>(&"mode", Self::VT_MODE, false)? .finish(); Ok(()) } } pub struct GpioButtonStatusArgs { pub id: u8, pub mode: GpioPres...
Rust
0
'\u{ff5b}'), ('\u{ff5d}', '\u{ff5d}'), ('\u{ff5f}', '\u{ff65}'), ('\u{10100}', '\u{10102}'), ('\u{1039f}', '\u{1039f}'), ('\u{103d0}', '\u{103d0}'), ('\u{1056f}', '\u{1056f}'), ('\u{10857}', '\u{10857}'), ('\u{1091f}', '\u{1091f}'), ('\u{1093f}', '\u{1093f}'), ('\u{10a50}', '\u{10a58}')...
Rust
0
#!/usr/bin/env python3 # coding=utf-8 __author__ = "zhaohongwei" __email__ = "hongweifuture@163.com" __contact__ = "https://blog.csdn.net/z_johnny" __version__ = "0.1" __date__ = "2019/9/2 16:37" __maintainer__ = "zhaohongwei," __description__ = "" """ History: 2019/9/2 16:37 : Created by zhaohongwei """ import date...
Python
1
l=False, ) download_example_images() EXAMPLES = [ [{"text": "Describe this image in great detailed.", "files": ["./cat.png"]}], [{"text": "Please describe this image and guess where it is?", "files": ["./hotel.jpg"]}], [{"text": "What's in the image, is it real happen?", "files": ["....
Python
1
[codec(index = 243)] Mortal243(::core::primitive::u8), #[codec(index = 244)] Mortal244(::core::primitive::u8), #[codec(index = 245)] Mortal245(::core::primitive::u8), #[codec(index = 246)] Mortal246(::core::primitive::u8), #[codec(index = 247)] Mortal247(::core::pri...
Rust
0
from setuptools import setup, find_packages setup( name="hubspot_export_api", version="0.1.0", description="A Python package for exporting HubSpot data, processing it, and uploading to AWS S3.", author="Jing Su", packages=find_packages(), install_requires=[ "requests", "pandas"...
Python
1
e=unpool_shape2) up1 = self.up1(up2, indices=indices_1, output_shape=unpool_shape1) fuse5 = self.fuse5(down_inp=down5, up_inp=up5) fuse4 = self.fuse4(down_inp=down4, up_inp=up4) fuse3 = self.fuse3(down_inp=down3, up_inp=up3) fuse2 = self.fuse2(down_inp=down2, up_inp=up2) ...
Python
1
id.fit(X_train, y_train) model = grid.best_estimator_ else: model = LGBMClassifier(**hyperparameters) model.fit(X_train, y_train) y_pred = model.predict(X_test) y_prob = model.predict_proba(X_test)[:, 1] metrics = { "accuracy": accuracy_score(y_test, y_pred), "a...
Python
1
ng 0b and whitespaces will be ignored. pub fn bytes_from_binary_string(original_text: &str) -> Result<Vec<u8>> { let mut text = original_text.replace("0b", ""); text = text.replace(" ", ""); bytes_from_radix_string(&text, 2) } /// Convert a octal string into a vector of bytes /// /// Leading 0 and whitesp...
Rust
0
Field; use tracing_test::traced_test; // enable logs in tests #[test] #[traced_test] fn basic_correctness() { // create a (statement, witness) pair let (ek, _dk) = &keygen_unsafe(&mut rand::thread_rng()).unwrap(); let msg = &k256::Scalar::random(rand::thread_rng()); let ...
Rust
0
ance, NegativeImbalance), TransactionValidityError> { Ok((Default::default(), Imbalance::zero())) } fn refund_fee( _who: &AccountId, _weight: Weight, _payed: NegativeImbalance, ) -> Result<(), TransactionValidityError> { Ok(()) } fn charge_fee( _who: &AccountId, _len: u32, _weight: Weight, _tip...
Rust
0
# Function to check if it's possible to place k cows in stalls such that # the minimum distance between any two cows is at least 'mid'. def is_possible(stalls, k, mid, n): cow_count = 1 # We place the first cow at the first stall last_pos = stalls[0] # The position of the last placed cow # Traverse the s...
Python
1
""" LE commands package. """ from .advertisement import * from .channel_sounding import * from .connection import * from .controller_config import * from .isochronus import * from .le_test import * from .misc import * from .scanning import * from .security import * __all__ = [ 'le_set_adv_params', 'le_set_a...
Python
1
ed. """ iterable = (iterable_or_value, *others) if others else iterable_or_value it = iter(iterable) try: lo = hi = next(it) except StopIteration as e: if default is _marker: raise ValueError( '`minmax()` argument is an empty iterable. ' ...
Python
1
# Generated by Ollama Llama 3 # Task: dynamic_mda_conversion_minimal # Attempt: 10 # Success: False # Overall Score: 0.568 import pyverilog.ast.tools as asttools import re class ArrayVisitor(asttools.NodeVisitor): def visit_Assignment(self, node): if isinstance(node.lvalue, asttools.ArrayRef) and '[]' in...
Python
1
def some_recursion(x): if x < 0: return 645 z = some_recursion(x - 1) print(f"z is return from base case :{z}") print(f"x is :{x}") x = 5 # y = some_recursion(x) # print(f"y is {y}") # def acc(x): # sum = 0 # for i in range(1, x + 1): # print(f"sum is {sum}") # sum += i # return sum ...
Python
1
_parse_array(input: &[u8], len: usize) -> IResult<&[u8], Frame, RedisParseError<&[u8]>> { let (input, data) = d_parse_array_frames(input, len)?; Ok((input, Frame::Array { data, attributes: None })) } fn d_parse_push(input: &[u8]) -> IResult<&[u8], Frame, RedisParseError<&[u8]>> { let (input, len) = d_read_prefi...
Rust
0
er buffer of the same audio # This adds ~20ms of latency but ensures smooth playback self.engine.play(mixed_audio) def set_volume(self, volume: float): self.volume = np.clip(volume, 0.0, 1.0) def enable(self): self.enabled = True def disable(self): self.ena...
Python
1
:<ldiv_t>())).rem as *const _ as usize }, 8usize, concat!("Offset of field: ", stringify!(ldiv_t), "::", stringify!(rem)) ); } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct lldiv_t { pub quot: ::std::os::raw::c_longlong, pub rem: ::std::os::raw::c_longlong, } #[test] fn bindgen_test_la...
Rust
0
# Copyright (c) 2025, NVIDIA CORPORATION. import pytest import cudf @pytest.mark.parametrize( "index, expected_repr", [ ( lambda: cudf.Index( [1000000, 200000, 3000000], dtype="timedelta64[ms]" ), "TimedeltaIndex(['0 days 00:16:40', " ...
Python
1
# 创建按钮框架 frame_buttons = tk.Frame(self.edit_window) frame_buttons.pack(pady=10) # 添加“添加词语”按钮,并绑定事件 button_add = tk.Button(frame_buttons, text="添加词语", command=self.add_word_dialog, width=15, height=2) button_add.pack(side=tk.LEFT, padx=5) # 添加“删除词语”按钮,并绑定事件 butt...
Python
1
import os import ldm_patched.modules.sd def first_file(path, filenames): for f in filenames: p = os.path.join(path, f) if os.path.exists(p): return p return None def load_diffusers(model_path, output_vae=True, output_clip=True, embedding_directory=None): diffusion_model_names ...
Python
1
"""SiteManagement URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Cl...
Python
1
# -*- coding: utf-8 -*- # 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or...
Python
1
let ux = if V.vector4_f32[0] <= Bounds.vector4_f32[0] && V.vector4_f32[0] >= -Bounds.vector4_f32[0] { 0xFFFFFFFF } else { 0 }; let uy = if V.vector4_f32[1] <= Bounds.vector4_f32[1] && V.vector4_f32[1] >= -Bounds.vector4_f32[1] { 0xFFFFFFFF } else { 0 }; let uz = if V.vector4_f32[2] <= Bounds.vector...
Rust
0
Answer { user: User { id: res.value_unchecked(0, 0)?, }, question: Question { id: res.value_unchecked(0, 1)?, text: res.value_unchecked(0, 2)?, }, ...
Rust
0
# Copyright (c) 2015, Frappe Technologies and contributors # License: MIT. See LICENSE import frappe from frappe.model.document import Document from frappe.query_builder import Interval from frappe.query_builder.functions import Now class ErrorLog(Document): # begin: auto-generated types # This code is auto-genera...
Python
1
#@+leo-ver=5-thin #@+node:ekr.20210329114352.1: * @file ../plugins/example_rst_filter.py """Filters for the rst3 command.""" from leo.core import leoGlobals as g def init(): if g.unitTesting: return False g.registerHandler('after-create-leo-frame', onCreate) return True def onCreate(tag, keys): ...
Python
1
t will attempt to ascertain the credentials from the environment. credentials_file (Optional[str]): A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. This argument is mutually exclusive with credentials. ...
Python
1
S)BlockManagerFixedrfnblocksrer[ Shape | NonecCszJ|j}d}t|jD]}t|jd|d}t|dd}|dur'||d7}q |jj}t|dd}|durAt|d|d}ng}|||WStyTYdSw)Nrblock_itemsrIrf) rfrerr~rZ block0_values...
Python
1
its()); } crate::ExtensionType::StatisticValue => { ext.set_sv_name(ext_param.sv_name()); ext.set_sv_eom(ext_param.sv_eom()); ext.set_sv_final(ext_param.sv_is_final()); } _ => { ext.set_pc_type(ext_param.pc_t...
Rust
0
we can do is check that the // new image is decodable. return Ok(output); } } eprintln!( "The resulting image is corrupted and will not be outputted.\nThis is a bug! Please report it at https://github.com/shssoichiro/oxipng/issues" ); Err(PngError::new("The resu...
Rust
0
e::MAX; let url = Url::parse(&format!( "http://localhost/api/v1/stream/{}?witness_begin={}&msg_begin={}", DST_SUBNET, witness_begin, msg_begin )) .unwrap(); let response = route_request( url, &*fixture.state_manager, &XNetEndpointMetrics::new(&fixture.metrics), ...
Rust
0
""" .. image:: https://img.shields.io/badge/classification-yes-brightgreen?style=flat-square :alt: classification badge .. image:: https://img.shields.io/badge/segmentation-yes-brightgreen?style=flat-square :alt: classification badge .. autoclass:: pytorch_ood.detector.MaxLogit :members: :exclude-member...
Python
1
kCreateInstance CreateInstance{ nullptr };', file=self.outFile ) write( ' PFN_vkCreateDevice CreateDevice{ nullptr };', file=self.outFile ) def endFile(self): """Method override.""" KhronosDispatchTableGenerator.generateDispatchTable(se...
Python
1
output_key="answer" ) print("Chat chain setup complete") except Exception as e: print(f"Error in setup_chain: {str(e)}") raise def chat(self, query: str) -> str: """Process a user query and return the response""" if not hasattr(se...
Python
1
ode(&mut d)?), EncodingTag::U16 => Revealed::U16(u16::strict_decode(&mut d)?), EncodingTag::U32 => Revealed::U32(u32::strict_decode(&mut d)?), EncodingTag::U64 => Revealed::U64(u64::strict_decode(&mut d)?), // EncodingTag::U128 => Value::U128(u128::strict_...
Rust
0
llier'] total_params = enc_tools['total_params'] return paillier_dec(cipher_list,cls_paillier,total_params,args) elif args.algorithm == 'bfv': bfv_file = os.path.join(args.data_dir + 'bfv_ctx') with open(bfv_file, "rb") as f: params = f.read() bfv_ctx = ts.contex...
Python
1
coords, bond_inds) nfrags = len(frags) nexcs = len(all_energies) - 1 assert ct_numbers.shape == (nexcs, nfrags, nfrags) spectrum = spectrum_from_ens_fosc(all_energies, foscs) exc_ens = spectrum.exc_ens exc_ens_nm = spectrum.exc_ens_nm foscs = spectrum.fosc fosc_max = max(foscs.max() *...
Python
1
ename: &str) -> Vec<u64> { // open file let path = Path::new(filename); let path_display = path.display(); let mut file = match File::open(&path) { Err(why) => panic!("could not open {}: {}", path_display, why), Ok(file) => file, }; // read file contents into a string let mu...
Rust
0
from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from Crypto.Random import get_random_bytes plaintext = b"This is a sample text for encryption mode test. It should be at least 64 bytes long." assert len(plaintext) >= 64 key = b'`DE\x92\xda\xbbn\x05\xc8c\x9e\xc1\xbd\xe7\xf1\xab' iv = b'\xddN\x...
Python
1
Sets the weight (or boldness) of the font. Returns ------- Font """ super(Font, self).__init__("font") if "_parent" in kwargs: self._parent = kwargs["_parent"] return # Validate arg # ------------ if arg is None:...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ x509-vacuumer.py: search for x509 certificates and store them in storedsafe. """
Python
1
.map(|check| check.name().to_string()) .collect() } pub fn run(lines: &[LineEntry], skip_checks: &[&str]) -> Vec<Warning> { let mut checks = checklist(); // Skip checks with the --skip argument (globally) checks.retain(|c| !skip_checks.contains(&c.name())); // Skip checks with commen...
Rust
0