text string | label_name string | labels int64 |
|---|---|---|
tObject):
raise TypeError(
"Expected list object from API, got %s"
% (type(result).__name__)
)
return result
@classmethod
async def list_async(
cls, **params: Unpack["TaxRate.ListParams"]
) -> ListObject["TaxRate"]:
"""
... | Python | 1 |
y.centroid.y),
fontsize=8,
color='white',
ha='center',
va='center'
)
# legend
legend_elements = [
mpatches.Patch(color='#21296B', label='High Calls + Low Need (Misalignment)'),
mpatches.Patch(color='#D12626', label='Low Calls + High Need (Underserved)'),
mpatches.Patch(c... | Python | 1 |
assert_eq!(output.trim(), format!("item {} hello", id.trim()));
}
use std::io::prelude::*;
use std::net::TcpListener;
use std::net::TcpStream;
fn main() {
let listener = TcpListener::bind("127.0.0.1:7878").unwrap();
for stream in listener.incoming() {
let stream = stream.unwrap();
// 处理每一次请求
... | Rust | 0 |
ings,
}
#[repr(C)]
pub struct Uniforms {
strength: f32,
offset: Vec2,
pub view: glam::Mat4,
pub model: glam::Mat4,
}
impl Stage {
pub fn new(
ctx: &mut Context,
tex_water_normal: Texture2D,
tex_target: Texture2D,
flip_y: bool,
) -> Stage {
#[rustfmt::ski... | Rust | 0 |
should be >0")
self.min_cutoff = mc
def set_beta(self, b):
"""
Set the beta parameter for adjusting dynamic cutoff.
:param b: The new beta value.
"""
self.beta = b
def set_derivative_cutoff(self, dc):
"""
Set the cutoff frequency for the deriva... | Python | 1 |
ration guarantees there will be a platform
if let Some(pinned_npm) = &project.platform().unwrap().npm {
info_pinned(self); // includes node version
if node_version.npm > *pinned_npm {
info!("{} this version of Node includes {}, which is higher than your p... | Rust | 0 |
rs
use image::buffer::ConvertBuffer;
use image::{ImageBuffer, Rgb, Rgba};
#[test]
fn test_rgbu8_to_rgbu16() {
// Create an all white image using Rgb<u16>s for pixel values
let image_u16 =
ImageBuffer::from_pixel(2, 2, image::Rgb::<u16>([u16::MAX, u16::MAX, u16::MAX]));
// Create an all white image... | Rust | 0 |
ests {
use super::*;
#[test]
fn test() {
let mut nums1 = vec![1, 2, 3, 0, 0, 0];
let mut nums2 = vec![2, 5, 6];
Solution::merge(&mut nums1, 3, &mut nums2, 3);
assert_eq!(nums1, vec![1, 2, 2, 3, 5, 6]);
}
}
<gh_stars>10-100
use common::*;
use monomial::{Monomial};
use polynomial::Polynomial;
use... | Rust | 0 |
pub fn $symbol => $extern_symbol($($argname : $argtype),*)
-> $rettype;
)*);
forward_stub_fn!($(
$(#[$meta])*
pub fn $symbol => $extern_symbol($($argname : $argtype),*)
-> $rettype;
)*);
... | Rust | 0 |
};
if stable {
log::info!("genesis stabilized");
std::fs::remove_file(gdir.join("changing")).ok();
let filep1 = gdir.join("current.toml");
let filep2 = gdir.join("stable.toml");
if let Err(e) = std::fs::rename(&filep1, &filep2) {
log::warn!("{:?}", e);
... | Rust | 0 |
mecode_5_1 = """Фокси немного устал, но пытается тебя догнать. Ускоряйся, чтобы быть первым на финише!"""
task_5_finished_word = """Узнай кодовое слово у координаторов квеста и напиши его сюда, чтобы завершить игру ⤵️"""
end_1 = "Ты молодец! Ты прибежал первым! 🎉"
end_2 = """Сегодня вечером мы подведем итоги дня и о... | Python | 1 |
ZG",
"UBOH",
"UDM",
"UNEWY",
"UTBI",
"VAIL",
"VOV",
"WAYN",
"WBPRN",
"WBPRO",
"WBPRZ",
"WCFB",
"WEB",
"WHT.WS.A",
"WISp",
"WLC",
"WPSpA.CL",
"XELpD",
"XELpG",
"XFD",
"XFR",
"XKC",
"XVF",
"ACMTA",
"AFBKW",
"ALLEP",
"AVCS",
"BKSC",
"BLVp",
"BSCpF",
"CEBK",
"CF... | Rust | 0 |
# Code generated by Lark OpenAPI.
import lark_oapi as lark
from lark_oapi.api.cardkit.v1 import *
def main():
# 创建client
client = lark.Client.builder() \
.app_id(lark.APP_ID) \
.app_secret(lark.APP_SECRET) \
.log_level(lark.LogLevel.DEBUG) \
.build()
# 构造请求对象
request:... | Python | 1 |
ub const Color_LightSalmon: c_int = -24454;
pub const Color_LightSeaGreen: c_int = -14634326;
pub const Color_LightSkyBlue: c_int = -7876870;
pub const Color_LightSlateGray: c_int = -8943463;
pub const Color_LightSteelBlue: c_int = -5192482;
pub const Color_LightYellow: c_int = -32;
pub const Color_Lime: c_int = -16711... | Rust | 0 |
# src/chuk_virtual_shell/commands/environment/export.py
import argparse
from chuk_virtual_shell.commands.command_base import ShellCommand
class ExportCommand(ShellCommand):
name = "export"
help_text = (
"export - Set environment variables\n"
"Usage: export KEY=VALUE [KEY2=VALUE2 ...]\n"
... | Python | 1 |
sert_eq!(universe.get(0, 0), true);
}
#[test]
fn universe_can_flip_cell() {
let mut universe = Universe::build_universe(2);
universe.flip(0, 1);
assert_eq!(universe.get(0, 1), true);
}
#[test]
fn lone_cell_dies_in_one_tick() {
let mut universe = Universe::build_universe(3);
universe.flip(1, 1);
... | Rust | 0 |
Path::new("./output/image.docx");
let file = File::create(&path).unwrap();
let mut img = File::open("./images/cat_min.jpg").unwrap();
let mut buf = Vec::new();
let _ = img.read_to_end(&mut buf).unwrap();
let pic = Pic::new(buf)
.size(320, 240)
.floating()
.offset_x(300)
... | Rust | 0 |
import json
from typing import Any
import scrapy
from scrapy.http import Response
from locations.dict_parser import DictParser
from locations.hours import OpeningHours
from locations.user_agents import BROWSER_DEFAULT
class LondonDrugsCASpider(scrapy.Spider):
name = "london_drugs_ca"
item_attributes = {"bra... | Python | 1 |
airport_path = self.base_path / "Data" / self.dir_name / "Terminal" / icao
if not airport_path.exists():
return f"No charts found for airport {icao}"
index_path = airport_path / "index.json"
if not index_path.exists():
return "Index file ... | Python | 1 |
_ => {
path[i][j] = bf::set_path_cell(l_pred, 'L');
l
}
}
}
}
}
//update best scoring position
if m[i][... | Rust | 0 |
import reflex as rx
from personal_website.styles.colors import Color as Color
class FloatButton(rx.Component):
library = "antd"
tag = "FloatButton"
# icon = rx.Image(src="/icons/linkedin_blue.svg")
icon : rx.Var[rx.Image]
# href = "https://www.linkedin.com/in/cgmuros/"
href : rx.Var[str]
ta... | Python | 1 |
import os
import re
COMPILE_REGEX = re.compile('<Compile Include="(.+)"\s*/?>')
def get_cs_files(dirname):
'''recursively search for C# files in directory
'''
return set(os.path.relpath(os.path.join(dirname, root, fname),
dirname)
for root, subdirs, files in os.... | Python | 1 |
_ => None,
}
}
pub fn acked(&mut self, token: &AckToken) {
self.spaces[token.space as usize].acknowledged(&token.ranges);
}
/// Generate an ACK frame.
///
/// Unlike other frame generators this doesn't modify the underlying instance
/// to track what has been sent. This onl... | Rust | 0 |
ueeze(Hc, dim=1)
Hc = self.cwa_net['fc'](Hc)
Ac = self.cwa_net['softmax'](Hc)
Ac = torch.mul(Ac, self.hp['k'])
beta = Ac.view(seq_len, batch, self.hp['k'])
fSC = torch.mul(fS, torch.unsqueeze(Ac, dim=2).repeat(1, 1, self.hp['m']))
fSC = torch.mean(fSC, dim=2)
fSC ... | Python | 1 |
, Serialize)]
#[serde(deny_unknown_fields)]
pub struct Version
{
major: u8,
minor: u4,
sub_minor: u4,
}
impl Display for Version
{
#[inline(always)]
fn fmt(&self, f: &mut Formatter) -> fmt::Result
{
write!(f, "{}.{}.{}", self.major, self.minor, self.sub_minor)
}
}
/// This is for a little-endian `u16`.
imp... | Rust | 0 |
]
fn test_primitive_null_offset_nulls() {
let b = UInt8Array::from(vec![Some(1), Some(2), Some(3)]);
let b = b.slice(1, 2);
let arrays = vec![b.data()];
let mut a = MutableArrayData::new(arrays, true, 2);
a.extend(0, 0, 2);
a.extend_nulls(3);
a.extend(0, 1, 2)... | Rust | 0 |
10971: "⫛",
10980: "⫤",
10982: "⫦",
10983: "⫧",
10984: "⫨",
10985: "⫩",
10987: "⫫",
10988: "⫬",
10989: "⫭",
10990: "⫮",
10991: "⫯",
10992: "⫰",
109... | Python | 1 |
rse YAML files")?;
let report = runner
.run_all_tests(collection)
.context("Failed to run tests")?;
printer
.print_report(&report)
.context("Failed to write report")?;
Ok(())
}
#[cfg(test)]
mod tests {
use super::*;
use mockall::*;
use crate::types::result::Te... | Rust | 0 |
'sequence_id'] = sequence_id
_execute_sequence = create_node(kind='execute', args=args)
return _execute_sequence
@_print_json
def execute_script(label):
"""Celery Script to execute a farmware.
Kind:
execute_script
Arguments:
label
"""
args = {}
args['label'] = label
... | Python | 1 |
ptr(repr_vec_64(pair)).to_bytes() };
let pair_repr_str: &str = from_utf8(pair_repr).unwrap();
assert_eq!(pair_repr_str, "1,2");
}
#[test]
fn test_parse_vec_64() {
let vec = parse_vec_64(CString::new("1.5,2.2,42,0,99.9999,-32.4,-2.0").unwrap().as_ptr());
let vec_repr = unsafe { CStr::from_ptr(repr... | Rust | 0 |
import os
# Reads and assembles the source code in the crate at the path `crate_root`.
# `crate_root` usually equals `basm/`.
def read_assemble(crate_root, target_language):
sol_first = []
sol_all = []
crate_src_path = os.path.join(crate_root, "src/")
for root, dirs, files in os.walk(crate_src_path):
... | Python | 1 |
#Uma empresa vai dar uma quantidade de bônus de internet de acordo com a pontuação que o cliente tem, para isso, vamos solicitar ao cliente para informar a quantidade de pontos que ele tem e devolver o resultado de informando o quanto de bônus ele vai ganhar
# 500 pontos = 6GB bonus
# 200 pontos = 3GB bonus
# 100 pon... | Python | 1 |
width: u32,
pub MaxPeakBandwidth: u32,
pub BurstSize: u32,
}
impl ::core::marker::Copy for HTTP_FLOWRATE_INFO {}
impl ::core::clone::Clone for HTTP_FLOWRATE_INFO {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: `\"Win32_Networking_HttpServer\"`*"]
pub const HTTP_FLUSH_RESPONSE_... | Rust | 0 |
ent).
#[allow(unused)]
#[repr(packed)]
pub struct Tss {
reserved0: u32,
stack0: u64,
stack1: u64,
stack2: u64,
reserved1: u64,
ist: [u64; 7],
reserved2: u64,
reserved3: u16,
iomap_base: u16,
}
<reponame>azuchi/tapyrus-signer<gh_stars>1-10
use crate::cli::setup::traits::Response;
use ... | Rust | 0 |
.body(Body::Empty)
.unwrap()
.with_query_string_parameters(query_param);
let response = saint::saint(request, Context::default())
.await
.expect("expected Ok(_) value")
.into_response();
let saint_collection: SaintCollection;
if let Body::Text(body) = response.body(... | Rust | 0 |
expr(place, ctx);
ctx.builder.push(format!("{} = {};", place_result, res_val));
}
fn generate_stmt(stmt: Stmt, ctx: &mut CodeGenContext) {
use self::StmtKind::*;
match stmt.node {
Return(e) => generate_return(*e, ctx),
Item(i) => generate_item(*i, ctx),
Expr(e) => {
le... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
from odoo.addons.base.tests.common import SavepointCaseWithUserDemo
class TestResPartnerBank(SavepointCaseWithUserDemo):
"""Tests acc_number
"""
def ... | Python | 1 |
64)).into(), ()).unwrap();
match s.get("piano").unwrap().0.eval(&s) {
Err(EvalError::Illegal(IllegalReason::CyclicDependency)) => (),
x => panic!("{:?}", x),
}
match Expr::from(ExprData::Ident("piano".into())).eval(&s) {
Err(EvalError::Illegal(IllegalReason::CyclicDependency)) => ()... | Rust | 0 |
n: u64,
/// The offset of the whitespace character preceeding the first entry of the main xref table
pub t: u64,
/// The page number of the first page. Defaults to 0.
pub p: Option<u64>,
}
macro_rules! try_iresult {
($e:expr) => {{
match $e {
Ok(val) => val,
Err(e) ... | Rust | 0 |
ribute Table."]
#[doc = ""]
#[doc = " @note It is currently only possible to add a characteristic to the last added service (i.e. only sequential population is supported at this time)."]
#[doc = ""]
#[doc = " @note Several restrictions apply to the parameters, such as matching permissions between the user description d... | Rust | 0 |
inder of the tip.
NotFinder,
/// The tip cannot be claimed/closed because there are not enough tippers yet.
StillOpen,
/// The tip cannot be claimed/closed because it's still in the countdown period.
Premature,
}
#[pallet::call]
impl<T: Config> Pallet<T> {
//... | Rust | 0 |
# Adapted for numpy/ma/cdms2 by convertcdms.py
import numpy
import cdms2, cdutil, vcs, cdtime
import string, time, sys, os
#
# A program that loops through a subset of the AMIP data
# for a specified variable. Data are extracted covering the AMIP I
# time period (197901-198412) and average annual cycle is calculated
#... | Python | 1 |
7
local.get 7
return)
(table (;0;) 1 1 funcref)
(memory (;0;) 2)
(global (;0;) (mut i32) (i32.const 66560))
(export "memory" (memory 0))
(export "add" (func $add)))
"#;
fn main() {
// Parse WAT text into syntax tree
let tree = match parse(MODULE_ADD) {
Ok(tree) => tree,
Err(e... | Rust | 0 |
from intelligence_layer.result_interpreters.step_relation_interpreters.conditional_rule_interpreters.command_output_conditional_rule_interpreter import BashCommandOutputConditionalRuleInterpreter
from intelligence_layer.result_interpreters.step_relation_interpreters.conditional_rule_interpreters.conditional_rule_interp... | Python | 1 |
};
($sandcrust:ident, $head:ident : $var_type:ty ) => {
$sandcrust.put_var($head);
};
($sandcrust:ident, mut $head:ident : $var_type:ty ) => { $sandcrust.put_var($head); };
($sandcrust:ident, mut $head:ident : $var_type:ty, $($tail:tt)+) => {
$sandcrust.put_var($head);
sandcrust_push_function_args!($sandcru... | Rust | 0 |
Raw>::test_build_multiproof_in_empty_tree()
}
#[test]
fn test_build_multiproof_in_empty_tree_hashed() {
ProofMapTester::<Hashed>::test_build_multiproof_in_empty_tree()
}
#[test]
fn test_build_multiproof_in_single_node_tree_raw() {
ProofMapTester::<Raw>::test_build_multiproof_in_single_node_tree()
}
#[test]
f... | Rust | 0 |
from typing import Dict, Iterator, Literal
import streamlit as st
import requests
import time
# type _
_Role = Literal['assistant', 'user']
# constant _
_API_HOST = 'http://localhost:5000'
# misc _
def _get_avatar(role: _Role) -> str:
return {
'assistant': '🤖',
'user': '👤'
}[role]
d... | Python | 1 |
nitTestRunnerO) -> bool>,
pub record: ::std::option::Option<
unsafe extern "C" fn(
inst: *mut UnitTestRunnerO,
pass: bool,
test_str: *const ::std::os::raw::c_char,
file: *const ::std::os::raw::c_char,
line: u32,
) -> bool,
>,
pub ex... | Rust | 0 |
tterBuilder,
},
management::{
mpi_finalize::MpiFinalizeBuilder, mpi_init::MpiInitBuilder,
mpi_init_thread::MpiInitThreadBuilder,
},
point_to_point::{
mpi_irecv::MpiIrecvBuilder, mpi_isend::MpiIsendBuilder, mpi_recv::MpiRecvBuilder,
mpi_send::MpiSendBuilder,
},
syn... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import os
import numpy as np
if __name__ == "__main__":
results_file = os.path.join("results", "results_accuracy_of_jaccard_no_refining")
output_file = os.path.join("plots", "accuracy_jaccard_no_refining_MGS.png")
df = pd.read_csv(re... | Python | 1 |
from flask import request
from app.config import (
PHONE_PROVIDER_1_HEADER,
PHONE_PROVIDER_1_SECRET,
)
from app.log import LOG
from app.models import PhoneNumber, PhoneMessage
from app.phone.base import phone_bp
@phone_bp.route("/provider1/sms", methods=["GET", "POST"])
def provider1_sms():
if request.he... | Python | 1 |
cv2.imshow(window_name, frame)
except cv2.error as e:
print(f"错误 (select_target_roi): 初始显示失败: {e}")
return None
key = cv2.waitKey(20) & 0xFF
if key == 13 or key == 32: # Enter or Space
if selected_bbox ... | Python | 1 |
import pytest
import re
from pathlib import Path
from ginkgo_ai_client.queries import MeanEmbeddingQuery, PromoterActivityQuery
def test_that_forgetting_to_name_arguments_raises_the_better_error_message():
expected_error_message = re.escape(
"Invalid initialization: MeanEmbeddingQuery does not accept unna... | Python | 1 |
data to `width * height`.
unsafe fn set_len(&mut self) {
self.data.set_len(self.width() * self.height())
}
}
/// A lottie animation.
pub struct Animation(NonNull<Lottie_Animation_S>);
impl Debug for Animation {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("Animation").finish_non_e... | Rust | 0 |
};
let producer_right = DisjointSubsetsProducer {
access: self.access,
subsets: self.subsets,
labels: self.labels,
range_start_idx: global_subset_idx,
range_len: producer_len - index,
};
(producer_left, producer_right)
}
}
str... | Rust | 0 |
square());
}
#[bench]
fn fp751_mul(b: &mut Bencher) {
let mut z = Fp751X2::zero();
b.iter(|| mul751(&BENCH_X, &BENCH_Y, &mut z));
}
#[bench]
fn fp751_rdc(b: &mut Bencher) {
let mut z = Fp751Element::zero();
b.iter(|| rdc751(&BENCH_Z, &mut z));
}
#[bench... | Rust | 0 |
d: Record<'n>,
file_record_number: u64,
}
impl<'n> NtfsFile<'n> {
pub(crate) fn new<T>(
ntfs: &'n Ntfs,
fs: &mut T,
position: u64,
file_record_number: u64,
) -> Result<Self>
where
T: Read + Seek,
{
let mut data = vec![0; ntfs.file_record_size() as usi... | Rust | 0 |
# Import necessary libraries
from sklearn.datasets import make_classification
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeClassifier
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
import matplotlib.pyplot as plt
from sklearn.tree import ... | Python | 1 |
DescriptorPool, DescriptorSet, DescriptorSetLayout},
device::{BarSupport, Device, DeviceConfiguration, QueueConfiguration, Queues},
error::AscheError,
fence::Fence,
image::{Image, ImageView, Sampler},
instance::{Instance, InstanceConfiguration, Version},
query::QueryPool,
queue::{ComputeQueu... | Rust | 0 |
ble of variables.
///
/// The most signicant variable (the one that produces the largest
/// change in the return variable) should be the rows (which are
/// spline fitted for accuracy) whereas the slower secondary
/// variable are the coluumns (which are only linearly
/// interpolate). Splines ... | Rust | 0 |
import os
import logging
import random
import hydra
import numpy as np
import multiprocessing as mp
import wandb
from omegaconf import DictConfig, OmegaConf
import torch
import time
from agents.utils import sim_framework_path
log = logging.getLogger(__name__)
print(torch.cuda.is_available())
OmegaConf.register_new... | Python | 1 |
optimisation, but might be useful if the threadpool is large & shared & stressed and workloads are small?
let sync = (Mutex::new(false), Condvar::new(), AtomicUsize::new(num_threads));
let loop_counter = AtomicUsize::new(0);
for cpu_id in 0..num_threads {
let p = Ptrs::<K::T> {
app: app_base.of... | Rust | 0 |
"""
更新風險控制參數
Args:
**kwargs: 風險參數
Returns:
bool: 是否更新成功
"""
try:
for key, value in kwargs.items():
if key in self.risk_params:
self.risk_params[key] = value
lo... | Python | 1 |
lize)]
#[clap(group = ArgGroup::new("method"), about)]
pub(crate) struct GetKeyPairOptions {
/// File name of key pair
key_file: Option<String>,
/// Set output format (one of 'hex-str', 'int-array', hex-array', 'base64')
#[clap(short, long, default_value = "base64")]
format: crate::commands::convert... | Rust | 0 |
format!("test_string_{}", rng.gen::<u64>());
Self {
a: rng.gen::<u32>(),
d: if rng.gen::<u32>() % 2 == 0 {
Some(rng.gen::<u32>())
} else {
None
},
b: s,
c: if rng.gen::<u32>() % 2 == 0 {
Some... | Rust | 0 |
gs.tick_rate);
let mut tui = Tui::new(terminal, events);
tui.init()?;
// Start the main loop.
while app.state.running {
// Render the user interface.
tui.draw(&mut app)?;
// Handle events.
match tui.events.next()? {
Event::Key(key_event) => {
handler::handle_events(key_event, &mut tui, &mut app)?
... | Rust | 0 |
se("http://barneyrubble.tumblr.com").unwrap()
);
}
#[test]
fn parse_shorthand_person_reversed() {
let person = "<NAME> (http://barneyrubble.tumblr.com/) <<EMAIL>>";
let parsed = Person::from_str(person).unwrap();
assert_eq!(parsed.name, "<NAME>");
assert_eq!(parsed.email.unwrap(), "<EMAIL>");
... | Rust | 0 |
ult()
};
}
impl orml_tokens::Config for Runtime {
type Event = Event;
type Balance = Balance;
type Amount = Amount;
type CurrencyId = CurrencyId;
type WeightInfo = ();
type ExistentialDeposits = ExistentialDeposits;
type OnDust = ();
type MaxLocks = ();
type DustRemovalWhitelist = ();
}
parameter_types! {
... | Rust | 0 |
of the image each ROI should be sampled from
# roi_size : tuple of int
# The size `(h_roi, w_roi)` of the output ROIs
# interpolation : str
# Sampling mode, one of "bilinear" or "nearest"
# padding : str
# Padding mode, one of "border" or "zero"
# valid_mask : bool
# If ... | Python | 1 |
):
if not line:
continue
m = re.search(r"(\S+) (add|delete) (\d+.\d+.\d+.\d+) +(\S+)", line)
if not m:
print( "Could not match line:", line )
continue
name = m.group(1)
operation = m.group(2)
if operation == "add":
mat... | Python | 1 |
STARTUP_A::_1472)
}
#[doc = "1536 periods of peripheral clock"]
#[inline(always)]
pub fn _1536(self) -> &'a mut W {
self.variant(STARTUP_A::_1536)
}
#[doc = "1600 periods of peripheral clock"]
#[inline(always)]
pub fn _1600(self) -> &'a mut W {
self.variant(STARTUP_A::_16... | Rust | 0 |
index: set to override the host_index for a single
request; this effectively ignores the host_index
in the spec for a single request.
:type _host_index: int, optional
:return: Returns the result object.
""" # noqa: E501
_param = se... | Python | 1 |
1.3 >> 25) & 1) == 1;
features.sse2 = ((cpuid_1.3 >> 26) & 1) == 1;
features.htt = ((cpuid_1.3 >> 28) & 1) == 1;
features.sse3 = ((cpuid_1.2 >> 0) & 1) == 1;
features.vmx = ((cpuid_1.2 >> 5) & 1) == 1;
features.ssse3 = ((cpuid_1.2 >> 9) & 1) == 1... | Rust | 0 |
### conda install diagrams
from diagrams import Cluster, Diagram, Edge
from diagrams.custom import Custom
import os
os.environ['PATH'] += os.pathsep + 'C:/Program Files/Graphviz/bin/'
graphattr = { #https://www.graphviz.org/doc/info/attrs.html
'fontsize': '22',
}
nodeattr = {
'fontsize': '22',
'bgc... | Python | 1 |
def solution(arr):
n = len(arr[0]) # ❶ 입력 배열의 열의 개수를 저장합니다.
dp = [[0] * n for _ in range(4)] # ❷ dp 배열을 초기화합니다. 4행 n열의 2차원 배열입니다.
# 각 열에서 선택 가능한 4가지 조약돌 배치 패턴에 대해 첫 번째 열의 가중치를 초기화합니다.
# ❸ 0: 상단, 1: 중앙, 2: 하단, 3: 상단과 하단
dp[0][0] = arr[0][0]
dp[1][0] = arr[1][0]
dp[2][0] = arr[2][0]
dp[3][0] = arr[0][0... | Python | 1 |
es:
excs = list(reversed(excs))
lines = []
for i, exc in enumerate(excs):
if i > 0:
lines += ["", "**During handling of the above exception, another exception occurred:**", ""]
lines += _header_lines(event, exc)
frames_list = _frames_for_exception(exc) or []
... | Python | 1 |
#!/usr/bin/env python3
""" Translate DNA/RNA to proteins """
import argparse
from typing import NamedTuple
class Args(NamedTuple):
""" Command-line arguments """
rna: str
# --------------------------------------------------
def get_args() -> Args:
"""Get command-line arguments"""
parser = argparse... | Python | 1 |
# -*- coding: utf-8 -*-
"""
transistor.examples.cny_exchange_rate
~~~~~~~~~~~~
This module implements a basic mechanicalsoup.StatefulBrowser web scrape example.
:copyright: Copyright (C) 2018 by BOM Quote Limited
:license: The MIT License, see LICENSE for more details.
~~~~~~~~~~~~
"""
from mechanicalsoup import Stat... | Python | 1 |
sink
/// is the mutable reference to the final accumulator.
fn reduce(
self,
mut left: MapfoldReduceResult<'t, Accumulator, Output>,
right: MapfoldReduceResult<'t, Accumulator, Output>,
) -> MapfoldReduceResult<'t, Accumulator, Output> {
(self.reduce)(left.sink.as_mut(), righ... | Rust | 0 |
taff[index + 1]
btn_next = types.InlineKeyboardButton(
"вперёд ⏭️",
callback_data=f"employer_addstaff_next_{next_id}_{index+1}_{employer_id}"
)
else:
btn_next = types.InlineKeyboardButton(
"вперёд ⏭️",
callback... | Python | 1 |
"""Loss Functions for Models."""
from repair.semseg.metrics import jaccard_index
import torch
import torch.nn.functional as F # noqa N812
def jaccard_loss(y_pred: torch.Tensor, y_true: torch.Tensor, smooth=1e-6):
"""
Compute the Jaccard loss, also known as the Intersection over Union (IoU) loss.
Args:
... | Python | 1 |
Ord
{
fn join_left(self, right: R) -> LeftJoin<L, R, K, U, V>;
}
impl<L, R, K, U, V> LeftJoinable<L, R, K, U, V> for L
where L: Iterator<Item = (K, U)>,
R: Iterator<Item = (K, V)>,
K: Ord
{
fn join_left(self, right: R) -> LeftJoin<L, R, K, U, V> {
LeftJoin::new(self, right)
... | Rust | 0 |
},
'TapeReadingAgent': {
'signal': tapereading_signal,
'confidence': tapereading_conf,
'weight': 0.25
},
'FootprintPatternAgent': {
'signal': footprint_signal,
... | Python | 1 |
"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""
from __future__ import annotations
from .awssqsconfig import AWSSQSConfig, AWSSQSConfigTypedDict
from .awssqscredentials import AWSSQSCredentials, AWSSQSCredentialsTypedDict
from .topics_union import TopicsUnion, TopicsUnionTypedDict
from enum imp... | Python | 1 |
0x7F800000
} else if is_signed {
!0 ^ (1 << (bits_clamped - 1))
} else {
let max = 0xFFFFFFFFu64 << bits_clamped as u64;
let max = (max & 0xFFFFFFFFu64) as u32;
max ^ 0xFFFFFFFFu32
}
}
<gh_stars>1-10
use matches::assert_matches;
use ruma_events::{AnyInitialStateEvent, Initial... | Rust | 0 |
ct();
num
}
}
fn main() {
let file: Vec<String> = env::args().collect();
let path = &file[1];
let content = fs::read_to_string(path)
.expect("Something went wrong, file missing");
let mut vec = Depth::new(content).to_vec_of_i32();
println!(
"Times where the number was... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': 'Skills Certification',
'category': 'Hidden',
'version': '1.0',
'summary': 'Add certification to resumé of your employees',
'description':
"""
Certification and Skills for HR
=======... | Python | 1 |
allergen_map.iter().collect();
kvs.sort_by_key(|&x| x.0);
kvs.iter().map(|(_, v)| &v[..]).collect::<Vec<_>>()[..].join(",")
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_part1() {
let (test_map, test_list) = read_input("../testcase1.txt");
let test_aller_map = find_all_... | Rust | 0 |
pes.Int128):
return "INT128"
if isinstance_or_issubclass(dtype, dtypes.Int64):
return "BIGINT"
if isinstance_or_issubclass(dtype, dtypes.Int32):
return "INTEGER"
if isinstance_or_issubclass(dtype, dtypes.Int16):
return "SMALLINT"
if isinstance_or_issubclass(dtype, dtypes.... | Python | 1 |
schema: &Type, _predicate: Option<&Self::Predicate>, repetition: Option<Repetition>,
) -> Result<(String, Self::Schema)> {
if schema.is_primitive()
&& repetition == Some(Repetition::Required)
&& schema.get_physical_type() == PhysicalType::FixedLenByteArray
&& schema.get_basic_info().logical_type()... | Rust | 0 |
alive, leak])
]
);
pub static ref MEMTRACE_PEERS: Arc<dyn MemoryTrace + Send + Sync> =
MEMTRACE_ROOT.sub_trace(Id::Name("peers"));
pub static ref MEMTRACE_APPLYS: Arc<dyn MemoryTrace + Send + Sync> =
MEMTRACE_ROOT.sub_trace(Id::Name("applys"));
pub static ref MEMTRACE_ENTRY_CACHE... | Rust | 0 |
x_screen_size:
big_points_vs = self.max_radii2D > max_screen_size
big_points_ws = self.get_scaling.max(dim=1).values > 0.1 * extent
prune_mask = torch.logical_or(torch.logical_or(prune_mask, big_points_vs), big_points_ws)
self.prune_points(prune_mask)
torch.cuda.empt... | Python | 1 |
meshes.iter() {
let (pipeline, mesh_set) = sub_mesh.main.clone();
builder.bind_pipeline_graphics(pipeline.clone())
.bind_descriptor_sets(PipelineBindPoint::Graphics,
pipeline.layout().clone(),
0,
(... | Rust | 0 |
: list of Candidate
:param _InputRetCode: 输入的人体动作轨迹图片中的合法性校验结果。
只有为0时结果才有意义。
-1001: 输入图片不合法。-1002: 输入图片不能构成动作轨迹。
:type InputRetCode: int
:param _InputRetCodeDetails: 输入的人体动作轨迹图片中的合法性校验结果详情。
-1101:图片无效,-1102:url不合法。-1103:图片过大。-1104:图片下载失败。-1105:图片解码失败。-1109:图片分辨率过高。-2023:动作轨迹中有非同人图片。-2024: 动作轨迹提... | Python | 1 |
]
servers = ["127.0.0.1:{}"]
[network]
listen = "127.0.0.1:0"
"#,
coredns.udp_port
);
let server = spawn_edgedns(&cfg);
let re = Regex::new(
r"\n;; ANSWER SECTION:\nmail.example.com.\s+\d+\s+IN\s+A\s+192.0.2.3",
).unwrap();
for port in &server.udp_ports {
... | Rust | 0 |
if !rel.is_blocky() && blknum != 0 {
bail!(
"invalid request for block {} for non-blocky relish {}",
blknum,
rel
);
}
let seg = SegmentTag::from_blknum(rel, blknum);
let layer = self.get_layer_for_write(seg, lsn)?;... | Rust | 0 |
cks to them. The provided callback function will be executed when the button is clicked.
This is an example:%s
The call to `put_table()` will not block. When user clicks a button, the corresponding callback function will be invoked:
""", r"""### 事件回调
PyWebIO允许你输出一些控件,当控件被点击时执行提供的回调函数,就像编写GUI程序一样。
... | Python | 1 |
on;
#[test]
fn test_quota_limiter() {
// consume write
let quota_limiter = QuotaLimiter::new(
1250, /*1.1vCPU*/
ReadableSize::kb(1),
ReadableSize::kb(1),
);
let thread_start_time = ThreadTime::now();
// (1250 * CPU_TIME_FACTOR) * 1 s... | Rust | 0 |
doc = "Bit 8 - RXFIFO Overflow"]
#[inline(always)]
pub fn rf_ovf(&mut self) -> RF_OVF_W {
RF_OVF_W { w: self }
}
#[doc = "Bit 6 - TXFIFO Full"]
#[inline(always)]
pub fn tf_full(&mut self) -> TF_FULL_W {
TF_FULL_W { w: self }
}
#[doc = "Bit 5 - TXFIFO Empty"]
#[inline(... | Rust | 0 |
#!/usr/bin/env python3
""" 音声情報処理 n本ノック !! """
# MIT License
# Copyright (C) 2020 by Akira TAMAMORI
# 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,
# including without... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.