text
string
label_name
string
labels
int64
in1_mask = (alpha < - 5 * math.pi / 6.) | (alpha > - math.pi / 6.) rot_bin0 = bin0_mask.to(alpha.dtype) rot_res0 = alpha - (-0.5 * math.pi) rot_bin1 = bin1_mask.to(alpha.dtype) rot_res1 = alpha - (0.5 * math.pi) rot_bin = torch.stack([rot_bin0, rot_bin1], dim=1) rot_res = torch.stack([rot_res0 ...
Python
1
from unittest import TestCase import numpy as np import scipy.signal as signal import audio_dspy as adsp _N_ = 1024 _fs_ = 44100 _tolerance_ = 0.001 def check_freq_point(tester, freq, exp_mag, w, H): idx = np.argmin(np.abs(H - freq)) tester.assertTrue(np.abs(np.abs(H[idx]) - exp_mag), ...
Python
1
ducing an intermediate 64-bit result. Shift the result right by the amount specified in the corresponding element of c, and store the lower 32-bits in dst. /// /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_shrdv_epi32&expand=5126) #[inline] #[target_feature(enable = ...
Rust
0
.0, base_lb], ys_2: &[0.0, base_ub], }; self.backend.regression_comparison( ctx.id, ctx.size, file_path, is_thumbnail, &x_label, x_scale, &unit, current_regression, current_confidence...
Rust
0
= match digits.last() { Some(v) if *v > 0x7f => Sign::Minus, Some(_) => Sign::Plus, None => return BigInt::zero(), }; if sign == Sign::Minus { // two's-complement the content to retrieve the magnitude let mut digits = Vec::from(digits); ...
Rust
0
# SPDX-License-Identifier: AGPL-3.0-Only # Copyright (C) 2023 Sean Anderson <seanga2@gmail.com> import cocotb from cocotb.binary import BinaryValue from cocotb.clock import Clock from cocotb.triggers import FallingEdge, RisingEdge, Timer from .mdio import wb_read, wb_write, wb_err from .mdio_regs import wb_xfer @coc...
Python
1
our proxy type needs a lifetime parameter let (mut params, ty_bounds) = match proxy_type { ProxyType::Ref | ProxyType::RefMut => { (quote! { #proxy_lt_param, }, quote! { : #proxy_lt_param + #trait_path }) } ProxyType::Box | ProxyType::Rc | ProxyType::Arc => (...
Rust
0
class Solution: def countGoodStrings(self, low: int, high: int, zero: int, one: int) -> int: @cache def dfs(i): if i > high: return 0 ans = 0 if low <= i <= high: ans += 1 ...
Python
1
_eq!(count1(&mut false_1), 0); assert_eq!(count1(&mut not), 1); assert_eq!(count1(&mut id), 1); assert_eq!(count1(&mut true_1), 2); assert_eq!(count2(&mut false_2), 0); assert_eq!(count2(&mut and), 1); assert_eq!(count2(&mut xor), 2); assert_eq!(count2(&mut eq), ...
Rust
0
number::streaming::be_u32; use nom::HexDisplay; const zelda: &'static [u8] = include_bytes!("../assets/zelda.flv"); const zeldaHQ: &'static [u8] = include_bytes!("../assets/zeldaHQ.flv"); const commercials: &'static [u8] = include_bytes!("../assets/asian-commercials-are-weird.flv"); #[test] fn headers() {...
Rust
0
ant_model = model assistant_model.generation_config.num_assistant_tokens = 2 assistant_model.generation_config.num_assistant_tokens_schedule = "constant" generated_ids = model.generate(input_ids, max_new_tokens=4, temperature=0) self.assertEqual(EXPECTED_OUTPUT_TOKEN_IDS, generated_ids[0...
Python
1
"""常用网络函数库封装""" import json import uuid import http import gzip import zlib import os.path import urllib.parse as urlparse import urllib.request as request from collections import namedtuple import xml.etree.cElementTree as et from typing import Tuple, Dict, Optional, Union from . import file from ..algorithm impor...
Python
1
import torch import torch.nn as nn from .mpp_loss import MPPLoss from .normal_loss import NormalLoss class LossComputer(nn.Module): def __init__(self, w_normal=1., w_mpp=1.): super().__init__() self.w_normal = w_normal self.w_mpp = w_mpp self.mppLoss = MPPLoss() self.normal...
Python
1
TEXT_PRESENTATION_TAB", "1"), ("(gint) WEBKIT_AUTOMATION_BROWSING_CONTEXT_PRESENTATION_WINDOW", "0"), ("(gint) WEBKIT_AUTOPLAY_ALLOW", "0"), ("(gint) WEBKIT_AUTOPLAY_ALLOW_WITHOUT_SOUND", "1"), ("(gint) WEBKIT_AUTOPLAY_DENY", "2"), ("(gint) WEBKIT_CACHE_MODEL_DOCUMENT_BROWSER", "2"), ("(gint) WE...
Rust
0
tion will be assumed or estimated on-the-fly. Returns: The initialized :class:`SelectiveLeakageCalibration` instance. Raises: ValueError: If the number of probes is not strictly positive. ValueError: If the number of samples is not strictly positive. ValueError: If the noise power is ...
Python
1
def soma(matriz): soma = 0 for linha in range(len(matriz)): for coluna in range(len(matriz[linha])): soma += matriz[linha][coluna] print("A soma de todos os valores da matriz é: ", soma) def main(): matriz = [ [1, 2 ,3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13,...
Python
1
import xml.etree.ElementTree as ET from xml.sax.saxutils import unescape import glob import sys,os import imageio import os.path as osp # base = '/home/asd/' base = sys.argv[1] xml = osp.join(base, 'xml/') fpath = osp.join(base, 'forms/') gpath = osp.join(base, 'pargs/') forms = glob.glob(xml+'*.xml') c=0 for i ...
Python
1
_data["customer"] = parse_prot[cus_idx:cus_idx2].strip(' ,') phrase = parse_prot[parse_prot.find('представителя организации:') + 26:parse_prot.find('Нормативные документы') - 1] if phrase.find('»') > 1: rep_idx = phrase.find('»') + 1 else: rep_idx = 0 if parse_pro...
Python
1
timeout_height, memo ); check_useful_c_str!(pool_alias, ErrorCode::CommonInvalidParam2); check_useful_c_str!(sender_public_key, ErrorCode::CommonInvalidParam3); check_useful_c_byte_array!( msg_raw, msg_len, ErrorCode::CommonInvalidParam4, ErrorCode::Commo...
Rust
0
*, *}; pub use log::{debug, info, warn}; use crate::world::World; mod component; mod render; mod view; use self::render::{RenderArea, RenderContext}; use self::view::StateMachine; /// UI user interaction events. pub enum Event { MouseDown { button: MouseButton, x: i32, y: i32, }, ...
Rust
0
(i as usize -1).map_or(0usize, |c| c.node_value()) }).sum() }, }, } } } #[test] fn test_08_a() { let t = Node::new(&[2, 3, 0, 3, 10, 11, 12, 1, 1, 0, 1, 99, 2, 1, 1, 2]); assert_eq!(t.sum_metadata(), 138); } #[test] fn test_08_b() { let t = Node:...
Rust
0
us_code == 400 expected_dict = { 'id': [ 'Course {} does not exist.'.format( course_key ) ] } self.assertDictEqual(expected_dict, json.loads(response.content.decode('utf-8'))) class OrderViewTests(UserMixin, TestCase)...
Python
1
<T> where T: client::Client + client::Ed255 + client::Tdes, { pub fn new( trussed: T, ) -> Self { // seems like RefCell is not the right thing, we want something like `Rc` instead, // which can be cloned and injected into other parts of the App that use Trussed. /...
Rust
0
in_dp_group = torch.distributed.get_rank(parallelization_group) for sh_ten in local_shards: shard_id = _sharded_tensor_shard_id(sh_ten) if ( shard_id in precomputed_distribution.shards_in_this_group and rank_within_dp_group == precomputed_distribution.main_rank_for_shard[shar...
Python
1
compile( r'<a (?:[^<>]*? )?href="#([^<>"]+?)">[^<>]+?</a>', re.IGNORECASE, ) linkTargetSet = set() def replaceBword(text: str) -> str: return text.replace( ' href="bword://', ' href="#', ) def addLinks(text: str, pos: int) -> None: for m in re_fixed_link.finditer(text): if ' class=...
Python
1
dation (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 use this file except in compliance...
Rust
0
-z0-9]*").unwrap(); let mut caps_it = re.captures_iter(s); st += &(&(caps_it.nth(0).unwrap()[0]).to_string().to_lowercase()); for caps in caps_it { st += "_"; st += &((&caps[0]).to_string().to_lowercase()); } st } /// change snake to camel fn snake_to_camel(s: &str, mode: char) -> String { let mut st = Strin...
Rust
0
# 市町村から中継施設への割り当て yearly_trans_size[near_trans_faci_i] += waste[city_i] # 中継施設から焼却施設への割り当て yearly_inc_size[near_inc_from_trans_faci_i] += waste[city_i] total_EL_indirect += EL_indirect to...
Python
1
nly. pub const AST_OPTION_NEGATED: OptionFlags = OptionFlags(0b0000_0100); /// _(internals)_ The [`AST`][crate::AST] node breaks out of normal control flow. /// Exported under the `internals` feature only. pub const AST_OPTION_BREAK: OptionFlags = OptionFlags(0b0000_1000); /// _(internals)_ Mask of ...
Rust
0
regex to group by. \ The match will use the entire expression, unless a group-id is provided.") .required(true) ) .arg( Arg::with_name("group-id") .short("g") .value_name("group-id") .help("The group-id to grou...
Rust
0
vSSKrSSK7 \RRR 5(aSSKJr gg)N* RemoteModuletorch functional distributedrpc is_availableapi.remote_moduler torch\distributed\nn\__init__.py<module>r0 ...
Python
1
&mut *(r as *mut U256).cast() }; udivmod4(res, &a, b, None); } pub fn div3(r: &mut MaybeUninit<U256>, a: &U256, b: &U256) { udivmod4(r, a, b, None); } pub fn rem2(r: &mut U256, a: &U256) { let mut res = MaybeUninit::uninit(); let (a, b) = (*r, a); // SAFETY: `udivmod4` does not write `MaybeUninit...
Rust
0
#[test] fn poll_stream_after_error() { let mut s = poll_stream_after_error_stream(); assert_eq!(executor::block_on(poll_fn(|ctx| s.poll_next(ctx))), Ok(Some(5))); assert_eq!(executor::block_on(poll_fn(|ctx| s.poll_next(ctx))), Err(())); assert_eq!(executor::block_on(poll_fn(|ctx| s.poll_next(ctx))), O...
Rust
0
from twitterpandas import TwitterPandas from examples.keys import TWITTER_OAUTH_SECRET, TWITTER_OAUTH_TOKEN, TWITTER_CONSUMER_SECRET, TWITTER_CONSUMER_KEY __author__ = 'willmcginnis' def friendship_option(): # get our own user id user_id = tp.api_id # use it to find all of our own friends (people we fol...
Python
1
EncodingError::NotAnAtom(term) => write!(f, "Encoding ({:#?}) is not an atom", term), EncodingError::NotAnEncodingName(term) => write!( f, "Encoding atom ({:#?}) is not one of the supported values (latin1, unicode, or utf8)", term ), } ...
Rust
0
) else: myio = get_io_module_to_decompress(fp) with myio.open(fp) as f: yaml_data = yaml.load(f, Loader=Loader) return yaml_data def _displacements_yaml_lines_type1( dataset: dict, with_forces: bool = False, key_prefix: str = "" ) -> list: """Return type1 dataset in yaml. ...
Python
1
e(list_of_label): if value==labels[i]: # list_of_label[idx]=maxlabel list_of_label[idx] = self.get_labels_of_k_neighbor_points(k_neighbor, predicted_contact_points[idx], maxl...
Python
1
f"Target modules {peft_config.target_modules} not found in the base model. " f"Please check the target modules and try again." ) self._mark_only_adapters_as_trainable() if self.peft_config[adapter_name].inference_mode: for n, p in self.model.named_pa...
Python
1
rade_ops: Union[UpgradeOps, List[UpgradeOps]] ) -> None: self._upgrade_ops = util.to_list(upgrade_ops) for elem in self._upgrade_ops: assert isinstance(elem, UpgradeOps) @property def downgrade_ops(self) -> Optional[DowngradeOps]: """An instance of :class:`.DowngradeOps`...
Python
1
Reg<t_string::T_STRING_SPEC>, #[doc = "0x08 - SHA 512/t configuration register 1."] pub t_length: crate::Reg<t_length::T_LENGTH_SPEC>, #[doc = "0x0c - DMA configuration register 0."] pub dma_block_num: crate::Reg<dma_block_num::DMA_BLOCK_NUM_SPEC>, #[doc = "0x10 - Typical SHA configuration register ...
Rust
0
6551835679802393705778511611365663565350753197990", "8886525670832950037403820227457774501115357138963728191033023737126263554734", "39423785451480055448398145195082124374056011700214448253256356858091859173057", "33404207154315723314001517707036921761049961639017818728334249043678763064723", ...
Rust
0
Documents to append as an appendix to all manuals. # exinfo_appendices = [] # If false, no module index is generated. # exinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # exinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # exin...
Python
1
{ // Draw the vertical rings for index in 0..segments { // Rotate around whole sphere (2pi) let fraction = (index as f32 / segments as f32) * std::f32::consts::PI * 2.0; let x_dir = glam::Vec3::new(fraction.cos(), fraction.sin(), 0.0); let y_dir = glam::V...
Rust
0
#!/usr/bin/env python """ BSD 3-Clause License Copyright (c) 2017, SafeBreach Labs All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notic...
Python
1
_method(this, extra_text) } fn async_method_default_trampoline(this: &BaseButtonInstance) -> PinnedFuture { BaseButton::from_instance(this).async_method(this) } pub(super) fn base_button_sync_method(this: &BaseButtonInstance, extra_text: Option<String>) { let klass = this.class(); (klass.as_ref().sync_met...
Rust
0
onds / 1e9) wL = float(self.js_msg.velocity[0]) wR = float(self.js_msg.velocity[1]) velX = (self.wheelRadius / 2) * (wL + wR) velY = 0 velTh = (self.wheelRadius/self.wheelSeparation) * (wR - wL) dt = self.odom_current_time - self.odom_last_time deltaX = velX * ...
Python
1
# -*- coding: utf-8 -*- """ Created on Thu Apr 10 21:33:35 2014 @author: kraft-p """ import cmf # project with three tracers p = cmf.project('No Linear Freundlich Langmuir') N, X, Y, Z = p.solutes # A water storage without specific properties ws = p.NewStorage('storage', 0, 0, 0) # 1m3 water as initial condition ws...
Python
1
dom, } } pub fn handle_event(&self, data: &EventData) { match data { &EventData::Axis(i, val) => self.dom.set_axis(i, val), &EventData::Button(i, pressed) => self.dom.set_button(i, pressed), &EventData::ButtonValue(i, val) => self.dom.set_button_value(i, va...
Rust
0
lookup_dict = tf_models attr_name = _re_tf_models.match(attr_name).groups()[0] elif _re_flax_models.match(attr_name) is not None: lookup_dict = flax_models attr_name = _re_flax_models.match(attr_name).groups()[0] elif _re_pt_models.match(attr_name) is not None: ...
Python
1
Box::new(Node::Leaf { hash: HashOf::<()>::from_hash(Hash([0; 32])), }), right: Box::new(Node::Leaf { hash: HashOf::from_hash(Hash([0; 32])), }), hash: HashOf::from_hash(Hash([0; 32])), }, }; ...
Rust
0
] #![allow(non_camel_case_types)] #![allow(clippy::all)] #![no_std] mod generic; pub use generic::*; #[doc = r"Register block"] #[repr(C)] pub struct RegisterBlock { #[doc = "0x00 - Module Control Register"] pub mcr: MCR, #[doc = "0x04 - IO Mux Control Register"] pub iocr: IOCR, #[doc = "0x08 - Ma...
Rust
0
de(rename = "IsCreationKey")] pub is_creation_key: bool, #[serde(rename = "Channels")] pub channels: Channels, pub resource_version: ResourceVersion, pub resource_type: ConstGmSpriteKeyframe, } #[derive(Debug, Serialize, Deserialize, Default, PartialEq, Eq, Clone)] pub struct Channels { #[serde...
Rust
0
id=message['_id'], content=message['content'], agent=message['agent'], timestamp=message['timestamp'], source=message['source'] ) self.history.append(msg) def _parse_answer(self, answer): ...
Python
1
eqs[s as usize]); state[j] = rans_renorm(reader, state[j])?; } i += 4; } Ok(()) } pub fn read_frequencies_0<R>( reader: &mut R, freqs: &mut [u32], cumulative_freqs: &mut [u32], ) -> io::Result<()> where R: Read, { let mut sym = reader.read_u8()?; let mut la...
Rust
0
the x86-64 ABI the register number mapping is defined in Figure 3.36: /// /// > Figure 3.36: DWARF Register Number Mapping /// > /// > <table> /// > <tr><th>Register Name</th> <th>Number</th> <th>Abbreviation</th></tr> /// > <tr><td>General Purpose Register RAX</td> ...
Rust
0
import asyncio import datetime import logging from pathlib import Path from apscheduler.events import EVENT_JOB_ERROR, EVENT_JOB_EXECUTED import infogami from openlibrary.config import load_config from openlibrary.utils.sentry import init_sentry from scripts.solr_builder.solr_builder.fn_to_cli import FnToCLI from scr...
Python
1
3ce137524349f422f399434e7365e5c6b904d466ddedd0639a5348413c758b8a5fa4a9c4adaf25e1c01f480fa9105c6820307df7336563a0b", "<KEY>", ]; for i in 0..inputs.len() { let input = hex::decode(inputs[i]).unwrap(); let mut tmp = [0u8; 128]; tmp.copy_from_slice(&input[..128]); ...
Rust
0
import cv2 import torch import time from deep_sort.utils.parser import get_config from deep_sort.deep_sort import DeepSort # Load the YOLOv5 model model = torch.hub.load('ultralytics/yolov5', 'custom', path='/home/jinjuuk/dev_ws/pt_files/yolov5s.pt') DeepSORT_path = '/home/jinjuuk/Yolov5_DeepSort_Pytorch' # Initializ...
Python
1
#!/usr/bin/env python3 """ Performs a convolution on grayscale images with custom padding. """ import numpy as np def convolve_grayscale_padding(images, kernel, padding): """ Performs a convolution on grayscale images with custom padding. """ m, h, w = images.shape kh, kw = kernel.shape ph, p...
Python
1
role whose "generate" is set to True. Returns: Tuple[str, bool]: The converted string, and whether the follow-up conversion should be proceeded. """ merged_prompt = role_dict.get( role_prompt['role'], role_dict.get(role_prompt.get('fallback_r...
Python
1
ict['recall@%d' % i] = tf.metrics.mean(best_query_ranks < i) metrics_dict['mean_reciprocal_rank'] = tf.metrics.mean( tf.pow(tf.to_float(best_query_ranks) + 1, -1)) avg_query_ranks = true_data['rank']['avg'] metrics_dict['avg-rank-average_query_rank'] = tf.metrics.mean(avg_query_ranks) num_candidates_wi...
Python
1
import numpy as np import pytest from building3d.geom.polygon import Polygon from building3d.geom.types import FLOAT from building3d.sim.rays.find_target import find_target_surface @pytest.mark.parametrize("x, y, ray_pos, ray_dir, expected_target", [ (1.0, 1.0, [0, 0, 1], [0, 0, -1], 0), (2.0, 2.0, [1, 1, 2...
Python
1
random_double(1,101); // auto z1 = z0 + w; // // boxes1.add(make_shared<box>(point3(x0,y0,z0), point3(x1,y1,z1), ground)); // } //} let mut list_1 = Vec::<Arc<dyn Geometry>>::default(); for i in 0..20 { for j in 0..20 { let v_min = Vector3::new( ...
Rust
0
extern crate probabilistic_collections; use chrono::{TimeZone, Utc}; use personal_search::indexer; use rusqlite::{params, Connection}; use std::io::prelude::*; use std::io::Read; use std::path::{Path, PathBuf}; use structopt::StructOpt; #[derive(StructOpt, Debug)] pub struct Opt { #[structopt(long = "backfill")...
Rust
0
TransformList([rotation, crop]) class PadTransform(Transform): def __init__(self, src_h, src_w, trg_h, trg_w): super().__init__() assert src_h <= trg_h, "expect src_h <= trg_h" assert src_w <= trg_w, "expect src_w <= trg_w" pad_left = int((trg_w - src_w) / 2) pad_right = ...
Python
1
.map(|s| s.into_repr()) .collect::<Vec<_>>(); let l_aux_acc = VariableBaseMSM::multi_scalar_mul(&pk.l_query, &aux_assignment); let r_s_delta_g1 = pk.delta_g1.into_projective().mul(r_repr).mul(s_repr); let v_eta_delta_inv = pk.eta_delta_inv_g1.into_projective().mul(v.into_repr()); end_...
Rust
0
{ prefix: &[], cursor: None, suffix: &[], } } } <reponame>mjsir911/weechat-discord<filename>src/command.rs use crate::utils::{ChannelExt, GuildOrChannel}; use crate::{buffers, discord, on_main_blocking, plugin_print, utils}; use lazy_static::lazy_static; use parking_lot:...
Rust
0
i32, bwork: &mut [i32], info: &mut i32) -> i32 { let mut work = [ Zero::zero() ]; let lwork = -1 as i32; unsafe { $xgees(jobvs, sort, None, n, a, lda, sdim, wr, wi, vs, l...
Rust
0
_Networking_WindowsWebServices\"`*"] pub struct WS_WSZ_DESCRIPTION { pub minCharCount: u32, pub maxCharCount: u32, } impl ::core::marker::Copy for WS_WSZ_DESCRIPTION {} impl ::core::clone::Clone for WS_WSZ_DESCRIPTION { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: ...
Rust
0
nt { let mut sheet = SpriteSheet::new(); sheet.path = PathBuf::from(reader.read_string_u16()?); sheet.color_key = reader.read_u32()?; self.sprite_sheets.push(sheet); } let _total_sprite_count = reader.read_u16()?; for sheet_idx in 0..sheet_count ...
Rust
0
atteryLife, 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 10} DEFINE_PROPERTYKEY!{PKEY_Devices_BatteryPlusCharging, 0x49CD1F76, 0x5626, 0x4B17, 0xA4, 0xE8, 0x18, 0xB4, 0xAA, 0x1A, 0x22, 0x13, 22} DEFINE_PROPERTYKEY!{PKEY_Devices_BatteryPlusChargingText, 0x49CD1F76, 0x5626, 0x4B...
Rust
0
_owned(); result.content_type = Some(value) }; if let Some(request_characters) = response.headers.get("x-amzn-RequestCharacters") { let value = request_characters.to_owned(); ...
Rust
0
Self { W(writer) } } #[doc = "Field `se_sha_0_dout_endian` reader - "] pub struct SE_SHA_0_DOUT_ENDIAN_R(crate::FieldReader<bool, bool>); impl SE_SHA_0_DOUT_ENDIAN_R { pub(crate) fn new(bits: bool) -> Self { SE_SHA_0_DOUT_ENDIAN_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for ...
Rust
0
ive(Debug, Copy, Clone)] #[repr(u32)] pub enum EnigoMouseButton { /// Left mouse button Left, /// Middle mouse button Middle, /// Right mouse button Right, /// Scroll up button ScrollUp, /// Left right button ScrollDown, /// Left right button ScrollLeft, /// Left rig...
Rust
0
rows the other way to make the space look rectangular. for _ in 0..(y - starty + 1) / 2 { buf.write_all("\u{ff0e}".as_bytes())?; } buf.write_all(b"\n")?; } Ok(()) } pub(crate) fn println(&self) { self.println_highlights(&[]); } ...
Rust
0
_modes .retain(|inst| is_zombie(inst, &zombies).is_none()); module .debug_string_source .retain(|inst| is_zombie(inst, &zombies).is_none()); module .debug_names .retain(|inst| is_zombie(inst, &zombies).is_none()); module .debug_module_processed .retain...
Rust
0
::io::{prelude::*, BufReader}; use std::path::{Path, PathBuf}; use std::process::exit; use structopt::StructOpt; mod password; /// Struct for the parameters of the app. #[derive(Debug, StructOpt)] #[structopt( name = "easypassword", about = "A program to create passwords like in xkcd.com/936. One seperator sh...
Rust
0
it, the `"rocksdb"` feature needs to be activated. /// /// Usage example: /// ``` /// use oxigraph::RocksDbStore; /// use oxigraph::model::*; /// use oxigraph::sparql::QueryResults; /// # use std::fs::remove_dir_all; /// /// # { /// let store = RocksDbStore::open("example.db")?; /// /// // insertion /// let ex = Named...
Rust
0
(call_info .input .take_while(move |item| { let condition = condition.clone(); let registry = registry.clone(); let scope = Scope::append_var(scope.clone(), "$it", item.clone()); trace!("ITEM = {:?}", item); async m...
Rust
0
InfSup::Sup => Number::Infinity, }, } } else { Number::Rational(center.clone()) } } fn uncertain_interval(s: &str) -> IResult<&str, Result<NInterval>> { map( separated_pair( recognize(pair(sign, dec_significand)), char('?'), ...
Rust
0
ruler, timeline, } } fn model(app: &App) -> Model { let window_id = app .new_window() .key_pressed(key_pressed) .raw_event(raw_window_event) .size(WIDTH, HEIGHT) .title("Timeline Demo") .view(view) .build() .unwrap(); // Create the UI...
Rust
0
olor: #fff; --secondary-background-color: #1e1e1e !important; --tb-orange-strong: #1e1e1e !important; } body.dark-mode .mat-toolbar { background-color: #1e1e1e !important; } .tab-bar { background-color: #1e1e1e !important; } app-header-dark-mode-toggle { display: none; } </style> """ ) add(b"</hea...
Python
1
` gating as well as writing more automated tests. //! //! # History //! This library is a Rust translation of the [yubico-piv-tool] utility by //! Yubico, which was originally written in C. It was mechanically translated //! from C into Rust using [Corrode], and then subsequently heavily //! refactored into safer, more...
Rust
0
import pytest from nats.js import JetStreamContext from nats.js.api import StreamConfig from nats.js.errors import NotFoundError from nats_app.app import NATSApp from nats_app.router import NATSRouter @pytest.mark.parametrize( "prefix, subsubject, expected", [ pytest.param("", "subject", "subject", i...
Python
1
d, period = _,) )))); } let exact_match = accounts .iter() .position(|account| account.nickname == query) .map(|index| accounts.remove(index)); if let Some(exact_match) = &exact_match { account_info_cache.put(exact_match).await?; } accounts.sort_unstable_by(|l...
Rust
0
let mut program = Program::new(vec!['0', '1'], State(2)); program .extend([ (1, '0', 2, '0', Move::Left), (2, '0', 0, '0', Move::None), (2, '1', 2, '1', Move::Left), ]) .unwrap(); Classic::new(program, '0').unwrap() ...
Rust
0
_empty() { keys = load_pkcs8_keys(&path)?; } if keys.is_empty() { return Err(key_not_found_err()); } Ok(keys) } pub struct TlsListenerResource { tcp_listener: AsyncRefCell<TcpListener>, tls_config: Arc<ServerConfig>, cancel_handle: CancelHandle, } impl Resource for TlsListenerResource { fn n...
Rust
0
# -*- coding: utf-8 -*- """ Created on Sun Jul 29 08:40:49 2018 @author: user """ import numpy as np from matplotlib import pyplot as plt from skimage.filters import threshold_mean import network from keras.datasets import mnist # Utils def reshape(data): dim = int(np.sqrt(len(data))) data = np.reshape(data,...
Python
1
ta provided)") # continue # node = self.model.nodeDic.get(data_idx, -1) # if type(node) is not int: # node.img = img # def loadFromTwo360Folders(self, imgs360_folder: str, data_folder: str): # self.logger.info("Loading 360 images from folders...") #...
Python
1
(Hash, u64) { let check_hash = false; let (hash, total_lamports) = self .calculate_accounts_hash_helper_with_verify( use_index, debug_verify, slot, ancestors, expected_capitalization, can_cached_s...
Rust
0
#[doc = "`write(|w| ..)` method takes [events_stopped::W](events_stopped::W) writer structure"] impl crate::Writable for EVENTS_STOPPED {} #[doc = "The ADC has stopped"] pub mod events_stopped; #[doc = "Publish configuration for event STARTED\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crat...
Rust
0
4, #[doc = "Mode 3 permitted"] MODE3, #[doc = "Mode 2 permitted"] MODE2, #[doc = "Mode 1 permitted"] MODE1, #[doc = "Mode 0 permitted"] MODE0, #[doc = r" Reserved"] _Reserved(u8), } impl AVAILR { #[doc = r" Value of the field as raw bits"] #[inline] pub fn bits(&self)...
Rust
0
type Proto = proto::cosmos::staking::v1beta1::MsgDelegate; } impl TryFrom<proto::cosmos::staking::v1beta1::MsgDelegate> for MsgDelegate { type Error = ErrorReport; fn try_from(proto: proto::cosmos::staking::v1beta1::MsgDelegate) -> Result<MsgDelegate> { MsgDelegate::try_from(&proto) } } impl TryF...
Rust
0
k_value_str.parse::<u64>(), "IPA Invalid ID"); try_or_error!(q.seek_channel_to_id(channel_name, id, self.clock)); }, _ => return NotifyMessage::with_error("IPA Invalid Seek Type Expected TS or ID") } NotifyMessage::with_int(2) } fn hmget(&self, args: &[&[...
Rust
0
t.process_word(text)?); } let t = Transliterator::new(Charset::Latin, Charset::Cyrillic, false, true, false); for (text, expected) in vec![ ("example", "еxампле"), ("例子", "例子"), ("مثال", "مثال"), ("példa", "пéлда"), ] { assert_...
Rust
0
:param resource: The email address you want to access :param scopes: The permission scopes for the resource :param token_backend: The backend used for storing OAuth token """ self.scopes = scopes self.resource = resource self.o365_acct = ...
Python
1
and![Cond::new(3, ArgLen::DWORD, Eq, libc::MAP_SHARED as u64)?], and![Cond::new( 3, ArgLen::DWORD, Eq, (libc::MAP_FIXED | libc::MAP_ANONYMOUS | libc::MAP_PRIVATE) as u64 )?], ...
Rust
0
ouse.get_pressed() update_cd(game_manager.clock) #update global cooldowns for event in game_manager.events: # events loop handling (single_time pressed events) if event.type == pygame.QUIT: game_manager.running = False if event.type == pygame.MOUSEBUTTONDOWN: # mouse click ...
Python
1
_ref = f":mens: [{title}]({url})" else: link_ref = title response = { 'name': title, 'affiliation': i.get('affiliations', ''), 'n_cited_by': i.get('cited_by', ''), 'ur...
Python
1
interval: Interval, ) -> Result<Literal, ErrorInfo> { let usage = "to_string() => string"; if !args.is_empty() { return Err(gen_error_info( Position::new(interval, &data.context.flow), format!("usage: {}", usage), )); } ...
Rust
0