text
string
label_name
string
labels
int64
from dataclasses import dataclass from typing import Optional @dataclass class Sheet: worksheet_id: str sheet_name: str date_column: str rate_column: str rate_type: str currency_column: Optional[str] = None
Python
1
file_type_id = file_types.get(file_type, None) if file_type_id is None: print("Invalid file type", file_type_id) return None done = False chunk_size = 100 # Convert file data to a byte array if file_type == "JSON": file_encoded = serializ...
Python
1
for j in range(1, 11) for i in dims] df = df[columns] for i in dims: df[i + '_all'] = df.apply( lambda r: get_final_scores(columns=[r[i + str(j)] for j in range(1, 11)], dim=i), axis=1) for i in ['EXT', 'EST', 'AGR', 'CSN', '...
Python
1
?}", twin); client.set_dmi_handler(handle_direct_method, DeliveryGuarantees::AtMostOnce); client.set_c2d_handler(handle_c2d, DeliveryGuarantees::AtMostOnce); let mut last_telemetry_instant = Instant::now(); let tx_freq= Duration::from_secs(3); loop { if last_telemetry_instant.elapsed() > ...
Rust
0
impl PoolBuf { /// Create a new PoolBuf. pub fn new() -> Self { let inner = BUF_POOL.with(|p| { let mut p = p.borrow_mut(); if p.is_empty() { vec![0; POOL_BUF_PRE_WRITE_SPACE] } else { p.remove(0) } }); Self...
Rust
0
from scripts.transformer import Transformer def transform(): """ Main function to perform the transformation step. Calls the transformer class to perform the transformation. """ transformer = Transformer() concatenated_data = transformer.concatenate_csv_files("data/raw/") transformed_data = tr...
Python
1
method returns [dividend::R](dividend::R) reader structure"] impl crate::Readable for DIVIDEND {} #[doc = "`write(|w| ..)` method takes [dividend::W](dividend::W) writer structure"] impl crate::Writable for DIVIDEND {} #[doc = "Dividend"] pub mod dividend; #[doc = "Divisor\n\nThis register you can [`read`](crate::gene...
Rust
0
#coding:utf-8 ''' 如果你仔细观察那些指向词条页面(不是指向其他内容页面)的链接 会发现它们都有三个共同点: • 它们都在 id 是 bodyContent 的 div 标签里 • URL 链接不包含分号 • URL 链接都以 /wiki/ 开头 我们可以利用这些规则稍微调整一下代码来获取词条链接: ''' from urllib.request import urlopen from urllib.error import HTTPError from bs4 import BeautifulSoup import re try: html = urlopen('http://en.wikipedia...
Python
1
hat can contain wildcards pub fn new_wildcard(str: String) -> Keyword { Keyword(str, KeywordType::WILDCARD) } /// Test if this is an empty keyword string pub fn is_empty(&self) -> bool { self.0.is_empty() } /// Convert this keyword to a `regex::Regex` object. pub fn to_rege...
Rust
0
ress_equip_bait(ctx, confirm_timeout) async def press_on_bait(ctx, timeout): await sleep(timeout) await click_mouse_with_coordinates(ctx, ctx["config"]["bait"]["bait_x"].get(), ctx["config"]["bait"]["bait_y"].get()) await sleep(timeout) async def press_equip_bait(ctx, timeout): await sleep(timeout) ...
Python
1
st( &mut self, ty: &Ty<I>, universe0: PlaceholderIndex, _outer_binder: DebruijnIndex, ) -> Fallible<Const<I>> { let universe = self .universes .map_universe_to_canonical(universe0.ui) .expect("Expected UCollector to encounter this universe"...
Rust
0
a = [text_a, '[SEP]', text_b, "the" , word, '?', "the", self.mask] # string_list_a = [text_a, 'the', text_b, "the" , word, '?', "the", self.mask] # few-shot if self.pattern_id == 1: string_list_a = [text_a, '[SEP]', text_b , "the", word + '?', self.mask] ...
Python
1
tt } fn pto(&self, pn_space: PNSpace) -> Duration { self.rtt() + max(4 * self.rttvar, GRANULARITY) + if pn_space == PNSpace::ApplicationData { self.max_ack_delay } else { Duration::from_millis(0) } } } impl Default for...
Rust
0
Box::new(err))), }; Ok(Subscription { to_back: self.to_back.clone(), notifs_rx, marker: PhantomData, id, }) } } /// Role of the node. #[derive(Clone, Copy, Debug)] pub enum Role { /// Light client. Light, /// A full node (mainly us...
Rust
0
lf), } } Ok(Variable { name: self.name, range: self.range, distribution: self.distribution, constraint: self.constraint, }) } } impl From<Variable> for VariableBuilder { fn from(f: Variable) -> Self { Self { ...
Rust
0
import pandas as pd import argparse from pathlib import Path parser = argparse.ArgumentParser() parser.add_argument("--date", required=True, help="基準日(YYYY-MM-DD)") args = parser.parse_args() base_date = pd.to_datetime(args.date) - pd.Timedelta(days=1) start_date = base_date - pd.DateOffset(years=3) date_list = pd.da...
Python
1
o `{}` messages.".format(limit) __help__ = """ You know how sometimes, people join, send 100 messages, and ruin your chat? With antiflood, that happens no more! Antiflood allows you to take action on users that send more than x messages in a row. Actions are: ban/kick/mute/tban/tmute Available commands are: - /fl...
Python
1
法实现,并且在PB端需要将父类的方法声明在子类中重新声明 /// /// # Examples /// /// - PowerBuilder /// /// ```vbscript /// /* 父类声明 */ /// forward /// global type n_parent from nonvisualobject /// end type /// end forward /// /// global type n_parent from nonvisualobject native "pbrs.dll" /// public function string of_hello (string world) /// end ...
Rust
0
rap(); if let SocketData::Listening(ref _listener, ref mut incoming, ref _jh, opts) = *l { let mut incoming = match incoming.take() { Some(l) => l, None => { return set_error_fmt( SRT_EINVOP, "accept can only be called from one ...
Rust
0
pango_cairo_update_context(cr: *mut cairo::cairo_t, context: *mut pango::PangoContext); pub fn pango_cairo_update_layout(cr: *mut cairo::cairo_t, layout: *mut pango::PangoLayout); } <reponame>bwt-dev/bwt-jni #[macro_use] extern crate log; use std::sync::{mpsc, Once}; use std::{any, panic, thread}; use jni::obje...
Rust
0
JM 'C<"22S86AL =!?VK9 K>K>r;rreturnrNrTrrD int | Nonerz"tuple[type[ctypes.Structure], int]r[ztype[ctypes.Structure]rTrrrrTrrDrrztuple[int, int, int] | Noner.rrztuple[int, int, int]rStrPathrrr...
Python
1
import numpy as np class CategoricalQ: def __init__(self, n_atoms, v_min, v_max): self.n_atoms = n_atoms self.v_min = v_min self.v_max = v_max self.delta_z = (v_max - v_min) / (n_atoms - 1) def distr_projection(self, next_distr, rewards, dones, gamma): """ Perf...
Python
1
tt )* ) => { { // let $name = $init; println!( concat!( stringify!( $name ), " = ", stringify!( $init ) ) ); munch!( $( $tail )* ); } }; } // fn main() { munch!( trace ; abc = def ; ghi ; ); } // <gh_stars>10-100 mod with_empty_list_arguments; mod with_non_empty_proper_list_arguments...
Rust
0
ntains(&byte) || (b'0'..=b'9').contains(&byte) || byte == b'-' || byte == b'.' } if hostname.is_empty() || hostname.len() > 253 || hostname.bytes().any(|byte| !is_valid_char(byte)) || hostname.split('.').any(|label| { ...
Rust
0
return (1 - token_attention/torch.sum(torch.square(map))) ** 2 @staticmethod def _compute_energy_loss2(map, token2ignore): #map -- [16, 16, len(prompt)] max_map = torch.sum(map, axis=(0,1)) token2ignore = torch.argmax(max_map) map = F.softmax(map * 100, dim=-1) ...
Python
1
"odd", "unsightly", "adorable", "important", "inexpensive", "cheap", "expensive", "fancy", ]; static COLOURS: &[&'static str] = &[ "red", "yellow", "blue", "green", "pink", "brown", "purple", "brown", "white", "black", "orange", ]; static NOUNS: &[&'static str] = &[ "table"...
Rust
0
td::os::raw::c_char, salt: *const gnutls_datum_t, generator: *const gnutls_datum_t, prime: *const gnutls_datum_t, res: *mut gnutls_datum_t, ) -> ::std::os::raw::c_int; } extern "C" { pub static gnutls_srp_8192_group_prime: gnutls_datum_t; } extern "C" { pub static gnutls_srp_...
Rust
0
0 0 0 0 00000111 0 B = b a t _ t p B = 0x62 0x61 0x74 0x20 0x74 0x70 ``` But of course, we can't use `B` with `PSHUFB` yet, since its values are 8 bits, and we need indexes that are at most 4 bits (corresponding to one of 16 values). We c...
Rust
0
# Copyright 2025 Matheus Vilano # SPDX-License-Identifier: Apache-2.0 from pywwise.descriptors import WwiseProperty from pywwise.enums import EMotionChannelConfig, EMotionDriver from pywwise.objects.abc import WwiseObject class MotionSource(WwiseObject): """ https://www.audiokinetic.com/en/library/edge/?sour...
Python
1
core_w = [overlap, degree, area, center, length] ''' score_w = [0.0, 1.0, 10.0, 0.5, 1.0] score_array = params['w_overlap'] * overlap_scores \ + params['w_degree'] * degree_scores \ + params['w_area'] * area_scores \ - params['w_c...
Python
1
button.add(image) button.set_size_request(image_width, image_height / 2) button.set_relief(Gtk.ReliefStyle.NONE) img_index = int(workspace_file.split("workspace")[1].split(".jpg")[0]) - 1 button.connect("clicked", self.on_workspace_selected, img_index) ...
Python
1
_service_t; pub fn IOServiceGetMatchingServices(masterPort: mach_port_t, matching: CFDictionaryRef, existing: *mut io_iterator_t) -> kern_return_t; pub fn IOServiceAddNotification(masterPort: mach_port_t, notificationType: *const c_char, matching: CFDictionaryRef, wakePort: mach_port_t, reference: uintptr_t, no...
Rust
0
NeFloat64() -> BinaryenOp; } extern "C" { pub fn BinaryenLtFloat64() -> BinaryenOp; } extern "C" { pub fn BinaryenLeFloat64() -> BinaryenOp; } extern "C" { pub fn BinaryenGtFloat64() -> BinaryenOp; } extern "C" { pub fn BinaryenGeFloat64() -> BinaryenOp; } extern "C" { pub fn BinaryenAtomicRMWAdd() ...
Rust
0
ault(), bysetpos: self.bysetpos.unwrap_or_default(), byweekno: self.byweekno.unwrap_or_default(), byhour: vec![dtstart.hour() as usize], byminute: vec![dtstart.minute() as usize], bysecond: vec![dtstart.second() as usize], until, wkst: ...
Rust
0
zones_request = ListHostedZonesRequest { ..Default::default() }; let mut rt = tokio::runtime::Runtime::new().unwrap(); let mut resp = rt.block_on(list_hosted_zones(&client, list_hosted_zones_request)); process_list_hosted_zones(resp.clone()); while resp.clone().is_truncated { let ...
Rust
0
}) .unwrap(); sender .unbounded_send(FinalityNotification { hash: block_2.header.hash(), header: block_2.header, tree_route: Arc::new([]), stale_heads: Arc::new([]), }) .unwrap(); ...
Rust
0
); let panic_msg: &'static str = $panic_msg; if !panic_msg.is_empty() { panic!("{}", panic_msg); } return; } }}; () => { maybe_skip_integration!("") }; } fn asse...
Rust
0
""" 星点检测模式配置文件 提供不同的检测参数组合,适应不同的使用需求 """ from star_detector import StarDetector def get_detector_config(mode="balanced"): """ 获取不同模式的检测器配置 Parameters: ----------- mode : str 检测模式: - "minimal": 最少模式,只检测最明显的星点 - "selective": 精选模式,检测较明显的星点 - "balanced": 平衡模式,适中数量的...
Python
1
art2(rules: &[Rule]) -> u32 { let mut total = 0; let mut bags: VecDeque<_> = vec![(1, "shiny gold")].into_iter().collect(); while let Some((count, bag)) = bags.pop_front() { total += count; if let Some(rule) = rules.iter().find(|rule| rule.outer == bag) { for (inner_count, inner_...
Rust
0
models with 8x8 keyboard matrix // works like this: // // The CPU 'lights up' the keyboard matrix columns by writing // column number 0..7 to output port 0x08. After each write to output // port 0x08, the CPU reads back the state of the keyboard matrix // line by doing 2 separate reads from PIO channel B. 2 separate /...
Rust
0
size_t, pSrc_buf: *const lzham_uint8, src_len: size_t, pAdler32: *mut lzham_uint32, ) -> lzham_compress_status_t; } pub const lzham_decompress_status_t_LZHAM_DECOMP_STATUS_NOT_FINISHED: lzham_decompress_status_t = 0; pub const lzham_decompress_status_t_LZHAM_DECOMP_STATUS_HAS_MORE_OUTPUT: l...
Rust
0
} result } fn line_for_pos(pos: usize, text: &str) -> &str { &text[start_of_line(pos, text)..end_of_line(pos, text)] } fn start_of_line(pos: usize, text: &str) -> usize { let bytes = text.as_bytes(); let mut loc = pos; while loc > 0 && bytes[loc - 1] != b'\n' { loc -= 1; } loc ...
Rust
0
import random print('Welcome to the PyPassword Generator!') print('How many letters would you like in your password?') letters = int(input()) print('How many symbols would you like?') symbols = int(input()) print('How many numbers would you like?') numbers = int(input()) capital_alphabets = [ 'A', 'B', 'C', 'D', '...
Python
1
r" into the "foo" channel echo "bar" | abra tx --channel foo # put "bar" into the "foo" channel abra tx --channel foo --value "bar" # print text that is put into the "foo" channel abra rx --channel foo # print the contents of filenames which are p...
Rust
0
vert an RPC to some bytes we can send over the network. */ pub fn as_network_msg(rpc: RaftRpc) -> ~[u8] { let content = json::Encoder::str_encode(&rpc); let msg = frame_msg(content); msg.as_bytes().to_owned() } /* * Frame a str wth the length header. */ pub fn frame_msg(msg: &str) -> ~str { (make_co...
Rust
0
_start,], a![ C![ C.flex, C.hover__underline, C.hover__text_green_700, C.focus__outline_none, ], attrs! { At::Href => Urls::new(base_url).guide(previous_guide), }, view_pre...
Rust
0
import matplotlib.pyplot as plt import numpy as np import pandas as pd gamma = pd.read_csv("./prediction/excel/gamma_506/gamma.csv").round(decimals=4) gamma.head() # citeseer = gamma[(gamma['dataset'] == 'citeseer')] # cora = gamma[(gamma['dataset'] == 'cora')] # citeseer datasets = ['cora', 'citeseer', 'pubmed', '...
Python
1
e_idx-1):04d}", "in_depth.dds"), dest_scenario_path / "in_depth_tm1.dds", ) os.symlink( os.path.join("..", f"frame_{(frame_idx-1):04d}", "out_derivative.dds"), dest_scenario_path / "in_derivative_tm1.dds", ) os.symlink( os.path.join("..", f...
Python
1
().is_terminal()); for _ in 0..2 { cw.step(2); } let t = cw.step(2); assert!(t.terminated()); assert!(t.to.is_terminal()); assert!(t.reward.is_sign_positive()); } } <reponame>Kroger-Technology/git-project<filename>src/commands/check.rs use crate::{ err::Result, expl...
Rust
0
bits_used_for_number(number) { 4 => { match number { 0 => 0b0011, n => ((n << 1) | 0b1) as u64 } }, 7 => { match number { 0 => 0b000_0010, n => (((n - 1) << 2) | 0b10) as u64 } }, 10 => { match number { 0 => 0b00_0000_0000, n => ((n - 1) << 2) as u64 } }, _ => un...
Rust
0
import pytest import cards from cards import Card @pytest.fixture(scope="session") def tmp_db_path(tmp_path_factory): """Path to temporary database""" return tmp_path_factory.mktemp("cards_db") @pytest.fixture(scope="session") def session_cards_db(tmp_db_path): """CardsDB""" db_ = cards.CardsDB(tmp_...
Python
1
mod testing; use godsays::God; use hyper::service; use hyper::{Body, Method, Request, Response, Server, StatusCode}; use std::convert::Infallible; use std::env; use std::error::Error; #[tokio::main] pub async fn run_server(addr: &str, god: God) -> Result<(), Box<dyn Error + Send + Sync>> { let make_svc = service::...
Rust
0
g = self.m_0_2; let h = self.m_1_2; let i = self.m_2_2; let det = a * (e * i - f * h) - b * (i * d - f * g) + c * (d * h - e * g); self.m_0_0 = (e * i - f * h) / det; // A self.m_1_0 = -(b * i - c * h) / det; // D self.m_2_0 = (b * f - c * e) / det; //...
Rust
0
import os import requests from pathlib import Path from urllib.parse import urlparse def download_emojis(csv_file): # Create directory if it doesn't exist output_dir = os.path.join(os.getcwd(), "slackmojis") Path(output_dir).mkdir(parents=True, exist_ok=True) # Read URLs from file with open(csv_f...
Python
1
class Solution: def maxNumberOfFamilies(self, n: int, reservedSeats: List[List[int]]) -> int: ans = 0 rowToSeats = collections.Counter() for row, seat in reservedSeats: rowToSeats[row] |= 1 << (seat - 1) for seats in rowToSeats.values(): if (seats & 0b0111111110) == 0: # Can fit ...
Python
1
{ self.inner.delete(build_inner_key(table_id, key)) } #[inline] pub fn delete_range<F, T>(&mut self, table_id: TableId, from_key: F, to_key: T) where F: AsRef<[u8]>, T: AsRef<[u8]>, { self.inner.delete(build_delete_range_hint_table_inner_key(&from_key, &to_key)); ...
Rust
0
from sklearn.cluster import DBSCAN, KMeans import numpy as np from sklearn.neighbors import KDTree import torch from external_libs.pointnet2_utils.pointnet2_utils import square_distance from sklearn.cluster import MeanShift import matplotlib.pyplot as plt from sklearn.decomposition import PCA def clustering_points(mo...
Python
1
fs = fs[0:ir] + sta_str + fs[ir+len("@{sta}"):] else: print ( "Station %s is not specified in IVS nscodes files, therefore file %s of type %s is rejected" % \ ( sta_str, file_name, file_type ) ) ...
Python
1
&k2=v2&k3=v3"); } #[test] fn test_sign() { let x = { let mut tmp: HashMap<&str, String> = HashMap::new(); tmp.insert("k2", "v2".to_string()); tmp.insert("k3", "v3".to_string()); tmp.insert("k1", "v1".to_string()); tmp }; a...
Rust
0
# -*- coding: utf-8 -*- import sys import os sys.path.append('./tests/lib') sys.path.append('./script.mrknow.urlresolver/lib/') sys.path.append('./script.mrknow.urlresolver/lib/urlresolver9') web_url = 'http://embed.nowvideo.sx/embed/?v=27e41183d1328' web_url = 'http://videomega.tv/iframe.php?width=720&height=400&r...
Python
1
r of cores a positive integer. Parameters ---------- n_cores Number of cores to use. n_jobs. Number of jobs. This is just used to determine if the collection is a singleton. If `1`, always returns `1`. Returns ------- Positive integer corresponding to how many cores...
Python
1
_acc, top_checkpoints = 0, [] train_queue, valid_queue, n_cls = get_dataset(args) net, net_name = set_architecture(n_cls) parameters = filter(lambda p: p.requires_grad, net.parameters()) optimizer = optim.SGD(parameters, lr=args.lr, momentum=args.momentum, weight_decay=args.weight_decay) criteri...
Python
1
param('offset', 'Offset to start looking for results, useful for paginating results.')) def results(self, params): sid = params['sid'] limit = int(params.get('limit', 25)) with self.controller: if not self.controller.has_session_uuid(sid): raise RestException('Se...
Python
1
response = client.table('users').select("*").eq('email', email).execute() if response.data: return response.data[0] return None except Exception as e: print(f"Erro ao obter usuário por email: {e}") return None # Funções de exclusão...
Python
1
.0515941029228475e+00, 1.0511460436960840e+00, 1.0515123758830476e+00, 1.0508871369510702e+00, 1.0508923708102380e+00, 1.0477492815668303e+00, 1.0493272144017338e+00, 1.0435963333422726e+00, 1.0392280772051465e+00 ] ...
Rust
0
Ordering::Greater => -1, } } fn parse_vec(input: &str) -> Result<Vec3> { let input = &input[0..input.len() - 1]; let mut coords = input.trim().split(','); let (x, y, z) = (coords.next(), coords.next(), coords.next()); match (x, y, z) { (Some(x), Some(y), Some(z)) => { let x = parse_coord(x)?; let y = par...
Rust
0
# -*- coding: utf-8 -*- """ Created on Fri Nov 7 20:39:22 2014 @author: crw """ import sys import numpy as np import matplotlib.pyplot as plt caffe_root = '/home/crw/caffe-local/' sys.path.insert(0, caffe_root + 'python') import caffe import cv2 plt.rcParams['figure.figsize'] = (10, 10) plt.rcParams['image.interpola...
Python
1
import einops import torch from kappamodules.layers import ContinuousSincosEmbed from kappamodules.transformer import PerceiverPoolingBlock, Mlp from torch import nn from torch_geometric.utils import to_dense_batch from models.base.single_model_base import SingleModelBase from optimizers.param_group_modifiers.exclude_...
Python
1
culate the loss loss_up, loss_down = None, None if targets is not None: targets_up, targets_down = targets loss_up = F.cross_entropy(logits_up.view(-1, logits_up.size(-1)), targets_up.view(-1), reduction='none') loss_down = F.cross_entropy(logits_down.view(-1, logit...
Python
1
from .products import Product from .subscribe import Subscribe
Python
1
} Executor::new() }); pub fn spawn<T: Send + 'static>(future: impl Future<Output = T> + Send + 'static) -> Task<T> { EXECUTOR.spawn(future) } // Simplre scheduler for the STM32F4DISCOVERY board. #![feature(const_fn)] #![no_std] //Just Core lib #![no_main] //To use the emb.rs startup code. En...
Rust
0
warnings[0]['category'], DeprecationWarning) class ClassA(pb.Copyable, pb.RemoteCopy): def __init__(self): self.ref = ClassB(self) class ClassB(pb.Copyable, pb.RemoteCopy): def __init__(self, ref): self.ref = ref class CircularReferenceTests(unittest.TestCase): """ ...
Python
1
pub enum Operation<R: Sized + Clone + PartialEq + Debug, W: Sized + Clone + PartialEq + Debug> { ReadOperation(R), WriteOperation(W), } /// Type to identify an OS thread. /// Ideally in our benchmark we should have one OS thread per core. /// On MacOS this is not guaranteed. pub type ThreadId = u64; // Pin a ...
Rust
0
\n" .as_ref(), )?; for (name, desc, value) in self.values { let (typ, value) = value.as_parts(); let full = format!( "#[doc=r#\"{}\"#]\npub const {}: {} = {};\n", desc, name, typ, value ); output_file.write_...
Rust
0
_id)?; is_email_valid(&form.email)?; let token = hex::encode(rand::thread_rng().sample_iter(Standard).take(4).collect::<Vec<u8>>()); let mut client = pool.get()?; let stmt = client.prepare("UPDATE pre_users SET token=$1, gen_time=NOW() WHERE id=$2 AND email=$3 AND token=$4;")?; let res = cli...
Rust
0
); match pair { (Some(left), Some(right)) => { if i32::abs(left-right) < 2 { return Some(i32::max(left, right) + 1); } else { return None; } } _ => retu...
Rust
0
ion_recommendations, "anomaly_detection": self.config.enable_anomaly_detection, "multi_model_routing": self.config.enable_multi_model_routing } return feature_map.get(feature_name, False) # ============================================================================ # ...
Python
1
new_isi_ds, new_bui_ds = new_ds fwi_values, fwi_nodata = calculate_fwi(new_isi_ds, new_bui_ds) await s3_client.persist_raster_data( temp_dir, new_fwi_key, new_isi_ds.as_gdal_ds().GetGeoTransform(), new_isi_ds.as_gdal_ds().G...
Python
1
""" Sudoku Solver using backtracking """ def find_empty_location(arr,l): for row in range(9): for col in range(9): if arr[row][col]==0: l[0]=row l[1]=col return True return False def get_entities(sudoku, r, c): curr_row = sudoku[r] c...
Python
1
xistent repo: {:?}", id))), } } fn config_from_id<S: AsRef<str>>(&self, id: S) -> crate::Result<&RepoConfig> { let id = id.as_ref(); match self.configs.get(id) { Some(config) => Ok(config), None => Err(Error::Config(format!("nonexistent repo: {:?}", id))), ...
Rust
0
how long it would take to crack the password, //!the number of guesses it would need and the number of years it would take to crack the passphrase. //! //! However, kindly node that this is only a passphrase generator and you need to hash it with //! a good hashing algorithm (I recommend argon2 implementations) for u...
Rust
0
generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [pl2_plmask_hi](pl2_plmask_hi) module"] pub type PL2_PLMASK_HI = crate::Reg<u32, _PL2_PLMASK_HI>; #[allow(missing_docs)] #[doc(hidden)] pub struct _PL2_PLMASK_HI; #[doc = "`read()` method r...
Rust
0
se), AccountMeta::new(id0, true)], )], None, ); // Ensure the dup writable key is a signer assert_eq!( keys, CompiledKeys { writable_signer_keys: vec![id0], readonly_non_signer_keys: vec![program_id], ...
Rust
0
_texture; pub mod face_keys_get_hair; pub mod face_keys_get_hair_color; pub mod face_keys_get_hair_texture; pub mod face_keys_get_morph_key; pub mod face_keys_get_skin_color; pub mod face_keys_set_age; pub mod face_keys_set_beard; pub mod face_keys_set_face_texture; pub mod face_keys_set_hair; pub mod face_keys_set_hai...
Rust
0
(*rtm).rtm_dst_len); } // gateway t = attrs[RTA_GATEWAY as usize]; if t as i64 != 0 { let data: *const u8 = RTA_DATA!(t) as *const u8; let len = RTA_PAYLOAD!(t) as u32; rte.gateway = format_addr...
Rust
0
from funciones3 import * def menu(opcion): match opcion: case 1: largo = int(input("Ingrese el largo: ")) ancho = int(input("Ingrese el ancho: ")) caracter = input("Ingrese el caracter que desea: ") return rectangulo(largo, ancho, caracter) ...
Python
1
error!(format!("Remote url ({}) did not pass regex", remote_url)); return Err(anyhow!("Remote url ({}) did not pass regex", remote_url)); } let captures = possible_captures.unwrap(); let possible_repository_name = captures.get(captures.len() - 1); if possible_repository_name.is_none() { ...
Rust
0
entity2 = MagicMock(spec=ClassificationEntity) mock_entity2.name = "entity2" mock_response = MagicMock() mock_response.entities = [mock_entity1, mock_entity2] self.mock_ometa.list_entities.return_value = mock_response result = Classifications.list(limit=10) self.asser...
Python
1
vec![5,6,7,8,9], vec![8,9,0]]; let r = ::comb::merge_n(&[0, 1, 2], v); assert_eq!(r, vec![vec![0,1,2,2,3,4], vec![0,1,2,5,6,7,8,9], vec![0,1,2,8,9,0]]); } #[test] fn merge() { let v = vec![vec![2,3,4], vec...
Rust
0
std::cmp::max; use std::collections::HashMap; use nom::branch::alt; use nom::bytes::complete::tag; use nom::character::complete::{line_ending, not_line_ending, one_of}; use nom::combinator::{all_consuming, map, map_res, recognize}; use nom::multi::{many0, many1}; use nom::sequence::{preceded, terminated, tuple}; use ...
Rust
0
.name, pragma_index_info(s.name) i WHERE s.type = 'index' AND tbl_name = ? AND NOT p.origin = 'c' ", ) .bind(&table.name) .fetch(&self.pool); let mut constraints: Vec<Box<dyn TableRow>> = vec![]; ...
Rust
0
wrap_or(cycle.len() - 3) + 1; triangles.push([cycle[index - 1], cycle[index], cycle[index + 1]]); // A cycle length of 3 makes the long segment part of the triangle. Don't double that segment. if cycle.len() > 3 { boundary.add_edge...
Rust
0
fastq | \ //! fasten_kmer -k 21 > 21mers.tsv //! ``` //! //! ## Read sampling //! ```text //! $ cat testdata/R1.fastq testdata/R2.fastq | \ //! fasten_shuffle | \ //! fasten_sample --paired-end --frequency 0.1 > 10percent.fastq //! ``` //! //! # Advanced //! ## Set of downsampled reads //! Create a set of do...
Rust
0
ciphertext, out_ciphertext, zkproof)| Self { cv: ValueCommitment(AffinePoint::identity()), cm_u: NoteCommitment(AffinePoint::identity()).extract_u(), ephemeral_key: keys::EphemeralPublicKey(AffinePoint::identity()), enc_ciphertext, out_ciph...
Rust
0
import heapq def a_star(): # Define the list of coins and their tax values coins = [40, 28, 46, 16, 13, 15, 38, 39, 3, 8, 40, 41, 18, 48, 16, 25, 39, 14, 47, 46, 31, 16, 41, 45, 9, 26, 33, 46, 17, 23, 6, 46, 7, 43, 10, 28, 47, 15, 35, 20, 32, 4, 32, 9, 48, 7, 34, 46, 10, 39, 44] tax_values = {44: 6, 39: ...
Python
1
!("{:?}", bytes), } } <reponame>Geraet/kompositum-rs // Copyright(c) 2021 <NAME>. // Distributed under the MIT License (http://opensource.org/licenses/MIT) #[cfg(test)] mod tests { use crate::{builder, printer::Printer, IDType}; use multimap::MultiMap; const TREE_MAP_DEF: &[(IDType, IDType)] = &[(1, 2...
Rust
0
n_ampl_in: f64 = min_ampl; let mut out_out: *mut bindings::VipsImage = null_mut(); let separable_in: i32 = if gaussmat_options.separable { 1 } else { 0 }; let separable_in_name = utils::new_c_string("separable")?; let precision_in: i32 = gaussmat_options.precision as i32; let p...
Rust
0
heric Data"), dcc.Graph(figure=fig) ]) # ----------------------------- # Tab 3: 3D Flight Path # ----------------------------- def get_tab_flightpath(): fig = go.Figure(data=[go.Scatter3d( x=gps_lon, y=gps_lat, z=altitude, mode='lines+markers', line=dict(color...
Python
1
ErrorStream", .descriptor == "()Ljava/io/InputStream;" unsafe { let __jni_args = []; let __jni_env = __jni_bindgen::Env::from_ptr(self.0.env); let (__jni_class, __jni_method) = __jni_env.require_class_method("java/net/HttpURLConnection\0", "getErrorStream\0", ...
Rust
0
import os.path import shutil import sqlite3 import tempfile import uuid import chromadb import pytest from chroma_ops.fts import rebuild_fts def test_rebuild_fts() -> None: records_to_add = 100 with tempfile.TemporaryDirectory() as temp_dir: client = chromadb.PersistentClient(path=temp_dir) ...
Python
1