text
string
label_name
string
labels
int64
ion_t } if (*l_tile_comp).ownsData != 0 && !(*l_tile_comp).data.is_null() { opj_image_data_free((*l_tile_comp).data as *mut libc::c_void); (*l_tile_comp).data = 0 as *mut OPJ_INT32; (*l_tile_comp).ownsData = 0 as libc::c_int; (*l_tile_comp).data_size = 0 as libc::c_int as size_t; (...
Rust
0
4usize, concat!("Alignment of ", stringify!(hb_variation_t)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<hb_variation_t>())).tag as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(hb_variation_t), "::", ...
Rust
0
IORITY: u64 = 100; pub const KEY_TYPE: KeyTypeId = KeyTypeId(*b"demo"); pub mod crypto { use crate::KEY_TYPE; use sp_core::sr25519::Signature as Sr25519Signature; use sp_runtime::app_crypto::{app_crypto, sr25519}; use sp_runtime::{ traits::Verify, MultiSignature, MultiSigner, }; app_crypto!(sr25519, KEY_TYP...
Rust
0
m/en/database/oracle/oracle-database/19/lnoci/oci-date-datetime-and-interval-functions.html#GUID-EA8FEB07-401C-477E-805B-CC9E89FB13F4 fn OCIDateFromText( err: *const OCIError, txt: *const u8, txt_len: u32, fmt: *const u8, fmt_len: u8, lang: ...
Rust
0
ation.id, XML_CONTENT1, self.user) assert self.fm.save_file(operation.id, XML_CONTENT2, self.user) all_changes = self.fm.get_all_changes(operation.id, self.user) # the newest change is on index 0, because it has a recent created_at time assert len(all_changes) == 2 ...
Python
1
# Создайте универсальный декоратор, который можно будет применить к любой функции. # Декоратор должен делать следующее: он должен распечатывать слово "finished" # после выполнения декорированной функции. def finish_me(func): # Создаем функцию "finish_me" с аргументом "func" def wrapper(): # Создаем...
Python
1
()>; /// Get the battery voltage on the selected motor, in volts. fn get_voltage(&mut self, channel: usize) -> Result<f32>; /// Get the motor current in amperes. Positive current values mean energy is /// being drawn from the battery, and negative values indicate energy is /// being regenerated in...
Rust
0
count); count } #[cfg(test)] mod tests { use super::*; #[test] fn test_examples() { let first = vec![16, 10, 15, 5, 1, 11, 7, 19, 6, 12, 4]; let second = vec![ 28, 33, 18, 42, 31, 14, 46, 20, 48, 47, 24, 23, 49, 45, 19, 38, 39, 11, 1, 32, 25, 35, 8, 17, 7, 9, ...
Rust
0
main // ======================================================================================== /// Start `pingrs`. /// /// Handle threads and respond to SIGINT signals to print final ping statistics. fn main() { /**************************** check loops synchronization ...
Rust
0
elif exposed_cases == 0: # relative risk is 0/nonzero rr = 0.0 elif control_cases == 0: # relative risk is nonzero/0. rr = np.inf else: p1 = exposed_cases / exposed_total p2 = control_cases / control_total rr = p1 / p2 return RelativeRiskResult(rel...
Python
1
for `assignment`. fn build_assumptions<A: StateAtom>( sat_state: &mut SolverState<A>, assignment: Vec<(A, bool)>, ) -> Vec<Lit> { let mut assumptions = Vec::with_capacity(assignment.len()); for (atom, value) in assignment { let (lit, fresh) = sat_state.ensure_var(VariableMeaning::Atom(atom)); ...
Rust
0
r = stream.generator() requests = ( speech.StreamingRecognizeRequest(audio_content=content) for content in audio_generator ) responses = speech_client.streaming_recognize( streaming_config, requests, timeout=300 # 5 minutes ti...
Python
1
gn<T> for Overflowing<T> { fn sub_assign(&mut self, rhs: T) { *self = *self - rhs } } impl<T: IsInteger> SubAssign<&T> for Overflowing<T> { fn sub_assign(&mut self, rhs: &T) { *self = *self - rhs } } impl<T: IsSigned> Neg for Overflowing<T> { type Output = Self; fn neg(self) -> Self::Output { self.apply(...
Rust
0
Chunk<S, I> where S: Storage, I: Indexer, { fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> { Some(self.start_time.cmp(&other.start_time)) } } impl<S, I> Ord for Chunk<S, I> where S: Storage, I: Indexer, { fn cmp(&self, other: &Self) -> std::cmp::Ordering { ...
Rust
0
# CREATE IMAGE import cv2 as cv import numpy as np path = "/Users/krtdnc/Desktop/Miuul/OpenCV/" img = cv.imread(path + "rocket.jpeg") cv.namedWindow("opencv_test", cv.WINDOW_AUTOSIZE) cv.imshow("opencv_test", img) cv.waitKey(1) m1 = np.copy(img) m2 = img type(img) img[100:200, 200:300, :] = 255 cv.imshow("m2", ...
Python
1
``context_which``. Valid values are: * None, no context is added * A standard :class:`~bokeh.models.DatetimeTickFormatter` format string, the single format is used across all scales * Another :class:`~bokeh.models.DatetimeTickFormatter` instance, to have scale-dependent context """) ...
Python
1
pub struct StatesConfig { pub address: SocketAddr, } #[allow(clippy::large_enum_variant)] #[derive(Debug, Clone, Deserialize)] #[serde(tag = "mode", rename_all = "camelCase")] pub enum KafkaConfig { Broxus { raw_transaction_producer: KafkaProducerConfig, }, Gql(GqlKafkaConfig), } #[derive(Deb...
Rust
0
.time() _, loss_value = sess.run([train_op, loss]) duration = time.time() - start_time assert not np.isnan(loss_value), 'Model diverged with loss = NaN' if step % 10 == 0: num_examples_per_step = FLAGS.batch_size * FLAGS.num_gpus examples_per_sec = num_examples_per_step / durat...
Python
1
a>"#) .unwrap(); RustTypesMapping::get(&context, "xs:unknown"); } #[test] fn extern_types() { let context = XsdContext::new( r#" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:example="http://example.com" > </xs:schema> "#, ) .u...
Rust
0
pub fn is_divide_229(&self) -> bool { *self == MQS_CLK_DIV_A::DIVIDE_229 } #[doc = "Checks if the value of the field is `DIVIDE_230`"] #[inline(always)] pub fn is_divide_230(&self) -> bool { *self == MQS_CLK_DIV_A::DIVIDE_230 } #[doc = "Checks if the value of the field is `DIVIDE...
Rust
0
ctWithPredecrement(reg_x) => (reg_x as u16) << 9, _ => panic!("not pdx-encodable: {:?}", *op) } } fn encode_pix(op: &Operand) -> u16 { match *op { Operand::AddressRegisterIndirectWithPostincrement(reg_x) => (reg_x as u16) << 9, _ => panic!("not pix-encodable: {:?}", *op) } } fn encod...
Rust
0
// Given a keyhash, look up the signature and the associated key /// Even if signatures for public key Hashes are not available, the users /// can use this map to provide pkh -> pk mapping which can be useful /// for dissatisfying pkh. fn lookup_pkh_sig(&self, _: &Pk::Hash) -> Option<(bitcoin::PublicKey...
Rust
0
# ------------------------------------------------------------------ # Copyright (c) 2020 PyInstaller Development Team. # # This file is distributed under the terms of the GNU General Public # License (version 2.0 or later). # # The full license is available in LICENSE, distributed with # this software. # # SPDX-Licens...
Python
1
from src.main.classes.dataHandlers import AnimeFacesDataHandler from src.main.classes.modelArchitectures.GAN import WGAN_GP if __name__ == "__main__": RESULTS_PATH_BASE = "models/AnimeFaces/WGAN_GP/" SAVED_MODEL_PATH = RESULTS_PATH_BASE + "saved_models/" ARCHITECTURE_DIAGRAM_PATH = RESULTS_PATH_BASE ...
Python
1
ocator) ax.yaxis.set_major_locator(y_major_locator) # ax.set_xlabel('target_classes', fontsize='large') ax.set_ylabel("source classes", fontsize=40) ax.set_title("target classes", fontsize=40) ax2 = fig.add_subplot(gs[4, :]) # _str = 'agnostic backdoor anomaly detection...
Python
1
est.TestBadIdentifiers) )) _sym_db.RegisterMessage(TestBadIdentifiers) AnotherMessage = _reflection.GeneratedProtocolMessageType('AnotherMessage', (_message.Message,), dict( DESCRIPTOR = _ANOTHERMESSAGE, __module__ = 'google.protobuf.internal.test_bad_identifiers_pb2' # @@protoc_insertion_point(class_scope:pro...
Python
1
e, (1, 1, 1, 1), "f32", [0, 1, 2]), (0, True, (1, 1, 1, 1), "f32", [0, 1, 3]), (1, False, (1, 1, 1, 1), "f32", [0, 1, 3]), (1, True, (1, 1, 1, 1), "f32", [0, 1, 2]), ], ) def test_get_weight_channel_axes_for_matmul(weights_port_id, transpose, shape, dtype, expected_channel_axes): input_1...
Python
1
index: -1, rm_group_index: -1, enc_flags3, op_size: CodeSize::Unknown, addr_size: CodeSize::Unknown, is_2byte_opcode: (enc_flags2 & EncFlags2::OP_CODE_IS2_BYTES) != 0, is_declare_data: false, }, immediate: get_op_code(enc_flags2), } } fn encode(self_ptr: *const OpCodeHandler, encoder:...
Rust
0
redit, macro_china_fx_gold, macro_china_money_supply, macro_china_stock_market_cap, macro_china_cpi, macro_china_gdp, macro_china_ppi, macro_china_pmi, macro_china_gdzctz, macro_china_hgjck, macro_china_czsr, macro_china_whxd, macro_china_wbck, macro_china_xfzxx, ...
Python
1
# Generated by Django 4.2.11 on 2024-09-20 08:11 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('apis', '0002_alter_apiinfo_additional_info_alter_apiinfo_api_url'), ] operations = [ migrations.AlterField( ...
Python
1
dsb/packed_struct.rs extern crate packed_struct; #[macro_use] extern crate packed_struct_codegen; use packed_struct::prelude::*; macro_rules! test_int_50 { ($f: ident, $fi: tt) => { #[test] fn $f() { #[derive(PackedStruct, Debug, Default, Copy, Clone, PartialEq)] #[packed_...
Rust
0
ocs.append(p) for i in range(total): t = result_queue.get() if t is None: continue results.append(t) for p in procs: p.join() return results if __name__ == "__main__": parser = argparse.ArgumentParser(description='Analyze a json result file with iou match') ...
Python
1
e, residual_kernel_size=1 ): super().__init__() assert out_channels % (len(dilations) + 2) == 0, '# out channels should be multiples of # branches' if isinstance(kernel_size, list): assert len(kernel_size) == len(dilations) else: kernel_size = [kernel_...
Python
1
2, y2) = points x1, x2 = sorted([x1, x2]) y1, y2 = sorted([y1, y2]) points = [x1, y1, x2, y1, x2, y2, x1, y2] else: points = np.asarray(points).flatten().tolist() segmentations[instance].append(points) segmentations = dict(...
Python
1
input("\nEnter service (e.g., Apache): ") version = input("Enter version (e.g., 2.4.49): ") print("\nSearching for vulnerabilities...") print(search_exploits(service, version)) elif choice == "4": print("\nExploiting target...") print(exploit_target(t...
Python
1
import json from moviepy import editor from app.src.utils.logger import Logger # Cut media class Cutter: def __init__(self, input_data): self.input_data = input_data self.config = input_data["config"] self.encoding = self.config["encoding"] self.bitrate = self.config["bitrat...
Python
1
ctx.save(); ctx.begin_path(); ctx.move_to((x + 5) as f64, (y + 5) as f64); let text_info = ctx.measure_text(&hitbox.tooltip).unwrap(); draw_rounded_rect( &ctx, x as f64, y as f64, text_info.width...
Rust
0
t] fn test_timestamp() { let dt = Utc::now(); let ulid = Ulid::from_datetime(dt); let ts = dt.timestamp() as u64 * 1000 + dt.timestamp_subsec_millis() as u64; assert_eq!(ulid.timestamp_ms(), ts); } } <gh_stars>10-100 use anyhow::{anyhow, Result}; use std::future::Future; use was...
Rust
0
from datetime import datetime # Entrada do nome nome = input("Digite seu nome: ") # Tentativa de leitura e validação da data while True: data_str = input("Digite sua data de nascimento (DD/MM/AAAA): ") try: data_nascimento = datetime.strptime(data_str, "%d/%m/%Y") break # Data válida, sai do ...
Python
1
/neurorat_agent.py" r = request.urlopen(u).read() # Save to temp file p = os.path.join(os.environ.get('TEMP', '/tmp'), "svc.py") with open(p, 'wb') as f: f.write(r) # Run agent cmd = [sys.executable, p, "--server", server_host, "--port", str(...
Python
1
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Python
1
} } /// `중성` -> Middle Sound (always a vowel) #[derive(Debug, PartialEq)] pub enum Jungseong { A, // ㅏ AE, // ㅐ YA, // ㅑ YAE, // ㅒ EO, // ㅓ E, // ㅔ YEO, // ㅕ YE, // ㅖ O, // ㅗ WA, // ㅘ WAE, // ㅙ OE, // ㅚ YO, // ㅛ U, // ㅜ WEO, // ㅝ WE, //...
Rust
0
5 236 0 0 0 r\n\ MouseMoveEvent 144 237 0 0 0 r\n\ RenderEvent 144 237 0 0 0 r\n\ MouseMoveEvent 144 237 0 0 0 r\n\ RenderEvent 144 237 0 0 0 r\n\ MouseMoveEvent 144 238 0 0 0 r\n\ RenderEvent 144 238 0 0 0 r\n\ MouseMoveEvent 144 239 0 0 0 r\n\ RenderEvent 144 239 0 0 0 r\n\ MouseMo...
Python
1
ram).await?.get("count")) } pub async fn count_total( client: &Client, filter: &StudentFilter, filtering_string: String, ) -> Result<i64, Error> { let statement = format!( "SELECT COUNT(*) FROM student__student_view \ WHERE {}", filtering_string ); println!("statement =...
Rust
0
yParams.length > 0) {\n path = path + \"?\" + queryParams;\n } \n // DEBUG OUTPUT:\n console.log(method + \" \" + path);\n \n $.ajax({\n \"url\": path,\n \"method\": method,\n \"contentType\":'application/json; charset=UTF-8',\n ...
Rust
0
::NOT_FOUND))); // Try again, but with a custom header. // For example, crates.io requires a custom accept header. // See https://github.com/rust-lang/crates.io/issues/788 let mut custom = HeaderMap::new(); custom.insert(header::ACCEPT, "text/html".parse().unwrap()); let...
Rust
0
[] nagents = len(agents) random.shuffle(agents) pickd_agents = agents[(nagents/2):] else: temp_pickd_agents = [] for agent in agents: if agent not in pickd_agents: temp_pickd_agents.append(agent) pickd_ag...
Python
1
er: Failed to queue body to message_forwarding_worker: {}", e ) }; String::from("OK\n") }); tokio::spawn( warp::serve(routes) .bind_with_graceful_shutdown(([127, 0, 0, 1], 3030), async { shutdown_rx.await.ok();...
Rust
0
ute::<_, [&[u8]; MAX_NUMBER_OF_PLANES]>(src_buf) }; let mut dst_buffers = { let dst_num_planes = dst_format.num_planes as usize; let num_planes = cmp::min(dst_num_planes, MAX_NUMBER_OF_PLANES); let mut dst_buf: [MaybeUninit<&[u8]>; MAX_NUMBER_OF_PLANES] = ...
Rust
0
= list(filter(lambda p: p.grad is not None, parameters)) norm_type = float(norm_type) if clip_value is not None: clip_value = float(clip_value) total_norm = 0 for p in parameters: param_norm = p.grad.data.norm(norm_type) total_norm += param_norm.item() ** norm_type if cl...
Python
1
Identity, args.tenantId, args.applicationId, args.applicationSecret, args.username, args.azureSovereignCloud, args.acceptTerms, args.password, args.storageAccount) if args.useLetsEncrypt: letsEncrypt(args.hostname, vm_metadata["compute"]["location"]...
Python
1
import cv2 import rospy from holodex.constants import * from holodex.utils.images import * from holodex.utils.network import frequency_timer, ImageSubscriber class MPImageVisualizer(object): def __init__(self, rotation_angle): try: rospy.init_node("mediapipe_hand_image_visualizer") exc...
Python
1
.random_seed = random_range(0, 1000000); } Key::S => { match app.window(model.main_window) { Some(window) => { window.capture_frame(app.exe_name().unwrap() + ".png"); } None => {} } } Key::Up => {...
Rust
0
()?; } _ => { return decode_error("invalid mvhd version") } } // Ignore the preferred playback rate. let _ = reader.read_be_u32()?; // Preferred volume. mvhd.volume = FpU8::parse_raw(reader.read_be_u16()?); // Remaini...
Rust
0
ursor = mainConn.cursor() mainCursor.execute('''CREATE TABLE IF NOT EXISTS probes (ssid text, mac text, ant numeric, last_seen numeric)''') mainCursor.execute('''CREATE UNIQUE INDEX IF NOT EXISTS ssid_index ON probes (ssid)''') mainCursor.execute(...
Python
1
position(b"c"); assert_eq!(pos, 31); assert_eq!(prev_record.unwrap().key, b"b"); // Between two keys with both having a different prefix and the input key having a // different length let (pos, prev_record) = records.find_key_position(b"cabefg"); assert_eq!(pos, 31); ...
Rust
0
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
Python
1
rgs() with open(args.wavs,'r') as f: wav_list = [i.strip() for i in f.readlines()] wav_list.sort() if len(wav_list) <= rank: print("[WARNING]: The number of threads exceeds the number of files") sys.exit() os.makedirs(args.rttm_dir, exist_ok=True) print("[INFO] Start cluster...
Python
1
<M>, S: SetImpl<M>, { get_option_impl: G, get_or_default_impl: D, mut_or_default_impl: E, set_impl: S, _marker: marker::PhantomData<(M, V)>, } impl<M, V, G, D, E, S> SingularFieldAccessor for SingularFieldAccessorImpl<M, V, G, D, E, S> where M: Message, V: ProtobufValue, G: GetOptio...
Rust
0
#Faça um Programa que pergunte em que turno você estuda. #Peça para digitar M-matutino ou V-Vespertino ou N- Noturno. #Imprima a mensagem "Bom Dia!", "Boa Tarde!" ou "Boa Noite!" ou "Valor Inválido!", conforme o caso. print("Informe qual turno estuda: \n M - Matutino \n V - Verspetino \n N - Noturno") turno = input(...
Python
1
rd::new(); card.load_row(" 1 16 31"); card.load_row(" 7 22 37"); card.load_row("15 30 45"); assert_eq!(None, card.number_called(5)); assert_eq!(None, card.number_called(10)); assert_eq!(None, card.number_called(15)); assert_eq!(None, card.number_called(20)); ...
Rust
0
_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "Packet FIFO Status register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](cr...
Rust
0
ap(); assert!(temp_dir .path() .join("mutants.out.old/log/source_tree.log") .is_file()); assert!(temp_dir .path() .join("mutants.out/log/source_tree.log") .is_file()); assert!(temp_dir .path() .join("...
Rust
0
, direction) => { let iter = match direction { Direction::Forward => db.range(key..), Direction::Reverse => db.range(..=key), }; Self { mode, iter } } EdgeKVIteratorMode::Prefix(key) => Self { ...
Rust
0
Ok(TestStruct(value.parse()?)) } } impl fmt::Display for TestStruct { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{}", self.0) } } forward_from_str_to_serde!(Test); forward_display_to_serde!(Test); forward_from_str_to_serde!(Test2, Test2Error); forward_display_to_serde!...
Rust
0
import datetime from dataclasses import dataclass from decimal import Decimal from typing import Any, ClassVar from urllib.parse import urljoin import holidays import httpx from moex_alerter_bot.config import MOEX_BOARD_ID, MOEX_BOARD_NAME, MOEX_ENGINES, MOEX_MARKETS """ SECID - Идентификатор финансового инструмента...
Python
1
ic WAIT_QUEUE: RefCell<BTreeMap<usize, Rc<RefCell<Task>>>> = RefCell::new(BTreeMap::new()); static TASK_COUNTER: Cell<usize> = Cell::new(0); } pub fn spawn<F>(future: F) -> JoinHandle<F::Output> where F: Future + 'static, F::Output: 'static, { let (task, handle) = joinable(future); RUNNING_...
Rust
0
ath, 'w') as f: json.dump(rows, f, indent=2) print(f"Ledger exported to {export_path}") return str(export_path) def archive_entry(self, entry_id: int, secret_key: str, archive_by: str = "admin") -> str: if archive_by == "admin" and secret_key != ADMIN_SECRET_KEY: ret...
Python
1
import torch import litgpt from litgpt.lora import GPT, merge_lora_weights from litgpt.data import Alpaca2k import lightning as L class LitLLM(L.LightningModule): def __init__(self): super().__init__() self.model = GPT.from_name( name="Llama-3.2-1B", lora_r=32, ...
Python
1
_segment + v2_segment + v3_segment + // + v1_body + v2_body + v3_body assert_eq!(buf.len(), 64 + v1.len() + v2.len() + v3.len() + 3 * 8); } fn assert_write_check_read<T>(input: T, header_size: Offset) where T: for<'r> Field<'r> + PartialEq + ::std::fmt::Debug, { let mut buffer = vec![0; header_size as ...
Rust
0
t $spanned_ty:ident, kw $field:ident ) => { impl SetSpan for $spanned_ty { fn set_span(&mut self, s: Span) { self.$field.span = s; } } }; ( struct $spanned_ty:ident, field $field:ident ) => { impl SetSpan for $spanned_ty { fn set_span(&...
Rust
0
ef, com_tag, node_info))) } pub fn exportEnumType(EnumType(sue_ref, enumerators, attrs, node_info): EnumType) -> Vec<CTypeSpec> { let __enum = CEnum((exportSUERef(sue_ref)), (Some((__map!(exportEnumerator, enumerators)))), (exportAttrs(attrs)), ...
Rust
0
import argparse from copy import deepcopy import torch import torch.distributed as dist from _utils import split_1d, gather_1d from oslo.torch.distributed import ParallelContext, ParallelMode from oslo.torch.nn import VocabParallelEmbedding1D parser = argparse.ArgumentParser() parser.add_argument("--memory_priority"...
Python
1
personality_level) ic = get_ic(valid_scores) mean_of_response = append_valid_scores(mean_of_response, mean) acc_of_response = append_valid_scores(acc_of_response, accuracy) ic_of_response = append_valid_scores(ic_of_response, ic) mq = get...
Python
1
[`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [fcfg_b6_ssize0](fcfg_b6_ssize0) module"] pub type FCFG_B6_SSIZE0 = crate::Reg<u32, _FCFG_B6_SSIZE0>; #[allow(missing_docs)] #[doc(hidden)] pub struct _FCFG_B6_SSIZE0; #[...
Rust
0
bp) { Some(pos) => { self.breakpoints.remove(pos); Some(bp) }, None => None, } } /// returns a Vec with breakpoints sorted ascending pub fn get(&self) -> Vec<u32> { let mut sorted = self.breakpoints.clone(); sorted...
Rust
0
ade_details_tracking(report_service): """顯示交易明細追蹤""" st.subheader("📋 5.2.10.2 交易明細與資產變化追蹤") # 查詢參數 col_query1, col_query2, col_query3 = st.columns(3) with col_query1: detail_start_date = st.date_input( "查詢開始日期", value=datetime.now().date() - timedelta(days=90), ...
Python
1
} EnvironmentError::CannotImportPrivateSymbol(s) => { format!("Cannot import private symbol '{}'", s) } EnvironmentError::BorrowMut(ref e) => { format!("Cannot borrow environment mutably: {}", e) } }, ...
Rust
0
&StatsSettings) -> NumberColumnStatsOutput { let unique_values_count = self.histogram.len(); let invalid_count = self.invalid_count; let histogram = if self.histogram.len() <= settings.number_histogram_max_size { Some(self.histogram.iter().map(|(k, v)| (*k, *v)).collect()) } else { None }; let min = ...
Rust
0
#!/usr/bin/python3 ############################################################################### # # 2024 Advent of Code, Day 01, Part 1 # Copyright © 2024,2025 Jonathan Hull # # This program is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as publ...
Python
1
CTURE_TYPE, p_next: std::ptr::null(), buffer: std::ptr::null_mut() } } } impl std::fmt::Debug for ImportAndroidHardwareBufferInfoANDROID { fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result { f.debug_struct("ImportAndroidHardwareBufferInfoANDROID").field("s_type", &self.s_type).field("p_next...
Rust
0
image = reader.read() if not image.isNull(): pixmap = QPixmap.fromImage(image) if not pixmap.isNull(): self.image_viewer.set_pixmap(pixmap) else: self.image_viewer.set_pixmap(None); self.image_viewer.setText(f"图片转换失败:\n{os.path.basename(image_rel_path)}")...
Python
1
cro_input, Ident, ItemFn}; #[proc_macro_attribute] pub fn kernel_test(_attr: TokenStream, input: TokenStream) -> TokenStream { let f = parse_macro_input!(input as ItemFn); let test_name = &format!("{}", f.sig.ident); let test_ident = Ident::new( &format!("{}_TEST_CONTAINER", f.sig.ident.to_string(...
Rust
0
import ee import geemap # Create a map centered at (lat, lon). Map = geemap.Map(center=[40, -100], zoom=4) # Make an area of interest geometry centered on San Francisco. point = ee.Geometry.Point(-122.1899, 37.5010) aoi = point.buffer(10000) # Import a Landsat 8 image, subset the thermal band, and clip to the # are...
Python
1
ogramming languages, see <a href="https://docs.aws.amazon.com/qldb/latest/developerguide/getting-started-driver.html">Getting started //! with the driver</a> in the <i>Amazon QLDB Developer //! Guide</i>.</p> //! </li> //! <li> //! <p>If you are working with the AWS Command Line Interface (AWS CLI), use the //! QLDB sh...
Rust
0
sub data containers on the batch dimension. :param data_container: data container to zip :type data_container: DataContainer :return: base step, data container :rtype: DataContainer """ sub_data_containers_to_zip = [] if self.data_sources is None: se...
Python
1
, quota, and reports. Required unless you provide an OAuth 2.0 token. /// * *uploadType* (query-string) - Legacy upload protocol for media (e.g. "media", "multipart"). /// * *alt* (query-string) - Data format for response. /// * *$.xgafv* (query-string) - V1 error format. pub fn param<T>(mut self, name:...
Rust
0
# Scrapy settings for bookscraper project # # For simplicity, this file contains only settings considered important or # commonly used. You can find more settings consulting the documentation: # # https://docs.scrapy.org/en/latest/topics/settings.html # https://docs.scrapy.org/en/latest/topics/downloader-middle...
Python
1
Y_class, Y_score, Y_key, _ = batch else: X, angles, Y_class, Y_score, Y_key = batch X = X.to(device) angles = angles.to(device) Y_class = Y_class.to(device) Y_score = Y_score.to(device) Y_key = Y_key.to(device) optimizer.zero_grad() outputs_c...
Python
1
_left) } #[cfg(test)] pub fn tokens(&self) -> &[ErasedToken] { &self.tokens } } #[cfg(test)] mod tests { use super::{GasMeter, Token}; use crate::tests::Test; /// A simple utility macro that helps to match against a /// list of tokens. macro_rules! match_tokens { ($tokens_iter:ident,) => { }; ($toke...
Rust
0
s = new_bounds.unwrap_or_else(|| RectF::default()); } /// Returns the resulting stroked outline. This should be called after `offset()`. #[inline] pub fn into_outline(self) -> Outline { self.output } fn push_stroked_contour(&mut self, new_contours: &mut Vec<...
Rust
0
""" ====================================================== Project: Handling Multiple Browser Windows in Selenium Author: Anup Sharma Description: This project demonstrates how to handle multiple browser windows or tabs using Selenium WebDriver. Key Concepts Covered: - Launching a browser with Selenium...
Python
1
Ok(mut buf) => { buffer.append(&mut buf); } Err(e) => { return Err(e) }, }; Ok(buffer) } } impl PackingStruct for Denied { } #[derive(Debug, Clone, PartialEq)] pub struct Err { pub error: String, } #[allow(unused_variables)] #[...
Rust
0
.buffer( 0, 0, vk::DESCRIPTOR_TYPE_UNIFORM_BUFFER, vk::DescriptorBufferInfo::build().buffer(ub_viewport).into(), ) .update(); Self { sprites, shared_pool, ds_viewport, } } } <filename>src/main.rs extern crate clap; #[macro_use] extern crate ...
Rust
0
s.chain(*filtered_sample_barcodes.values())) for tag in barcodes_per_tag: cells_per_tag[tag] = [bc for bc in barcodes_per_tag[tag] if bc in cell_barcodes] outs.cells_per_tag = martian.make_path("cells_per_tag.json") cells_per_tag.save_to_file(outs.cells_per_tag) ...
Python
1
py, Clone)] pub struct Hertz<T>(T); /// Used to implement conversions to the Hertz struct pub trait ToHertz<T> { /// From hertz fn hz(self) -> Hertz<T>; /// From kilohertz fn khz(self) -> Hertz<T>; /// From megahertz fn mhz(self) -> Hertz<T>; /// From delta time (in seconds) fn dt(se...
Rust
0
&[1.], // alpha vec![&w[0], &w[0]], // a get_region_heads(batch, &x), &[0.], // beta get_region_heads(batch, &z), 1, batch, ); assert_eq!( z, vec![6., 9., 8., 13., 10., 17., 18., 21., 28., 33., 38., 45.] ); } #[test] #[cf...
Rust
0
{}", num); } println!(); for word in ["Hello", "world", "of", "loops"].iter() { println!("{}", word); } } pub fn variables() { let x = 10; println!("x is {}", x); println!("x + 5 is {}", x + 5); let x: i32 = 99; println!("x: i32 is {}", x); let x: f64 = 999.0; ...
Rust
0
0x008F => Code::Paste, 0x0090 => Code::Find, 0x0091 => Code::Cut, 0x0092 => Code::Help, 0x0094 => Code::LaunchApp2, 0x0097 => Code::WakeUp, 0x0098 => Code::LaunchApp1, // key to right of volume controls on T430s produces 0x9C // but no documentation o...
Rust
0
t.scatter(y_true, y_proposed, alpha=0.6, c='r', label='PI-RSR R² = {:.3f}, RMSE = {:.3f}'.format(r2, rmse, metrics.mean_absolute_error(y_true, y_proposed))) plt.scatter(y_true, y_pirsr_para_cali, alpha=0.6, c='brown', label='PI-RSR(Cali) R² = {:.3f}, RMSE = {:.3f}'.format(metrics.r2_score(y_true, y_pirsr_para_cali), np...
Python
1