text
string
label_name
string
labels
int64
Pallet, Call, Event} = 19, // Oracle // // NOTE: OperatorMembership must be placed after Oracle or else will have race condition on initialization // DexOracle: dex_oracle::{Pallet, Storage, Call}, = 20 SetheumOracle: orml_oracle::<Instance1>::{Pallet, Storage, Call, Event<T>} = 21, OperatorMembershipSethe...
Rust
0
s DataMessage(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _DATAMESSAGE # @@protoc_insertion_point(class_scope:DataMessage) class ColumnMessage(_message.Message): __metaclass__ = _reflection.GeneratedProtocolMessageType DESCRIPTOR = _COLUMNMESSAGE # @@protoc_in...
Python
1
hnologies (UK) Ltd. // SPDX-License-Identifier: Apache-2.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 applica...
Rust
0
::{channel, Receiver}; use std::thread::{sleep, spawn}; use std::time::Duration; #[derive(Debug)] pub struct Event { pub x: u16, pub y: u16, } pub fn spawn_thread(interval_ms: u64) -> Receiver<Event> { let interval = Duration::from_millis(interval_ms); let (tx, rx) = channel(); spawn(move || loop ...
Rust
0
scaling=scaling, base_layer=self.get_base_layer(), base_result=base_result, ) if requires_conversion: result = result.to(expected_dtype) return result def __re...
Python
1
output buffer to send events to host #[repr(C)] pub struct OutgoingEvents { num_events: i32, _reserved: isize, event_ptrs: [*mut MidiEvent; OUTPUT_BUFFER_SIZE], events: [MidiEvent; OUTPUT_BUFFER_SIZE], } impl OutgoingEvents { pub fn new() -> Self { // create placeholders, ownership stays h...
Rust
0
* ( 0 as * const nvmlBridgeChipHierarchy_st ) ) . bridgeCount as * const _ as usize } , 0usize , concat ! ( "Alignment of field: " , stringify ! ( nvmlBridgeChipHierarchy_st ) , "::" , stringify ! ( bridgeCount ) )); assert_eq! (unsafe { ...
Rust
0
5RU5$)Nrr$)rmrs r!r$_spbase._matmul_vectorzz|**511r c@UR5RU5$)Nrr&)rmrs r!r&_spbase._matmul_multivectorzz|//6...
Python
1
_file::catalog::{test_helpers::TestCatalogState, PreservedCatalog}; use query::{exec::ExecutorType, frontend::sql::SqlQueryPlanner, QueryDatabase}; use test_helpers::assert_contains; use super::*; const ARBITRARY_DEFAULT_TIME: i64 = 456; fn make_application() -> Arc<ApplicationState> { Ar...
Rust
0
from typing import Any, Dict from qcengine.exceptions import InputError def muster_modelchem(method: str, derint: int) -> Dict[str, Any]: """Converts the QC method into GAMESS keywords.""" method = method.lower() opts = {} runtyp = { 0: "energy", 1: "gradient", 2: "hessian",...
Python
1
that this /// information might be unreliable because it's initially cached and /// also might be incorrect if the connection like object is not /// actually connected. fn get_db(&self) -> i64; } /// A connection is an object that represents a single redis connection. It /// provides basic support f...
Rust
0
from django.urls import path, include from rest_framework.routers import DefaultRouter from skul_data.documents.views.document import ( DocumentViewSet, DocumentCategoryViewSet, DocumentShareLinkViewSet, ) # app_name = "documents" router = DefaultRouter() router.register(r"documents", DocumentViewSet, bas...
Python
1
Definir le format de notre simulation (ici static, mechanical) elemType1 = mesh.ElemType(elemCode=C3D8R, elemLibrary=STANDARD, kinematicSplit=AVERAGE_STRAIN, secondOrderAccuracy=OFF, hourglassControl=DEFAULT, distortionControl=DEFAULT) elemType2 = mesh.ElemType(elemCode=C3D6, elemLibrary=STANDARD) elemType...
Python
1
} else { self.offset += next_offset; } Some(Ok(animation_ref)) } } bitflags! { struct BoneFlags: u8 { const RAWPOS = 0x01; const RAWROT = 0x02; const ANIMPOS = 0x04; const ANIMROT = 0x08; const FULLANIMPOS = 0x10; const CONST_RO...
Rust
0
.build() }; builder.exec(create_purse_request).expect_success().commit(); let rewards_pre_balance = builder.get_proposer_purse_balance(); let payment_pre_balance = get_handle_payment_payment_purse_balance(&builder); let refund_pre_balance = get_named_account_balance(&builder, *DEFAULT_ACC...
Rust
0
# Copyright (c) 2022-2024, The Isaac Lab Project Developers. # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause """Sub-module for spawners that spawn sensors in the simulation. Currently, the following sensors are supported: * Camera: A USD camera prim with settings for pinhole or fisheye projections. ...
Python
1
iid_custom_model_reverse` is deprecated. Use method\\n\ \x20 `encode_reverse` instead. For transition instructions with code examples, see:\\n\ https://bamler-lab.github.io/constriction/apidoc/python/stream/model.html#constriction.stream.model.CustomModel')", None, ...
Rust
0
grow and we update our stack // pointer as the default stack pointer is surely wrong for us. let mut block = builder.if_else_block(Box::new([]), Box::new([])); if let Some(stack_pointer) = stack_pointer { // local0 = grow_memory(stack_size); let grow_amount = block.i32_const((stack_size / PA...
Rust
0
take one cycle. // Compute the value in the condition and save its value in cs_if todo!() } /// Compiled to: /// ``` /// group[go] = (fsm >= cur_start & fsm < cur_state + static) & pre_guard ? 1'd1; /// ``` fn enable_calculate_states( con: &ir::Enable, // The current state cur_state: u64, // ...
Rust
0
''' Created on 2016/03/07 @author: takuya-hv2 ''' from pybrainSG.rl.experiments.episodicSG import EpisodicExperimentSG from pybrainSG.rl.examples.tasks.gridgames import * from pybrainSG.rl.agents.multiAgent import MultiAgent from pybrainSG.rl.leaners.valuebased.sgsp import * from pybrainSG.rl.agents.sgspa import SGSP_...
Python
1
RayCanIntersect::WrongSide => { // Ray does not intersect the curve } } } } // Collect any collinear collisions into a vec let collinear_collisions = collinear_sections .into_iter() .flat_map(move |colinear_edge_points| { c...
Rust
0
# 获取边界框坐标 x_c, y_c, w, h = [int(val) for val in box] x1, y1 = x_c - w // 2, y_c - h // 2 x2, y2 = x_c + w // 2, y_c + h // 2 # 在原图和增强图上画框 img = cv2.rectangle(img, (x1, y1), (x2, y2), color, 2) unlabel_samples_img_strong_aug = cv2.rectangl...
Python
1
# This is an automatically generated file. # DO NOT EDIT or your changes may be overwritten from __future__ import annotations import base64 from xdrlib3 import Packer, Unpacker from .time_sliced_node_data import TimeSlicedNodeData from .time_sliced_peer_data_list import TimeSlicedPeerDataList __all__ = ["TopologyR...
Python
1
Parse for Array<T> { fn parse(input: ParseStream) -> Result<Self> { let contents; Ok(Self { _bracket_token: bracketed!(contents in input), items: contents.parse_terminated(T::parse)?, }) } } #[derive(PartialEq, Eq, Hash)] struct DoomMapping { value: i16, ...
Rust
0
import numpy as np import pandas as pd import matplotlib.pyplot as plt intiger_series = pd.Series([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) lista = ['123', '233','1231'] asd = pd.Series(lista) intiger_series = list(intiger_series) my_list = [1, 32, -37, 91, 12, 11, -5] my_dict = {'a' : [1, 3, 2], 'b' : [2, 5, 7], 'c' : [3, 4,...
Python
1
range(0, len(decode), 2): dmin = decode[i] dmax = decode[i + 1] lut.extend( round(255.0 * (j / 255.0 * (dmax - dmin) + dmin)) for j in range(256) ) img = img.point(lut) return img def _get_mode_and_invert_color( x_object_obj: dict[str, A...
Python
1
(2549, ("CZS", "SBCZ", -7.59990978241, -72.7695007324)), (2550, ("PPB", "SBDN", -22.1751003265, -51.4245986938)), ( 2551, ("MAO", "SBEG", -3.0386099815368652, -60.04970169067383), ), ( 2552, ("JCR", "SBEK", -6.233160018920898, -57.77690124511719), ), ( ...
Rust
0
", instr); } } "add" => self.variables[output] += op2, "mul" => self.variables[output] *= op2, "div" => self.variables[output] /= op2, "mod" => self.variables[output] %= op2, "eql" => self.variables[outpu...
Rust
0
} if attributes.contains(ParamAttribute::RETVAL) { s += "[ret]"; } if attributes.contains(ParamAttribute::OPTIONAL) { s += "[opt]"; } if attributes.contains(ParamAttribute::HAS_DEFAULT) { s += "[default]"; } if attributes.contains(ParamAttribute::HAS_FIELD_MARSHAL) { ...
Rust
0
return InvokeNative(NoOperandsInstruction::new()); } } impl Instruction for InvokeNative { fn fetch_operands(&mut self, reader: &mut BytecodeReader) { self.0.fetch_operands(reader); } fn execute(&mut self, frame: &mut Frame) { let method = frame.method(); let class = method.cla...
Rust
0
// No data to handle if iovs.is_empty() { return Ok(()); } for (index, res2) in &iovs { match self.pending_req_map.remove(index) { Some(req) => { // Just ignore the result of write_obj(). Though we have validated ...
Rust
0
notifier) { break; } dispatch_date(&threadpool, &dates_scheduler, &pair_scheduler); check_peeking_date(&dates_scheduler, &state_lock); } }); Scheduler { condvar: pair, dates, } } } ///...
Rust
0
Chip<FixedPoints: super::FixedPoints<pallas::Affine>> { config: EccConfig<FixedPoints>, } impl<FixedPoints: super::FixedPoints<pallas::Affine>> Chip<pallas::Base> for EccChip<FixedPoints> { type Config = EccConfig<FixedPoints>; type Loaded = (); fn config(&self) -> &Self::Config { &self.config...
Rust
0
literal as well. assert_eq!( fidl::MacAddress { octets: [0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF] }, fidl_mac!("AA:BB:CC:DD:EE:FF") ); } #[test] fn test_fidl_ip_v4_with_prefix() { assert_eq!( fidl::Ipv4AddressWithPrefix { addr: fidl::I...
Rust
0
dex) ***** def lower_reduce_axis(ctx: IndexContext, x: UOp): # NOTE: always using ridxs is fine here reduce_range, reduce_expand = partition([ctx.ridxs[i] for i in x.axis_arg], lambda y: y.op is Ops.RANGE) assert all(x.op is Ops.UNROLL for x in reduce_expand), f"not all UNROLLS in {reduce_expand} for {x.axis_arg...
Python
1
<InputEvent<T>>, hidpi: f32, ) { handler.send_event(event, output, hidpi as f32); } } impl<'a, T: BindingTypes> System<'a> for InputSystem<T> { type SystemData = ( Read<'a, EventChannel<Event>>, Write<'a, InputHandler<T>>, Write<'a, EventChannel<InputEvent<T>>>, ...
Rust
0
import json from datetime import datetime from kafka import KafkaConsumer from cassandra.cluster import Cluster # Cassandra config CASSANDRA_CONTACT_POINTS = ['127.0.0.1'] CASSANDRA_KEYSPACE = 'crypto_data' # Connect to Cassandra cluster = Cluster(CASSANDRA_CONTACT_POINTS) session = cluster.connect(CASSANDRA_KEYSPACE...
Python
1
# coding = utf-8 # pylint: disable=invalid-name, no-member """lib informantion about mini-caffe""" from __future__ import absolute_import import os import sys import ctypes import numpy as np # types BlobHandle = ctypes.c_void_p NetHandle = ctypes.c_void_p real_t = ctypes.c_float def find_lib_path(): """find l...
Python
1
TENT STATS_SAMPLE_PAGES STATUS STDIN STOP STORAGE STORED STR_TO_DATE STRAIGHT_JOIN STRCMP STRING SUBCLASS_ORIGIN SUBDATE SUBJECT SUBPARTITION SUBPARTITIONS SUBSTR SUBSTRING SUBSTRING_INDEX SUBTIME SUM SUPER SUSPEND SWAPS SWITCHES SYSDATE SYSTEM SYSTEM_TIME TABLE TABLE_CHECKSUM TABLE_NAME TABLES TABLESPACE TAN TEMPORARY...
Rust
0
from enum import Enum class Site(Enum): SOFASCORE = "SOFASCORE" SCORES365 = "365SCORES" DRAFTKINGS = "DRAFTKINGS" FANDUEL = "FANDUEL" BETMGM = "BETMGM" POINTSBET = "POINTSBET" available_markets = [ "SET_ONE_WINNER", "SET_TWO_WINNER", "SET_THREE_WINNER", ] #===== Scores #Sofascor...
Python
1
# encoding=utf-8 from cProfile import label import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt from pylab import * #支持中文 # mpl.rcParams['font.sans-serif'] = ['SimHei'] acc_orig = [ 0.705882353, 0.705882353, 0.633689840, 0.729946524, 0.727272727 ] acc_sani = [ 0.675862069, 0.710344828, 0.6...
Python
1
def __len__(self): """Get dataset length.""" try: dataset_len = self.dataset.__len__() except (AttributeError, TypeError): dataset_len = 0 for _ in self.dataset: dataset_len += 1 except Exception: raise ValueError( ...
Python
1
category>")] pub fn create(category: Json<NewCategory>) -> Json<Category> { let connection = establish_connection(); let category = diesel::insert_into(categories) .values(&category.0) .get_result(&connection) .unwrap(); Json(category) } #[get("/")] pub fn index() -> Json<Vec<Cate...
Rust
0
=00000c13a127fa05:T=1686809853:RT=1690533255:S=ALNI_MYOneuJQPPw88O-7aWsnES94iFwGA; invpc=11; _ga=GA1.1.1966509239.1686809841; page_view_count=11; lifetime_page_view_count=102; cto_bundle=ixd3A19JWUhkRFFyeG5GdktRUTNqRTJQVlp0ZjZHRnFsV3pteEhsU29SUVE0ZDh3aklvNFhtbkJoNSUyQmdoRUI3cmk4R0xNVSUyRlp6dUdjWGRqM2hlTnNLcGFrWGxTcTlFc...
Python
1
_eq!(statistics.n_array_containers, 0); /// assert_eq!(statistics.n_run_containers, 1); /// assert_eq!(statistics.n_bitset_containers, 0); /// assert_eq!(statistics.n_values_array_containers, 0); /// assert_eq!(statistics.n_values_run_containers, 99); /// assert_eq!(statistics.n_values_bitset_contai...
Rust
0
rTypes").start_array(); for item_450 in var_448 { { array_449.value().string(item_450.as_str()); } } array_449.finish(); } if let Some(var_451) = &input.default_code_repository { object.key("DefaultCodeRepository").string(var_451.as_str());...
Rust
0
pub fn GetThemeAppProperties() -> u32; #[doc = "*Required features: `\"Win32_UI_Controls\"`, `\"Win32_Foundation\"`, `\"Win32_Graphics_Gdi\"`*"] #[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi"))] pub fn GetThemeBackgroundContentRect(htheme: isize, hdc: super::super::Graphics::Gdi:...
Rust
0
# This is a sample quisk_conf.py configuration file for Microsoft Windows. # For Windows, your default config file name is "My Documents/quisk_conf.py", # but you can use a different config file by using -c or --config. Quisk creates # an initial default config file if there is none. To control Quisk, edit # "My Doc...
Python
1
::try_build`] for no panics. pub fn build(self) -> PathBuf { match self.try_build() { Ok(out) => out, Err(error) => panic!("Error found during Codegen::build: {}", error) } } /// Non-panicking [`Self::build`] pub fn try_build(self) -> Result<PathBuf> { let (config, config_parent) = millennium_codegen::...
Rust
0
enum Rule { #[tag("QualifiedRule")] QualifiedRule(QualifiedRule), #[tag("Tokens")] Invalid(Tokens), #[tag("AtRule")] AtRule(AtRule), } #[ast_node("QualifiedRule")] pub struct QualifiedRule { pub span: Span, pub prelude: SelectorList, pub block: SimpleBlock, } #[ast_node] pub enu...
Rust
0
structmeta_tests::attr_name_value(value(10))] fn my_func() {} fn main() {} <reponame>llogiq/rustfst use std::fmt::Debug; use anyhow::Result; use crate::semirings::{ GallicWeight, GallicWeightLeft, GallicWeightMin, GallicWeightRestrict, StringWeightLeft, StringWeightRestrict, }; use crate::Semiring; pub trai...
Rust
0
# GENERATED BY setup.py commit = "22d6a1c16"
Python
1
Geometry() center_point = screen_geometry.center() window_geometry.moveCenter(center_point) window.move(window_geometry.topLeft()) window.show() print("Application ready!") # Run the application event loop exit_code = app.exec() print(f"Appli...
Python
1
} id_tag.push_str(&self.no_to_info.get(child_no).unwrap().alt_allele_names[*child_allele as usize - 1]); ccount += 1; } } } id_tag } } // Index the sites in the deconstruced VCF // Done in 2 passes in case ...
Rust
0
d_semaphore]; let wait_dst_stage_mask = [vk::PipelineStageFlags::COLOR_ATTACHMENT_OUTPUT]; //add fence to queue submit let submit_info = [vk::SubmitInfo::builder() .wait_semaphores(&wait_semaphores) .signal_semaphores(&signal_semaphores) .wait_dst_stage_mask...
Rust
0
f let Err(error) = self.refresh_screen() { die(error); } if self.should_quit { break; } if let Err(error) = self.process_keypress() { die(error); } } } pub fn default() -> Self { // Get input filename let args: Vec<String> = env::args().collect(); let mut initial_status = String::f...
Rust
0
NG_SERVICE_NAME, service_configuration); proposal.set_actual_from(Height(24)); anchoring_testkit.commit_configuration_change(proposal); anchoring_testkit.create_blocks_until(Height(26)); let signatures = anchoring_testkit .create_signature_tx_for_validators(3) .unwrap(); anchoring_...
Rust
0
C" fn(domain: *const __itt_domain, name: *mut __itt_string_handle, delta: ::libc::c_ulonglong)>; extern "C" { #[link_name = "\u{1}___itt_counter_inc_delta_v3_ptr__3_0"] pub static mut __itt_counter_inc_delta_v3_ptr__3_0: __itt_counter_inc_delta_v3_ptr__3_0_t; } extern "C" { /// @ingroup counters /// @brief Decremen...
Rust
0
# -*- coding: utf-8 -*- # Generated by Django 1.11.4 on 2017-12-10 21:26 from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('djangoUserExtension', '0004_auto_20171210_2126'), (...
Python
1
the same board #![no_main] #![no_std] use kea_hal as hal; use cortex_m_rt::entry; use embedded_hal::digital::v2::OutputPin; use embedded_hal::spi; use hal::embedded_time::rate::*; use hal::{pac, prelude::*}; use panic_halt as _; #[entry] fn main() -> ! { let _cp = cortex_m::Peripherals::take().unwrap(); le...
Rust
0
Model, ) -> String { let mut shader_source = lighting_model.shader().to_string(); shader_source.push_str(include_str!("../core/shared.frag")); shader_source.push_str(include_str!("light/shaders/light_shared.frag")); let mut dir_fun = String::new(); for (i, light) in lights.iter().enumerate() { ...
Rust
0
] } } ], [] ] return_value_component_delete = [ None ] changed = True set_module_args(module_args) # Run the module with mock_good_connection(): with patch_keycloak_...
Python
1
import numpy as np import pytest from numpy.testing import assert_allclose from sklearn.ensemble._hist_gradient_boosting._bitset import ( in_bitset_memoryview, set_bitset_memoryview, set_raw_bitset_from_binned_bitset, ) from sklearn.ensemble._hist_gradient_boosting.common import X_DTYPE @pytest.mark.para...
Python
1
onent)); self } pub fn build(self) -> Entity { let entity = self.world.allocator.allocate(); for (component_type, component) in self.components { self.world .attach_component(entity, component_type, component); } self.world.entities.push(ent...
Rust
0
from math import radians, cos, sin, sqrt, atan2 # Calculate the great-circle distance between two points on the Earth's surface. def haversine(lat1, lon1, lat2, lon2): R = 6371.0 # Radius of the Earth in kilometers dlat = radians(lat2 - lat1) dlon = radians(lon2 - lon1) a = sin(dlat / 2) ** 2 + cos(r...
Python
1
_iter().map(|m| { LegalMove::from(m) }).collect::<Vec<LegalMove>>() ); } #[test] fn test_oute_only_moves_from_mochigoma_kaku_sente() { let mut banmen = Banmen([[Blank; 9]; 9]); banmen.0[4][4] = GOu; let mut ms:HashMap<MochigomaKind,u32> = HashMap::new(); ms.insert(MochigomaKind::Kaku,1); l...
Rust
0
andalaState; use quicksilver::{geom::Transform, graphics::Color}; #[test] fn test_add_mandala_transforms() { let left = Transform::IDENTITY; let right = left * 2 - Transform::IDENTITY; assert_eq!(left, right); } #[test] fn test_create_mandala_state() { let _mand...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import hashlib import json import os import uuid from pathlib import Path from typing import Any, Dict, Iterator,...
Python
1
le(&mut conf, &OPT_ARY, &OPT_ARY_SHO_IDX, &args, parse_match); // if let Err(err) = err_r { return Err(err); } if let Some(free) = free_opt { if !free.is_empty() { conf.arg_params = free; } } // Ok(conf) } //-----------------------------------------------...
Rust
0
#!/usr/bin/python3 import time from picamera2 import Picamera2 picam2 = Picamera2() picam2.configure("still") picam2.start() # Give time for Aec and Awb to settle, before disabling them time.sleep(1) picam2.set_controls({"AeEnable": False, "AwbEnable": False, "FrameRate": 1.0}) # And wait for those settings to take ...
Python
1
de_json::Value>, Error>; fn badges_cards_put(&self, body: Value) -> Result<(), Error>; fn badges_cards_post(&self, body: Value) -> Result<(), Error>; fn badges_cards_card(&self, card_id: &str) -> Result<serde_json::Value, Error>; fn badges_cards_card_delete(&self, card_id: &str) -> Result<(), Error>; ...
Rust
0
)?; } } else if decl.unique_keys.is_empty() { writeln!(writer)?; } if !decl.unique_keys.is_empty() { write!(writer, ",")?; writeln!(writer)?; write!(writer, " UNIQUE (")?; for (i, unique) in decl.unique_keys.iter().enumerate() { write!(writer, ...
Rust
0
.getCopy()) # tr. sup. zapata wall.stemReinforcement.setReinforcement(9, reinf_types['A12_15'].getCopy()) # ln. sup. zapata wall.stemReinforcement.setReinforcement(7, reinf_types['A10_15'].getCopy()) # tr. inf. zapata wall.stemReinforcement.setReinforcement(8, reinf_types['A12_15'].getCopy()) # ln. inf. zapata wall.st...
Python
1
pub selection_hotkeys: [[[u32; 0xc]; 0x12]; 0x8], pub dc2870: [u8; 0x400], pub chat_dialog_recipient: u8, pub player_lose_type: u8, pub player_has_left: [u8; 0x8], pub self_alliance_colors: [u8; 0xc], pub player_color_palette: [[u8; 0x8]; 0xc], pub player_minimap_color: [u8; 0xc], pu...
Rust
0
# SPDX-FileCopyrightText: © 2022-2025 Wojciech Trybus <wojtryb@gmail.com> # SPDX-License-Identifier: GPL-3.0-or-later from typing import Generic, TypeVar from config_system import Field T = TypeVar("T") class GroupOrderHolder(Generic[T]): """ Allows to read and write value order in a group, stored in config...
Python
1
debug_assert!(low <= self_sz, "out of range"); let low = TransitTy::from(low); let hig = TransitTy::from(hig); self >> low << low // clear `low` lesser bits << hig >> hig // clear `hig` highter bits >> low // shift bits to the lowest posi...
Rust
0
# Copyright (C) 2012 Anaconda, Inc # SPDX-License-Identifier: BSD-3-Clause """Entry point for all conda subcommands.""" import sys def init_loggers(): import logging from ..base.context import context from ..gateways.logging import initialize_logging, set_log_level initialize_logging() # silen...
Python
1
# Author: Rowan J. Gollan & Peter J. # Date: 2024-03-02 # # Integration test for shock-fitting on structured grids. # Note that the tests are not independent and must be run in order of appearance. import pytest import subprocess import re import os # This is used to change to local directory so that subprocess runs ...
Python
1
cale_indices_test, train_dl_global, test_dl_global, comm_round=args.comm_round, device=device) elif args.comm_type == "fedma": comm_init_batch_weights = [copy.deepcopy(hungarian_weights) for _ in...
Python
1
0, &mut volume, ); if r == NO_ERR { Ok(volume) } else { cubeb_log!("AudioUnitGetParameter/kHALOutputParam_Volume rv={}", r); Err(Error::error()) } } fn minimum_resampling_input_frames( input_rate: f64, output_rate: f64, output_frames: usize, ) -> usize { ...
Rust
0
# Generated by Django 3.2.5 on 2021-07-06 08:39 import datetime from django.db import migrations, models import django.db.models.deletion from django.utils.timezone import utc class Migration(migrations.Migration): dependencies = [ ('settings', '0009_bank'), ('employee', '0058_auto_20210706_1341...
Python
1
import numpy as np import pandas as pd import pytest from src.av_integration import AlphaVantageHandler from src.av_util import AV_CANDLE_TF, AV_CURRENCY, AV_CURRENCY_DIGITAL, AV_SYMBOL handler = AlphaVantageHandler(api_key="demo") def validate_candles(candles) -> None: assert isinstance( candles, ...
Python
1
# ***************************************************************************** # Copyright (c) 2020, Intel Corporation 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 sou...
Python
1
G: u32 = 16; fn build_device_id(disk_image: &dyn Ufile) -> Vec<u8> { let mut default_disk_image_id = vec![0; VIRTIO_BLK_ID_BYTES as usize]; match disk_image.get_device_id() { Err(_) => warn!("Could not generate device id. We'll use a default."), Ok(m) => { // The kernel only knows t...
Rust
0
pub ledger_hash: String, #[serde(rename="ledger_index")] pub ledger_index: u64, #[serde(rename="receive_currencies")] pub receive_currencies: Vec<String>, #[serde(rename="send_currencies")] pub send_currencies: Vec<String>, #[serde(rename="validated")] pub validated: bool, } #[d...
Rust
0
mut()), then the type of the request is /// [`xcb_get_motion_events_request_t`]. pub const XCB_GET_MOTION_EVENTS: u8 = 39i32 as u8; /// The `GetMotionEvents` request. #[derive(Copy, Clone, Debug)] #[repr(C)] pub struct xcb_get_motion_events_request_t { pub major_opcode: u8, pub pad0: u8, pub length: u16, ...
Rust
0
import torch from torch.utils.data import DataLoader from data.dataset import GolfDBKeypointDataset from models.hybrid_model import CNNTCNHybrid from experiments.logger import SimpleLogger from metrics.accuracy import compute_mae import torch.nn as nn import torch.optim as optim import os def train_model(config): ...
Python
1
__DARWIN_C_LEVEL: u32 = 900000; pub const __STDC_WANT_LIB_EXT1__: u32 = 1; pub const __DARWIN_NO_LONG_LONG: u32 = 0; pub const _DARWIN_FEATURE_64_BIT_INODE: u32 = 1; pub const _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE: u32 = 1; pub const _DARWIN_FEATURE_UNIX_CONFORMANCE: u32 = 3; pub const __PTHREAD_SIZE__: u32 = 8176; pu...
Rust
0
# --------------------------------------- # 论文:Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks (TPAMI 2021) # Github地址: https://github.com/houqb/VisionPermutator # --------------------------------------- import torch from torch import nn class Mlp(nn.Module): def __init__(self,...
Python
1
resolve, bypass, num_coefficients); let index = Literal::isize_unsuffixed(self.index as isize); let max_coefficients = Literal::isize_unsuffixed(self.max_coefficients as isize); quote! { Fir { index: #index, bypass: #bypass, num_coeffi...
Rust
0
_unaligned!(IcmpTimestampData); #[derive(Copy, Clone)] #[repr(C, packed)] struct Timestamp { id_seq: IdAndSeq, timestamps: IcmpTimestampData, } /// An ICMPv4 Timestamp Request message. #[derive(Copy, Clone)] #[repr(transparent)] pub struct Icmpv4TimestampRequest(Timestamp); /// An ICMPv4 Timestamp Reply mess...
Rust
0
#!/usr/bin/python3 def add_tuple(tuple_a=(), tuple_b=()): temp = tuple_a + (0, 0) temp2 = tuple_b + (0, 0) return temp[0] + temp2[0], temp[1] + temp2[1]
Python
1
"] ) else: self.stats["average_processing_time"] = processing_time def get_processing_statistics(self) -> Dict[str, Any]: """Get comprehensive processing statistics.""" total = self.stats["total_requests"] return { "total_requests": t...
Python
1
ests.get method to obtain all equipment from remote api, and gave json object(stream) to get_all_equipment response_json = get_all_object.content.decode() # 把get_all_equipment从远程endpoint返回的json对象decode成json字符串格式,with "" # print(response_json_location) # json object, with "" python_dict = json.loads(res...
Python
1
IMPORT_LEAGUE_DOCUMENTATION = { "title": "Import League", "description": "Import a league from football-data API", "responses": { 200: { "description": "League imported successfully", "content": { "application/json": { "example": { ...
Python
1
pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !(0x3f << 8)) | (((value as u32) & 0x3f) << 8); self.w } } #[doc = "I/O Location\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] #[repr(u8)] pub enum CH6LOC_A { #[doc = "0: Location 0"] LOC0 =...
Rust
0
(), actual.to_dense_matrix()); } #[test] fn fc_impose_matrix_symmetry() { let (orig, sc) = make_fc_test_data(); // symmetrize first (tricky), then add the missing rows let actual = { let mut modified = orig.clone(); modified.impose_matrix_symmetry(SupercellW...
Rust
0
list_1 = [4, 9, 8, 7, 5, 2, 13] list_1.sort() # Sort ascending list_1 = list_1[::-1] # Reverse using slicing print("Sorted Descending:", list_1) print("Difference (Max - Min):", list_1[0] - list_1[-1])
Python
1
; let mut channel = Channel::new(reader, writer); let mut ot = OTReceiver::init(&mut channel, &mut rng).unwrap(); ot.receive_random(&mut channel, &bs, &mut rng).unwrap(); handle.join().unwrap(); } fn bench_ot(c: &mut Criterion) { c.bench_function("ot::ChouOrlandiOT", move |bench| { let m0s ...
Rust
0
from setuptools import setup, find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name="archivist", version="0.1.0", author="Eren Kahraman", author_email="your.email@example.com", description="A Python-based image processing and search system ...
Python
1