text
string
label_name
string
labels
int64
shape = [256] dtype = "torch.float32" device = "cpu" mean = 0.000 std = 0.000 data = None class Program_weight_tensor_meta_L_self_modules_convs_modules_3_modules_lin_parameters_weight_: name = "L_self_modules_convs_modules_3_modules_lin_parameters_weight_" shape = [256, 256] dtype = "...
Python
1
(); sender.send(record.clone()).await.unwrap(); assert_stream_pending(&mut stream).await; sender.send(record.clone()).await.unwrap(); let unwrap = |e: Result<Option<Result<_, _>>, _>| e.unwrap().unwrap().unwrap(); // need a solid timeout here because we have simulated an erro...
Rust
0
#2.特征融合 #这里给出一个使用 VAE 进行语音风格转换中的特征融合的 Python 代码示例。 import torch import torch.nn as nn from torch.nn import functional as F # 定义VAE模型 class VAE(nn.Module) : def __init__(self, input_dim, latent_dim) : super(VAE, self).__init__() # 编码器 self.enc_fc1 = nn.Linear(input_dim, 512) self.enc_fc2 = nn.Linear(512, late...
Python
1
Point (P3P) Solver. //! <NAME>, <NAME>. ECCV 2018. ([paper][lambda-twist]) //! //! [pnp]: https://en.wikipedia.org/wiki/Perspective-n-Point //! [lambda-twist]: http://openaccess.thecvf.com/content_ECCV_2018/html/Mikael_Persson_Lambda_Twist_An_ECCV_2018_paper.html //! //! Implementation based on //! "Lambda Twist: A...
Rust
0
} StreamError::UnknownStreamType(stream_type) => { write!(f, "Unknown stream type: (type: {})", stream_type) } StreamError::ReadStreamLength(err) => { write!(f, "Failed to read stream length: {}", err) } StreamError::Inva...
Rust
0
mpatible; MSIE 10.0; Windows Phone 8.0; Trident/6.0; IEMobile/10.0; ARM; Touch; NOKIA; Lumia 520)' }, { 'user-agent': 'Mozilla/5.0 (MeeGo; NokiaN9) AppleWebKit/534.13 (KHTML, like Gecko) NokiaBrowser/8.5.0 Mobile Safari/534.13' }, { 'user-agent': 'Mozilla/5.0 (Linux; Android 9; Pixel 3 Build/PQ1...
Python
1
ut=rss # 구글뉴스 [헤드라인]주요뉴스 # http://news.google.co.kr/news?pz=1&hdlOnly=1&cf=all&ned=kr&hl=ko&output=rss # 구글뉴스 [헤드라인]인기뉴스 # http://news.google.co.kr/news?pz=1&hdlOnly=1&cf=all&ned=kr&hl=ko&topic=po&output=rss # 구글뉴스 [헤드라인]정치 # http://news.google.co.kr/news?pz=1&hdlOnly=1&cf=all&ned=kr&hl=ko&topic=p&output=rss # 구글뉴스 [헤드...
Python
1
(C64(l), C64(r)) => Bool(l.gt(r.deref())), (F32(l), F32(r)) => Bool(l.gt(r.deref())), (F64(l), F64(r)) => Bool(l.gt(r.deref())), (I16(l), I16(r)) => Bool(l.gt(r.deref())), (I32(l), I32(r)) => Bool(l.gt(r.deref())), (I64(l), I64(r)) => Bool(l.gt(r.deref())), ...
Rust
0
_as_usize(r)?; let mut lambdas = Vec::new(); for _ in 0..len { let name = deserialize_string(r)?; let argn = deserialize_u64_as_usize(r)?; let body = Expr::deserialize_from(r)?; lambdas.push((name.into(), arg...
Rust
0
println!("{:<4} {:<20} {:<4} {:<10}", line, "OP_MULTIPLY", "", "") } OpCode::OpDivide => { println!("{:<4} {:<20} {:<4} {:<10}", line, "OP_DIVIDE", "", "") } OpCode::OpNegate => { println!("{:<4} {:<20} {:<4} {:<10}"...
Rust
0
// Compare the digest let hash_str = get_digest_hex(digest_reconstructed); if hash_str != v.checksum { pln!("DIFF FAIL for {} v{}!", name, v.version); } } /*if ctr > 100 { pln!("abort"); break; }*/ } println!("thread {} done", t); } fn main() { println!("Loading all crates json..."); ...
Rust
0
try: stdin.writelines(in_lines) stdin.flush() stdout.channel.set_combine_stderr(combine_stderr) stdoutdata = stdout.readlines() exit_status = stdin.channel.recv_exit_status() if exit_status != 0: if not allow_fail: ...
Python
1
Result<A> { fn analyze_children(src: HashMap<Condition, Box<BNode<A>>>) -> ChildrenAnalysisResult<A> { src.into_iter().fold( ChildrenAnalysisResult::Empty, |car, (cond, n)| match (car, cond) { (ChildrenAnalysisResult::Empty, Condition::CStr(s)) => ...
Rust
0
= 4097, /// `VPCOMD xmm1, xmm2, xmm3/m128, imm8` /// /// `XOP.128.X8.W0 CE /r ib` /// /// `XOP` /// /// `16/32/64-bit` XOP_Vpcomd_xmm_xmm_xmmm128_imm8 = 4098, /// `VPCOMQ xmm1, xmm2, xmm3/m128, imm8` /// /// `XOP.128.X8.W0 CF /r ib` /// /// `XOP` /// /// `16/32/64-bit` XOP_Vpcomq_xmm_xmm_xmmm128_imm8 = ...
Rust
0
# 以下を「app.py」に書き込み import streamlit as st from langchain_openai import ChatOpenAI from langchain.schema import HumanMessage, SystemMessage from langchain.prompts.chat import ( ChatPromptTemplate, HumanMessagePromptTemplate, SystemMessagePromptTemplate ) import os # Streamlit Community Cloudの「Secrets」からOpen...
Python
1
>::get(), index: 1 }); assert_eq!(SimpleUnion::NAMED_FIELD_INFO.f, UnionFieldDef { name: "f", value_type: TypeId::<f32>::get(), index: 2 }); assert_eq!(SimpleUnion::NAMED_FIELD_INFO.nested, UnionFieldDef { name: "nested", value_type: TypeId::<Nested>::get(...
Rust
0
戌、亥。 pub(crate) const THE_EARTHLY_BRANCHES_CHARS: [char; 12] = ['子', '丑', '寅', '卯', '辰', '巳', '午', '未', '申', '酉', '戌', '亥']; /// 列舉中國十二生肖:鼠、牛、虎、兔、龍、蛇、馬、羊、猴、雞、狗、豬。 pub(crate) const THE_ZODIAC_SIGNS: [[&str; 2]; 12] = [ ["鼠", "鼠"], ["牛", "牛"], ["虎", "虎"], ["兔", "兔"], ["龍", "龙"], ["蛇", "蛇"], ...
Rust
0
import numpy as np import matplotlib.pyplot as plt from scipy.spatial import Voronoi from matplotlib.patches import Polygon from matplotlib.collections import PatchCollection import os # 创建保存图像的文件夹 output_folder = "voronoi_bild" if not os.path.exists(output_folder): os.makedirs(output_folder) # 函数:生成并保存一个 Voronoi...
Python
1
.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the Li...
Rust
0
class ChatManager: def __init__(self): self.chats = {} # user_id -> chat_id -> chat_data def create_chat(self, user_id, chat_id, system_prompt): """Create a new chat for a user.""" if user_id not in self.chats: self.chats[user_id] = {} self.chats[user_i...
Python
1
"*Required features: 'Win32_Devices_Tapi'*"] pub const PHONEERR_REQUESTOVERRUN: u32 = 2415919136u32; #[doc = "*Required features: 'Win32_Devices_Tapi'*"] pub const PHONEERR_RESOURCEUNAVAIL: u32 = 2415919135u32; #[doc = "*Required features: 'Win32_Devices_Tapi'*"] pub const PHONEERR_SERVICE_NOT_RUNNING: u32 = 241591914...
Rust
0
:c_int; } extern "C" { pub fn xsltExtModuleTopLevelLookup( name: *const xmlChar, URI: *const xmlChar, ) -> xsltTopLevelFunction; } extern "C" { pub fn xsltUnregisterExtModuleTopLevel( name: *const xmlChar, URI: *const xmlChar, ) -> ::std::os::raw::c_int; } extern "C" { ...
Rust
0
, t4: "10_11111111110_0_0_0_0_0_0_0_0_0_0", } } #[cfg(test)] mod validate_lbs_failure_tests { use crate::Louds; use fid_rs::Fid; macro_rules! parameterized_tests { ($($name:ident: $value:expr,)*) => { $( #[test] #[should_panic] fn $name() { ...
Rust
0
from tkinter import Label, Tk import time app_window = Tk() app_window.title("Digital Clock") app_window.geometry("420x150") app_window.resizable(1,1) text_font= ("Boulder", 68, 'bold') background = "#f2e750" foreground= "#363529" border_width = 25 label = Label(app_window, font=text_font, bg=background, fg=foreg...
Python
1
.assignments .lock() .expect("mem role based authorization store lock was poisoned"); let key = id_to_string(&identity); assignments.remove(&key); Ok(()) } fn clone_box(&self) -> Box<dyn RoleBasedAuthorizationStore> ...
Rust
0
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from setuptools import find_packages, setup MAIN_REQUIREMENTS = [ "airbyte-cdk~=0.1", ] TEST_REQUIREMENTS = [ "requests-mock~=1.9.3", "pytest~=6.1", "pytest-mock~=3.6.1", ] setup( entry_points={ "console_scripts": [ ...
Python
1
"libpcap.A.dylib", "libpcap.dylib", //Unix "libpcap.so", "libpcap.so.0.9.5", "libpcap.so.0.9.4", "libpcap.so.0.8", //Windows "NPcap\\Packet.dll", "Packet.dll", "Npcap\\wpcap.dll", "wpcap.dll" ]; pub struct PCap { dll: Container<PCapDll> } pub struct PCapInterface...
Rust
0
import paraview.web.venv # noqa from paraview import simple from trame.app import get_server from trame.ui.html import DivLayout from trame.widgets import html, client from trame_vtklocal.widgets import vtklocal from trame.decorators import TrameApp, change CLIENT_TYPE = "vue3" @TrameApp() class DemoApp: def...
Python
1
except Exception as e: logger.error(f"消息处理失败: {subscription.subscriber_id} - {e}") if delivered: self.stats['messages_delivered'] += 1 else: # 重试逻辑 if message.retry_count < message.max_...
Python
1
egree"] mbs_candidates = candidates["micro_batch_size"] sharding_stage_candidates = candidates["sharding_stage"] sharding_degree_candidates = candidates["sharding_degree"] use_recompute_candidates = candidates["use_recompute"] recompute_granularity_candidates = candidates["recompute_granularity"] ...
Python
1
if len(boxes) < self.max_objs: append_boxes = [torch.zeros( [self.max_objs - len(boxes), 4], device="cpu")] append_conds = [torch.zeros( [self.max_objs - len(boxes), self.key_dim], device="cpu")] box_out = torch.cat( boxes + append_bo...
Python
1
("assert-output-fact") .help("Infered shape and datum type must match exactly this"), ); app = app.subcommand(output_options(run)); let cost = clap::SubCommand::with_name("cost").help("Compute a cost on (some) operations."); app = app.subcommand(output_options(cost)); let optim...
Rust
0
_theirs(l1, scid41) > amount * 0.9) assert(l4.rpc.drain(scid41, 100, 4)) wait_for_all_htlcs(nodes) assert(get_ours(l1, scid41) > amount * 0.9) assert(l1.rpc.drain(scid41, 100, 4)) wait_for_all_htlcs(nodes) assert(get_theirs(l1, scid41) > amount * 0.9) assert(l4.rpc.drain(scid41, 100, 6)) ...
Python
1
uting using multi-processes and multi-GPUs, the time cost will be: 16 * (75*5+15) = 6240s / round The entire training time is larger than 6240s * 100 / 3600 = 173.3 hours = 7 days, which is prohibited in the real-world. When optimized by using MPI-based distributed computing,...
Python
1
#--------------MADE BOT WHICH REPLIES EMAILS 4 ME!!!!!!!---------------------------------- import undetected_chromedriver as uc from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.action_chains import ActionChains from...
Python
1
[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self) -> u8 { match *self { CLK_DIVR::IOCONCLKDIV0 => 0, CLK_DIVR::IOCONCLKDIV1 => 1, CLK_DIVR::IOCONCLKDIV2 => 2, CLK_DIVR::IOCONCLKDIV3 => 3, CLK_DIVR::IOCONCLKDIV4 => 4, ...
Rust
0
pub tm_min: libc::c_int, pub tm_hour: libc::c_int, pub tm_mday: libc::c_int, pub tm_mon: libc::c_int, pub tm_year: libc::c_int, pub tm_wday: libc::c_int, pub tm_yday: libc::c_int, pub tm_isdst: libc::c_int, pub tm_gmtoff: libc::c_long, pub tm_zone: *const libc::c_char, } /*- * ...
Rust
0
from __future__ import annotations from PIL import Image from xcoder.math.rect import Rect from xcoder.matrices import Matrix2x3 from xcoder.objects import Shape from xcoder.objects.renderable.display_object import DisplayObject class RenderableShape(DisplayObject): def __init__(self, shape: Shape): sup...
Python
1
import argparse def parseargs(): parser = argparse.ArgumentParser(description='Config for using LLMs.') parser.add_argument('-mn', '--mname', help='The path or name from hugging face of the model, example: "Quangnguyen711/clothes_shop_chatbot_QLoRA".', required=True, type=str) parser.add_argument('-l4', '-...
Python
1
PreloadUpdater(mock_preload_obj, mock_reload_lock, True, True, True).run(mock_database_handler) assert flatten_mock_calls(mock_reload_lock) == [["acquire", (), {}], ["release", (), {}]] assert flatten_mock_calls(mock_database_query) == [ ["object_classes", (["route", "route6"],), {}], ...
Python
1
1..]), 0b0110_0111 => (ItuTT35::Libya, &buf[1..]), 0b0110_1000 => (ItuTT35::Liechtenstein, &buf[1..]), 0b0110_1001 => (ItuTT35::Luxembourg, &buf[1..]), 0b0110_1010 => (ItuTT35::Macau, &buf[1..]), 0b0110_1011 => (ItuTT35::Madagascar, &buf[1..]), 0b0...
Rust
0
::Unknown(disk_space_result.err().unwrap().to_string()), })); } let cli_config = get_config(); if cli_config.is_err() { return Err(warp::reject::custom(RegistryError { code: RegistryErrorCode::Unknown(cli_config.err().unwrap().to_string()), })); } let mut total_a...
Rust
0
def parse_config(config_file): if config_file.endswith(".cntl"): from configobj import ConfigObj keywords = ConfigObj(config_file, file_error=True) # Split float list string keywords for key in ( "DISPLACEMENT", "DISPL0_LIG1", "DISPL1_LIG1", ...
Python
1
: Dictionary with month's performance metrics """ date_range = await self.get_trading_period_range('month') signals = await self.get_period_signals_with_results( date_range['start'], date_range['end'] ) total = len(signals) profit = le...
Python
1
/ XMM0 0xA3, 0x0A,// EVEX_Vorps_xmm_k1z_xmm_xmmm128b32 0x08,// N16b4 0x2A,// VkHW_3b 0x6D,// YMM0 0xA4, 0x0A,// EVEX_Vorps_ymm_k1z_ymm_ymmm256b32 0x09,// N32b4 0x2A,// VkHW_3b 0x8D,// ZMM0 0xA5, 0x0A,// EVEX_Vorps_zmm_k1z_zmm_zmmm512b32 0x0A,// N64b4 0x00,// Invalid ...
Rust
0
.bits >> 29) & 0x01) != 0) } #[doc = "Bit 28 - ADC_SH_MODE_EN"] #[inline(always)] pub fn adc_sh_mode_en(&self) -> ADC_SH_MODE_EN_R { ADC_SH_MODE_EN_R::new(((self.bits >> 28) & 0x01) != 0) } #[doc = "Bit 27 - ATESTLF_RCOSCLF_IBIAS_TRIM"] #[inline(always)] pub fn atestlf_rcosclf_ib...
Rust
0
合规要求冲突 for rule in rules: for req in compliance_reqs: conflict = self._check_rule_compliance_conflict(rule, req) if conflict: conflicts.append({ "type": "compliance_conflict", "rule": rule.rule_id, ...
Python
1
rmat(*table::FORMAT); table.set_titles(Row::new( ["Name", "Port", "Version", "Status"] .iter().map(|x| table::header_cell(x)).collect())); for status in statuses { table.add_row(Row::new(vec![ Cell::new(&status.name), Cell::new(&status....
Rust
0
import json import os from transformers import AutoTokenizer import argparse JSONL_FILE_DIR = "jsonl_files" TOKENIED_FILE_DIR = "tokenized_files" T5_PROMPT = {"wiki_bio": "convert the table to text: ", "totto_meta": "", "common_gen": "generate a sentence with: ", "multi_news": "...
Python
1
} #[cfg(feature = "khr_push_descriptor")] unsafe { loader.load_khr_push_descriptor(instance); } #[cfg(feature = "khr_descriptor_update_template")] unsafe { loader.load_khr_descriptor_update_template(instance); } #[cfg(feature = "khx_device_group")] unsafe { loader.load_k...
Rust
0
"""This file describes the heroic adventurer Ranger3. It's used primarily for saving characters from create-character, where there will be many missing sections. Modify this file as you level up and then re-generate the character sheet by running ``makesheets`` from the command line. """ dungeonsheets_version = "0....
Python
1
import ast from ..utils import ast_helpers def return_with_parenthesis(project_folder, *args, **kwargs): for parsed_file in project_folder.get_parsed_py_files(): file_content = parsed_file.content.split('\n') return_lines = [n.lineno for n in ast.walk(parsed_file.ast_tree) if isinstance(n, ast.Re...
Python
1
tree: Box<Tree>, skin: Box<Skin>, width: u16, }, Program { // execute an external program exe: String, args: Vec<String>, }, SystemOpen { // open a path path: PathBuf, }, } /// If s starts by a '$', replace it by the environment variable of th...
Rust
0
""" File encoding detection utilities """ import chardet from typing import Optional class EncodingDetector: """Detect file encoding automatically""" def __init__(self): self.common_encodings = ['utf-8', 'latin-1', 'iso-8859-1', 'windows-1252', 'ascii'] def detect_encoding(self, uploade...
Python
1
scale_b = B_scales.view(torch.float8_e4m3fn) else: assert False, f"unknown recipe {recipe}" def do_matmul_fp8(A, B): nonlocal scale_a nonlocal scale_b return torch._scaled_mm( A, B, scale_a, scale_b, out_dtype=d3, use_fast_accum=...
Python
1
all( feature = "simd", not(target_feature = "avx2"), target_feature = "sse2" ))] const SSE2_ALIGNMENT: usize = 16; #[cfg(all(feature = "simd", target_feature = "avx2"))] #[inline] pub fn frame(key: &[u8], input: &mut [u8], offset: usize) { unsafe { let payload_len = input.len(); // We ...
Rust
0
let _ = Command::new("sed") .arg("-i.tycho_save") .arg("-e") .arg(format!("s/SRCNAME=.*/SRCNAME=/g")) .arg("Makefile") .spawn(); let path = Path::new("src/"); for entry in path.read_dir().expect("read_dir call failed") { if let Ok(entry) = entry { let path = entry.path(); let ext = path.extension();...
Rust
0
__all__ = ['temporary_attr'] class TemporaryAttr(object): def __init__(self, inst, attr, value, skip_magic=False): self.inst = inst self.attr = attr self.value = value self.old = None if skip_magic: self.setattr = object.__setattr__ self.getattr = o...
Python
1
255. keypoint_matching_output ([`LightGlueKeypointMatchingOutput`]): Raw outputs of the model. """ warnings.warn( "`plot_keypoint_matching` is deprecated and will be removed in transformers v. " "Use `visualize_keypoint_matching` instead.", ...
Python
1
r_none(material.get('duration'), invscale=60) return { 'id': lecture_id, 'title': title, 'description': description, 'duration': duration, 'formats': formats, } class PlatziCourseIE(PlatziBaseIE): _VALID_URL = r'''(?x) ...
Python
1
rojectionElem::Downcast(name, index) => { use std::ops::Deref; let name_str = match name { None => format!("variant#{}", index.as_usize()), Some(name) => String::from(name.as_str().deref()), }; PathSelector::Downcast...
Rust
0
y called function is blocking it. // // Julia can be started with one or more threads by setting the `JULIA_NUM_THREADS` // environment variable. By default it's 1, and it must be set to a higher value in order for // the asynchronous runtime to work. The `n_threads` argument indicates how many of the...
Rust
0
SeekFrom, Write}; use std::path::Path; /// A HashMap representation of a Fasta file. #[derive(Debug, PartialEq)] pub struct FastaMap { pub id_to_seq: HashMap<String, String>, } impl FastaMap { pub fn from_fasta(path: &Path) -> Self { let reader = FastaReader::new(path); let mut entries: HashMa...
Rust
0
if let Ok(i) = endpoints.binary_search(&&y) { return Ok(self.compute_chain(self.table.get(i).unwrap(), self.t - steps)); } let h = (self.hash_function)(&y); y = (self.reduction)(&h); steps += 1; } Err("Key not found") } }...
Rust
0
} } #[cfg(any( target_os = "nacl", target_os = "macos", target_os = "ios", target_os = "android", target_os = "solaris", target_os = "illumos", target_os = "fuchsia") )] fn get_num_cpus() -> usize { // On ARM targets, processors could be turned off to save power. // Use `_SC_NP...
Rust
0
to read {}", manifest_path.display()))?; let value: toml::Value = toml::from_slice(&data).with_context(|| { format!( "could not decode the manifest file at {}", manifest_path.display() ) })?; ...
Rust
0
('𥋣', "jià"), ('𥋤', "cháng"), ('𥋥', "jí"), ('𥋮', "zhuó"), ('𥋿', "hè"), ('𥌀', "chá"), ('𥌁', "qì"), ('𥌂', "mián"), ('𥌃', "zhěn"), ('𥌄', "kū"), ('𥌅', "yè"), ('𥌆', "zhōu"), ('𥌈', "jiān"), ('𥌊', "pàn"), ('𥌍', "huī"), ('𥌏', "míng"), ('𥌐', "liù...
Rust
0
); return Ok(()); } let find_device = find_device.unwrap(); let device = { let mut device: Option<StylusDevice> = None; for (i, dev) in device_list.devices().iter().enumerate() { let name = device_list.names().nth(i).unwrap().name().to_utf8(); if name.contai...
Rust
0
# 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 use this file except in compliance # with the License. You ma...
Python
1
turns: Figure and Axes object Raises: ModuleNotFoundError: If `matplotlib` is not installed .. plot:: :scale: 75 >>> from torch import randn >>> # Example plotting a single value >>> from torchmetrics.regression i...
Python
1
self.messages, self.feature_spec_memberships[name].configmanagement, fs.membershipSpec, ) acm_status.append(cluster) return {'acm_errors': acm_errors, 'acm_status': acm_status} def fleet_default_sync_status(self, membership): if not self.f.fleetD...
Python
1
fixed by default on macOS and Windows (we // don't explicitly request it), and on Android and DragonFly we explicitly // request it as unprefixing cause segfaults (mismatches in allocators). extern "C" { #[cfg_attr(any(target_os = "macos", target_os = "android", target_os = "ios", ...
Rust
0
*f)() } CONFIGURED_PLUGINS = true; } #[macro_export] macro_rules! define_event { ( $(#[$meta:meta])* $name:ident, ($event_src:ident: &$l:lifetime $src_ty:ty $(,$arg:ident: $arg_ty:ty)*) -> $result:ty ) => { $(#[$meta])* pub mod $name { pub use super::*; ...
Rust
0
Vec<Frame>; fn expecting(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result { fmt.write_str("a json array or map") } fn visit_map<M: serde::de::MapAccess<'de>>(self, mut map: M) -> Result<Self::Value, M::Error> { let mut frames = Vec::new(); while let Some(key) = map.next...
Rust
0
# Этот файл был сгенерирован тНавигатор v23.4-5689-g1082f6c. # Copyright (C) Рок Флоу Динамикс 2005-2024. # Все права защищены. # This file is MACHINE GENERATED! Do not edit. #api_version=v0_0_117 from __main__.tnav.workflow import * from tnav_debug_utilities import * from datetime import datetime, timedelta de...
Python
1
ptr() as *mut u8, encrypted_data.len().try_into()?, std::ptr::null_mut(), &mut data_len, )) .into_result()?; } let mut data = vec![0; data_len.try_into()?]; unsafe { Rv::from(get_pkcs11!(self.client(), C_Decryp...
Rust
0
get_contract_web = warp::path::path("contract") .map(move || (request_sender.clone(), contract_store.clone())) .and(warp::path::param()) .and(warp::path::end()) .and_then(|(rs, cs), key: String| async move { handle_contract(key, rs, cs).await }); let get_contract...
Rust
0
=[ derive(StableAbi), ] } //////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// impl Display for LifetimeIndex{ fn fmt(&self,f:&mut fmt::Formatter<'_>)->fmt::Result{ match *self { ...
Rust
0
def _flat_reconstruction_loss(self, flat_x_target, flat_rnn_output): # flat_x_target is by default shape (1,27), [on/offs... vels...offsets...] # split into 3 equal length vectors target_hits, target_velocities, target_offsets = tf.split( flat_x_target, 3, axis=1) output_hits, output_velociti...
Python
1
Required features: 'Win32_System_SystemServices'*"] pub const SUBLANG_KASHMIRI_SASIA: u32 = 2u32; #[doc = "*Required features: 'Win32_System_SystemServices'*"] pub const SUBLANG_KAZAK_KAZAKHSTAN: u32 = 1u32; #[doc = "*Required features: 'Win32_System_SystemServices'*"] pub const SUBLANG_KHMER_CAMBODIA: u32 = 1u32; #[do...
Rust
0
N×K×3 img_pre = ArSSR(img_lr, xyz_hr, H, W, D) # N×K×1 loss = loss_fun(img_pre, img_hr) # frequency # freq_hr = torch.fft.fftn(img_hr) # freq_pred = torch.fft.fftn(img_pre) # # loss2 = loss_fun(freq_pred, freq_hr) # loss2, reg = loss...
Python
1
ription": "The text to wait for to disappear", }, }, "required": [], }, } run_shell_command = _RunShellCommandTool() run_ipython_cell = _RunIPythonCellTool() browser_close = BrowserCloseTool() browser_resize = BrowserResizeTool() browser_console_messages = BrowserCo...
Python
1
can't be less then `vert_seqno_incr`".to_string())) } if (vert_seqno_incr == 0) ^ prev_vert_ref.is_none() { fail!(BlockError::InvalidArg( "`prev_vert_ref` may be Some only if `vert_seqno_incr != 0` and vice versa".to_string())) } self.vert_seqno_incr = vert_...
Rust
0
_sha256(&mut self, hash: &[u8]) -> Result<(), Error> { let mut reader = Cursor::new(hash); self.boot_cfg.hash_0 = reader.read_u32::<NativeEndian>()?; self.boot_cfg.hash_1 = reader.read_u32::<NativeEndian>()?; self.boot_cfg.hash_2 = reader.read_u32::<NativeEndian>()?; self.boot_cf...
Rust
0
import torch import torch.nn.functional as F import numpy as np def random_affine_matrix(rot_factor = 0.2, trans_factor = 0, scale_factor = 0.0, B=1): scale_rand = torch.randn(B,1)*scale_factor+1 scale_rand = torch.clip(scale_rand, 1-scale_factor, 1+scale_factor) scale_rand = scale_rand.repeat(1,3) ...
Python
1
mask: None, broadcast: None }, &[102, 15, 243, 193], OperandSize::Qword) } fn psllq_12() { run_test(&Instruction { mnemonic: Mnemonic::PSLLQ, operand1: Some(Direct(XMM4)), operand2: Some(IndirectScaledIndexedDisplaced(RAX, RAX, Two, 103442484, Some(OperandSize::Xmmword), None)), operand3: None, operand4: None, lo...
Rust
0
taOp(MetaOp), MiscOp(MiscOp), StringOp(StringOp), ListOp(ListOp), SetOp(SetOp), HashOp(HashOp), } #[derive(Clone, Debug, PartialEq)] pub enum MetaOp { NoOp, Unrecognized, Quit, } #[derive(Clone, Debug, PartialEq)] pub enum MiscOp { Ping, } #[derive(Clone, Debug, PartialEq)] pub en...
Rust
0
&GitConfig, branch: &LocalBranch) -> Result<String> { let push_remote_key = format!("branch.{}.pushRemote", branch.short_name()); if let Some(push_remote) = get::<String>(config, &push_remote_key).read()? { return Ok(push_remote.unwrap()); } if let Some(push_default) = get::<String>(config, "r...
Rust
0
from gemini import Gemini_Model from llama import Llama_Model from gpt import GPT_Model class Compare_Model: def GeminiVsLlama(user_input): print("Gemini Model: ") geminiOutput = Gemini_Model.output(user_input) print("Llama Model: ") llamaOutput = Llama_Model.output(user_input) output = "Gemini: " + gemi...
Python
1
import PyQuest class Quest: @staticmethod def quest_instance(): return PyQuest.PyQuest() @staticmethod def GetActiveQuest(): """ Purpose: Retrieve the active quest. Args: None Returns: int """ return Quest.quest_instance().get_active_quest_id() ...
Python
1
items.count(x)] for x in set(items)]: query = self.get_task_query({search_key: id}) self.assertEqual(count, query.count()) # Tests to ensure there are no regressions from query refactor # https://bugzilla.redhat.com/show_bug.cgi?id=1224848 def test_search_api_directly(self): ...
Python
1
), getopts::optflag("u", "unique", "only print unique lines"), getopts::optflag("h", "help", "display this help and exit"), getopts::optflag("V", "version", "output version information and exit") ]; let matches = match getopts::getopts(args.tail(), &opts) { Ok(m) => m, Er...
Rust
0
self.cell_formats.set_attributes(reader, e); } b"cellStyles" => { self.cell_styles.set_attributes(reader, e); } b"dxfs" => { self.differential_formats.set_attributes(r...
Rust
0
import torch from . import utils class Metric: @staticmethod def anisotropic_reconstruction(x, current, verts, faces, face_normals, bdry_edges): bs = x.shape[0] reshaped_faces = faces.view(bs, -1, 1).expand(-1, -1, 3) face_verts = torch.gather(verts...
Python
1
or() as cursor: sql = ( f'DELETE FROM {TABLE_NAME} ' 'WHERE id = %s' ) print(cursor.execute(sql, (1,))) # type: ignore connection.commit() cursor.execute(f'SELECT * FROM {TABLE_NAME} ') # type: ignore for row in cursor.fetchall(): # type: igno...
Python
1
terApiInstanceMut { #[inline] pub fn read_variable_f32(&mut self, variable: &str) -> Option<f32> { let variable = hash(variable.as_bytes()); let var = unsafe { (*self.api).read_variable.unwrap()(self.ctx, variable) }; if !var.data.is_null() { let data = unsafe { slice...
Rust
0
oken_text): suffix = whole_text[len(prop_token_text):] suffix_tokens = enc.encode(suffix) # a list inp[i + 1:i + 1] = suffix_tokens # insert suffix tokens into list break ...
Python
1
# 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 logging import os import sys from dinov2.eval.knn import get_args_parser as get_knn_args_parser from dinov2.logging ...
Python
1
.unwrap_or_else(|| DEFAULT_MANIFEST_FILE.as_ref()); spin_loader::from_file(manifest_file, working_dir).await? } (None, Some(bindle)) => match &self.server { Some(server) => spin_loader::from_bindle(bindle, server, working_dir).await?, ...
Rust
0
chived: query += " and archived=0" result = ( ( await self._connection.execute( text(query), {"parent_ref_id": parent_ref_id.as_int()} ) ) .mappings() .all() ) return [ Per...
Python
1