text
string
label_name
string
labels
int64
from pymtl import * from tests.context import lizard from lizard.util.rtl.divide import DivideInterface, NonRestoringDivider from tests.config import test_verilog from lizard.util.test_utils import run_model_translation, run_test_vector_sim from lizard.model.test_model import run_test_state_machine from lizard.model.wr...
Python
1
import numpy as np class GetData: def __init__(self, n_instance: int, n_facilities: int, n_customers: int, max_capacity: int, max_demand: int, max_cost: int): """ Initialize the GetDataCFLP class for the Capacitated Facility Location Problem. Args: n_instance: Number of instan...
Python
1
pool_mode=('max', 'avemax3'), x1_rate=0.7, n_folds=10, get_backbone=get_conv_backbone, pretrained='../model/v1mixpretrainedbest.h5', ) main(cfg, cnn_model) cfg = Config( duration=5, name='model_MSC_se_r4_1.0_10fold', lr=0.0005, batch_size...
Python
1
alternative = models.CharField(max_length=50) def clean(self): if self.user_id and self.session_key: raise ValidationError("Only one of user_id or session_key can be set") elif not self.user_id and not self.session_key: raise ValidationError("Must set a user_id or session_...
Python
1
CountK"] if "PathlineFeature" not in self.dastasetMetaInfo: logging.warning("PathlineFeature not in self.dastasetMetaInfo,assume 10" ) else: PathlineFeature= self.dastasetMetaInfo["PathlineFeature"] PathlineCount=int(PathlineCountK/2)*int(PathlineCountK/2)*4 oneF...
Python
1
import numpy as np import scipy def generate_interpolated_path(poses, n_interp, spline_degree=5, smoothness=.03, rot_weight=.1): """Creates a smooth spline path between input keyframe camera poses. Spline is calculated with poses in format (position, lookat-point, up-point). A...
Python
1
Negate the weight for compatibility with shortest_path() pub (crate) fn longest_paths_mult(edges: &[Edge]) -> Result<BTreeMap<Pair, Path>, PathCalculationError> { let edges = unique_cheapest_edges(edges, Ordering::Greater); // record the original weights let weight_map: BTreeMap<(Pair, usize), f64> = edges...
Rust
0
skip trailing ']' right: Box::new(parse_pair(&input[split_i + 1..input.len() - 1])), } } } #[derive(Clone, Debug, PartialEq)] enum Node { Literal { value: usize }, Pair { left: Box<Node>, right: Box<Node> }, } type LeftValue = usize; type RightValue = usize; impl Node { fn calc_mag...
Rust
0
if self.box_insert.mode == BoxInsertMode::Normal { e_disp_x = get_row_width(&self.buf.char_vec_line(sy)[..ex], 0, false).1; self.set_cur_target(sy, sx, false); } else { // BoxSelMode::InsertStr e_disp_x ...
Rust
0
ACTION YES') d.setReport('F-FACTOR YES') # Write the report to file d.writeReport() report_file_string_1 = open('TestReport1.txt').read() # create str varible d.setReportFormatReset() d.setReport('FILE TestReport2.txt') d.setTimeStatisticsType('AVERAGE') d.setReport('NODES 10') d.setReport('HEAD YES') d.setReport('...
Python
1
import dash import warnings import importlib from collections import defaultdict import feffery_antd_components as fac from typing import Union, Literal, Any, List, Callable, Dict try: import pandas as pd except ImportError: warning_message = ( '检测到您的环境中未安装\033[93mpandas\033[0m,' '部分工具函数如\033[9...
Python
1
channel::Message}; use std::fs::File; async fn test_context(authors: Vec<User>, maps: Vec<GameMap>) -> Context { let context = commands::mock_context::tests::mock_context(); let user_count = authors.len() as u32; { let game = Game::new( vec![], DraftPool::new(authors, 2 * user_cou...
Rust
0
IGHT, "Tilt Wrist", "[Y]/[U]") self.add_overlay(const.GRID_TOPRIGHT, "Slow down/Speed up", "[-]/[=]") self.add_overlay( const.GRID_BOTTOMRIGHT, "Reset took", "%.2f sec." % (sum(self.elapsed) / len(self.elapsed)), ) self.add_overlay(const.GRID_BOTTOMRI...
Python
1
(&mut self) -> TRIMCOAR_W { TRIMCOAR_W { w: self } } } #[cfg(not(feature = "no_log"))] #[test] fn test_output() { use simple_logger::SimpleLogger; use tree_decorator::{ decorator::Entry, DecoratorBuilder, tree_item_info, tree_item_debug, tree_item_error, tr...
Rust
0
if quantize_lambda is not None: if isinstance(modelz, nn.DataParallel): modelz.module.replace_bias(model.module, weight_name) else: modelz.replace_bias(model, weight_name) model_test(modelz, epoch, test_loader, ...
Python
1
rt = bert_model self.dropout = torch.nn.Dropout(0.2) # Maps the output of the bert into label space. self.lstm = nn.LSTM(self.embedding_dim, hidden_dim // 2, num_layers = 1, bidirectional = True, batch_first = True) self.hidden2label = nn.Linear(self.hidden_dim, self.num_labels) ...
Python
1
let vals = [ (1 as u64, "0100000000000000"), (0xffff_ffff_ffff_ffff, "ffffffffffffffff"), (0x0000_ffff_0000_ffff, "ffff0000ffff0000"), (0xFF00_FF00_FF00_FF00, "00ff00ff00ff00ff"), ]; for (v, b) in &vals { let buff: &mut Vec<u8> = &mut ...
Rust
0
nts(event) self.screen.fill((255, 255, 255)) for y in range(self.current_iteration + 1): for x, cell in enumerate(self.automaton[y]): color = (0, 0, 0) if cell == '1' else (255, 255, 255) pygame.draw.rect(self.screen, color, ...
Python
1
} r => Err(Error::Internal(format!("Unexpected result {:?}", r))), } } } extern crate docopt; extern crate regex; extern crate regex_syntax as syntax; extern crate serde; #[macro_use] extern crate serde_derive; use std::error; use std::io::{self, Write}; use std::process; use std::result; use ...
Rust
0
torchscript happy (cannot use tensor as tuple) lepe = self.lepe(rearrange(x, 'n (h w) c -> n c h w', h=H, w=W)) lepe = rearrange(lepe, 'n c h w -> n (h w) c') attn = (q @ k.transpose(-2, -1)) * self.scale attn = attn.softmax(dim=-1) attn = self.attn_drop(attn) x = (at...
Python
1
ref().map(|_| Probe::Jlink), log_swo.is_some(), log_dso.is_some(), color, )?, probe_cell( probe_openocd.as_ref().map(|_| Probe::Openocd), log_swo.is_some(), log_dso.is_some(), color, ...
Rust
0
> { Box::new(move |logger| { let start = Command::new("systemctl") .arg("start") .arg("--no-block") .arg(&service_name) .output() .with_context(|_| ErrorKind::ServiceOpFailed("start"))?; if !start.status.success() { let stderr =...
Rust
0
window::{Window, WindowBuilder}, }, webview::{RpcRequest, WebViewBuilder}, }; let event_loop = EventLoop::new(); let mut webviews = std::collections::HashMap::new(); let window = WindowBuilder::new() .with_decorations(false) .build(&event_loop) .unwrap(); let url = r#"data:text/ht...
Rust
0
ce-between; align-items: center; margin-bottom: 0.5rem; } .post-header h3 { font-size: 1.3rem !important; font-weight: 600 !important; color: #1b5e20 !important; margin: 0; } .category-tag { display: inline-block; padding: 0.3rem 0.7rem; ...
Python
1
", encoding="utf-8") as f: for line in f: line = line.strip() if line: lines.append(line) annotations = [] for obj_id, line in enumerate(lines): parts = line.split() if len(parts) != 5: raise Invalid...
Python
1
Display information about the creator. Behavior: - Prints a message indicating the user's intent to learn about the creator. """ print("hmmm u wanna know about me me crying :)") def resume_pause_menu(): """ Resume the game from the pause menu. Behavior: - Removes the pause menu f...
Python
1
ikipedia.org/wiki/Trapezoidal_rule # Normalize by common bbox and get the bbox fill ratio # Call this ratio the "distance" # The box area is an early-exit filter for non-intersected figures bbox = max_bbox([a, b]) box_area = bbox[2] * bbox[3] if not box_area: ...
Python
1
}) } } mod test_str_add { use ::mutagen::mutate; use ::mutagen::MutagenRuntimeConfig; // strings cannot be subtracted, the mutation that changes `+` into `-` should panic #[mutate(conf = local(expected_mutations = 1), mutators = only(binop_num))] fn str_add() -> String { "a"....
Rust
0
status_code=status.HTTP_404_NOT_FOUND, detail="Context not found" ) if context_data.name is not None: ctx.name = context_data.name if context_data.description is not None: ctx.description = context_data.description if context_data.original_content is not None: ctx....
Python
1
import random __all__ = ["faker"] class Base62: BASE = 62 CHARSET = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" def encode(self, b: bytes) -> str: encoded: list[str] = [] for byte in b: i = byte % self.BASE encoded.append(self.CHARSET[i]) ...
Python
1
pedPages, MappedPages, MappedPages, [Option<MappedPages>; 32], [Option<MappedPages>; 32]), &'static str> { // bootstrap a PageTable from the currently-loaded page table let mut page_table = PageTable::from_current(); let boot_info_start_vaddr = VirtualAddress::new(boot_info.start_address()).map_err(|_| "bo...
Rust
0
)* }; } /// A mapping from known rdf syntaxes to their canonical corresponding preferred file-extensions pub static SYNTAX_TO_EXTENSION_CORRESPONDENCE: Lazy< HashMap<RdfSyntax, Correspondent<FileExtension>>, > = Lazy::new(|| { let mut map: HashMap<RdfSyntax, Correspondent<FileExtension>> = HashMap::new();...
Rust
0
ance,Ticker): coin_info = binance.fetch_ticker(Ticker) coin_price = coin_info['last'] # coin_info['close'] == coin_info['last'] return coin_price def ExistOrderSide(binance,Ticker,Side): #주문 정보를 읽어온다. orders = binance.fetch_orders(Ticker) ExistFlag = False for order in orders: i...
Python
1
erive_conversions_for_ast!(Flag<'a>, Induct); derive_conversions_for_ast!(Flag<'a>, Inline); derive_conversions_for_ast!(Flag<'a>, InlineInvariant); derive_conversions_for_ast!(Flag<'a>, InlineOnce); derive_conversions_for_ast!(Flag<'a>, IsAbstract); derive_conversions_for_ast!(Flag<'a>, IsAccessor<'a>); derive_convers...
Rust
0
# PROVA AULA 05 Desenvolva um programa em Python para calcular a média de notas de alunos em uma disciplina. O programa deve solicitar ao usuário o número de alunos e, em seguida, para cada aluno, pedir o nome e três notas. Utilize um loop 'for' para iterar sobre os alunos e suas notas. # Além disso, implemente uma es...
Python
1
weights_regularizer=slim.l2_regularizer(l2_penalty), scope="experts-"+sub_scope) gating_distribution = tf.nn.softmax(tf.reshape( gate_activations, [-1, num_mixtures + 1])) # (Batch * #Labels) x (num_mixtures + 1) expert_distribution = tf.nn.sigmoid(tf.reshape( expert_activati...
Python
1
import pytest import sysconfig import numpy as np from numpy.testing import assert_, assert_raises, IS_WASM # The floating point emulation on ARM EABI systems lacking a hardware FPU is # known to be buggy. This is an attempt to identify these hosts. It may not # catch all possible cases, but it catches the known case...
Python
1
# Copyright 2020-2021 Huawei Technologies Co., Ltd # # 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 agre...
Python
1
pub fn new(path: PathBuf) -> Self { Self { path: path, allocation_batch_size: 1_000, servers: 1, live: true, ipc_to_suricata_channel_size: 1, } } pub fn into_plugin<'a>(self) -> Result<(IpcPlugin, Vec<packet_ipc::Server<'a>>), Erro...
Rust
0
import pandas import cmdstanpy import numpy as np from scipy import stats from plotnine import * d = pandas.read_csv('input/data-shopping-1.csv') N = len(d) fit = cmdstanpy.from_csv('output/result-model5-3') mu_ms = fit.stan_variable(var='mu') N_ms = len(mu_ms) noise_ms = np.repeat(d.Y.to_numpy()[None, :], N_ms, axis...
Python
1
from kivy.app import App from kivy.uix.widget import Widget from kivy.uix.label import Label from kivy.lang import Builder arrangement_1 = ''' <RootWidget>: LevelOneWidget: id: level1 LevelTwoWidget: id: level2 ''' arrangement_2 = ''' <LevelOneWidget>: custom: "Lvl" LevelTwoW...
Python
1
r> { if urls.is_empty() { return Err(Error::NoEngines); } let engines = urls .into_iter() .map(|url| { let id = url.to_string(); let api = HttpJsonRpc::new(url)?; Ok(Engine::new(id, api)) }) ...
Rust
0
return True else: logger.error("知識庫管理器未初始化") return False except Exception as e: logger.error(f"知識資源掃描失敗: {e}") return False def search_knowledge(self, query: str, limit: int = 10) -> List[Dict[str, Any]]...
Python
1
=status.HTTP_401_UNAUTHORIZED, detail=f"Invalid API key: {error_message}", headers={"WWW-Authenticate": "Bearer"} ) # Check required scope if self.required_scope: permissions = api_key_manager._deserialize_permissions(api_key_model.permiss...
Python
1
small stride -> higher resolution.""") parser.add_argument('--model_type', default='dino_vits8', type=str, help="""type of model to extract. Choose from [dino_vits8 | dino_vits16 | dino_vitb8 | dino_vitb16 | vit_small_pa...
Python
1
# coding: utf-8 from __future__ import absolute_import from datetime import date, datetime # noqa: F401 from typing import List, Dict # noqa: F401 from openapi_server.models.base_model_ import Model from openapi_server import util class OperationSortResultsScoreParameters(Model): """NOTE: This class is auto ...
Python
1
Box<dyn Fn(&mut QueryPlanner, TypedBufferRef, TypedBufferRef) -> TypedBufferRef + Sync>; struct Function2 { pub factory: Factory, pub type_rhs: BasicType, pub type_lhs: BasicType, pub type_out: Type, pub encoding_invariance: bool, } impl Function2 { pub fn integer_op(factory: Factory) -> Func...
Rust
0
ể 1 biến cố kiện xảy ra với tần suất là $k$ khi thực hiện một số lượng phép thử $n$, $n \geq k$. Phân phối này là trường hợp tổng quát của phân phối Bernoulli cho tần suất nhiều hơn 1 biến cố xảy ra và có hàm phân phối xác xuất là: # # $$f_{p}(k) := P(X=k)=\binom{k}{n}p^{k}(1-p)^{n-k}$$ # # $\binom{k}{n}$ chính là xá...
Python
1
t_home().return_const(home.clone()); mock.expect_project_home().return_const(hygeia_home.clone()); mock.expect_paths().return_const(paths.clone()); let paths_provider = PycorsPathsProvider::from(mock); let cwd = home.join("current_dir"); fs::create_dir_all(&cwd).unwrap(); ...
Rust
0
taset( cameras=TEST_CAMS, sequence=sequence, start_idx=time_step, end_idx=time_step + 1, n_cameras_per_frame=config.gaussian_splatting_settings.camera_batch_size, ) # get loaders train_loader = DataLoader( train_set, batch_size=None, shuffle=T...
Python
1
:u8 = 0xB; const PROGRAM_CHANGE:u8 = 0xC; #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] pub enum MidiMessage { NoteOff(Channel, Note, Velocity), ProgramChange(Channel, ProgramNumber), ControlChange(Channel, ControllerNumber, ControllerValue), NoteOn(Channel, Note, Velocity), ...
Rust
0
" fn(arg1: *mut ::std::os::raw::c_void), >, ) -> ::std::os::raw::c_int; } extern "C" { pub fn pthread_key_delete(__key: pthread_key_t) -> ::std::os::raw::c_int; } extern "C" { pub fn pthread_getspecific(__key: pthread_key_t) -> *mut ::std::os::raw::c_void; } extern "C" { pub fn pthread_setspecif...
Rust
0
import random import sys import math n = int(sys.argv[1]) m = int(sys.argv[2]) U = int(sys.argv[3]) perturb_ratio = float(sys.argv[4]) if len(sys.argv) > 4 else 0 job_matrix = [[i for t in range(U)] for i in range(m)] nb_jobs = m while nb_jobs < n: # cut each machine AT LEAST ONCE rand_i = nb_jobs-m ...
Python
1
from pathlib import Path # Configuration settings for GenomeML DEFAULT_SETTINGS = { 'FILE_NUM': 0, 'FILE_NUM2': 0, 'DO_RANGE': False, 'DO_DOUBLE_COLUMNS': False, 'DO_ENSEMBLE': False, 'DO_PCA': False, 'DO_SINGLE_COLUMN': True, 'KFOLD': False, 'TRANSPOSE': False, 'PCA_COMPONENTS...
Python
1
from django.contrib.auth.decorators import login_required from django.utils.decorators import method_decorator from django.views.generic import TemplateView @method_decorator(login_required, name="dispatch") class TestingBreakdownView(TemplateView): # pylint: disable=missing-permission-required template_name = "...
Python
1
rt] macro_rules! my_vec { ( $( $x:expr ),* ) => { { let mut temp_vec = Vec::new(); $( temp_vec.push($x); )* temp_vec } }; } let vec = my_vec![1, 2, 3]; println!("macro_rules: vec i...
Rust
0
11.0, 13.0, 14.0, 12.0, 13.0, 15.0, 16.0, 13.0, 14.0, 16.0, 17.0, 0.0, 1.0, 3.0, 4.0, 1.0, 2.0, 4.0, 5.0, 3.0, 4.0, 6.0, 7.0, 4.0, 5.0, 7.0, 8.0, 9.0, 10.0, 12.0, 13.0, 10.0, 11.0, 13.0, 14.0, 12.0, 13.0, 15.0, 16.0, 13.0, 14.0, 16.0, 17.0, ] ) } #[allow(unused_mut)] fn...
Rust
0
elf._pump) identifiers=list(di['identifiers'])[0] pump=("pump_"+str(self._pump),) identifiers+=pump di['identifiers']={identifiers} return di ################################################################################ # WAVE class ReefWaveSelectEntity(ReefBeatSelectEnti...
Python
1
L = 1.76 b_f = 0.22 t_f = 0.005 t_w = 0.006 t_i = 0.01 d = 0.58 rho_a = 2700. rho_i = 20. V_a = L*(b_f*t_f*2+(d-2*t_f)*t_w) V_c = 0.8 V_i = (L+2*t_i)*( (b_f+2*t_i)*(t_f+2*t_i)*2 + (d+2*t_i-2*(t_f+2*t_i))*(t_w+2*t_i) ) - V_a p_0 = 101.325 R = 0.008314 W = 0.028...
Python
1
# This file is part of libigl, a simple c++ geometry processing library. # # Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com> # # This Source Code Form is subject to the terms of the Mozilla Public License # v. 2.0. If a copy of the MPL was not distributed with thi...
Python
1
# coding=utf-8 import logging logger = logging.getLogger("mycodo.atlas_scientific") def constraints_pass_percent(mod_dev, value): """ Check if the user input is acceptable :param mod_dev: SQL object with user-saved options :param value: float or int :return: tuple: (bool, list of strings) """...
Python
1
self.assertEqual( response.status_code, 201 ) def test_recipe_api_list_logged_user_can_update_a_recipe(self): # Arrange (config do test) recipe = self.make_recipe() access_data = self.get_auth_data(username='test_patch') jwt_access_token = acces...
Python
1
# generate job status transition graph # usage: # 1) run ganga and this file as a script # or 2) cd ganga/python, run python interactively and execfile(this_file) ARC_LABELS = True STYLED_EDGES = True DEBUG = False from Ganga.GPIDev.Lib.Job import Job import os g = Job.status_graph initial_states = Job.initial_s...
Python
1
[[-0.6, 0. ], [ 0.2, -0.6]], [[-0.1, 0. ], [ 0.1, -0.1]]]) a31 = np.r_[np.eye(3)[None,:,:], 0.8*np.eye(3)[None,:,:]] a32 = np.array([[[ 1. , 0. , 0. ], [ 0. , 1. , 0. ], [ 0. , 0. , 1. ...
Python
1
_name() )))), } } pub fn format_markdown(&self) -> String { use NixValue::*; match self { Str(_) | Bool(_) | Float(_) | Integer(_) | Null => format!("```nix\n{}\n```", self), Map(_) => format!("```text\n{}\n```", self), } } } /// Maximum ...
Rust
0
import imp import logging import os import xml.etree.ElementTree as ElTree import config def save_xml(results): host_parts = [] host_buf = [] for host in results: host_buf.append(host) if len(host_buf) == config.max_xml_entries: host_parts.append(host_buf) host_buf...
Python
1
# encoding=UTF-8 # Copyright © 2009-2017 Jakub Wilk <jwilk@jwilk.net> # # This file is part of pdf2djvu. # # pdf2djvu is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. # # pdf2djvu is distributed in t...
Python
1
::Zero), sae: false, mask: Some(MaskReg::K1), broadcast: None, }, &[98, 241, 124, 169, 81, 244], OperandSize::Dword, ) } #[test] fn vsqrtps_16() { run_test( &Instruction { mnemonic: Mnemonic::VSQRTPS, operand1: Some(Dir...
Rust
0
import os import unittest from pyats.topology import loader from genie.libs.sdk.apis.iosxe.icmp.configure import unconfigure_icmp_ip_reachables class TestUnconfigureIcmpIpReachables(unittest.TestCase): @classmethod def setUpClass(self): testbed = f""" devices: n08HA: con...
Python
1
format(fps), (2, frame.shape[0] - 4), cv2.FONT_HERSHEY_TRIPLEX, 0.4, (255, 255, 255), ) cv2.imshow("preview", frame) if cv2.waitKey(1) == ord("q"): break # If we're in a tracking session and we found no matches, restart. ...
Python
1
=> write!(f, "TIBRV_INTR"), TIBRV_INVALID_DISPATCHABLE => write!(f, "TIBRV_INVALID_DISPATCHABLE"), TIBRV_INVALID_DISPATCHER => write!(f, "TIBRV_INVALID_DISPATCHER"), TIBRV_INVALID_EVENT => write!(f, "TIBRV_INVALID_EVENT"), TIBRV_INVALID_CALLBACK => write!(f, "TIBRV_INVAL...
Rust
0
import yfinance as yf import pandas as pd import ta # List of NIFTY 50 stock tickers in NSE format nifty50_tickers = [ "RELIANCE.NS", "TCS.NS", "HDFCBANK.NS", "INFY.NS", "HINDUNILVR.NS", "ITC.NS", "ICICIBANK.NS", "KOTAKBANK.NS", "SBIN.NS", "AXISBANK.NS", "LT.NS", "BAJFINANCE.NS", "BHARTIARTL.NS", "ASIANPAI...
Python
1
Can't get specific timezone for this user") if args.utc_offset: print("[\033[91m!\033[0m] Applying timezone offset %d (--utc-offset)" % args.utc_offset) print("[+] statuses_count : \033[1m%s\033[0m" % user_info.statuses_count) # Will retreive all Tweets from account (or max limit) num_tweets ...
Python
1
eft to right, top to bottom) as a single string of uppercase letters. No explanations or additional text." }, { "type": "image_url", "image_url": { "url": f"data:image/jpeg;base64,{ima...
Python
1
from keras.layers.core import Dense from keras.models import Sequential from keras.layers import Bidirectional, TimeDistributed, Dropout from keras.layers import LSTM import numpy as np import keras from BiLSTM.smorms3 import SMORMS3 from BiLSTM.prepare_dataset import load_dataset def train_bilstm(): model = Seq...
Python
1
# (c) adarsh-goel import os from os import getenv, environ from dotenv import load_dotenv load_dotenv() class Var(object): MULTI_CLIENT = False API_ID = int(getenv('API_ID', '19061625')) API_HASH = str(getenv('API_HASH', '4534b1d0579daa0f770f4f3d520c94d5')) BOT_TOKEN = str(getenv('BOT_TOKEN', '69145...
Python
1
_V1: SkimMatcher = SkimMatcher::default(); static ref SKIM_V2: SkimMatcherV2 = SkimMatcherV2::default().element_limit(BYTES_1M); static ref CLANGD: ClangdMatcher = ClangdMatcher::default(); } pub fn fuzzy_match(choice: &str, pattern: &str, fuzzy_algorithm: FuzzyAlgorithm) -> Option<(i64, Vec<usize>)> { if ...
Rust
0
import ccxt from datetime import datetime FACTOR_0 = 0.01 FACTOR_1 = 0.4 def sliding_window(lst, window_size): for i in range(len(lst) - window_size + 1): yield lst[i:i + window_size] def combine_candles(candles): time = candles[0][0] o = candles[0][1] h = max(candles, key=lambda x: x[2])[2]...
Python
1
import os import sys import logging from typing import Any import polars as pl current_dir = os.path.dirname(os.path.abspath(__file__)) sys.path.append(current_dir) from config import load_config # noqa: E402 # Load config config: dict[str, Any] = load_config() log_level: str = getattr(logging, config["settings"]["...
Python
1
"Dense NodeSubset does not support nodes()")] fn dense_nodes() { let node_subset = NodeSubset::full(42); node_subset.nodes(); } #[test] #[should_panic(expected = "Dense NodeSubset does not support node(idx)")] fn dense_node() { let node_subset = NodeSubset::full(42); ...
Rust
0
((mouse_x * 2) + 1, 111) } else { i32::max(0, (mouse_x * 2) - (width as i32 + 1)) }; let tip_y = if map_pos.y > HEIGHT as i32 / 2 { mouse_y - height as i32 } else { mouse_y }; batch.draw_box( ...
Rust
0
eue to empty work.stop(); Ok(()) } /// Add channel fn add(name: &str, service_str: &str) -> Result<()> { let service = Service::from_str(service_str)?; let cid = crate::source::invidious::find_channel_id(name, &service)?; match &cid { ChannelID::Youtube(ytid) => { let yt = cra...
Rust
0
e, nyxr0ydv6fi, wefj8xfhmqc as xi0ox3xcja2, mkcqb_tx96l as ir5i5_tdi6i, tpskroaihk7, nqn20ufww52 as l2wjcuz4f_6, sbbqx60pr59 import gx9u3kzj5f_ as ot7zd5nrcxo, wru9ebdbst5 raise jepin2kmlh1 assert vre0n05zzq7, '' del af43dbnmab9 '# eves_authorizations_opportunities -> copies_rollouts_vent' retur...
Python
1
# Simula recomendações externas mock_external.return_value = [ {'id': 'ext1', 'volumeInfo': {'title': 'External Book 1'}}, {'id': 'ext2', 'volumeInfo': {'title': 'External Book 2'}} ] recommendations = self.engine.get_recommendations(self.eclectic_use...
Python
1
al` MIDI file types, `TrackNumber` can be empty, and defaults to /// track index. TrackNumber(Option<u16>), Text(&'a [u8]), Copyright(&'a [u8]), TrackName(&'a [u8]), InstrumentName(&'a [u8]), Lyric(&'a [u8]), Marker(&'a [u8]), CuePoint(&'a [u8]), ProgramName(&'a [u8]), Device...
Rust
0
"""Code Coverage Test. Note: File : test_functions.py Author : Baiqi.Lu <ittuann@outlook.com> (https://github.com/ittuann) License: GNU AGPLv3 """ from pathlib import Path import pandas as pd import pytest from scripts.build import build_docs, update_404page_title from scripts.config import Config, cf...
Python
1
ult_{req_id}.clstr") res = cd_hit( i=input_fasta, o=out_fasta, c=c, T=T, n=n ) # df_clstr = read_clstr(out_clstr) # df_clstr.to_csv(os.path.join(output_dir, "cluster_result.csv"), index=False) # print(df_clstr) def protein_seq_reverse_translate(input_faste, ...
Python
1
_left.x as u16, shape.top_left.y as u16, shape.bottom_right.x as u16, shape.bottom_right.y as u16, iter, ) }, (Some(fill), Some(stroke)) => { let fill_color = RawU16::from(fill).into_i...
Rust
0
_nmos), Some(action)), IZP(action) => (bus_izp(op), Some(action)), IZX(action) => (bus_izx(op, is_nmos), Some(action)), IZY(action) => (bus_izy(op, action, is_nmos), Some(action)), NONE => (bus_none(op), None), _ => return None, }; let tests = bases .iter() ...
Rust
0
#!/usr/bin/env python # coding=utf-8 # 绘制 相机3D轨迹 # 使用 python draw_groundtruth_Rt_associate.py import numpy import matplotlib.pyplot as plt import mpl_toolkits.mplot3d import sys # 数据匹配======= import associate def align(model,data): """Align two trajectories using the method of Horn (closed-form). 匹配误差计算===...
Python
1
} } #[derive(AsChangeset)] #[primary_key(id, bar = "baz")] struct UserForm1 { id: i32, name: String, } #[derive(AsChangeset)] #[primary_key(id, qux(id))] struct UserForm2 { id: i32, name: String, } #[derive(AsChangeset)] #[primary_key] struct UserForm3 { id: i32, name: String, } #[derive...
Rust
0
tokens[word_ids[end_effect]] + '</ARG1>' if has_signal: this_space_splitted_tokens[word_ids[start_signal]] = '<SIG0>' + this_space_splitted_tokens[word_ids[start_signal]] this_space_splitted_tokens[word_ids[end_signal]] = this_spac...
Python
1
doc = "Bit 17"] #[inline(always)] pub fn clk_sys_pwm(&self) -> CLK_SYS_PWM_R { CLK_SYS_PWM_R::new(((self.bits >> 17) & 0x01) != 0) } #[doc = "Bit 16"] #[inline(always)] pub fn clk_sys_psm(&self) -> CLK_SYS_PSM_R { CLK_SYS_PSM_R::new(((self.bits >> 16) & 0x01) != 0) } #[do...
Rust
0
import numpy as np from scipy.sparse.linalg import eigsh import rigidpy as rp from stiffness_eigenvalue.framework import stiffness_matrix_sparce from stiffness_eigenvalue.visualize import custom_visualize, plot_eigen_vals_and_alpha import math import time ################################################## """ Hyperpar...
Python
1
logging.info( f"For language {lang} (CommonVoice) , a.k.a., {lang_iso} (whisper)" ) if (args.output_dir / lang_iso / ".complete").is_file(): logging.info(f"language {lang} has been processed. Skip.") continue train, dev, test = collect_data( ...
Python
1
want to use for a specific `TextStyle`. pub family_and_size: BTreeMap<TextStyle, (FontFamily, f32)>, } impl Default for FontDefinitions { fn default() -> Self { Self::default_with_pixels_per_point(f32::NAN) // must be set later } } impl FontDefinitions { /// Default values for the fonts pu...
Rust
0
&mut menv, "len", prim_len, 1, 1)?; def_prim(&mut menv, "trim-string", prim_trim_string, 1, 1)?; def_prim( &mut menv, "current-environment", prim_current_environment, 0, 0, )?; def_prim(&mut menv, "eval", prim_eval, 1, 2)?; def_prim(&mut menv, "read-string", ...
Rust
0
x7550_0000,// Sysenter 0x6550_0000, 0x7540_0000,// Sysexitd 0x6550_0000, 0x7540_0000,// Sysexitq 0x0800_0000, 0x7A00_0000,// Getsecd 0x0005_4031, 0x3800_0000,// Cmovo_r16_rm16 0x0005_4032, 0x3800_0000,// Cmovo_r32_rm32 0x0005_4031, 0x3800_0000,// Cmovo_r64_rm64 0x0005_4031, 0x3800_0000,// Cmovno_r16_rm16 0x0005...
Rust
0
n: break def rollback_and_wait(): log.info(f"Rolling back after truncating {n} relations...") ep.safe_psql("ROLLBACK") # Restart the endpoint: this ensures that we can read back what we just wrote, i.e. pageserver # ingest has caught up. ep.stop() l...
Python
1
debug { ($($arg:tt)+) => ({ $crate::text_to_struct_log!($crate::log::Level::Debug, $($arg)+); $crate::log::debug!(target: $crate::DEFAULT_TARGET, $($arg)+); }) } /// Define error macro that specify libra as the target #[macro_export] macro_rules! error { ($($arg:tt)+) => ({ $crate:...
Rust
0