text
string
label_name
string
labels
int64
=["png"]) def test_mutating_input_arrays_y_and_z(fig_test, fig_ref): """ Test to see if the `z` axis does not get mutated after a call to `Axes3D.plot` test cases came from GH#8990 """ ax1 = fig_test.add_subplot(111, projection='3d') x = [1, 2, 3] y = [0.0, 0.0, 0.0] z = [0.0, 0.0, ...
Python
1
from vellum import SearchResponse, SearchResult, SearchResultDocument from tests.workflows.basic_search_node.workflow import BasicSearchWorkflow, Inputs def test_run_workflow__happy_path(vellum_client): """Confirm that we can successfully invoke a Workflow with a single Search Node""" # GIVEN a workflow tha...
Python
1
UT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. use async_trait::async_trait; use common::observer_proto::{structure_graph::Node as GraphNode, StructureGraph}; use std::{collections::HashSet, sy...
Rust
0
.insts[i][0].clone(); if inst == "nop" { self.insts[i][0] = "jmp".to_string(); } else if inst == "jmp" { self.insts[i][0] = "nop".to_string(); } self.flipped = Some(i); } fn reset(&mut self) { self.state = State::RUN; self.acc = 0; ...
Rust
0
} /// Shoot a bullet with the given power, and consume that power. If outside /// the range specified by `bullet_power_limits` in the configuration, clamp /// to that range. Will cause an error if called more than once in a single /// step. Will do nothing if called when the robot's current shoot power...
Rust
0
nsing information. // // Authors: // - <NAME> <<EMAIL>> // - <NAME> <<EMAIL>> //! ### Schnorr signature creation and verification, including batch verification. use core::fmt::{Debug}; use curve25519_dalek::constants; use curve25519_dalek::ristretto::{CompressedRistretto,RistrettoPoint}; use curve25519_dalek::scala...
Rust
0
root().join("lib/ds-test/.git").exists()); }); // Checks that quiet mode does not print anything forgetest!(can_init_quiet, |prj: TestProject, mut cmd: TestCommand| { prj.wipe(); cmd.arg("init").arg(prj.root()).arg("-q"); let _ = cmd.output(); }); // `forge init` does only work on non-empty dirs forgetes...
Rust
0
import json import os import argparse underwater_classes = ['holothurian', 'echinus', 'scallop', 'starfish'] def parse_args(): parser = argparse.ArgumentParser(description='json2submit_nms') parser.add_argument('--test_json', help='test result json', type=str) parser.add_argument('--submit_file', help='sub...
Python
1
expected_output ); Ok(()) } use std::fs::File; use std::io::Read; use std::path::Path; use clap::{App, Arg, SubCommand}; use sha1::{Digest, Sha1}; use magnetite_common::TorrentId; use crate::model::TorrentMeta; use crate::CARGO_PKG_VERSION; pub const SUBCOMMAND_NAME: &str = "dump-torrent-info"; pub fn g...
Rust
0
""" Escribe un programa que reciba un texto y transforme lenguaje natural a "lenguaje hacker" (conocido realmente como "leet" o "1337"). Este lenguaje se caracteriza por sustituir caracteres alfanuméricos. - Utiliza esta tabla (https://www.gamehouse.com/blog/leet-speak-cheat-sheet/) con el alfabeto y los número...
Python
1
ed_operator(J, d): """Return J diag(d) as LinearOperator.""" J = aslinearoperator(J) def matvec(x): return J.matvec(np.ravel(x) * d) def matmat(X): return J.matmat(X * d[:, np.newaxis]) def rmatvec(x): return d * J.rmatvec(x) return LinearOperator(J.shape, matvec=matv...
Python
1
"1.2.3", } checker = RequirementsCheck(confirm=False, pin_requirement=True) with patch.object(checker, "update_requirements") as mock_update: checker.parse_file(Path("requirements.txt")) mock_update.assert_called_once() updated_lines = mock_update.call_args[0...
Python
1
ame>david-perez/axum use crate::{ body::{self, BoxBody}, extract::{rejection::*, take_body, FromRequest, RequestParts}, response::IntoResponse, BoxError, }; use async_trait::async_trait; use http::{ header::{self, HeaderValue}, StatusCode, }; use http_body::Full; use hyper::Response; use serde::...
Rust
0
3, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13 ]; #[cfg_attr(rustfmt, rustfmt_skip)] const BITMASKS: [u32; 17] = [ 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, 0x001F, 0x003F, 0x007F, 0x00FF, 0x01FF, 0x03FF, 0x07FF, 0x0FFF, 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF ]; /// The maximum number...
Rust
0
activation (callable): a callable that constructs activation layer. head_output_with_global_average (bool): if True, perform global averaging on the head output. Returns: (nn.Module): the csn model. """ torch._C._log_api_usage_once("PYTORCHVIDEO.model.create_csn") # Number...
Python
1
# This file was auto-generated by Fern from our API Definition. import typing import typing_extensions from ..types.shift_filter_status import ShiftFilterStatus from .shift_workday import ShiftWorkdayParams from .time_range import TimeRangeParams class ShiftFilterParams(typing_extensions.TypedDict): """ Def...
Python
1
yccnt::U32Ext as _}; const PERIOD: u32 = 1_000_000; // 10ms at 100Mhz type WIFI = Wifi< Spi<SPI3, (PB3<Alternate<AF6>>, PB4<Alternate<AF6>>, PB5<Alternate<AF6>>)>, PB6<Output<PushPull>>, PB7<Input<PullDown>>, PB8<Output<PushPull>>, PB9<Output<PushPull>>, Delay, >; #[app( device = stm32f4x...
Rust
0
ORDER_DEFAULT = 0, } impl From<SD_MASH_MASH_ORDER_A> for u8 { #[inline(always)] fn from(variant: SD_MASH_MASH_ORDER_A) -> Self { variant as _ } } #[doc = "Reader of field `SD_MASH_MASH_ORDER`"] pub type SD_MASH_MASH_ORDER_R = crate::R<u8, SD_MASH_MASH_ORDER_A>; impl SD_MASH_MASH_ORDER_R { #[doc ...
Rust
0
table = [ [0] * 1001 for _ in range(1001) ] n = int(input()) for i in range(1, n+1): a, b, w, h = map(int, input().split()) for y in range(b, b + h): table[y][a:a + w] = [i] * w for i in range(1, n + 1): count = 0 for l in range(1001): count += table[l].count(i) print(count)
Python
1
import sys from collections import deque input = sys.stdin.readline INF = sys.maxsize def bfs(start, end): queue = deque([start]) visited = [False] * (v) visited[start] = True while queue: now = queue.popleft() if now == end: return True for s, e, w in graph: ...
Python
1
"config": ConfigCommand, "export": ExportCommand, "external": ExternalCommand, "fmt": FmtCommand, "load": LoadCommand, "run": RunCommand, "shell": ShellCommand, "secret": SecretCommand, } register_graceful_shutdown_si...
Python
1
cookie.value); } } _ => {} } } } #[cfg(target_family = "windows")] pub fn pre_entry(_: Entry) -> bool { eprintln!("interactive not supported yet in windows!"); true } pub fn post_entry() -> bool { false } <gh_stars>0 pub use desktop_entry_manager::*; p...
Rust
0
A interrupt event, controlled by GPT3:TAMR"] GPT3A = 14, #[doc = "13: GPT2B interrupt event, controlled by GPT2:TBMR"] GPT2B = 13, #[doc = "12: GPT2A interrupt event, controlled by GPT2:TAMR"] GPT2A = 12, #[doc = "0: Always inactive"] NONE = 0, } impl From<EV_A> for u8 { #[inline(always)...
Rust
0
.create_index_buffer_uninit(new_capacity, buffer.usage_hint()) .into(); true } else { false }; let view = buffer.get(0..*len).unwrap(); let upload_task = unsafe { // Note: the view data range is not actually guaranteed to be initia...
Rust
0
import os import shutil import ruamel.yaml import log from app.utils import ExceptionUtils from config import Config from app.utils.commons import singleton @singleton class Category: _category_path = None _categorys = None _tv_categorys = None _movie_categorys = None _anime_categorys = None ...
Python
1
tr = "hab-sup"; pub const VERSION: &str = include_str!(concat!(env!("OUT_DIR"), "/VERSION")); #[derive(Copy, Clone)] pub enum ShutdownReason { Departed, LauncherStopping, PkgUpdating, Signal, SvcStopCmd, } <reponame>t-rasmud/MIRAI<gh_stars>0 // Copyright (c) Facebook, Inc. and its affiliates. // //...
Rust
0
for i in range(645): pass # null statement in python # instructs to do nothing i = 0 while(i<45): print(i) i = i +1
Python
1
guration checks if frame_count % 4 == 0: if special_config != 0: if special_config > 0: if special_config < 2: alert_callback('Special condition met at frame ' + str(frame_count)) # Processed count checks b = frame_...
Python
1
56usize, concat!( "Offset of field: ", stringify!(StdVideoH265SubLayerHrdParameters), "::", stringify!(cpb_size_du_value_minus1) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<StdVideoH265SubLayerHrdParameters>())).bit_rate_du...
Rust
0
import smtplib from email.mime.text import MIMEText sender = "Frentdenis1997@gmail.com" receiver = "Frentdenis1997@gmail.com" subject = "Test alertă" body = "Acesta este un test pentru verificarea trimiterii emailurilor din aplicație." msg = MIMEText(body) msg["Subject"] = subject msg["From"] = sender msg["To"] = rec...
Python
1
G: u32 = 65536u32; #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`*"] pub const DN_REBAL_CANDIDATE: u32 = 2097152u32; #[doc = "*Required features: `\"Win32_Devices_DeviceAndDriverInstallation\"`*"] pub const DN_REMOVABLE: u32 = 16384u32; #[doc = "*Required features: `\"Win32_Devices_DeviceA...
Rust
0
a,'b>(s: &'a str, sep: &'b str, it: &fn(&'a str) -> bool) { for iter_between_matches(s, sep) |from, to| { if !it( unsafe { raw::slice_bytes(s, from, to) } ) { return; } } } pub fn each_split_str_nonempty<'a,'b>(s: &'a str, ...
Rust
0
"""Tests for the Linn / OpenHome integration."""
Python
1
pos: Position::new() .set_line(16) .set_byte(54) .set_record(2) .clone() }, ExpectedRecord { id: Ok("id4"), desc: None, head: &b"id4"[..], seq: b"ATG", qual: Some(b"@@@"...
Rust
0
&identity) .map_err(|err| TezosGenerateIdentityError::InvalidJsonError { message: err.to_string() })? ) } Err(e) => { Err(TezosGenerateIdentityError::from(e)) } } }) } pub fn decode_context_data(protocol_hash: RustBytes...
Rust
0
from typing import List class Solution: def minimumDifference(self, nums: List[int]) -> int: n = len(nums) // 2 total_sum = sum(nums) target = total_sum // 2 def generate_sums(nums: List[int]) -> List[List[int]]: # Generate all sums and store in separate lists based on ...
Python
1
# coding: utf-8 # Copyright (c) 2016, 2025, Oracle and/or its affiliates. All rights reserved. # This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c...
Python
1
vals } #[cfg(test)] mod test { use crate::interactive::helpers::to_string; use crate::interactive::table::TableItem; use crate::interactive::url_table_item::{default_columns, Columns, URLItem}; use bookmark_lib::types::URLRecord; struct TestCase<'a> { url_record: URLRecord, colu...
Rust
0
ges.TASK_UNEXPECTED_FAILURE % ("runner_event", event, event_dict), log_level=logging.ERROR, ) def _event_callback(self, event_dict=None): """Control the event callback for runner.""" if event_dict: logger.debug("processing event callback") ...
Python
1
Mode"] pub struct HFXOMODE_W<'a> { w: &'a mut W, } impl<'a> HFXOMODE_W<'a> { #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: HFXOMODE_A) -> &'a mut W { unsafe { self.bits(variant.into()) } } #[doc = "4-25 MHz crystal oscillator."] #[inline(a...
Rust
0
)?, } } _ => { return Err(smithy_json::deserialize::Error::custom( "expected object key or end object", )) } } } Ok(Some...
Rust
0
from collections import deque from typing import Dict, Any, Optional, List import pandas as pd # 用于计算移动平均线 import numpy as np from datetime import datetime, timedelta from qte.core.events import MarketEvent, SignalEvent, EventType from qte.data.interfaces import DataProvider # 策略可能需要直接查询历史数据进行初始化 from qte.core.event_l...
Python
1
key(&(*afi, *safi))) .map(|((afi, safi), val)| ((*afi, *safi), *val)) .collect(); negotiated.GRACEFUL_RESTART_SUPPORT = a .GRACEFUL_RESTART_SUPPORT .intersection(&b.GRACEFUL_RESTART_SUPPORT) .copied() .collect(); negotiated.FOUR_OCTET_ASN_SUPPORT = a.FOUR_OCTET_A...
Rust
0
ining_time']}") time.sleep(0.1) # Small delay to prevent overwhelming the UI if update["status"] == "Complete": st.success(f"Model '{model_name}' pulled successfully!") elif "Error" in update["status"]: st.error(update["status"])...
Python
1
) print(df.to_latex()) def main_football(): algorithms = ['MAPPO', 'VDN'] scales = [0.5, 1, 2, 4, 8] seeds = list(range(1, 5)) games = ['3v1', 'Corner', 'CAeasy', 'CAhard'] scores = {k: np.zeros((len(seeds), len(games), len(scales)), dtype=np.float64) for k in algorithms} frames = {k: ...
Python
1
self.info.sample_rate = ident.audio_sample_rate as usize; self.info.map = ChannelMap::default_map(ident.audio_channels as usize); let headers = (ident, comment, setup); self.headers = Some(headers); Ok(()) } fn flush(&mut self) -> Result<()> { self.pwr = PreviousWindowR...
Rust
0
) -> u8 { if !self.lcd_and_ppu_enabled || (self.running_mode != Mode::Mode2 && self.running_mode != Mode::Mode3) { self.oam_ram[(addr - OAM_START) as usize] } else { 0xff } } pub fn write_oam(&mut self, addr: u16, b: u8) { if !self.lcd...
Rust
0
B::write_u64(&mut self.data[Elf64::E_ENTRY_START .. Elf64::E_ENTRY_END], entry) } /// Set the processor-specific flags for this ELF data to `flags`. pub fn set_flags(&mut self, flags: u32) { B::write_u32(&mut self.data[Elf64::E_FLAGS_START .. ...
Rust
0
in this case leaf node will be replaced by interim node // - interim node: in this case we retry this method Err(InsertOp { node: next_node, key_byte_offset: key_start_offset + prefix_size + 1, key, value, ...
Rust
0
from typing import Callable from pydantic import Field, BaseModel, ConfigDict try: from pyspark.sql import functions as F except ImportError: print("pyspark not installed, please install it first. < pip install pyspark >") __all__ = [ "SparkBaseOperator", "spark_base_operator", ] class SparkBaseOper...
Python
1
one: result = _construct_validity_buffer_from_bitmask( bitmask, null_value=1, offset=0, length=4, allow_copy=True ) expected = pl.Series([True, False, False, True]) assert_series_equal(result, expected) def test_construct_validity_buffer_from_bitmask_zero_copy_fails( bitmask: PolarsBuffer,...
Python
1
ction performs a `DELETE` to the `/admin/api/2021-01/customers/{customer_id}.json` endpoint. * * https://shopify.dev/docs/admin-api/rest/reference/customers/customer#destroy-2021-01 * * **Parameters:** * * * `customer_id: &str` -- storefront_access_token_id. */ pub async fn deprec...
Rust
0
f not axis: assert log_prob.feature_dim axis = log_prob.feature_dim # See formula above for label_smoothing. dim = axis.dimension if not exclude_labels: # See formula in code comments in label_smoothing above. floor_prob = smoothing / (dim - 1) factor = 1.0 - dim * fl...
Python
1
agent_name, agent_seed, &user_did, user_key_name, user_name, user_seed, delegation_name, ) .expect("Creating the Authentication Delegation from an User to an Agent failed."); println!("DELEGATION CREATED"); ...
Rust
0
ert_res.uids.values().next() { // Ok(uid.to_owned()) // } else { // match node_key_to_uid(dg, &node_key).await? { // Some(uid) => { // Ok(uid) // }, // None => bail!("Could not retrieve uid after upsert for {}", &node_key), // } // } } fn chun...
Rust
0
c start_recording() and \\c stop_recording()"] pub fn check_record_exit() -> INT16; } extern "C" { #[doc = "CALIBRATION, DRIFT CORRECTION CONTROL"] #[doc = " Call this to stop calibration/drift correction in progress"] #[doc = " This could be called from a Windows message handler"] #[doc = "This fun...
Rust
0
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: queue.proto """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool from google.protobuf import symbol_database as _symbol_data...
Python
1
frame_obj.update_canvas() # 短暂休眠,让另一个线程有机会执行 time.sleep(0.05) def create_szt_interface(scrollbar_frame_obj, szts): creator = sztCreator(scrollbar_frame_obj, szts) # 创建两个线程 thread1 = threading.Thread(target=creator.create_szt_frames, args=(1,)) thread2 = thread...
Python
1
0, 2., 0], [0., 0, 0, 1.]]) p = jnp.array([1.0, -2., 1.0, 2.]) A_eq = jnp.array([[1, 1, 0, 0], [1, 0, -1, 0]]) b_eq = jnp.array([8., -7.0]) G_ineq = jnp.array([[1., 0, 0, 0], [-1, 0., 0, 0], [0., 1., 0., 0], ]) h_ineq = jnp.ar...
Python
1
i_all_subjects) fmri_all_subjects = torch.Tensor(fmri_all_subjects).to(device) return fmri_all_subjects, image_paths if __name__ == "__main__": device = "cuda" ckpt_path = "/data/parietal/store3/work/pbarbara/fmri2image_alignment/models/unaligned_embeddings/ckpt2.pt" model = load_model(ckpt_path, ...
Python
1
} /// Concrete enum of recognized file types. /// /// *Note*: `cat`-ing a directory should result in an /// CatError::IsDirectory enum InputType { Directory, File, StdIn, SymLink, #[cfg(unix)] BlockDevice, #[cfg(unix)] CharacterDevice, #[cfg(unix)] Fifo, #[cfg(unix)] Socket, } type ...
Rust
0
_http_rx) }; if let Either::Right((_, server)) = futures_util::future::select(server, restart_http_rx).await { let _ = restart_http_loop_tx.send(()); server.await; } info!("HTTP server stopped"); // Check if this is an actual shutdown, not...
Rust
0
""" ## Astronaut ETL example DAG This DAG queries the list of astronauts currently in space from the Open Notify API and prints each astronaut's name and flying craft. There are two tasks, one to get the data from the API and save the results, and another to print the results. Both tasks are written in Python using A...
Python
1
ctory).EnumAdapters(i, &mut adapter)) { break; } let mut desc = mem::MaybeUninit::uninit(); let hr = (*adapter).GetDesc(desc.as_mut_ptr()); if !SUCCEEDED(hr) { error!("Failed to get adapter description: {:?}", Error::Hr(hr)); break; } l...
Rust
0
.with_feature_status("quux", (Unknown, Unknown)), ) .with_platform_status( DependencyKind::Build, x86_64_linux.clone(), // x86_64_linux uses TargetFeature::Unknown. PlatformResults::new((Unknown, Enabled), (Disabled, Enabled)) ...
Rust
0
. let new_read_key = self.get_key_schedule() .derive_next(read_kind); let suite = self.get_suite(); self.set_message_decrypter(cipher::new_tls13_read(suite, &new_read_key)); if read_kind == SecretKind::ServerApplicationTrafficSecret { self.get_mut_key_schedule()....
Rust
0
ef _internal( values: Sequence[complex], ) -> Sequence[Mapping[str, Sequence[complex]]]: ret: list[dict[str, list[complex]]] = [] prev = 0 # import pdb; pdb.set_trace() for i, (_, length) in enumerate(channel_order): N_channel = len(channels[i]) cur ...
Python
1
AST_LOCATOR), ) .unwrap(); } } fn add_metatraffic_multicast_locators<S: Serializer>(&self, s: &mut S::SerializeStruct) { let locators = match self.metatraffic_multicast_locators { Some(l) => l, None => return, }; // TODO: make sure this works with multiple locators for ...
Rust
0
sMeasureS) YuleK = YulesCharacteristicK(chunk) feature.append(YuleK) S = SimpsonsIndex(chunk) feature.append(S) B = BrunetsMeasureW(chunk) feature.append(B) Shannon = ShannonEntropy(text) feature.append(Shannon) # READIBILTY FEATURES F...
Python
1
n_time = t2 - t1 if self.enc_infer_count > 0: prev_loop_data = self.time_data[self.enc_infer_count - 1] prev_loop_data['enc_token_time'] = text_encoder_token_time return r pipe.model.encoder.forward = my_text_encoder def new_text_encoder_request(self,...
Python
1
tigenic_data): distance_label = [] if len(set(antigenic_data['Distance'])) == 2: for i in range(0, antigenic_data.shape[0]): if antigenic_data['Distance'].iloc[i] == 1: distance_label.append(1) elif antigenic_data['Distance'].iloc[i] == 0: distance...
Python
1
::ServiceProvider, }; use actix_web::{middleware, App, HttpServer}; use coi::container; use mobc_postgres::{mobc::Pool, tokio_postgres::NoTls, PgConnectionManager}; use std::sync::{Arc, Mutex}; mod dtos; mod models; mod postgres; mod repositories; mod routes; mod services; #[actix_rt::main] async fn main() -> Result<...
Rust
0
# Copyright 2024 Lawrence Livermore National Security, LLC and other # Benchpark Project Developers. See the top-level COPYRIGHT file for details. # # SPDX-License-Identifier: Apache-2.0 import pathlib import llnl.util.tty as tty from spack.package import * import spack_repo.builtin.packages.cuda.package from llnl.ut...
Python
1
Fr::one(), x, d + 1, &mut g1), h_negative_x: table(E::Fr::one(), x_inv, d + 1, &mut g2), h_positive_x: table(E::Fr::one(), x, d + 1, &mut g2), g_negative_x_alpha: table(inv_x_alpha, x_inv, d, &mut g1), g_positive_x_alpha: table(x_alpha, x, d, &mut g1), h_ne...
Rust
0
import copy N = int(input()) boards = [list(input()) for _ in range(N)] dx = [1, -1, 0, 0] dy = [0, 0, 1, -1] answer = 0 def check(newBoards): global answer for x in range(N): # 가로로 연속된 사탕 개수 찾기 hori_count = 1 for y in range(1, N): if newBoards[x][y] == newBoards[x][y - ...
Python
1
, module: &Arc<Module>, ) -> Result<Option<Variable>, String> { let why = rt.stack.pop().expect(TINVOTS); let val = rt.stack.pop().expect(TINVOTS); let (val, why) = match rt.resolve(&val) { &Variable::Bool(val, ref sec) => (val, match *sec { None => Box::new(vec![why....
Rust
0
std::sync::Arc; // These constants must be kept in sync with the ones in web/zerde_eventloop_events.ts const MSG_TYPE_END: u32 = 0; const MSG_TYPE_INIT: u32 = 1; const MSG_TYPE_RESIZE: u32 = 4; const MSG_TYPE_ANIMATION_FRAME: u32 = 5; const MSG_TYPE_POINTER_DOWN: u32 = 6; const MSG_TYPE_POINTER_UP: u32 = 7; const MSG_...
Rust
0
feature_names=self.feature_names) # 採樣資料(如果指定) if sample_size is not None and len(X) > sample_size: sample_indices = np.random.choice(len(X), sample_size, replace=False) X_sample = ( X.iloc[sample_indices] if hasattr(X, "iloc") else X[sample_indices] ...
Python
1
let same_dir = path .strip_prefix(volume.prev_dir.as_slice()) .map(|p| !p.is_empty() && !p.contains(&b'/')) .unwrap_or(false); if !same_dir { if let Some(p) = path.strip_suffix(&[b'/']) { path = p; ...
Rust
0
# Ultralytics YOLO 🚀, AGPL-3.0 license import shutil from pathlib import Path from tests import TMP def pytest_addoption(parser): """ Add custom command-line options to pytest. Args: parser (pytest.config.Parser): The pytest parser object. """ parser.addoption("--slow", action="store_t...
Python
1
0130424}}, {"4cn", Box{-84.375, -82.96875, -47.8125, -46.40625}}, {"ds2", Box{23.90625, 25.3125, -67.5, -66.09375}}, {"rxvywy", Box{-0.230712890625, -0.225219726562, 165.882568359, 165.893554688}}, {"zs2k", Box{69.609375, 69.78515625, 157.8515625, 158.203125}}, {"kg63", Box{-26.54296875, -26.3671875, 36.9140625, 3...
Rust
0
import binascii import sys start_seq = '11010110011111111110000011101' #1ACFFC1D alt_start_seq = '01010110011111111110000011101' # 9ACFFC1D end_seq = 'BEEF' def convert_bit_stream(bit_stream): bit_data = b'' data = b'' found = False for i in range(len(bit_stream)): if bit_stream[i] == b'\x00'...
Python
1
(always)] #[cfg_attr(docs_rs, doc(cfg(target_feature = "avx")))] pub fn bitor_m256(a: m256, b: m256) -> m256 { m256(unsafe { _mm256_or_ps(a.0, b.0) }) } /// Shuffle the `f64` lanes in `a` using an immediate control value. /// /// * **Intrinsic:** [`_mm_permute_pd`] /// * **Assembly:** `vpermilpd xmm, xmm, imm8` #[mu...
Rust
0
de_json::from_slice::<Vec<(data::Piece, Vec<data::Peer>)>>(&payload) { Ok(data) => Ok(Self::new(data)), Err(err) => Err(io::Error::new(io::ErrorKind::Other, err)), } } fn as_vec(self) -> Result<Vec<u8>, io::Error> { match serde_json::to_vec(&self.0) { Ok(vec) => Ok(vec), Err(err) =>...
Rust
0
from mainpage import MainPage from subpage import SubPage from selenium.webdriver.remote.webdriver import WebDriver from mainpage_webscraper import MainPageWebScraper from selenium.webdriver.support.ui import WebDriverWait class ScrapeYourSay: def __new__(cls, xpaths: dict, driver: WebDriver, url: str, wait: WebDr...
Python
1
(file_path) os.makedirs(parent_dir, exist_ok=True) with open(file_path, "w") as f: json.dump(data, f, indent=2) except Exception as e: logging.error(f"Error writing file: {e}") raise class BasicExampleApplication(Gtk.Application): """Applica...
Python
1
se() def outputResults(srcBatch,r,outF): x=0 j=0 out= [] for i in range(len(srcBatch)): out.append([]) while(x < r.size(0)): for i in range(len(srcBatch)): if(j < len(srcBatch[i])): out[i].append(str(r[x].item())) x+=1 j += 1 ...
Python
1
eeze_time( (timezone.now() - timedelta(days=2)).replace(hour=12, minute=40, second=0, microsecond=0) ) @region_silo_test class PerfIssuePlatformIssueUniqueUserFrequencyConditionTestCase( PerfIssuePlatformEventMixin, EventUniqueUserFrequencyConditionTestCase, ): pass @freeze_time( (timezone.now() -...
Python
1
# Copyright 2023 The Qwen team, Alibaba Group. 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...
Python
1
", bootwrapper_dir, ["make"]) # Copying the final binary run_cmd( "copy xen binary", bootwrapper_dir, ["cp", "xen-system.axf", binaries_dir], ) with open(os.path.join(revisions_dir, "xen"), "w+") as rev_file: run_cmd( "write revision of xen repo", ...
Python
1
to_net(net, param_dict) # load the parameter into optimizer load_param_into_net(optim, param_dict) else: print('train from scratch *** ') net.set_train() loss = Loss() loss_net = CustomWithLossCell(net, loss) model = Model(loss_net, loss, optim, metrics=metrics) # ckpt...
Python
1
64; if column_index >= cols_offset && column_index < last_rendered_col { new_cols_offset = None; } else { new_cols_offset = Some(column_index) } (new_rows_offset, new_cols_offset) } fn scroll_to_found_record( found_record: find::FoundRecord, rows_view: &mut view::RowsView, ...
Rust
0
Response_VoteSummary| { &mut m.reported }, )); ::protobuf::reflect::MessageDescriptor::new_pb_name::<CPublishedFile_GetUserVoteSummary_Response_VoteSummary>( "CPublishedFile_GetUserVoteSummary_Response.VoteSummary", fields, file_descriptor_proto() ...
Rust
0
rm{Eff}$') pl.setp(ax_cbj, xlabel='Impact parameter') pl.setp(ax_crj, xlabel='Stellar density') pl.setp(ax_thm, xlim=ax_chj.get_xlim()) pl.setp(ax_ctm, xlim=ax_ccj.get_xlim()) pl.setp(ax_bm, xlim=ax_cbj.get_xlim()) pl.setp([ax_ccj, ax_cnm], ylim=ax_chj.get_ylim()) pl.setp([ax_chj, ax_ccj, a...
Python
1
env_var, record.args(), ); let color = match record.level() { Level::Error => color::RED, Level::Warn => color::YELLOW, _ => unreachable!(), }; ...
Rust
0
# Generated by Ollama Llama 3 # Task: multi_signal_width_rich # Attempt: 1 # Success: False # Overall Score: 0.432 Here's a Python module for your requirement using PyVerilog and Regex to change bit width of signals at once, along with error handling as per requirements mentioned in task description above (1-5). This ...
Python
1
str, default: bool = False) -> bool: """불린 설정값 조회 편의 함수""" return get_config_manager().get_bool(name, default) def get_optional_string_config(name: str, default: Optional[str] = None) -> Optional[str]: """선택적 문자열 설정값 조회 편의 함수""" return get_config_manager().get_optional_string(name, default) # ========...
Python
1
from itertools import cycle from evalassist.benchmark import run_benchmarks from evalassist.judges import BaseDirectJudge, DirectJudge if __name__ == "__main__": MAX_WORKERS = 1 BATCH_SIZE = 25 RITS_API_KEYS = None INSTANCES_PER_DATASET = 300 # List of models to benchmark MODELS = [ "g...
Python
1
mounted Revoke, } /// Process events /// /// These are OS-specific, and may not all be supported on your platform. Check /// `kqueue(2)` for more information. #[derive(Debug)] pub enum Proc { /// The watched process exited with the returned exit code Exit(usize), /// The process called `fork(2)` F...
Rust
0
is returned from remote storage based on quorum-read flag; - if it's 0, then we simply return what we currently have in cache, no guarantee; - if set to non zero, then the result is at least as fresh as given rv. pub resource_version: Option<&'a str>, /// Timeout for the list/watch call. This limits the durat...
Rust
0