text
string
label_name
string
labels
int64
config #[derive(Builder, Clone, Debug, PartialEq, Deserialize)] #[builder(build_fn(private, name = "build_impl"))] pub struct ReplicaConfig { #[builder(default = "default_base_dir()")] #[serde(default = "default_base_dir")] pub base_dir: PathBuf, #[builder(default = "default_index_max_bytes()")] #[...
Rust
0
Return2 = sys::SDLK_RETURN2 as i32, Separator = sys::SDLK_SEPARATOR as i32, Out = sys::SDLK_OUT as i32, Oper = sys::SDLK_OPER as i32, ClearAgain = sys::SDLK_CLEARAGAIN as i32, CrSel = sys::SDLK_CRSEL as i32, ExSel = sys::SDLK_EXSEL as i32, Kp00 = sys::SDLK_KP_00 as i32, Kp000 = sys::SDLK...
Rust
0
_SPEC { type Ux = u32; } #[doc = "`read()` method returns [uart_int_sts::R](R) reader structure"] impl crate::Readable for UART_INT_STS_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [uart_int_sts::W](W) writer structure"] impl crate::Writable for UART_INT_STS_SPEC { type Writer = W; } #[do...
Rust
0
t(':') iaqis.append((elem, iaqi)) ret = [] for iaqi in iaqis: ret.append((iaqi[0], _aqi.cc(iaqi[0], iaqi[1]))) if len(ret) == 1: sys.stdout.write(str(ret[0][1]) + "\n") elif len(ret) > 1: ccs = [] ...
Python
1
<usize> = (0..data.len()).collect(); thread_rng().shuffle(&mut indices[..]); indices.iter().take(k).cloned().collect() } // manhatten distance fn distance(a: &Point, b: &Point) -> f32 { a.iter().zip(b.iter()).map(|(&x,&y)| (x - y) * (x - y)).fold(0.0, |acc, x| acc + x).sqrt() } fn total_distance(data: &Vec<Point>,...
Rust
0
import torch import time from tensorly import tenalg tenalg.set_backend('einsum') from configmypy import ConfigPipeline, YamlConfig, ArgparseConfig from neuralop import get_model # Read the configuration config_name = 'default' pipe = ConfigPipeline([YamlConfig('./test_config.yaml', config_name='default', config_fo...
Python
1
from typing import Optional, Type, Union import logging logger = logging.getLogger(__name__) from panda_plugins.base import BaseWorkNode, work_node, ui from pydantic import BaseModel, Field from pandas import DataFrame from panda_factor.generate.macro_factor import MacroFactor """ 普通因子构建节点 """ @ui( start_date={"i...
Python
1
stoneProgressBarStateComponent, self)._onExited() self._milestonesHandler.stop() self._milestonesHandler.onMilestoneReached -= self._onMilestoneReached self._milestonesHandler.onMilestoneTypeChanged -= self._onMilestoneTypeChanged def _onMilestoneReached(self, newMilestone): _logger...
Python
1
book.get_best_bid().unwrap(), dec!(100)); assert!(book.get_best_ask().is_none()); assert!(book.find_order(1).is_some()); book.insert( Order::new(2, UserId::zero(), dec!(105), dec!(1)), AskOrBid::Ask, ); assert!(book.indices.contains_key(&2)); assert_eq!(book.size().0, dec!(1)); ...
Rust
0
self) -> Result<f64> { // TODO: assumes there are two things here let mut iter = self.samples.iter(); let a = iter.next().unwrap().1; let b = iter.next().unwrap().1; a.ttest(b) } } <reponame>LenaWil/rust // edition:2018 // FIXME: missing sysroot spans (#53081) // ignore-i586-...
Rust
0
} } <reponame>LouayKamel/bee // Copyright 2020 <NAME> // SPDX-License-Identifier: Apache-2.0 use bee_crypto::ternary::HASH_LENGTH; /// Length of a message fragment. pub const MESSAGE_FRAGMENT_LENGTH: usize = 27; /// Length of a signature fragment. pub const SIGNATURE_FRAGMENT_LENGTH: usize = MESSAGE_FRAGMENT_LEN...
Rust
0
buyurtmalar = [] while True: buyurtmalar = input("Buyurtma qilish uchun mahsulot nomini kiriting (dasturni to'xtatish uchun 'exit' yoki 'quit' deb yozing): ") if buyurtmalar.lower() in ['exit', 'quit']: break buyurtmalar.lower() print("Sizning buyurtmalaringiz: ")
Python
1
ll have unexpected values. vq.avail().idx().store(u16::to_le(7)); loop { q.disable_notification().unwrap(); while let Some(_chain) = q.iter().unwrap().next() { // In a real use case, we would do something with the chain here. } if !q.enabl...
Rust
0
= min_threshold + step if step > 0: for k in range(ntrial): sym = make_mirror_plan_to_layer(sym, layer_name=layer_name, threshold=threshold, plan_info=info, ...
Python
1
# 39. Combination Sum from typing import List class Solution: def combinationSum(self, candidates: List[int], target: int) -> List[List[int]]: res = [] candidates.sort() n = len(candidates) def dfs(i, cur, total): if i == n: return if total ...
Python
1
" => (&next_change, "Goes to next change"), "prev_change" => (&prev_change, "Goes to previous change"), "next_found" => (&next_found, "Goes to next found sequence"), "prev_found" => (&prev_found, "Goes to previous found sequence"), "go_to_start" => (&go_to_start, "Goes to first offset"),...
Rust
0
from django.utils.translation import gettext_lazy as _ from temba.channels.types.dartmedia.views import ClaimView from temba.contacts.models import URN from ...models import ChannelType class DartMediaType(ChannelType): """ An DartMedia channel (http://dartmedia.biz/) """ code = "DA" category =...
Python
1
, y: 7}, true) + rw.value_at(&Position{x: 3, y: 7}, true) - rw.value_at(&Position{x: 0, y: 7}, true); let bs = kb.value_at(&Position{x: 6, y: 0}, true) - kb.value_at(&Position{x: 4, y: 0}, true) + rb.value_at(&Position{x: 5, y: 0}, true) - rb.value_at(&Position{x: 7, y: 0}, true); ...
Rust
0
t cigar_list.push(CigarPos { cig: cigar_string_view[j].clone(), ref_pos: rpos, read_pos: qpos, }); } &Cigar::SoftClip(_) | &Cigar::Pad(_) | &Cigar::HardClip(_) => {} } // move the referen...
Rust
0
return Err(ChunkGenError::SeveralBGTilesets(moar + 1)); } Ok(bg_tileset) } } <filename>src/bucket.rs use super::bitmap::BitMap; use super::Arc; use core::cell::UnsafeCell; use core::hint::spin_loop; use core::ops::Deref; use std::sync::atomic::{fence, AtomicU8, Ordering}; use array_init::arra...
Rust
0
if mem_v0 > 201 {0} else {mem_v0 + 1}; // receiver let fn_7 = |dst, count,_, mem_v0|(if dst == 213451 { mem_v0 + 1 } else { if count > 200 {0} else {mem_v0}}); //received let fn_8 = |dst: i64, push, length, mem_v0|(if (dst == 213451) && push > 1 { 0 } else { length }); //workload let fn_9 = |count, _, _, ...
Rust
0
"""レイキャスティングエンジン""" import math from typing import Tuple, Optional from src.dungeon.dungeon_manager import PlayerPosition from src.dungeon.dungeon_generator import DungeonLevel, DungeonCell, CellType, Direction from src.rendering.renderer_config import RaycastConfig from src.rendering.wall_renderer import WallType ...
Python
1
analogy::Analogy, use artifact::ArtifactId, use claim::{Claim, ClaimId}, use std::rc::Rc; pub enum SearchNode { Artifact { binary_concatenated_atomid_list: Option<Vec<u8>>, artifact_id: ArtifactId, }, Pair { vec: Option<Vec<u8>>, left: Box<SearchNode>, right: Box<...
Rust
0
hrowable>> { // // class.path == "java/net/DatagramSocketImpl", java.flags == PROTECTED | ABSTRACT, .name == "create", .descriptor == "()V" // unsafe { // let __jni_args = []; // let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env); // let (__j...
Rust
0
: 'down' if output_y > 0 else 'up', # 计算机坐标系中y向下为正 'magnitude_x': abs(output_x), 'magnitude_y': abs(output_y) } def update(self, results, dt=0.1): """ 更新控制系统,处理新的传感器数据并生成控制指令 参数: results: 包含角点和激光点的字典列表 dt: 与上一次更新的时间间隔 ...
Python
1
elf.generate_thread.start() def handle_success(self, result): license_key = result['license_key'] expires_at = "永久有效" if self.enable_expiry.isChecked(): expires_at = self.expiry_date.dateTime().toString("yyyy-MM-dd hh:mm:ss") success_msg = (f"许可证生成成功!\n"...
Python
1
import os import glob import cv2 import numpy as np import argparse from tqdm.auto import tqdm def read_mask(mask_path): image = cv2.imread(mask_path) image = cv2.cvtColor(image, cv2.COLOR_BGR2HSV) # lower boundary RED color range values; Hue (0 - 10) lower1 = np.array([0, 100, 20]) upper1 = np.ar...
Python
1
nt; pub fn ftruncate(fd: c_int, length: i64) -> c_int; pub fn lstat(path: *const libc::c_char, buf: *mut stat) -> c_int; } #[cfg(not(any(target_os = "freebsd", target_os = "macos", target_os = "android")))] use libc::fallocate; #[cfg(target_os = "freebsd")] use libc::madvise; #[cfg(not(any(target_os = "freebsd...
Rust
0
-> None: super(Transition, self).__init__() self.config = config self.global_config = global_config num_intermediate = int(num_channel * config.num_intermediate_factor) self.input_layer_norm = nn.LayerNorm(num_channel) self.transition1 = nn.Linear(num_channel, num_intermediate) self.relu = nn.ReLU() s...
Python
1
rust_name, c_name,); continue; } if rust_layout != c_layout { results.record_failed(); eprintln!( "Layout mismatch for {}\nRust: {:?}\nC: {:?}", rust_name, rust_layout, &c_layout ); continue; } ...
Rust
0
스크린샷 timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") screenshot_path = f"{self.logs_dir}/verification_page_{timestamp}.png" await self.page.screenshot(path=screenshot_path) print(f" Screenshot: {screenshot_path}") else: print(" [...
Python
1
weights[valid_distance_mask] = ( n_nearest_model_points / distances[valid_distance_mask]) # Denominator is the sum of the weights per nearest point (axis 1) denom = numpy.sum(weights, axis=1) # To avoid a divide by 0 valid_denom = denom != 0 average_biomass =...
Python
1
") .and_then(|()| writer.write_all(l.as_bytes())), (Some(s), None) => { let mut buf = [0; 4]; let s = s.encode_utf8(&mut buf); writer .write_all(b"-") .and_then(|()| writer.write_all(s.as_bytes())) ...
Rust
0
# -*- coding: utf-8 -*- import threading import socket import numpy as np import cv2 from _socket import timeout class VideoStream(threading.Thread): ''' ''' def __init__(self, video, host, port): ''' Constructor ''' super(VideoStream, self).__init__() ...
Python
1
import os import shutil import tempfile from unittest import TestCase, main from sblpy.migrations.file_processes import setup_migration_directories, generate_new class TestMigrationDirectories(TestCase): def setUp(self): # Create a temporary directory for testing self.test_dir = tempfile.mkdtemp...
Python
1
_system.write().unwrap(); rs_write .initialize( &common::get_render_module_path(), &common::get_render_backend_settings(), ) .unwrap(); assert!(rs_write.is_initialized()); let registry = Arc::clone(&rs_write.get_registry().unwra...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the Apache License, Version 2.0 # found in the LICENSE file in the root directory of this source tree. import random import math import numpy as np class MaskingGenerator: def __init__( self, input_size, ...
Python
1
""" User notification preferences model. Handles user-specific notification settings and preferences. """ from datetime import datetime from typing import Any, Dict from sqlalchemy import JSON, BigInteger, Boolean, DateTime, ForeignKey, Index, String from sqlalchemy.orm import Mapped, mapped_column, relationship fr...
Python
1
import math from typing import Optional from app.core.config import settings from app.gpt.autohf import AutoHF from app.models.soft_prompt import SoftPrompt as SoftPromptModel from transformers import AutoTokenizer import openai class OpenAI(AutoHF): def __init__(self, model_name='convo-6b', decoder=True): ...
Python
1
# 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
"""Utility functions for Slack integration.""" import os from slack_sdk import WebClient def _get_slack_client(): """Create an authenticated Slack client. Returns: WebClient: An authenticated Slack WebClient instance. """ token = os.getenv('SLACK_TOKEN') client = WebClient(t...
Python
1
unop(expr, UnOp::Neg) } pos:pos() keyword("new") _ id:ident() _ "(" _ params:commasep(<expr()>) _ ")" end:pos() { Expr::New(TypeName::basic_owned(id.to_owned()), params, Span::new(pos, end)) } -- expr:(@) _ "[" _ idx:expr() _ "]" high:pos() { ...
Rust
0
Error { code: ErrorCode::InternalError, message: message.to_string(), data: None } } pub fn error_on_execution_failure(reason: &ExitReason, data: &[u8]) -> Result<(), Error> { match reason { ExitReason::Succeed(_) => Ok(()), ExitReason::Error(e) => { Err(Error { code: ErrorCode::InternalError, ...
Rust
0
//! needed by DataFusion use arrow_deps::{ arrow::{datatypes::SchemaRef, error::Result as ArrowResult, record_batch::RecordBatch}, datafusion::physical_plan::RecordBatchStream, }; use read_buffer::ReadFilterResults; use std::{ sync::Arc, task::{Context, Poll}, }; /// Adapter which will take a ReadFil...
Rust
0
t sftp = connection.sftp().unwrap(); let path = PathBuf::from("asuran/test_locked_file"); let _test_file = sftp.create(&path).expect("Unable to create test file"); let lock_path = PathBuf::from("asuran/test_locked_file.lock"); let _test_file_lock = sftp.create(&lock_path).expect("Unable...
Rust
0
ay be set to ``True`` to include a sequential row ID column. :param include_row_ids: :param content: File content. If given, used as is. :param encoding: Encoding. :param format_func: Callable responsible for formatting template strings. :param raw: If set...
Python
1
_ok!( calculate_next_work_required(previous_target, first_block_time, last_block_time), 0x170e2632 // Block #703584 ); } } use actix_web::web; #[derive(Deserialize, Serialize, Debug)] pub struct Info { username: String, email: String, password: String, confirm_passwo...
Rust
0
Progress { ValidatingDependencies, ValidatingDependency { name: String, }, DependenciesValidated, UploadingDependencies, UploadingDependency { name: String, progress: URx<AttachmentUploaderProgress>, }, DependenciesUploaded, CreatingExperiment, Expe...
Rust
0
"""A dummy contents manager for when the logic is done client side (in JavaScript).""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. from .compat import JUPYTER if JUPYTER: from notebook.services.contents.manager import ContentsManager else: from IPython...
Python
1
#################################################################################### # Exploit Title: Mini-stream RM-MP3 Converter/WMDownloader/ASX to MP3 Converter Stack Buffer Overflow Exploit # # Tested on Windows XP SP3 Pro # Found By : Cyber-Zone (ABDELKHALEK) # http://www.securityfocus.com/bid/34494 # The way exp...
Python
1
class TaskFamily: @staticmethod def get_tasks() -> dict[str, dict]: return { "1": {"type": "story", "constraints": {"word_count": 100, "required_words": ["sunset", "ocean", "whisper"], "theme": "mystery"}}, "2": {"type": "poem", "constraints": {"word_count": 50, "theme": "hope", ...
Python
1
tion'], # 'start_ch': sr['start_ch'], 'end_ch': sr['end_ch']} # with open(os.path.join(files[sr['sender']], f"{slot_file}.yaml"), 'w', encoding='utf-8') as file: # # 使用 yaml.dump() 函数将字典序列化并写入文件 # yaml.dump(sdata, file, allow_unicode=True, sort_k...
Python
1
_id(-1), dist.get_layer_placement(-1) ) else: for module_block in model.modules(): if isinstance(module_block.to(nn.Module), GLMEmbedding): module_block.to(nn.graph.GraphModule).set_stage( dist_utils.get_layer_stage_id(0), dist....
Python
1
.long("csv-in-ts-fmt-time") .help( "csv input only: specify the split timestamp time-only column format \ \n[default: %H:%M:%S]", ) .takes_value(true) .value_name("arg") ...
Rust
0
+ x + "\\x50\\x5c" else: x = str(hex(x)).replace("0x", "\\x") print "[-] ESP Sub Adjust Opcodes: \\x54\\x58\\x2c" + x + "\\x50\\x5c" print "[+] ESP Add Adjust Opcodes: \\x54\\x58\\x04" + x + "\\x50\\x5c" def jump(): global positiveSeed global negativeSeed global offsetNegative offset = raw_input...
Python
1
impl<CTX> HashStable<CTX> for DebruijnIndex { fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { self.as_u32().hash_stable(ctx, hasher); } } impl<CTX> HashStable<CTX> for IntTy { fn hash_stable(&self, ctx: &mut CTX, hasher: &mut StableHasher) { discriminant(self).hash_stable...
Rust
0
> { let meta = &self.as_inner().metadata; match meta.try_into_other(self.ptr.as_ptr()) { Ok(inner) => { // SAFETY: We are guaranteed to have a non-null pointer here let inner = unsafe { NonNull::new_unchecked(inner) }; Ok(<FlexRc<META2, META, ...
Rust
0
}), )) => { orders.send_msg(Msg::Sets(SetsMsg::GetSetsSuccess(GetSetsSuccessPayload { deck_id: *deck_id, sets: data .sets .iter() .map(|s| Set { id: s.id as usize, ...
Rust
0
# Copyright (C) 2017-2025 Pier Carlo Chiodi # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distri...
Python
1
class GraphModule(torch.nn.Module): def forward(self, primals_1: "f32[256, 128]", primals_2: "f32[1, 128]"): # File: /gpfs/users/goon/github/garrett361/learn_torch/compile/basic.py:29 in forward, code: outputs = self.lin0(inputs).relu() permute: "f32[128, 256]" = torch.ops.aten.permute.default(prima...
Python
1
# coding=utf-8 # Copyright 2023 The HuggingFace Inc. team. All rights reserved. # # 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 r...
Python
1
16, 16) .with_simple_console(WINDOW_WIDTH, WINDOW_HEIGHT, "Sapphos-square-16x16.png") .with_sparse_console(WINDOW_WIDTH, WINDOW_HEIGHT, "Anikki-square-16x16.png") .with_fps_cap(60.0) .build()?; //term.post_scanlines = true; // Load external files. rexloader::load_dungeons(...
Rust
0
from accelerate import init_empty_weights, load_checkpoint_and_dispatch from transformers import LlavaConfig import sys, os # 获取 lite_llama 目录的绝对路径并添加到 sys.path 中 sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) from lite_llama.models.llava import LlavaLlama hf_model_path = "/gemini/cod...
Python
1
the ' 'github reporter.') auth_token = os.getenv('GITHUB_AUTH_TOKEN') if not auth_token: raise Exception('Environment Variable $GITHUB_AUTH_TOKEN must be set ' 'to use the github reporter.') match = PR_URL_REGEX.match(args.pr_url) if match: ...
Python
1
AN. Scale the loss here so it comes out right loss = loss / grad_accum_steps loss_accum += loss.detach() loss.backward() if ddp: dist.all_reduce(loss_accum, op=dist.ReduceOp.AVG) norm = torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0) # determine and set the learning r...
Python
1
if let Some(var_325) = &input.final_db_snapshot_identifier { scope_324.string(var_325); } writer.finish(); Ok(aws_smithy_http::body::SdkBody::from(out)) } pub fn serialize_operation_crate_operation_delete_db_parameter_group( input: &crate::input::DeleteDbParameterGroupInput, ) -> Result<aws_smi...
Rust
0
rator::ISub => Type::Int64, Operator::IMul => Type::Int64, Operator::IDiv => Type::Int64, Operator::EQ => Type::Bool, Operator::NE => Type::Bool, Operator::LT => Type::Bool, Operator::LE => Type::Bool, Operator::GT => Type::Bool, Operator::GE => Type::Bool...
Rust
0
r[0]; cur[0] = i + 1; for j in 0..seq2.len() { let cb = seq2[j]; tmp = cur[j + 1]; cur[j + 1] = min( // deletion tmp + 1, min( // insertion cur[j] + 1, // match...
Rust
0
_ADDR_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [dev_addr::W](W) writer structure"] impl crate::Writable for DEV_ADDR_SPEC { type Writer = W; } #[doc = "`reset()` method sets DEV_ADDR to value 0"] impl crate::Resettable for DEV_ADDR_SPEC { #[inline(always)] fn reset_value() -> Self...
Rust
0
TsModuleRef, bump: &'a Bump) -> TsModuleRef<'a> { match inner { swc_ast::TsModuleRef::TsEntityName(value) => TsModuleRef::TsEntityName(get_view_for_ts_entity_name(value, bump)), swc_ast::TsModuleRef::TsExternalModuleRef(value) => TsModuleRef::TsExternalModuleRef(get_view_for_ts_external_module_ref(value, bump...
Rust
0
id_body_flag(&mut self, flag: RigidBodyFlag, value: bool) { unsafe { PxRigidBody_setRigidBodyFlag_mut(self.get_raw_mut(), flag.into(), value) } } #[allow(non_snake_case)] pub fn set_rigid_body_flags(&mut self, in_flags: BitFlags<RigidBodyFlag>) { unsafe { PxRigidBody_setRigidBody...
Rust
0
tKey: &Vec<u32>, msg: &Vec<u32>, opt_random: &Vec<u32>) -> Vec<u32> { let mut len = 64; if opt_random.len() > 0 { len = 128; } let mut buf: Vec<u32> = vec![0; len + msg.len()]; curve25519_sign(&mut buf, &msg, msg.len(), secretKey, opt_random); let mut signature: Vec<u32> = vec![0; 64]; for i in (0...
Rust
0
# Copyright (C) 2016 Cisco Systems, Inc. and/or its affiliates. All rights reserved. # # This file is part of Kitty. # # Kitty is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the License, o...
Python
1
content="content", metadata=metadata) self.setup_documents(docs) # mark each doc as already-chunked so we don't try to split them further # TODO later we may want to split large text-columns for d in docs: d.metadata.is_chunk = True return n # type: ignore def ...
Python
1
false; for (idx, c) in line.chars().enumerate() { if idx < line.len() - 2 { let c2 = line.chars().nth(idx + 2).unwrap(); if c2 == c { sequence_found = true; break; } } } if !sequence_found { return false; } ...
Rust
0
def factorial(n): result = 1 for i in range(1, n + 1): result *= i return result # loop until a valid number is entered while True: user_input = input("Enter a number: ") if user_input.isdigit(): # accepts 0 and positive integers num = int(user_input) break else: ...
Python
1
import torch import re from math_verify import LatexExtractionConfig, parse, verify from XC.rm_fn.math_utils import is_equal import os from datetime import datetime # format_pattern = r"^<think>(?:(?!</think>).)*</think>\s*<answer>(?:(?!</answer>).)*</answer>\Z" response_prefix = r"<\|im_start\|>assistant\n" answer_p...
Python
1
act one. circuit = qml.QNode(circuit_base, dev_exact) expval_exact = [ circuit(params, observable=[o]) for o in list_of_observables ] ############################################################################## # Finally, we plot the errors :math:`|\langle{O_i}\rangle_{shadow} - \langle{O_i}\rangle_{exact}|` # ...
Python
1
cs.namespace(|| "conditional reversal of preimage"), &cur, path_element, &direction_bit, )?; // We don't need to be strict, because the function is // collision-resistant. If the prover witnesses a congruency, // they will be unable to find an a...
Rust
0
us_defs = FamousDefs(&ctx.sema, scope.krate()); let core_result = famous_defs.core_result_Result(); let core_option = famous_defs.core_option_Option(); if Some(expected_enum) != core_result && Some(expected_enum) != core_option { return None; } let variant_name = if Some(expected_enum) == ...
Rust
0
import time import Board print(''' ********************************************************** ********Function: Hiwonder Raspberry Pi Expansion Board, Buzzer Control Routine********* ********************************************************** ---------------------------------------------------------- Official website:h...
Python
1
import numpy as np import matplotlib.pyplot as plt from scipy.spatial import ConvexHull from scipy import interpolate # ======================= Inputs ======================= # Read y2 x2 data # Get points without smoothening input y0 and x0 which are the stress and strain respectively SS_data = np.loadtxt("V3_Origin...
Python
1
"### ); } } #![feature(async_closure)] use brio::{App, Ctx, Request, Response, Status}; use log::info; use std::{future::Future, pin::Pin, time::Instant}; type BoxFuture<'a, Response> = Pin<Box<dyn Future<Output = Response> + Send + 'static>>; // curl -v -H 'connection:keep-alive' localhost:8000/foo ...
Rust
0
# -*- coding: utf-8 -*- """ Created on Mon Nov 29 16:25:55 2021 @author: joverbee (c) University of Antwerp 2021 """ import sys import pytest from pyEELSMODEL.core.parameter import Parameter # note that changing the loglevel on anaconde requires at least a kernel # restart import logging # logging.basicConfig(level...
Python
1
Seed<'de> for ConstraintSeed<'de, 'a> { type Value = Constraint; fn deserialize<D>(self, deserializer: D) -> Result<Self::Value, D::Error> where D: serde::Deserializer<'de>, { let src = <Cow<str> as serde::Deserialize>::deserialize(deserializer)?; parse_constraint(self.0, src).m...
Rust
0
import numpy as np from skimage import color def analyze_visual_contrast(image, mask): """ Compute brightness and color contrast between masked object and background. Parameters: image: RGB image (H, W, 3) mask: Boolean mask (H, W), True = object Returns: dict with brightness_...
Python
1
# ======================================================================= # # Copyright (C) 2020 - 2025 Dominik Willner <th33xitus@gmail.com> # # # # This file is part of KIAUH - Klipper Installation And Update Helper # # https://githu...
Python
1
], outputs=[gr.Textbox(visible=False)] ) """ generate_button.click( fn=generate_video, inputs=[ ltx095_inference_type, ltx095_quality, ltx095_memory_optimization, ltx095_vaeslicing, ltx095_vaetiling, ltx095_prompt, ltx095_negative_prompt, ltx...
Python
1
check_refs( &mirror, &[ hash_two, hash_three, ], ); // Remove the tags assert!(process::Command::new("git") .args(&["tag", "-d", "tag1", "tag2"]) .current_dir(&origin) .status().unwrap().success()); crate::update_with_date(&mir...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse from alipay.aop.api.domain.TransferAccountBookDetailResult import TransferAccountBookDetailResult class AlipayDataBillTransferaccountbookQueryResponse(AlipayResponse): def __init__(self): ...
Python
1
# Copyright 2023 The Google Earth Engine Community Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Python
1
(Error::MethodNotAllowed); } let mut headers = self.common_headers(origin.clone()); headers.insert(ALLOW_METHODS, self.cache.allow_methods.clone()); headers.insert(ALLOW_HEADERS, request_headers_header.clone()); if let Some(max_age) = self.cache.config.max_age { hea...
Rust
0
Tool - GRASS"), ) if flags["l"]: frame.linRegRaster.SetValue(state=True) frame.linRegVector.SetValue(state=True) frame.SetDatasets( rasters, vectors, coords, cats, attr, title, xlabel, ylabel, csvfile, flags["h"...
Python
1
} #[test] fn test_split() { let mut args = vec!["--exec-file", "foo", "--", "--extra-arg-1", "--extra-arg-2"] .into_iter() .map(String::from) .collect::<Vec<String>>(); let (left, right) = Arguments::split_args(&args); assert_eq!(left.to_vec(), ve...
Rust
0
#!/usr/bin/env python from common import * mainArch = "amd64" outputFolder = "../%s" %mainArch subarchs = [ { "name": "avx", "subarchtitle": "AVX", "flags": "-mavx -mfma" }, { "name": "sse2", "subarchtitle": "SSE2", "flags": "-msse2" } ] sources = [ { "filename": "add_complex_...
Python
1
stride_bn, stride_cm, stride_cn, # Meta-parameters BLOCK_SIZE_M: tl.constexpr, BLOCK_SIZE_N: tl.constexpr, BLOCK_SIZE_K: tl.constexpr, # GROUP_SIZE_M: tl.constexpr, # ACTIVATION: tl.constexpr, # ): """ alpha, beta is preprocess bn layer Kernel for computing the matmul ...
Python
1
self, dtype: torch.dtype, device: torch.device, CUDA_MAX_DIM_SIZE: int = 20_000, logging_level=logging.INFO, lambda_reg: float = 0.0, ) -> None: """ Args: dtype (torch.dtype): device (Union[str, torch.device]): torch d...
Python
1
e, k_proj_bias=False, v_proj_bias=False, q_norm=True, k_norm=True, lora_rank=lora_rank, lora_alpha=lora_alpha, lora_dropout=lora_dropout, use_dora=use_dora, quantize_base=quantize_base, ) def lora_qwen3_32b( lora_attn_modules: List[LORA_A...
Python
1
''' Copyright 2025.4.23 Koji-Huang(1447396418@qq.com) 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...
Python
1
dImages = [invIndex[ind] for ind in indNonZero] for j in range(len(indNonZero)): temp_min[0, indImages[j]] = temp_min[0, indImages[j]] + np.minimum(V[i, indNonZero[j]], V[indImages[j], indNonZero[j]]) jaccard_dist...
Python
1