text
string
label_name
string
labels
int64
&DataType) -> Result<Self> { let format = get_format_string(dtype)?; // allocate and hold the children let children = match dtype { DataType::List(child) | DataType::LargeList(child) | DataType::FixedSizeList(child, _) => { vec![FFI_ArrowSchem...
Rust
0
rsion > (1, 1) and self.scanner.check_token( ValueToken ): self.state = self.parse_flow_mapping_value return self.process_empty_scalar(self.scanner.peek_token().end_mark) elif not self.scanner.check_token(FlowMappingEndToken): self....
Python
1
164 |a[3]|. Same as |y1|, but |a| is three bytes long, //! |@t$-2^{23}$@><=a<@t$2^{23}$@>|. //! //! \yskip\hang|@!y4| 165 |a[4]|. Same as |y1|, but |a| is four bytes long, //! |@t$-2^{31}$@><=a<@t$2^{31}$@>|. //! //! \yskip\hang|z0| 166. Set |v:=v+z|; i.e., move down |z| units. The `|z|' commands //! are like the `|y|...
Rust
0
LEGACY[22]), FontUtf16(0xE558 as u16, SGA_LEGACY[23]), FontUtf16(0xE559 as u16, SGA_LEGACY[24]), FontUtf16(0xE55A as u16, SGA_LEGACY[25]), ]; /// A convenient constant for special SGA fonts (`U+E541` - `U+E55A`), that implements the [`Utf16Fonts`](./utf16/trait.Utf16Fonts.html) trait. pub const SGA_FONTS: ...
Rust
0
.expect("No Window") .document() .expect("No Document"); debug!("document created"); self.workbench = Some( document .create_element("canvas")? .dyn_into::<web_sys::HtmlCanvasElement>()?, ); debug!("workbench c...
Rust
0
from django.urls import re_path from . import views urlpatterns = [ re_path(r"^(?P<title>[^/]+)$", views.view, name="djiki-page-view"), re_path(r"^(?P<title>[^/]+)/edit/$", views.edit, name="djiki-page-edit"), re_path(r"^(?P<title>[^/]+)/history/$", views.history, name="djiki-page-history"), re_path( ...
Python
1
rce, lora_rank, lora_dropout, learning_rate, steps, batch_size, grad_accum, max_grad_norm, optimizer, scheduler, precision, quantization, text_encoder_8bit, gradient_checkpointing, num_workers, ...
Python
1
import sys input = sys.stdin.readline m = int(input()) ans = 0 rot = 0 for i in range(m): a, b, r = map(int,input().split()) if(i == 0): ans = a * b else: ans = int(ans / a * b) if(r == 1): rot = 1 - rot print(rot,ans)
Python
1
ui.text(im_str!("{:?}: {:?}", key, duration)); } }); } } }<reponame>csrpi/fuchsia // Copyright 2021 The Fuchsia Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. //! This module contains...
Rust
0
::null::<interpolation_context_s>())).ctx_A as *const _ as usize }, 0usize, concat!( "Offset of field: ", stringify!(interpolation_context_s), "::", stringify!(ctx_A) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<interpolation_co...
Rust
0
ixed, c_fixed)) x_concat = torch.cat(x_fake_list, dim=3) x_concat = ((x_concat.data.cpu() + 1)/2).clamp_(0, 1) sample_path = os.path.join(out_path, '{}-images.jpg'.format(i)) save_image(x_concat, sample_path, nrow=1, padding...
Python
1
(cond = "flags.get(4)")] pub quoted_ttl: Option<u8>, /// Node address, included if flag 5 is set. #[deku(cond = "flags.get(5)")] pub addr: Option<Address>, /// Included if flag 6 is set. #[deku(cond = "flags.get(6)")] pub name: Option<CString>, } /// A link in a multipath traceroute. #[deri...
Rust
0
erialize)] pub enum State { Adventuring, KilledRhulad, WonGame, LostGame, } /// Used for NPCs visible to the player. pub struct Npc { pub letter: char, pub color: Color, pub observed_hps: (i32, i32), // current and max where max is in [1, 10] (based on perception) pub actual_hps: Option...
Rust
0
import os import pandas as pd from spaceai.data import NASA from spaceai.benchmark import NASABenchmark from spaceai.benchmark.callbacks import SystemMonitorCallback from spaceai.segmentators.nasa_segmentator import NasaDatasetSegmentator from spaceai.models.predictors import RocketClassifier from sklearn.svm import On...
Python
1
%Y-%m-%d %H:%M"), task_plan={"task": "Task 5"}, ) tasks = [task1, task4, task5] now = datetime.strptime("2023-09-19 10:00", "%Y-%m-%d %H:%M") res1 = find_next_task( tasks, now + timedelta(minutes=5), task_type=TaskTypes.RUN_ORDER, ...
Python
1
y1c($i, $f) ); ); /// `many_till!(I -> IResult<I,O>, I -> IResult<I,P>) => I -> IResult<I, (Vec<O>, P)>` /// Applies the first parser until the second applies. Returns a tuple containing the list /// of results from the first in a Vec and the result of the second. /// /// The first embedded parser may return `Incomp...
Rust
0
кщо перевірялося створити але залишити пустим якщо помилок нема [ ["Дублікат точки", (1531.5315, 5315.53153)], #зауваж шо точка має бути в координатах ["Самопересічення", (1531.5315, 5315.53153)], ["помилка3"] ...
Python
1
ase64::decode(&string).map_err(|err| Error::custom(err.to_string()))) } // Copyright 2014-2015 <NAME>, <NAME>, <NAME> // Licensed under the MIT license (http://opensource.org/licenses/MIT) // This file may not be copied, modified, or distributed // except according to those terms. //! Banded Smith-Waterman alignment f...
Rust
0
tensor!( tensor!(10.0, 14.0, 18.0), tensor!(15.0, 21.0, 27.0), tensor!(20.0, 28.0, 36.0) ); assert_eq!(*output_3x3.data.clone(), *expected_vals.data.clone()); assert_eq!(output_3x3.op, Some(MathFn::TensorFns(BinaryFn::MatMul))); } #[test] fn bro...
Rust
0
# hidtest.py - Basic test of PsychHID for Python # Also tests WaitSecs, as it is utilized here. # # Collects key responses for 5 seconds via KbQueues while being blocked on # the main thread. The disabled latter part will perform some low-level access # to a USB-HID device, to test HID report send/receive. However, thi...
Python
1
# Superclase class Animal: def __init__(self, nombre, edad): self.nombre = nombre self.edad = edad def hacer_sonido(self): print("Este animal hace un sonido.") def describir(self): print(f"Soy un {self.__class__.__name__}, me llamo {self.nombre} y tengo {self.edad} años...
Python
1
object } Item::Cooker => { // create a fireball scroll-like item let mut object = Object::new(x, y, 'E', "Jew Cooker", colors::LIGHT_YELLOW, false); object.item = Some(Item::Cooker); ...
Rust
0
from colorama import Fore, init from movie_app import MovieApp from storage_json import StorageJson from storage_csv import StorageCsv def main(): init(autoreset=True) print(Fore.CYAN + "Choose storage format:") print(Fore.CYAN + "1. JSON") print(Fore.CYAN + "2. CSV") storage_choice = input(Fore.Y...
Python
1
", BasicBlock, [2, 2, 2, 2], pretrained, progress, **kwargs) def resnet34_mpo( pretrained: bool = False, progress: bool = True, **kwargs ) -> ResNet_MPO: """ResNet-34 with MPO compression.""" return _resnet("resnet34", BasicBlock, [3, 4, 6, 3], pretrained, progress, **kwargs) def resnet50_mpo( pretr...
Python
1
ge::ServerMsg}; use super::*; pub async fn message_delete( state: &ServerState, db: &db::pool::Client, id: Snowflake, party_id: Option<Snowflake>, ) -> Result<(), Error> { let row = db .query_opt_cached_typed( || { use schema::*; use thorn::*; ...
Rust
0
temp_df['发放日'] = pd.to_datetime(temp_df['发放日'], format='%Y-%m-%d', errors='coerce').dt.date return temp_df if __name__ == "__main__": stock_hk_security_profile_em_df = stock_hk_security_profile_em(symbol="03900") print(stock_hk_security_profile_em_df) stock_hk_company_profile_em_df = stock_h...
Python
1
bitop: match cf & 0b11 { 0b00 => None, 0b01 => Some(BitChange::Flip), 0b10 => Some(BitChange::Clear), 0b11 => Some(BitChange::Set), _ => unreachable!(), }, cycle: cf & 0b100 != 0, }; let prev_bit_val...
Rust
0
datatypes::*, error::Result, io::parquet::read::*, io::parquet::write::*}; use parquet2::indexes::{compute_rows, select_pages}; use parquet2::read::IndexedPageReader; /// Returns 2 sets of pages with different the same number of rows distributed un-evenly fn pages( arrays: &[&dyn Array], encoding: Encoding, )...
Rust
0
&[255.; RENDER_QUANTUM_SIZE][..], abs_all <= 0. ); // taken from the start of the ring buffer assert_float_eq!( &buffer[2 * RENDER_QUANTUM_SIZE..3 * RENDER_QUANTUM_SIZE], &[256.; RENDER_QUANTUM_SIZE][..], abs_all <= 0. ); ...
Rust
0
0] * quat[2]); rmat[[1, 2]] = 2.0_f64 * (quat[2] * quat[3] - quat[0] * quat[1]); rmat[[2, 2]] = qbar + 2.0_f64 * quat[3] * quat[3]; }; #[cfg(feature = "parallel")] par_azip!((rmat in ori.axis_iter_mut(Axis(2)), quat in self.ori.axis_iter(Axis(1))) { f(rmat, q...
Rust
0
(1.0, hub_only=False): sleep(0) def test_no_switches_no_function(self): # No blocking time given, no switch performed: exception with self.assertRaises(util._FailedToSwitch): with util.assert_switches(): pass # blocking time given, for all greenlets...
Python
1
_db(sample_service, mocker): send_mock = mocker.patch("app.celery.process_sms_client_response_tasks.check_and_queue_callback_task") reference = str(uuid.uuid4()) process_sms_client_response(status="3", provider_reference=reference, client_name="MMG") send_mock.assert_not_called() @freeze_time("2001-01...
Python
1
# # Copyright 2007-2014 Charles du Jeu - Abstrium SAS <team (at) pyd.io> # This file is part of Pydio. # # Pydio is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at yo...
Python
1
self.tree_r_last_config.path = cp.clone(); self.tree_c_config.path = cp; } pub fn labels_for_layer( &self, layer: usize, ) -> Result<DiskStore<<Tree::Hasher as Hasher>::Domain>> { self.labels.labels_for_layer(layer) } pub fn domain_node_at_layer( &self,...
Rust
0
er_children(children)?; self.set_sep(sep); self.set_indent(indent); } Tag::List(opt) => { let sep = self.set_sep(SepMode::NewLine); let bullet = self.set_bullet(self.bullet.next(opt)); self.nested_nl()?; ...
Rust
0
self.details_text.config(state="normal") self.details_text.delete("1.0", tk.END) self.details_text.insert(tk.END, "Виберіть подію, щоб відобразити її деталі.") self.details_text.tag_add("center", "1.0", "end") self.details_text.config(state="disabled") de...
Python
1
best_cost = cost best_coil_config = CoilConfig( phase=phase.detach().clone(), amplitude=amplitude.detach().clone(), ) pbar.set_postfix_str(f"Best cost {best_cost:.2f}") phase = best_coil_config.phase.clone().de...
Python
1
string contains multiple contiguous separators, you will end up /// with empty strings in the output: /// /// ``` /// let x = "||||a||b|c".to_string(); /// let d: Vec<_> = x.split('|').collect(); /// /// assert_eq!(d, &["", "", "", "", "a", "", "b", "c"]); /// ``` /// /// Contigu...
Rust
0
message: {}", msg); if let Err(_source) = self.stream.send(msg).await { #[cfg(feature = "tracing")] tracing::warn!("sending failed: {}", _source); break; } } else { ...
Rust
0
save_config(self, config_path: Optional[str] = None) -> None: """ Save current configuration to file. Args: config_path: Optional path to save configuration """ save_path = config_path or self.config_path or "config.json" try: # ...
Python
1
memory. /// /// For a `callback_when_finished_or_cancelled` that does nothing, use `::ucx::callbacks::tagged_message_receive_callback_is_ignored`. /// `request` should not be freed inside the `callback_when_finished_or_cancelled`. /// /// If a returned `ReceivingTaggedMessageNonBlockingRequest` is neither cancelle...
Rust
0
CB_RES_2_r_h: (0x94, 2, h), test_CB_RES_3_r_h: (0x9C, 3, h), test_CB_RES_4_r_h: (0xA4, 4, h), test_CB_RES_5_r_h: (0xAC, 5, h), test_CB_RES_6_r_h: (0xB4, 6, h), test_CB_RES_7_r_h: (0xBC, 7, h), // L test_CB_RES_0_r_l: (0x85, 0, l), test_CB_RES_1_r_l: (0x8D, 1, l), test_CB_RES_2_r_l: (...
Rust
0
nitMsg, QueryMsg}; use crate::msg_cw721::HandleMsg as Cw721HandleMsg; use crate::state::{ config, config_read, offers, offers_read, read_viewing_key, token_bets, token_bets_read, write_viewing_key, Offer, OfferStatus, State, TokenBet, }; use crate::utils::{calculate_fee, sha_256, Prng}; use crate::validation::{...
Rust
0
:now()).format(Some("%Y-%m-%d")), }; let mut print_type = log::PrintType::DEFAULT; let _with_slack = &args.with_slack.unwrap_or_default(); if *_with_slack == true { print_type = log::PrintType::SLACK; } let started = Instant::now(); let mut client = client::Client::new(); clien...
Rust
0
import logging from concurrent_log_handler import ConcurrentRotatingFileHandler from config.dashgo_conf import LogConf # logging.error("An error occurred: %s", e, exc_info=True) class Log: # 创建一个ConcurrentRotatingFileHandler对象 handler_file = ConcurrentRotatingFileHandler( filename=LogConf.LOG_FILE_PAT...
Python
1
class Solution: def countHillValley(self, nums: List[int]) -> int: i = 1 ret = 0 while i < (len(nums) - 1): curr = nums[i] before = nums[i - 1] for tmp in range(i + 1, len(nums)): if nums[tmp] != curr: i = tmp - 1 ...
Python
1
enumerate() { // If this class' vector has not been populated, we can safely // skip this iteration, since the user is clearly not interested // in associating features with this class if c.is_empty() { continue; } ...
Rust
0
_spec: arg_spec, }, }) } } }) .collect(); let args = try!(args); (self.function)(&args); Ok(()) } fn print_usage(&self) { print!("{}", self.name); for arg in se...
Rust
0
vg CV-R^2', np.mean(scores)) print(' avg CV-RMSE', np.mean(rmse_scores)) def compute_model_scores(x_train, y_train, models: dict): """ Generalized helper function to quickly evaluate models """ scores = {} model_info = {} for m in models: scores[m] = {} # train model and pred...
Python
1
#!/usr/bin/env python3 '''GUI wrapper around oathtool that allows you to maintain multiple sets of two factor authentication credentials''' # Version 0.1 2017.06.06 # Copyright (c) 2017, OmegaPhil - OmegaPhil@startmail.com # # This program is free software: you can redistribute it and/or modify # it under the terms ...
Python
1
0,4]), (vec![3, 4, 6, 5], vec![9, 1, 2, 5, 8, 3], 5, vec![9, 8, 6, 5, 3]), (vec![3,9],vec![8,9],3, vec![9,8,9]), ]; for (nums1, nums2, k, expect) in test_cases { let actual = Solution::max_number(nums1, nums2, k); assert_eq!(actual, expect); } ...
Rust
0
from typing import TYPE_CHECKING from langchain_community.document_loaders.parsers.language.tree_sitter_segmenter import ( # noqa: E501 TreeSitterSegmenter, ) if TYPE_CHECKING: from tree_sitter import Language CHUNK_QUERY = """ [ (class_specifier body: (field_declaration_list)) @cla...
Python
1
{ self.channels.get_mut(&id) } fn unregister(&mut self, id: LocalChannelId) { self.channels.remove(&id); self.id_allocator.free(id); } } async fn jmux_sender_task<T: AsyncWrite + Unpin>( mut jmux_msg_sink: FramedWrite<T, JmuxCodec>, mut jmux_msg_to_send_receiver: Unbounded...
Rust
0
#[doc = "0x60 - pwm2_clkdiv."] pub pwm2_clkdiv: crate::Reg<pwm2_clkdiv::PWM2_CLKDIV_SPEC>, #[doc = "0x64 - pwm2_thre1."] pub pwm2_thre1: crate::Reg<pwm2_thre1::PWM2_THRE1_SPEC>, #[doc = "0x68 - pwm2_thre2."] pub pwm2_thre2: crate::Reg<pwm2_thre2::PWM2_THRE2_SPEC>, #[doc = "0x6c - pwm2_period...
Rust
0
print("""******************* Faktoriyel Bulma Programı Programdan çıkmak için 'q' ya basın. *******************""") while True: sayi = input("Sayı:") if (sayi == "q"): print("Programdan çıkılıyor...") break sayi = int(sayi) faktoriyel = 1 for i in range(2,sayi+1): faktoriy...
Python
1
011b, # LATIN SMALL LETTER E WITH CARON 0x00ef: 0x010f, # LATIN SMALL LETTER D WITH CARON 0x00f0: 0x0111, # LATIN SMALL LETTER D WITH STROKE 0x00f1: 0x0144, # LATIN SMALL LETTER N WITH ACUTE 0x00f2: 0x0148, # LATIN SMALL LETTER N WITH CARON 0x00f5: 0x0151, # LATIN SMALL LETTER O ...
Python
1
AGNIFYING_GLASS_MESSAGES["live"]) + "\n你确定要对准别人吗?" else: response_text = random.choice(MAGNIFYING_GLASS_MESSAGES["miss"]) + "\n你可以考虑对自己开一枪..." elif tool_name == "饮料": player_info["hp"] += 1 response_text = random.choice(...
Python
1
raise j95qd_yd8p5 '# network_diamond_punishments -> numeral_cleanliness_lubricant' nonlocal xo1o6st_45f return vdsfsrlzgs4 *= None @p0nyvia1yp7[b''] def lmu0xzqo_hj(jovhbr4si85: nnurvjg56d9=b'', l11qrns4gtk=0.0, bfjahnutcz1: xtp60k8zx5a='', da6dc60_i3b=0, lx25otgttg0=None, pq3fg4pnhzq: bl126n5cvd1=0.0,...
Python
1
SGX_EC_VALID = 0x0000_0000, /* validation pass successfully */ SGX_EC_COMPOSITE_BASE = 0x0000_0001, /* field based on composite */ SGX_EC_COMPLICATED_BASE = 0x0000_0002, /* number of non-zero terms in the polynomial (> PRIME_ARR_MAX) */ SGX_EC_...
Rust
0
from datetime import date from django.template.loader import render_to_string from core.emails import send_email year = date.year def send_sponsor_email(contact_person, contact_email, template, subject, errors=None): content = render_to_string(template, {"contact_person": contact_person, "errors": errors}) ...
Python
1
40."), 190 => (TotalLengthIpv4, total_length_ipv4, u16, (), doc="The total length of the IPv4 packet."), 191 => (PayloadLengthIpv6, payload_length_ipv6, u16, (), doc="This Information Element reports the value of the Payload Length field in the IPv6 header. Note that IPv6 extension headers belong to the payload. Also...
Rust
0
buteName::BonusPyro, "炽烈的炎之魔女2", 0.15); } fn effect4(&self, attribute: &mut T) { let key = "炽烈的炎之魔女4"; attribute.set_value_by(AttributeName::EnhanceOverload, key, 0.4); attribute.set_value_by(AttributeName::EnhanceBurning, key, 0.4); attribute.set_value_by(AttributeName::Enhance...
Rust
0
ore1 games = games + 1 return goal, lose, games, goal/games, lose/games def get_champion_goal_stat(self): list_champion_goal_stat = [] dict_champion = self._get_champion_team() for year, champion in dict_champion.items(): df = self._data_df[self._data_d...
Python
1
FieldReader<u16, u16>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `reg_pket_tail_byte` writer - "] pub struct REG_PKET_TAIL_BYTE_W<'a> { w: &'a mut W, } impl<'a> REG_PKET_TAIL_BYTE_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] ...
Rust
0
" def execute_mock(*args, **kwargs): raise err.TrestleError('execution failed') test_data_source = testdata_dir / 'split_merge/step4_split_groups_array/catalogs' catalogs_dir = pathlib.Path('catalogs/') # Copy files from test/data/split_merge/step4 shutil.rmtree(catalogs_dir) shutil.rm...
Python
1
4dp3sp", -64.884901238, 80.401698979}, {0xa44e965841a63b05, "nj79dq21nsxh", -60.170549227, 95.021040316}, {0xb7047275e02eb6ae, "qw274xg05uvb", -9.273808632, 112.96571463}, {0xf9b1e97ad7155863, "z6sykyqr2pd6", 60.19675025, 153.147013916}, {0xd054059f331cc978, "u1b0c7tm3m4r", 54.995741231,...
Rust
0
self.0 as *const FontAtlas) } } } impl DerefMut for SharedFontAtlas { fn deref_mut(&mut self) -> &mut FontAtlas { unsafe { &mut *(self.0 as *mut FontAtlas) } } } /// An immutably borrowed reference to a (possibly shared) font atlas pub enum FontAtlasRef<'a> { Owned(&'a FontAtlas), Shared(&...
Rust
0
import pytest from pathlib import Path from AnkiTools.convert import anki_convert from AnkiTools.tools.verify import is_valid_anki @pytest.mark.parametrize('in_file', [ 'test.apkg' ]) @pytest.mark.parametrize('out_format', [ '.xlsx' ]) def test_convert_to_excel(in_file, out_format): in_file = Path('tests...
Python
1
# # Licensed to the Apache Software Foundation (ASF) under one # # or more contributor license agreements. See the NOTICE file # # distributed with this work for additional information # # regarding copyright ownership. The ASF licenses this file # # to you under the Apache License, Version 2.0 (the # # "License"); y...
Python
1
(d, e, f) = (*other).into(); a == d && b == e && c == f } } impl Default for ScanAngle { fn default() -> ScanAngle { ScanAngle::Rank(0) } } impl From<ScanAngle> for i8 { fn from(scan_angle: ScanAngle) -> i8 { match scan_angle { ScanAngle::Rank(n) => n, ...
Rust
0
fn min_score(&self, game: &Game, state: &State, role: &Role, last_move: Move) -> Score { let moves = game.legal_moves(state, role); assert!(moves.len() >= 1, "No legal moves"); let mut min = 100; for m in moves { let move_vec = if game.roles()[0] == *role { ...
Rust
0
rovider.device_authorization_endpoint_url().as_str()) .header(CONTENT_TYPE, REQ_CONTENT_TYPE.to_string()) .header(ACCEPT, RES_CONTENT_TYPE.to_string()) .body(body_str.as_bytes().to_vec()) .map_err(DeviceAuthorizationEndpointError::MakeRequestFailed)?; Ok(request)...
Rust
0
child_num: vec![ Xi { value: Some("bar".to_string()), partials: vec![alpha!(0).form()], child_num: vec![], child_den: vec![], }, Xi::new("foo"), ], child_den: ...
Rust
0
let target_size = target.get_size(); let viewport_min_x = 0; let viewport_min_y = 0; let viewport_max_x = target_size.0 as i32; let viewport_max_y = target_size.1 as i32; let mut i = 0; while i < indices.len() { let v0 = vertices[indices[i] as usize].position().round().to_i32(); ...
Rust
0
)) }); parser(rest) } fn device_id<'a, E: ParseError<&'a [u8]>>(input: &'a [u8]) -> IResult<&'a [u8], String, E> { let mut parser = map(tuple((be_u32, be_u32, be_u32)), |(p1, p2, p3)| { format!("{}-{}-{}", p1, p2, p3) }); parser(input) } fn ventilation_mode<'a, E: ParseError<&'a [u8]> + Fr...
Rust
0
(s): return s.coord elif is_field_query(s): return x else: return None return _remove_empty(jax.tree.map(get_query, specs, inputs)) def as_input_specs( specs: dict[str, dict[str, DataSpec]], ) -> dict[str, dict[str, cx.Coordinate]]: """Transforms structure of DataSpec objects into a...
Python
1
, 100) } #[bench] fn bench_from_fn_1000(b: &mut Bencher) { do_bench_from_fn(b, 1000) } #[bench] fn bench_from_fn_1000_std(b: &mut Bencher) { do_bench_from_fn_std(b, 1000) } fn do_bench_from_elem(b: &mut Bencher, src_len: usize) { b.bytes = src_len as u64; b.iter(|| { let dst: ve::Vec<usize> ...
Rust
0
tooltip_component.update_tooltip_field(self.tooltip_field_markup, None, None, should_update=True, immediate=True) else: clear_tooltips = True else: clear_tooltips = True if clear_tooltips: if self.tooltip_field_entrance...
Python
1
r n, contour in enumerate(contours_cup): patch_image[(contour[:, 0]).astype(int), (contour[:, 1]).astype(int), :] = [0, 255, 0] patch_image[(contour[:, 0] + 1.0).astype(int), (contour[:, 1]).astype(int), :] = [0, 255, 0] patch_image[(contour[:, 0] + 1.0).astype(int), (contour[:, 1] + 1.0).astype...
Python
1
#! /usr/bin/env python import sys sys.path.append('..') import tensorflow as tf import numpy as np import re import os import time import datetime import gc from input_helpers import InputHelper from Lstm_Attention_network import LSTM_Attention from tensorflow.contrib import learn import gzip from random import random...
Python
1
from .. import IconBase class IconMartini(IconBase): class_name = "lucide lucide-martini" svg_data = { "attrs": { "width": "24", "height": "24", "view_box": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke_width": "2", "stroke_linecap":...
Python
1
q_ignore_ascii_case("s")); for i in 0..501 { let lower = if 'A' as u32 <= i && i <= 'Z' as u32 { i + 'a' as u32 - 'A' as u32 } else { i }; assert!( (from_u32(i).unwrap()) .to_string() .eq_ignore_ascii_case(&from_u32(lower).unwrap().to_string()...
Rust
0
(CheckpointLoaderSimple, "RETURN_NAMES", CheckpointLoaderSimple.RETURN_TYPES), "example") @classmethod def INPUT_TYPES(s): types = super().INPUT_TYPES() types["optional"] = {"prompt": ("STRING", {"hidden": True})} return types def load_checkpoint(self, **kwargs)...
Python
1
we left Stop mode with // a different clock frequency than we entered it with, a // lot of peripheral would stop working correctly. // // For now, I've decided to just not support this case and // panic, which is also d...
Rust
0
#----------------------------------------------------------------------------- # Copyright (c) 2015-2020, PyInstaller Development Team. # # This file is distributed under the terms of the Apache License 2.0 # # The full license is available in LICENSE, distributed with # this software. # # SPDX-License-Identifier: Apac...
Python
1
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import math import numpy as np # type: ignore import onnx from ..base import Base from . import expect class LRN(Base): @staticmethod def export(): # type: (...
Python
1
ld.to(args.device) esmfold.esm = esmfold.esm.half() # Load ESMFold tokenizer. esmfold_tokenizer = AutoTokenizer.from_pretrained("facebook/esmfold_v1") # Fold proteins. print('Folding proteins with EMSFold...') for i, protein_record in enumerate(SeqIO.parse(args.proteins_fasta, "fasta")):...
Python
1
import numpy as np def merge_channels(h1,h2): """Merge the spin up and down channels""" if h1.has_spin or h2.has_spin: raise if h1.has_eh or h2.has_eh: raise h1 = h1.get_multicell() # multicell Hamiltonian h2 = h2.get_multicell() # multicell Hamiltonian if len(h1.hopping)!=len(h2.hopping): rai...
Python
1
n(root[min_vevlb]) return res def _subgraph_mining(self, projected): self._support, self._ids = self._get_support(projected) if self._support < self._min_support: return if not self._is_min(): return self._report(projected) num_vertices = sel...
Python
1
= ((inst >> 16) & u16::MAX as u64) as i16; let src: usize = ((inst >> 12) & 0x0f) as usize; let dst: usize = ((inst >> 8) & 0x0f) as usize; let op: u8 = (inst & u8::MAX as u64) as u8; match op { ALU_K_ADD => reg[dst] = (reg[dst] as i32).wrapping_add(imm) as u64, ...
Rust
0
_BLE_1 {} #[doc = "MAC BLE Address 1"] pub mod mac_ble_1; #[doc = "MAC IEEE 802.15.4 Address 0\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic:...
Rust
0
# Given list of tuples (name, surname, age, profession, City location) # 1 - Add your new record to the beginning of the given list # 2 - In modified list swap elements with indexes 1 and 5 (1<->5). Print result # 3 - check that all people in modified list with records indexes 6, 10, 13 # have age >=30. Print conditi...
Python
1
from erpnext.accounts.doctype.accounting_dimension.accounting_dimension import ( create_accounting_dimensions_for_doctype, ) def execute(): create_accounting_dimensions_for_doctype(doctype="Supplier Quotation") create_accounting_dimensions_for_doctype(doctype="Supplier Quotation Item")
Python
1
num_workers=args.num_workers) total_cer, total_wer = 0, 0 output_data = [] for i, (data) in tqdm(enumerate(test_loader), total=len(test_loader)): inputs, targets, input_percentages, target_sizes, inputFilePaths, inputsMags = data inputs = Variable(inputs, volatile=True) inputs = inputs.to(device) # unflat...
Python
1
ors[self.elevator].components_to_move() } fn potential_floors(&self) -> &'static [usize] { static FLOOR_0: &'static [usize] = &[1]; static FLOOR_1: &'static [usize] = &[0, 2]; static FLOOR_2: &'static [usize] = &[1, 3]; static FLOOR_3: &'static [usize] = &[2]; match sel...
Rust
0
.characters .get(&character_id) .and_then(|c| { c.character_action_ids .iter() .filter_map(|id| game.character_actions.get(id)) .filter_map(|ca| game.actions.get(&ca.action_id)) ...
Rust
0
.scalar('train_epoch_loss', loss, step=epoch) # Forces summary writer to send any buffered data to storage. writer.flush() # Evaluate on validation set. if FLAGS.validation_type is not None and (epoch % FLAGS.test_freq == 0 or epoch == 1): ...
Python
1
ql::*; use static_assertions::_core::marker::PhantomData; #[derive(SimpleObject)] struct ObjA<'a> { value: &'a i32, } struct ObjB<'a>(PhantomData<&'a i32>); #[Object] impl<'a> ObjB<'a> { async fn value(&self) -> &'a i32 { todo!() } } #[derive(Union)] enum MyUnion1<'a> { ObjA(ObjA<'a>), } #[...
Rust
0
#[must_use] pub fn post_scale(&self, x: T, y: T) -> Self where T: Copy + Add<Output = T> + Mul<Output = T> + Zero, { self.post_transform(&Transform2D::create_scale(x, y)) } /// Applies a scale before self's transformation and returns the resulting transform. #[inline] #...
Rust
0
""" This file runs the main training/val loop """ import os import json import math import sys import pprint import torch from argparse import Namespace sys.path.append(".") sys.path.append("..") from options.train_options import TrainOptions from training.coach import Coach def main(): opts = TrainOptions().parse...
Python
1