text
string
label_name
string
labels
int64
torch.stack( (poses[..., 0], poses_local[..., 1], poses[..., 1]), axis=-1) # Rotate the vel_trajectory vel_trajectory = torch.einsum("...j,...jk->...k", vel_trajectory_local, rotations) # Integrate the trajectory # Already have the good...
Python
1
# Copyright (c) 2025 Carnegie Mellon University. # NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE # ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS. # CARNEGIE MELLON UNIVERSITY MAKES NO WARRANTIES OF ANY KIND, # EITHER EXPRESSED OR IMPLIED, AS TO ANY MATTER INCLUDING, BUT # NOT LIMITED...
Python
1
se_error.get('error', 'Unknown error')}"], "warnings": ["Could not validate individual files due to browsing failure"], }, "summary": { "package_exists": True, "validation_limited": True, "reason": "Package b...
Python
1
n self._UserId @UserId.setter def UserId(self, UserId): self._UserId = UserId def _deserialize(self, params): self._UserName = params.get("UserName") self._UserId = params.get("UserId") memeber_set = set(params.keys()) for name, value in vars(self).items(): ...
Python
1
# Generated by Ollama Llama 3 # Task: inside_op_misc_scenarios_rich # Attempt: 6 # Success: False # Overall Score: 0.308 Here's a simplified version of your requirements, just for reference and to illustrate how you might start implementing them in Python using PyVerilog library which is based on AST (Abstract Syntax ...
Python
1
} } } } // A point is in a box when its coordinates are smaller or equal than the top // right and larger or equal than the bottom left. fn point_in_rect(x: f32, y: f32, left: f32, bottom: f32, right: f32, top: f32) -> bool { x >= left && x <= right && y >= bottom && y <= top } use std::{convert::Infal...
Rust
0
#!/usr/bin/env python3 import sys,os,math,subprocess Cores = 28 GauEnv = 'chem/g16/b01' PttAccMem = {'stf' : ['compute','stf','118G'], 'chem': ['compute','chem','118G']} def checkcommand(): if len(sys.argv)!=5: raise SystemExit("Usage: python gaussian-klone.py input-file partition node-num time-float-in-...
Python
1
2] # tile reduction axes n, f, y, x = s[OL].op.axis rc, ry, rx = s[OL].op.reduce_axis rco, rcm, rci = cfg["tile_rc"].apply(s, OL, rc) s[OL].reorder(rco, rcm, ry, rx, rci, n, f, y, x) s[AA].compute_at(s[OL], rx) s[WW].compute_at(s[OL],...
Python
1
import numpy as np import json from pyserini.search.lucene import LuceneSearcher from sentence_transformers import CrossEncoder def rerank_passages(query, passages, reranker): res = [] query_passage_pairs = [[query, passage['passage_text']] for passage in passages] scores = reranker.predict(query_passage_...
Python
1
t(np.ceil(float(num_vectors) / vector_batch)) args_list = [] for vector_round in range(vector_rounds): start_index = vector_round * vector_batch stop_index = (vector_round + 1) * vector_batch assert start_index < num_vectors stop_index = min(stop_index, n...
Python
1
import os from dotenv import load_dotenv load_dotenv() configs_list = list() # Receivers coordinates receiver_coordination_1 = os.getenv("receiver_coordination_1") configs_list.append(os.getenv("receiver_coordination_1")) receiver_coordination_2 = os.getenv("receiver_coordination_2"), configs_list.append(os.getenv("...
Python
1
ptions are we making that might not hold in all cases? What valid counterarguments or alternative viewpoints exist? Where might this reasoning break down or face legitimate challenges? What evidence supports AND contradicts this position? Please revise your response to: Acknowledge what you genuinely agree with AND w...
Python
1
# Copyright (c) 2020 PaddlePaddle Authors. 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 required by appl...
Python
1
DoubleEndedIterator for MapxOrdRawValueValuesMut<'a> { fn next_back(&mut self) -> Option<Self::Item> { self.inner.next_back().map(|(_, v)| v) } } ///////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////// ...
Rust
0
und a type that isn't defined elif type_ not in types: raise ValueError(f"No definition of type `{type_}`") results.add(type_) for field in types[type_]: find_type_dependencies(field["type"], types, results) return results def encode_type(type_: str, types: Dict[str, List[Dict[str, s...
Python
1
tch self { Self::Wrap => "WRAP", Self::Mirror => "MIRROR", Self::Clamp => "CLAMP", Self::Border => "BORDER", Self::None => "NONE", } } } impl Display for WrapMode { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { D...
Rust
0
let p = self.p.take().ok_or_else(argmin_error_closure!( PotentialBug, "`ConjugateGradient`: Field `p` not set" ))?; let r = self.r.as_ref().ok_or_else(argmin_error_closure!( PotentialBug, "`ConjugateGradient`: Field `r` not set" ))?; l...
Rust
0
thod represents a failure to find a method in /// an actor InvalidMethod, /// InvalidArguments indicates that a method was called with the incorrect /// number of arguments, or that its arguments did not satisfy its /// preconditions InvalidArguments, /// InsufficientFunds represents a fai...
Rust
0
().skip(word_start).take(word_end-word_start).collect(); words.push(word); word_start = word_end; word_end = word_start+1; } words.reverse(); words.join(" ") } } // submission codes end #[cfg(test)] mod tests { use super::*; #[test] fn tes...
Rust
0
nt) pub mod project_environment { /// A builder for [`ProjectEnvironment`](crate::model::ProjectEnvironment) #[non_exhaustive] #[derive(std::default::Default, std::clone::Clone, std::cmp::PartialEq, std::fmt::Debug)] pub struct Builder { pub(crate) r#type: std::option::Option<crate::model::Envir...
Rust
0
node_phi=grad_phi[:, 0:5], node_grad=hessian_phi[:, 0:5] if hessian_phi is not None else None, graph_node=graph_node, graph_edge=graph_edge, ) ''' >>> fix face flux BC >>> ''' uv_face_new = self._fix_face_flux_BC( face_flux = phi_face[:, 0:...
Python
1
representation structure, or their must only be one element in Axis-angle representation. The final case is that there must only be one element in the vector field. There are currently {} elements in vector and {} elements in Axis-angle representation", nelems, rnelems); //We need to s...
Rust
0
min, event_van_driel_total, ]; let ids = vec![ menu_ids.button_explanation_1, menu_ids.button_explanation_2, menu_ids.button_explanation_3, menu_ids.button_explanation_4, ]; // find the index I should drop let drop_index = match scene.get_explanation_mode() {...
Rust
0
of the "mineable" txs. assert_eq!( txs.iter().map(|x| x.fee(header.height)).collect::<Vec<_>>(), [88, 82, 80, 77, 74] ); assert_eq!( txs.iter().map(|x| x.weight()).collect::<Vec<_>>(), [25, 25, 46, 46, 46] ); assert_eq!( txs.iter() .map(|x| x.fee_rate(header.height)) .collect::<Vec<_>>(), [3, 3,...
Rust
0
import logging import shutil from pathlib import Path logger = logging.getLogger(__name__) import hydra from omegaconf import DictConfig from ..utils import run_in_env, temp_env from . import CFG_YAML, DATASETS @hydra.main(version_base=None, config_path=str(CFG_YAML.parent), config_name=CFG_YAML.stem) def main(cfg...
Python
1
import numpy as np from metaworld.policies.action import Action from metaworld.policies.policy import Policy, assert_fully_parsed, move class SawyerHandInsertV1Policy(Policy): @staticmethod @assert_fully_parsed def _parse_obs(obs): return { 'hand_pos': obs[:3], 'obj_pos':...
Python
1
d: game = recent_sched[0] print(f"Game found: {game}") # Try to get boxscore if game has an ID if isinstance(game, dict) and "game_id" in game: boxscore = statsapi.boxscore(game["game_id"]) print(f"Boxscore type: {type(boxscore)}") ...
Python
1
import pandas as pd import time import numpy as np import datetime from icecream import ic # encoding the timestamp data cyclically. See Medium Article. def process_data(source): df = pd.read_csv(source) timestamps = [ts.split('+')[0] for ts in df['timestamp']] timestamps_hour = np.array([float(...
Python
1
ame, create_mosaic_img()) def update_box_w(new_box_w): global mask_img global box_w if new_box_w < 1: new_box_w = 1 box_w = new_box_w mask_img = np.zeros_like(mask_img, dtype=mask_img.dtype) mask_img[box_t:box_t+box_h, box_l:box_l+box_w] = 255 cv2...
Python
1
value::method::Method; use jlrs::value::method_instance::MethodInstance; use jlrs::value::simple_vector::SimpleVector; use jlrs::value::type_name::TypeName; use jlrs::value::type_var::TypeVar; use jlrs::value::union::Union; use jlrs::value::union_all::UnionAll; #[test] fn datatype_methods() { JULIA.with(|j| { ...
Rust
0
import sublime import Vintageous.ex.plat as plat import Vintageous.ex.plat.linux import Vintageous.ex.plat.osx import Vintageous.ex.plat.windows def run_and_wait(view, cmd): if plat.HOST_PLATFORM == plat.WINDOWS: plat.windows.run_and_wait(view, cmd) elif plat.HOST_PLATFORM == plat.LINUX: plat...
Python
1
struct PersonSpawner { no_of_persons: u32 } impl PersonSpawner { pub fn new() -> PersonSpawner { PersonSpawner { no_of_persons: 0 } } } impl System for PersonSpawner { fn update(&mut self, entities: &mut EntityManager, args:UpdateArgs){ if self.no_of_persons < 5 { let mut rng = rand::thread_rng(); ...
Rust
0
ount >= self.max_retries: print(f"已达最大重试次数({self.max_retries}次),程序退出") self.stop() break def stop(self): """停止系统运行""" self.running = False def get_recognized_result(self): """获取识别结果的方法""" return self.recognized_result ...
Python
1
#!/usr/bin/env python3 from sys import exit from test.http_test import HTTPTest from test.base_test import HTTP, HTTPS from misc.wget_file import WgetFile """ This is a Prototype Test File. Ideally this File should be copied and edited to write new tests. """ ############# File Definitions ####################...
Python
1
ut builder), 1); assert_eq!(builder.finish().to_vec(), vec![Some(3)]); let mut builder = I32ArrayBuilder::new(); assert_eq!(scanner.next_batch(None, &mut builder), 0); } } <gh_stars>10-100 // Copyright 2020 <NAME> and the rust-fuse contributors. // // Licensed under the Apache License, Ver...
Rust
0
import os from django.core.exceptions import ImproperlyConfigured def setup(settings): """ This function is called after Baserow as setup its own Django settings file but before Django starts. Read and modify provided settings object as appropriate just like you would in a normal Django settings file...
Python
1
# -*- coding: utf-8 -*- from __future__ import print_function # feProblem.setVerbosityLevel(0) dx= 1 dy= 2 dz= 3 import geom import xc __author__= "Luis C. Pérez Tato (LCPT)" __copyright__= "Copyright 2014, LCPT" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@gmail.com" NumDiv= 4 CooMax= NumDiv feProb...
Python
1
""" Archivo: pyqt5_app.py Autor: Edwin Yoner Fecha: 18/02/2025 Descripción: Este programa crea una interfaz gráfica con PyQt5 que incluye un label, dos botones ("Activar" y "Desactivar") y un slider. Se manejan eventos para detectar clics en los botones y cambios en el slider. """ import os # Configuraci...
Python
1
_unpatch_intrins_from_runtime(intrinsics=None): """Remove intrinsics from runtime.""" _iter_intrins(_unregister_intrin_emulate, '_token', intrinsics=intrinsics) def _patch_intrins_to_calls(intrinsics=None): """Register intrinsics to calls.""" _iter_intrins(_register_intrin, '_token', '_intrin', intrin...
Python
1
tclchiam/weave-ce<filename>weave/src/zdd2/forest/node/union.rs use super::Node; pub fn union(node1: Node, node2: Node) -> Node { if node1 == node2 { return node1; } let (id, low, high) = match (node1, node2) { (_, Node::Never) => return node1, (Node::Never, _) => return node2, ...
Rust
0
ure and instantiate the RL trainer cfg_trainer = {"timesteps": 36000, "headless": True} trainer = SequentialTrainer(cfg=cfg_trainer, env=env, agents=agent) # start training trainer.train() # # --------------------------------------------------------- # # comment the code above: `trainer.train()`, and... # # uncommen...
Python
1
honAdapter) -> None: """Test that multiple operations can run concurrently.""" local_path1 = Path("/tmp/test-repo1") local_path2 = Path("/tmp/test-repo2") with patch(f"{MODULE_PATH}.Repo") as mock_repo_class: mock_repo_class.return_value = MagicMock() # Run multiple operations concurre...
Python
1
shaderEngineCount: u32, pub shaderArraysPerEngineCount: u32, pub computeUnitsPerShaderArray: u32, pub simdPerComputeUnit: u32, pub wavefrontsPerSimd: u32, pub wavefrontSize: u32, pub sgprsPerSimd: u32, pub minSgprAllocation: u32, pub maxSgprAllocation: u32, pub sgprAllocationGranula...
Rust
0
}, (&"eyr", value) => { // eyr (Expiration Year) - four digits; at least 2020 and at most 2030. match value.parse::<i32>() { Ok(year) => { if year < 2020 || year > 2030 { ...
Rust
0
s access counter."] pub struct DBUS_TO_FLASH_END_VADDR_R(crate::FieldReader<u32, u32>); impl DBUS_TO_FLASH_END_VADDR_R { #[inline(always)] pub(crate) fn new(bits: u32) -> Self { DBUS_TO_FLASH_END_VADDR_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for DBUS_TO_FLASH_END_VADDR_R { typ...
Rust
0
self.oid, self.name, self.db_oid ).as_bytes()) } } impl MiniClassRecord { pub fn new(oid: Oid, name: String, db_oid: Oid) -> MiniClassRecord { MiniClassRecord { oid: oid, name: name, db_oid: db_oid } } } impl R...
Rust
0
unused)] pub(crate) fn as_slice(&self) -> &[crate::lightning::util::errors::APIError] { unsafe { std::slice::from_raw_parts_mut(self.data, self.datalen) } } } impl From<Vec<crate::lightning::util::errors::APIError>> for CVec_APIErrorZ { fn from(v: Vec<crate::lightning::util::errors::APIError>) -> Self { let datal...
Rust
0
aint_brush(&editor, pos); } super::Event::None } fn handle_drag(&self, editor: Rc<RefCell<Editor>>, _start: Position, cur: Position) -> super::Event { self.paint_brush(&editor, cur); super::Event::None } }#![cfg_attr(test, feature(test))] #[cfg(test)] use std::cmp; #[c...
Rust
0
t = aphrodite_model.model.chat(msg, sampling_params=SAMPLING_PARAMS) outputs.extend(output) logprobs = aphrodite_runner._final_steps_generate_w_logprobs(outputs) check_logprobs_close(outputs_0_lst=EXPECTED_CHAT_LOGPROBS, outputs_1...
Python
1
AtomPlugin { urids: URIDs, } unsafe impl UriBound for AtomPlugin { const URI: &'static [u8] = b"urn:rust-lv2:atom-plugin\0"; } impl Plugin for AtomPlugin { type Ports = Ports; type Features = Features<'static>; fn new(_plugin_info: &PluginInfo, features: Features) -> Option<Self> { Some(S...
Rust
0
pt, ) ) representative_drug_agent.enable_message(SubmitAnswer) representative_drug_agent.enable_message(FinalAnswerTool) representative_drug_agent.enable_message(FeedbackTool, use=False) cat_summary = {} def handle_submit_answer(msg: SubmitAnswer) -> str: ...
Python
1
self.compositor.create_surface(); let inner = Rc::new(RefCell::new(PointerInner { surface: surface.detach(), themes: self.themes.clone(), last_serial: 0, current_cursor: "left_ptr".into(), scale_factor: 1, })); let inner2 = inner.clon...
Rust
0
tores ownership proposal struct of type [`OwnershipProposal`] at the given key static OWNERSHIP_PROPOSAL: Item<OwnershipProposal> = Item::new("ownership_proposal"); /// ## Description /// Specific type for updating owner fn type UpdateOwnerFn = fn(&mut dyn Storage, CanonicalAddr) -> StdResult<()>; /// ## Description ...
Rust
0
ax_priority_fee_per_gas, 'type': type, 'chainId': chainid, } return transaction def assemble_tx(tx_params: dict, params: EthKmsParams, eth_checksum_addr: str, chainid: int) -> (bytes, bytes): tx_unsigned = serializable_unsigned_transaction_from_dict(transaction_dict=tx_params) tx_hash...
Python
1
); // eprintln!("{:?}\t{}", &bests, &combinations[pref_idx]); } } // and we are done with the main task! eprintln!( "{}\t\tPreferencing complete: {} ballots. ({} were BTL)", ttyjump(), progress, btl_count ); eprintln!("\t\tAggregating Absents, Pos...
Rust
0
"""Gaussian process based regression and classification.""" # Author: Jan Hendrik Metzen <jhm@informatik.uni-bremen.de> # Vincent Dubourg <vincent.dubourg@gmail.com> # (mostly translation, see implementation details) # License: BSD 3 clause from . import kernels from ._gpc import GaussianProcessClassi...
Python
1
[ "git", "for-each-ref", "--format=%(refname:short)%09%(objectname)", "refs/remotes/", ], cwd=str(Path("/bin") / "test_curr_path"), timeout=20, ...
Python
1
accounts.store(&replicator_pubkey, &replicator_account); // check that 4x credits worth of points are available assert_eq!(storage_accounts.points(), credits * 2 * 2); storage_accounts.store(&validator_pubkey, &validator_account); storage_accounts.store(&replicator_pubkey, &replicator_a...
Rust
0
""" códigos wiews psc_treinamento""" from django.http import HttpResponse def index(request): return HttpResponse("Bem vindo a Treinamentos PSC SOLUÇÕES INTELIGENTES") # Create your views here.
Python
1
assert_eq!(merged_vals, vec![1, 2, 4, 7, 8, 12, 15, 17]); assert_eq!(merged_rmins, vec![1, 2, 4, 6, 8, 10, 13, 16]); assert_eq!(merged_rmaxs, vec![1, 3, 6, 8, 11, 13, 15, 16]); let epsilon: f64 = 0.2; let compressed = compress(merged, 4, epsilon); let compressed_vals: Vec<i32> ...
Rust
0
"""KIRA interface to receive UDP packets from an IR-IP bridge.""" from __future__ import annotations import logging from homeassistant.components.sensor import SensorEntity from homeassistant.const import CONF_DEVICE, CONF_NAME, STATE_UNKNOWN from homeassistant.core import HomeAssistant from homeassistant.helpers.ent...
Python
1
) ]) # publish self.battery.header.stamp = rclpy.clock.Clock().now().to_msg() charging_percentage = min(100.0, charging_percentage) self.battery.percentage = charging_percentage if charging_percentage == 100.0: self.battery.power_supply_status = sens...
Python
1
""" hcl_pdra25: basis.py Routines to define and change bases and coordinate systems. """ import numpy as np """ Define a local FAC system based on b and v (in the same coordinate system)""" def local_FAC(b, v): b_hat = np.einsum('ti,t->ti', b.values, np.reciprocal(np.linalg.norm(b.values, axis=1))) v_hat =...
Python
1
#!/usr/bin/env python # coding: utf-8 # In[1]: import pandas as pd import numpy as np column_names = ['user_id', 'item_id', 'rating', 'timestamp'] df = pd.read_csv('http://files.grouplens.org/datasets/movielens/ml-100k/u.data', sep='\t', names=column_names) df = df.drop('timestamp', axis=1) user_item_matrix = df.piv...
Python
1
= 0xF4, subopcode = 0x0A, operands(PC8))] #[insn(opcode = 0xF5, subopcode = 0x0A, operands(PC16))] BS, /// The BZ instruction. /// /// Branches to the PC-relative target when the zero bit is set. #[insn(opcode = 0xF4, subopcode = 0x0B, operands(PC8))] #[insn(opcode = 0xF5, subopcode = 0x0B...
Rust
0
y the /// backing algorithm (AES-GMAC/AES-CMAC). /// /// Passing IV is required for GMAC mode, otherwise don't pass it for OMAC. pub fn new_mac(&self, secret: &[u8], iv: Option<&[u8]>) -> Result<Hash> { self.create_hash(Some(secret), iv) } } struct HashHandle { handle: BCRYPT_HASH_HANDL...
Rust
0
ent as * const _ as usize } , 24usize , concat ! ("Offset of field: " , stringify ! (SQL_NET_STATS) , "::" , stringify ! (uiNetStatsBytesSent))) ; assert_eq ! (unsafe { & (* (:: std :: ptr :: null :: < SQL_NET_STATS > ())) . uiNetStatsBytesReceived as * const _ as usize } , 32usize , concat ! ("Offset of field: " ,...
Rust
0
=1.0, kernel_size=16) frequencies = ['delta', 'theta', 'alpha', 'all'] print("Computing MS-SSIM...") frequency_data = {} for frequency in frequencies: pbar = tqdm(enumerate(test_loader), total=len(test_loader)) ms_ssim_list = [] print(frequency) print("-----------------...
Python
1
Result<V::Value, SerdeNameError> where V: Visitor<'de>, { Err(SerdeNameError(Some(name))) } fn deserialize_enum<V>( self, name: &'static str, _variants: &'static [&'static str], _visitor: V, ) -> std::result::Result<V::Value, SerdeNameError> where...
Rust
0
Element's content or border box. ResizeObserver avoids infinite callback /// loops and cyclic dependencies that are often created when resizing via a /// callback function. It does this by only processing elements deeper in the /// DOM in subsequent frames. /// /// See also https://developer.mozilla.org/en-US/docs/Web...
Rust
0
eaction_remove_all(self, reaction): guild = self.get_guild(reaction["guild_id"]) channel = guild.get_channel(reaction["channel_id"]) index = get_index(self.messages, reaction["message_id"], key=lambda m: m.id) if index is None: message = reaction["message_id"] else:...
Python
1
eturn Err(ProgramError::IncorrectProgramId); } verify_gatekeeper_length(gatekeeper_account_info)?; let mut gateway_token = try_from_slice_incomplete::<GatewayToken>(*gateway_token_info.data.borrow())?; let (gatekeeper_address, _gatekeeper_bump_seed) = get_gatekeeper_address_with_seed( ...
Rust
0
unwrap(); assert_eq!(run_a(&sample_res).ok(), Some(165)); assert_eq!(run_b(&sample_res_2).ok(), Some(208)); } use span::Span; use crate::Expression; #[derive(Debug, Clone)] pub struct ExpressionStatement { pub span: Span, pub expression: Expression, } <filename>parser/src/parser/tests/features.rs //! Tests...
Rust
0
def load_samples(self, index): labels4, segments4 = [], [] s = self.img_size yc, xc = [int(random.uniform(-x, 2 * s + x)) for x in self.mosaic_border] indices = [index] + random.choices(self.indices, k=3) for i, index in enumerate(indices): img, _, (h, w) = load_image(self, index) if...
Python
1
Error parsing {:?}\n {:?}", d.path, e); std::process::exit(1) }, }; let area = the_area(&data); let midline = the_midline(&data); let speed1 = the_speed_in(0.0, 4.0, &data); let speed2 = the_speed_in(1.5, 3.5, &data); let xs = the_coord(|d| d.x, &...
Rust
0
bp.set_attribute('noise_accel_stddev_y', str(0.001)) bp.set_attribute('noise_accel_stddev_z', str(0.015)) bp.set_attribute('noise_gyro_stddev_x', str(0.001)) bp.set_attribute('noise_gyro_stddev_y', str(0.001)) bp.set_attribute(...
Python
1
} } use std::error::Error; use std::fmt::Display; use std::sync::Arc; use err_derive::Error; use async_trait::async_trait; use serde::Deserialize; use serde::de::DeserializeOwned; use futures::StreamExt; use itertools::Itertools; use percent_encoding::{utf8_percent_encode, NON_ALPHANUMERIC}; use chrono::DateTime; use...
Rust
0
import os import sys import random def run_train(device='0', tag='spatial_sgdet'): port = random.randint(10000,59999) num_devices = len(device.split(',')) os.environ['CUDA_VISIBLE_DEVICES'] = device os.system(f"python -m torch.distributed.launch \ --master_addr 127.0.0.1 \ ...
Python
1
um)] val_acc_performance = val_acc - baseline # 奖励设置优先以 训练集节点节点是否预测成功为首,若预测成功,则计算应逐步减少节点聚合数量?? # TODO:设置多尺度奖励: r = 0.6 * (测试集分类准确率) + 0.2 * (当前批次节点聚合邻居数目相较于上一批次节点数目增量的负数) + 0.2 * (验证集相较于过去十个批次平均提升准确率是否上升): 结合节点计算效率与准确性 rewards = [x + y + val_acc_performance for x, y in zip(train_acc_per...
Python
1
er_pcd = o3d.geometry.PointCloud() # primary_cluster_pcd.points = o3d.utility.Vector3dVector(largest_cluster_points) # # if len(pcd.points) < 100: # print("less than 100 points in this point cloud, skipping") # continue # # ...
Python
1
elf, name, old_value, new_value): self.encoding.y = new_value return self.change_hook() def _y_agg_changed_callback(self, name, old_value, new_value): if new_value == "none": self.encoding.y_aggregation = None else: self.encoding.y_aggregation = new_value ...
Python
1
DEBUG_OUTPUT); gl::DebugMessageCallback(callaback, ptr::null()); gl::BlendFunc(gl::SRC_ALPHA, gl::ONE_MINUS_SRC_ALPHA); gl::Enable(gl::BLEND); gl::Enable(gl::PROGRAM_POINT_SIZE); gl::LineWidth(1.0); let mut vao = 0; gl::GenVertexArray...
Rust
0
eError("Invalid value %s for norm, must be None, 'ortho' or " "'no norm'" % norm) return norm if scikits_cuda_available: # @op_lifter([theano.tensor.fft.FFTOp]) # @register_opt2([theano.tensor.fft.FFTOp], 'fast_compile') @register_opt('fast_compile') @op_lifter([cascadenet....
Python
1
import tkinter as tk from tkinter import simpledialog import LoginIntegrador.Menu.menu_principal as menup def contactanos(): # Información de contacto predeterminada contactos = [ ["Brian Difilipo", "2604511997", "Briandifilipo@hotmail.com"], ["Dalma Ponce", "3834000000", "dalma@hotmail.com"], ...
Python
1
clippy::let_and_return)] #[inline(always)] pub fn decode_pre_d(opu: u32) -> (u32, u32) { debug_assert_eq!(opu.get_bits(0, 3), 0x6); let match_len = opu.get_bits(3, 3) + 0x03; let literal_len = opu.get_bits(6, 2); debug_assert!(0x00 < literal_len); debug_assert!(literal_len <= 0x03); debug_assert...
Rust
0
# ----------------------------------------------------------------------------- # SF2527 Numerical Methods for Differential Equations I # Computer Exercise 1, Part 1-b # # Author: Alessio / Tim # Date: 26 August 2025 # ----------------------------------------------------------------------------- import numpy as np imp...
Python
1
ig_addr() -> Result<MultisigAddress, Box<dyn Error>> { MultisigAddress::new( 1, 2, &[ "<KEY>".parse()?, "BFRTECKTOOE7A5LHCF3TTEOH2A7BW46IYT2SX5VP6ANKEXHZYJY77SJTVM".parse()?, "47YPQTIGQEO7T4Y4RWDYWEKV6RTR2UNBQXBABEEGM72ESWDQNCQ52OPASU".parse()?, ],...
Rust
0
for arrival in sorted( stop.get_time_to_arrivals(stop_times_dataset=stop_times_dataset) ) ] ) print(stop.alerts) print() print("Route Status:") print("===============") if len(route_statuses) == 0: ...
Python
1
: bool = false; } /// Contains supertraits used to restrict which traits users can implement mod private { pub trait SealedTx {} pub trait SealedTxHalfDuplex {} pub trait SealedRx {} pub trait SealedRtsDe {} pub trait SealedCts {} } <gh_stars>0 //! Run-time feature detection for RISC-V on Linux. ...
Rust
0
#!/usr/bin/env python import sys import matplotlib.pyplot as plt import numpy as np import pywt usage = """ Usage: python waveinfo.py waveletname Example: python waveinfo.py 'sym5' """ try: wavelet = pywt.Wavelet(sys.argv[1]) try: level = int(sys.argv[2]) except IndexError as e: ...
Python
1
ter_width = "16")] mod counter { use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering as O}; use std::usize; #[derive(Debug)] pub struct Counter { n1: AtomicUsize, n2: AtomicUsize, } pub const COUNTER_INIT: Counter = Counter { n1: ATOMIC_USIZE_INIT, ...
Rust
0
# export PYTHONPATH=/Applications/ParaView-5.12.0-RC1.app/Contents/Python/ # export DYLD_LIBRARY_PATH=/Applications/ParaView-5.12.0-RC1.app/Contents/Libraries/ from paraview import simple from trame.app import get_server from trame.ui.html import DivLayout from trame.widgets import html, paraview # create a new 'IOS...
Python
1
grade_table: vec![], } } pub fn add(&mut self, grade: u32, student: &str) { self.grade_table.push((student.to_string(), grade)); } pub fn grades(&self) -> Vec<u32> { let mut result = vec![]; for t in self.grade_table.iter() { result.push(t.1); ...
Rust
0
sev::Chain::decode(&mut file, ()).expect("unable to decode chain") } } } fn ca_chain(filename: &str) -> ca::Chain { let mut file = File::open(&filename).expect("unable to open CA certificate chain file"); ca::Chain::decode(&mut file, ()).expect("unable to dec...
Rust
0
# Update best letter in str which may be for a "next" letter # or a "rematch" if new_score >= best_letter_score: # Apply penalty for now skipped letter if best_letter is not None: score += UNMATCHED_LETTER_PENALTY best_letter...
Python
1
{package: pkg_info[ATTR_VERSION] for package, pkg_info in requirements_to_install.items()} ) # If any requirements were unpinned, get their version now so they can be pinned later if any(version == UNPINNED_VERSION for version in pyscript_installed_packages.values()): pyscript_installed_package...
Python
1
pub fn pc1(&self) -> PC1_R { PC1_R::new(((self.bits >> 11) & 0x1f) as u8) } #[doc = "Bits 19:23 - Port Control for Port n Pin 0 to 3"] #[inline(always)] pub fn pc2(&self) -> PC2_R { PC2_R::new(((self.bits >> 19) & 0x1f) as u8) } #[doc = "Bits 27:31 - Port Control for Port n P...
Rust
0
Ok(len) } }#![deny(warnings)] #![allow(non_camel_case_types)] #![allow(clippy::all)] #![no_std] mod generic; pub use generic::*; #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Crossbar A Select Register 0"] pub sel0: SEL0, #[doc = "0x02 - Crossbar A Select Reg...
Rust
0
dio_content(user=None, book=None, published_only=True, search_query=None): """ 统一获取音频内容(AudioSegment + DialogueScript) 返回统一格式的数据列表,按创建时间倒序排列 """ audio_items = [] # 构建查询条件 audio_filter = Q() dialogue_filter = Q() if user: audio_filter &= Q(user=user) dialogue_filter ...
Python
1
ion criterion = nn.CrossEntropyLoss() # 6. Batch Construction batches, masks = construct_batches( corpus, vocab, batch_size=config.batch_size, src_lang_key="src", tgt_lang_key="tgt", device=device, ) # 7. Training print("Starting training...") ...
Python
1