text
string
label_name
string
labels
int64
"_Test Company with perpetual inventory" customer = create_internal_customer( "_Test Internal Customer 3", company, company, ) supplier = create_internal_supplier( "_Test Internal Supplier 3", company, company, ) for store in ["Inter Transfer Store 1", "Inter Transfer Store 2", "Inter Transfer Stor...
Python
1
tring(&self) -> String { match self { Self::Known(mime) => mime.mime().to_string(), Self::Unknown(s) => s.clone(), Self::None => String::new() } } /// Returns `Charset::Utf8` if the mime type is known and is a text file. pub fn charset(&self) -> Option<Charset> { match self { Self::Known(mime) ...
Rust
0
from pathlib import Path import gymnasium as gym from stable_baselines3 import PPO from stable_baselines3.common.evaluation import evaluate_policy from stable_baselines3.common.vec_env import DummyVecEnv, VecNormalize checkpoint = Path("human.checkpoint") vec_env = DummyVecEnv([lambda: gym.make("InvertedPendulum-v4"...
Python
1
# @author Avtandil Kikabidze # @copyright Copyright (c) 2008-2015, Avtandil Kikabidze aka LONGMAN (akalongman@gmail.com) # @link http://longman.me # @license The MIT License (MIT) import os import sys import re import htmlbeautifier import sublime directory = os.path.dirname(os.path....
Python
1
command=self.start_trading, state='abled') self.start_btn.pack(side='left', padx=5) self.stop_btn = ttk.Button(button_frame, text="매매 중지", command=self.stop_trading, ...
Python
1
from import_packages import * class FaceGenerator(object): """docstring for FaceGenerator.""" def __init__(self, current_dir, encoding_outfile, face_directory_name): super(FaceGenerator, self).__init__() self.current_dir = current_dir self.encoding_outfile = encoding_outfile self.face_directory_name = face_...
Python
1
} string.push(c as char); } } struct Serial {} impl Write for Serial { fn write_str(&mut self, s: &str) -> core::fmt::Result { write_str(s); Ok(()) } } #[doc(hidden)] pub fn _print_args(args: ::core::fmt::Arguments) { Serial {} .write_fmt(args) .expect...
Rust
0
"""Handle parsing and providing pipette information.""" import re from typing import Dict, Tuple import struct from opentrons_shared_data.errors.exceptions import ( InvalidInstrumentData, PythonException, ) from opentrons_hardware.firmware_bindings.constants import PipetteName from opentrons_hardware.instrument...
Python
1
_badge.authorize(|auth| {self.nft_shares_def.mint(distribution_amount, auth)}); //gets address from vector let address:Address = self.nft_owners[i]; //sends share distribution amount to each address Component::from(address).call::<()>("d...
Rust
0
eturn a list of laid out pages without margin boxes. Re-make pages only if necessary. """ i = 0 reported_footnotes = None while True: remake_state = context.page_maker[i][-1] if (len(pages) == 0 or remake_state['content_changed'] or remake_state['pag...
Python
1
; if log_m == GF_MODULUS { Self::xor_within(data, pos + dist, pos, dist); } else { let (mut a, mut b) = data.split_at_mut(pos + dist); for i in 0..dist { self.ifft_butterfly_partial( &mut a[pos + i], // d...
Rust
0
from lxml import etree def tensor_to_cdata(X): """Converts a tensor representation of voxels to a cdata representation. A tensor representation of voxels in R^4 is defined by: f(x, y, z) = m where m is the material type in which 0 represents empty space. The corresponding cdata representation...
Python
1
Some((name, value)) }, None => None } } else { // Index out of bounds! None } } } /// Finds the given header in the header table. Tries to match both the /// header name and value to one ...
Rust
0
FailureReason, TestResult}; use crate::toolchain::{MAIN_TOOLCHAIN, TEST_TOOLCHAIN}; use crates_index::Index; #[test] fn test_crate_to_path_fragment() { let reg = Crate::Registry(RegistryCrate { name: "lazy_static".into(), version: "1.0".into(), }); let g...
Rust
0
client.get(&rs).send().await; let query_res = resp.unwrap().text().await.unwrap(); let c = query_res.matches("</entry>").count(); (c as u32, query_res) } async fn update_feed_index(feed: &Feed, limitoutput: bool, prerelease: bool) -> String { let total_pkg_count = get_package_count_on_feed(feed, prerelease).a...
Rust
0
# bai 1 def ma_hoa_list(l): new_l = {} for index, item in enumerate(l, 0): if new_l.get(item) == None: new_l.update({item: index}) for i in range(len(l)): l[i] = new_l.get(l[i]) return l print('List ma hoa: ',ma_hoa_list(l=['xanh', 'do', 'cam', 'vang', 'xanh', 'do'])) # Bai...
Python
1
# cleaning.py def clean_up_poop(monster): """ Cleans up the monster's poop or vomit, adjusting happiness and hygiene accordingly. Removes the poop/vomit images and resets the relevant attributes. """ print(f"Cleaning up after {monster.name}...") had_poop = len(monster.poop_list) > 0 had_vo...
Python
1
page.update() if (code := response["code"]) != 200: send_error(page, f"加载失败: ({code}) {response['message']}") else: update_user_controls(response["data"]["users"], _update_page) user_listview.visible = True if _update_page: user_listview.update() loading_animati...
Python
1
let entry_uri: &Uri = &entry.config.uri(); let uri = format!( "{}://{}{}", entry_uri.scheme_str().unwrap(), entry_uri.host().unwrap(), path_query ); *req.uri_mut() = Uri::try_from(uri).unwrap(); req.headers_mut().insert( ...
Rust
0
return Ok(Type::EmptyParameterPack); } if self.consume(b"$T") { return Ok(Type::Nullptr); } if self.consume(b"$A6") { return self.read_func_type(false); } if self.consume(b"$A8@@") { retur...
Rust
0
ty: AfterTy, comma_opt: Option<PToken>, px: &mut Px, ) -> AfterParamTy { (ty, comma_opt, event.end(PElementKind::ParamTy, px)) } pub(crate) fn alloc_param_ty_list( left_paren: PToken, param_tys: Vec<AfterParamTy>, right_paren_opt: Option<PToken>, px: &mut Px, ) -> AfterParamTyList { ...
Rust
0
from unittest import TestCase import pandas as pd from pytz import UTC from .test_trading_calendar import EuronextCalendarTestBase from trading_calendars.exchange_calendar_xpar import XPARExchangeCalendar class XPARCalendarTestCase(EuronextCalendarTestBase, TestCase): answer_key_filename = 'xpar' calendar_c...
Python
1
h_stars>10-100 extern crate pest; #[macro_use] extern crate pest_derive; extern crate serde; pub use parser::parse; pub mod ast; pub mod validator; pub mod parser; pub mod errors; pub mod support; //! The `std::vec` module. use crate::{ContextError, Module, Protocol, Vec}; /// Construct the `std::vec` module. pub f...
Rust
0
et, storage::MbrDevice}; // NOTE binary interfaces, using `no_mangle` and `extern`, are extremely unsafe // as no type checking is performed by the compiler; stick to safe interfaces // like `#[rtic::app]` #[no_mangle] fn main() -> ! { let emmc = eMMC::take().expect("eMMC").unwrap(); let mut mbr = MbrDevice::...
Rust
0
0.8838834764831842, -1.75); [1.0, 4.0, 1.0, 3.0, 1.0], // TODO Check OpenOffice gave: 0.883883476483184 } #[test] fn accumulators_should_read_and_sumarise_data () { let mut a = Accumulators::new(); assert_eq!(0, a.column()); assert_eq!(0, a.rows()); assert_eq!(0, a....
Rust
0
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup from .callback import * def menu_markup(user_id: int): callback_data_history = HistoryCallback(user_id=user_id) callback_data_banner = BannerCallback(user_id=user_id) callback_data_characters = CharactersCallbackc(user_id=user_id, page=0)...
Python
1
# - *- coding: utf- 8 - *- import asyncio import json import time from aiohttp import ClientConnectorCertificateError from async_class import AsyncClass #from yoomoney import Client from coinbase.wallet.client import Client from tgbot.services.api_session import RequestsSession from tgbot.services.api_sqlite import u...
Python
1
, on = 'ENSEMBL_GENE_ID', how = 'left') outlier_metrics['SAMPLE_ID'] = sample_id outlier_metrics['REF_COHORT'] = comparison_disease_cohort outlier_metrics['REF_COHORT_SIZE'] = exp_data_refcohort.shape[1] - 1 out...
Python
1
rlua::Error::SyntaxError{message, .. } => { assert!(message.contains("expected")); }, _ => panic!("Got wrong hlua error type: {:?}", err) } } _ => panic!("Got wrong LuaResponse type: {:?}", syntax_result) } } #[test] fn test_rust_exec(...
Rust
0
, lambda x: torch.var(x, unbiased=True), lambda x: torch.std(x, unbiased=False), lambda x: torch.std(x, unbiased=True), torch.min, torch.max, torch.sum, lambda x: torch.sum((x - torch.mean(x)) ** 2), ] for stat, name, g...
Python
1
Hexbit::new(0b111111), Hexbit::new(0b000000), Hexbit::new(0b101010), Hexbit::new(0b010101), Hexbit::new(0b111111), Hexbit::new(0b000000), Hexbit::new(0b101010), Hexbit::new(0b010101), ]; let mut h = HexbitBytes::new...
Rust
0
let fd = regs.ebx; let iov = regs.ecx as *const IOVec; let iovcnt = regs.edx as i32; // Checking the size of the vector is in bounds if iovcnt < 0 || iovcnt as usize > limits::IOV_MAX { return Err(errno::EINVAL); } let mutex = Process::get_current().unwrap(); let mut guard = mutex.lock(false); let proc = ...
Rust
0
from selenium.webdriver.common.by import By #Password Locators SIFREMI_UNUTTUM_BUTTON_LOCATOR = (By.CSS_SELECTOR, ".d-block") MAIL_INPUT_LOCATOR = (By.CLASS_NAME, "form-control.mt-6") GONDER_BUTTON_LOCATOR = (By.CLASS_NAME, "btn.btn-primary.w-100.mt-6") TOAST_MESSAGE_LOCATOR = (By.CLASS_NAME, "toast-body") GMAIL_MAIL_...
Python
1
з памяти log_lines = memory_handler.get_logs(lines) if log_lines: log_output = "\n".join(log_lines) # Обрезаем по размеру для Telegram if len(log_output) > 4000: log_output = "...\n" + log_output[-3...
Python
1
*; /// extern crate hex; /// use hex::ToHex; /// /// # fn main () { /// let cbor = "a16452757374a666626c616e6b730564636f64650c68636f6d6d656e747\ /// 30065737461747381a566626c616e6b730564636f64650c68636f6d6d656e747300\ /// 656c696e657311646e616d65722e5c7372635c6c69625c6275696c642e7273...
Rust
0
uf::SingularField<::std::vec::Vec<u8>> { &self.public_key } fn mut_public_key_for_reflect(&mut self) -> &mut ::protobuf::SingularField<::std::vec::Vec<u8>> { &mut self.public_key } } impl ::protobuf::Message for PeerTicketPublicKey { fn is_initialized(&self) -> bool { if self.p...
Rust
0
#html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If fal...
Python
1
# Copyright (C) 2022-2025 Intel Corporation # LIMITED EDGE SOFTWARE DISTRIBUTION LICENSE """Grafana stack management functions""" import logging from collections.abc import Mapping, Sequence from enum import Enum import kubernetes from kubernetes.stream import stream from constants.platform import PLATFORM_NAMESPAC...
Python
1
::Result { if self.0.cluster_name.len() == 1 { f.write_str(self.0.cluster_name[0].as_ref())?; } else { write!(f, "({} hosts)", self.0.cluster_name.len())?; } write!(f, ":{}", self.0.path) } } impl<'a> fmt::Display for ProgressOneLiner<'a> { fn fmt(&self, ...
Rust
0
stsd stts stsc stsz stz2 stss stco co64 ctts stsh padb stdp ...
Rust
0
_snapshot!( "scenario_af20bd1d8e76cf9db0416175232b9b0276447f7148f3261f2d14b006aa7a0229__spectacle_contributions", &spec_projection.contributions().to_json_string() ); let interactions_string = std::fs::read_to_string(interactions_file_path) .expect("expected interactions file to be readable"); let int...
Rust
0
i])) model_error = model_error + clust_err #print(clusters[i]) print('Average error within cluster:', clust_err) print('best_tri:', best_tri) #print(base_tris) fig=go.Figure() if len(clusters[i]) > 1: mean = np.mean(base_tris...
Python
1
[doc = $width] #[doc = ".\n\nSee [`align`](trait.Slice.html#tymethod.align)."] #[allow(clippy::type_complexity)] #[inline] fn $align(&self, token: Token) -> ( &[<<Self as Slice<Token, $width_type>>::Vector as Vector>::Scalar], &[<Self as Slice<Token, $widt...
Rust
0
INC_L = 0x2c, // 1 4 | Z 0 H - | Increment L by 1 DEC_L = 0x2d, // 1 4 | Z 1 H - | Decrement L by 1 LD_L_d8 = 0x2e, // 2 8 | - - - - | Load the next byte into L CPL = 0x2f, // 1 4 | - 1 1 - | Take the bitwise compliment of A (A ...
Rust
0
d gt_think: m = compute_metrics(pred_think, gt_think) # print("----------------------") # print("pred:") # print(pred_think) # print("gt:") # print(gt_think) # print("----------------------") ...
Python
1
ion<Range<usize>>) { unsafe { if let Some(written_range) = written_range { let written_range = D3D12_RANGE { Begin: written_range.start, End: written_range.end, }; self.0.Unmap(subresource, &written_range) ...
Rust
0
::Mutex; use matrix_sdk_common::locks::RwLock; use std::ops::Deref; #[cfg(feature = "encryption")] use crate::api::r0::keys::{ claim_keys::Response as KeysClaimResponse, get_keys::Response as KeysQueryResponse, upload_keys::Response as KeysUploadResponse, DeviceKeys, KeyAlgorithm, }; #[cfg(feature = "encryptio...
Rust
0
), x["score"], ) for x, md in zip(responses, metadatas) ] if self.config.rerank_config.reranker in [ "mmr", "rerank_multilingual_v1", ...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2024 Google LLC. 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 requir...
Python
1
return args def main(): args = parse_args() if len(args.pose_shape) == 1: pose_input_shape = (32, 3, args.pose_shape[0], args.pose_shape[0]) elif len(args.pose_shape) == 2: pose_input_shape = ( 32, 3, ) + tuple(args.pose_shape) else: raise Valu...
Python
1
iterbi() { let p_init = Array1::from_vec(vec![0.6f64, 0.4]); let p_emit = Array2::from_shape_vec((2, 3), vec![0.5f64, 0.4, 0.1, 0.1, 0.3, 0.6]).unwrap(); let p_trans = Array2::from_shape_vec((2, 2), vec![0.7f64, 0.3, 0.4, 0.6]).unwrap(); let (path, logp) = viterbi(p_emit.view(), p_trans....
Rust
0
} } } } vote_counts_sizes.append(&mut response); return response; } #[inline] fn get_4_byte_recent_polls( poll_rankings: &Vec<VoteCount>, starting_index: usize, mut response: Vec<u8>, ) -> Vec<u8> { let mut iterator = poll_rankings.iter().skip(starting_i...
Rust
0
县"), ("231124", "黑龙江省孙吴县"), ("231181", "黑龙江省北安市"), ("231182", "黑龙江省五大连池市"), ("231200", "黑龙江省绥化市"), ("231201", "黑龙江省绥化市市辖区"), ("231202", "黑龙江省绥化市北林区"), ("231221", "黑龙江省望奎县"), ("231222", "黑龙江省兰西县"), ("231223", "黑龙江...
Rust
0
u{ccb4}' | '\u{ccd0}' | '\u{ccec}' | '\u{cd08}' | '\u{cd24}' | '\u{cd40}' | '\u{cd5c}' | '\u{cd78}' | '\u{cd94}' | '\u{cdb0}' | '\u{cdcc}' | '\u{cde8}' | '\u{ce04}' | '\u{ce20}' | '\u{ce3c}' | '\u{ce58}' | '\u{ce74}' | '\u{ce90}' | '\u{ceac}' | '\u{cec8}' | '\u{cee4}' | '\u{cf00}' | '\u{...
Rust
0
import os from pythonforandroid.recipes.qt6 import Qt6Recipe from pythonforandroid.util import load_source util = load_source('util', os.path.join(os.path.dirname(os.path.dirname(__file__)), 'util.py')) assert Qt6Recipe._version == "6.4.3" # assert Qt6Recipe._version == "6.5.3" assert Qt6Recipe.depends == ['python3...
Python
1
from settings import * from timer import Timer class Evolution: def __init__(self, frames, start_monster, end_monster, font, end_evolution, star_frames): self.display_surface = pygame.display.get_surface() self.start_monster_surf = pygame.transform.scale2x(frames[start_monster]['idle'][0]) self.end_monster_sur...
Python
1
"""Add personal access tokens Revision ID: 1f6738730753 Revises: 356b8985ae7c Create Date: 2021-06-29 12:05:07.347139 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql from indico.core.db.sqlalchemy import UTCDateTime # revision identifiers, used by Alembic. revision = '...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo.addons.mass_mailing.tests.common import MassMailCommon from odoo.addons.test_mail.tests.common import TestMailCommon class TestMassMailCommon(MassMailCommon, TestMailCommon): @classmethod def setUpCl...
Python
1
t00.dds", 0x5106_3228, 0xF03C_948F), (r"icons\m\misc_dwrv_goblet10.dds", 0x5106_3228, 0xF03C_949F), (r"icons\m\misc_redware_plate.dds", 0x5114_2428, 0x913A_29E0), (r"icons\m\misc_redware_flask.dds", 0x5114_2428, 0x913A_7990), (r"icons\m\misc_de_tankard_01.dds", 0x5114_3228, 0x7D4B_82A8), (r"ico...
Rust
0
icle_ls if article ] logging.info(f"Number of fetched articles: {len(articles)}") for article in articles: url = article["url"] if url in indexed_articles: continue article = _locate_set_text(article) clean_article: NewsArticle...
Python
1
parse_quote!(#value_ident) } other => fold::fold_expr(self, other), } } fn fold_block(&mut self, node: syn::Block) -> syn::Block { use std::iter; let replaced = fold::fold_block(self, node); let join = self.join(); let futures = self.futures(); ...
Rust
0
# --8<-- [start:df] import polars as pl df = pl.DataFrame( { "A": ["a", "b", "a"], "B": [1, 3, 5], "C": [10, 11, 12], "D": [2, 4, 6], } ) print(df) # --8<-- [end:df] # --8<-- [start:unpivot] out = df.unpivot(["C", "D"], index=["A", "B"]) print(out) # --8<-- [end:unpivot]
Python
1
import ee import math def to_backscatter(image): """Convert dB from S1_GRD collection to backscatter units. Also multiply result by 1e5. Angle is between the pixel (line-of-sight) and the satellite's nadir. """ angle_corrected = image.select( 'VH' # "V.|H." ).subtract( # this should...
Python
1
from typing import Union from selenium.webdriver.remote.webelement import WebElement class ClickableVideoElement: """Parser for an Element on YouTube that can be clicked by the user to watch a video, e.g. a search result. Supported video elements are ytd-video-renderer,ytd-compact-video-renderer and ytd-grid...
Python
1
logger.info(f'average new node validate {metric_name}, {np.mean([new_node_val_metric_single_run[metric_name] for new_node_val_metric_single_run in new_node_val_metric_all_runs]):.4f} ' f'± {np.std([new_node_val_metric_single_run[metric_name] for new_node_val_metric_single_run in n...
Python
1
A HashMap literal, where the keys must implement ToString. #[macro_export] macro_rules! routes { { $($key:expr => $value:expr),* $(,)* } => { { let mut result = std::collections::HashMap::new(); $( // We can handle arguments of multiple types by using this: ...
Rust
0
on="forward"): self.direction = direction async def execute(self, controller: WindowController, windStack: WindowStack, args): dir = args[0] if args else self.direction await controller.toggleWithinGroup(dir) class ToggleLockGroupCommand(CommandStrategy): def __init__(self, direction=...
Python
1
# Copyright 2025 Arm Limited and/or its affiliates. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch from executorch.exir.pass_base import ExportPass torch_cosine_similarity = (torch.ops.aten.cosine_similarity.default,) ...
Python
1
.e does not have a pk yet) super(Menu, self).save(force_insert, **kwargs) # Save, so that it gets a pk force_insert = False root_item.menu = self root_item.save() # Save, so that it gets a pk self.root_item = root_item super(Menu, self).save(...
Python
1
), 'loc_482F', ) ChrSetChipByIndex(0x0105, 18) def _loc_482F(): pass label('loc_482F') If( ( (Expr.Eval, "OP_42(0x0006)"), (Expr.PushLong, 0x1), Expr.Neg, Expr.Neq, Expr.Return, ), 'loc_4842', ) ...
Python
1
리 기반으로 로그 확률 조정 mean_distance = distances.mean() std_distance = distances.std() + 1e-5 # 0으로 나누는 것을 방지 z_scores = (distances - mean_distance) / std_distance weighted_logits = logits_i - z_scores probs_i = F.softmax(weighted_logits, dim=-1).detach().cpu().nump...
Python
1
4(16).to_be(); Ok((vertex_id, ts)) } /// A storage will contain vertex tables and edge tables, and it uses different prefix to identify /// them. Edge table has two parts: forward edges and backward edges, so they should be distinguished. /// If an edge table's id is X, we use 2 * X to identify the forward edges a...
Rust
0
9 => Ok((I::BUFFER_LOAD_FORMAT_D16_XY, 8)), 10 => Ok((I::BUFFER_LOAD_FORMAT_D16_XYZ, 8)), 11 => Ok((I::BUFFER_LOAD_FORMAT_D16_XYZW, 8)), 12 => Ok((I::BUFFER_STORE_FORMAT_D16_X, 8)), 13 => Ok((I::BUFFER_STORE_FORMAT_D16_XY, 8)), 14 => Ok((I::BUFFER_STORE_FORMAT_D16_XYZ, 8...
Rust
0
on. Consider how that may work in a custom pybind wrapper: m.def("SomeNewFeature", ([](py::object handle) { auto* interpreter = reinterpret_cast<tflite::Interpreter*>(handle.cast<intptr_t>()); ... })) and corresponding Python call: SomeNewFeature(interpreter.native_han...
Python
1
!($val)),+,) }; } <reponame>jeizsm/relibc use super::{internal, BUFSIZ, FILE, UNGET}; use stdlib::calloc; use core::{mem, ptr}; use core::sync::atomic::AtomicBool; use platform::types::*; use super::constants::*; use fcntl::*; use platform; use errno; /// Parse mode flags as a string and output a mode flags intege...
Rust
0
iview: None, }); let bind_group_entries = bindings .into_iter() .map(|binding| BindGroupEntry { binding: binding.index, resource: binding.resource, }) .collect::<Vec<_>>(); let bind_group = device.create_bind_group(&BindGroupDescriptor { labe...
Rust
0
o::NaiveTime> { let time = if let Ok(time) = chrono::NaiveTime::parse_from_str(string, "%H:%M:%S") { time } else { chrono::NaiveTime::parse_from_str(string, "%H:%M")? }; Ok(time) } pub fn display_clocks<T>(clocks: &[Rc<Clock>], doc: &Doc, callbacks: &mut CliCallbacks<T>) { let overa...
Rust
0
refs` /// nor the `treat-xrefs` header clauses will be removed from the AST. /// /// # See also /// - [Header Macro Translation](http://owlcollab.github.io/oboformat/doc/obo-syntax.html#4.4.2) /// section of the syntax and semantics guide. pub fn treat_xrefs(&mut self) { use self::Head...
Rust
0
# Program to sort words alphabetically and put them in a dictionary with corresponding numbered keys # We are also removing punctuation to ensure the desired output, without importing a library for assistance. # Declare base variables word_Dict = {} count = 0 my_str = "Hello this Is an Example With cased letters. Hel...
Python
1
(alpha1, |v: &str| v.to_owned()))(s) } #[test] fn day06() -> Result<()> { test_parse!(parse, "abcdef\nghijkl" => vec!["abcdef".to_owned(), "ghijkl".to_owned()]); const EXAMPLE: &'static str = "\ eedadn drvtee eandsr raavrd atevrs tsrnev sdttsa rasrtv nssdts ntnada svetve tesnvt vntsnd vrdear dvrsen enarar"; ...
Rust
0
""" ConsoleReporter A class for reporting test results to the console in real-time, handling parallel test execution and out-of-order test completions. This reporter provides a clear, color-coded output of test results, organized by module and class, and presents a summary at the end of the test run. Usage: repo...
Python
1
orch.zeros(self.max_nodes, self.max_nodes, device=self.device) adj[:valid_nodes, :valid_nodes] = adj_valid adj = adj.unsqueeze(0) with torch.no_grad(): pred_vel_norm = self.model(obs_vel, adj, self.future_length) if self.normalize and self.mean is not None ...
Python
1
merge(first_queue_player) session.merge(second_queue_player) def remove_duo(player_id: int, channel_id: int): # Removes duos for all roles for this player in this channel # This could be called during a ready-check but it shouldn’t be too much of an issue with session_scope() as session: ...
Python
1
er balance --- // E_we_an = E_we_del_an - E_we_exp_an; // formula 2 step A self.we.a += rhs.we.a; // E_we_an = E_we_del_an - E_we_exp_an; // formula 2 step B self.we.b += rhs.we.b; // Weighted energy partials self.we.del += rhs.we.del; self.we.exp_a += rhs.we.e...
Rust
0
t.is_null() && pdf_obj_typeof(annot_dict) == 6i32) { spc_warn( spe, b"Invalid type: not dictionary object.\x00" as *const u8 as *const i8, ); free(ident as *mut libc::c_void); pdf_release_obj(annot_dict); return -1i32; }...
Rust
0
ILE='{}'", e, pidfilename)); pidfile .write_all(process::id().to_string().as_bytes()) .unwrap_or_else(|e| panic!("{}: pidfile write failed '{}'", e, pidfilename)); } if init_process_flag { signal::kill(Pid::from_raw(std::process::id() as i32), Signal::SIGTSTP).unwrap(); ...
Rust
0
pos - center; let distance_squared = diff.length_squared(); let dir = diff / distance_squared / distance_squared; if distance_squared <= radius_squared { Some(DistantEntity { distance_squared, entity: *en...
Rust
0
def test_full_loop_with_noise(self): scheduler_class = self.scheduler_classes[0] scheduler_config = self.get_scheduler_config() scheduler = scheduler_class(**scheduler_config) scheduler.set_timesteps(self.num_inference_steps) model = self.dummy_model() sample = self.dummy_sample_deter * schedule...
Python
1
#merge intervals def merge(self, intervals: List[List[int]]) -> List[List[int]]: n=len(intervals) intervals.sort() ans=[] for i in range(n): # if the current interval does not # lie in the last interval: if not ans or intervals[i][0]>ans[-1][1]: ans.append(intervals[...
Python
1
et valid_json = match line.chars().last() { Some(',') => { let (valid_json, _) = line.split_at(line.len() - 1); valid_json }, _ => line }; let wd_item: Item = serde_json::from_str(valid_json) .expect(format!("Valid json not ...
Rust
0
.clone(), ENDOWMENT)) .chain(initial_authorities.iter().map(|x| (x.0.clone(), STASH))) .collect(), }, pallet_indices: polkadot::IndicesConfig { indices: vec![] }, pallet_session: polkadot::SessionConfig { keys: initial_authorities .iter() .map(|x| { ( x.0.clone(), x.0.clone(), ...
Rust
0
fo(&self) -> Info { Info { kind: Kind::Ignite | Kind::Liftoff, name: "Sass Sheet", } } async fn on_ignite(&self, rocket: Rocket<Build>) -> fairing::Result { use rocket::figment::value::magic::RelativePathBuf; let configured_path = rocket .fig...
Rust
0
# This file is part of dxtb. # # SPDX-Identifier: Apache-2.0 # Copyright (C) 2024 Grimme Group # # 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...
Python
1
actor in //! each. Note on actor `stopping` lifecycle event, sync actor can not prevent //! stopping by returning `false` from `stopping` method. //! Multi consumer queue is used as a communication channel queue. //! To be able to start sync actor via `SyncArbiter` //! Actor has to use `SyncContext` as an execution co...
Rust
0
# ####################################### # ########### Ejercicio Hamburguesas##### # ####################################### print("Bienvenido a nuestro programa para pedir tus hamburguesas") cantHam = int(input("Cuantas hamburguesas desea pedir: ")) acumulado=0 for i in range(cantHam): tipoPan = int(input("Se...
Python
1
ing-color-1", "#E7C975")) self.state_F_Color = QColor(self.config.get("floating-color-2", "#FF0253")) def setWeapon(self, data): color = self.state_T_Color if(round(data[1]*100)>int(self.config.get("confidence", "80")))else self.state_F_Color style = f"font-size: {int(self.sizeUnit/2)}px; f...
Python
1
otify_auto_render_trampoline<P>(this: *mut ffi::GtkGLArea, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) where P: IsA<GLArea> { let f: &&(Fn(&P) + 'static) = transmute(f); f(&GLArea::from_glib_borrow(this).downcast_unchecked()) } #[cfg(any(feature = "v3_16", feature = "dox"))] unsafe extern "C" fn no...
Rust
0
# starrealms/tests/test_effects_ai_paths.py import pytest from starrealms.game import Game from starrealms.effects import apply_effect def test_destroy_base_ai_respects_outpost_and_notifies(): # Names are NOT "you"/"player 1" so both players are non-human (AI path) g = Game(("P1", "P2")) p = g.current_play...
Python
1
import operator import typing as ty from collections import defaultdict Song = dict[str, ty.Any] def _sort_album(album: list[Song]) -> None: """Sort album in track order""" def get_track_number(rec): try: tnr = int(rec["track-number"]) except (KeyError, ValueError): t...
Python
1
self: "AutoModelForCausalLMWithValueHead", output_dir: str) -> None: if isinstance(self.pretrained_model, PeftModel): self.pretrained_model.create_or_update_model_card(output_dir) ignore_modules = [name for name, _ in model.named_parameters() if "pretrained_model" in name] setattr(model, "_...
Python
1