text
string
label_name
string
labels
int64
om sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use...
Python
1
from google.cloud import firestore from Backend.models.receipt import Receipt db = firestore.Client() collection_name = "receipts" class ReceiptRepository: @staticmethod def create_receipt(receipt: Receipt): doc_ref = db.collection(collection_name).document() receipt.processed_at = receipt.pro...
Python
1
bc!(pthread_key_create()); rsix::io::write(&rsix::io::stderr(), b"unimplemented: pthread_key_create\n").ok(); 0 } #[cfg(feature = "threads")] #[inline(never)] #[link_section = ".text.__mustang"] #[no_mangle] unsafe extern "C" fn pthread_key_delete() -> c_int { //libc!(pthread_key_delete()); rsix::io::w...
Rust
0
import asyncio import pytest import ucp @pytest.mark.asyncio @pytest.mark.parametrize("transfer_api", ["am", "tag"]) async def test_message_probe(transfer_api): msg = bytearray(b"0" * 10) async def server_node(ep): # Wait for remote endpoint to close before probing the endpoint for # in-tra...
Python
1
contact.", } request = helpers.get_request(journal=self.journal_one) request.POST = post_data form = forms.ArticleInfo( data=post_data, instance=self.article, ) if form.is_valid(): form.save( request=request, ...
Python
1
s Source License // included in the LICENSE file. // // As of the Change Date specified in that file, in accordance with // the Business Source License, use of this software will be governed // by the Apache License, Version 2.0. //! TBD: Currently, `sql::func` handles matching arguments to their respective //! built-...
Rust
0
#!/usr/bin/env python3 """ Production startup script for the Discord Personal Data Bot. Includes validation, monitoring, and graceful shutdown handling. """ import sys import os import signal import logging import asyncio from pathlib import Path # Add current directory to path for imports sys.path.insert(0, str(Path...
Python
1
stringify!(RealList) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<OGRField>())).StringList as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(OGRField), "::", stringify!(StringList) ) )...
Rust
0
pub fn has_manager(&self) -> bool { // Relaxed is fine here since there is always a bit of a race condition // when using this method (and then doing something based on it). has_manager(self.channel().ref_count.load(Ordering::Relaxed)) } /// Set the receiver's waker to `waker`, if they ...
Rust
0
kPipelineColorBlendAttachmentState { blendEnable: VkBool32, srcColorBlendFactor: VkBlendFactor, dstColorBlendFactor: VkBlendFactor, colorBlendOp: VkBlendOp, srcAlphaBlendFactor: VkBlendFactor, dstAlphaBlendFactor: VkBlendFactor, alphaBlendOp: VkBlendOp, /// /// * **Optional:** true colorWriteMask: V...
Rust
0
(); } mod x { #[test] fn foo() { #[test] //~ ERROR cannot test inner items [unnameable_test_items] fn bar() {} bar(); } } fn main() {} /* TODO Bugs: When placing cells near the bottom of the screen, the cells are a few units lower than they should be. This happens becau...
Rust
0
g.fit(X_train, np.ravel(y_train)) y_pred = reg.predict(X_test) me, mse = get_mean_squared_error(y_test, y_pred) r2 = get_r2_score(y_test, y_pred) return me, mse, r2 # trains the randon forest regression model def get_random_forest_reg(X_train, X_test, y_train, y_test): reg = RandomForestRegressor(max_depth=2, ran...
Python
1
from playwright.sync_api import Playwright, sync_playwright from undetected_playwright import stealth_sync import time def run(playwright: Playwright) -> None: browser = playwright.chromium.launch(headless=False) context = browser.new_context() stealth_sync(context) page = context.new_page() # go...
Python
1
[u8; 8usize], #[doc = "0x14 - AHB Mask"] pub ahbmask: AHBMASK, #[doc = "0x18 - APBA Mask"] pub apbamask: APBAMASK, #[doc = "0x1c - APBB Mask"] pub apbbmask: APBBMASK, #[doc = "0x20 - APBC Mask"] pub apbcmask: APBCMASK, _reserved10: [u8; 16usize], #[doc = "0x34 - Interrupt Enable...
Rust
0
9c\xb5\ \xf1,9\xf6j\xb5T:#?\x00\xd4$\x1czd\ 9\x1b\xed}\xe3g\x89\xddZ\x11\xcb\xaa\xf8\x8aJ\xff\ \xa5^\xee\xca\x89\xady;\x83\x9d\x0dI\x82l\xd7\xee\ \x22\x8d\xe4\x82\x1e\xef\x99\xd6I.tvp\xe0\xf0\xfa\ ?\xe9\xf5I\x82\x90\xf0\xc3=\x1b\xe2\x98\xa8\xedI[\ 8\x1f\x81\xf2\x7f\xbe>uc\xd3.\xa6{\x9e0S\ \xbf.S\xdb\xd9\x8b\x8f\xf8Y\xc...
Python
1
if list.is_match(&line) { return Ok(GeminiLine { line_type: LineType::UnorderedList, text: line, url: None, }); } Ok(GeminiLine { line_type: LineType::Text, text: line, url: None, ...
Rust
0
from abc import ABC from .private_torrent import PrivateTorrent from ..base.entry import SignInEntry from ..base.sign_in import check_final_state, SignState from ..base.work import Work from ..utils.net_utils import get_module_name from ..utils.value_handler import handle_infinite class XWT(PrivateTorrent, ABC): ...
Python
1
libro "genero": libro[3], # Género del libro "edicion": libro[4], # Edición del libro "paginas": libro[5], # Número de páginas "imagen": libro[6], # URL de la imagen "link": libro[7] # URL del libro } for libro in libros] ...
Python
1
count: usize) -> Result<Self> { let mut buffer = vec![0; count]; ::std::io::Read::read_exact(tape, &mut buffer)?; Ok(buffer) } } }; } walue!(Vec<u8>, 1); <filename>src/options/pane_options.rs use crate::{Error, Switch}; use crate::{SetOption, Sho...
Rust
0
#!/usr/bin/env python3 """ Milvus 实现验证脚本 验证 Milvus 集成的完整性和功能 """ import os import sys import subprocess from pathlib import Path from typing import List, Dict, Any def run_command(cmd: List[str], cwd: str = None) -> tuple[int, str, str]: """运行命令并返回结果""" try: result = subprocess.run( cmd, ...
Python
1
from mido import MidiFile, MidiTrack, Message from keras.layers import LSTM, Dense, Activation, Dropout from keras.preprocessing import sequence from keras.models import Sequential from keras.optimizers import RMSprop from sklearn.preprocessing import MinMaxScaler import numpy as np import mido ########### PROCESS MID...
Python
1
}) .any(|r| { for hash in hashes.iter() { if r.access.exists(hash) { return true; } } return false; }) ...
Rust
0
-1, 0.166_666_666_666_649_754_3, ) * (x2 * x.0); let y = dd( 3.141_592_653_589_793_116 / 4., 1.224_646_799_147_353_207_2_e-16 / 4., ) .sub_checked(x) .add_checked(-u); let r = if o { u + x.0 } else { (y.0 + y.1) * 2. }; mulsign(r, d) } pub fn sin(d: f64) -> f64 { ...
Rust
0
Zd: 31, }) } #[test] fn roundtrip_SQSUB_z_zz() { assert_eq!(Instruction::SQSUB_z_zz { size: 3, Zm: 31, Zn: 31, Zd: 31, }.encode().decode(), Instruction::SQSUB_z_zz { size: 3, Zm: 31, Zn: 31, Zd: 31, }) } #[test] fn roundtrip_UQSUB_z_zz() { assert_eq!(Instruction::UQSUB_z_zz { size: 3, Zm: 31, ...
Rust
0
_GPCFG_DSIZE_4BIT, 1 => EPI_GPCFG_DSIZER::EPI_GPCFG_DSIZE_16BIT, 2 => EPI_GPCFG_DSIZER::EPI_GPCFG_DSIZE_24BIT, 3 => EPI_GPCFG_DSIZER::EPI_GPCFG_DSIZE_32BIT, _ => unreachable!(), } } #[doc = "Checks if the value of the field is `EPI_GPCFG_DSIZE_4BIT`"] ...
Rust
0
�ーの同期処理は実施されない. fn is_busy(&mut self) -> bool { false } } <gh_stars>0 mod access; mod index; mod keys; mod patch; mod records; mod table; pub use access::*; pub use index::*; pub use patch::*; pub use records::*; pub use table::*; <filename>network/src/tests/receiver_tests.rs<gh_stars>10-100 // Copyrig...
Rust
0
ject.key("ReplaceKeyWith").string(var_2888.as_str()); } Ok(()) } pub fn serialize_structure_crate_model_aws_s3_bucket_notification_configuration_filter( object: &mut aws_smithy_json::serialize::JsonObjectWriter, input: &crate::model::AwsS3BucketNotificationConfigurationFilter, ) -> Result<(), aws_smith...
Rust
0
h_and_import(MAX_DATA_BRANCH_LEN * 10) .await; let fork = chain_builder .build_branch_above(&blocks[2].header.hash(), MAX_DATA_BRANCH_LEN * 10) .await; for len in 1..=MAX_DATA_BRANCH_LEN { let fork_branch = fork[0..len].to_vec(); let proposal...
Rust
0
r::BinOp(BinOp::Mul), Instr::BinOp(BinOp::Minus), Instr::UnOp(UnOp::Sqrt), Instr::BinOp(BinOp::PlusMinus), Instr::Load("a"), Instr::Push(2), Instr::BinOp(BinOp::Div), ]; assert_eq!( debug3::pprint(&instrs), "\ [ Load(\"b\"), UnOp(Minus), ...
Rust
0
addditional info" field of the packet. msg_to_drop: MsgNumber, /// The range of sequence numbers in the message to drop range: RangeInclusive<SeqNumber>, }, // Peer error, type 0x8 PeerError(u32), /// Srt control packets /// These use the UDT extension type 0xFF Srt(Sr...
Rust
0
captures.get(1).unwrap().as_str().parse().unwrap(); Ok(Shuffle::Inc(n)) } else { panic!("unexpected shuffle: {}", s); } } } #[derive(Debug, Eq, PartialEq, Copy, Clone)] struct MulAdd(u128, u128); impl MulAdd { fn compose(self, other: MulAdd, modulo: u128) -> MulAdd { ...
Rust
0
-0.0, 50135040.0, -0.0, -5013504.0, -0.0, 131072.0, ]; const INFLOOP_18_HCF: f64 = 9280784638125.0; const INFLOOP_19: [f64; 20] = [ -0.0, -46189.0, -0.0, 2771340.0, -0.0,...
Rust
0
ature " "compatibility and support please visit https://www.mongodb.com/supportability/cosmosdb", ) return True for host in document_db_hosts: if entity.endswith(host): _log_or_warn( _CLIENT_LOGGER, "You appear to be connect...
Python
1
html.Div("{{ local_rendering_ready }}", classes="readyCount") client.Style( "body { margin: 0; } .readyCount { z-index: 10; position: absolute; left: 0; top: 0; }" ) with html.Div(style=FULL_SCREEN): self.html_view = vtklocal.LocalView( ...
Python
1
from random import choice, randint from math import ceil from models import Enemy, Explorator class FormigaQuimera(Enemy): NAME = 'Formiga Quimera' DESCRIPTION = 'São formigas destemidas e unidas, irritar uma é irritar todas.' __IN_RAGE = False def __init__(self) -> None: super().__init__(hp=...
Python
1
ra.append(cls_extra) if bboxes: bboxes = torch.cat(bboxes) labels = torch.cat(labels) extra = torch.cat(extra) if bboxes.shape[0] > max_num: _, inds = bboxes[:, -1].sort(descending=True) inds = inds[:max_num] bboxes = bboxes[inds] label...
Python
1
2147478616i32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const EVENT_NDIS_RESOURCE_CONFLICT: i32 = -1073736824i32; #[doc = "*Required features: `\"Win32_NetworkManagement_NetManagement\"`*"] pub const EVENT_NDIS_SIGNAL_LOSS_ERROR: i32 = -2147478620i32; #[doc = "*Required features: ...
Rust
0
let mut counter = i; let mut new_indices = cell_indices.clone(); for dim in (0..cell_indices.len()).rev() { let multiple = ONE_DIMENSION_NEIGHBOR_CELLS_COUNT.pow(dim as u32); let multiple_count = counter / multiple; let new_index = new_...
Rust
0
# console_llm/__init__.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- __version__ = "1.1.0" __author__ = "ConsoleLLM Team" __license__ = "MIT" import sys import os # 패키지 경로 설정 package_dir = os.path.dirname(os.path.abspath(__file__)) if package_dir not in sys.path: sys.path.insert(0, package_dir) try: fro...
Python
1
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": { "type": "spatial_description", "prompt": "Imagine a room that is 5 meters by 5 meters with a height of 3 meters. In the center of the room, there is a circular table with a di...
Python
1
str(), Some("bb") | Some("bbappend") ) { let stem = file_name.file_stem().unwrap().to_str().unwrap(); let parts = stem .split("_") .map(|part| part.to_string()) .collect::<Vec<_>>(); if parts.len() > 3 { ...
Rust
0
.common), ftd::Element::Image(e) => Some(&e.common), ftd::Element::IFrame(e) => Some(&e.common), ftd::Element::Input(e) => Some(&e.common), ftd::Element::Integer(e) => Some(&e.common), ftd::Element::Boolean(e) => Some(&e.common), ftd::Element::Deci...
Rust
0
laimer in the documentation and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote // products derived from this software without specific prior written permission. // // THIS SOFTWARE IS PROVIDED BY TH...
Rust
0
from . import all as _all from . import py2, py3, py27, py36, py37, py38, py39, py310, py311, py312, py313 __all__ = ( "_all", "py2", "py3", "py27", "py36", "py37", "py38", "py39", "py310", "py311", "py312", "py313", )
Python
1
import cv2 import os # Define the path to the video file and the output folder video_path = 'Pipeline dataset.mov' output_folder = 'images' # Make sure the output folder exists if not os.path.exists(output_folder): os.makedirs(output_folder) # Open the video file cap = cv2.VideoCapture(video_path) # Check if vi...
Python
1
features = None # TO DEFINE -> array-like of shape (n_individuals,n_features) targets = None # TO DEFINE -> array-like of shape (n_individuals,) sgd_lrate = None # TO DEFINE -> initial SGD learning rate preproc_steps = None # TO DEFINE -> array-like of sklearn transformers corresponding to the preprocessing dest_path =...
Python
1
elf, initial_val, loss_grad_func, equality_funcs, equality_grad_funcs, inequality_funcs, inequality_grad_funcs, packed_bounds, step_callback, optimizer_kwargs, ): def loss_grad_func_wrapper(x): # SciPy's L-BFGS-B Fortran imp...
Python
1
[orientation as usize].into() } /// Convert a Robocraft robot to a 3D model in Wavefront OBJ format. pub fn cubes_to_model(robot: robocraft::Cubes) -> obj::Obj { cubes_to_model_with_lut(robot, default_model_lut) } /// Convert a Robocraft robot to a 3D model in Wavefront OBJ format using the provided lookup table ...
Rust
0
error = OnErrorMode::from_str(on_error).map_err(ErrorCode::SyntaxException)?; } stage_info.copy_options.size_limit = *size_limit; } Ok(Plan::CreateStage(Box::new(CreateUserStagePlan { if_not_exists: *if_not_exists, tenant: self.ctx.ge...
Rust
0
nt = os.cpu_count() pool = Pool(worker_count) cluster_labels = sorted(cluster_masks.keys(), key=lambda label: cluster_masks[label].shape[0], reverse=True) print('The largest cluster contains {:d} points (should be < 100k)'.format(cluster_masks[cluster_labels[0]].shape[0])) print("Using {:d} processes."...
Python
1
::mem::size_of::<usize>(); assert_size!(8 + ptr_size * 4, VkDescriptorSetAllocateInfo); } #[doc(hidden)] #[derive(Copy, Clone)] pub enum VkDescriptorSet__ {} /// Opaque handle to a descriptor set object pub type VkDescriptorSet<'l> = VkNonDispatchableHandle<'l, VkDescriptorSet__>; /// Structure specifying descripto...
Rust
0
, h: Hint_) -> Self { Self(p, Box::new(h)) } } <gh_stars>0 use config::Configuration; use anyhow::{Result, anyhow}; use crossbeam::sync::WaitGroup; use i2p::{sam::StreamForward, net::{I2pListener, I2pAddr}}; use std::{thread, time}; use tokio::io::{AsyncReadExt, AsyncWriteExt}; use tokio::net::{TcpListener,...
Rust
0
n llm.input = args.input llm.test_data_path = args.test_data_path if args.web: llm.eval_load_model() def parse_text(text): lines = text.split("\n") lines = [line for line in lines if line != ""] count = 0 for i, line in enumerate(lines): ...
Python
1
_400ns_wait(); self.sel_primary(); self.identify(ATADriveType::PRIMARY) } pub fn identify_secondary(&self) -> Option<ATADrive> { self.soft_reset(); self.approx_400ns_wait(); self.sel_secondary(); self.identify(ATADriveType::SECONDARY) } } lazy_static! { ...
Rust
0
quaternion_op_impl!( Mul, mul; ; self: Quaternion<T>, rhs: Quaternion<T>, Output = Quaternion<T>; &self * &rhs; ); // UnitQuaternion × UnitQuaternion quaternion_op_impl!( Mul, mul; ; self: &'a UnitQuaternion<T>, rhs: &'b UnitQuaternion<T>, Output = UnitQuaternion<T>; UnitQuaternion::ne...
Rust
0
1.30) prevents this being a constant. let SocketDataLength: socklen_t = size_of::<SD>() as socklen_t; let mut peer_address: SD = unsafe { uninitialized() }; let mut peer_address_length = SocketDataLength; let result = unsafe { accept4(self.as_raw_fd(), &mut peer_address as *mut _ as *mut _, &mut peer_address...
Rust
0
L = [] import re with open("day3.txt", "r") as f: lines = f.readlines() for l in lines: L.append(l) def mul(s): nums = re.findall(r'\d{1,3}', s) x = int(nums[0]) y = int(nums[1]) print(x) print(y) return x*y total = 0 toggle = 1 for line in L: lis = re.findall(r'mul\(\d{...
Python
1
from sqlalchemy import Column, Integer, String, Boolean,DateTime,ForeignKey,func from database.db import Base from sqlalchemy.orm import relationship import uuid class Credits(Base): __tablename__ = "credits" id = Column(String,primary_key = True,index = True) project_name = Column(String, nullable = Fals...
Python
1
> None: module = StackedAlternatingLstm( input_size=input_size, hidden_size=hidden_size, num_layers=num_layers, recurrent_dropout_probability=recurrent_dropout_probability, use_highway=use_highway, use_input_projection_bias=use_input_projec...
Python
1
# use numerical indices mpres.cnLineThicknessF = 2 # thickness of contour lines mpres.tiMainString = "Spaghetti-style contours" # title mpres.tiMainFontHeightF = 0.02 mpres.mpProjection = "Stereographic" mpres.mpEllipticalBoundary = True mpres.mpLimitMode = "LatL...
Python
1
d = scaler.fit_transform(X_train) X_test_scaled = scaler.transform(X_test) #=============================================== # 匯入模型與 RMSLE 評估函數 from sklearn.linear_model import LinearRegression, Ridge, Lasso from sklearn.ensemble import RandomForestRegressor from sklearn.metrics import mean_squared_log_error, make_scor...
Python
1
from onnx_modules.V220_OnnxInference import OnnxInferenceSession import numpy as np Session = OnnxInferenceSession( { "enc": "onnx/BertVits2.2PT/BertVits2.2PT_enc_p.onnx", "emb_g": "onnx/BertVits2.2PT/BertVits2.2PT_emb.onnx", "dp": "onnx/BertVits2.2PT/BertVits2.2PT_dp.onnx", "sdp":...
Python
1
# to run this code, we much ensure the picture location is right, or it would encounter errors. import numpy as np import cv2 from sklearn.mixture import GaussianMixture from sklearn.preprocessing import MinMaxScaler import matplotlib.pyplot as plt # 1. Load the image and extract features def extract_features(image):...
Python
1
# Write the response to a file # with open("output.mp3", "wb") as out: # out.write(output_array) return send_file("../output.mp3", as_attachment=True) # @views.route('/text-to-speech', methods=['POST']) # def text_to_speech(): # text = request.json.get('text', '') # print(text) # model...
Python
1
#[doc = "Bits 0:7 - 7:0\\] RXENABLE enables the receiver. A nonzero value in this register causes FFCTRL to enable the receiver when in idle, after transmission and after acknowledgement transmission. The following strobes can modify RXENMASK: SRXON: Set bit 7 in RXENMASK. STXON: Set bit 6 in RXENMASK if SET_RXENMA...
Rust
0
io[Key::KeyPadEnter] = VirtualKeyCode::NumpadEnter as _; io[Key::A] = VirtualKeyCode::A as _; io[Key::C] = VirtualKeyCode::C as _; io[Key::V] = VirtualKeyCode::V as _; io[Key::X] = VirtualKeyCode::X as _; io[Key::Y] = VirtualKeyCode::Y as _; io[Key::Z] = VirtualKe...
Rust
0
import torch from tests import _PATH_DATA # Assuming you have this in your __init__.py def test_data_loading(): from knd.data.dataloader import get_dataloaders # Load the dataloaders train_dataloader, test_dataloader = get_dataloaders(batch_size=64) # Check the number of samples in the datasets ...
Python
1
REG_GPIO_7_IE_R { type Target = crate::FieldReader<bool, REG_GPIO_7_IE_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `reg_gpio_7_ie` writer - Input enable for GPIO7."] pub struct REG_GPIO_7_IE_W<'a> { w: &'a mut W, } impl<'a> REG_GPIO_7_IE_W<'a> { #...
Rust
0
s def forward( self, x: torch.Tensor, t: torch.Tensor, y: Optional[torch.Tensor] = None, context: Optional[torch.Tensor] = None, detach: Optional[bool] = False) -> torch.Tensor: """ Forward pass of DiT. x: (N, C, H, W) tensor of spatial inputs (images or latent repre...
Python
1
(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe extern "C" fn notify_description_trampoline<P, F: Fn(&P) + 'static>( this: *mut ffi::GTlsPassword, _param_spec: glib::ffi::gpointer, f: glib::ffi::gpointer, ) where P: IsA<TlsPassword>, { ...
Rust
0
SIONS = {"txt", "pdf"} # NEO4J_URI = os.environ.get("NEO4J_URI", "bolt://localhost:7687") # NEO4J_USERNAME = os.environ.get("NEO4J_USERNAME", "neo4j") # NEO4J_PASSWORD = os.environ.get("NEO4J_PASSWORD", "password") # USE_KNOWLEDGE_GRAPH = os.environ.get("USE_KNOWLEDGE_GRAPH", "false").lower() == "true" # # Инициализац...
Python
1
# Resource object code (Python 3) # Created by: object code # Created by: The Resource Compiler for Qt version 6.7.0 # WARNING! All changes made in this file will be lost! from PySide6 import QtCore qt_resource_data = b"\ \x00\x00\x04\xa6\ \x89\ PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ \x00\x00 \x00\x00\x00 \x08\...
Python
1
=> Some(expr.desc.datatype().clone()), Self::BinaryOp(expr) => expr.return_type.clone(), Self::UnaryOp(expr) => expr.return_type.clone(), Self::TypeCast(expr) => Some(expr.ty.clone().nullable()), Self::AggCall(expr) => Some(expr.return_type.clone()), Self::Inp...
Rust
0
, is_runtime_import=self.in_try_import_error ) # Issue #37 修复:为外部导入创建模块符号依赖 # 创建一个虚拟的模块符号作为依赖 module_symbol = Symbol( name=module_name, qname=module_name, symb...
Python
1
093720, lon: 14.303641 }, Place { name: "Innerschwand am Mondsee, Österreich", lat: 47.833108, lon: 13.407022 }, Place { name: "Höf-Lembach, Österreich", lat: 47.104549, lon: 15.612211 }, Place { name: "Stubenberg am See, Österreich", lat: 47.244392, lon: 15.801977 }, Place { name: "Tauglboden, Österrei...
Rust
0
xy_compressed_len Length of the compressed coordinate in bytes."] #[doc = " This should be equal to twice of the length of"] #[doc = " one coordinate plus one byte for the prefix."] #[doc = ""] #[doc = " @param[out] sign Pointer to the sign of the hidden coor...
Rust
0
from pathlib import Path import numpy as np import whooie.pyplotdefs as pd infile = Path("output/convergence_test.npz") data = np.load(str(infile)) depth = data["depth"] entropy = data["entropy"] size = data["size"][0] p_meas = data["p_meas"][0] tol = data["tol"][0] d0 = np.mean(depth) dpm = np.std(depth) s0 = np.m...
Python
1
sj='', oesxejnuuad=0, zrmchep0ten: fres4u9dp1g=b'', wd1qtfdzzum: r983gmpencn=0.0, my9dt0a6l0h=0j, lagt8dg4r2m=0, v7xgg1g_33e: c4js9qemcig=None, ij6yo54gvmo='', lzpltbgjorj: cu7rnccpqsr=False): 0.0[''] //= None '# lieutenant_oscillations_boxes -> sums_afternoon_checker' return from kih8yi53z1x import ai6...
Python
1
_observer); self } pub fn set_op_observer(&mut self, op_observer: &'a mut Obs) -> &mut Self { self.op_observer = Some(op_observer); self } } use snafu::Snafu; #[derive(Debug, Snafu)] enum EnumError { #[snafu(display("an error variant"))] #[snafu(display("should not allow du...
Rust
0
} } macro_rules! test { ($n:ident, $b:block) => { #[test] fn $n() { let result = { $b }; assert!(result.is_ok()); } } } mod ns { use super::*; test!(creates_new, { ...
Rust
0
from llama_index.callbacks.langfuse.base import langfuse_callback_handler __all__ = ["langfuse_callback_handler"]
Python
1
mutation_token(remove_res, &mut lcb_mutation_token); let mutation_token = if lcb_mutation_token.uuid_ != 0 { let mut bucket_len: usize = 0; let mut bucket_ptr: *const c_char = ptr::null(); lcb_errctx_kv_bucket(lcb_ctx, &mut bucket_ptr, &mut bucket_len); let bucket...
Rust
0
""" The Dependency Inversion Principle (DIP) is the last of the five SOLID principles of object-oriented design. It states that high-level modules should not depend on low-level modules. Both should depend on abstractions. Additionally, abstractions should not depend on details. Details should depend on abstractions. ...
Python
1
= create_modifier::create_modifier(attr, item.into()); match result { Ok(o) => o, Err(e) => e.to_compile_error() }.into() } <gh_stars>1-10 use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt}; use std::collections::HashMap; use std::io::Cursor; use std::io::Write; #[macro_use] extern crate ...
Rust
0
import tensorflow as tf class LearningRateStrategy(object): def __init__(self, init_lr, strategy_spec): self._type = strategy_spec.pop('type', 'exponential_decay') self._decay_steps = strategy_spec.pop('decay_steps', 1000) self._decay_rate = strategy_spec.pop('decay_rate', 0.9) sel...
Python
1
t result = f(); let _ = unsafe { thread_resume(thread_act) }; Ok(result) } pub fn get_backtrace( memory: &mut ForeignMemory, thread_act: mach_port_t, frames: &mut Vec<u64>, ) -> Result<(), SamplingError> { with_suspended_thread(thread_act, || { let (ip, bp) = get_unwinding_registers(thr...
Rust
0
1, :] # Shape (1, 3) width, height = 200, 100 pad_x, pad_y = 0.1, 0.1 # Test centered params_centered = OrthographicProjectionParameters( width=width, height=height, padding_x=pad_x, padding_y=pad_y, canvas_alignment="center", center_original_coordinates...
Python
1
already exists in the database" )] DuplicateTransaction, #[error("Value not found")] ValueNotFound, #[error("Unexpected result: `{0}`")] UnexpectedResult(String), #[error("If an pending transaction does not exist to be confirmed")] PendingTransactionNotFound, #[error("This write ope...
Rust
0
except ValueError: return 0 def get_blob_logdir(): # You can change this to be a separate path to save checkpoints to # a blobstore or some external drive. return logger.get_dir() def log_loss_dict(diffusion, ts, losses): for key, values in losses.items(): logger.logkv_mean(key, va...
Python
1
nal[OrderStatus] = None) -> List[Order]: """ 獲取訂單列表 Args: status (OrderStatus, optional): 訂單狀態 Returns: List[Order]: 訂單列表 """ # 更新所有訂單狀態 self._update_all_orders() # 過濾訂單 if status is None: return list(self.ord...
Python
1
import unittest from speedtest_pypy.utils import calculate_distance, generate_payload class TestUtils(unittest.TestCase): def test_calculate_distance(self): # Test distance calculation between New York and London ny_lat, ny_lon = 40.7128, -74.0060 london_lat, london_lon = 51.5074, -0.1278 ...
Python
1
#!/usr/bin/env python # Created by "Thieu" at 17:03, 03/10/2023 ----------% # Email: nguyenthieu2102@gmail.com % # Github: https://github.com/thieu1995 % ...
Python
1
.map_err(InternalCreateRequestError::InvalidOriginalInput)?; let disable_output_substitution = uri.disable_output_substitution || params.disable_output_substitution; let payee = uri.address.script_pubkey(); check_single_payee(&psbt, &payee, uri.amount)?; let fee_contribution = determine_fee_contribu...
Rust
0
ify() { let bose = Bose { prime_base: 2, dimensions: 2, }; let oa = bose.gen().unwrap(); assert!(verify(&oa).unwrap()); let bose = Bose { prime_base: 3, dimensions: 2, }; let oa = bose.gen().unwrap(); assert!(verify(&oa).unwrap()); let bose = Bose { ...
Rust
0
he user about this alternative if provided. pending : bool, optional If True, uses a PendingDeprecationWarning instead of a DeprecationWarning. addendum : str, optional Additional text appended directly to the final message. Examples -------- Basic example:: ...
Python
1
#!/usr/bin/env python # coding: utf-8 from baseframe import Plugin class MyPlugin(Plugin): info = { 'name': 'Sample XSS Match', 'tag': 'xss' } rules = [ { 'desc': 'PHP常见XSS过滤函数', 'rule': ( r'(?i)htmlspecialchars\(|' r'htmlen...
Python
1
{ enabled_bits.push(EnabledBitRange { offset: 6, len: 1, explanation: "Issuer authentication failed".to_owned(), severity: Severity::Error, }); } if self.script_processing_failed_before_final_gen_ac { enabled_bits.push(EnabledBitRange { offset: 5, len: 1, explanation: "Script p...
Rust
0
ata.materials["SMPLX-male"].diffuse_color = [0.5, 0.8, 0.46, 1] bpy.data.materials["SMPLX-female"].diffuse_color = [0.8, 0.5, 0.61, 1] bpy.data.worlds["World"].color = (1, 1, 1) # light_constraint = b_light.constraints.new(type='TRACK_TO') # light_constraint.track_axis = 'TRACK_NEGATIVE_Z' # light_...
Python
1
, Debug, PartialEq, Serialize, Deserialize)] pub struct ProviderInstanceListResult { #[serde(default, skip_serializing_if = "Vec::is_empty")] pub value: Vec<ProviderInstance>, #[serde(rename = "nextLink", default, skip_serializing_if = "Option::is_none")] pub next_link: Option<String>, } #[derive(Clone,...
Rust
0
y_sw_log(key, value / n, step) mg = self._train_mg if key.startswith('train') else self._eval_mg mg.log(key, value, n) def log_param(self, key, param, step): self.log_histogram(key + '_w', param.weight.data, step) if hasattr(param.weight, 'grad') and param.weight.grad is not None: ...
Python
1