text
string
label_name
string
labels
int64
::EmitterConfig { one_shot: true, lifetime: 1.5, explosiveness: 1.0, amount: 8, local_coords: true, initial_direction: math::vec2(0.0, 1.0), initial_direction_spread: 2.0 * PI, initial_velocity: 20.0, initial_velocity_randomness: 0.4, size:...
Rust
0
self) -> SUTINT0_W { SUTINT0_W { w: self } } #[doc = "Bit 2 - AC1 Interrupt Disable"] #[inline(always)] pub fn acint1(&mut self) -> ACINT1_W { ACINT1_W { w: self } } #[doc = "Bit 3 - AC1 Startup Time Interrupt Disable"] #[inline(always)] pub fn sutint1(&mut self) -> SUTIN...
Rust
0
for (v1, v2) in a.iter().zip(c.iter()) { assert_relative_eq!(v1 / 3.0, v2); } let mut rng = rand::thread_rng(); for _ in 0..ITERATIONS { let a = new_random_mat3d(&mut rng); let k: f64 = 200.0 * rng.gen::<f64>() - 100.0; let b = k * a; ...
Rust
0
e 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 License. // //! Backend server for the HTTPS Attestation example. //! //! Listens to plain HTTP connections, ...
Rust
0
, 7, 2, 7, 3, // right 1, 5, 4, 4, 1, 0, // left 0, 3, 7, 4, 7, 0, // front 1, 2, 6, 1, 5, 6, // back 10, 13, 12, 10, 11, 12, // floor ]; // A Slice dictates in which and in what order vertices get processed. let (vbuf, slice) = factory.create_vertex...
Rust
0
root_base_metaclass: Root<ObjClass>, root_object_class: Root<ObjClass>, ) -> Self { let source = String::from(CORE_SOURCE); let result = vm::interpret(vm, source, None); match result { Ok(_) => {} Err(error) => eprint!("{}", error), } l...
Rust
0
Config, endmill: EndmillConfig, drill: DrillConfig, cut: bool, } pub struct Move { x: f64, y: f64, z: f64, a: f64, b: f64, } impl Move { fn nowhere() -> Self { Move { x: -1.0, y: -1.0, z: -1.0, a: -1.0, b: -1.0, ...
Rust
0
inputs_to_plot[i])) for i in range(len(inputs_to_plot))] fig = plt.figure() plt.subplot(311) for i in range(inputs_to_plot.shape[0]): # plt.fill_between(x[i], inputs[i], alpha=0.4) plt.plot(inputs_to_plot[i,:,0], linewidth=4, alpha=0.8) plt.ylabel('Current (A)') plt.grid() plt.subplot(312) for i in range(input...
Python
1
rld!" scr.rect(0, 0, 7, 3, pixel::pxl('#')); scr.print(1, 1, "Hello,"); scr.print(1, 2, "World!"); scr.draw(); println!(); // the extract function returns a screen containing the provided section // if the section coordinates are reversed the resulting screen will also be reversed // ...
Rust
0
8, -dFdV / 1.0e8, places=6) self.assertAlmostEqual(K_T / 1.0e8, -V * dPdV / 1.0e8, places=6) self.assertAlmostEqual(alphaK_T / 1.0e3, dSdV / 1.0e3, places=6) self.assertAlmostEqual(alphaK_T / 1.0e3, dPdT / 1.0e3, places=6) def test_standard_entropy_pade(self): thermal_model = anharm...
Python
1
""" Adapted from https://github.com/v-iashin/SparseSync/blob/main/scripts/reencode_videos.py. Use to reencode videos to a specific format. See README.md for more details. """ import subprocess from glob import glob from multiprocessing import Pool from pathlib import Path import random from tqdm import tqdm ORIG_PA...
Python
1
e = M.basis('e') sage: a = M.automorphism([[0,1,2], [-1,0,3], [2,4,1]], name='a') sage: a.minpoly() # needs sage.libs.pari x^3 + 6*x^2 + 6*x + 1 sage: a.minimal_polynomial() ...
Python
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' CERTitude: the seeker of IOC Copyright (c) 2016 CERT-W Contact: cert@wavestone.com Contributors: @iansus, @nervous, @fschwebel CERTitude is under licence GPL-2.0: This program is free software; you can redistribute it and/or modify ...
Python
1
der from `path`, it also creates any missing folders. /// For instance, the path `/a/b/c` will create the folder `c` as well as folders `a` and `b` if they do not exist. fn create_folders(path: &Path, dry_run: bool, verbose: u8) -> Result<(), NeatError> { if dry_run { println!("create folder {:?}", path); ...
Rust
0
header = Text(f"🔹 {titulo} 🔹", style=f"bold {cor}") self.console.print(Panel(header, expand=False, border_style=cor)) @staticmethod def pausar(): """ Pausa a execução até o usuário pressionar Enter. """ Ui.console.input("\n[grey]Pres...
Python
1
: (a, b, c) })) }; let ret = body(); nom_tracable::backward_trace(ret, "brace", depth) } } #[cfg(not(feature = "trace"))] pub(crate) fn apostrophe_brace<'a, O, F>( mut f: F, ) -> impl FnMut(Span<'a>) -> IResult<Span<'a>, ApostropheBrace<O>> where F: FnMut(Span<'a>) -> IResult<Span<'...
Rust
0
atorError, WGRSError # ClipError, RefFrameError def _xkwds_pop(kwds, **name_default): return errors._xkwds_pop2(kwds, **name_default)[0] t = Tests(__file__, __version__, errors) for E in (errors._AssertionError, errors._AttributeError, errors._IndexError, errors.LimitError, err...
Python
1
""" Se agrega método Fourier para analizar frecuencias de intermodulación cuántica en 4 qubits. """ from qiskit_ibm_runtime import QiskitRuntimeService, Session, SamplerV2 as Sampler from qiskit import QuantumCircuit, transpile, ClassicalRegister from qiskit.quantum_info import Statevector from qiskit.visualization im...
Python
1
s } pub fn lde_size(&self) -> usize { 1 << (self.degree_bits + self.config.fri_config.rate_bits) } pub fn lde_generator(&self) -> F { F::primitive_root_of_unity(self.degree_bits + self.config.fri_config.rate_bits) } pub fn constraint_degree(&self) -> usize { self.gates...
Rust
0
bytes::Bytes; use std::io::Write; use std::os::unix::fs::PermissionsExt; use std::path::Path; pub mod data; pub mod file; pub mod path; pub fn owned_string_vec(args: &[&str]) -> Vec<String> { args.iter().map(<&str>::to_string).collect() } pub fn as_byte_owned_vec(str: &str) -> Vec<u8> { Vec::from(str.as_bytes()...
Rust
0
blocks): block_key = self.ccx_locator.make_usage_key( expected.location.block_type, expected.location.block_id ) actual = self.store.get_item(block_key) assert expected.display_name == actual.display_name assert expected.location == actual.loca...
Python
1
score: 0.54545456, false_negatives: 2, false_positives: 3, precision: 0.5, recall: 0.6, true_negatives: 5, true_positives: 3, }, ) "###); } <reponame>AndWass/embedded-async #![no_std] pub mod intrusive; pub mod channel; pub mod prelude; pub mod sync; pub mo...
Rust
0
= GG(d, a, b, c, M[10], 9, SV[21]) c = GG(c, d, a, b, M[15], 14, SV[22]) b = GG(b, c, d, a, M[4], 20, SV[23]) a = GG(a, b, c, d, M[9], 5, SV[24]) d = GG(d, a, b, c, M[14], 9, SV[25]) c = GG(c, d, a, b, M[3], 14, SV[26]) b = GG(b, c, d, a, M[8], 20, SV[27]) a = GG(...
Python
1
item_count, album_name, item.name, id.0); } fn load_albums(opts:&Opts) -> Vec<Album> { let manifest = Manifest::load(&opts); manifest.list .into_iter() .map(|item| { Album::load(&opts, item.id, item.name) }) .collect() } fn init_logger(verbose:bool) { if verbo...
Rust
0
import pathlib import xml.etree.ElementTree as ET MOCK_URL = "https://127.0.0.1" MOCK_API_KEY = "123456789abcdefg123456789" SONARR_API_KEY = ( ET.parse("tests/docker_configs/sonarr/config.xml").getroot().find("ApiKey").text ) RADARR_API_KEY = ( ET.parse("tests/docker_configs/radarr/config.xml").getroot().find(...
Python
1
import time from concurrent.futures import ThreadPoolExecutor def doJob(val): print("Job Started.....") time.sleep(2) print("Job Completed......") val += val return val pool = ThreadPoolExecutor(2) t1 = pool.submit(doJob, 5) t2 = pool.submit(doJob, 6) t3 = pool.submit(doJob, 4) t4 = pool.submit...
Python
1
byte order."] pub local: sockaddr_ptr, #[doc = " Remote IP address. Note that the values are in network byte order."] pub remote: sockaddr, #[doc = " Connection handle"] pub conn_handler: *mut net_conn_handle, #[doc = " Receive callback to be called when desired packet"] #[doc = " has been ...
Rust
0
nerKnearestResult { bot: curr_bot, mag: curr_dis, }; //$unit_create!(curr_bot,curr_dis); arr.insert(i, unit); self.curr_num += 1; return true; } } //onl...
Rust
0
} f.write_char(')') } } // ================================================================================================ heap_struct! { pub struct Slice: UniformHeapValue { start: usize, end: usize, vals: ValueRefT<Tuple> } } impl Slice { pub fn new(heap: &mut...
Rust
0
f.forward(prime_input[p], hidden, stack) inp = prime_input[-1] for p in range(predict_len): output, hidden, stack = self.forward(inp, hidden, stack) # Sample from the network as a multinomial distribution probs = torch.softmax(output, dim=1) top_i = torc...
Python
1
&self) -> Option<&Self::Content> { None } } #[derive(Debug, Clone, PartialEq)] pub struct GetEdge<T> { graph_name: String, edge_id: DocumentId, content: PhantomData<T>, if_match: Option<String>, if_non_match: Option<String>, } impl<T> GetEdge<T> { pub fn new<G, Coll>(graph_name: G,...
Rust
0
x5cMD\xa3\x00\x8c\x22\xa2\x0a\x1f\xe6\xd7\x84V\xab\ \xe5\xa8\xa1\xc3i\xe4\x8d\xb7(\xd98\xf8\xffJB=\ \xbf\xcf\x1a\xf9\xf9\xe8\x8e\x1d\xf3.|yG\xe6\xe1`\ \xa7\xec\xdc\x80\x86q\xf4\xed\x18\x88FD\x19\xf4\xbb\x00\ \xc0`04\xf7\xf1\xf1\xc9\x83\xfb\xe3E\xae\xcdf\xeb\ \x88\xd2\x95\x17\xa1\xee\x12\x13\x80z\xc0d2\xfd\x00\xe0\ F%u|...
Python
1
::io; use std::io::Write; use std::fs::File; use std::io::Read; type Filename = String; type Program = String; use rusty_brainfuck::Brainfuck; enum IsContinue { Yes, No, } use IsContinue::{Yes, No}; pub fn print_discription() { println!("Brainfuck Int...
Rust
0
""" API 服务器模块 负责处理 MCPStore 的 API 服务器启动功能 """ import logging logger = logging.getLogger(__name__) class APIServerMixin: """API 服务器 Mixin""" def start_api_server(self, host: str = "0.0.0.0", port: int = 18200, reload: bool = False, ...
Python
1
,// 'l' // Adox_r64_rm64 0x02,// Normal_2a 0xA6, 0x05,// 678 = "adox" 0x71,// 'q' // VEX_Mulx_r32_r32_rm32 0x02,// Normal_2a 0x98, 0x06,// 792 = "mulx" 0x6C,// 'l' // VEX_Mulx_r64_r64_rm64 0x02,// Normal_2a 0x98, 0x06,// 792 = "mulx" 0x71,// 'q' // VEX_Bextr_r32_rm32_r32 0x02,// Normal_2a 0xB1, 0x02,...
Rust
0
# jax2onnx/plugins/jax/nn/leaky_relu.py from __future__ import annotations from typing import TYPE_CHECKING, ClassVar, Final import jax from jax.extend.core import Primitive from jax2onnx.plugins._patching import AssignSpec, MonkeyPatchSpec from jax2onnx.plugins.plugin_system import PrimitiveLeafPlugin, register_pr...
Python
1
amount = Amount::try_from(shortfall).ok()?; amount.checked_neg()? }, _ => Amount::try_from(excess).ok()? }; Some(HypotheticalLiquidityData{ liquidity_in_usd: res }) } fn is_admin(caller: AccountId) -> Option<bool> { Some(MinterestCouncil::is_member(&caller)) } fn get_user_total_collat...
Rust
0
vec![&room_id, &max_group_found]; client.query_raw(sql, params) } .expect("Something went wrong while querying the database"); // Copy the data from the database into a map let mut state_group_map: BTreeMap<i64, StateGroupEntry> = BTreeMap::new(); let pb: ProgressBar; if cfg!(feature ...
Rust
0
ndProperties::False { .. } => { // No Logic Layer, give error instead app .resource("/data", |r| { r.method(Method::GET).with(logic_layer_non_unique_levels_default_handler) }) .resource("/data.{format}", |r| { ...
Rust
0
#!/usr/bin/env python3 # Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2 # This file is part of Checkmk (https://checkmk.com). It is subject to the terms and # conditions defined in the file COPYING, which is part of this source code package. from collections.abc import Mapping import pytest ...
Python
1
import unicodedata import sys from io import StringIO from pathlib import Path from contextlib import redirect_stdout def main(): path = Path(sys.argv[1]) f = StringIO() with redirect_stdout(f): mktable() try: old = path.read_text() except FileNotFoundError: old = '' ...
Python
1
else: logger.error(f"Lagrange文件上传失败: {result}") return False except Exception as e: logger.error(f"Lagrange文件上传异常: {e}", exc_info=True) return False async def _send_file_via_local_route(self, file_path: str, event: AstrMes...
Python
1
id(&self, _: &HyperClient) -> Result<String, Error> { match &self.credentials.project_id { Some(pid) => Ok(pid.clone()), None => Err(Error::ProjectIdNotFound), } } fn get_token(&self, scopes: &[&str]) -> Option<Token> { let key: Vec<_> = scopes.iter().map(|x| x.t...
Rust
0
ert_approx_eq!(block_out[2][0], 0.0, 0.0001); assert_approx_eq::assert_approx_eq!(block_out[3][0], 0.0, 0.0001); assert_approx_eq::assert_approx_eq!(block_out[4][0], 0.0, 0.0001); assert_approx_eq::assert_approx_eq!(block_out[5][0], 0.0, 0.0001); assert_approx_eq::assert_approx_eq!(block...
Rust
0
# /usr/bin/python3 import yaml import sys input_filename = sys.argv[1] rest_url = sys.argv[2] if len(sys.argv) > 2 else '' yaml.Dumper.ignore_aliases = lambda self, data: True def log(str): # print(str) return def dereference(input, ref): if not isinstance(ref, dict): return path = ref.get...
Python
1
odel # elif args.note == 'GraphRNN_structure' and args.is_flexible==True: # for num_layers in range(4,5): # graph_real_list = [] # graph_pred_list = [] # epoch_end = 30000 # for epoch in [epoch_end-500*(8-i) for i in range(8)]: # # give file name and figure name # ...
Python
1
paign F": [0.35, 0.78] "Our Target Product": [0.5, 0.6]""", ) REQUIREMENT_ANALYSIS = ActionNode( key="Requirement Analysis", expected_type=str, instruction="Provide a detailed analysis of the requirements.", example="", ) REFINED_REQUIREMENT_ANALYSIS = ActionNode( key="Refined Requirement Anal...
Python
1
les! invoke_command { ($commands:expr,$command:ident,$($x:ident),*) => { { if let Some($command) = $commands.$command.as_ref() { $command($($x,)*) } else { panic!(concat!("Command not loaded: ", stringify!($command))); } } } } ...
Rust
0
Level { Quiet, Error, Info, Debug, } impl LogLevel { pub fn to_int(&self) -> i32 { match *self { LogLevel::Quiet => -1, LogLevel::Error => 0, LogLevel::Info => 1, LogLevel::Debug => 2, } } pub fn from_int(int: i32) -> Self { ...
Rust
0
available, // or we have downloaded more than Y number of root metadata files (because the // exact number is as yet unknown), then go to step 5.1.9. The value for Y is set // by the authors of the application using TUF. For example, Y may be 2^10. // FIXME(...
Rust
0
//! * `GET /live` -- returns 200 when the proxy is live. use futures::future; use http::StatusCode; use hyper::{ body::{Body, HttpBody}, Request, Response, }; use linkerd_app_core::Error; use std::{ future::Future, pin::Pin, task::{Context, Poll}, }; mod readiness; pub use self::readiness::{Latch...
Rust
0
"456 Oak Ave", "test_keep_primary_address_city": "Cambridge", "test_keep_primary_address_internal_id": "PRIMARY-UPDATED", } parsed = form.parse(form_data) # Verify that kept SkipJsonSchema fields are parsed correctly assert parsed["id"] == "id-override" ...
Python
1
let w0 = t3 - 2.0 * t2 + t; weights[0] = 0.0; weights[1] -= w0; weights[2] += w0; } // Compute last node weight $w_3$ if idx + 2 < nodes.len() { let w3 = (t3 - t2) * (x1 - x0) / (nodes[idx + 2] - x0); weights[1] -= w3; weights[3] = w3; } else { ...
Rust
0
import xml.etree.ElementTree as ET import re from svgpathtools import parse_path, Path import sys def clean_and_scale_svg(input_path, output_path, scale=0.01): ET.register_namespace('', "http://www.w3.org/2000/svg") tree = ET.parse(input_path) root = tree.getroot() for elem in root.findall(".//*"): ...
Python
1
606000381/train/rust> pub fn positive_sum(slice: &[i32]) -> i32 { // same assembly as with filter slice.iter().map(|&x| x.max(0)).sum() } <gh_stars>1000+ // //! Copyright 2020 Alibaba Group Holding Limited. //! //! Licensed under the Apache License, Version 2.0 (the "License"); //! you may not use this file ex...
Rust
0
import numpy as np def gauss_seidel_fixed_iterations(A, b, initial_guess=None, iterations=10): """ Perform the Gauss-Seidel method with a fixed number of iterations to solve Ax = b. Parameters: A (2D array): Coefficient matrix. b (1D array): Constant vector. initial_guess (1D array): Initial gu...
Python
1
2 }, /* ADC A,d8 */ 0xCE => { let d8 = cpu.fetch_operand(memory); debug_system!(format!("ADC A,{:#04X}\n", d8), cpu.debug_mode); arithmetic::add_carry(cpu, d8); 2 }, /* SUB d8 */ 0xD6 => { let d8 = cpu.fetch_operand(mem...
Rust
0
ndation'*"] #[cfg(feature = "Win32_Foundation")] pub struct D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA { pub DataSize: u32, pub Anonymous: D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA_0, } #[cfg(feature = "Win32_Foundation")] impl ::core::marker::Copy for D3D12_VIDEO_ENCODER_PICTURE_CONTROL_CODEC_DATA {} ...
Rust
0
let entry = HistogramBucket { index: (fidl_stats::RSSI_BINS - (bin as u8) - 1).into(), count: diff.into(), }; histogram.push(entry); } } if !histogram.is_empty() { sender.log_int_histogram(rssi_metric_id, histogram); } } ...
Rust
0
"""Enhanced ShockBurst scanning features unit tests. """ from whad.esb.stack.llm.constants import ESBRole from whad.esb.esbaddr import ESBAddress from whad.esb.scanning import CommunicatingDevice, CommunicatingDevicesDB def test_device_creation(): """Test CommunicatingDevice creation""" address = ESBAddress("...
Python
1
#%% # Import Pandas import pandas as pd #%% #Import CSV df = pd.read_csv('CricketData.csv') #%% #Rename Multiple Coloums df= df.rename(columns={'NO':'NotOuts', 'Inns':'Innings', 'Mat':'Matches', 'HS':'HighScore', 'Ave':'Average', 'SR':'ScoreRate'}) #%% #Check the Null Values df.isnull().any() df[df['BF'].isna()==1] #%...
Python
1
and_varint(COLLECTION_ID_TO_PROPERTIES, collection_id) } fn encode_key_index_id_to_properties(collection_id: u64, index_id: u64) -> Vec<u8> { // TODO capacity let mut k = vec![]; k.push(INDEX_ID_TO_PROPERTIES); misc::push_varint(&mut k, collection_id); misc::push_varint(&mut k, index_id); k } ...
Rust
0
ExecuteMsg::Distribute { id, } => executions::distribute(deps, env, info, id), ExecuteMsg::Transfer { recipient, amount, } => executions::transfer(deps, env, info, recipient, amount), } } #[cfg_attr(not(feature = "library"), entry_point)] pub fn ...
Rust
0
= conversions_from_nouns_general(source_dir); conversions = conversions_from_custom_data(conversions); let widths = ( conversions.keys().map(String::len).max().unwrap(), conversions .values() .map(|p| p.modern.as_ref().map(|m| m.len()).unwrap_or(0)) .max() ...
Rust
0
<H256, BtcAddress>>); impl IssueRequests { pub fn new() -> Self { Self::default() } pub(crate) async fn lock(&self) -> MutexGuard<'_, ReversibleHashMap<H256, BtcAddress>> { self.0.lock().await } pub(crate) async fn insert(&self, issue_id: H256, address: BtcAddress) -> (Option<H256...
Rust
0
/// Select2 can render programmatically supplied data from an array or remote /// data source (AJAX) as dropdown options. In order to accomplish this, Select2 /// expects a very specific data format. This format consists of a JSON object /// containing an array of objects keyed by the `results` key. #[derive(Clone, De...
Rust
0
!( vec3a_to_vec3, "vec3a into vec3", op => vec3a_into_vec3, from => random_vec3a ); bench_func!( vec3a_to_rgb, "vec3a to rgb", op => vec3a_to_rgb_op, from => random_vec3a ); bench_func!( vec3a_to_array_accessors, "vec3a into array slow", op => vec3a_accessors, from => random_vec3a ); bench_func!( vec3a_to_array_into...
Rust
0
r3 bi3 br1 bi1 br1 bi1 let mut out = _mm256_blend_ps(out_lo, out_hi, 0b0011_1100); // br0 bi0 br3 bi3 br1 bi1 br2 bi2 if size != RADIX { let twiddles = _mm256_loadu_ps(twiddles.as_ptr().add(RADIX * i) as *const _); out = mul!(out, twiddles); } _mm256_storeu_ps(out...
Rust
0
# Copyright (C) 2016-2018 Jurriaan Bremer. # This file is part of VMCloak - http://www.vmcloak.org/. # See the file 'docs/LICENSE.txt' for copying permission. from vmcloak.abstract import Dependency class Silverlight(Dependency): name = "silverlight" default = "5.0.61118.0" exes = [{ "arch": "x86"...
Python
1
''' Задача 62 Кубические перестановки Можно найти перестановки куба 41063625 (3453), чтобы получить еще два куба: 56623104 (3843) и 66430125 (4053). К слову, 41063625 является наименьшим кубом, для которого ровно три перестановки также являются кубами Найдите наименьший куб, для которого ровно пять перестановок такж...
Python
1
keChannel(1006, items) root = FakeMessage(701, a, "root", now - timedelta(minutes=3), ch, guild) bot_msg = FakeMessage(702, other_bot, "bot noise", now - timedelta(minutes=2), ch, guild, reference=SimpleNamespace(message_id=root.id)) ours = FakeMessage(703, our_bot_author, "bot reply", now - timedelta(minu...
Python
1
end + Sync + 'static>( &self, f: F, ) -> SignalHandlerId { unsafe extern "C" fn notify_control_source_g_trampoline< P, F: Fn(&P) + Send + Sync + 'static, >( this: *mut gst_controller_sys::GstARGBControlBinding, _param_spec: glib_sys::gp...
Rust
0
// # /// let matrix: Matrix1x1<i32> = Matrix1x1::zero(); /// /// assert!(matrix.is_zero()); /// ``` #[inline] pub fn zero() -> Matrix1x1<S> { Matrix1x1::new(S::zero()) } /// Determine whether a matrix is a zero matrix. /// /// ## Example /// /// ``` /// #...
Rust
0
if raw_noise_std > 0.: noise = torch.randn(sigmas.shape) * raw_noise_std alpha = raw2alpha(sigmas + noise, dists) # [N_rays, N_samples] weights = alpha * torch.cumprod(torch.cat([torch.ones((alpha.shape[0], 1)).cuda(), 1.-alpha + 1e-10], -1), -1)[:, :-1] # [N_rays, N_samples] opacity = torch....
Python
1
(100)); loop { ticks.tick().await; replica_arch_timer.lock().await.tick(); } }); join(listener_cleanup, liveness_tick) } pub async fn handle(&self, req: Request<Body>) -> Result<Response<Body>, hyper::Error> { let path = Bytes::fr...
Rust
0
, Es, // 9 Fm, Md, No, Lr, Rf, Db, Sg, Bh, Hs, Mt, // 10 Ds, Rg, Cn, Nh, Fl, Mc, Lv, Ts, Og // 11 } pub enum Parity { Clockwise, Counterclockwise }<reponame>k-nasa/wasmer //! Create, grow, destroy tables of an instance. use crate::deprecated::{get_global_store, wasmer_limits_t, wasmer_res...
Rust
0
import math import numpy as np import pandas as pd import plotly.express as px import pickle import seaborn as sns import matplotlib.pyplot as plt import os from LinearRegression import LinearRegression from ft_liner_p1 import Linear_Regression_preduct def evalute_modle(): price_df = pd.read_csv('./data.csv')...
Python
1
scrape_system_health_metrics() { // This will silently fail if we are unable to observe the health. This is desired behaviour // since we don't support `Health` for all platforms. if let Ok(health) = SystemHealth::observe() { set_gauge(&SYSTEM_VIRT_MEM_TOTAL, health.sys_virt_mem_total as i64); ...
Rust
0
_name: &str) -> String { BINDING_CC_TEMPLATE.replace(PARSER_NAME_PLACEHOLDER, parser_name) } pub fn binding_gyp(parser_name: &str) -> String { BINDING_GYP_TEMPLATE.replace(PARSER_NAME_PLACEHOLDER, parser_name) } pub fn index_js(parser_name: &str) -> String { INDEX_JS_TEMPLATE.replace(PARSER_NAME_PLACEHOLD...
Rust
0
# Copyright 2020 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
# Copyright (C) 2019-2025 CEA, EDF # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2.1 of the License, or (at your option) any later version. # # This library is distr...
Python
1
from easydict import EasyDict agent_num = 10 collector_env_num = 16 evaluator_env_num = 8 main_config = dict( exp_name='smac_MMM_qtran_seed0', env=dict( map_name='MMM', difficulty=7, reward_only_positive=True, mirror_opponent=False, agent_num=agent_num, collecto...
Python
1
ool); let mut dispatcher = Dispatcher::new(&pool, printer, command); dispatcher.run(&rx); } fn start_repo_iter(working_dir: PathBuf, pool: &ThreadPool) -> Receiver<WorkType> { let (tx, rx) = channel(); let tx_send = tx.clone(); pool.execute(move || { for (index, repo) in RepoIter::new(wor...
Rust
0
import openai import json import httpx as _httpx import gepetto.config import gepetto.models.model_manager from gepetto.models.openai import GPT _ = gepetto.config._ DEFAULT_SILICONFLOW_MODELS = [ "deepseek-ai/DeepSeek-V3", "deepseek-ai/DeepSeek-R1", "Pro/deepseek-ai/DeepSeek-V3", "Pro/deepseek-ai/De...
Python
1
d_by(id=self.security_group_id, deleted=False) @classmethod def get_security_group_by_instance_id(cls, id): association = SecurityGroupInstanceAssociation.find_by( instance_id=id, deleted=False) return association.get_security_group()...
Python
1
Request; use crate::LogId; use crate::Membership; use crate::MetricsChangeFlags; use crate::NodeId; use crate::ServerState; use crate::Vote; /// Commands to send to `RaftRuntime` to execute, to update the application state. #[derive(Debug, Clone, PartialEq, Eq)] pub(crate) enum Command<NID: NodeId> { // Update ser...
Rust
0
from datetime import datetime import pytest from django.test import Client from ceramic_cache.models import CeramicCache pytestmark = pytest.mark.django_db client = Client() class TestGetStamp: base_url = "/ceramic-cache" stamp_version = CeramicCache.StampType.V1 def test_succesfully_get_stamp( ...
Python
1
olor across the program pub main_color: CustomColor, /// The accent color across the program pub accent_color: CustomColor } /// The Custom color structure used to create custom color objects that can then be parsed for `crossterm::style::Color` #[derive(Debug, Deserialize)] #[serde(rename_all = "PascalCase")] p...
Rust
0
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab import random import string import aws_cdk as cdk from aws_cdk import ( Stack, aws_kinesisfirehose ) from constructs import Construct random.seed(47) class KinesisFirehoseStack(Stack): def __init__(self, ...
Python
1
(&filename).expect("no file found"); let metadata = fs::metadata(&filename).expect("unable to read metadata"); let mut buffer = vec![0; metadata.len() as usize]; f.read_exact(&mut buffer).expect("buffer overflow"); buffer } fn test_w1() { // https://users.rust-lang.org/t/format-string-to-buffer-an...
Rust
0
obj = loss + penalty LOGGER.info("loss: %f penalty: %f seconds elapsed %d", loss, penalty, time.time() - start_time) LOGGER.info("iteration: %d relative coef change: %f obj: %f", i, change, obj) if permute_fit_order: ...
Python
1
" \\return <tt>\\ref vx_node</tt>."] #[doc = " \\returns A node reference <tt>\\ref vx_node</tt>. Any possible errors preventing a"] #[doc = " successful creation should be checked using <tt>\\ref vxGetStatus</tt>."] pub fn vxTensorMatrixMultiplyNode( graph: vx_graph, input1: vx_tensor, ...
Rust
0
from websocket_server import WebsocketServer import threading import helpers as helpers import helpersws as helpersws # Called for every client connecting (after # handshake) def new_client(client, server): print("New client connected and was given id) %d" % client["id"]) server.send_message_to_all("Hey all,...
Python
1
,G7,SO,S8],[GU,H8,EZ,E9,E8,GZ,SK,S7],[SU,HZ,EA,EK,EO,GA,GK,SZ],], vec![], vec![], &[(EPI0, [EU,H7,H8,SU]),(EPI0, [H9,HU,GU,HZ]),(EPI2, [GZ,GA,G9,G7]),(EPI3, [EA,HA,E7,E8]),(EPI0, [S9,SO,SK,SZ]),(EPI3, [GK,HK,G8,S7]),(EPI0, [HO,S8,E9,EO]),(EPI0, [SA,GO,EZ,EK]),], [150, -50, -50, -50], ...
Rust
0
> Self::Out {} } impl<T: 'static> Remove for ViewMut<'_, T> { type Out = Option<T>; #[inline] fn remove(&mut self, entity: EntityId) -> Self::Out { SparseSet::remove(&mut *self, entity) } } impl<T: 'static> Remove for &mut ViewMut<'_, T> { type Out = Option<T>; #[inline] fn remov...
Rust
0
, ((data_graph, query_graph), config)| { b.iter(|| run_find(data_graph, query_graph, *config)); }, ); } } } group.finish(); } criterion_group!(benches, criterion_benchmark); criterion_main!(benches); <filename>services/mgmt/guestco...
Rust
0
; mod font_atlas_set; mod font_loader; mod glyph_brush; mod pipeline; pub use draw::*; pub use error::*; pub use font::*; pub use font_atlas::*; pub use font_atlas_set::*; pub use font_loader::*; pub use glyph_brush::*; pub use pipeline::*; pub mod prelude { pub use crate::{Font, TextAlignment, TextError, TextSty...
Rust
0
s = 'Vu Nguyen Coder Vu Coder lap trinh Pyhon' #1 . đếm số từ đơn words = s.split() so_tu_don = len(words) print(f"Kết quả 1:{so_tu_don}") # 2. List tần suất các từ word_count = {} # Tạo từ điển rỗng để chứa tần suất từ for word in words: if word in word_count: word_count[word] += 1 # Nếu từ đã có trong...
Python
1
def solve(n, k, edges): # Initialize the memoization table memo = [[[0, 10**9] for _ in range(k + 1)] for _ in range(n)] def dfs(node, mi, mx, parent, mask): if node == -1: return True # Update the memoization table memo[node][mask[0]][mask[1]] = (mi, mx) for c...
Python
1
/api/v1/leagues/mine") assert response.status_code == 200 leagues = response.json() assert len(leagues) == 2 # Check roles roles = {league["league"]["name"]: league["role"] for league in leagues} assert roles["Owned League"] == "commissioner" assert roles["Membe...
Python
1