text
string
label_name
string
labels
int64
import pandas as pd start_date = '2021-01-01 00:00:00' end_date = '2021-12-31 23:00:00' datetime_range = pd.date_range(start=start_date, end=end_date, freq='H') # Read hourly power prices from CSV hourly_power_prices_df = pd.read_csv('/Users/luigibottecchia/Dev/PhD/graphs_pyplot/dataprices/power_prices.csv') # Read ...
Python
1
ancel" button.''' self.EndModal(wx.ID_CANCEL) def update_simpack_list(self): '''Update the list of available simpacks.''' self.list_of_simpacks = [] for path, package_prefix in garlicsim_wx.simpack_places: if path not in sys.path: ...
Python
1
.interpolate( freq_new_pos_embed, size=(1, targ_freq_len), mode='bilinear')) elif 'head' in key: if key in ['head.0.weight', 'head.0.bias']: value.data.copy_(passt_ckpt[key]) else: value.data.cop...
Python
1
ive(PartialEq, Eq, Clone, Encode, Decode)] #[cfg_attr(feature = "std", derive(Debug, Default, Hash))] pub struct CandidateCommitments { /// Fees paid from the chain to the relay chain validators. pub fees: Balance, /// Messages destined to be interpreted by the Relay chain itself. pub upward_messages: Vec<UpwardMes...
Rust
0
f(test_dir) @unittest.skipIf(not util.canBuildNatively(), "can't build natively on windows yet") def test_Toplevel_Application(self): test_dir = util.writeTestFiles(Test_Toplevel_Application) stdout = self.runCheckCommand(['--target', util.nativeTarget(), 'build'], test_dir) output = su...
Python
1
', resume_after = slurmrest_python.models.v0_0_41_openapi_nodes_resp_nodes_inner_resume_after.v0_0_41_openapi_nodes_resp_nodes_inner_resume_after( set = True, infinite = True, number = 56, ), reservation = '', ...
Python
1
import time import board import busio import terminalio import displayio import os import gc import microcontroller import digitalio import supervisor GUI=True SCALE=1 from picomputer import * hidden_ID = ['.', '_', 'TRASH', 'boot_out.txt', 'main.py', 'code.py', 'menu.py', 'main.txt', 'code.txt', 'boot.py'] ...
Python
1
oweeks(), 52); assert_eq!(C.nisoweeks(), 52); assert_eq!(D.nisoweeks(), 53); assert_eq!(E.nisoweeks(), 52); assert_eq!(F.nisoweeks(), 52); assert_eq!(G.nisoweeks(), 52); assert_eq!(AG.nisoweeks(), 52); assert_eq!(BA.nisoweeks(), 52); assert_eq!(CB.nisoweek...
Rust
0
import pandas as pd import matplotlib.pyplot as plt # Listas com os parâmetros vars_list = [20, 100, 250] sa_max_list = [1, 5, 10] # Tamanho e estilo do gráfico plt.style.use("seaborn-v0_8-deep") fig, axs = plt.subplots(1, 3, figsize=(15, 5), sharey=True) for idx, vars_value in enumerate(vars_list): data = [] ...
Python
1
receiver.try_next().unwrap().unwrap(); assert_eq!(receiver_replicate_result, "replicate-snapshot some_db_name"); } #[test] fn should_replicate_if_the_command_is_a_create_db_and_node_is_primary() { let (sender, mut receiver): (Sender<String>, Receiver<String>) = channel(100); let req...
Rust
0
); assert_eq!(QualitativeSeverityRating::from_quantitative_rating(9.9), QualitativeSeverityRating::Critical); assert_eq!(QualitativeSeverityRating::from_quantitative_rating(10.0), QualitativeSeverityRating::Critical); assert_eq!(QualitativeSeverityRating::from_quantitative_rating(10.1), QualitativeSeverityR...
Rust
0
g | rook; self[Role::King] ^= king; self[Role::Rook] ^= rook; } } /// A type that can be used for [`MultiBoard`](struct.MultiBoard.html) indexing /// operations. pub trait Index { /// Returns the `BitBoard` for `self` in `board`. fn bits(self, board: &MultiBoard) -> BitBoard; /// Remov...
Rust
0
assert_eq!(StaticStr::from(ApiReqType::Dashboard), "dashboard"); assert_eq!( StaticStr::from(ApiReqType::RedirectToDashboard), "redirect_to_dashboard" ); assert_eq!( StaticStr::from(ApiReqType::InvalidArgument), "invalid_argument" ); ...
Rust
0
} let solution = puzzle.at_least_one_present(); println!("{} houses received at least one present.", solution); } // Copyright 2017 The UNIC Project Developers. // // See the COPYRIGHT file at the top-level directory of this distribution. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or...
Rust
0
tbot.load_prompt_template') async def test_generate_explanation_cleans_prefixes( self, mock_template, mock_clean, mock_vllm, sample_messages ): """Test that explanation removes common AI prefixes""" # Setup mocks mock_template.return_value = "test ...
Python
1
else { Err(ParseError::MissingFileFormat) } } fn parse_record(mut builder: Builder, line: &str) -> Result<Builder, ParseError> { let record: Record = line.parse().map_err(ParseError::InvalidRecord)?; builder = match record.key() { record::Key::FileFormat => { return Err(ParseE...
Rust
0
it()) return w def create_canvas(c=None): if not c: c = Canvas() b = MyBox(c.connections) b.min_width = 20 b.min_height = 30 b.matrix.translate(20, 20) b.width = b.height = 40 c.add(b) bb = Box(c.connections) bb.matrix.translate(10, 10) c.add(bb, parent=b) bb...
Python
1
} #[derive(Debug, PartialEq)] enum ConwayCubeParseError { InvalidCharacter(char), OutOfRange(TryFromIntError), } impl TryFrom<&str> for ConwayCube { type Error = ConwayCubeParseError; fn try_from(input: &str) -> Result<Self, Self::Error> { let active: HashSet<Idx3> = input .split...
Rust
0
# ckwg +29 # Copyright 2020 by Kitware, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
Python
1
+ sp_std::ops::Sub<Output = B> + From<u32> + PartialOrd, > RoundInfo<B> { pub fn new(current: RoundIndex, first: B, length: u32) -> RoundInfo<B> { RoundInfo { current, first, length } } /// Check if the round should be updated pub fn should_update(&self, now: B) -> bool { now - self.first >= s...
Rust
0
import os import glob import math import numpy as np from atom_location import parse_poscar from atom_location import calculate_distance from utils import calculate_plane_normal from atom_location import calculate_angle from reorder_atom import reorder_atoms def rotation_matrix(axis, theta): """ 给定旋转轴(axis)和旋...
Python
1
IOError as er: MyLogger.log(modulename,'WARNING',"Sensor input failure: %s" % er) return {} # test main loop if __name__ == '__main__': from time import sleep import sys Conf['input'] = True # Conf['sync'] = True # sync = False will start async collect Conf['debug'] = True # ...
Python
1
one, Copy)] enum RomType { LoRom, HiRom, } impl RomHeader { fn dump(&self) { info!("ROM name: '{}'", str::from_utf8(&self.title).unwrap_or("").trim_right()); info!("{} KB ROM / {} KB Cartridge RAM", self.rom_size / 1024, self.ram_size / 1024); } /// Loads the ROM header from the gi...
Rust
0
""" Provide string-manipulation functions for regulation paragraphs. Paragraph parsing operations that manipulate paragraph IDs are handled by the patterns.IdLevelState class. """ import re def bold_first_italics(graph_text): """For a newly broken-up graph, convert the first italics text to bold.""" if grap...
Python
1
d (discovery operation) assert get_result.success is False assert "expired" in get_result.message asyncio.run(run_test()) def test_session_error_handling(self): """Test error handling for edge cases.""" async def run_test(): injector...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.constant.ParamConstants import * class SeatInfo(object): def __init__(self): self._seat_class = None self._seat_no = None @property def seat_class(self): return self._seat_class @seat_class.setter...
Python
1
"std")] /// # fn main() -> Result<(), Box<dyn std::error::Error>> { /// # fn escape(buf: &[u8]) -> &[u8] { buf } /// # fn itoa_fmt<T>(num: T) -> Vec<u8> { vec![] } /// # fn ryu_fmt<T>(num: T) -> Vec<u8> { vec![] } /// # use std::io::Write; /// use value_bag::{ValueBag, Error, visit::Visit}; /// /// // Implemen...
Rust
0
# file scalene/scalene_profiler.py:1843-1854 # lines [1843, 1844, 1846, 1848, 1850, 1851, 1852, 1853] # branches [] import pytest import sys from unittest.mock import patch from scalene.scalene_profiler import Scalene @pytest.fixture def scalene_cleanup(): # Fixture to clean up any state after the test yield...
Python
1
ry_storage_type: %s\n" % ( disk_storage_type if disk_storage_type != '' else "STORAGE TYPE COULD NOT BE FETCHED!" ) ) f.write(" secondary_logical_unit_id: # %s\n" % disk_id) if disk_storage_type == otypes.StorageType.ISCSI: ...
Python
1
a(HackingTool): TITLE = "Enigma" DESCRIPTION = "Enigma is a Multiplatform payload dropper" INSTALL_COMMANDS = [ "sudo git clone https://github.com/UndeadSec/Enigma.git"] RUN_COMMANDS = ["cd Enigma;sudo python3 enigma3.py"] PROJECT_URL = "https://github.com/UndeadSec/Enigma" class PayloadCr...
Python
1
def filtrar_productos(precios, umbral, condicion="mayor"): """Arg precios: Un diccionario con los productos y sus precios. umbral: El valor umbral para la comparación. condicion: La condición de comparación ("mayor" o "menor"). Returns: Una lista con los nombres de los productos""" productos_fi...
Python
1
# -*- coding: utf-8 -*- # Lint as: python3 # Copyright 2020 Google Inc. 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 # ...
Python
1
&Proof::from(proof), &protocol_tag, &None, )?, &message, )?) } #[cfg(test)] mod test { use super::*; use crate::bp::test::*; use crate::commit_verify::test::*; use bitcoin::hashes::{hex::ToHex, Hash}; use bitcoin::secp256k1; use std::str::FromS...
Rust
0
f"gdkmm-{self._abi_version}" self.cpp_info.components[gdkmm_lib].set_property("pkg_config_name", gdkmm_lib) self.cpp_info.components[gdkmm_lib].libs = [gdkmm_lib] self.cpp_info.components[gdkmm_lib].includedirs += [ os.path.join("include", gdkmm_lib), ...
Python
1
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors # License: MIT. See LICENSE import frappe def get_context(context): token = frappe.local.form_dict.token if token: frappe.db.set_value("Integration Request", token, "status", "Cancelled") frappe.db.commit()
Python
1
res.iter() { let val: i32 = val.extract()?; if val > highest.1 { highest = (key.to_string(), val); } } debug!("{res:#?}"); Ok(format!("{}: {}", highest.0, highest.1)) }) } fn start_measure(&mut se...
Rust
0
... ) -> ::std::os::raw::c_int; } extern "C" { pub fn vfscanf( __s: *mut FILE, __format: *const ::std::os::raw::c_char, __arg: *mut __va_list_tag, ) -> ::std::os::raw::c_int; } extern "C" { pub fn vscanf( __format: *const ::std::os::raw::c_char, __arg: *mu...
Rust
0
self.sprites[sprite_index].sprite_line ^= SPRITE_16X_FLIPMASK; } else if (self.sprites[sprite_index].attribute & VFLIP) > 0 { self.sprites[sprite_index].sprite_line ^= SPRITE_8X_FLIPMASK; } sprite_index += 1; } } pub fn pattern0_address(&mut self, conte...
Rust
0
# Solicitar al usuario que ingrese un número entero no negativo a = input("Introduce un número entero no negativo: ") # Convertir el valor de entrada a un entero while True: try: a = int(a) break except ValueError: print("Por favor, introduce un número entero no negativo.") a =...
Python
1
print( f"loading pre-trained weights at step {step} from \ {config.model.archive} with metrics \ {json.dumps(metrics, indent=2)}" ) policy.load_state_dict(state_dict["state"]) if config.loss.name == "dpo": reference_model.load_state_dict(s...
Python
1
.org/wiki/Sidecar_file //! [SignTool]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa387764(v=vs.85).aspx //! [statically link the CRT]: https://doc.rust-lang.org/reference/linkage.html#static-and-dynamic-c-runtimes //! [`std::process::Command`]: https://doc.rust-lang.org/std/process/struct.Command.html //...
Rust
0
019 07:59:25 PM PDT, */ /* for Linux, release 5.0.0-27-generic */ #[allow( non_snake_case, non_camel_case_types, non_upper_case_globals, dead_code, unused_variables )] pub mod langinfo; #[allow( non_snake_case, non_camel_case_types, non_upper_case_globals, dead_code, unused_va...
Rust
0
from_raw(this_ptr as *mut nativeUnsignedNodeAnnouncement); } } #[allow(unused)] /// When moving out of the pointer, we have to ensure we aren't a reference, this makes that easy impl UnsignedNodeAnnouncement { pub(crate) fn take_ptr(mut self) -> *mut nativeUnsignedNodeAnnouncement { assert!(self.is_owned); let ret...
Rust
0
lib::environment::Environment; use crate::lib::error::DfxResult; use clap::Clap; mod delete; mod install; mod list; mod show; /// Manages the dfx version cache. #[derive(Clap)] #[clap(name("cache"))] pub struct CacheOpts { #[clap(subcommand)] subcmd: SubCommand, } #[derive(Clap)] pub enum SubCommand { D...
Rust
0
thJWT._header_name = "Authorization" def test_custom_header_type(client,Authorize): class HeaderType(BaseSettings): authjwt_secret_key: str = "secret" authjwt_header_type: str = "JWT" @AuthJWT.load_config def get_header_type(): return HeaderType() token = Authorize.create_acce...
Python
1
ise_pred = noise_pred.chunk(2, dim=1)[0] # perform guidance scale # NOTE: For exact reproducibility reasons, we apply classifier-free guidance on only # three channels by default. The standard approach to cfg applies it to all channels. # This can be done...
Python
1
let Some(rid) = args.layout { let pipeline_layout_resource = state.resource_table.get::<WebGpuPipelineLayout>(rid)?; Some(pipeline_layout_resource.0) } else { None }; let vertex_shader_module_resource = state .resource_table .get::<super::shader::WebGpuShaderModule>(args.vertex...
Rust
0
int, existing_runs: List[str], expected_deletion_plan: Set[str], ) -> None: """It should return a plan that leaves at least one slot open for a new run.""" subject = RunDeletionPlanner(maximum_runs=maximum_runs) result = subject.plan_for_new_run(existing_runs=existing_runs) assert result == expe...
Python
1
return host, port return host, None def explode_ip(ip): if isipv4(ip): return explode_ipv4(ip) elif isipv6(ip): return explode_ipv6(ip) else: return [] def explode_ipv4(ip): nw24 = ip.rpartition('.')[0] return [f'{nw24:s}.{i:d}' for i in range(256)] def explode_ipv6...
Python
1
atrix.matrixheight matrixwidth = tilematrix.matrixwidth tileheight = tilematrix.tileheight tilewidth = tilematrix.tilewidth tilematrixminx = tilematrix.topleftcorner[0] # here we assume 3857 tilematrixmaxy = tilematrix.topleftcorner[1] # ...
Python
1
for SpriteProgram { fn drop(&mut self) { unsafe { gl::DeleteProgram(self.handle); gl::DeleteShader(self.fs); gl::DeleteShader(self.vs); gl::DeleteVertexArrays(1, &self.vao); } } } <filename>rust/src/models/request.rs /* * GraphHopper Directions ...
Rust
0
modifiers: KeyMods, repeat: bool, }, KeyUp { keycode: KeyCode, modifiers: KeyMods, }, Touch { phase: TouchPhase, id: u64, x: f32, y: f32, }, } impl MiniquadInputEvent { fn repeat<T: miniquad::EventHandler>(&self, ctx: &mut QuadContext, t: ...
Rust
0
ap::uuidof(), cbv_descriptor_heap.mut_void(), ) }; assert!( winerror::SUCCEEDED(cbv_descriptor_heap_hr), "error on constant buffer descriptor heap creation 0x{:x}", cbv_descriptor_heap_hr ); self.cbv_descriptor_heap = cbv_descriptor_heap; unsafe { let buffer_name : String = String::from("cb...
Rust
0
break elif event.type == pygame.MOUSEBUTTONUP: if dragging: closest_stack = min(range(3), key=lambda i: abs(150 + i * 250 - pygame.mouse.get_pos()[0])) if is_valid_move(dragged_disk_start_stack, closest_stack): ...
Python
1
hal::spi::Transaction::write(vec![192, 168, 0, 11, 0, 67]), /// # ]); /// # let pin = hal::pin::Mock::new(&[ /// # hal::pin::Transaction::set(hal::pin::State::Low), /// # hal::pin::Transaction::set(hal::pin::State::High), /// # ]); /// use w5500_ll::{ /// blocking::vdm::W5500, ...
Rust
0
addlabels(list(categories.keys()), list(categories.values())) plt.ylabel("Number of Movies") plt.xlabel("Binned Category") plt.title("Movies per binned identity") plt.savefig("./plots/Movies/identities_binned_split.png", format="png", bbox_inches='tight', pad_inches=0.5) def addlabels(x,y): f...
Python
1
a d@sdZddlZddlZejZeddkZeddkZz ddlZWne yXddlZYn0erddl m Z m Z m Z mZmZmZmZmZmZddlmZmZmZmZmZddlmZddlZddlmZdd lmZdd lm Z m!Z!m"Z"m#Z#e$Z%e$Z&e'Z$e(Z(e)e*e+fZ,e)e*fZ-nerdd l...
Python
1
println!("History graph open in your browser"); } } } Err(e) => { eprintln!("reading task history failed: {}", e); } _ => { eprin...
Rust
0
s", check_id)); match r.call() { Ok(response) => Ok(response.into_json::<Check>()?), Err(Error::Status(401, _)) => Err(HealthchecksApiError::InvalidApiKey), Err(Error::Status(403, _)) => Err(HealthchecksApiError::AccessDenied), Err(Error::Status(404, _)) => { ...
Rust
0
# Copyright (c) 2022 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 appli...
Python
1
_LITTLEENDIAN_INTEGER: i32 = 227; pub const WSTK_32BIT_SIGNED_2sCOMPLEMENT_LITTLEENDIAN_INTEGER: i32 = 228; pub const WSTK_32BIT_UNSIGNED_2sCOMPLEMENT_LITTLEENDIAN_INTEGER: i32 = 229; pub const WSTK_32BIT_UNSIGNED_LITTLEENDIAN_INTEGER: i32 = 229; pub const WSTK_64BIT_SIGNED_2sCOMPLEMENT_LITTLEENDIAN_INTEGER: i32 = 230;...
Rust
0
="omit"), "Kurtosis": kurtosis(series, nan_policy="omit"), "ACF (1)": series.autocorr(lag=1), "0 Cross": ((series.shift(1) - series.mean()) * (series - series.mean()) < 0).sum() } return pd.DataFrame([stats]).round(3) def _add_overlay_blocks( fig, df, column_name, timestamps_col, c...
Python
1
ainedConfig] = None, ) -> None: scaling_factors = (list(lora_config.long_lora_scaling_factors) if lora_config.long_lora_scaling_factors else []) base_scaling_factor = (self.base_layer.scaling_factor if isinstance( self.base_layer, LinearScalingRotaryEmbedding) ...
Python
1
10}', # 'TurbVisRatio':'{0:{fill}>14}', # 'TurbInten':'{0:{fill}>11}', # 'CoreRadiusFraction':'{0:{fill}>20}'} #formatDict = {'p1':'{0:10.2%}', 'T1':'{0:>10.2%}', # 'Vs':'{0:>10.2%}', 'pe':'{0:>10.2%}', # 'Tw':'{0:>1...
Python
1
from parsetron import RobustParser, TopDownStrategy, BottomUpStrategy, \ LeftCornerStrategy import time import sys sents = [ (True, "lights please on"), (True, "flash both top and bottom light with red color and middle light " "with green"), (True, "flash middle light twice with red and top ...
Python
1
from antlr4 import CommonTokenStream, InputStream from antlr4.tree.Tree import ParseTreeWalker from module_programming_apted.convert_code_to_ast.languages.python.Python3Lexer import Python3Lexer from module_programming_apted.convert_code_to_ast.languages.python.Python3Parser import Python3Parser from module_programming...
Python
1
match="Options 'delta_csm_min' and \"delta_csm_max\" should be provided for function", ): DeltaCSMRatioFunction(function="smootherstep", options_dict={}) with pytest.raises( ValueError, match="Options 'delta_csm_min' and \"delta_csm_max\" should be provided ...
Python
1
: out_context = load_from_file(out_file) context = itertools.chain(context, out_context) context, context_clone = itertools.tee(context) best_context = ApplyHistoryBest(context) best_set = set() for v in best_context.best_by_model.values(): best_set.add(measure_str_key(v[0])) ...
Python
1
0 { // It's hard to imagine a scenario in which it would // be useful to inherit breakpoints (along with their // refcounts) across a non-VM-sharing clone, but for // now we never want to do this. new_task.vm().remove_all_breakpoints(); new_task.vm().remove_all_watch...
Rust
0
r::UNDERLINED), ), Span::styled(rest, Style::default().fg(Color::White)), ]) }) .collect(); let tabs = Tabs::new(menu) .select(active_menu_item.into()) .block(Block::default()...
Rust
0
e): fan_in = input_size bias_bound = 1.0 / math.sqrt(fan_in) fc_bias_attr = paddle.ParamAttr(initializer=nn.initializer.Uniform( low=-bias_bound, high=bias_bound)) negative_slope = math.sqrt(5) gain = math.sqrt(2.0 / (1 + negative_slope**2)) std = gain / math.sqrt(fan_in) weight_bound = ma...
Python
1
} else if c == '!' { let mut stdout = io::stdout(); stdout.write(&[cell]).unwrap(); stdout.flush().unwrap(); } else if c == '?' { let mut input = String::new(); std::io::stdin().read_line(&mut input).expect("Error reading line.")...
Rust
0
import time from binascii import hexlify from ledger.test.test_file_hash_store import generateHashes from storage.text_file_store import TextFileStore def testMeasureWriteTime(tempdir): store = TextFileStore(tempdir, 'benchWithSync', isLineNoKey=True, storeContentHash=False) hashes ...
Python
1
_男性_薄い肌色_濃い肌色:', 'ko': ':키스_남자_남자_하얀_피부_검은색_피부:', 'pt': ':beijo_homem_homem_pele_clara_e_pele_escura:', 'it': ':bacio_tra_coppia_uomo_uomo_carnagione_chiara_e_carnagione_scura:', 'fa': ':بوسه_مرد_مرد_پوست_سفید_و_پوست_آبنوسی:', 'id': ':berciuman_pria_pria_warna_kulit_cerah_warna_k...
Python
1
= 'tensorrt': from mmdet.core.export.model_wrappers import TensorRTDetector model = TensorRTDetector( args.model, class_names=dataset.CLASSES, device_id=0) model = MMDataParallel(model, device_ids=[0]) outputs = single_gpu_test(model, data_loader, args.show, args.show_dir, ...
Python
1
import torch as th class BaseMap: """ Base map class. Contains basic interface for converting from map to world frame, and vise-versa """ def __init__( self, map_resolution=0.1, ): """ Args: map_resolution (float): map resolution """ ...
Python
1
], ['b', 2], ['b', 3], ['b', 4], ['b', 5], ['b', 6], ['b', 7], ['b', 8], ['b', 9], ['b', 10], ['b', 11], ['b', 12], ['b', 13], ['b', 14], ['b', 15], ['c', 0], ['c', 1], ['c', 2], ['c', 3], ['c', 4], ['c', 5], ['c', 6], ['c', 7], ...
Rust
0
(default $PWD) #[clap(short, long, value_hint = ValueHint::DirPath)] path: Option<PathBuf>, } pub fn init_repo(args: InitArgs) -> Result<()> { let old = std::env::current_dir()?; let res = { if let Some(path) = args.path { std::env::set_current_dir(&path) .wrap_err_...
Rust
0
on::new("-", 1, 2, 1)))); assert_eq!(scanner.is_at_end(), true); scanner = Scanner::new("-", "; Single-Line Comment\n"); assert_eq!(scanner.is_at_end(), false); assert_eq!(scanner.next(), Some(Token::SingleLineComment("; Single-Line Comment", SourceFileLocation::new("-", 1, 1, 21)))); assert_eq...
Rust
0
import sys import os # Add the parent directory to the Python path sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from parameters import INITIAL_RAW_MATERIAL import matplotlib.pyplot as plt from my_environment.raw_material import RawMaterial raw_material = RawMaterial() # Generate d...
Python
1
use compiler_builtins::int::sdiv::__divsi3; static TEST_CASES: &[((i32, i32), i32)] = &[ " } fn epilogue() -> &'static str { " ]; #[test] fn divsi3() { for &((a, b), c) in TEST_CASES { let c_ = __divsi3(a, b); assert_eq!(((a, b), c), ((a, b), c_)); } } " }...
Rust
0
partner1.id, self.partner3.id], self.partner1) self.assertFalse(self.partner3.exists(), "Source partner should be deleted after merge") self.assertTrue(self.partner1.exists(), "Destination partner should exist after merge") self.assertEqual(len(self.partner1.bank_ids), 1, "There should be a sin...
Python
1
'parser mut Parser<'code, T>); impl<'parser, 'code, T: Tokenizer<'code>> ParserProxy<'parser, 'code, T> { fn new(p: &'parser mut Parser<'code, T>) -> ParserProxy<'parser, 'code, T> { ParserProxy(p) } pub fn with<'p>(&'p mut self, flag: Flag) -> ParserProxy<'p, 'code, T> { self.push_flags(f...
Rust
0
acter in pstring: sin_omega = sin(omega) cos_omega = cos(omega) xpos = xmid + radius*sin_omega ypos = ymid - radius*cos_omega zpos = zmin + pitch*omega # In general, the inclination is proportional to the derivative of # the position wrt theta. x_inclinati...
Python
1
/// The update to perform for the visibility of the Race. #[serde(skip_serializing_if = "Option::is_none")] pub visibility: Option<Visibility>, } /// Creates a new Race. pub async fn create(client: &Client, settings: Settings<'_>) -> Result<Race, Error> { let ContainsRace { race } = get_json( ...
Rust
0
#----------------------------------------------------------------------------- # Copyright (c) 2013-2023, PyInstaller Development Team. # # Distributed under the terms of the GNU General Public License (version 2 # or later) with exception for distributing the bootloader. # # The full license is in the file COPYING.txt...
Python
1
eference.insert(k, u16::from(new)); } } Scan(k, len) => { let mut tree_iter = tree .scan(&*k.0) .take(len) .map(|res| res.unwrap()); let ref_iter = reference .iter() ...
Rust
0
to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False # -- Options for Epub output ---------------------------------------------- # Bibliographic Dublin Core info. epub_title = proje...
Python
1
import streamlit as st def render(): # Menampilkan konten dalam layout full screen st.markdown( """ <div class="fullscreen"> <div> <h1>About Me</h1> <p>"I am a passionate web developer from Yogyakarta, dedicated to creating user-friendly and accessibl...
Python
1
None, description="智能分析结果,包含数据和分析解读", example="贵州茅台(600519.SH)在2025年6月20日的股价为:开盘价1423.58元..." ) query_type: Optional[str] = Field( None, description="查询类型:sql/rag/financial_analysis/money_flow/hybrid", example="sql" ) sources: Optional[Dict[str, Any]] = Fi...
Python
1
""" Program to counts the number of digits in a given integer. It handles: - Positive numbers - Negative numbers (ignores the minus sign) - Zero (correctly returns 1 digit) The core logic divides the number by 10 repeatedly to strip off digits until the number becomes 0, incrementing a counter along the way. Time Co...
Python
1
def test_hota_score_4(self): """Test for HOTA Score when an object is missing in the middle.""" bboxes_track = player_dfs[0].copy() bboxes_track.loc[1] = -1 bboxes_gt = pd.concat([player_dfs[0], player_dfs[1]], axis=1) hota = hota_score(bboxes_track, bboxes_gt) HOTA_TP = 1.0 HOTA_FN = 3.0 ...
Python
1
} } } <reponame>Kodowa/eve-native<filename>tests/indexes.rs extern crate eve; use eve::indexes::*; use eve::ops::{EstimateIter, OutputRounds, RoundHolder, Change}; use std::collections::HashMap; #[test] fn index_insert_check() { let mut index = HashIndex::new(); index.insert(1,1,1); index.inser...
Rust
0
k4t3rib2fx return 0j '# documentation_contrast_horizon -> wait_junctions_buzzer' nonlocal ra0covzfuwc m80ueeuurli = gu0bzdnaa27 import ctbze5cr0j6, rjjyk5hto7a as h4rg8vnm5hy, u4wgbovcxon, uuldn19l3zo, z408ngda86z as zxwxuf21qdn '# documentation_contrast_horizon -> wait_junctions_buzzer' (mh...
Python
1
from collections import Counter import pickle class TrieNode: def __init__(self): self.children = {} self.c=Counter() class Trie: def __init__(self): self.root = TrieNode() def update(self, nums,value): node = self.root for num in nums: if num not in no...
Python
1
类型: {fix_result.defect_type}") print(f" 文件路径: {fix_result.file_path}") print(f" 行号: {fix_result.line_number}") print(f" 严重程度: {fix_result.severity_assessment.value}") print(f" 修复复杂度: {fix_result.fix_complexity.value}") print(f" 置信度: {fix_result.confi...
Python
1
import time from neko_sdk.neko_framework_NG.UAE.neko_modwrapper_agent import neko_module_wrapping_agent from neko_sdk.neko_framework_NG.workspace import neko_workspace, neko_environment # We will separate seq with att, as att is not affected by the training state now. # use gt_length as "length_name" for training an...
Python
1
""" wayback_web4 - A tool for downloading websites from Wayback Machine and deploying to Web4 """ __version__ = "0.1.0"
Python
1
bin_alias: &str, problem_url: &Url, shell: &mut Shell, ) -> anyhow::Result<Utf8PathBuf> { let contest = match PlatformKind::from_url(problem_url) { Ok(PlatformKind::Atcoder) => Some(snowchains_core::web::atcoder_contest_id(problem_url)?), Ok(PlatformKind::Codeforces) => { So...
Rust
0
{ verify_standard_transaction(request, &params).await }; match verification_result { Ok(()) => status::status("Transaction\nconfirmed", true).await, Err(err) => { if err == Error::UserAbort { status::status("Transaction\ncanceled", false).await; }...
Rust
0