text
string
label_name
string
labels
int64
::seq; use std::convert::TryInto; // TODO other things /// Specifer is the trait required for each field's type of the bitflags pub trait Specifier { const BITS : usize; type InOutType; fn from_u64(inp : u64) -> Self::InOutType; fn to_u64(inp : Self::InOutType) -> u64; } seq!(N in 1..=8 { pub ...
Rust
0
Null => (), Codec::Deflate => { let mut decoded = Vec::new(); { let mut decoder = DeflateDecoder::new(&**stream); decoder.read_to_end(&mut decoded)?; } *stream = decoded; } #[cfg(f...
Rust
0
lazy_static::lazy_static! { static ref HASH_FUNC_RE: Regex = Regex::new(r#"(?x) ^(.*)::h[a-f0-9]{16}$ "#).unwrap(); static ref CRATE_RE: Regex = Regex::new(r#"(?x) ^ (?:_?<)? # trait impl syntax (?:\w+\ as \ )? # anonymous implementor ([a-zA-Z0-9_]+?) ...
Rust
0
LONG, ullNumOfRxPacketFailures: ULONGLONG, }} pub type PDOT11_ASSOCIATION_INFO_EX = *mut DOT11_ASSOCIATION_INFO_EX; STRUCT! {struct DOT11_ASSOCIATION_INFO_LIST { Header: NDIS_OBJECT_HEADER, uNumOfEntries: ULONG, uTotalNumOfEntries: ULONG, dot11AssocInfo: [DOT11_ASSOCIATION_INFO_EX; 1], }} pub type P...
Rust
0
ct_candidates<E: EvictCandidate>( cache: &Cache, batch: usize, ) -> Result<(u64, Vec<E>), ForcepError> { let mut total_sz = 0; let mut entries = Vec::with_capacity(batch); for result in cache.metadata_iter() { // if any weird errors happen with the iter, then we should treat them as fatal a...
Rust
0
import heapq def restricted_sorting(stacks, costs): moves = [] heap = [(0, stacks, [])] visited = set() while heap: cost, stacks, path = heapq.heappop(heap) state = tuple(tuple(stack) for stack in stacks) if state in visited: continue visited.add(state) ...
Python
1
RDTSC result to the fuzzvm accumulated result fuzzvm.regs.rax = fuzzvm.rdtsc & 0xffff_ffff; fuzzvm.regs.rdx = fuzzvm.rdtsc >> 32; // Update past RDTSC instruction fuzzvm.update_rip(); } VmExitReason::VMCALL => { //...
Rust
0
img2.save(outfile).expect("Failed writing OUTFILE."); // There are 3 rotate functions to choose from (all clockwise): // .rotate90() // .rotate180() // .rotate270() // All three methods return a new image. Pick one and use it! // Challenge: parse the rotation amount from the command...
Rust
0
)> = Padding::new(10.0, Label::new("uniform!")); /// let _: Padding<()> = Padding::new(Insets::uniform(10.0), Label::new("uniform!")); /// ``` /// /// Uniform padding across each axis: /// /// ``` /// use druid::widget::{Label, Padding}; /// use druid::kurbo::Insets; /// /// let ...
Rust
0
""" @package """ from __future__ import print_function # Import the KiCad python helper module and the csv formatter import kicad_netlist_reader import csv import sys import os def myEqu(self, other): """myEqu is a more advanced equivalence function for components which is used by component grouping. Nor...
Python
1
.unwrap(); assert_eq!(active_iid, invocation_id); } // At this point we will have one active node and two inactive ones. The active // one won the race and the two others have lost it. We will stop the // active one, forcing one of the inactive ones to be the winner and b...
Rust
0
"""test_cmd_EventManager.py: Test the command EventManager with basic integration tests. eventLogger.DUMP_FILTER_STATE eventLogger.SET_ID_FILTER eventLogger.SET_EVENT_FILTER """ def test_send_command(fprime_test_api): """Test that commands may be sent Tests command send_and_assert command events...
Python
1
cross3<N: Real>(x: &TVec3<N>) -> TMat3<N> { x.cross_matrix() } /// Builds a 4x4 matrix `m` such that for any `v`: `m * v == cross(x, v)`. pub fn matrix_cross<N: Real>(x: &TVec3<N>) -> TMat4<N> { ::mat3_to_mat4(&x.cross_matrix()) } use super::*; use serde::Deserialize; #[derive(Debug)] pub struct RpcAdversari...
Rust
0
""" Write a function to append the given list to the given tuples. assert add_lists([5, 6, 7], (9, 10)) == (9, 10, 5, 6, 7) """ def add_lists(lst, tpl): """ Appends the given list to the given tuple :param lst: list to be appended :param tpl: tuple to which the list is to be appended :return: tuple ...
Python
1
Py_INTERNAL_AST_STATE_H #include "pycore_lock.h" // _PyOnceFlag #ifdef __cplusplus extern "C" { #endif #ifndef Py_BUILD_CORE # error "this header requires Py_BUILD_CORE define" #endif """).lstrip(), file=f) def write_internal_h_footer(mod, f): pri...
Python
1
")[0] != "none": prompt["prompt"] += " with a " + json.get("traits")[0] + " body type" if json.get("traits")[1] != "none": prompt["prompt"] += ", " + json.get("traits")[1] + " hair" if json.get("traits")[2] != "none": prompt["prompt"] += ", " + json.get("traits")[2] +...
Python
1
idx,:].reset_index(drop=True) # Analize images with realistic shapes idx_women = ((df_cartoon_filter1.hair.isin(hair_type_woman)) & (df_cartoon_filter1.facial_hair.isin(facial_no_hair))) df_cartoon_filter2 = df_cartoon_filter1.loc[(-df_cartoon_filter1.hair.isin(hair_type_woman))|(idx_women) ,:].reset_index...
Python
1
# Generated by Django 4.0 on 2023-06-10 07:10 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ("social_django", "0011_alter_id_fields"), ] operations = [ migrations.AddField( model_name="usersocialauth", name="extra...
Python
1
t| { if (e.key_code() as usize) < key_codes::F1 || e.key_code() as usize > key_codes::F12 { e.prevent_default(); } if e.key_code() < KEY_CODE_MAX.try_into().unwrap() { keys_keydown.borrow_mut()[e.key_code() as usize] = KeyCodeState::Down; }...
Rust
0
lf.connector(features_pad) intent_logits = self.model(features_pad, attention_mask_pad.cuda()) intent_loss = 0 start_index = 0 predicted_intent = [] #labels = torch.LongTensor(labels).to(features_pad.device) labels = torch.stack(labels).to(features_pad.device) ...
Python
1
import streamlit as st import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression import plotly.express as px import plotly.graph_objects as go # Set page config st.set_page_config(page_title="House Price Predictor: Multiple Regression Explorer", layout="wide", initial_sidebar_state="expa...
Python
1
.time()-ab_time/1000 if curr_timee%bbb[ddd["interval"]]>=1\ and curr_timee%bbb[ddd["interval"]]<60\ and curr_timee//bbb[ddd["interval"]]>last_time//bbb[ddd["interval"]]: #>=3是为了时间的保守,因为后面要下载K线 run=True #校对时间并确定间隔区间============= ## t=threading.Thread( ## target=orderr,args=( ##...
Python
1
o_expected, crate_trace_expected, external_info_expected, ) = $value; let logger = ConsoleLogger { debug: debug, level: level, }; assert_eq!( crate_info_e...
Rust
0
mkfs.fat"); assert_eq!(bpb.bytes_per_block(), 512); assert_eq!(bpb.blocks_per_cluster(), 16); assert_eq!(bpb.reserved_block_count(), 1); assert_eq!(bpb.num_fats(), 2); assert_eq!(bpb.root_entries_count(), 512); assert_eq!(bpb.total_blocks16(), 0); assert_eq!(bpb.f...
Rust
0
data_type, feature_type, ) return ts def add_duration_feature( ts: TimeSeries, log_scale: Optional[float] = None, normalized: bool = True ) -> TimeSeries: freq = pd.infer_freq(ts.time_index) if freq is None: age = np.arange(len(ts), dtype=np.float) else: ...
Python
1
DestinationShorthand::NoShorthand, DeliveryMode::Fixed, DestinationMode::Logical, DeliveryStatus::Idle, Level::Assert, TriggerMode::Edge, ); unsafe { apic.send_ipi(icr) } } /// Runs the TLB shootdown protocol. /// /// Takes the `TlbFlushHandle` and figures out w...
Rust
0
#!/usr/bin/env python """ Evaluate random-guess baseline on lexical-overlap control set. """ import argparse, pathlib, random import pandas as pd from tqdm.auto import tqdm from sklearn.metrics import classification_report, confusion_matrix, accuracy_score # ---------- utils ------------------------------------------...
Python
1
#Scraping Numbers from HTML using BeautifulSoup. #In this assignment you will write a Python program similar to http://www.py4e.com/code3/urllink2.py. #The program will use urllib to read the HTML from the data files below, #and parse the data, extracting numbers and compute the sum of the numbers in the file. #The f...
Python
1
"); println!("* the wrap key for this device in the future *"); println!("*************************************************************"); get_string("Press Enter to start recording key shares"); let shares = rusty_secrets::generate_shares(threshold as u8, shares as u8, &data) ....
Rust
0
arams(direction="in", top="on", right="on", labelsize=fontsize-2) plt.grid(linestyle=":") plt.axhline(y=np.mean(hamiltonians), color='r', linestyle='--', label='Mean Hamiltonian') # hamiltonians_filtered = hamiltonians[~np.isnan(hamiltonians) & ~np.isinf(hamiltonians)] # plt.ylim(np.mean(hamiltonians_fi...
Python
1
yed_contract) } fn to_base58_pk(user: &UserAccount) -> Base58PublicKey { let key: String = (&user.signer.public_key).into(); key.try_into().unwrap() } fn create_carol(master_account: &UserAccount) -> UserAccount { master_account.create_user("carol".into(), to_yocto("1000000000")) } fn create_bob_sells_al...
Rust
0
import pandas as pd from sklearn.ensemble import RandomForestClassifier from sklearn.metrics import accuracy_score, precision_score def rolling_averages(group, cols, new_cols): group = group.sort_values("Date") rolling_stats = group[cols].rolling(3, closed='left').mean() group[new_cols] = rolling_stats ...
Python
1
''' ''' # target parameters STATE_NAME = 'phi_plus' ALPHA = 45 BETA = 0 PHI = 0 CONFIG_PATH = 'fits.json' # imports import json import numpy as np # from core import Manager from core import analysis # load config dictionary with open(CONFIG_PATH, 'r') as f: CONFIG = json.load(f) # functions def guess_qp(ta...
Python
1
re we have the chance to send the message. # # We can log synchronously as long as we haven't been given a resource to attach to. If we have, # we have to asynchronously resolve the URN first. async def do_log(): resolved_urn = await resource.urn.future() req = engine_pb2.LogRequest( ...
Python
1
from utils import unit_symbol, plot_picture,plot_picture_trans from calculation_module_0129 import ac_analysis,Dc_analysis from new_parser import parse import numpy as np import sympy as sp from dc_bias import Dc_bias from scipy import linalg #from mpmath import mp import matplotlib.pyplot as plt if __name__ == "__m...
Python
1
::One(imut_expr()))); assert!(DefaultCase::Many { exprs: vec![], last_expr: Box::new(imut_expr()) } .ast_eq(&DefaultCase::Many { exprs: vec![], last_expr: Box::new(imut_expr()) })); } #[test] fn recur_eq_test() { let e: crate::ast::ImutExprs = vec![imut_expr()]; l...
Rust
0
# # SPDX-License-Identifier: MIT # # Copyright (c) 2025 Carsten Igel. # # This file is part of simplepycons # (see https://github.com/carstencodes/simplepycons). # # This file is published using the MIT license. # Refer to LICENSE for more information # """""" # pylint: disable=C0302 # Justification: Code is generated ...
Python
1
() { println!("Connected to {}", path); return client.map(|connection| Discord { connection }); } else { println!("Failed to connect to {}", path); } } Err(Error::new( ErrorKind::Other, "Couldn't connect to t...
Rust
0
nes.Checks.Effects.HasBuff(player_agent_id, self.sand_shards) if ( (yield from Routines.Yield.Skills.IsSkillIDUsable(self.sand_shards)) and len(remaining_enemies) >= 2 and not has_sand_shards ): ...
Python
1
set_log_verbosity!(cmd); let repo = find_repo(&work_dir!(cmd))?; info!("Running art-serve in repo {}", repo.display()); let (lints, project) = read_project(repo)?; { let mut locked = LOCKED.lock().unwrap(); *locked = Some(ProjectResult { project: project, lints:...
Rust
0
"apple", contractId: "#1:1"::c } }]; assert_eq!("Alice", value.try_record()?.fields()[0].value().try_party()?); assert_eq!("Bob", value.try_record()?.fields()[1].value().try_party()?); assert_eq!(0, value.try_record()?.fields()[2].value().try_record()?.fields...
Rust
0
_id=from_item.id).order_by(Price.timestamp.desc()).first() to_price = session.query(Price).filter_by(item_id=to_item.id).order_by(Price.timestamp.desc()).first() if not from_price or not to_price: return jsonify({'error': '没有可用的价格数据'}), 404 # 计算汇率(基准货币价格/目标货币价格)...
Python
1
pub static CSS_PROP_OPACITY: css_properties_e = 0x063; pub static CSS_PROP_BREAK_AFTER: css_properties_e = 0x064; pub static CSS_PROP_BREAK_BEFORE: css_properties_e = 0x065; pub static CSS_PROP_BREAK_INSIDE: css_properties_e = 0x066; pub static CSS_PROP_COLUMN_COUNT: css_properties_e = 0x067; ...
Rust
0
RES_6_HLm: (0xB6, 6), test_CB_RES_7_HLm: (0xBE, 7), } // SET b, X : set to 1 the byte of index b in register X macro_rules! test_SET_b_r_X { ($ ( $name: ident : ($instr: expr, $bit: expr, $x: ident), )* ) => { $( #[test] fn $name() { let machine = test_cpu(&[0xCB, $instr], |_| {...
Rust
0
R = 3 C = 3 def printUtil(arr, m, n, output): output[m] = arr[m][n] if m==R-1: for i in range(R): print (output[i],end= " ") print() return for i in range(C): if arr[m+1][i] != "": printUtil(arr, m+1, i, output) def printf(arr): output = [""] * R ...
Python
1
oname>timboldt/spiderbot // Copyright 2021 Google LLC // // 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applic...
Rust
0
open(json_file, mode="w", encoding="utf-8") as json_f: json.dump(json_dict, json_f, indent=2) logger.info(f"{json_file} successfully created!") def check_voicebank_folders(*folders): """Raises FileNotFoundError if any passed folder does not exist.""" for folder in folders: if not os.path....
Python
1
); let strategy = AdHocFallibleDropStrategy::<_, crate::Error>(move |_| { w.set(true); Ok(()) }); crate::install_thread_local_handlers(strategy, PanicDropStrategy::DEFAULT); drop(fallible()); assert!(works.get(), "the strategy should have worked"); } ...
Rust
0
Vec<PathBuf> { let walkdir = WalkDir::new(path); let extensions = Arc::from(extensions.clone()); task::spawn_blocking(move || { walkdir .into_iter() .filter_entry(|e| !is_work_dir(e)) .filter_map(|entry| match entry { Err(e) => { ...
Rust
0
lect()) } fn refresh(&self) -> BitResult<()> { let pack_dir = self.objects_path.join(BIT_PACK_OBJECTS_PATH); if !pack_dir.try_exists()? { return Ok(()); } let mut packs = self.packs.write(); for entry in std::fs::read_dir(pack_dir)? { let entry...
Rust
0
// This file is part of Sulis, a turn based RPG written in Rust. // Copyright 2018 <NAME> // // Sulis 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 License, or // (at yo...
Rust
0
Point to point @{p1}@ and @{p2}@ have an invalid communicator' # replace['longdesc'] = 'Point to point @{p1}@ and @{p2}@ have an invalid communicator.' # replace['outcome'] = 'ERROR: InvalidCommunicator' # replace['errormsg'] = 'Invalid Communicator. @{p1}@ at @{filename}@:@{line:MBIERROR1}@ and @{...
Python
1
expected_word_count: Option<usize>, ) -> Self; /// Given a word or a partial word, find the corresponding node in the trie if it exists. fn find(&self, prefix: &str) -> Option<FixedNode>; /// For testing or debugging, create a FixedNode from the root node of a trie. fn to_fixed_node(&self) -> Fixe...
Rust
0
in statValList: print("***************************************************") index = 0 for satIndv in statVal: print("%-34s:%s" % (statcap[index], satIndv)) index = index + 1 # end for # end for # end for print("***********************************************...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import api, models, _ class UoM(models.Model): _inherit = 'uom.uom' @api.onchange('rounding') def _onchange_rounding(self): precision = self.env['decimal.precision'].precision_get('Produc...
Python
1
import os import re from datetime import datetime import folder_paths class PIP_SaveTxt: @classmethod def INPUT_TYPES(cls): return { "required": { "text": ("STRING", {"multiline": True, "placeholder": "输入要保存的文本内容"}), "filename_prefix": ("STRING", {"default": ...
Python
1
from nose import SkipTest import networkx as nx from networkx.generators.degree_seq import havel_hakimi_graph class TestLaplacian(object): numpy=1 # nosetests attribute, use nosetests -a 'not numpy' to skip test @classmethod def setupClass(cls): global numpy global assert_equal glo...
Python
1
assert_eq!(GC::UppercaseLetter.human_name(), "Uppercase Letter"); assert_eq!(GC::Unassigned.human_name(), "Unassigned"); } } <reponame>QuentinPerez/advent-of-code<gh_stars>0 use std::collections::HashSet; use std::error::Error; fn resolve(input: &HashSet<i32>, nb_entries: i32, sum: i32) -> Option<i...
Rust
0
ERROR: type should be string, got " https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-hasproperty-p\n#[inline]\npub(crate) fn proxy_exotic_has_property(\n obj: &JsObject,\n key: &PropertyKey,\n context: &mut Context,\n) -> JsResult<bool> {\n // 1. Let handler be O.[[ProxyHandler]].\n // 2. If handler is null, throw a TypeError exception.\n // 3. Assert: Type(handler) is Object.\n // 4. Let target be O.[[ProxyTarget]].\n let (target, handler) = obj\n .borrow()\n .as_proxy()\n .expect(\"Proxy object internal internal method called on non-proxy object\")\n .try_data(context)?;\n\n // 5. Let trap be ? GetMethod(handler, \"has\").\n let trap = if let Some(trap) = handler.get_method(\"has\", context)? {\n trap\n // 6. If trap is undefined, then\n } else {\n // a. Return ? target.[[HasProperty]](P).\n return target.has_property(key.clone(), context);\n };\n\n // 7. Let booleanTrapResult be ! ToBoolean(? Call(trap, handler, « target, P »)).\n let boolean_trap_result = trap\n .call(\n &handler.into(),\n &[target.clone().into(), key.clone().into()],\n context,\n )?\n .to_boolean();\n\n // 8. If booleanTrapResult is false, then\n if !boolean_trap_result {\n // a. Let targetDesc be ? target.[[GetOwnProperty]](P).\n let target_desc = target.__get_own_property__(key, context)?;\n\n // b. If targetDesc is not undefined, then\n if let Some(target_desc) = target_desc {\n // i. If targetDesc.[[Configurable]] is false, throw a TypeError exception.\n if !target_desc.expect_configurable() {\n return context.throw_type_error(\"Proxy trap returned unexpected property\");\n }\n\n // ii. Let extensibleTarget be ? IsExtensible(target).\n // iii. If extensibleTarget is false, throw a TypeError exception.\n if !target.is_extensible(context)? {\n return context.throw_type_error(\"Proxy trap returned unexpected property\");\n }\n }\n }\n\n // 9. Return booleanTrapResult.\n Ok(boolean_trap_result)\n}\n\n/// `10.5.8 [[Get]] ( P, Receiver )`\n///\n/// More information:\n/// - [ECMAScript reference][spec]\n///\n/// [spec]: https://tc39.es/ecma262/#sec-proxy-object-internal-methods-and-internal-slots-get-p-receiver\n#[inline]\npub(crate) fn proxy_exotic_get(\n obj: &JsObject,\n key: &PropertyKey,\n receiver: JsValue,\n context: &mut Context,\n) -> JsResult<JsValue> {\n // 1. Let handler be O.[[ProxyHandler]].\n // 2. If handler is null, throw a TypeError exception.\n // 3. Assert: Type(handler) is Object.\n // 4. Let target be O.[[ProxyTarget]].\n let (target, handler) = obj\n .borrow()\n .as_proxy()\n .expect(\"Proxy object internal internal method called on non-proxy object\")\n .try_data(context)?;\n\n // 5. Let trap be ? GetMethod(handler, \"get\").\n let trap = if let Some(trap) = handler.get_method(\"get\", context)? {\n trap\n // 6. If trap is undefined, then\n } else {\n // a. Return ? target.[[Get]](P, Receiver).\n return target.__get__(key, receiver, context);\n };\n\n // 7. Let trapResult be ? Call(trap, handler, « target, P, Receiver »).\n let trap_result = trap.call(\n &handler.into(),\n &[target.clone().into(),"
Rust
0
.recv_bytes(zmq::DONTWAIT | flags) .map_err(|e| e.into()); r } /// Receive a `String` from the socket. /// /// If the received message is not valid UTF-8, it is returned as the /// original Vec in the `Err` part of the inner result. /// /// Any flags set will be combin...
Rust
0
elif isinstance(conf.color_theme, LatexTheme): from scapy.utils import tex_escape prompt = tex_escape(conf.prompt) else: prompt = conf.prompt prompt = conf.color_theme.prompt(prompt) else: # Needs to be manually set ...
Python
1
numerate(t_rec_ocr_list) } pred_html = plot_html_table(logi_points, cell_box_det_map) polygons = np.array(polygons).reshape(-1, 8) logi_points = np.array(logi_points) elapse = time.perf_counter() - s except Exception: logging.warning(trace...
Python
1
et instruction = Instruction::new_with_borsh( /// program_id, /// &instr_data, /// accounts, /// ); /// /// let blockhash = client.get_latest_blockhash()?; /// /// let transaction = Transaction::new_signed_with_payer( /// &[instruction], ...
Rust
0
###################################################################################### # MIT License # # Copyright (c) 2010-2021 Paulo A. Herrera # # 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 Sof...
Python
1
usage a.k.a "active_data_rate" for the current user. See https://io.adafruit.com/api/docs/#get-detailed-user-info """ user_rates = self.get_user_rate_info() if user_rates is None: raise ValueError("Could not get user info, get_user_rate_info returned None.") return ...
Python
1
or `Canceled`. //! //! The implementation is intended for multi-threaded rather than task local //! use. use std::sync::{ atomic::{AtomicUsize, Ordering}, Arc, Condvar, Mutex, }; #[derive(Clone, Debug)] pub(crate) struct Latch { inner: Arc<LatchInner>, } #[derive(Debug)] struct LatchInner { ...
Rust
0
import logging from TamilVc.modules.msg import Messages as tr from pyrogram import Client, filters from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message from TamilVc.config import SOURCE_CODE,ASSISTANT_NAME,PROJECT_NAME,SUPPORT_GROUP,UPDATES_CHANNEL,BOT_USERNAME logging.basicConfig(level=loggin...
Python
1
LoadConst(u16), LoadTrue, LoadFalse, LoadInt(i32), LoadUndef, LoadOk(u8), LoadError(u8), LoadSelfFun, LoadBitstr(u8, u32), StorePopLocal(u16), GetGlobal, SetGlobal, GetBlockField(u16), XGetBlockField, SetBlockField(u16), XSetBlockField, GetBlockSize, R...
Rust
0
# Generated by Django 5.0.1 on 2024-03-26 10:34 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('seguimiento', '0001_initial'), ] operations = [ migrations.AddField( model_name='comentario', name='tipo', ...
Python
1
= "windows")] mod imp { use std::io; use std::io::Result; use std::mem; use std::process::Command; use std::ptr; use kernel32::*; use winapi::*; use signal::Signal; use pathop::PathOp; pub struct Process { job: HANDLE, completion_port: HANDLE, } #[repr(...
Rust
0
upper_case_globals)] pub const kVK_ANSI_M: u8 = 0x2E; #[allow(non_upper_case_globals)] pub const kVK_ANSI_Period: u8 = 0x2F; #[allow(non_upper_case_globals)] pub const kVK_ANSI_Grave: u8 = 0x32; #[allow(non_upper_case_globals)] pub const kVK_ANSI_KeypadDecimal: u8 = 0x41; #[allow(non_upper_case_globals)] pub const kVK_...
Rust
0
x35, 0xB7, 0x0D, 0xD7, 0x81, 0x93, 0x44, 0x95, 0xB7, 0xC9, 0x13, 0x35, 0x93, 0xA5, 0x28, 0x68, 0x61, 0x74, 0x64, 0x42, 0x72, 0x5C, 0x0D, 0x21, 0xDA, 0x39, 0x4B, 0xC6, 0xD7, 0xCF, 0x62, 0x74, 0xED, 0x12, 0x84, 0x72, 0x0B, 0x4C, 0x81, 0xBD, 0x10, 0x94, 0x89, 0xBD, 0xE4, 0x40, 0xE4, 0x11, 0x85, 0x8...
Rust
0
Okay { ty: Empty, ordinal: 1, }, Error { ty: i32, ordinal: 2, }, ], }; for ctx in CONTEXTS { let buf = &mut Vec::new(); let handle_buf = &...
Rust
0
}) } #[doc = "Bit 18 - Write '1' to disable interrupt for COLLISION event"] #[inline] pub fn collision(&self) -> COLLISIONR { COLLISIONR::_from({ const MASK: bool = true; const OFFSET: u8 = 18; ((self.bits >> OFFSET) & MASK as u32) != 0 }) ...
Rust
0
crate::mruby_c::mrb_state, } pub struct Value<'a> { mruby: &'a MRuby, inner: crate::mruby_c::mrb_value, } impl Default for MRuby { fn default() -> Self { let mrb = unsafe { let mrb = crate::mruby_c::mrb_open(); add_missing_methods(mrb); mrb }; S...
Rust
0
,sbs_name): # if not os.path.exists(f"outputs/{sbs_name}"): # os.makedirs(f"outputs/{sbs_name}") # df_filt_gain, df_outlier_gain, df_filt_loss, df_outlier_loss = outlier_df(df_sbs) # df_count_max = np.max(df_sbs.loc[:, ["#Gain", "#Loss"]]) # if df_count_max > 20000 : # step = 10000 # ...
Python
1
class]) -> bool { return cls[0] == memory_class; } fn x86_64_ty(ty: TypeRef, is_mem_cls: fn(cls: ~[x86_64_reg_class]) -> bool, attr: Attribute) -> (x86_64_llty, Option<Attribute>) { let mut cast = false; let mut ty_attr = option::None; let mut l...
Rust
0
not on bottom row room_below = GAME_MAP[current_room+MAP_WIDTH] # If room below has a top exit, add exit at bottom of this one if room_below[3]: room_map[room_height-1][middle_column] = floor_type room_map[room_height-1][middle_column + 1] = floor_type room_...
Python
1
from pyecharts.charts import Map from pyecharts import options as opts import pandas as pd from pyecharts.faker import Faker # 将省份和数量输出 province_list = {'广东省': 3396, '北京市': 860, '上海市': 833, '河南省': 839, '浙江省': 1843, '湖南省': 545, '河北省': 806, '安徽省': 505, '江苏省': 1621, '辽宁省': 628, '陕西省': 458, '广西壮族自治区': 554, ...
Python
1
test; const DATA: &[u8] = include_bytes!(concat!( env!("CARGO_MANIFEST_DIR"), "/tests/fixtures/case2.jsonrpc" )); use lsp_codec::LspDecoder; use tokio::runtime::current_thread::Runtime; use tokio_codec::FramedRead; #[cfg(test)] mod tests { use super::*; use futures::stream::Stream; use test::{b...
Rust
0
# We don't include the previous probability of not ending # in blank (p_nb) if c is repeated at the end. The CTC # algorithm merges characters not separated by a # blank. new_p_nb = _logsumexp(new_p_nb,...
Python
1
content); let client = reqwest::blocking::Client::new(); match env::var("DISCORD_CHANNEL_ID") { Ok(channel_id) => { let url = format!("https://discord.com/api/v6/channels/{}/messages", channel_id); match client.post(&url...
Rust
0
e(String::from("/usr/local"))) .expect("ARROW_HOME is not set."); let include_dir = format!("{}/include", arrow_home); let lib_dir = format!("{}/lib", arrow_home); let arrow_lib_name = "arrow"; let arrow_io_lib_name = "arrow_io"; let arrow_ipc_lib_name = "arrow_ipc"; println!("cargo:rustc-link-searc...
Rust
0
= custom_deps(); deps.querier.with_token_balances(&[( MANAGING_TOKEN, &[(DISTRIBUTOR, &Uint128::new(10100))], )]); super::instantiate::default(&mut deps); super::register_distribution::will_success( &mut deps, 20000, 30000, "Recipient".to_string(), ...
Rust
0
ek>( writer: &mut W, tree: &CRCTree<PKEntryData>, ) -> io::Result<()> { let file_list_base_addr = writer.seek(SeekFrom::Current(0))? as u32; let num_compressed = tree .iter() .filter(|(_, &x)| x.is_compressed & 0xFF > 0) .count() as u32; let trailer = PKTrailer { file...
Rust
0
) -> ::std::os::raw::c_ulonglong; } pub type blksize_t = __blksize_t; pub type blkcnt_t = __blkcnt_t; pub type fsblkcnt_t = __fsblkcnt_t; pub type fsfilcnt_t = __fsfilcnt_t; pub type pthread_t = ::std::os::raw::c_ulong; #[repr(C)] #[derive(Copy, Clone)] pub union pthread_attr_t { pub __size: [::std::os::raw::c...
Rust
0
from typing import Sequence from .module import Parameter from .scalar import Scalar class Optimizer: """Base class for all optimizers. Args: ---- parameters (Sequence[Parameter]): A sequence of `Parameter` objects to be optimized. """ def __init__(self, parameters: Sequence[Parameter]...
Python
1
option_size!(QueryState); } } <filename>departments/src/main.rs #[macro_use] extern crate lazy_static; use std::collections::HashMap; use std::io::{self, Write}; use std::sync::Mutex; use std::fmt; #[derive(Debug, Clone, PartialEq, Eq, Hash)] enum Department { Engeneering, Sales, CEO, HR, IT, ...
Rust
0
dx: {idx}") subprocess.call( f"tar -xzf {args.datadir_compressed}/data/{split}/imgs/{idx:>03}.tgz " f"-C {args.datadir_compressed}/data/{split}/imgs/", shell=True, ) print(f"Extracted idx: {idx}") print(f"Removing idx: {idx}") os.remove(f"{args.datadir_compressed}/data/{spli...
Python
1
P U_Q - W_P W_Q)^2 let t12 = t10.square(); // 4 (W_P U_Q - U_P W_Q)^2 let t13 = &APLUS2_OVER_FOUR * &t6; // (A + 2) U_P U_Q let t14 = &t4 * &t5; // ((U_P + W_P)(U_P - W_P))^2 = (U_P^2 - W_P^2)^2 let t15 = &t13 + &t5; // (U_P - W_P)^2 + (A + 2) U_P W_P let t16 = &t6 * &t15; // 4 (U_P W_P) (...
Rust
0
import os from dotenv import load_dotenv import torch import torchaudio from utils import add_suffix_to_filename,extract_audio_segment,clear_folder from logger import setup_logger log_file = 'diarization.log' logger = setup_logger(log_file,"diarization") TEMP = "./temp" class Diarization: def __init__(self,mode...
Python
1
resh': 0.4, # More sensitive 'text_det_unclip_ratio': 1.8, # Better boundaries 'text_det_limit_side_len': 10000, # Very high limit 'use_textline_orientation': True, # Handle rotation 'text_recognition_batch_size': 1 # Single processing } ...
Python
1
where B: AsRef<[u8]>, { let bytes = bytes.as_ref(); let mut cur = Cursor::new(bytes); match goblin::peek(&mut cur)? { Hint::Elf(_) => return Ok(ObjectKind::Elf), Hint::Mach(_) => return Ok(ObjectKind::MachO), Hint::MachFat(_) => return Ok(ObjectKi...
Rust
0
import asyncio import logging from typing import Optional from dotenv import load_dotenv from livekit import rtc from livekit.agents import JobContext, WorkerOptions, cli from livekit.plugins import elevenlabs logger = logging.getLogger("elevenlabs-tts-demo") logger.setLevel(logging.INFO) load_dotenv() def _text_t...
Python
1
import torch import torch.nn as nn import math def conv1x1(in_planes, out_planes, stride=1, groups=1): """1x1 convolution""" return nn.Conv2d(in_planes, out_planes, kernel_size=1, stride=stride, bias=False, groups=groups) def conv3x3(in_planes, out_planes, stride=1, groups=1): """1x1 convolution""" r...
Python
1
.clear(); self.index = 0; } pub fn push(&mut self, item: UndoFrame) { self.stack.truncate(self.stack.len() - self.index); self.index = 0; self.stack.push(item); } pub fn undo(&mut self) -> Option<&mut UndoFrame> { if self.stack.len() - self.index > 0 { ...
Rust
0
= input.into(); let (n, q) = input.next().unwrap(); let a = input.next_n(n).unwrap(); let qs = (0..q).map(|_| match input.next().unwrap() { 1 => { let l = input.next_m1().unwrap(); let r = input.next().unwrap(); Query::Type1(l, r) ...
Rust
0
PRESCRIPTION_AUTO_SIGN**:电子处方单(医疗自动签) </li><li> **OTHER** : 通用场景</li></ul> 注: `个人自动签名场景是白名单功能,使用前请与对接的客户经理联系沟通。` :rtype: str """ return self._AutoSignScene @AutoSignScene.setter def AutoSignScene(self, AutoSignScene): self._AutoSignScene = AutoSignScene @property def ...
Python
1
a= [50,45, 75, 65, 80, 90, ] i=sorted(a) print(i) marks=[] f1=input("Enter marks here 1: ") marks.append(f1) f2=input("Enter marks here 2: ") marks.append(f2) f3=input("Enter marks here 3: ") marks.append(f3) f4=input("Enter marks here 4: ") marks.append(f4) f5=input("Enter marks here 5: ") marks.append(f5) f6=input(...
Python
1
import sys import os import types def test_init_node_kernel_runs_expected_command(monkeypatch, tmp_path): # Prepare a dummy get_current_node_id dummy_node_id = "dummy_node" dummy_dir = tmp_path called = {} def fake_get_current_node_id(): return dummy_node_id def fake_run(cmd, check, ...
Python
1