text string | label_name string | labels int64 |
|---|---|---|
from compiler import Compiler
import sys
def main():
if len(sys.argv) < 3:
print("Использование: python main.py [--cassette <section_number>] <output_file> <input_file>")
return
use_cassette = False
section_number = 0
output_file = ""
input_file = ""
if "--cassette" in sys.ar... | Python | 1 |
symbols_to_z_numbers = {
'H': 1,
'He': 2,
'Li': 3,
'Be': 4,
'B': 5,
'C': 6,
'N': 7,
'O': 8,
'F': 9,
'Ne': 10,
'Na': 11,
'Mg': 12,
'Al': 13,
'Si': 14,
'P': 15,
'S': 16,
'Cl': 17,
'Ar': 18,
'K': 19,
'Ca': 20,
'Sc': 21,
'Ti': 22,
'... | Python | 1 |
file.read_to_string(&mut data_str).expect("file should load");
let known_urls: HashMap<String, String> = serde_json::from_str(&data_str).expect("json is not valid");
println!("JSON loaded in {} ms", now.elapsed().as_millis());
known_urls
};
}
#[get("/<short>")]
fn short(short: &str... | Rust | 0 |
.channel_id()
.messages(ctx.discord(), |m| m.limit(100))
.await?
.into_iter()
.filter(|msg| {
if msg.author.id != ctx.data().bot_user_id {
return false;
}
if (ctx.created_at() - msg.timestamp).num_hours() >= 24 {
return ... | Rust | 0 |
se_name)}.wav")
if ext.lower() != '.wav':
self.log_queue.put(("status", "Converting file to WAV..."))
if not convert_to_wav(self.current_file, wav_path):
self.log_queue.put(("error", "File conversion failed."))
return
else:... | Python | 1 |
35, "sexo": "Masculino", "peso": 70}
sintomas = ["fiebre", "mocos", "dolor de cabeza"]
respuestas_adicionales_json = [
{"pregunta": "¿Has viajado recientemente?", "respuesta": "No"},
{"pregunta": "¿Tienes enfermedades crónicas?", "respuesta": "No"}
]
resultado, categorias = moderac... | Python | 1 |
=491, y=453)
time.sleep(0.5)
T_ACTION_QUEUE_TIMER.add_click_to_queue(handle=handle, x=600, y=453)
time.sleep(0.5)
T_ACTION_QUEUE_TIMER.add_keyboard_up_down_to_queue(handle=handle, key="backspace")
time.sleep(0.5)
T_ACTION_QUEUE_TIMER.add_keyboard_u... | Python | 1 |
from phi.model.sambanova.sambanova import Sambanova
| Python | 1 |
ry; under destination path (first element), we store the original destination
# path, while source path contains the relative reference path.
toc_refs.append((dest_name, dep_path, "DEPENDENCY"))
return toc_keep, toc_refs
UNCOMPRESSED = False
COMPRESSED = True
_MISSING_BOOTLOA... | Python | 1 |
# -*- encoding:utf-8 -*-
"""Autogenerated file, do not edit. Submit translations on Transifex."""
MESSAGES = {
"%d min remaining to read": "Cần %d phút để đọc",
"(active)": "(active)",
"Also available in:": "Cũng có sẵn trong:",
"Archive": "Kho",
"Atom feed": "Nguồn cung cấp dữ liệu Atom",
"Aut... | Python | 1 |
#!/usr/bin/env python3
"""
Test script to try the new British child-like voice
"""
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
from src.ui.speech_manager import SpeechManager
def test_british_child_voice():
"""Test the British child-like voice"""
print("Testing Bri... | Python | 1 |
Kind(Class::Half)
}
/// Errors that can occur when converting an `ElfHdrData` with raw
/// offsets to one with slices.
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
pub enum ElfHdrWithDataError<Class: ElfClass> {
/// Program header table is out of bounds.
ProgHdrOutOfBounds(Class::Offset)... | Rust | 0 |
fig.savefig('matplotlib_test.png', dpi=150)
self.assertTrue(os.path.isfile("matplotlib_test.png"))
class CryptographyTestCase(PythonTestMixIn, TestCase):
module_import = 'cryptography'
def test_run_module(self):
from cryptography.fernet import Fernet
key = Fernet.generate_key()
... | Python | 1 |
[doc = "Bit 29 - FlexTimer 0 Hardware Trigger 1 Source Select"]
#[inline(always)]
pub fn ftm0trg1src(&mut self) -> FTM0TRG1SRC_W {
FTM0TRG1SRC_W { w: self }
}
#[doc = "Bit 30 - FlexTimer 3 Hardware Trigger 0 Source Select"]
#[inline(always)]
pub fn ftm3trg0src(&mut self) -> FTM3TRG0SRC_W... | Rust | 0 |
new())
}
fn simple_hint(pos: Pos, name: impl Into<String>) -> aast_defs::Hint {
aast_defs::Hint(pos.clone(), Box::new(simple_hint_(pos, name)))
}
fn apply_to_hint(pos: Pos, name: impl Into<String>, ty: aast_defs::Hint) -> aast_defs::Hint {
let id = ast_defs::Id(pos.clone(), name.into());
let happly = aast... | Rust | 0 |
,
vec![
0u8, 0u8, 0u8, 255u8, 127u8, 127u8, 127u8, 255u8, 255u8, 255u8, 255u8, 255u8,
0u8, 0u8, 0u8, 255u8, 127u8, 127u8, 127u8, 255u8, 255u8, 255u8, 255u8, 255u8,
]
);
// notes:
// (81, 90, 240) is full red in YUV
// (145, 54, 34) is full green i... | Rust | 0 |
# AutomationDesigner/RunLoopHandler.py
import time
from PySide6.QtCore import QTimer
def runLoopHandler(self, start_node, stop_event, pause_event, EndNode, DelayNode):
# 'self' is the AutomationDesigner instance
start_id = start_node.id
# print(f"[LoopWorker-{start_id}] Thread started.") # Optional
... | Python | 1 |
}
}
impl<'a> ExactSizeIterator for Iter<'a> {}
/// A single result row of a query.
pub struct TextRow<'a> {
columns: &'a [Column],
data: &'a RowData,
}
impl<'a> fmt::Debug for TextRow<'a> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
fmt.debug_struct("TextRow")
.field("co... | Rust | 0 |
tx in txs {
all.push(tx?);
}
Ok(all)
}
pub fn is_tx_empty(db_tx: &rusqlite::Transaction<'_>, tx_id: Entid) -> Result<bool> {
let count: i64 = db_tx.query_row("SELECT count(rowid) FROM timelined_transactions WHERE timeline = 0 AND tx = ? AND e != ?", rusqlite::params![&tx_id... | Rust | 0 |
use path_builder::PathBuilder;
#[cfg(feature = "lib")]
pub use raster_builder::RasterBuilder;
#[cfg(feature = "lib")]
pub use styling::Styling;
#[cfg(not(feature = "lib"))]
use mold::{tile::Map, ColorBuffer, Path, PixelFormat, Point, RasterInner};
#[repr(C)]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enu... | Rust | 0 |
);
}
#[test]
fn field_self_assignment() {
err(
"class Foo(a: Int32) { var b: Int32 = b; }",
pos(1, 38),
SemError::UnknownIdentifier("b".into()),
);
}
#[test]
fn test_generic_class() {
ok("class A[T]");
ok("class A[X, Y]"... | Rust | 0 |
import environ
from .base import *
ALLOWED_HOSTS = ['43.201.173.110']
STATIC_ROOT = BASE_DIR / 'static/'
STATICFILES_DIRS = []
DEBUG = False
env=environ.Env()
environ.Env.read_env(BASE_DIR / '.env')
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2',
'NAME': env('DB_NA... | Python | 1 |
Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct Item {
pub id: u64,
pub content: String,
pub priority: u8,
pub checked: u8,
pub description: String,
pub due: Option<DateInfo>,
pub is_deleted: u8,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
pub struct DateInfo {... | Rust | 0 |
#[derive(Copy, Clone)]
pub union tm_physics_shape_component_t__bindgen_ty_1 {
pub sphere: tm_physics_shape_sphere_t,
pub capsule: tm_physics_shape_capsule_t,
pub box_: tm_physics_shape_box_t,
pub convex: tm_physics_shape_cooked_t,
pub mesh: tm_physics_shape_cooked_t,
_bindgen_union_align... | Rust | 0 |
# Use this as RSS Guard post-processing script.
#
# Example command line usage:
# curl 'PATH_TO_SOME_YOUTUBE_CHANNEL_RSS_FEED' | python 'youtube-limit-length.py'
import sys
import xml.etree.ElementTree as ET
import requests
import json
import isodate
sys.stdin.reconfigure(encoding="utf-8")
input_data = sys.stdin.re... | Python | 1 |
::RTCPS_4
}
#[doc = "Checks if the value of the field is `RTCPS_5`"]
#[inline(always)]
pub fn is_rtcps_5(&self) -> bool {
*self == RTCPS_A::RTCPS_5
}
#[doc = "Checks if the value of the field is `RTCPS_6`"]
#[inline(always)]
pub fn is_rtcps_6(&self) -> bool {
*self == RTC... | Rust | 0 |
#[macro_use]
pub mod test_helpers;
mod escape;
pub use escape::*;
mod unescape;
pub use unescape::*;
mod language;
use language::syntax;
use language::vm;
use language::compiler;
use language::natives;
use syntax::lexer;
use syntax::parser;
use lexer::{process_branch, lexer};
use lexer::block_tree;
use parser::{T... | Rust | 0 |
here should the patch point to?
enum PointTo {
/// Point to the crate path.
Path,
/// Point to the git branch.
GitBranch { repository: String, branch: String },
/// Point to the git commit.
GitCommit { repository: String, commit: String },
}
impl PointTo {
fn from_cli(
point_to_git:... | Rust | 0 |
ry:
calibrator = CameraCalibrator(image_size)
except Exception as e:
print(f"Error when creating CameraCalibrator: {e}")
exit(-1)
if args.mode == 'calibrate':
if not args.corner or not args.square:
print("Missing parameters of corner/square. Using: \n\n"
... | Python | 1 |
er_mock = MockDnsResponseHandler::new();
let cache = StreamsCache::with_default_cleanup_duration(
|| {
Ok(Stream::new(
Builder::new()
.read_error(io::Error::new(ErrorKind::Other, "oh no!"))
.build(),
... | Rust | 0 |
program = ::create_program_with_source(&context, &[CString::new(kernel).unwrap()]).unwrap();
let program2 = ::create_program_with_source(&context, &[CString::new(kernel2).unwrap()]).unwrap();
let header = ::create_program_with_source(&context, &[CString::new(header).unwrap()]).unwrap();
let opti... | Rust | 0 |
sure
that corresponds to this value. The f-measure is the harmonic mean
of the ``precision`` and ``recall``, weighted by ``alpha``.
In particular, given the precision *p* and recall *r* defined by:
- *p* = true positive / (true positive + false negative)
- *r* = true positive / ... | Python | 1 |
flow.name,
SUM(mz_records_per_dataflow.records) as records
FROM
mz_catalog.mz_records_per_dataflow
GROUP BY
mz_records_per_dataflow.id,
mz_records_per_dataflow.name",
id: GlobalId::System(43),
index_id: GlobalId::System(44),
};
const VIEW_PERF_DEPENDENCY_FRONTIERS: LogView = LogView {
name:... | Rust | 0 |
import pygame
class MusicPlayer:
def __init__(self):
pygame.init()
pygame.mixer.init()
self.playing = False
def load_music(self, file_path):
pygame.mixer.music.load(file_path)
def play_music(self):
pygame.mixer.music.play()
self.playing = True
def pau... | Python | 1 |
th_point[1]]
pts2 = np.float32([new_left_point, heigth_point, right_point]) # 字符只是高度需要改变
pts1 = np.float32([left_point, heigth_point, right_point])
M = cv2.getAffineTransform(pts1, pts2)
dst = cv2.warpAffine(oldimg, M, (pic_width, pic_hight))
point_limit(righ... | Python | 1 |
b: EvasReal)>;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[repr(C)]
pub enum EvasCanvas3DObjectType {
EvasCanvas3DObjectTypeInvalid = 0,
EvasCanvas3DObjectTypeScene = 1,
EvasCanvas3DObjectTypeNode = 2,
EvasCanvas3DObjectTypeCamera = 3,
EvasCanvas3DObjectTypeLight = 4,
EvasCanvas3DObj... | Rust | 0 |
usize>().unwrap();
}
}
let mut edges = Vec::with_capacity(n_edges);
for line in reader.lines() {
let (node1, node2, weight) = parse_line(&line.unwrap());
edges.push((node1, node2, weight));
edges.push((node2, node1, weight));
}
run_exp!(runs, let _ = kruskal(&edges... | Rust | 0 |
"""Tests for parsing PharmGKB data."""
from unittest import TestCase
from parameterized import parameterized
from kg_covid_19.transform_utils.pharmgkb import PharmGKB
class TestPharmGKB(TestCase):
"""Test the ttd transform."""
def setUp(self) -> None:
"""Set up for PharmGKB tests."""
self.... | Python | 1 |
)
} {
-1 => Err(Error::last_os_error()),
n => Ok(n as _),
}
}
/// Receive from socket into buffer.
pub fn recv(socket: &OwnedFd, buf: &mut ReadBuf, flags: c_int) -> Result<usize> {
let unfilled = unsafe { buf.unfilled_mut() };
match unsafe { libc::recv(socket.as_raw_fd(), unfill... | Rust | 0 |
tab: {}", &raw);
if let Err(e) = self.call_method_on_browser(target_method) {
warn!("Failed to call method on browser: {:?}", e);
self.waiting_call_registry.unregister_call(call.id);
trace!("Unregistered callback: {:?}", call.id);
... | Rust | 0 |
er(1, 1), 1);
assert_eq!(grid_traveler(2, 3), 3);
assert_eq!(grid_traveler(3, 2), 3);
assert_eq!(grid_traveler(3, 3), 6);
assert_eq!(grid_traveler(18, 18), 2333606220);
}
#[test]
fn test_can_sum() {
assert_eq!(can_sum(7, &[2, 3]), true);
assert_eq!(can_sum(7, &[5, 3, 4, 7]), true);
assert_eq!(can_sum(... | Rust | 0 |
_attack_board_wrapper,
calculate_knight_attack_board
);
const KNIGHT_ATTACK_BOARD: [BitBoard; 64] =
array_const_fn_init![calculate_knight_attack_board_wrapper; 64];
const fn calculate_king_attack_board(pos: Position) -> BitBoard {
const KING_OFFSETS: [(i16, i16); 8] = [
(0, 1),
(1, 0),
... | Rust | 0 |
found")]
CopyCachedInitDBFailedFileNotFound(#[source] std::io::Error),
/// Error when a copy process cannot be joined.
#[cfg(feature = "tokio-process")]
#[error("copying cached database failed, failed to join cp process")]
CopyCachedInitDBFailedJoinError(#[source] tokio::task::JoinError),
/// E... | Rust | 0 |
Poll::Pending
}
Err(other) => Poll::Ready(Err(nixerror(other))),
Ok(value) => Poll::Ready(Ok(value)),
}
}
pub fn poll_read_maybe<F, R>(
&self,
ctx: &mut Context<'_>,
fun: F,
) -> Poll<Result<R>>
where
F: FnOnce... | Rust | 0 |
e */
if (CAN_InitStruct->CAN_RFLM == ENABLE) {
CANx->MCR |= MCR_RFLM;
} else {
CANx->MCR &= ~MCR_RFLM;
}
/* Set the transmit FIFO priority */
if (CAN_InitStruct->CAN_TXFP == ENABLE) {
CANx->MCR |= MCR_TXFP;
} else {
... | Rust | 0 |
A fixed point unsigned integer
///
/// This is a `num_bigint::BigUint` with a fixed scale.
///
/// The fixed scale is determined by the generic `S` which implements `FixedScale` and
/// provides the constant `FixedScale::SCALE`.
#[derive(Clone)]
pub struct FixedUnsigned<S>
where S: FixedScale
{
int_value: BigUi... | Rust | 0 |
let defines = sources
.defines
.iter()
.map(|(k, v)| {
(
self.intern_string(k),
v.as_ref().map(|v| self.intern_string(v)),
)
})
.collect();
let files = sources
.files... | Rust | 0 |
_eq!(
self.len(),
self.ordering.len(),
"Draw state is inconsistent"
);
}
fn len(&self) -> usize {
self.members.len() - self.free_set.len()
}
}
#[derive(Default)]
struct MultiStateMember {
/// Draw state will be `None` for members that haven't been dr... | Rust | 0 |
# SPDX-License-Identifier: (GPL-2.0 OR Linux-OpenIB)
# Copyright (c) 2019 Mellanox Technologies, Inc. All rights reserved. See COPYING file
"""
Test module for pyverbs' pd module.
"""
import random
from tests.base import PyverbsAPITestCase
from pyverbs.pd import PD
class PDTest(PyverbsAPITestCase):
"""
Test ... | Python | 1 |
impl Display for ast::ProjExpr {
fn fmt(&self, f: &mut Formatter) -> Result {
write!(f, "{}.{}", ProjValExpr(&self.expr.val), self.field)
}
}
impl Display for ast::MatchExpr {
fn fmt(&self, mut f: &mut Formatter) -> Result {
write!(f, "match {} with ", self.expr)?;
if self.cases.is_... | Rust | 0 |
r all frames
inst_id: (M,) Instance id. If None, warp for the average instance
Returns:
xy: (M,N,2) Points in image plane
"""
# TODO: make the format consistent
# print("proj xyz.shape", xyz.shape)
xyz = xyz[:, :, None]
# inst_id = inst_id[..., :1... | Python | 1 |
ShBinOp::BitAndEq=>"&=",
ShBinOp::BitOrEq=>"|=",
ShBinOp::ShlEq=>"<<=",
ShBinOp::ShrEq=>">>=",
}
}
}
#[derive(Clone, Hash, PartialEq)]
pub struct ShId{
pub name:String
}
#[derive(Clone)]
pub enum ShLit{
Int(i64),
Float(f64),
Str(String),
... | Rust | 0 |
offset: first.offset,
data: first.data,
});
}
}
for ch in order[..chars.len()].iter().map(|i| &chars[*i]) {
self.push_char(ch);
}
self.next_cluster += 1;
self.push_cluster(cluster);
start..sel... | Rust | 0 |
= HTTPX_DEFAULT_TIMEOUT,
**kwargs,
) -> Union[httpx.Client, httpx.AsyncClient]:
'''
helper to get httpx client with default proxies that bypass local addesses.
'''
default_proxies = {
# do not use proxy for locahost
"all://127.0.0.1": None,
"all://localhost": None,
}... | Python | 1 |
import re
import sys
from collections import Counter
from copy import deepcopy
from tqdm import tqdm
pattern = re.compile(r"(-?\d+)")
x = []
y = []
vx = []
vy = []
for line in sys.stdin:
[x_i, y_i, vx_i, vy_i] = map(int, pattern.findall(line))
x.append(x_i)
y.append(y_i)
vx.append(vx_i)
vy.append... | Python | 1 |
from .u2if import Device
from . import u2if_const as report_const
class WS2812B:
def __init__(self, pin_id, direction=None, pull=None, value=None):
self._initialized = False
self._device = Device()
self.pin_id = pin_id
self._initialized = self._init()
def __del__(self):
... | Python | 1 |
NoR/HyRes/img_noisy_npdB21_denoised.mat")
# print(comp.keys())
comp_tens = torch.tensor(comp["Y_restored"], dtype=torch.float32)
import matplotlib.pyplot as plt
# import matplotlib.image as mpimg
s = torch.sum(input_tens ** 2.0)
# print(s)
d = torch.sum((input_tens - output) ** 2.0)
#... | Python | 1 |
ling threshold
# Move through the particles until we find the one corresponding to u
while u > c:
i += 1
c += wt[i]
# Add the selected particle (excluding the weight) to the resampled set
X_bar_resampled[m] = X_bar[i]
# R... | Python | 1 |
e) * scaleFactor
# Store them on the output plugs
sinHandle = data.outputValue(circle.aSOutput)
cosHandle = data.outputValue(circle.aCOutput)
sinHandle.setFloat(sinResult)
cosHandle.setFloat(cosResult)
data.setClean(plug)
else:
return OpenMaya.MStatus.kUnknownParameter
return OpenMaya.MStatus... | Python | 1 |
: std::option::Option<std::string::String>,
/// <p>The name of the fleet that the device belongs to.</p>
pub device_fleet_name: std::option::Option<std::string::String>,
}
impl std::fmt::Debug for GetDeviceRegistrationInput {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
let m... | Rust | 0 |
n(n_block, n_unit, "conv3/kernel")], conv=True)
gn1_weight = np2th(weights[pjoin(n_block, n_unit, "gn1/scale")])
gn1_bias = np2th(weights[pjoin(n_block, n_unit, "gn1/bias")])
gn2_weight = np2th(weights[pjoin(n_block, n_unit, "gn2/scale")])
gn2_bias = np2th(weights[pjoin(n_block, n_unit... | Python | 1 |
Options;
use pathfinder_resources::embedded::EmbeddedResourceLoader;
use sdl2::event::Event;
use sdl2::keyboard::Keycode;
use sdl2::video::GLProfile;
fn main() {
// Set up SDL2.
let sdl_context = sdl2::init().unwrap();
let video = sdl_context.video().unwrap();
// Make sure we have at least a GL 3.0 co... | Rust | 0 |
t -delay 7 -loop 1 -compress lzw -layers optimize frame* out.gif
# convert is part of imagemagick (freeware)
SAVE_POSTSCRIPT = False
POSTSCRIPT_OUTPUT_DIR = 'frames'
FRAME_NUMBER = 0
import os
def saveFrame():
"Saves the current graphical output as a postscript file"
global SAVE_POSTSCRIPT, FRAME_NUMBER, POST... | Python | 1 |
a x: '/'.join(x.split(' > ')[1:])).apply(lambda x: x + ' (601302)')
df_printShirts['Brand'] = ''
df_printShirts['Product Name'] = df_printShirts['title_live'].apply(lambda x: f"{shop_name.upper()} {x}")
df_printShirts['Product Description'] = df_printShirts['body_html_live']
df_printShirts['Main Product... | Python | 1 |
der(SPLUNK_HEC_CHANNEL_HEADER, channel_id.clone())
.body(body)
.unwrap();
match client.request(request).await {
Ok(response) => {
let (parts, body) = response.into_parts();
... | Rust | 0 |
# Defeat as many ogres as you can.
# Use 'cast' and 'canCast' for spells.
index = 0
plan = ["lightning-bolt", 'attack', 'attack', 'attack', 'attack', 'attack', "lightning-bolt", "chain-lightning",
"regen", 'attack', "regen", "lightning-bolt", "chain-lightning", 'attack', 'attack', "lightning-bolt", 'attack',
... | Python | 1 |
US)?;
result = result - self.term()?;
}
}
Ok(result)
}
fn integer(&mut self, current_char: char) -> i32 {
let mut result = current_char as i32 - '0' as i32;
while self.index < self.line.len() && self.line[self.index].is_ascii_digit() {
res... | Rust | 0 |
from .base import Dependency, GitClone, ReleaseDownload, MakeBuilder, MesonBuilder
from kiwixbuild.utils import Remotefile
from kiwixbuild._global import neutralEnv
import platform
class Xapian(Dependency):
name = "xapian-core"
if platform.system() == "Windows":
class Source(GitClone):
... | Python | 1 |
+= 1
elif self.get_key(pygame.K_LEFT) == KeyStatus.PRESSED:
self.step -= 1
if self.step < 0:
self.step = 0
elif self.get_key(pygame.K_p) == KeyStatus.PRESSED:
self.env_pause = not self.env_pause
self.step_t0 = time.time()
elif self.... | Python | 1 |
#[inline(always)]
pub fn flock(file: &dyn AsRawFd, op: FlockOperation, nonblocking: bool) -> Result<()> {
let mut operation = match op {
FlockOperation::LockShared => libc::LOCK_SH,
FlockOperation::LockExclusive => libc::LOCK_EX,
FlockOperation::Unlock => libc::LOCK_UN,
};
if nonbl... | Rust | 0 |
"""Modifies Apache Beam so that we use MockBlobStorageFileSystem
instead of BlobStorageFileSystem for azfs:// URLs.
This allows unit tests that test Azure Blob Storage integration to be
lighter, as they can use the filesystem-backed MockBlobStorageFileSystem
rather than having to run Azurite for BlobStorageFileSystem.... | Python | 1 |
}
}
mod boxed {
use super::super::*;
#[bench]
fn run(b: &mut Bencher) {
const ITER_COUNT: usize = 1_000_000;
let thread_key = thread_key::get();
let x = TCell::new(Box::new(0usize));
b.iter... | Rust | 0 |
bplot(133)
# plot_tsp(plt3, x_coord, W_val, W_bs, 'Beamsearch: {:.3f}'.format(W_to_tour_len(W_bs, W_val)))
# plt.show()
if __name__ == "__main__":
from utils.google_tsp_reader import GoogleTSPReader
num_nodes = 20
batch_size = 50
filepath = "./data/tsp5.txt"
dataset = GoogleTSPRea... | Python | 1 |
("Could not get cwd");
// use ./deploy as execution directory for now
let edir = cwd.join("deploy");
let inv = invoke::Invocation {
root: cwd,
edir,
opts,
pl_name,
art: art,
switches: switches,
};
inv.invoke(&mut log);
log.conclude();
}
<gh_sta... | Rust | 0 |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import pandas as pd
np.random.seed(19680801)
def randrage(n, vmin, vmax):
return (vmax - vmin) * np.random.rand(n) + vmin
# Crear una malla de puntos
x = np.linspace(-600, 700, 100)
y = np.linspace(-600, 700, 100)
x, y =... | Python | 1 |
s Fortran code contains undefined external functions, it will be skipped!")
# Step 3: get function of the code; translated cpp code and explanation
if skip_code == False:
try:
histor... | Python | 1 |
self.block_blob_service.create_blob_from_bytes(container_name, encrypted_blob_name, data)
raise Exception
except ValueError:
pass
# If the require_encryption flag is set, the service object will throw if
# there is no encryption policy set on download.
kek =... | Python | 1 |
a-current-file", file); }catch(e){}')
html.append(' let html="<div class=\\\"controls\\\"><div><b>檔案:</b>"+file+"</div>";')
html.append(' html+="<div style=\\\"margin-top:10px\\\"><label><input type=\\\"checkbox\\\" id=\\\"autoSizeColumns\\\" checked> 自適應短欄位寬度</label> <span class=\\\"muted\\\">(僅適... | Python | 1 |
st libc::c_char,
userData: *mut libc::c_void,
useCapture: EM_BOOL,
callback: em_webgl_context_callback,
) -> EMSCRIPTEN_RESULT;
pub fn emscripten_set_webglcontextrestored_callback(
target: *const libc::c_char,
userData: *mut libc::c_void,
useCapture: EM_BOOL,
... | Rust | 0 |
class BColors:
HEADER = "\033[95m"
OKBLUE = "\033[94m"
OKCYAN = "\033[96m"
OKGREEN = "\033[92m"
WARNING = "\033[93m"
FAIL = "\033[91m"
ENDC = "\033[0m"
BOLD = "\033[1m"
UNDERLINE = "\033[4m"
def print_green(*args):
print(BColors.OKGREEN + " ".join(map(str, args)) + BColors.ENDC... | Python | 1 |
collect::<Vec<T>>();
let right = &arr[mid..high].iter().copied().collect::<Vec<T>>();
let mut li = 0;
let mut ri = 0;
while li < left.len() && ri < right.len() {
if left[li] <= right[ri] {
arr[low + li + ri] = left[li];
li += 1;
}... | Rust | 0 |
width
}
}
pub struct Grid {
pub dimensions: GridSize,
pub grid: Vec<usize>
}
impl Grid {
pub fn with_dimensions(dimensions: GridSize) -> Grid {
let grid = Grid::zero_grid(&dimensions);
Grid {
dimensions,
grid
}
}
pub fn new_zero_grid(&self) -> Grid {
let next_dimensions = sel... | Rust | 0 |
for i in all_sheet_name_list:
data_df_dict[i] = pd.read_excel(data_xls, sheet_name=i, header=0,
usecols=['order', 'family', 'genera', 'species', 'taphonomic grade'],
nrows=3000)
# if data_df_dict[i].shape[0] < 3000:
# da... | Python | 1 |
ndjson_writer.flush().unwrap();
let written_messages = String::from_utf8(output).unwrap();
assert_eq!(
&written_messages,
r###"{"gherkinDocument":{"uri":"testdata/good/empty.feature"}}
{"gherkinDocument":{"uri":"testdata/good/incomplete_feature_1.feature","feat... | Rust | 0 |
from mmcv import load, dump
from protogcn.smp import *
import datetime
joint_path = '../work_dirs/ntu60_xsub/j/best_pred.pkl'
bone_path = '../work_dirs/ntu60_xsub/b/best_pred.pkl'
kbone_path = '../work_dirs/ntu60_xsub/k/best_pred.pkl'
joint_motion_path = '../work_dirs/ntu60_xsub/jm/best_pred.pkl'
bone_motion_path = '.... | Python | 1 |
"""
for easy key changing n stuff
"""
keys = {
"null": chr(0), # No key pressed,
"ERR_OVF": 0x01,
"LCTRL": 0x01,
"LSHIFT": 0x02,
"LALT": 0x04,
"LMETA": 0x08,
"WINDOWS": 0x08, # for duckyscript
"RCTRL": 0x10,
"RSHIFT": 0x20,
"RALT": 0x40,
... | Python | 1 |
from fractions import Fraction
import av
from .common import fate_suite
def test_chapters() -> None:
expected = [
{
"id": 1,
"start": 0,
"end": 5000,
"time_base": Fraction(1, 1000),
"metadata": {"title": "start"},
},
{
... | Python | 1 |
::Y as u32 as sys::godot_vector3_axis,
set_to.y
);
(api.godot_vector3_set_axis)(
&mut copied as *mut _ as *mut sys::godot_vector3,
Axis::Z as u32 as sys::godot_vector3_axis,
set_to.z
);
... | Rust | 0 |
(Self::from(superclass_value))
}
}
/// Returns a Vector of ancestors of current class
///
/// # Examples
///
/// ### Getting all the ancestors
///
/// ```
/// use rutie::{Class, VM};
/// # VM::init();
///
/// let true_class_ancestors = Class::from_existing("TrueC... | Rust | 0 |
::complete::tag,
character::complete::{multispace0, multispace1},
combinator::all_consuming,
multi::separated_list1,
sequence::{delimited, separated_pair},
IResult,
};
#[derive(Debug, PartialEq, Eq, Hash, Clone)]
struct Point(i32, i32);
#[derive(Debug, Clone)]
struct Line(Point, Point);
impl Line ... | Rust | 0 |
;
}
}
s.tPos = s.origPtr as u32;
s.nblock_used = 0;
if s.blockRandomised > 0 {
// BZ_RAND_INIT_MASK;
s.rNToGo = 0;
s.rTPos = 0;
s.k0 = BZ_GET_SMALL(s, nblock);
s.nblock_used += 1;
BZ_RAND_UPD_MASK(s);
s.k0 ^= if s.rNToGo == 1 { 1 } else { ... | Rust | 0 |
import subprocess
import sys
def execute_use_case(use_case_name):
# Dictionary of executable paths for each use case
use_cases = {
"useCase1": "C:\\Users\\oem\\Documents\\usecase\\encrypt.exe",
"useCase2": "C:\\Users\\oem\\Documents\\usecase\\excel.exe"
}
# Check if the given use case ... | Python | 1 |
online_product_id = product.get('id')
# # 产品中的spu存储的是原始产品id
# product_spu = product.get('spu')
# if product_spu:
# original_product_id = product_spu
# else:
# product_images_list = product.get('images')
# ... | Python | 1 |
# Copyright (c) 2019, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
import frappe
def execute():
frappe.reload_doc("accounts", "doctype", "bank_account")
frappe.reload_doc("accounts", "doctype", "bank")
if frappe.db.has_column("Bank", "branch_code") and frappe.db.has_column(... | Python | 1 |
a_current[i] != 0:
CPU_id = int(omega_current[i] - 1)
actual_process_delay[i, 0] = task_mat[i, CPU_id] / np.sum(actual_C[i, :])
'''
process_delay = cp.max(cp.multiply(task_mat, cp.inv_pos(C))) # Mx1
func = cp.Minimize(cp.sum(cp.maximum(local_delay, front_delay + ... | Python | 1 |
import time # Used for adding delays (pausing between characters)
import random # Used for picking a random delay each time
# ------------------ Slow Print Function ------------------ #
def slow_print(text, delay_range=(0.01, 0.06)):
"""
Prints text character-by-characte... | Python | 1 |
#!/usr/bin/env python
#
#
# Licensed to the Apache Software Foundation (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
#... | Python | 1 |
emote.update()
self.view_local.update()
@change("camera")
def on_camera_change(self, camera, **kwargs):
if camera is not None:
self.view_local.object_manager.UpdateObjectFromState(json.dumps(camera))
self.view_remote.update()
def reset_camera(self):
self.ren... | Python | 1 |
import os
import logging
import requests
from cryptography.fernet import Fernet
from cryptography.exceptions import InvalidTag
# Endereço do servidor do atacante (INSIRA O IP DA SUA MÁQUINA KALI)
URL_SERVIDOR_ATACANTE = "http://192.168.100.20:8000/decrypt" # <--- MUDE ESTE IP!
def descriptografar_pasta_remotamente(... | Python | 1 |
SHALL THE
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
/// SOFTWARE.
use core::fmt;
use core::fmt::Write;
extern "C" {
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.