text
string
label_name
string
labels
int64
handlers['gen_ffi_exports'] = cmd_gen_ffi_exports gtbi_desc = "Extract build info from manifest" gtbi_cmd = cmd.add_parser('get_build_info', help=gtbi_desc, description=gtbi_desc) gtbi_cmd.add_argument('--manifest', '-m', required=True) gtbi_cmd.add_argument('--var_prefix', default='') gtbi_cmd.a...
Python
1
for Bps { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} bps", self.0) } } #[derive(Debug, PartialEq, PartialOrd, Clone, Copy)] pub struct Hertz(pub u32); impl fmt::Display for Hertz { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} Hz", self.0) ...
Rust
0
=> std::ptr::null_mut(), Some(image_filter) => ValueBox::new(image_filter).into_raw(), }) } #[no_mangle] pub fn skia_paint_has_image_filter(paint_ptr: *mut ValueBox<Paint>) -> bool { paint_ptr.with_not_null_return(false, |paint| match paint.image_filter() { None => false, Some(_) => tr...
Rust
0
section(&aabb, &v.aabb)) .map(|(i, _)| i) { let (lower, upper) = get_intersection(&aabb, &non_intersecting_cubes[start + i].aabb); if aabb.lower[0] < lower[0] { aabbs.push(Aabb { lower: [aabb.lower[0], aabb.lower[1], aabb.lower[2]], ...
Rust
0
0, true, 0, 0, 0, out.as_mut_ptr(), ) } }); } #[bench] #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] fn bench_many_chunks_sse2(b: &mut Bencher) { if !blake3_c_rust_bindings::sse2_detected(...
Rust
0
st try the objfiles. for objfile in gdb.objfiles(): _get_some_type_recognizers(result, objfile.type_printers) # Now try the program space. _get_some_type_recognizers(result, gdb.current_progspace().type_printers) # Finally, globals. _get_some_type_recognizers(result, gdb.type_printers) ...
Python
1
} } else if utf8 { println!("utf-8: {}", entry.path().display()); } } else if not_utf8 { println!("not-utf8: {}", entry.path().display()); } ...
Rust
0
10] = [0, 33, 48, 58, 65, 91, 97, 123, 126, 128]; let fg_color_map = DefaultFgColorMap::new(); let bg_color_map = DefaultBgColorMap::new(); println!("Hex Bin Oct Dez"); for i in values.iter() { let byte: xxd::Byte = xxd::ByteBuilder::new(*i, &fg_color_map, &bg_color_map).into(); ...
Rust
0
t p2: Point<f64> = p1.map_coords(|&(x, y)| (x as f64, y as f64)); /// /// assert_eq!(p2, Point::new(10.0f64, 20.0f64)); /// ``` fn map_coords(&self, func: impl Fn(&(T, T)) -> (NT, NT) + Copy) -> Self::Output where T: CoordinateType, NT: CoordinateType; } /// Map a fallible function ...
Rust
0
_replies_t, ) -> c_int { sym!( self, xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_length )(r, s) } /// Returns `true` iff the symbol `xcb_xkb_get_kbd_by_name_replies_key_names_value_list_radio_group_names_length` could be loaded. #[cfg(f...
Rust
0
*; let cid: i32 = request.url().path().trim_start_matches("/").parse() .status(StatusCode::BadRequest)?; let conn = &request.state().pool; let target: String = posts.select(content) .filter(id.eq(cid)) .first_async(&conn) .await .status(StatusCode::NotFound)?; Ok...
Rust
0
)); } self.cpu_fd.insert(cpu, fd); Ok(()) } fn update(&mut self, key: &mut [u8], val: &mut [u8]) -> i32 { unsafe { bpf_update_elem( self.table_fd, key.as_mut_ptr() as MutPointer, val.as_mut_ptr() as MutPointer...
Rust
0
se: open_dict[child.puzzle] = child.h heapq.heappush(open_list, (child.h, child)) max_states_in_memory = max( max_states_in_memory, len(open_dict) + len(closed_dict) ) def a_star_search(puzzle, goal): Node.set_comparison_criteria("f") start_node = N...
Python
1
, introduction_version: 12.1f32, name: "person: curly hair", group: "People & Body", subgroup: "person", is_variant: false, variants: &[], annotations: &[], }; #[doc = "🧑🏻\u{200d}🦱"] pub const PERSON_LIGHT_SKIN_TONE_CURLY_HAIR: crate::Emoji = crate::Emoji { glyph: "🧑🏻\u{200d}🦱", ...
Rust
0
# Copyright 2018 The Exoplanet ML Authors. # # 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 t...
Python
1
_LDODPCTL_VLDOR::SYSCTL_LDODPCTL_VLDO_1_35V => 27, SYSCTL_LDODPCTL_VLDOR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(hidden)] #[inline(always)] pub fn _from(value: u8) -> SYSCTL_LDODPCTL_VLDOR { match value { 18 => SYSCTL_LDODPCTL_VLDOR::SYSCTL_...
Rust
0
_6d_c1, }; use itertools::Itertools; // for the function [unique_by] const QUERY_TIMEOUT: Duration = Duration::from_secs(5); #[test] fn can_get_nns_targets_for() { let mainnet_prefix = "tdb26"; let tempdir = TempDir::new().unwrap(); let ic_dir = PathBuf::from(tempdir.path())...
Rust
0
t_time = QDateTime.currentDateTime().toString("hh:mm:ss") self.clock_label.setText(current_time) # 更新测量时长 elapsed = self.start_time.secsTo(QDateTime.currentDateTime()) hours = elapsed // 3600 minutes = (elapsed % 3600) // 60 seconds = elapsed % 60 duration = f"{h...
Python
1
l, } impl ExecutableProtocolRunner { /// Send SIGINT signal to the sub-process, which is cheking for this ctrl-c signal and shuts down gracefully if recieved async fn terminate_or_kill( process: &mut Child, reason: String, ) -> Result<(), ProtocolRunnerError> { // try to send SIGINT...
Rust
0
') else: print(test ,': failed') print_test('test1', False) ''' Q4. Design a function called num_teams that takes 2 arguments in this order: the number of people to be split into teams and the maximum team size. The function should assume these arguments are greater than zero. The function should...
Python
1
plugin_manager().hook.init_anonymization_pipeline( endpoints_file=endpoints_file ) # configure structlog configure_structlog(log_level) cmdline_arguments.func(cmdline_arguments) elif hasattr(cmdline_arguments, "version"): print_ve...
Python
1
always)] pub fn im0(&self) -> IM0_R { IM0_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1 - XDMAC Channel 1 Interrupt Mask Bit"] #[inline(always)] pub fn im1(&self) -> IM1_R { IM1_R::new(((self.bits >> 1) & 0x01) != 0) } #[doc = "Bit 2 - XDMAC Channel 2 Interrupt Mask Bit"] ...
Rust
0
keys and returns references to them. /// The returned buckets must be unlocked again in order to not cause deadlocks. /// /// If both keys hash to the same value, both returned references will be to the same bucket. Be /// careful to only unlock it once in this case, always use `unlock_bucket_pair`. #[inline] fn lock_...
Rust
0
ure"), ('CLIP', "Clip","Use the alpha threshold to clip the visibility (binary visibility)"), ('HASHED', "Hashed","Use noise to dither the binary visibility (works well with multi-samples)"), ('OPAQUE', "Opaque","Render surface without transparency"), ) blend_method: EnumProperty(name="B...
Python
1
d(), 1, 0) node.stakeblock(1) # height : 1101 self.log.info("Set score (4) to fakePost for check lottery payment") for acc in accounts: pubGenTx( acc, ScoreContentPayload(fakePostTx, 4, fakeAcc.Address), ) node.stakeblock(2) # h...
Python
1
If kexec fails, there is no real chance at diagnostics because the device will be hung. Get the output prior to the call, in case this helps after the job fails. """ connection = super().run(connection, max_end_time) if self.deploy_commands: self.logger.debug("Runnin...
Python
1
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve. # # 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 applic...
Python
1
from Py4GWCoreLib.enums import outpost_name_to_id, explorable_name_to_id # 1) IDs _8_gatesofkryta_to_lionsarch_ids = { "outpost_id": outpost_name_to_id["Gates of Kryta outpost"], } # 2) Outpost exit path (inside Gates of Kryta) _8_gatesofkryta_to_lionsarch_outpost_path = [ (-4203, 26650), (-4333, 26800), ...
Python
1
ely.""" # Try to break up long structured messages if "headers:" in message: parts = message.split("headers:") if len(parts) == 2: prefix = parts[0].strip() headers_part = parts[1].strip() # Try to parse headers if they look like a dict if headers...
Python
1
class Solution: def solve(self, board: List[List[str]]) -> None: rows, cols = len(board), len(board[0]) def dfs(row,col): if (row < 0 or row >= rows) or (col < 0 or col >= cols) or board[row][col] != "O": return board[row][col] = "T" #save the square as safe...
Python
1
.") map22kto1k_path = f'data/map22kto1k.txt' with open(map22kto1k_path) as f: map22kto1k = f.readlines() map22kto1k = [int(id22k.strip()) for id22k in map22kto1k] state_dict['head.weight'] = state_dict['head.weight']...
Python
1
, Deserialize)] pub enum ClientMessage { Input(InputEvent), } #[derive(Clone, Debug, Serialize, Deserialize)] pub enum ServerMessage { ButtonStatesUpdated(Vec<(ButtonGridLocation, ButtonCoordinate, ButtonState)>), ButtonLabelsUpdated(Vec<(ButtonGridLocation, ButtonCoordinate, String)>), ClockUpdated(cl...
Rust
0
" 9 players; last marble is worth 25 points: high score is 32 10 players; last marble is worth 1618 points: high score is 8317 13 players; last marble is worth 7999 points: high score is 146373 17 players; last marble is worth 1104 points: high score is 2764 21 players; last marble is worth 6111 points: high score is 5...
Rust
0
nd_shake = State::new(); hand_shake = hand_shake.try_step(&[0, 0, 0, 8]).expect("proceed to the next step"); hand_shake = hand_shake .try_step(&Vec::from(SSL_REQUEST_CODE)) .expect("proceed to the next step"); assert_eq!(hand_shake, State::SetupParsed(SetupParsed::Secur...
Rust
0
#!/usr/bin/env python # -*- coding:utf-8 -*- # author: heiseweiye # time: 2021/11/20 12:42 import torch import random from transformers import BertTokenizer, BertConfig, BertModel from transformers import BertForMaskedLM from torch.utils.data import Dataset from torch.utils.data import DataLoader from torch.nn.utils.r...
Python
1
plt.clf() # 取最后一个时间点,第2个特征(出口温度) pressure_pred = pred[:, -1, 1] plt.figure(figsize=(12, 10)) plt.plot(vis_origin_data[:, 1], label='true') plt.plot(pressure_pred, label='pred') if first_1 > -1: plt.axvline(x=first_1, linestyle='--', color='r') # plt.title(f'{file_no}. Change of outp...
Python
1
depth_embedding = torch.as_tensor(depth_embedding, dtype=torch.float, device=device) if len(box_torch.shape) == 2: box_torch = box_torch[:, None, :] # (B, 1, 4) # get prompt embeddings sparse_embeddings_box, dense_embeddings_box = sam_model.prompt_encoder( ...
Python
1
""" Attention Decorator Pattern. This module provides a decorator pattern for adding attention mechanisms to decoders while preserving their interface and behavior. """ from typing import override import torch from torch import nn from crackseg.model.base import DecoderBase class AttentionDecorator(DecoderBase): ...
Python
1
exactly equal to the size of that element, then the // value is taken to be `Nothing`. T::try_from_aligned_slice(&self.data).ok() } } impl<'a, T: Cast> From<&'a MaybeFixedSize<T>> for Option<&'a T> { fn from(m: &'a MaybeFixedSize<T>) -> Self { m.to_option() } } impl<T: Cast + Part...
Rust
0
, None, 4), ]; let product = ProductTable::new(); let (mut store, endpoint) = init_with_data(&product, &data); store.begin(); for &(id, name) in &[(8, b"name:5"), (9, b"name:6")] { store .insert_into(&product) .set(&product["id"], Datum::I64(id)) .set(&p...
Rust
0
import re st = "boat" res = re.match(r'b(oa|ai)t' , st) if res: print("Match found.....") print(res.group(0)) # matched string else: print("Match not found.....")
Python
1
from oscar.core.loading import get_model from rest_framework import serializers from ecommerce.core.constants import ISO_8601_FORMAT from ecommerce.extensions.api.serializers import BillingAddressSerializer, UserSerializer Order = get_model('order', 'Order') class MobileOrderSerializer(serializers.ModelSerializer):...
Python
1
.0 * I::modpow(&r, &ek.n, &ek.nn)) % &ek.nn; Ciphertext(d) } } impl<I, S> Encryption<EncryptionKey<I>, Plaintext<I>, Ciphertext<I>> for S where S: AbstractScheme<BigInteger = I>, S: Rerandomisation<EncryptionKey<I>, Ciphertext<I>>, I: One, for<'a, 'b> &'a I: Add<&'b I, Output = I>, for<...
Rust
0
peso = float(input("peso(kg): ")) altura = float(input("altura(m): ")) imc = round(peso / (altura**2),2) print("tu imc es: ",imc)
Python
1
ccur for the `UpdateDomain` operation. #[non_exhaustive] #[derive(std::fmt::Debug)] pub enum UpdateDomainErrorKind { /// <p>Resource being accessed is in use.</p> ResourceInUse(crate::error::ResourceInUse), /// <p> You have exceeded an Amazon SageMaker resource limit. For example, you might have too many ...
Rust
0
from typing import List class Solution: """ - Time Complexity: O(n), n = len(nums) - Space Complexity: O(N) - N = len(dic) = The number of unique numbers - Worst case, it would be n. => O(N) => O(n) """ def twoSum(self, nums: List[int], target: int) -> List[int]: ...
Python
1
#!/usr/bin/python3 import unittest import sys sys.path.append('../util') import iwd from iwd import IWD from iwd import PSKAgent from iwd import NetworkType from hostapd import HostapdCLI class Test(unittest.TestCase): def validate_connection(self, wd): networks = [] psk_agent = PSKAgent(["secr...
Python
1
me, item.values.iter().map(|v| format!("{} {} {}", float_to_string_general(v.x, 8), float_to_string_general(v.y, 8), float_to_string_general(v.z, 8))).collect::<Vec<String>>().join(" "))?; } for item in &self.strings { write!(f, "\"string {}\" [{}] ", item.name, ...
Rust
0
'unofficial' bench that works with Stable Rust as of 2018. This may conflict with "official" bench which is in "Nightly" Rust */ #[macro_use] extern crate bencher; extern crate earcutr; extern crate serde; extern crate serde_json; use bencher::Bencher; use std::fs::File; use std::fs::OpenOptions; use std::io::Read; us...
Rust
0
"processed" : str(processed_gpt4ss) } }, "factual verification":{ "gpt3-5-fv": { "original" : og_gpt3fv, "processed" : processed_gpt3fv }, "gpt4-fv": { "original" : og_gpt4fv, ...
Python
1
unwrap(); println!("JsonResult: {:?}", r); } #[test] fn test_list_sf_nodes() { use std::fs::File; use std::io::Read; let mut f = File::open("tests/solidfire/list_active_nodes.json").unwrap(); let mut buff = String::new(); f.read_to_string(&mut buff).unwrap(); let r: JsonResult<Nodes> = se...
Rust
0
import torch import triton import triton.language as tl @triton.jit def _seeded_dropout(x_ptr, output_ptr, n_elements, p, seed, BLOCK_SIZE: tl.constexpr): pid = tl.program_id(axis=0) block_start = pid * BLOCK_SIZE * 4 offset = block_start + tl.arange(0, BLOCK_SIZE) r0, r1, r2, r3 = tl.random.rand...
Python
1
&'static str], pub type_id: TypeId, pub setter: fn(&str) -> Result<*const (), FromStrError>, pub getter: unsafe fn(*const ()) -> String, pub ptr: AtomicPtr<()>, } impl Field { pub fn new<T: GVar>( unique_name: &'static str, aliases: &'static [&'static str], init: &'static T,...
Rust
0
array([[1, 3], [2, 3]]) """ M = self._order normalized = np.asarray(received, dtype=float) / self._delta indices = np.round(normalized + (M - 1) / 2).astype(int) indices = np.clip(indices, 0, M - 1) return indices def closest_symbols(sel...
Python
1
const RANK7_BB: Bitboard = Bitboard { p: [0x0040_2010_0804_0201 << 6, 0x201 << 6], }; const RANK8_BB: Bitboard = Bitboard { p: [0x0040_2010_0804_0201 << 7, 0x201 << 7], }; const RANK9_BB: Bitboard = Bitboard { p: [0x0040_2010_0804_0201 << 8, 0x201 << 8], }; const RANK_BB: [Bitboard; 9] = [ RANK1_BB, RA...
Rust
0
print( "and cocode product A(a,b,.) is not zero" ) null = [0]*6 for a in iter_hexacode(): for b in iter_hexacode(): c = cocode_product(a,b) if c != null: try: assert hermite4(a,b) != null, (a,b,c, hermite4(a,b) ) except: ...
Python
1
solution.denominator; if (0.0..=1.0).contains(&parameter) { return parameter; } } 0.0 }) .collect::<Vec<f32>>() }}; } macro_rules! cubic_uniform_tangent_angle { ($power_basis:expr, $angle_ste...
Rust
0
atchups: {len(matchups)}, Games per matchup: {args.games}, Total games: {total_games}") game_count = 0 for p1, p2 in matchups: for i in range(args.games): game_count += 1 # Alternate who plays black black_player = p1 if i % 2 == 0 else p2 white_player = p...
Python
1
# See linux/include/uapi/asm-generic/ioctl.h import struct _IOC_NRBITS = 8 _IOC_TYPEBITS = 8 # According to linux these *may* be architecture specific _IOC_SIZEBITS = 14 _IOC_DIRBITS = 2 _IOC_NRMASK = (1 << _IOC_NRBITS) - 1 _IOC_TYPEMASK = (1 << _IOC_TYPEBITS) - 1 _IOC_SIZEMASK = (1 << _IOC_SIZEBITS) - 1 _IOC_DIRMA...
Python
1
ド cmd_str.append('\r') # CR cmd_str.append('\n') # LF ############################################################## # 受信 ############################################################## recv_...
Python
1
para o neurônio {i+1} após a atualização: {W_hidden[j][i]:.4f}" ) # Definir entradas e pesos manualmente input_data = np.array([1, 1]) # Definindo manualmente as entradas W_hidden = np.array( [[-0.424, -0.743, -0.961], [0.358, -0.581, -0.468]] ) # Pesos para a camada oculta W_output = np.array( ...
Python
1
![ uz * ux * (one - ca) - uy * sa, uz * uy * (one - ca) + ux * sa, ca + uz * uz * (one - ca), ], ]; let mut result = Vec3d::<T>::new(T::zero(), T::zero(), T::zero()); for i in 0..3 { for j in 0..3 { result[i...
Rust
0
#[allow(deprecated)] use Configuration; use ThreadPoolBuilder; #[test] #[should_panic(expected = "Hello, world!")] fn panic_propagate() { let thread_pool = ThreadPoolBuilder::new().build().unwrap(); thread_pool.install(|| { panic!("Hello, world!"); }); } #[test] fn workers_stop() { let regist...
Rust
0
import unittest class TestPowerSet(unittest.TestCase): def test_power_set(self): input_set = '' expected = [''] self.run_test(input_set, expected) input_set = 'a' expected = ['a', ''] self.run_test(input_set, expected) input_set = 'ab' expected = ['...
Python
1
('√') { let w = new_word.word_header.word.trim_start_matches('√').to_string(); new_word.word_header.inflections.push(a); new_word.word_header.word = w; } // Remove the root sign from `grammar_roots`. for w in new_word.word_header.grammar_roots.iter_mut() { ...
Rust
0
f, _date: Date) -> Date { Date::default() } pub fn add_holiday(&self, _date: Date) {} pub fn remove_holiday(&self, _date: Date) {} pub fn adjust(&self, _date: Date) -> Date { Date::default() } pub fn adjust_with_convention(&self, _date: Date, _convention: BusinessDayConvention)...
Rust
0
from .base import * DEBUG = True HOST = "http://localhost:8000" SECRET_KEY = "secret" # noqa: S105 STATIC_ROOT = base_dir_join("staticfiles") STATIC_URL = "/static/" MEDIA_ROOT = base_dir_join("mediafiles") MEDIA_URL = "/media/" STORAGES = { "default": { "BACKEND": "django.core.files.storage.FileSys...
Python
1
from modules import ModulesManager MainModule: ModulesManager = ModulesManager("main") MainModule.connect("modules.main", "start")
Python
1
register GPIO_FUNC10_OUT_SEL_CFG"] pub type W = crate::W<u32, super::GPIO_FUNC10_OUT_SEL_CFG>; #[doc = "Register GPIO_FUNC10_OUT_SEL_CFG `reset()`'s with value 0"] impl crate::ResetValue for super::GPIO_FUNC10_OUT_SEL_CFG { type Type = u32; #[inline(always)] fn reset_value() -> Self::Type { 0 }...
Rust
0
fn get_cached_size(&self) -> u32 { self.cached_size.get() } fn get_unknown_fields(&self) -> &::protobuf::UnknownFields { &self.unknown_fields } fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { &mut self.unknown_fields } fn as_any(&self) -> &dyn ...
Rust
0
oint", "vpnEndpoint"], "schema_version": "1.0.0" }"#; #[test] fn parse_os_config_v1() { let parsed: OsConfigSchema = serde_json::from_str(JSON_DATA).unwrap(); let expected = OsConfigSchema { services: vec![ Service { id: "openvpn".int...
Rust
0
import pytest @pytest.fixture() # This set of wallet words corresponds to a 256-bit entropy value with all zeros def zero_wallet_words(): return 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon a...
Python
1
rti', 'kgp': 'Nãrti-Mỹrijỹnỹ Goj-vẽso', 'khq': 'Mariana Gurma Gungey', 'ki': 'Visiwa vya Mariana vya Kaskazini', 'kk': 'Солтүстік Мариана аралдары', 'kln': 'Ikwembeiyotab Mariana nebo murot katam', 'km': 'កោះ\u200bម៉ារីណា\u200bខាង\u200bជើង', 'kn': 'ಉತ್ತರ ಮರಿಯಾನಾ ದ್ವೀಪಗಳು', 'ko': '북마리아나제도', 'kok': 'उत्तरी मरिना आयसलैण्ड...
Python
1
recv_mpst_d_from_h(s)?; let s = send_mpst_d_to_h((), s)?; let (_, s) = recv_mpst_d_from_i(s)?; let s = send_mpst_d_to_i((), s)?; let (_, s) = recv_mpst_d_from_j(s)?; let s = send_mpst_d_to_j((), s)?; endpoint_d(s) }, }) } fn endpoint_...
Rust
0
let mut out_register: DataType = op_and(shifted_in_register, mask); // We consumed our current quadruplets entirely. // We therefore read another one. if inner_capacity <= NUM_BITS && i != 31 { ...
Rust
0
: if 'channel' in message: channel = await self.api_call( 'conversations.info', {'channel': message['channel']} ) message['channel'] = channel['channel']['name'] ...
Python
1
name=merge_key, bead_annotation_name=obs_index_key, min_reads=min_counts) elif mode == 'denoise' or mode == 'bulk': if mode == 'bulk': mapping = 'bulk' mdata = reconstruct_expression(adata, annotation, profiles, mapping, min_counts=min_counts, rounded=(seed is not ...
Python
1
_time / n_simulations return avg_failures, avg_time def mttf(self, n_simulations=1000): total_time_to_failure = 0 for _ in range(n_simulations): self.places = {"W1": 1, "W2": 0, "F1": 0, "F2": 0, "S2": 1, "F": 0} time_to_failure, _ = self.simulate() tota...
Python
1
1676497.5, time::CalType::Julian), TestDate(-1000, time::Month::July, 12.5, 1356001.0, time::CalType::Julian), TestDate(-1000, time::Month::Feb, 29.0, 1355866.5, time::CalType::Julian), TestDate(-1001, time::Month::Aug, 17.9, 1355671.4, time::CalType::Julian), TestDate(-4712, ti...
Rust
0
class Solution: def matchPlayersAndTrainers(self, players: List[int], trainers: List[int]) -> int: players.sort() trainers.sort() i = j = count = 0 while i < len(players) and j < len(trainers): if players[i] <= trainers[j]: i += 1 count += ...
Python
1
if slug not in _report_status: raise ValueError(f"slug {slug} not found in report status") # enumの値を文字列に変換して保存 _report_status[slug]["visibility"] = new_visibility.value save_status() invalidate_report_cache(slug) return _report_status[slug]["visibility"] def updat...
Python
1
rm_step + x_sorted[0] - margin ) grid = self.grid_eps * grid_uniform + (1 - self.grid_eps) * grid_adaptive grid = torch.cat( [ grid[:1] - uniform_step * torch.arange(self.spline_order, 0, -1, device=x.device).un...
Python
1
,Default)] #[cfg_attr(feature = "with-serde", derive(Serialize, Deserialize))] pub struct CDeviceAuth_AcceptAuthorizationRequest_Response { // special fields #[cfg_attr(feature = "with-serde", serde(skip))] pub unknown_fields: ::protobuf::UnknownFields, #[cfg_attr(feature = "with-serde", serde(skip))] ...
Rust
0
plate_name): with BatchedObservations(data, name=self._data_plate_name): model_trace, guide_trace = get_nmc_traces(*args, **kwargs) index_plates = get_index_plates() plate_name_to_dim = collections.OrderedDict( (p, index_plates[p]) for p in [self._mc_...
Python
1
[ ("test-topic", '{"state":"val1"}', '{"state":"val2"}'), ( "test-topic", '{"last_reset":"2023-09-15 15:11:03"}', '{"last_reset":"2023-09-16 15:11:02"}', ), ("availability-topic", "online", "offline"), ("json-attributes-topic", '{"attr1": "val...
Python
1
books = input().split("&") while True: command = input() if command == "Done": break split_command = command.split(" | ") action = split_command[0] if action == "Add Book": book = split_command[1] if book not in books: books.insert(0, book) elif action == "...
Python
1
print(10>9) return True
Python
1
= fork.get_proof_list::<_, u8>("name"); /// /// for val in index.iter() { /// println!("{}", val); /// } /// ``` pub fn iter(&self) -> ProofListIndexIter<'_, V> { ProofListIndexIter { base_iter: self.base.iter(&0_u8), } } /// Returns an iterator over the...
Rust
0
exceeded max safe integer value")); } // 2. Perform ? CreateDataPropertyOrThrow(target, targetIndex, element) target.create_data_property_or_throw(target_index, element, context)?; // 3. Set targetIndex to targetIndex + 1 ...
Rust
0
addresses, if not already page-aligned, will /// be rounded down and up (respectively) to align them to page boundaries. pub fn allocate_at(start: usize, end: usize) -> Result<usize, AllocationError> { KERNEL_VMA.lock().allocate_at(start, end) } /// Deallocate virtual memory pages from the kernel heap. /// /// Th...
Rust
0
yncWrite + Unpin, { if stream.write_all(message).await.is_err() { return false; } if stream.flush().await.is_err() { return false; } true } // Copyright 2013 The color-rs developers. For a full listing of the authors, // refer to the AUTHORS file at the top-level directory of this ...
Rust
0
= bytes.len() - len; if show_ascii { Visible::BytesAscii(&bytes[offset..]) } else { Visible::Bytes(&bytes[offset..]) } } fn take_str_head_tail(bytes: &[u8], width: usize, cjk: bool) -> Visible<'_> { let iter = UnitIter::new_char(bytes, cjk); if let Ok((start, end)) = take_head_tail...
Rust
0
from odoo import fields, models class ResCompany(models.Model): _inherit = 'res.company' extract_bank_statement_digitalization_mode = fields.Selection( selection=[ ('no_send', "Do not digitize"), ('auto_send', "Digitize automatically"), ], string="Digitization ...
Python
1
{ use std::char; pub static UTF8_1BYTE_FOLLOWING: u8 = 0b11000000; pub static UTF8_2BYTE_FOLLOWING: u8 = 0b11100000; pub static UTF8_3BYTE_FOLLOWING: u8 = 0b11110000; pub fn readCodepoint( input: &[u8] ) -> Option< char > { fn isContinuationByte( byte: u8 ) -> bool { byte & 0b1100000...
Rust
0
"<lazyllm-query>", followed by the serialized dictionary. The key `files` in the dictionary stores a list, with elements being the paths of the generated audio files. - Supported models: [bark](https://huggingface.co/suno/bark) ''') add_chinese_doc('BarkDeploy', '''\ Bark 模型部署类。该类用于将Bark模型部署到指定服务器上,以便可以通过网络进行调用。 ...
Python
1
impl_conversion!(ICtCpPQ to CieXYZ => ICtCp_PQ_to_RGB, BT_2020_D65_TO_CIE_XYZ_D65, None); impl_conversion!(ICtCpPQ to Bt2020 => ICtCp_PQ_to_RGB, None, None); impl_conversion!(ICtCpPQ to Oklab => ICtCp_PQ_to_RGB, BT_2020_D65_TO_CIE_XYZ_D65, XYZ_to_Oklab); impl_conversion!(ICtCpPQ to Ok...
Rust
0
# NOME DO CANDIDATO: [O candidato deve preencher aqui] # CURSO DO CANDIDATO: [Curso] # AREAS DE INTERESSE: [Digite Aqui] # Você pode importar as bibliotecas que julgar necessárias. def encontrar_caminho(pos_inicial, pos_objetivo, obstaculos, largura_grid, altura_grid, tem_bola=False): """ Esta é a função prin...
Python
1
countries = ('Russia', 'Argentina', 'Slovakia', 'Canada', 'Slovenia', 'Italy', 'Spain', 'Ukraine', 'Chile', 'Cameroon') print(countries[:-3])
Python
1
fn bundle( &self, resources: &UnifiedResources, parameters: &[Parameters], bullet_type: BulletTypeId, bundles: &mut Vec<Self::Bundled>, ) -> Result<()> { let tmp = resources.fetch_one::<TestResource>()?; let test_resource = &mut tmp.borrow_mut(); let ...
Rust
0
"""Chain that makes API calls and summarizes the responses to answer a question."""
Python
1