text string | label_name string | labels int64 |
|---|---|---|
from setuptools import setup, find_packages
setup(
name="umoc-backend",
version="0.1",
packages=find_packages(),
python_requires=">=3.8",
)
| Python | 1 |
51
);
assert_eq!(
copy_exactly_n(&mut &data[..], &mut sink, 79, &mut buf).unwrap(),
79
);
assert_eq!(
copy_exactly_n(&mut &data[..], &mut sink, 80, &mut buf).unwrap(),
80
);
assert_eq!(copy_n(&mut &data[..], &mut... | Rust | 0 |
bool {
matches!(c, 'A'..='Z' | 'a'..='z' | '\u{00c0}'..='\u{00d6}' | '\u{00d8}'..='\u{00f6}' | '\u{00f8}'..='\u{02ff}' | '\u{0370}'..='\u{037d}' | '\u{037f}'..='\u{1fff}' | '\u{200c}'..='\u{200d}' | '\u{2070}'..='\u{218f}' | '\u{2c00}'..='\u{2fef}' | '\u{3001}'..='\u{d7ff}' | '\u{f900}'..='\u{fdcf}' | '\u{fdf0}'..='\... | Rust | 0 |
String::from_utf8_lossy(&input);
let instructions: Vec<_> = input
.lines()
.map(|line| {
let args: SmallVec<[_; 3]> = line.split_ascii_whitespace().collect();
Ok(match args[0] {
"cpy" => Instruction::Copy(get_input(args[1])?, get_input(args[2])?),
... | Rust | 0 |
"""Create and bundle CSS and JS files."""
from flask_assets import Environment, Bundle
def compile_static_assets(app):
"""Configure static asset bundles."""
assets = Environment(app)
Environment.auto_build = True
Environment.debug = False
# Stylesheets Bundles
account_less_bundle = Bundle(
... | Python | 1 |
IterFlags::empty())
.map(|segment| segment.reversed())
.collect();
segments.reverse();
for (segment_index, segment) in segments.iter().enumerate() {
// FIXME(pcwalton): We negate the radius here so that round end caps can be drawn
// clockwise. Of course, ... | Rust | 0 |
import pygame
import sys
pygame.init()
# Configurações da tela
largura_tela = 1200
altura_tela = 650
tela = pygame.display.set_mode((largura_tela, altura_tela))
pygame.display.set_caption("Visual Novel")
# Cores
branco = (255, 255, 255)
# Carrega imagens
background_image = pygame.image.load("menu.png") # Substitua... | Python | 1 |
import tensorflow as tf
import tensorflow_datasets as tfds
import t5
import functools
vocab = 'gs://mesolitica-tpu-general/t5-data-v2/sp10m.cased.ms-en.model'
tpu = tf.distribute.cluster_resolver.TPUClusterResolver(
'node-1', zone='us-central1-f', project='mesolitica-tpu'
)
TPU_ADDRESS = tpu.get_master()
TPU_TOPOL... | Python | 1 |
e), Some(5));
/// assert_eq!(s.find(char::is_lowercase), Some(1));
/// }
/// ```
///
/// Base usage: split系列方法分割字符串
///
///
/// ```rust
/// fn main() {
/// let s = "Löwe 虎 Léopard";
/// let v = s.split( |c|
/// (c as u32) >= (0x4E00 as u32) && (c as u32) <= (0x9FA5 as u32)
/// ).collect::<Vec<... | Rust | 0 |
an be good for tracking",
"recommendations": []
}
# Add specific recommendations
if wind_speed > 20:
analysis["recommendations"].append("High winds may reduce animal movement")
elif wind_speed < 3:
analysis["recommendations"].append("Calm cond... | Python | 1 |
std::io::BufReader;
use std::collections::{HashSet, HashMap};
use wiki_network::wikipedia::*;
fn main() {
let stop_words = load_stopwords();
let questions = load_questions();
let wiki_graph = WikiGraph::new();
let ref new_page_map = wiki_graph.new_page_map;
let ref neighbors = wiki_graph.adjacenc... | Rust | 0 |
@OriginalExpenseSettlement.setter
def OriginalExpenseSettlement(self, OriginalExpenseSettlement):
self._OriginalExpenseSettlement = OriginalExpenseSettlement
@property
def OriginalOtherSettlement(self):
"""原合同事项处理-其他事项,长度不能超过200,只能由中文、字母、数字、中文标点和英文标点组成(不支持表情)。
:rtype: str
... | Python | 1 |
fig(signedness_to_force=False), QuantizerConfig(), True),
(QuantizerConfig(), QuantizerConfig(signedness_to_force=False), False),
(QuantizerConfig(signedness_to_force=True), QuantizerConfig(signedness_to_force=False), False),
(QuantizerConfig(signedness_to_force=False), QuantizerConfig(signednes... | Python | 1 |
if let Ok(location) = fs::read_to_string("debug-output-location.txt") {
return Path::new(location.trim()).join("glt");
};
PathBuf::from("./output")
}
fn get_seed() -> u64 {
std::env::args().nth(1)
.and_then(|seed| seed.parse::<u64>().ok())
.unwrap_or(0)
}
fn main() -> PyResult<()> {
println!("gen... | Rust | 0 |
(&local_node_id, &quorum_set, num_blocks);
let connection_manager = get_connection_manager(&local_node_id, &peers, &logger);
let (_task_sender, task_receiver) = get_channel();
let worker = ByzantineLedgerWorker::new(
Box::new(scp_node),
msg_signer_key,
ledg... | Rust | 0 |
_on_channels(&[
in1,
in2,
oak::ReadHandle {
handle: out1.handle
}
]))?
);
expect_eq!(
vec![
ChannelReadStatus::NOT_READY,
ChannelReadStatus::READ_READY,
... | Rust | 0 |
session.requests_sent += 1
session.failed_requests += 1
session.errors.append(str(e))
# 思考時間
if config.think_time > 0:
time.sleep(config.think_time)
return session
def _execute_request(
self,
... | Python | 1 |
oursename"])
)
elif course_check > 1:
redirect("/%s/default/courses" % request.application)
else:
redirect("/%s/default/" % request.application)
redirect("/%s/default/" % request.application)
def terms():
return dict(terms={})
def privacy():
return dic... | Python | 1 |
iou(target_boxes[idx][i, :].unsqueeze(0), target_boxes[idx])[0][0]
ious[i] = -1.0 # Mask self-IoU.
scores[idx][ious > nms_threshold] = 0.0
# Convert from relative [0, 1] to absolute [0, height] coordinates
img_h, img_w = target_sizes.unbind(1)
scale_fct ... | Python | 1 |
"test3",
);
let output = expand_by_wrapper(
r#"
value1:${TEST_EXPAND_BY_WRAPPER_EMBEDDED_PARTIAL_FOUND_EMPTY_DEFAULT1}
value2:${TEST_EXPAND_BY_WRAPPER_EMBEDDED_PARTIAL_FOUND_EMPTY_DEFAULT2}
value3:${TEST_EXPAND_BY_WRAPPER_EMBEDDED_PARTIAL_FOUND_EMPTY_DEFAULT3}
value4:${TEST_EXPAND_BY_WRAPPER_EM... | Rust | 0 |
_ptr()` and `len()` functions to get the
//! primitives, and `mem::forget()` the Buffer so that it isn't dropped. Again,
//! as with regular Rust, the caller is responsible for reconstructing the
//! `UnifiedBuffer` using `from_raw_parts()` and dropping it to ensure that the
//! memory allocation is safely cleaned up.
... | Rust | 0 |
}
fn _diff_param_sz(&self) -> usize {
self.cfg.in_dim * self.cfg.out_dim + self.cfg.out_dim
}
fn _init_param(&mut self, rng: &mut Xorshiftplus128Rng) {
match self.cfg.w_init {
ParamInitKind::Disabled => {
panic!("parameter initialization explicitly disabled");
}
ParamInitKin... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Created on Fri Aug 11 13:17:14 2017
@author: edgar
"""
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), ".."))
import getopt
from sharc.support.logging import Logging
from sharc.controller import Controller
from sharc.gui.view_cli import ViewCli
from sharc.mode... | Python | 1 |
_VERY_LONG_STRING: &'static str = "#version 100
#ifdef GL_FRAGMENT_PRECISION_HIGH
precision highp float;
#else
precision mediump float;
#endif
varying vec3 ls_normal;
void main() {
gl_FragColor = vec4((ls_normal + 1.0) / 2.0, 1.0);
}
";
use anyhow::Result;
use clap::{value_t, App, AppSettings, Arg, SubComma... | Rust | 0 |
nulls_first: options.nulls_first,
},
})
})
.collect()
}
/// Build a datafusion physical expression from its logical one
pub fn df_physical_expr(
input: &dyn ExecutionPlan,
expr: Expr,
) -> std::result::Result<Arc<dyn PhysicalExpr>, DataFusionError> {
df_physica... | Rust | 0 |
import platform
from pathlib import Path
import pytest
from invokeai.app.services.image_files.image_files_disk import DiskImageFileStorage
@pytest.fixture
def image_names() -> list[str]:
# Determine the platform and return a path that matches its format
if platform.system() == "Windows":
return [
... | Python | 1 |
}
fn origin(
&self, _origin: RouteOrigin, _info: &OriginInfo, _target: &mut W
) -> Result<(), io::Error> {
Ok(())
}
}
//------------ NoOutput-------------------------------------------------------
struct NoOutput;
impl<W: io::Write> Formatter<W> for NoOutput {
fn origin(
... | Rust | 0 |
-threshold=0",
"-Ccodegen-units=1",
// "-Zdebug-macros", // don't enable, makes the gcno graph involving `assert!` even worse.
]);
}
debug!("Executing {:?}", cmd);
cmd.ensure_success("rustc")?;
if is_local {
move_gcov_files(cov_build_path, OsStr::new("gcno"))?;
... | Rust | 0 |
oder
_default_decoder = JSONDecoder(
encoding=None,
object_hook=None,
object_pairs_hook=None,
)
global _default_encoder
_default_encoder = JSONEncoder(
skipkeys=False,
ensure_ascii=True,
check_circular=True,
allow_nan=True,
indent=None,
s... | Python | 1 |
$crate::Invariant::<$type, $crate::__impl_Unused!($($types $(: $variances)?,)*)>
};
($type:ty: invariant, $($types:ty $(: $variances:ident)?,)*) => {
$crate::Invariant::<$type, $crate::__impl_Unused!($($types $(: $variances)?,)*)>
};
($type:ty: covariant, $($types:ty $(: $variances:ident)?,)... | Rust | 0 |
ingle(UnitObject),
Many(&'a [UnitObject]),
}
impl Iscript {
pub fn unit_ref_object(&self, unit: UnitRefId) -> UnitRefParts<'_> {
if unit.0 < UnitObject::_Last as u16 {
UnitRefParts::Single(unsafe { mem::transmute(unit.0 as u8) })
} else {
let index = (unit.0 - UnitObject... | Rust | 0 |
證和待測試)"""
all_sources = self.get_all_data_sources()
implemented_sources = {}
for category, sources in all_sources.items():
implemented_list = []
for source_id, source_info in sources.items():
if source_info['status'] in ['verified', 'implemented']... | Python | 1 |
from test.support import is_apple_mobile
from test.test_importlib import abc, util
machinery = util.import_importlib('importlib.machinery')
import unittest
import sys
class FinderTests(abc.FinderTests):
"""Test the finder for extension modules."""
def setUp(self):
if not self.machinery.EXTENSION_S... | Python | 1 |
"" => continue,
text => annotations.parse([text], date_range)?,
}
}
}
Ok((annotations, depart_times_texts)) as Result<_>
};
inner().context("Failed to parse depart time/annotations texts")
}
fn parse_depart_times_and_annotations(
depart_times... | Rust | 0 |
dtype=torch.float32).view(1, -1, 4)
outputs["pred_logits"] = torch.tensor(outputs["pred_logits"], dtype=torch.float32).view(1, -1, 1)
# print("targets:", targets)
# print("outputs:", outputs)
index_i, index_j = matcher(outputs, [targets])[0]
for i, j in zip(index_i, index_j):
... | Python | 1 |
d y */
if ex == 0 {
i = uxi << 9;
while i >> 31 == 0 {
ex -= 1;
i <<= 1;
}
uxi <<= -ex + 1;
} else {
uxi &= u32::MAX >> 9;
uxi |= 1 << 23;
}
if ey == 0 {
i = uyi << 9;
while i >> 31 == 0 {
ey -= 1;
... | Rust | 0 |
num:int = int(input("Ingresa un número: "))
print(str(num) + " x 1 = " + str(num * 1))
print(str(num) + " x 2 = " + str(num * 2))
print(str(num) + " x 3 = " + str(num * 3))
print(str(num) + " x 4 = " + str(num * 4))
print(str(num) + " x 5 = " + str(num * 5))
print(str(num) + " x 6 = " + str(num * 6))
print(str(num) +... | Python | 1 |
# Test for https://github.com/kivymd/KivyMD/issues/1412 issue.
from kivy.clock import Clock
from kivy.lang import Builder
from kivymd.app import MDApp
from kivymd.uix.screen import MDScreen
class ScreenWithoutHero(MDScreen):
"""
This is the first screen from which we go to the screen that contains hero.
... | Python | 1 |
raise ValueError('Missing receptor or ligand.')
self._prepare_lsite()
cmd_hdock = [self.hdock_bin, "receptor.pdb", "ligand.pdb", "-lsite", "lsite.txt"]
if self._epitope_sites is not None:
self._prepare_rsite()
cmd_hdock += ["-rsite", "rsite.txt"]
subprocess.run(... | Python | 1 |
"scomplex",
"side_t", "siz_t", "struc_t", "trans_t", "uplo_t",
];
let mut builder = bindgen::Builder::default()
.header("wrapper.h")
.clang_arg(&format!("-I{}", std::env::var("DEP_BLIS_INCLUDE").unwrap()))
.generate_inline_functions(true)
.parse_callbacks(Box::new(bindge... | Rust | 0 |
Some(input_device_destroy as
unsafe extern "C" fn(_:
*mut wlr_input_device)
-> ()),};
init
}
};
unsafe extern "... | Rust | 0 |
# В каждой строке электронной таблицы записаны шесть натуральных чисел.
# Определите, сколько в таблице строк, для которых выполнены следующие условия:
# — в строке встречается ровно четыре различных числа; два из них по два раза,два — по одному;
# — сумма повторяющихся чисел (без учёта повторений, то есть каждое чис... | Python | 1 |
#indice o index
mi_texto = "Esto es una prueba de texto"
resultado = mi_texto[-4]
#print(resultado)
texto = "Esto es una prueba de texto"
resultado1 = texto.index("n") #retorna el indice de la primera letra n encontrada
#print(resultado)
texto2 = "Esto es una prueba de texto"
resultado2 = texto2.index("a",5) #lo... | Python | 1 |
import os
import cv2
import numpy as np
def video_time(file_path):
cap = cv2.VideoCapture(file_path)
# file_path是文件的绝对路径,防止路径中含有中文时报错,需要解码
if cap.isOpened(): # 当成功打开视频时cap.isOpened()返回True,否则返回False
# get方法参数按顺序对应下表(从0开始编号)
rate = cap.get(5) # 帧速率
FrameNumber = cap.get(7) # 视频文件的... | Python | 1 |
# -*- coding: utf-8 -*-
"""RespostaEntradaZero.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1dpE2pTGyFo4OYpiqk5XCyrhfQqi5MsN7
Resposta a entrada zero
"""
import sympy as sp
def resolver_resposta_entrada_zero(QN_coeffs, cond_iniciais):
t = sp.sy... | Python | 1 |
OTTOMPADDING', (0, 0), (-1, 0), 12),
('BACKGROUND', (0, 1), (-1, -1), colors.beige)]))
elements.append(t)
doc.build(elements)
# Function to handle button click and download PDF
def download_pdf(b):
create_pdf(df_targets, 'output.pdf')
print("PDF file created. Check your noteb... | Python | 1 |
# -*- coding: utf8 -*-
#
# Copyright (C) 2007, 2008 Adolfo González Blázquez <code@infinicode.org>
#
# This program 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 2, or (at your option)
# any l... | Python | 1 |
use crate::{alloc::AllocVar, boolean::Boolean, R1CSVar};
use ark_ff::{biginteger::BigInteger, fields::FpParameters, BitIteratorBE, One, PrimeField, Zero};
use ark_relations::{
ns,
r1cs::{ConstraintSystemRef, Result as R1CSResult},
};
use ark_std::{cmp::min, marker::PhantomData, vec, vec::Vec};
use num_bigint::B... | Rust | 0 |
code(enc)
for v in dec:
assert v in s
@pytest.mark.parametrize(
"td",
[
Timedelta(days=366),
Timedelta(days=-1),
Timedelta(hours=13, minutes=5, seconds=5),
Timedelta(hours=13, minutes=20, seconds=30),
Timedelta(days=-1... | Python | 1 |
").is_none());
i64_val += 1 as i64;
assert_eq!(i64::from_str(~"-9223372036854775808"), Some(i64_val));
assert!(i64::from_str(~"-9223372036854775809").is_none());
}
#[test]
fn test_ranges() {
let mut l = ~[];
for range(0,3) |i| {
l.push(i);
}
... | Rust | 0 |
Initial two slashes are ignored.
let search_start = if url.len() >= 2 && url.get(..2) == Some("//") {
2
} else {
0
};
let early_path = find_first_of(url, "/?;", search_start);
let mut protocol_end = find(url, "://", search_start);
if early_path.is_some() && early_path < protoco... | Rust | 0 |
s} rodada {server_round}")
clients_m = []
for me in range(self.ME):
sc = selected_clients_m[me]
for client in sc:
config = {"t": server_round, "me": me}
if type(parameters) is dict:
fit_ins = FitIns(p... | Python | 1 |
.insert(Occupied);
}
}
}
}
//! Expressions
//!
//! [Reference](https://github.com/hashicorp/hcl2/blob/master/hcl/hclsyntax/spec.md#expressions)
use std::borrow::Cow;
use std::iter::FromIterator;
use nom::types::CompleteStr;
use nom::{alt_complete, call, do_parse, named, tag};
use crate::co... | Rust | 0 |
_value(&query).unwrap();
let expected = json!({
"to_number": "2",
});
assert_eq!(expected, serialized);
}
#[test]
fn test_to_string() {
let fun = ToString::new(false);
let query = Query::from(fun);
let serialized = serde_json::to_value(&query).u... | Rust | 0 |
h,
external_cloud_key_path,
key_backup_data_path,
log_level_str,
)
}
TmkmsLight::Start { config_path, v } => {
let log_level_str = set_log(v);
command::start(config_path, log_level_str)
}
TmkmsLight::Reco... | Rust | 0 |
# -*- coding: utf-8 -*-
import datetime, pytz
from django.conf import settings as django_settings
from django.utils.translation import ugettext_lazy as _, string_concat
from django.utils import timezone
from magi.default_settings import (
DEFAULT_ACTIVITY_TAGS,
DEFAULT_ENABLED_NAVBAR_LISTS,
DEFAULT_ENABLED... | Python | 1 |
import telebot #line:2
from telebot import types #line:3
import colorama #line:4
from colorama import Fore ,Style ,Back ,init #line:5
import os #line:6
import time #line:7
import sys #line:8
import requests #line:9
init ()#line:10
red =Fore .RED #line:13
cyan =Fore .CYAN #line:14
blue =Fore .BLUE #line:15
green =Fore .... | Python | 1 |
1\x93\x47\x75\xAB\xFD\x10\xA9\xAE\x38\x16\xEA\x0B\x36\x6F\x6D\x88\x56\x8A\xE4\xFC\x02\xA5\xA5\x58\x9C\x73\x19\x23\x99\x6E\x88\x12\xA3\x94\x6B\x2B\x78\x9B\xB8\xA1\xA5\x9B\xE9\x9F\xF0\x20\xA7\x37\x58\x37\x64\x52\xAB\x50\x48\x57\x85\xF3\x21\x55\x18\x6C\xA6\x0A\x3D\xD9\x1B\x68\x37\x7E\x41\xD3\x4E\x0A\x2C\x40\xF7\x05\x12\x6... | Python | 1 |
_BLINKFW {
_BLINKFW { w: self }
}
#[doc = "Bits 10:12 - Contrast control"]
#[inline]
pub fn cc(&mut self) -> _CCW {
_CCW { w: self }
}
#[doc = "Bits 7:9 - Dead time duration"]
#[inline]
pub fn dead(&mut self) -> _DEADW {
_DEADW { w: self }
}
... | Rust | 0 |
}", index_string), None)?;
let voter = PairSigner::<NodeTemplateRuntime, Pair>::new(voter_keypair);
let body = RequestBody {
pk: pk.clone(),
cipher: cipher.clone(),
};
let response: ResponseBody = randomize_cipher(&body).await.unwrap();
let proof_is_valid... | Rust | 0 |
str(&s).is_ok());
}
}
use std::mem::{size_of};
use std::slice::{from_raw_parts, from_raw_parts_mut};
pub fn u64s_as_u8s(buf: &[u64]) -> &[u8] {
let ptr = buf.as_ptr();
let len = buf.len();
let bytes_len = len * size_of::<u64>();
unsafe { from_raw_parts(ptr as *const u8, bytes_len) }
}
pub fn u64s_as_u8s_m... | Rust | 0 |
import cv2
import pytesseract
import numpy as np
import re
pytesseract.pytesseract.tesseract_cmd = r"C:\\Program Files\\Tesseract-OCR\\tesseract.exe"
TESSERACT_CONFIG = "--oem 3 --psm 6 -c tessedit_char_whitelist=ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-"
MIN_AREA = 300
MAX_AREA = 30000
def recognize_plate(frame):
gr... | Python | 1 |
import logging as log
import numpy as np
from treys import Evaluator
from .deck import Card
def get_winners(hands: list[list[Card]], board:list[Card]) -> np.ndarray:
"""
Get the winner of a poker hand given the hands and board.
"""
evaluator = Evaluator()
scores = np.zeros(len(hands))
# Eval... | Python | 1 |
to_string(&self).map_err(|e| Error::Serde(e))?.as_bytes(),
)
.map_err(|e| Error::AeadCryptoError(e))?;
cypher.append(&mut nonce.iter_mut().map(|v| *v).collect());
Ok(LockedWallet {
id: self.id.clone(),
ciphertext: cypher
})
}
}
// generates rand... | Rust | 0 |
),
body: CommandGroup {
commands: vec!(cmd("echo")),
trailing_comments: vec!(Newline(Some("#body_comment".into()))),
},
})
);
}
#[test]
fn test_for_command_valid_separators() {
let cases = vec![
"for var do body; done",
... | Rust | 0 |
::LIKE,
FieldRelationship::NOT_LIKE,
];
values
}
fn enum_descriptor_static() -> &'static ::protobuf::reflect::EnumDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::EnumDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ON... | Rust | 0 |
TY_DEBUG_FILES, output_filename)
def main():
parser = argparse.ArgumentParser(description='Create DamnScript packages')
parser.add_argument('--all', action='store_true', help='Create all packages')
parser.add_argument('--net-release', action='store_true', help='Create .NET Release package')
parser.add_... | Python | 1 |
!= OFFCURVE:
continue
bcp2 = bcp1.nextNode
if bcp2.type == OFFCURVE:
node2 = bcp2.nextNode
else:
bcp2 = None
node2 = bcp1.nextNode
if layer.selection and not bcp1.selected and (bcp2 and not bcp2.selected) and not node1.selected and not node2.selected:
continue
angle1 = angle... | Python | 1 |
import turtle
import math
import random
#constants
turtle.bgcolor("black")
turtle.speed(500)
turtle.pencolor("white")
#variables
#pos1
x1 = -259.81
y1 = -150.00
#pos2
x2 = 259.81
y2 = -150.00
#pos3
x3 = 0.00
y3 = 300.00
def draw_dot():
turtle.penup()
turtle.dot(3.5, "white")
def draw_red_dot():
turt... | Python | 1 |
is file, make sure to update its references in runtime/src/lib.rs
/// If you remove this file, you can remove those references
/// For more guidance on Substrate modules, see the example module
/// https://github.com/paritytech/substrate/blob/master/srml/example/src/lib.rs
use runtime_primitives::traits::Hash;
use p... | Rust | 0 |
and Javascript for dates with the given timezone.
Parameters
----------
tz : string (optional)
The timezone of the input dates
Returns
-------
offset : pd.Timedelta
The offset between the Javasript representation and the Python representation
of a date with the given t... | Python | 1 |
/VkDescriptorPoolSize.html
#[repr(C)]
#[derive(Copy, Clone)]
pub struct VkDescriptorPoolSize {
pub descriptorType: VkDescriptorType,
pub descriptorCount: u32,
}
// @see https://www.khronos.org/registry/vulkan/specs/1.1-extensions/man/html/VkDescriptorPoolCreateInfo.html
#[repr(C)]
pub struct VkDescriptorPoolCr... | Rust | 0 |
import multiprocessing
import tempfile
from . import wds
def test_choose_next_shard_no_missing():
existing = [0, 1, 2]
init_counter = 0
expected_seq = [3, 4]
counter = multiprocessing.Value("I", init_counter, lock=True)
with tempfile.TemporaryDirectory() as tmpdir:
for expected in expect... | Python | 1 |
from pyrogram.types import (CallbackQuery, InlineKeyboardButton,
InlineKeyboardMarkup, InputMediaPhoto, Message)
def song_markup(videoid, duration, user_id, query, query_type):
buttons = [
[
InlineKeyboardButton(
text="❮",
callback_da... | Python | 1 |
r, PageRange>,
> {
self.tree.range(r)
}
pub fn range_mut(
&mut self,
r: core::ops::Range<PageNumber>,
) -> nonoverlapping_interval_tree::ValueRangeMut<
'_,
PageNumber,
IntervalValue<PageNumber, PageRange>,
> {
self.tree.range_mut(r)
}
... | Rust | 0 |
wrap();
None
}
};
}
}
break;
} else if !get_info.shown() {
caretaker.pop().unwrap();
return None;
}
}
None
}
/// Function that changes
/// age of already know... | Rust | 0 |
html_report_path = Path(values[0].find("a")["href"])
else:
html_report_path = None
# skip file name col
col_values = values_text[1:]
# parse the (6/48) part
covered_vs_total_re = r".*\(([0-9]+)/([0-9]+)\)"
covered_vs_... | Python | 1 |
String,
/// The pronoun to use when referring to a specified thing or things
/// belonging to or associated with a member previously mentioned. "That
/// popcorn was hers."
pub possessive_pronoun: String,
/// The pronoun to use to refer back to the member. "He saw himself as a
/// great directo... | Rust | 0 |
import os
import sys
TEST_PATH = os.path.dirname(__file__)
sys.path.insert(0, os.path.join(TEST_PATH, '..'))
import pytest
from pyvirtualdisplay import Display
import webdriverwrapper
from webdriverwrapper.pytest import *
@pytest.yield_fixture(scope='session', autouse=True)
def display():
d = Display(visible=... | Python | 1 |
xa7\xf3\x02\xe8\x9c\xccy\x9d\xdf+\
$o\x87\xd7\x9e}\xe4\x81kE\x8c\xbe\xb7\xd0'\xc3\
\xa3\xcc\x98q\xc4\xc5\x11\x8c\xf6!3\x7f\xe7\x93\xfe\xf0\
Ut\x06\x9b>`\xf2\x02b\xf3\xb0\xed\xe7\xf5l \
\xf4\x0b\xe2\x91\x89+\xc6\x1ei\xee7\x09\xc8\xfa\xe0\xcf\
\xf1\x1a\xc7\xe8\x86\x11g\xfd\xf8\xa0\x0d\xf6\xef\xd5\x1ee\
\x0e\x11>\xc6Sq\x0... | Python | 1 |
#!/usr/bin/env python
counts = dict()
mails = list()
fname = input("Enter file name:")
fh = open(fname)
for line in fh:
if not line.startswith("From "):
continue
# if line.startswith('From:'):
# continue
id = line.split()
mail = id[1]
mails.append(mail)
freq_mail = max(mails, k... | Python | 1 |
)
ttk.Button(btn_frame, text="确认", command=self.save_patches).pack(side="right", padx=4)
Printer().debug(f"加载完成后字典内容: {self.addr_patch_dicts}")
@staticmethod
def strip_prefix_suffix(hex_str: str, prefix_hex: str = None, suffix_hex: str = None) -> bytes:
"""
去掉前后缀对应的字节,返回主体部分的 ... | Python | 1 |
}
}
pub mod table {
use exoquant::Color;
pub struct MonoDark;
pub struct MonoLight;
impl super::Table for MonoDark {
fn table() -> &'static [Color] {
static TABLE: &'static [Color] = &[
Color {
r: 0x00,
g: 0x00,
b: 0x00,
a: 0xff,
},
Color {
r: 0xff,
g: 0xff,
... | Rust | 0 |
_stocks[code] = {'score': 0, 'reasons': [], 'raw_data': {}}
candidate_stocks[code]['score'] += score
candidate_stocks[code]['reasons'].append("체결강도상위")
# 거래대금 정보 보존 (있다면)
tv = float(row.get('acml_tr_pbmn', 0))
... | Python | 1 |
info.program = Some(s);
first = false;
} else if is_option(&s) {
if s == "-i" {
ifile = true;
} else if s == "-e" {
cmd = true;
} else if s == "-ei" {
ifile = true;
... | Rust | 0 |
Dsr r r GetItemsByID s zISteamInventory.GetItemsByIDc C s t t| |||S r )ISteamInventory_SerializeResultr )r r
Z
pOutBufferZpunOutBufferSizer r r SerializeResult s zISteamInventory.SerializeResultc C s t t| ||||... | Python | 1 |
SERVER_CORE: ULONG = 0x00000094;
pub const PRODUCT_UTILITY_VM: ULONG = 0x00000095;
pub const PRODUCT_DATACENTER_EVALUATION_SERVER_CORE: ULONG = 0x0000009F;
pub const PRODUCT_STANDARD_EVALUATION_SERVER_CORE: ULONG = 0x000000A0;
pub const PRODUCT_PRO_WORKSTATION: ULONG = 0x000000A1;
pub const PRODUCT_PRO_WORKSTATION_N: U... | Rust | 0 |
s
b[:, m2:, :] = stdev_inv_obs * (logz_obs - Knm_Kmminv[:, :, :m1] @ logz1)
logz2 = lstsq_chol(A, b)
return logz2
# Handles kernel matrix calculation and depth filtering
def distill_conditional_depth_from_scratch(
coords_m, z_m1, coords_n, cov_params_img, z_obs, model, min_depth, stdev_obs
):
a... | Python | 1 |
three(context: dg.AssetExecutionContext) -> None:
context.log.info("Creating asset three")
# define the resources to use different folders for different "environments"
resource_defs = {
"DEV":{"csv_storage": CsvStorageResource(base_dir="/Users/christian/code/30_days_of_dagster/data_dev")},
"PROD": ... | Python | 1 |
# -------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2021 OpenAI
#
# 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 Software without restriction, ... | Python | 1 |
lor='fraud_rate',
color_continuous_scale='Reds'
)
st.plotly_chart(fig, use_container_width=True)
else:
st.info("No amount range data available")
# Display recent alerts
st.subheader("Recent Fraud Alerts")
session = get_cassandra_connectio... | Python | 1 |
import os
from fastapi import APIRouter, HTTPException
from model.explorer import Explorer
if os.getenv("CRYPTID_UNIT_TEST"):
from fake import explorer as service
else:
from service import explorer as service
from error import Duplicate, Missing
router = APIRouter(prefix = "/explorer")
@router.get("")
@router... | Python | 1 |
operation="DELETE",
zone=zone,
rev_zone=rev_zone,
name=name,
rectype="AAAA",
)
)
ttl = None
ip_addresses = []
... | Python | 1 |
# -*- coding: utf-8 -*-
"""test proprietary_sim_types
:copyright: Copyright (c) 2019 RadiaSoft LLC. All Rights Reserved.
:license: http://www.apache.org/licenses/LICENSE-2.0.html
"""
from __future__ import absolute_import, division, print_function
from pykern.pkcollections import PKDict
import os
import pytest
def ... | Python | 1 |
receipts.len(), 2);
assert_eq!(alice.escrow_sigs.len(), 0);
// Interaction event.
alice.make_ixn("")?;
assert_eq!(alice.get_log_len(), 3);
assert_eq!(alice.get_state().sn, 2);
// Send interaction event to bob.
msg_to_bob = alice.get_last_event();
msg_to_alice = bob.process_events(&msg_... | Rust | 0 |
use it can lead to unexpected behavior. For elements, this is okay
because they do not trigger a re-run.
"""
ctx = get_script_run_ctx()
# Check is only relevant for fragments
if ctx is None or ctx.current_fragment_id is None:
return
current_fragment_delta_path = ctx.current_fragment_de... | Python | 1 |
`Err` if the free balance is lower than `value`.
/// otherwise return `ok`.
fn lock(aid: Self::AssetId, who: &T::AccountId, value: Self::Balance) -> DispatchResult {
Self::base_lock(aid,who,value)
}
/// Unlock `value` from locked balance to free balance. This function cannot fail.
/// If th... | Rust | 0 |
Gcl = Gcl_mags*sp.exp(1.j*Gcl_phases)
# Invert Gcl = Gol/(1+Gol) to map the contours into the open-loop space
return Gcl/(1.0 - Gcl)
def m_circles(mags, phase_min=-359.75, phase_max=-0.25):
"""Constant-magnitude contours of the function Gcl = Gol/(1+Gol), where
Gol is an open-loop transfer function... | Python | 1 |
e)
return last_log_len
# -------- buy (trade row or Explorer) --------
if cmd == "b":
if arg == "x":
if p.trade_pool >= 2:
game.buy_explorer(p)
if echo:
print("🛒 Bought Explorer.")
else:
if echo:
... | Python | 1 |
"BLD2_KEY_CERT.bin",
"BLD1_KEY_CERT.bin",
"BLD.bin",
]
with tarfile.open(bld_tar_path, "w") as tf:
for m in members:
s = os.path.splitext(fip_signed_path)[0] + "_" + m
logging.debug("Add %s", s)
tf.add(s, arcname=m, re... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.