text
string
label_name
string
labels
int64
anceKeys anymore, the font key gets deleted. /// /// The only thing remaining in memory permanently is the FontSource (which is only /// the string of the file path where the font was loaded from, so no huge memory pressure). /// The reason for this agressive strategy is that the pub last_frame_font...
Rust
0
_path_refs: Vec<mdMemberRef>, end_void_member_ref: mdMemberRef, log_exception_ref: mdMemberRef, call_target_state_type_get_default: mdMemberRef, call_target_return_void_type_get_default: mdMemberRef, get_default_member_ref: mdMemberRef, } impl CallTargetTokens { pub const FAST_PATH_COUNT: usize...
Rust
0
: u64; } } decl_event!( pub enum Event<T> where <T as frame_system::Config>::AccountId, { TradePairCreated(AccountId, Did, TradePair), TradePairUpdated(AccountId, Did, TradePair), } ); decl_error! { /// Error for the trade module. pub enum Error for Module<T: Confi...
Rust
0
>( buffer_size : usize ) -> ( Sender< T >, Receiver< T > ) { let inner = Arc::new( Mutex::new( RingBuffer::new( buffer_size ) ) ); ( Sender { inner : inner.clone( ) }, Receiver { inner : inner } ) } impl < T : Clone + Default > Sender< T > { /// Attempts to write as many elements to the RingBuffer withou...
Rust
0
turns: _type_: _description_ """ # Function to be used in threads for fetching the byte ranges def fetch_bytes(range_start: int, range_end: int, num_retries: int, verbose: bool): """Fetch a range of bytes from a remote file using the range header Args: range_start (int):...
Python
1
import pytest from sqlmesh.core.reference import ReferenceGraph from sqlmesh.utils.errors import SQLMeshError @pytest.fixture def make_model(mocker): def make(name, refs=None): mock = mocker.Mock() mock.name = name mock.columns_to_types = {} references = [] for ref_name, u...
Python
1
kZAxis) model = Db.BlockTableRecord(db.modelSpaceId(), Db.OpenMode.kForWrite) id = model.appendAcDbEntity(wipout) self.assertTrue(id.isValid()) @pytest.mark.known_failure_ZRX @pytest.mark.known_failure_BRX def test_create_extruded_surface(self): db = Db.curDb() opts ...
Python
1
for image_num in range(images.shape[1]): image = images[:, image_num] fiseye_rays = self.fiseye_rayss[image_num].to(self.device) color = [] for chunk in range(0, fiseye_rays.shape[0], self.val_chunk_size): ...
Python
1
PagedResponse, }; const MAX_LIMIT: u32 = 30; const DEFAULT_LIMIT: u32 = 10; pub fn query_mixnodes_paged( deps: Deps, start_after: Option<HumanAddr>, limit: Option<u32>, ) -> StdResult<PagedResponse> { let limit = limit.unwrap_or(DEFAULT_LIMIT).min(MAX_LIMIT) as usize; let start = calculate_st...
Rust
0
d; packets.push(packet); } (packets, cur_bit) } fn parse_packet_bits(bits: &[u8]) -> (Packet, usize) { let version_bits = &bits[0..3]; let type_bits = &bits[3..6]; let version = bin_to_dec(version_bits) as usize; let type_id = bin_to_dec(type_bits) as usize; // println!("type_id =...
Rust
0
#!/usr/bin/env python """ Copyright (c) 2006-2017 sqlmap developers (http://sqlmap.org/) See the file 'doc/COPYING' for copying permission """ import re from lib.core.common import randomRange from lib.core.data import kb from lib.core.enums import PRIORITY __priority__ = PRIORITY.NORMAL def dependencies(): pa...
Python
1
ndarray]: perm, L, U = _lu_factor_to_lu(a, dtype, overwrite_a) PL = L[perm] return PL, U return impl @overload(_lu_3) def lu_impl_3( a: np.ndarray, permute_l: bool, check_finite: bool, p_indices: bool, overwrite_a: bool, ) -> Callable[ [np.ndarray, bool, bool, boo...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 测试PCD强度解析功能的脚本 """ import os import sys import numpy as np def test_load_pcd_with_intensity(file_path): """ 测试PCD文件强度解析功能 """ print(f'🧪 测试PCD强度解析: {os.path.basename(file_path)}') print('=' * 60) intensity_values = None try: # 读...
Python
1
import unittest from unittest.mock import patch, MagicMock from src.data_collection.scrapers import EcommerceScraper class TestUnifiedScraper(unittest.TestCase): def setUp(self): self.scraper = EcommerceScraper() @patch('src.data_collection.scrapers.requests.get') def test_scrape_news(self, mock_g...
Python
1
v4(); let conn = create_conn_pool().get().unwrap(); let session_id = create_new_session(&user_id, conn.deref()).unwrap(); let new_board = "-X----------------------------------------------------".to_owned(); let updated_records = update_game_state( &session_id, &us...
Rust
0
-> GCLK1_R { GCLK1_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 0 - Gate IOM0 CLK in SPI mode, allowing external input clock"] #[inline(always)] pub fn gclk0(&self) -> GCLK0_R { GCLK0_R::new((self.bits & 0x01) != 0) } } impl W { #[doc = "Bit 5 - Gate IOM5 CLK in SPI mod...
Rust
0
"""Test configuration for opentherm_gw.""" from collections.abc import Generator from unittest.mock import AsyncMock, MagicMock, patch from pyotgw.vars import OTGW, OTGW_ABOUT import pytest from homeassistant.components.opentherm_gw import DOMAIN from homeassistant.const import CONF_DEVICE, CONF_ID, CONF_NAME from ...
Python
1
of the field is `SOURCE_EQ_TIMER_3_MATCH_0_UART3_RECEIVE_DMA_REQ_0`"] #[inline] pub fn is_source_eq_timer_3_match_0_uart3_receive_dma_req_0(&self) -> bool { *self == SRCPERIPHERALR::SOURCE_EQ_TIMER_3_MATCH_0_UART3_RECEIVE_DMA_REQ_0 } #[doc = "Checks if the value of the field is `SOURCE_EQ_TIMER...
Rust
0
Prim::Address => serde_json::from_value::<AddressWrapper>(json) .ok() .map(|addr| { let addr = svm_sdk_types::Address::from(addr.0.bytes()); SdkValue::Primitive(Primitive::Address(addr)) }), TySigPrim::I8 => json_as_nume...
Rust
0
#!/usr/bin/python3 def new_in_list(my_list, idx, element): copy = my_list.copy() if idx < 0 or idx >= len(my_list): return copy copy[idx] = element return copy
Python
1
""" pygments.lexers.bare ~~~~~~~~~~~~~~~~~~~~ Lexer for the BARE schema. :copyright: Copyright 2006-2025 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ from pygments.lexer import RegexLexer, words, bygroups from pygments.token import Text, Comment, Keyword, Name, L...
Python
1
class AlchemyTable: alchemytable_cost_map = {1:5, 2:7, 3:10} def __init__(self, level): self.level = level def __repr__(self): return f"AT{self.level}" def getUpgrade(self): return AlchemyTable(self.level + 1) def getCost(self): return AlchemyTable.alchemy...
Python
1
::{miette, IntoDiagnostic, Result, WrapErr}; use parol::generate_tree_layout; use std::env; use std::fs; // To generate: // cargo run --bin parol -- -f ./examples/boolean_parser/boolean-parser.par -e ./examples/boolean_parser/boolean-parser-exp.par -p ./examples/boolean_parser/boolean_parser.rs -a ./examples/boolean_p...
Rust
0
DoF. Must be <= 0.0 pub min_impulse: SpacialVector<Real>, /// The maximum positive impulse the joint can apply on each DoF. Must be >= 0.0 pub max_impulse: SpacialVector<Real>, /// The minimum negative position impulse the joint can apply on each DoF. Must be <= 0.0 pub min_pos_impulse: SpacialVecto...
Rust
0
# 1. Sort a Dictionary by Value my_dict = {'a': 3, 'b': 1, 'c': 2} sorted_dict = dict(sorted(my_dict.items(), key=lambda item: item[1])) print("Sorted dictionary by value:", sorted_dict) # 2. Add a Key to a Dictionary my_dict = {0: 10, 1: 20} my_dict[2] = 30 print("Dictionary after adding a key:", my_dict) # 3. Conc...
Python
1
/bar"); filterer.dir_doesnt_pass("possum"); filterer.dir_doesnt_pass("foo/bar/possum"); filterer.dir_does_pass("possum/foo/bar"); filterer.file_doesnt_pass("rat"); filterer.file_doesnt_pass("foo/bar/rat"); filterer.file_doesnt_pass("/foo/bar/rat"); } #[tokio::test] async fn glob_middle_double_star() { let filte...
Rust
0
, labels_b], [lmb, 1 - lmb] class Maxup(torch.nn.Module): """A meta-augmentation, returning the worst result from a range of augmentations. As in the orignal paper, https://arxiv.org/abs/2002.09024, this augmentation is not active for the first warm_up epochs. """ def __init__(self, given_data_a...
Python
1
"""empty message Revision ID: 99d9e329b27f Revises: 2f1b3c759773 Create Date: 2021-10-18 17:15:29.903802 """ import sqlalchemy_utils from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '99d9e329b27f' down_revision = '2f1b3c759773' branch_labels = None depends_on = None...
Python
1
ShapeReferenceIdsINTEL = 5775u32, SubgroupAvcImeGetBorderReachedINTEL = 5776u32, SubgroupAvcImeGetTruncatedSearchIndicationINTEL = 5777u32, SubgroupAvcImeGetUnidirectionalEarlySearchTerminationINTEL = 5778u32, SubgroupAvcImeGetWeightingPatternMinimumMotionVectorINTEL = 5779u32, SubgroupAvcImeGetWeig...
Rust
0
rity Technologies (UK) Ltd. // // 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 applicable law or agreed to in wr...
Rust
0
PartialEq)] pub enum JceValue { Bool(bool), U8(u8), I16(i16), I32(i32), I64(i64), F32(f32), F64(f64), String(String), Map(HashMap<JceMapKey, JceValue>), List(Vec<JceValue>), Struct(JceStruct), Empty, Bytes(Bytes), } impl super::JceGet for JceValue {...
Rust
0
import sys sys.path.append("..") import math import torch from gconv.geometry import so2 from gconv.nn.functional import create_grid_R2 def test_uniform_grid(): grid = so2.uniform_grid(8) reference = torch.Tensor( [[0.0000], [0.7854], [1.5708], [2.3562], [3.1416], [3.9270], [4.7124], [5.4978]] ...
Python
1
as f: pickle.dump(history[i], f) else: print('Incorrect Instance') history = history[correct_idx] code = extract_code(history[-2]['content']) with open(f'{save_dir}/correct_code.rs', 'w') as f: f.write(code...
Python
1
) ); #[derive(Debug)] pub struct ReplayBody<'a> { levels: Vec<&'a str>, keyframes: Vec<Keyframe>, raw_network_stream: RawNetworkStream<'a>, debug_strings: Vec<DebugString<'a>>, tick_marks: Vec<TickMark<'a>>, packages: Vec<&'a str>, objects: Vec<&'a str>, names: Vec<&'a str>, cl...
Rust
0
90-=??qwertyuiop[]\n?asdfghjkl;'`?\\zxcvbnm,./?*? ?"; pub struct Keyboard { control_port: Port, data_port: Port } impl Keyboard { pub fn new(control_port: Port, data_port: Port) -> Keyboard { Keyboard { control_port: control_port, data_port: data_port } } pub fn run(&mut self) { loop { ...
Rust
0
pub const D3D11_FEATURE_FORMAT_SUPPORT: D3D11_FEATURE = 2i32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"] pub const D3D11_FEATURE_FORMAT_SUPPORT2: D3D11_FEATURE = 3i32; #[doc = "*Required features: `\"Win32_Graphics_Direct3D11\"`*"] pub const D3D11_FEATURE_D3D10_X_HARDWARE_OPTIONS: D3D11_FEATURE = ...
Rust
0
:decompose::Decomposer::new(&g.g) } } fn graphs(&self) -> PyResult<Vec<VecGraph>> { let mut gs = vec![]; for (_a,g) in &self.d.stack { gs.push(VecGraph {g: g.clone() }); } Ok(gs) } fn apply_optimizations(&mut self, b: bool) { if b { self.d.with_simp...
Rust
0
class Solution: def countDaysTogether(self, arriveAlice: str, leaveAlice: str, arriveBob: str, leaveBob: str) -> int: days = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] def toDays(s: str) -> int: month = int(s[:2]) day = int(s[3:]) prevDays = 0 for m in range(1, month): ...
Python
1
import os os.environ['CUDA_VISIBLE_DEVICES'] = '0,1,2,3' os.environ['SWIFT_DEBUG'] = '1' tools = [{ 'name': 'get_current_weather', 'description': 'Get the current weather in a given location', 'parameters': { 'type': 'object', 'properties': { 'location': { 'type...
Python
1
\x20default,\x20RunCallable()\x20will\x20synchronize\x20the\x20GPU\x20st\ ream\x20before\x20returning\n\x20fetched\x20tensors\x20on\x20a\x20GPU\ \x20device,\x20to\x20ensure\x20that\x20the\x20values\x20in\x20those\x20t\ ensors\n\x20have\x20been\x20produced.\x20This\x20simplifies\x20interacti\ ng\x20...
Rust
0
from collections import deque def check(lst_c,lst_d,x,change): count=0 for i in range(x): change-=lst_c[i]*lst_d[i]*2 count+=lst_c[i] i=0 while change>0: i+=1 change-=lst_c[-i]*lst_d[-i] count+=lst_c[-i] return count num_of_tc = int(input()) for _ in range(num...
Python
1
"""Page export module.""" from . import page __all__ = ["page"]
Python
1
pos * count).sum(); let mut min_fuel = fuel; for hpos in 1..=(*num_right_buckets.keys().max().unwrap_or(&0)) { num_left += num_current; fuel += num_left; fuel -= num_right; num_current = num_right_buckets.remove(&hpos).unwrap_or(0); num_right -= num_current; ...
Rust
0
); assert_eq!( b.possible_moves_for_regular_piece_in_cell( ChessPiece::Rook, Cell::C3, w.occupied_cells() ), BitBoard::new() ); assert_eq!( b.possible_moves_for_regular_piece_in_cell( ...
Rust
0
lse, "multisignature mislabelled 2/3 succeeded" ); } // test threshold not met { let mut witness_builder = WitnessBuilder::new(); witness_builder.append(TreeIndex::D1(i1), pk1.clone(), sk1.sign(&msg).coerce()); let witness = witnes...
Rust
0
: sys.exit(f"ERRO: Falha ao processar imagem do emissor ou receptor.") for driver_name in os.listdir(input_path): driver_input_folder = os.path.join(input_path, driver_name) if not os.path.isdir(driver_input_folder): continue driver_key = driver_name.upper() ...
Python
1
Option_f64 { Some(f64), None, } let integer = Option_i32::Some(5); let float = Option_f64::Some(5.0); */ // Rust では ジェネリックなコードを各インスタンスで型を指定したコードにコンパイルするので、 // ジェネリクスを使っても実行時コストを払うことはない。コードを実行すると それぞれの定義を手作業で複製した時のように振る舞う // 単相化の過程により Rust のジェネリクスは実行時に究極的に効率的になる } pub fn tra...
Rust
0
# 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 applicable law or agreed to in writing, software # distributed under the...
Python
1
his function will *not* be caught. If on_error was specified in the constructor, this value will be ignored. Returns: Callable: A callable that will invoke ``func`` with retry behavior. """ if self._on_error is not None: on...
Python
1
# ----------------------------------------------------------------------------- # MIT License # # Copyright (c) 2024 Ontolearn Team # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without r...
Python
1
# 텐서를 numpy로 변환 occlusion_mask_np = occlusion_mask.squeeze(0).cpu().numpy() # 파일명 생성 filename = data_batch['tgt_left_filename'].split('/')[-1] filename_base = filename.split('.')[0] filename_occlusion = f"{filename_base}_occlusion.png" # 저장 ...
Python
1
import logging import os logging.basicConfig( filename=os.environ.get("TASKWEAVER_LOGGING_FILE_PATH", "ces-runtime.log"), level=logging.DEBUG, format="%(asctime)s %(levelname)s %(name)s %(message)s", ) logger = logging.getLogger(__name__)
Python
1
#!/usr/bin/env python import rospy,sys from geometry_msgs.msg import PoseStamped,Pose from moveit_commander import MoveGroupCommander import moveit_commander from copy import deepcopy import numpy,math def set_pose(x,y,z,ox,oy,oz,w): reference_frame = 'world' target_pose = PoseStamped() targe...
Python
1
FileSnippetData { path: "/temp/bar".into(), snippets: vec![Snippet { lnum: 100, content: " ⠀⠀⠀⠀⣀⣤ ⠀⠀⠀⠀⣿⠿⣶ ⠀⠀⠀⠀⣿⣿⣀ ⠀⠀⠀⣶⣶⣿⠿⠛⣶ ⠤⣀⠛⣿⣿⣿⣿⣿⣿⣭⣿⣤ ⠒⠀⠀⠀⠉⣿⣿⣿⣿⠀⠀⠉⣀ ⠀⠤⣤⣤⣀⣿⣿⣿⣿⣀⠀⠀⣿ ⠀⠀⠛⣿⣿⣿⣿⣿⣿⣿⣭⣶⠉ ⠀⠀⠀⠤⣿⣿⣿⣿⣿⣿⣿ ⠀⠀⠀⣭⣿⣿⣿⠀⣿⣿⣿ ⠀⠀⠀⣉⣿⣿⠿⠀⠿⣿⣿ ⠀⠀⠀⠀⣿⣿⠀⠀⠀⣿⣿⣤ ⠀⠀⠀⣀⣿⣿⠀⠀...
Rust
0
# Generated by Django 3.0.1 on 2020-02-26 15:15 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('faction', '0054_auto_20200224_2056'), ] operations = [ migrations.CreateModel( name='AttacksPla...
Python
1
zhuān"), ('漚', "ōu,òu"), ('漛', "téng"), ('漜', "yě"), ('漝', "xí"), ('漞', "mì"), ('漟', "táng"), ('漠', "mò"), ('漡', "shāng,tàng"), ('漢', "hàn,tān"), ('漣', "lián,lán"), ('漤', "lǎn"), ('漥', "wā"), ('漦', "chí,tāi"), ('漧', "gān"), ('漨', "féng,péng,běng"), ('漩', "...
Rust
0
"""comments Revision ID: 09aabad78506 Revises: 37265f5c8138 Create Date: 2024-03-01 20:54:58.522093 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = '09aabad78506' down_revision = '37265f5c8138' branch_labels = None depends_on = None def upgrade(): # ### c...
Python
1
pr $(,)?) => { #[allow(unknown_lints, clippy::eq_op)] const _: [(); 0 - !{ const ASSERT: bool = $x; ASSERT } as usize] = []; }; } #[macro_export] #[doc(hidden)] macro_rules! _memoffset__let_base_ptr { ($name:ident, $type:ty) => { // No UB here, and the po...
Rust
0
_code( "bp::scope().attr( \"QUERY_PORT_NOT_INITIALIZED\" ) = (int)QUERY_PORT_NOT_INITIALIZED;" ) mb.add_registration_code( "bp::scope().attr( \"QUERY_PORT_ERROR\" ) = (int)QUERY_PORT_ERROR;" ) self.ParseSteamApps(mb) self.ParseSteamFriends(mb) # User cls = mb.cl...
Python
1
) dev_loss, dev_f1, dev_acc = evaluate(model, dev_loader, criterion, device) print(f"Epoch {epoch:02d}: Train Loss={train_loss:.4f} | Dev Loss={dev_loss:.4f} | F1={dev_f1:.4f} | Acc={dev_acc:.4f}") scheduler.step(dev_loss) if dev_f1 > best_f1: best_f1 = dev_f1 ...
Python
1
CAR_BRANDS = ( ('bmw', 'BMW'), ('mercedes', 'Mercedes-Benz'), ('audi', 'Audi'), ('toyota', 'Toyota'), ('honda', 'Honda'), ('ford', 'Ford'), ('chevrolet', 'Chevrolet'), ('volkswagen', 'Volkswagen'), ('nissan', 'Nissan'), ('subaru', 'Subaru'), ('volvo', 'Volvo'), ('jeep', ...
Python
1
e = 20 * 1024 * 1024; pub struct HosterManager { id: String, next_request_id: usize, mux: Multiplexer, response_managers: ResponseManagers, cache: Cache, } struct ResponseManager { cache_key: String, tx: oneshot::Sender<Response<Body>>, } impl HosterManager { pub fn new(id: String, w...
Rust
0
self.count_1 < self.count_0 { '1' } else { '0' } } pub fn at(index: usize, bits: &[Vec<char>]) -> Self { let len = bits.len(); let count_1 = bits .iter() .filter_map(|arr| arr.get(index).copied()) .filter(|c| *c == '1'...
Rust
0
attc_char_t; 1usize], } #[test] fn bindgen_test_layout_ble_gattc_evt_char_disc_rsp_t() { assert_eq!( ::std::mem::size_of::<ble_gattc_evt_char_disc_rsp_t>(), 12usize, concat!("Size of: ", stringify!(ble_gattc_evt_char_disc_rsp_t)) ); assert_eq!( ::std::mem::align_of::<ble_gatt...
Rust
0
"vega_value": vega, "input_parameters": {"S": S, "K": K, "T": T, "r": r, "q": q, "vol": vol}, "model": "black-scholes", "status": "success", } except OverflowError as e: raise OverflowError( f"Numerical overflow...
Python
1
uCtx { mvm: self, c_struct: ptr::null_mut(), handles: Default::default(), }); let ctx_ptr = Box::into_raw(ctx); println!("The header address: {:?}", ctx_ptr); let cctx = make_new_MuCtx(ctx_ptr as *mut c_void); println!("The C-visible CMuCtx...
Rust
0
game_level = 10 enemies = ["skeleton","zombie","alien"] def create_enemy(): ## assign variable to avoid the error # new_enemy = "" if game_level < 5: new_enemy = enemies[0] print(new_enemy)
Python
1
ine = EngineConfig(**self.engine) if isinstance(self.engine, dict) else self.engine self.strategy = StrategyConfig(**self.strategy) if isinstance(self.strategy, dict) else self.strategy # Validate strategy self.strategy.validate() # Validate dates if self.st...
Python
1
e\xde\xa6wm\xfa&\xb9\x90{\xf6\xf8\xd1\x89\x03\ \x7f\xe1\xb7q\xe4u\x07\xc6\xa3\x8e\x83\x9bi\xdb\x1d\xb8\ \x8cu\x1c\x1c\x0d\x89\xadh\xd1\x1d8\xcd\xb6\xab6\x9b\ \xff\x01b\x10\x83\x99\xe1\x10\x22f\x00\x00\x00\x00IE\ ND\xaeB`\x82\ \x00\x00\x08V\ \x89\ PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0dIHDR\x00\ \x00\x00O\x00\x00\x00{\x08\x...
Python
1
""" Lightflow --------- Lightflow is a lightweight, distributed workflow system. It is based on a directed acyclic graph structure, with tasks as nodes and arbitrary data flowing between tasks. """ from setuptools import setup, find_packages import re with open('lightflow/version.py') as file: version = re.sea...
Python
1
): # returns a pair of numbers order = self.privkey.order # privkey.sign() may raise RuntimeError in the amazingly unlikely # (2**-192) event that r=0 or s=0, because that would leak the key. # We could re-try with a different 'k', but we couldn't test that # code, so I c...
Python
1
from behave import * import numpy as np from caspailleur.base_functions import isets2bas from caspailleur.orchestrator import explore_data from caspailleur.indices import linearity_index, distributivity_index @given("I have a binary dataset") def step_given_binary_dataset(context): #Создание тестового набора бин...
Python
1
::Consumer; pub use self::core::Settings; pub use self::entity_cache::EntityCache; pub use self::entity_store::EntityStore; pub use self::position_store::PositionStore; pub use self::write_message::WriteMessage; // use std; // #[derive(Clone,Debug,PartialEq)] // pub enum Token { // String(std::string::String), // ...
Rust
0
.await } } #[derive(StructOpt)] pub enum HadronSubcommands { /// Hadron pipeline interaction. #[structopt(name = "pipeline")] Pipeline(cmd::pipeline::Pipeline), /// Hadron stream interaction. #[structopt(name = "stream")] Stream(cmd::stream::Stream), } <reponame>RobWalt/rustgym struct Sol...
Rust
0
0x037f_ffff, // DENALI_CTL_224_DATA 0xffff_ffff, // DENALI_CTL_225_DATA 0x000f_000f, // DENALI_CTL_226_DATA 0x00ff_ff03, // DENALI_CTL_227_DATA 0x000f_ffff, // DENALI_CTL_228_DATA 0x0003_000f, // DENALI_CTL_229_DATA 0xffff_ffff, // DENALI_CTL_230_DATA 0x000f_000f, // DENALI_CTL_231_DATA ...
Rust
0
B, center: BackendCoord, radius: (u32, u32), style: &S, ) -> Result<(), DrawingErrorKind<B::ErrorType>> { let a0 = ((radius.0 - radius.1) as f64).min(radius.0 as f64 * (1.0 - 1.0 / (2f64).sqrt())); let a1 = (radius.0 as f64 - a0 - radius.1 as f64).max(0.0); check_result!(draw_part_a::<B, _>(a0...
Rust
0
operand1: Some(Direct(ZMM3)), operand2: Some(Direct(ZMM19)), operand3: Some(Literal8(95)), operand4: None, lock: false, rounding_mode: None, merge_mode: Some(MergeMode::Zero), sae: false, mask: Some(MaskReg::K1), ...
Rust
0
r=e2e.fetched_alerts_json_path, error_message='The alert has not occurred').result() raised_alert_timestamp = raised_alert.group(1) query = e2e.make_query([ { "term": { "rule.id": f"{rule_id}" } }, { ...
Python
1
', // ('PrimaryExpression 10', '/xyzzy/g')))))); let allocator = &Bump::new(); let actual = try_parse(allocator, &vec!["x/", "=2;"]).unwrap(); let atoms = Rc::new(RefCell::new(SourceAtomSet::new())); let expected = Script { directives: arena::Vec::new_in(allocator), statement...
Rust
0
l::DvbSdtSettings, ) { if let Some(var_750) = &input.output_sdt { object.key("outputSdt").string(var_750.as_str()); } if input.sdt_interval != 0 { object.key("sdtInterval").number( #[allow(clippy::useless_conversion)] smithy_types::Number::NegInt((input.sdt_interval)....
Rust
0
request) .expect_upgrade_success(); let after_validator_slots: u32 = builder .query(None, validator_slot_key, &[]) .expect("should have validator slots") .as_cl_value() .expect("should be CLValue") .clone() .into_t() .expect("should be u32"); ass...
Rust
0
V: Send + Sync + 'static, { type Shared = SharedOp<LastOrOp<S::Shared, V>>; fn to_shared(self) -> Self::Shared { SharedOp(LastOrOp { source: self.source.to_shared(), default: self.default, last: self.last, }) } } pub struct LastOrObserver<S, T> { default: Option<T>, observer: S, l...
Rust
0
accounts_payable(&1).unwrap().claimed_reward, 500); roll_to(330); assert_noop!( Crowdloan::claim(Origin::signed(1)), Error::<Test>::RewardsAlreadyClaimed ); let expected = vec![ crate::Event::InitialPaymentMade(1, 100), crate::Event::InitialPaymentMade(2, 100), crate::Event::RewardsPaid(1, 100),...
Rust
0
html/VK_NV_clip_space_w_scaling.html> pub trait NvClipSpaceWScalingExtension: DeviceV1_0 { /// The metadata for this extension. #[allow(deprecated)] const METADATA: Extension = NV_CLIP_SPACE_W_SCALING_EXTENSION; /// <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkCmdSetViewport...
Rust
0
t_freq[:index_enough], rotor_hysteresis_loss_dft[:index_enough], '^',alpha=0.4) axes_dft[3].set_xlabel('Frequency [Hz]') axes_dft[3].set_ylabel('\nRotor\nHysteresis\nLoss [W]') # # Stator iron loss # for id_element, area_element in enumerate(self.stator_Area_data): ...
Python
1
), &num).unwrap(); assert!(num.get_value().unwrap().eq(&num_native), "result incorrect"); let _neg_num = num.negate(cs.ns(|| format!("negate num {}", i))).unwrap(); } if !cs.is_satisfied() { println!("{:?}", cs.which_is_unsatisfied()); } assert!(cs.is_satisfied()); } /// Tests...
Rust
0
ntent = content.replace( 'config_somali_ft.yml', 'config_somali_warmup.yml' ) with open(train_gpu_file, 'w') as f: f.write(content) print("\\nRunning warmup training (5 epochs, very small LR)...") subprocess.run(cmd) # Restore original train_gpu.py with open(train_gpu_file, 'w') as f: f.write(content...
Python
1
from collections import deque from sys import stdin def solution(N, K, A): answer = 0 belt = deque([False] * N) # Create a deque representing the conveyor belt with N slots, initially empty while True: answer += 1 # Increment the answer counter by 1 A.rotate(1) # Rotate the durability...
Python
1
#!/usr/bin/python3 '''Module defines the island_perimeter method''' def get_square_perimeter( grid, height, width, row, column ): """ Calculates the perimeter added by one square Args: grid: the island """ perimeter = 0 # top if row == 0 or grid[row - 1][column] == 0:...
Python
1
self._Changed = params.get("Changed") self._TaskId = params.get("TaskId") self._RequestId = params.get("RequestId") class ModifyMongoDBParamType(AbstractModel): """修改mongoDB实例,请求参数 """ def __init__(self): r""" :param _Key: 需要修改的参数名称,请严格参考通过 DescribeInstanceParams 获取的当前实例支...
Python
1
efault)] pub struct ViewMatrix(pub Matrix4<f32>); #![type_length_limit = "15524550"] use self::prelude::*; use clap::Clap as _; use command::Opts; mod command; mod common; mod daemon; mod endpoint; mod ioctl; mod prelude; mod protocol; mod router; mod terminal; type Error = eyre::Error; type Result<T> = eyre::Result...
Rust
0
: Vec<String>, } impl TerminalCommand for CatCommand { fn run(&self) -> Result<String, String> { let aboutme: DOMTree<String> = html!( <div> <p>"Hi, my name is Timo 🙋‍♂️"</p> <p>"I love teaching machines how to solve problems."</p> </div> ); ...
Rust
0
"ACTIVE", ConfigurationState::UpdateFailed => "UPDATE_FAILED", ConfigurationState::UpdateInProgress => "UPDATE_IN_PROGRESS", ConfigurationState::Unknown(s) => s.as_ref(), } } /// Returns all the `&str` values of the enum members. pub fn values() -> &'static [&'st...
Rust
0
atetime type: datetime "; let source = "\ 1\ta\t1000\t1.1\t11.11\t2022-01-01T00:00:00Z 2\tb\t2000\t2.2\t22.22\t2022-01-02T00:00:00Z 3\tc\t3000\t3.3\t33.33\t2022-01-03T00:00:00Z "; let schema = Schema::try_from(schema).unwrap(); let parser = Parser::new(schema).unwrap(); let event...
Rust
0
shape[1], txt_mu.shape[2]).to(device) z1 = txt_mu + torch.exp(txt_logsigma) * eps z.append(z1) text_embeds = torch.cat(z) return image_embeds, text_embeds, img_mu, img_logsigma, txt_mu, txt_logsigma # 重塑 def pgu(self, img_mu, img_logsigma, txt_mu, txt_logsigma, scaling_f...
Python
1
t_size = cheaptrick_option.fft_size; let aperiodicity_ptr = aperiodicity .iter() .map(|inner| inner.as_ptr()) .collect::<Vec<_>>(); let aperiodicity_ptr = aperiodicity_ptr.as_ptr(); let n_aperiodicity; unsafe { n_aperiodicity = GetNumberOfAperiodicities(fs); } let...
Rust
0
.load('./outer_model_state')) # Need to enable_grad because we use autograd in optimize_dual (disabled in backward() by default). with torch.enable_grad(): # Here the model approximating a* needs to be trained on the same X_inner batches # as the h* model was trained on and on X_outer batches that h...
Python
1
KeyCreated>() { Ok(key) => Ok(key.uid), Err(_) => Err(Box::new(GatekeeperError::Unknown)), }, StatusCode::NOT_FOUND => { println!("Key {} doesn't exist!", association); Err(Box::new(GatekeeperError::Unknown)) }, status => { prin...
Rust
0
from typing import Any, TYPE_CHECKING if TYPE_CHECKING: from client import BSClient try: from models.parse_error import ParseException except ImportError: class ParseException(Exception): """Custom exception for parsing errors.""" pass class BannedBrawlerEntry: """ Represents a b...
Python
1
struct ScePspFMatrix4Unaligned { pub x: ScePspFVector4, pub y: ScePspFVector4, pub z: ScePspFVector4, pub w: ScePspFVector4, } #[allow(missing_debug_implementations)] pub union ScePspVector3 { pub fv: ScePspFVector3, pub iv: ScePspIVector3, pub f: [f...
Rust
0