text
string
label_name
string
labels
int64
.len() { if sub_bonds[j] == 0 { continue } // Allows "R" to act as H atom, meaning nothing - which means no maj_bonds apart from 0 let mut should_check_maj_bonds = false; let mut cntr = 0; if sub_mol.atoms[j] == "R" { should_check_maj_bond...
Rust
0
tr.move_to_pos_chars(p) self.assertEqual( tr.peek_token(parsing_state=ps_mm('$')), LatexToken(tok='mathmode_inline', arg='$', pos=p, pos_end=p+1, pre_space='') ) p = 10 tr.move_to_pos_chars(p) self.assertEqual( tr.peek_token(parsing_sta...
Python
1
rn Ok(true); } } previous.insert((t_1, v_1)); } } } Ok(false) } } <filename>src/standard_box/mod.rs //! Systems, components, helpers and a plugin for the StandardBox state. //! //! The StandardBox state all...
Rust
0
class Solution: def maxSizeSlices(self, slices: List[int]) -> int: # dp(i, j, k) := max sum of slices if you can pick k slices from slices[i:j] @functools.lru_cache(None) def dp(i: int, j: int, k: int) -> int: if k == 1: return max(slices[i:j]) # Note that j - i is not the number of al...
Python
1
ombined injected simultaneous + fast interleaved mode InjecSimultFastInterl, /// Combined injected simultaneous + slow interleaved mode InjecSimultSlowInterl, /// Injected simultaneous mode only InjecSimult, /// Regular simultaneous mode only RegSimult, /// Fast interleaved mode only ...
Rust
0
TRIGGERS = {'ассистент', 'ассистент'} data_set = { 'вызвать нейро': 'neuro_answer', 'открой ютуб': 'browser запускаю браузер', 'интернет открой': 'browser открываю браузер', 'посмотреть фильм': 'browser сейчас открою браузер', 'обнови страницу': 'update_web страница обновлена', 'зайди в курсы': 'eKurs попытка регист...
Python
1
# GENERATED BY KOMAND SDK - DO NOT EDIT import insightconnect_plugin_runtime import json class Component: DESCRIPTION = "Gets a list of all groups a device is member of" class Input: ID = "ID" class Output: DEVICE_GROUPS = "device_groups" class GetDeviceGroupsInput(insightconnect_plugin_runt...
Python
1
#!/usr/bin/env python # # __COPYRIGHT__ # # 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 restriction, including # without limitation the rights to use, copy, modify, merge, publish, ...
Python
1
G_MSGS["node_fail"].format(error=e)) return False # 使用node執行server.js cmd = ["node", server_path] logger.info(LOG_MSGS["run_cmd"].format(cmd=" ".join(cmd))) if debug: # 在調試模式下,直接在前台運行,顯示所有輸出 process = subprocess.run(cmd, check=True) retur...
Python
1
aserde(child)] addressoffset: String, #[yaserde(child)] size: u8, #[yaserde(child)] access: String, #[yaserde(child)] resetvalue: String, #[yaserde(child)] resetmask: String, #[yaserde(child)] fields: Vec<Field>, } #[derive(Default, PartialEq, Debug, YaSerialize)] struct Peripheral { #[yaserde(...
Rust
0
int((annotation['stopTime'] - annotation['startTime']).total_seconds()) filteredAnnotatorUser = User().filterSummary(annotatorUser, currentUser) annotatorUserName = filteredAnnotatorUser['name'] if 'login' in filteredAnnotatorUser: anno...
Python
1
, Self::Error> { let profiles = Profiles::read_as_ini(&file)?; file.seek(SeekFrom::Start(0))?; Ok(CredentialsStore { file, profiles }) } } #[derive(Serialize, Deserialize, Debug, PartialEq)] #[serde(untagged)] pub enum ProfileCredentials { Sts { #[serde(rename = "aws_access_key_...
Rust
0
/// Calculus operators > /// differentiation (D), integration (L) /// fn load_calculus(&mut self, vm: &mut Interpreter) -> Result<(), LangError> { // ```D(x, ...) = ∂x / ∂ ... ∂``` vm.bind_function("D", |mut arg| { Ok(arg.remove(0).derivative(arg)) //. }); // ```L(x, ...) = ∫ ... ∫x d v``` ...
Rust
0
er, subelement, use_ns): if not matched_elements.get(other, False): matched_elements[other] = True matched = True if not matched: return False else: if not self._mask_cmp(self....
Python
1
: Vec<u32> = Vec::new(); let mut boards: Vec<Board> = Vec::new(); load_data(&mut numbers_called, &mut boards, contents); for number_called in numbers_called { for board in boards.iter_mut() { if board.mark_called_number(number_called) { //println!("Winning board: {:?}"...
Rust
0
if sorted.len() == self.vertices.len() { Ok(sorted) } else { Err(self) } } /// Try to perform topological sort on the graph /// /// If the graph contains no cycles, finds the topological ordering of this /// graph using Kahn's algorithm and returns it as `Ok(...
Rust
0
pub result: ::core::option::Option<ResponseDeliverTx>, } //---------------------------------------- // Blockchain Types /// Validator #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { /// The first 20 bytes of SHA256(public key) #[prost(bytes="vec", tag="1")] pub address: ::prost::al...
Rust
0
gth, } => { let green = Duration::from_secs(no_of_nodes) * grace_coeff; let yellow = Duration::from_secs(no_of_nodes + longest_path_length) * grace_coeff; let red = Duration::from_secs(no_of_nodes + longest_path_length * 2) * grace_coeff; let t...
Rust
0
from EXPANSE import ResolvedGalaxy, ResolvedGalaxies from tqdm import tqdm galaxies = ResolvedGalaxies(ResolvedGalaxy.init_all_field_from_h5("JOF_psfmatched", n_jobs=6)) overwrite_ids = [] for galaxy in tqdm(galaxies): galaxy.add_psf_models( "/nvme/scratch/work/tharvey/EXPANSE/psfs/psf_models/star_stack/...
Python
1
mov_compare_add_subtract_imm!(thumb_sub_i8_r4, alu::arm_alu_subs, 4); mov_compare_add_subtract_imm!(thumb_sub_i8_r5, alu::arm_alu_subs, 5); mov_compare_add_subtract_imm!(thumb_sub_i8_r6, alu::arm_alu_subs, 6); mov_compare_add_subtract_imm!(thumb_sub_i8_r7, alu::arm_alu_subs, 7); pub fn thumb_dp_g1(cpu: &mut ArmCpu, m...
Rust
0
// instance count offset, // first vertex 0, // first instance ); offset += batch.vertices.len() as u32; } } } sel...
Rust
0
# /*==LICENSE==* # # CyanWorlds.com Engine - MMOG client, server and tools # Copyright (C) 2011 Cyan Worlds, Inc. # # This program 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 Licen...
Python
1
5b, 0x8b, 0x29, 0x6, 0x50, 0x53, 0x8, 0x1, 0xb1, 0x8e, 0xbf, 0xbf, 0x5e, 0x8f, 0xab, 0x3c, 0x82, 0x87, 0x2a, 0x3e, 0x9b, 0xb7, ]; /// Static large safe prime (`N`) value. /// The little endian version of [LARGE_SAFE_PRIME_BIG_ENDIAN]. /// This is the version that should be sent over the network in the /// [CMD_AUT...
Rust
0
rue) // 10 for start in range(0, len(y_true), chunk_size): reg_metrics.update(y_true[start : start + chunk_size], y_pred[start : start + chunk_size]) # Get metrics from our implementation metrics = reg_metrics.compute() # Compare with scikit-learn and scipy metrics assert np.isclose(metric...
Python
1
pos: hook_pos, vel: _, time_left: _, } => (*hook_pos, false), comn::Hook::Attached { target, offset } => { let hook_pos = interp_entity(state, next_entities, time, *target) .map_or(pos, |interp_target| interp_target.pos(time) + offset); ...
Rust
0
active(&self) -> bool { self.is_active } /// Makes the thrust attack inactive (unable to hit a character). pub fn deactivate(&mut self) { self.is_active = false; } /// Decrements and then returns the number of frames left before the effect /// has worn off. #[must_use] pub fn tick(&mut self) -> u32 { se...
Rust
0
"76": (2,12), "77": (2,13), "74": (2,10), "75": (2,11), "72": (2,8), "73": (2,9), "70": (2,6), "71": (2,7) } def read(sensor, pin): # Validate GPIO and map it to GPIO base and number. gpio = pin_to_gpio.get(str(pin).upper(), None) if gpio is None: # Couldn't find in ...
Python
1
# takenlijst.py import os # Functie om de takenlijst op te slaan in een bestand def sla_taken_op(taken): with open('takenlijst.txt', 'w') as bestand: for taak in taken: bestand.write(taak + '\n') # Functie om de takenlijst uit een bestand te lezen def lees_taken(): if os.path.exists('take...
Python
1
an': 1, 'konum': (5, 11)}, 'Ö': {'element': 'Cd', 'orbital': '4d10 5s2', 'son_katman': 2, 'konum': (5, 12)}, 'P': {'element': 'In', 'orbital': '4d10 5s2 5p1', 'son_katman': 3, 'konum': (5, 13)}, 'R': {'element': 'Sn', 'orbital': '4d10 5s2 5p2', 'son_katman': 4, 'konum': (5, 14)}, 'S': {'element': 'Sb', ...
Python
1
s, (int)fil) * dark-> moinitor dark value. * emi-> moinitor emission shift value. * a1-> moinitor anode1 value. * a2-> moinitor anode2 value. * bias-> moinitor bias value. * fil-> moinitor filament value. """ return self.__monior ...
Python
1
# coding: utf-8 from django.conf import settings from django.db import connection from onadata.libs.utils.common_tags import SUBMISSION_TIME def _count_group(field, name, xform): if using_postgres: result = _postgres_count_group(field, name, xform) else: raise Exception("Unsupported Database"...
Python
1
from django.apps import AppConfig from django.utils.translation import gettext_lazy as _ class WagtailUsersAppConfig(AppConfig): name = "wagtail.users" label = "wagtailusers" verbose_name = _("Wagtail users") default_auto_field = "django.db.models.AutoField" group_viewset = "wagtail.users.views.gr...
Python
1
::RangeInclusive<Self>> for $typ { fn dummy_with_rng<R: Rng + ?Sized>( range: &ops::RangeInclusive<Self>, rng: &mut R, ) -> Self { let u = Uniform::new_inclusive(range.start(), range.end()); u.sample(rng) } } ...
Rust
0
] + cos_thetao * self.sin2k_alpha[2]; cos_theta_op = cos_thetao * self.cos2k_alpha[2] - sin_thetao * self.sin2k_alpha[2]; } else { sin_theta_op = sin_thetao; cos_theta_op = cos_thetao; } // Sample M_p to compute thetai u[1][0] = (u[1][0]).max(1.0e-5);...
Rust
0
<Box<Counter>, PrometheusError> { let opts = Opts::new(name, help).const_labels(const_labels); let counter = Box::new(Counter::with_opts(opts)?); Ok(counter) } fn global_counter( &self, name: String, help: String, const_labels: HashMap<String, String>, ...
Rust
0
from GalTransl.CSentense import CSentense from GalTransl.GTPlugin import GTextPlugin class text_common_normalfix(GTextPlugin): def before_src_processed(self, tran: CSentense) -> CSentense: while True: if tran.post_jp.startswith(" "): tran.post_jp = tran.post_jp[1:] ...
Python
1
trend_mds_overall - avg_source_ts_of_data_in_trend_overall) python_internal_processing_delay_ms = python_alert_emission_time_ms - current_mdf_trigger_timestamp_ms alert_payload = { "thingId": thingid, "alertTriggerTimestamp": current_mdf_trigger_timestamp_ms, ...
Python
1
eDepth; #[test] fn test_shl_shr() { let mut csprng: OsRng = OsRng::new().unwrap(); for _ in 0..100 { let r: Scalar = Scalar::random(&mut csprng); let mut b_arr = ScalarBits::from_scalar(&r, TreeDepth); assert_eq!(r, b_arr.to_scalar()); //assert_eq...
Rust
0
# 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"); you may not u...
Python
1
any(|key| !key.is_null() && map.iter().any(|(k, _v)| k == key.unwrap_str())) .into() } fn map_contains_map<'a>(a: Datum<'a>, b: Datum<'a>) -> Datum<'a> { let map_a = a.unwrap_map(); b.unwrap_map() .iter() .all(|(b_key, b_val)| { map_a .iter() ...
Rust
0
def quicksort(array): if len(array) < 2: return array pivot = array[0] # Pivot less = [x for x in array[1:] if x <= pivot] greater = [x for x in array[1:] if x > pivot] # recursively sort the sub-arrays return quicksort(less) + [pivot] + quicksort(greater) nList = [5, 65, 29, 100,...
Python
1
import _plotly_utils.basevalidators class LineValidator(_plotly_utils.basevalidators.CompoundValidator): def __init__(self, plotly_name="line", parent_name="sankey.node", **kwargs): super(LineValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, d...
Python
1
: u8 = LOAD_PRESET_RES_LEN!(); // ----- // ----- // Clear a numbered preset. // // NOTE: It doesn't work. The spec must be wrong. macro_rules! SET_CLEAR_PRESET_COMMAND { () => { "72" }; } pub const SET_CLEAR_PRESET_COMMAND: &'static str = SET_CLEAR_PRESET_COMMAND!(); // command example: // clear preset 5: // ":...
Rust
0
font with a hashmap of characters to textures, and a default //! texture to use if a character does not exist in the mapping. use super::{Renderer, Target, Transform}; use std::collections::HashMap; pub struct Font<R: Renderer> { mapping: HashMap<char, R::Texture>, default: R::Texture, } impl<R: Renderer> F...
Rust
0
个字典,键是度数,值是拥有该度数的节点数量。 """ degrees = [d for n, d in graph.degree()] return Counter(degrees) def opinion_variance(opinions: np.ndarray) -> float: """ 计算观点分布的方差。 方差越小,共识程度越高。 Args: opinions (np.ndarray): 观点数组。 Returns: float: 观点的方差。 """ return np.var(...
Python
1
from deref-ed vec. assert_eq!(bounded.len(), 3); assert!(bounded.iter().next().is_some()); assert!(!bounded.is_empty()); } #[test] fn try_mutate_works() { let bounded = boundedmap_from_keys::<u32, Seven>(&[1, 2, 3, 4, 5, 6]); let bounded = bounded .try_mutate(|v| { v.insert(7); }) .unwrap();...
Rust
0
model_names.append("base_model") except Exception as e: print(f"❌ Failed to evaluate base model: {e}") # 2. Evaluate base model + runtime adapters if Path(args.adapters_path).exists(): print("\n🔸 Step 2: Evaluating Base Model + Runtime LoRA Adapters")...
Python
1
Matrix2), "::", stringify!(real) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<ComplexMatrix2>())).imag as *const _ as usize }, 32usize, concat!( "Offset of field: ", stringify!(ComplexMatrix2), "::", stri...
Rust
0
#!/usr/bin/env python """ Copyright (c) 2019-2021 Miroslav Stampar (@stamparm), MIT See the file 'LICENSE' for copying permission The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. """ from __future__ import print_function import base64 imp...
Python
1
> From<TryPile<'p, 'v>> for Pile<'p,'v> { #[inline(always)] fn from(trypile: TryPile<'p,'v>) -> Self { Self(trypile) } } impl<'p, 'v> From<Pile<'p, 'v>> for TryPile<'p,'v> { #[inline(always)] fn from(pile: Pile<'p,'v>) -> Self { pile.0 } } impl<'p,'v> ops::Deref for Pile<'p,'v...
Rust
0
match dp { Direction::Right => x == self.codels.iter().map(|Point(x, _)| x).max().unwrap(), Direction::Down => y == self.codels.iter().map(|Point(_, y)| y).max().unwrap(), Direction::Left => x == self.codels.iter().map(|Point(x, _)| x).min().unwrap(), Dire...
Rust
0
/// Clamp a to [0, 255] fn clamp(a: i32) -> i32 { if a < 0 { 0 } else if a > 255 { 255 } else { a } } /// Clamp add subtract full on one part fn clamp_add_subtract_full_sub(a: i32, b: i32, c: i32) -> i32 { clamp(a + b - c) } /// Clamp add subtract half on one part fn clamp...
Rust
0
der -> machines_battleships_unions' return global eblao5c9t6n on9zsmdvp3x pass i3fca927x9j: False = m48t4jd_yzt def uegg1f4n2z3(q7n9d659wc1, btb_2bsad5s: e3wgtw7u51o, s6jzzgiyk2o: er1dmf52_q7, n2vwdch_gnn, qoikqdnpech: pokzfv0fa73, k8hf5m_7ndz, f18a888hjvx: e5_ycxlrolt, hh2k0qtftqk, l_1oxt6txh4: lhy...
Python
1
); r.set_adc2en(true); r.set_adc3en(true); }); // enable all gpio ports rcc.ahb1enr.update(|r| { r.set_gpioaen(true); r.set_gpioben(true); r.set_gpiocen(true); r.set_gpioden(true); r.set_gpioeen(true); r.set_gpiofen(true); r.set_gpioge...
Rust
0
_ => Err(CustomError::CommandNotFound(path)), } { Ok(_) => {} Err(e) => { command .create_interaction_response(&ctx.http, |response| { response .kind(InteractionResponseType::ChannelMessageW...
Rust
0
class Solution: def maxEnvelopes(self, envelopes: List[List[int]]) -> int: envelopes = sorted(envelopes,key = lambda x: x[1],reverse = True) envelopes = sorted(envelopes,key = lambda x: x[0]) # current = envelopes[0][0] dp = [envelopes[0][1]] for env in envelopes[1:]: ...
Python
1
response_msg_list = [] for response_part in re.split(r'\\n\\n|\n\n', full_answer): response_part = response_part.replace('\\n', '\n') if response_part and response_part != "#沉默#": # 忽略沉默 response_msg_list.append(response_part) return response_msg_list # 定义 DAG with DAG( dag...
Python
1
_count = 0; for elem in graph_nodes.iter() { edge_count += elem.neighbors.len(); } let operation_type = format!("[{} Thread(s)]", thread_count).yellow().bold(); let mut timing_format = format!("{} ms", start.to(end).num_milliseconds()); if start.to(end).num_milliseconds() > prev_timing { ...
Rust
0
f"signal_duration_max={dataset_metadata.signal_duration_max}," f"signal_bandwidth_min={dataset_metadata.signal_bandwidth_min}," f"signal_bandwidth_max={dataset_metadata.signal_bandwidth_max}," f"signal_center_freq_min={dataset_metadata.signal_center_freq_min}," ...
Python
1
from unittest.mock import ( mock_open, patch, ) import pytest import requests from homebrew_releaser.constants import GITHUB_HEADERS from homebrew_releaser.utils import Utils @patch('requests.get') def test_make_github_get_request(mock_request): url = 'https://api.github.com/repos/Justintime50/homebrew-...
Python
1
_FROUND_TO_POS_INF |_MM_FROUND_NO_EXC) // round up, and suppress exceptions /// (_MM_FROUND_TO_ZERO |_MM_FROUND_NO_EXC) // truncate, and suppress exceptions /// _MM_FROUND_CUR_DIRECTION // use MXCSR.RC; see _MM_SET_ROUNDING_MODE /// /// [Intel's documentation](https://software.intel.com/sites/landingpa...
Rust
0
import hw_nixie as n from time import sleep, monotonic import random last_divergence = "0.000000" def display(divergence): if "." not in divergence: n.set_dot(None, "R") for tube in range(1, 9): value = divergence[tube - 1] if value == ".": n.set_dot(tube, "R") ...
Python
1
d: d, e: e, }) } } impl MojomEncodable for StructH { impl_encodable_for_pointer!(); fn compute_size(&self, context: Context) -> usize { encoding::align_default(self.serialized_size(&context)) + self.a.compute_size(context.clone()) + self.b.compute_size(context...
Rust
0
s[AA].split(k, nparts=cfg["tile_x"].size[1]) s[AA].reorder(ty, tx, yi, ki) s[AA].bind(ty, thread_y) s[AA].bind(tx, thread_x) s[AA].pragma(yi, "auto_unroll_max_step", cfg["auto_unroll_max_step"].val) s[AA].pragma(yi, "unroll_explicit", cfg["unroll_explicit"].val) _, x, k...
Python
1
}) } /// Submit the commands made through this context to the GPU. pub fn submit(self) { self.queue.submit(Some(self.encoder.finish())); } } mod constants; use std::str; use std::error::Error; use std::net::SocketAddr; use std::{env, io}; use tokio::net::UdpSocket; struct Server { socket...
Rust
0
start" => Ok(StringToken::RubyTextStart), "ruby-text-end" | "rubytextend" => Ok(StringToken::RubyTextEnd), "ruby-center-per-char" => Ok(StringToken::RubyCenterPerChar), "parallel" => Ok(StringToken::Parallel), "center" => Ok(StringToken::Center), "margin" => m...
Rust
0
import pandas as pd import matplotlib.pyplot as plt import numpy as np import os import time def gen_MMVET(csv, base_csv, base_model_name): # 读取 CSV 文件 data = pd.read_csv(csv) base_data = pd.read_csv(base_csv) # 提取数据 categories = list(data.iloc[:, 0]) # 提取第一列数据,作为类别 values = data.iloc[:, 2].a...
Python
1
ame::from_bytes(bbytes); let c = $tname::from_bytes(cbytes); match a.modinv(&b) { None => assert!(false), Some(myc) => { assert_eq!(c, myc); } } }); }; } #[cfg(test)] macro_rules! generate_smodinv_...
Rust
0
u8 = 0x03; pub const LIBUSB_REQUEST_SET_ADDRESS: u8 = 0x05; pub const LIBUSB_REQUEST_GET_DESCRIPTOR: u8 = 0x06; pub const LIBUSB_REQUEST_SET_DESCRIPTOR: u8 = 0x07; pub const LIBUSB_REQUEST_GET_CONFIGURATION: u8 = 0x08; pub const LIBUSB_REQUEST_SET_CONFIGURATION: u8 = 0x09; pub const LIBUSB_REQUEST_GET_INTER...
Rust
0
s2) total_logprob2.extend(logprob2.cpu().numpy()) total_sumlogprob2.extend(sum_logprob2.cpu().numpy()) total_reference_response.extend(data["reference_response"]) if args.num_samples is not None and len(total_decode_queries) * accelerator.num_processes >=...
Python
1
let state = &self.state.read().await; if state.broadcasting_software.current_scene == switch_scene { return Ok(()); } if !state .switcher_state .switchable_scenes .contains(&state.broadcasting_software.current_scene) { r...
Rust
0
(), "let z = [42]; x[z.len]")?, 2 ); assert_eq!( engine.eval_with_scope::<INT>(&mut scope.clone(), "let z = [2]; x[z[0]]")?, 3 ); } assert_eq!( engine.eval_with_scope::<Blob>(&mut scope.clone(), "x += x; x")?, [1, 2, 3, 1, 2, 3] );...
Rust
0
class NegativeAgeError(Exception): pass def set_age(age): if age<0 : raise NegativeAgeError("Age non valide") else: print(f"l age est :{age}") # try: # print(set_age(age)) # except NegativeAgeError as e: # print(e) print(set_age(5))
Python
1
= (NODES_PER_GROUP * 3 + 1); impl AbaCommonCoinAdversary { fn new<R: Rng>( netinfo_mutex: Arc<Mutex<Option<Arc<NetworkInfo<NodeId>>>>>, rng: &mut R, ) -> Self { Self::new_with_epoch(netinfo_mutex, 0, false, rng) } fn new_with_epoch<R: Rng>( netinfo_mutex: Arc<Mutex<Opt...
Rust
0
'GL_TRANSFORM_FEEDBACK', GLuint), ('GL_SAMPLER', GLsampler), ('GL_TEXTURE', GLtexture), ('GL_TEXTURE_1D', GLtexture), ('GL_TEXTURE_1D_ARRAY', GLtexture), ('GL_TEXTURE_2D', GLtexture), ('GL_TEXTURE_2D_MULTISAMPLE', GLtexture), ('GL_TEXTURE_2D_ARRAY', GLtexture), ...
Python
1
em_value(value) @cache_readonly def _isnan(self) -> npt.NDArray[np.bool_]: # error: Incompatible return value type (got "ExtensionArray", expected # "ndarray") return self._data.isna() # type: ignore[return-value] class NDArrayBackedExtensionIndex(ExtensionIndex): """ Index s...
Python
1
_, callback) in compute_cell.callbacks.iter_mut() { callback(new_val); } } } } } // Sets the value of the specified input cell. // // Returns false if the cell does not exist. // // Similarly, you may wonder about `...
Rust
0
orbit_counter = OrbitCounter::parse_from_string(input).unwrap(); assert_eq!(orbit_counter.count_orbits(), 42) } #[test] fn example_two() { let input_two = "\ COM)J J)K K)L COM)F"; let orbit_counter = OrbitCounter::parse_from_string(input_two).unwrap(); assert_eq!(orbit_c...
Rust
0
8, 1.1216, 1.2123, 1.303, 1.4019], normal_dmg6: [0.5762, 0.6231, 0.67, 0.737, 0.7839, 0.8375, 0.9112, 0.9849, 1.0586, 1.139, 1.2311, 1.3395, 1.4478, 1.5561, 1.6743], charged_dmg1: [0.4386, 0.4743, 0.51, 0.561, 0.5967, 0.6375, 0.6936, 0.7497, 0.8058, 0.867, 0.9282, 0.9894, 1.0506, 1.1118, 1.173], charged_dmg...
Rust
0
ANK6_BB, IN_FRONT_BLACK_RANK7_BB, IN_FRONT_BLACK_RANK8_BB, IN_FRONT_BLACK_RANK9_BB, ], [ IN_FRONT_WHITE_RANK1_BB, IN_FRONT_WHITE_RANK2_BB, IN_FRONT_WHITE_RANK3_BB, IN_FRONT_WHITE_RANK4_BB, IN_FRONT_WHITE_RANK5_BB, IN_FRONT_WHITE_RANK6_BB, ...
Rust
0
import logging from datetime import datetime from migration.base.exceptions import DestinationExecutionError from migration.scheduler.task.base_task import Task, TaskType, TaskStatus from migration.connector.destination.base import Destination import migration.util.migration_tasks_status as migration_tasks_status log...
Python
1
for ans, context in zip(answers, contexts): res.append(ans) content.append(ans) self.cache_hook.add_partial("generate_until", (context, gen_kwargs), ans) pbar.update(1) # reorder this group of results back to original unsorted form...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import tweepy, time, sys, json from datetime import datetime from coti import create_json, write_output, get_output from config import CONSUMER_KEY, CONSUMER_SECRET, ACCESS_KEY, ACCESS_SECRET client = tweepy.Client( consumer_key=CONSUMER_KEY, consumer_secret=CONSUMER_...
Python
1
_click) .with_callback_if("onkeydown", on_key_down) .with_callback_if("onkeypress", on_key_press) .with_callback_if("onkeyup", on_key_up) .with_callback_if("onblur", on_blur) .with_callback_if("onfocus", on_focus) .with_callback_if("oninput", on_in...
Rust
0
#!/usr/bin/env python import argparse import re def padfile(infile, outfile, fieldcnt=None): with open(infile, 'r') as fh: out = open(outfile, 'w') commentlines = [] tabs = '\t' * fieldcnt if fieldcnt is not None else None def pad_line(txtline, tabs=None): line = txtl...
Python
1
import discord from discord.ext import commands from config.settings import UPDATE_CHANNEL_ID, QUIZ_ROLE_ID class AnnounceCmd(commands.Cog): def __init__(self, bot): self.bot = bot @commands.command(name="annonce_nouveautes") async def annonce_nouveautes(self, ctx: commands.Context): if ct...
Python
1
from queue import PriorityQueue def heuristic(a, b): return abs(b[0] - a[0]) + abs(b[1] - a[1]) def get_neighbors(pos): x, y = pos directions = [(1, 0), (-1, 0), (0, 1), (0, -1)] result = [] for dx, dy in directions: nx, ny = x + dx, y + dy if nx >= 0 and nx < 3 and ny >= 0 and ny...
Python
1
# Problem: Number of Substrings Containing All Three Characters - https://leetcode.com/problems/number-of-substrings-containing-all-three-characters/description/ class Solution: def numberOfSubstrings(self, s: str) -> int: l, cntr= 0, 0 cnt_map = defaultdict(int) for r in range(le...
Python
1
LOCKBIT { #[doc = r"Returns a pointer to the register block"] #[inline(always)] pub const fn ptr() -> *const lockbit::RegisterBlock { 0 as *const _ } } impl Deref for LOCKBIT { type Target = lockbit::RegisterBlock; #[inline(always)] fn deref(&self) -> &Self::Target { unsafe ...
Rust
0
radius_attr::*; use nom::error::{make_error, ErrorKind}; use nom::Err; #[test] fn test_attribute_invalid() { let data = &[255, 0, 2, 2]; assert_eq!( parse_radius_attribute(data), Err(Err::Error(make_error(&data[1..], ErrorKind::Verify))) ); } #[t...
Rust
0
y) = self.start_date; let (end_m, end_y) = self.end_date; let mut result = String::from(r#"<div class="calendar">"#); let mut curr_month = start_m; let mut curr_year = start_y; loop { result.push_str(r#"<div class="month">"#); let month_calendar = self.b...
Rust
0
: PDXVAHDSW_GetVideoProcessorOutputFormats, GetVideoProcessorInputFormats: PDXVAHDSW_GetVideoProcessorInputFormats, GetVideoProcessorCaps: PDXVAHDSW_GetVideoProcessorCaps, GetVideoProcessorCustomRates: PDXVAHDSW_GetVideoProcessorCustomRates, GetVideoProcessorFilterRange: PDXVAHDSW_GetVideoProcessorFilte...
Rust
0
ero, }; pub type G2Affine = bls12::G2Affine<bls12_381::Parameters>; pub type G2Projective = bls12::G2Projective<bls12_381::Parameters>; #[derive(Clone, Default, PartialEq, Eq)] pub struct Parameters; impl ModelParameters for Parameters { type BaseField = Fq2; type ScalarField = Fr; } impl_scalar_mul_kernel_...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy_crud_plus import CRUDPlus from backend.app.admin.model import UserSocial from backend.app.admin.schema.user_social import CreateUserSocialParam from backend.common.enums import UserSocialType class CRUDOUse...
Python
1
n, ), ) OP_5F(0x0000) OP_56(0x00) FadeIn(300, 0) Switch( ( (Expr.PushReg, 0x0), Expr.Return, ), (0x00000000, 'loc_2934'), (-1, 'loc_296D'), ) def _loc_2934(): pass label('loc_2934') ChrTalk( 0x000E, ...
Python
1
: Lazy<MethodName> = lazy!(sn::members::__SET_STATE); pub static __sleep: Lazy<MethodName> = lazy!(sn::members::__SLEEP); pub static __toString: Lazy<MethodName> = lazy!(sn::members::__TO_STRING); pub static __unset: Lazy<MethodName> = lazy!(sn::members::__UNSET); pub static __wakeup: Lazy<MethodName> =...
Rust
0
e.key_offset(&k); check_offset(&node.keys, &k, offset, |o| o / SCALE); } } } } use tapyrus::blockdata::script::{Instruction::PushBytes, Script}; use crate::chain::Network; use crate::chain::{TxIn, TxOut}; pub struct InnerScripts { pub redeem_script: Option<Script>, pub ...
Rust
0
len() { for j in 0..filled[i].len() { if item_fits(filled, item, i as i64, j as i64) { return Some((i as i64, j as i64)); } } } None } use std::io; use std::vec::Vec; use std::collections::HashSet; fn main() { let mut line = String::new(); let mut sequence = Vec::new(); //...
Rust
0
import sqlite3 from sqlite3 import Error import sqlalchemy from sqlalchemy import Table, Column, String, MetaData, FLOAT from sqlalchemy import create_engine engine = create_engine('sqlite:///stations.db') meta = MetaData() stations = Table( 'stations', meta, Column('station', String, primary_key=True), Colum...
Python
1
e [ch13_ctrl](ch13_ctrl) module"] pub type CH13_CTRL = crate::Reg<u32, _CH13_CTRL>; #[allow(missing_docs)] #[doc(hidden)] pub struct _CH13_CTRL; #[doc = "`read()` method returns [ch13_ctrl::R](ch13_ctrl::R) reader structure"] impl crate::Readable for CH13_CTRL {} #[doc = "`write(|w| ..)` method takes [ch13_ctrl::W](ch1...
Rust
0