text string | label_name string | labels int64 |
|---|---|---|
let value1 = self.read_value(src0)?;
let value2 = self.read_value(src1)?;
let result = op(value1, value2);
self.write_value(dest, result)
}
fn write_value(&mut self, dest: Value, value: i64) -> Result<State, Error> {
match dest {
Value::Stored(addr) => {
let addr = self.read(addr)?... | Rust | 0 |
Request {
pub out_point: OutPoint,
pub partial_signature: PartialSigResponse,
}
/// Request to blind sign a certain amount of coins
#[derive(Debug, Clone, Eq, PartialEq, Hash, Deserialize, Serialize, Encodable, Decodable)]
pub struct SignRequest(pub Coins<tbs::BlindedMessage>);
// FIXME: optimize out blinded ... | Rust | 0 |
or AuthError {
fn from(err: tokio_diesel::AsyncError) -> Self {
Self::InternalError {
error_message: err.to_string(),
}
}
}
<gh_stars>1-10
//! Generate dependant graph so each file can be updated if one of its dependencies is updated.
//!
//! Used in the development server.
pub mod ... | Rust | 0 |
e)
if nimg > 1:
masks[i] = outputs
else:
masks = outputs
if stitch_threshold > 0 and nimg > 1:
models_logger.info(
f"stitching {nimg} planes using stitch_threshold={stitch_threshold:0.3f} to make 3D ... | Python | 1 |
const PCNT_SIG_CH1_IN0_IDX: u32 = 40;
pub const GPIO_WLAN_ACTIVE_IDX: u32 = 40;
pub const PCNT_CTRL_CH0_IN0_IDX: u32 = 41;
pub const BB_DIAG0_IDX: u32 = 41;
pub const PCNT_CTRL_CH1_IN0_IDX: u32 = 42;
pub const BB_DIAG1_IDX: u32 = 42;
pub const PCNT_SIG_CH0_IN1_IDX: u32 = 43;
pub const BB_DIAG2_IDX: u32 = 43;
pub const... | Rust | 0 |
Res {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
static file_descriptor_proto_data: &'static [u8] = b"\
\n\x12common/query.proto\x12\x0ftypedb.protocol\x1a\x13common/answer.pro\
to\x1a\x12common/logic.proto\x1a\x14common/op... | Rust | 0 |
}
}
// Copyright (c) 2021 <NAME>' <<EMAIL>>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DIS... | Rust | 0 |
"""
Arsenic - A forensic analysis tool for iOS and Android devices
Copyright (C) 2025 North Loop Consulting, LLC
Charlie Rubisoff
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 3 of... | Python | 1 |
.0
{
Err(StatsError::BadParams)
} else {
Ok(FisherSnedecor {
freedom_1,
freedom_2,
})
}
}
/// Returns the first degree of freedom for the
/// fisher-snedecor distribution
///
/// # Examples
///
/// `... | Rust | 0 |
#!/usr/bin/python3
"""Fabric script that distributes an archive to your web servers
"""
from datetime import datetime
from fabric.api import *
import os
env.hosts = ["54.146.64.216", "35.174.213.136"]
env.user = "ubuntu"
def do_pack():
"""returns the archive path if archive has generated correctly.
"""
... | Python | 1 |
Self::Output {
rhs * self
}
}
impl Div<f32> for Duration {
type Output = Self;
fn div(self, rhs: f32) -> Self::Output {
Self::seconds_f32(self.as_seconds_f32() / rhs)
}
}
impl DivAssign<f32> for Duration {
fn div_assign(&mut self, rhs: f32) {
*self = *self / rhs;
}
}
... | Rust | 0 |
bar between specified start year and ending year for
more than one tickers in tasks list.
parameters
----------
* db: pymongo.db object; the database which collections of bars will
go into. Note that this database will be transferred to every
drudgery functions created by controller.
* id: integer... | Python | 1 |
Option<&'a Entry> {
let ret = match self.cur {
None => {
let i;
loop {
match self.items.next() {
None => return None,
Some(&None) => {}
Some(&Some(ref a)) => { i = &**a; break... | Rust | 0 |
# 1753 / 최단경로 / 골드4
import math
import heapq
V, E = map(int, input().split())
K = int(input())
graph = [[] for _ in range(V+1)]
INF = math.inf
dist = [INF] * (V+1); dist[K] = 0
# 방향 그래프 제작 (가중치, 다음 노드)
for _ in range(E):
u, v, w = map(int, input().split())
graph[u].append((w, v))
# Dijkstra
Q = []
heapq.hea... | Python | 1 |
def reversed_string(string):
if len(string) < 2:
return string
reversed_string_result = ""
for letter in string:
reversed_string_result = letter + reversed_string_result
return reversed_string_result
result = reversed_string("Valentine")
print(result) | Python | 1 |
# Copyright (c) 2017, United States Government, as represented by the
# Administrator of the National Aeronautics and Space Administration.
#
# All rights reserved.
#
# The Astrobee platform is licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with the
# Li... | Python | 1 |
ase_stds, cv_values)
plt.tight_layout()
if output_type == "file":
plt.savefig("picture_analysis_figure1.png", dpi=300, bbox_inches='tight')
plt.close()
print("✅ Picture analysis Figure 1 saved as 'picture_analysis_figure1.png'")
else:
... | Python | 1 |
[cfg(target_family = "unix")]
if unsafe { geteuid() != 0 } {
bail!("Please rerun as root for system-wide installation.");
}
}
#[cfg(target_family = "unix")]
{
let shell = get_shell();
if !shell.is_empty() && !SUPPORTED_SHELLS.contains(&shell.as_str()) {
... | Rust | 0 |
: InjectionContext[InjectedT]
) -> Provider[List[InjectedT]]:
if parameter.annotation is Parameter.empty:
return FromInstanceProvider([])
if TypeChecker.is_named(parameter.annotation):
provider: Optional[Provider[List[InjectedT]]] = self._get_provider(
[
... | Python | 1 |
ge_qubits(self.control_registers, **quregs))
def _circuit_diagram_info_(self, args: cirq.CircuitDiagramInfoArgs) -> cirq.CircuitDiagramInfo:
"""Basic circuit diagram.
Descendants are encouraged to override this with more descriptive
circuit diagram information.
"""
wire_sym... | Python | 1 |
summary of the news article below:"
f"input: {page_content}"
"output:")
try:
summary = llm.generate_content(
contents=prompt_template,
generation_config={
"max_output_tokens": 2048,
"temperature": 0.8,
"top_p": 0.8,
... | Python | 1 |
SERI_A::PCM_SERI_SRC_CONST_LOW),
17 => Val(SERI_A::PCM_SERI_SRC_CONST_HIGH),
i => Res(i),
}
}
#[doc = "Checks if the value of the field is `PCM_SERI_SRC_DIO_0`"]
#[inline(always)]
pub fn is_pcm_seri_src_dio_0(&self) -> bool {
*self == SERI_A::PCM_SERI_SRC_DIO_0
... | Rust | 0 |
///
/// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
/// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
pub reply_markup: ReplyMarkup [into],
}
}
}
<gh_stars>0
use std::sync::Mutex;
use tokio_postgres::{sel... | Rust | 0 |
# 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 of the License, or
# (at your option) any later version.
from flask import jsonify, request
from sqlalchemy.orm.exc import NoRe... | Python | 1 |
# ======================================
# Exemplo da instrução del
# A instrução del é usada para remover uma chave e seu valor de um dicionário.
# Se a chave não existir, ela lançará um erro KeyError.
# ======================================
# Criando um dicionário com alguns dados
usuario = {
"nome": "Matheus",... | Python | 1 |
J: ?Sized} (A, B, C, D, E, F, G, H, I, J),
{A, B, C, D, E, F, G, H, I, J, K: ?Sized} (A, B, C, D, E, F, G, H, I, J, K),
{A, B, C, D, E, F, G, H, I, J, K, L: ?Sized} (A, B, C, D, E, F, G, H, I, J, K, L),
{Idx} Range<Idx>,
{Idx} RangeFrom<Idx>,
{Idx} RangeInclusive<Idx>,
{Idx} RangeTo<Idx>,
{... | Rust | 0 |
# # -*- coding: utf-8 -*-
# #
# # 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, Vers... | Python | 1 |
intrinsic(op_kind: BinOpKind, ty: &ScalarKind, width: u32) -> WeldResult<&'static str> {
match (op_kind, ty, width) {
(BinOpKind::Min, &F32, 4) => Ok("@llvm.minnum.v4f32"),
(BinOpKind::Min, &F32, 8) => Ok("@llvm.minnum.v8f32"),
(BinOpKind::Min, &F64, 2) => Ok("@llvm.minnum.v2f64"),
(... | Rust | 0 |
ponsesSensorUpdateSettingsV1;
pub mod responses_sensor_update_settings_v2;
pub use self::responses_sensor_update_settings_v2::ResponsesSensorUpdateSettingsV2;
pub mod responses_sv_exclusion_resp_v1;
pub use self::responses_sv_exclusion_resp_v1::ResponsesSvExclusionRespV1;
pub mod responses_sv_exclusion_v1;
pub use self... | Rust | 0 |
pub fn msdfgen_Vector2_reset(this: *mut msdfgen_Vector2);
}
extern "C" {
#[doc = " Sets individual elements of the vector."]
#[link_name = "\u{1}__ZN7msdfgen7Vector23setEdd"]
pub fn msdfgen_Vector2_set(this: *mut msdfgen_Vector2, x: f64, y: f64);
}
extern "C" {
#[doc = " Returns the vector's length.... | Rust | 0 |
"}").unwrap()),
"'{\"f\": \"asd\"}'"),
(None, "NULL")])
}
<reponame>SwapnilBhosale/jvm-rs
use rtda::slot::Slot;
use util::converter;
#[derive(Debug)]
pub struct OperandStack {
vec: Vec<Slot>,
}
impl OperandStack {
pub fn new(max_stack: usize) -> OperandStack ... | Rust | 0 |
(apcupsd_poll_rate)
continue
except ConnectionRefusedError as e:
logger.error(
f"Could not connect to APCUPSD host because connection was refused: {apcupsd_host}"
)
time.sleep(apcupsd_poll_rate)
continue
except Exception as e:
... | Python | 1 |
ing()));
}
#[fuchsia_async::run_singlethreaded(test)]
async fn test_target_event_synthesis_wait() {
let conn = RcsConnection::new_with_proxy(
setup_fake_remote_control_service(false, "foo".to_owned()),
&NodeId { id: 1234 },
);
let t = match Target::from_rcs_c... | Rust | 0 |
use std::os::unix::fs::OpenOptionsExt;
OpenOptions::new().mode(0o600)
}
}
.write(true)
.truncate(true)
.create(true)
.open(outfile)?;
self.write_json(&mut f)
}
}
/// Public key for the ElGamal encryption scheme.
#[derive(Serialize,... | Rust | 0 |
,
interrupt_handlers: &[HandlerFunc]
) -> Result<HashMap<u8,u8>, &'static str> {
let num_msi_vec_enabled = interrupt_handlers.len();
if rxq.len() < num_msi_vec_enabled { return Err("Not enough rx queues for the interrupts requested"); }
// set IVAR reg to enable interrupts for diff... | Rust | 0 |
"error calculating the ngrams model");
let mut ngrams_json = File::create(output).expect("error creating the output file");
serde_json::to_writer(&mut ngrams_json, &ngrams.serialize()).expect("error writing the json to the output file");
}
fn crypt_main(dir: CryptionDirection, cipher: &str, key: &str, input: ... | Rust | 0 |
"type": "combo",
"options": ["true", "false"],
"default": "false",
"required": True
},
{
"var_suffix": "EMAIL",
"title": "收发件邮箱",
"icon": "CLOUD",
"placeholder": "将由自己发给自己",
"type": "text",
... | Python | 1 |
onal or named arg."""
# my-py is complaining that page_content is not defined on the base class.
# Here, we're relying on pydantic base class to handle the validation.
super().__init__(page_content=page_content, **kwargs) # type: ignore[call-arg]
@classmethod
def is_lc_serializable(cls... | Python | 1 |
from tkinter import *
from tkinter import messagebox
from PIL import Image, ImageTk
import random
import pygame
def toss_coin():
global cnt, imageframe, tossing_sound
images={'heads.png','tails.png'}
which=random.choice(list(images))
print(which)
img=Image.open(which).resize((200,200))
img=Imag... | Python | 1 |
# Copyright 2016-2024 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
site_configuration = {
'systems': [
{
'name': 'pseudo-cluster',
'descr': 'CI Slurm-based p... | Python | 1 |
test_forward(self):
src, tgt = ["I am a small frog"], ["Ich bin ein kleiner Frosch."]
expected_ids = [38, 121, 14, 697, 38848, 0]
model_inputs = self.tokenizer(src, text_target=tgt, return_tensors="pt").to(torch_device)
self.assertListEqual(expected_ids, model_inputs.input_ids[0].tolis... | Python | 1 |
s and
// limitations under the License.
extern crate glfw;
use std::sync::mpsc::Receiver;
use glfw::event::{Action, Key};
type WindowInstance = (glfw::Window, Receiver<(f64, glfw::event::Event)>);
type WindowVector = Vec<WindowInstance>;
fn add_window(glfw: &glfw::Glfw, window_vector: &mut WindowVector) {
let ... | Rust | 0 |
Inicia o bot Telegram, configurando o webhook.
Remove webhooks existentes, configura um novo webhook
com a URL fornecida e inicia o servidor Quart com Hypercorn na porta 5000.
Returns:
None
Notes:
Requer as bibliotecas Quart e Hypercorn para o servidor webhook.... | Python | 1 |
more impulsive and disorganized. You may have difficulty setting and achieving goals, and may be more likely to engage in behaviors that are not in your best interest.",
"label":"C-Low"
},
{
"prompt":"You are high on openness to experience. You are characterized as being imaginat... | Python | 1 |
import yaml
if __name__ == '__main__':
stream = open("test.yaml", "r")
dictionary = yaml.safe_load(stream)
for key, value in dictionary.items():
print(key + " : " + str(value)) | Python | 1 |
import os
import sys
import time
class GraphNode:
def __init__(self, file_path, file_size):
self.file_path = file_path
self.file_size = file_size
self.adjacent = []
def add_neighbor(self, neighbor_node):
self.adjacent.append(neighbor_node)
class Graph:
def __init__(self):
... | Python | 1 |
code()
# create list of versions which are less than our equal to given version,
# and return the tail value, which is the highest level we may support,
# or the latest value we support, when completely unmatched or higher
# than any supported version.
#
# function will never complete, always r... | Python | 1 |
Z_level = np.linspace(*pdp_lim[2], num=8)
if ax is None:
fig = plt.figure(**fig_kw)
else:
fig = ax.get_figure()
fig.clear()
n_cols = min(n_cols, len(features))
n_rows = int(np.ceil(len(features) / float(n_cols)))
axs = []
for i, fx, name, (pdp, axes) in zip(count()... | Python | 1 |
class Solution:
def isRectangleCover(self, rectangles: List[List[int]]) -> bool:
X1, Y1 = float('inf'), float('inf')
X2, Y2 = -float('inf'), -float('inf')
points = set()
actual_area = 0
for x1, y1, x2, y2 in rectangles:
# calculate the coords of the potential per... | Python | 1 |
nent_data('p', p)
s_anim.add_component_data('r', r)
x, y, z = bone_matrix.to_translation()
s_anim.add_component_data('x', x)
s_anim.add_component_data('y', y)
s_anim.add_component_data('z', z)
# advance to the next frame
... | Python | 1 |
Domain(String::new())
} else {
try!(Host::parse(host_input.as_slice()))
};
Ok((host, input.slice_from(end)))
}
pub fn parse_standalone_path(input: &str, parser: &UrlParser)
-> ParseResult<(Vec<String>, Option<String>, Option<String>)> {
if !input.starts_with("/")... | Rust | 0 |
!(),
EmptyBlockType => unimplemented!(),
}
}
pub fn fmt_instr(fmt: &mut impl fmt::Write, op: &Operator, param_local_idx: Option<u32>) -> fmt::Result {
// Print instruction mnemonic.
fmt.write_str(instr_name(op))?;
// Print instruction arguments, or <param> for the local we currently extract th... | Rust | 0 |
= 1 << 39;
// Connection establishment
/// Supports connecting to interface.
const CONNECT_TO_IFACE = 1 << 40;
/// Supports connecting to specific endpoint.
const CONNECT_TO_EP = 1 << 41;
/// Supports connecting to sockaddr.
const CONNECT_TO_SOCKADDR = 1 << 42;
// Special transport ... | Rust | 0 |
, 0xDC, 0xFE, 0xD1, 0xC2, 0x99, 0x45, 0xD8, 0xD2, 0x8A, 0x6D, 0x46, 0xDC, 0x4D,
0x82, 0x29, 0x93, 0x51, 0x6A, 0x96, 0xA5, 0x20, 0x8C, 0xA4, 0x2C, 0xF1, 0x95, 0x14, 0x98,
0x3E, 0x08, 0xD6, 0xFC, 0x63, 0x61, 0x45, 0xD1, 0x68, 0xC1, 0xFD, 0x19, 0xA1, 0x69, 0x84,
0x1A, 0x9D, 0x50, 0x46, 0x50, 0x77, ... | Rust | 0 |
a>( i : &'a u32) -> impl TestTrait<'a> {
// Test{ x : i }
// }
// // works:
// fn create_test<'a>( i : &'a u32) -> Test<'a> {
// Test{ x : i }
// }
// // works too:
// fn create_test<'a>( i : &'a u32) -> Box<Test<'a>> {
// Box::new(Test{ x : i })
// }
fn main() {
println!("Hello, world!");
let v: u32 = 1... | Rust | 0 |
onMethod::Summarize,
_ => AggregationMethod::Histogram,
}
}
}
impl Arbitrary for Telemetry {
fn arbitrary<G>(g: &mut G) -> Self
where
G: Gen,
{
let name_len = g.gen_range(0, 64);
let name: String = g.gen_iter::<char... | Rust | 0 |
"""
Grade 1. Этап 1: Задание 3
"""
# Устанавливаем переменные для использования текста при запросе ввода у пользователя
## Указанные переменные необходимо передавать при вызове функции input()
prompt_username = 'Пожалуйста, введите имя пользователя: '
prompt_title = 'Пожалуйста, введите заголовок заметки: '
prompt_co... | Python | 1 |
: String,
mut input: &'input str,
) -> Result<(V, Option<char>, usize)>
where
V: ValueTrait + Mutable + Builder<'input> + 'input + std::fmt::Debug,
{
let mut offset = 0;
loop {
if let Some(idx) = input.find(|c| c == ',' || c == ' ' || c == '\\') {
offset += idx;
res.push_... | Rust | 0 |
color: b;\n}\n"
);
test!(
length_of_space_separated_super_selector,
"a b {\n color: length(&);\n}\n",
"a b {\n color: 1;\n}\n"
);
test!(
nth_1_of_space_separated_super_selector,
"a b {\n color: nth(&, 1);\n}\n",
"a b {\n color: a b;\n}\n"
);
test!(
length_of_comma_separated_super_select... | Rust | 0 |
import pdfplumber
import pytesseract
from pdf2image import convert_from_path
from pathlib import Path
# Set the Tesseract path
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe"
def extract_text(pdf_path: str) -> str:
"""Extracts text from a PDF, handling both text-based and ... | Python | 1 |
{
value,
direction: ControllerAxisDirection::GreaterThan,
}
}
pub fn lesser_than(value: f32) -> ControllerAxisThreshold {
Self {
value,
direction: ControllerAxisDirection::LesserThan,
}
}
}
impl_imdraw_todo!(ControllerAx... | Rust | 0 |
n_with_fuel(input: &Vec<i32>) {
let fuel_value: i32 = input
.iter()
.map(|&weight| realistic_fuel_calculation(weight))
.sum();
println!("More realistic Fuel weight: {}", fuel_value);
}
fn do_rocket_calculation_cases(filename: &str) -> i32 {
let input = match gather_input_numbers(fil... | Rust | 0 |
# file generated by setuptools_scm
# don't change, don't track in version control
__version__ = version = '2.6.2'
__version_tuple__ = version_tuple = (2, 6, 2)
| Python | 1 |
import pytest
from dbt.tests.util import run_dbt
my_model_sql = """
select 1 as fun
"""
cleanup_existing_sql = """
{% macro cleanup_existing() %}
{%- call statement('drop_existing', fetch_result=False) -%}
if exists(
select *
from sys.database_principals
where name =... | Python | 1 |
rel='True'><div class='menu-banner-inner-img'><img alt='Warmies' data-original='//images.wbstatic.net/poster/ru/menuright1/c352x428/verh_warmies_27_1119.jpg' src='//static.wbstatic.net/i/blank.gif' data-id='91095097-a816-4bc7-9b20-58c84f1bf62f' /></div><span class='c-text-base-v1'>ИГРУШКИ ГРЕЛКИ</span><span class='c-te... | Python | 1 |
parameter.
/// * firstLevel: The level of pyramid to put source image to. Previous layers are filled
/// with upscaled source image.
/// * WTA_K: The number of points that produce each element of the oriented BRIEF descriptor. The
/// default value 2 means the BRIEF where we take a random point pair and compare the... | Rust | 0 |
,
Self::Fuzzy => ffi::NM_SETTING_COMPARE_FLAG_FUZZY,
Self::IgnoreId => ffi::NM_SETTING_COMPARE_FLAG_IGNORE_ID,
Self::IgnoreSecrets => ffi::NM_SETTING_COMPARE_FLAG_IGNORE_SECRETS,
Self::IgnoreAgentOwnedSecrets => {
ffi::NM_SETTING_COMPARE_FLAG_IGNORE_AGENT_... | Rust | 0 |
# Generated by Django 2.1.5 on 2019-01-20 19:24
from django.db import migrations, models
def forward_migrate_data(apps, schema_editor):
test_case_model = apps.get_model("testcases", "TestCase")
historical_test_case_model = apps.get_model("testcases", "HistoricalTestCase")
for test_case in test_case_mode... | Python | 1 |
he name of the conference provider.</p>
#[serde(rename = "ConferenceProviderName")]
pub conference_provider_name: String,
/// <p>Represents a type within a list of predefined types.</p>
#[serde(rename = "ConferenceProviderType")]
pub conference_provider_type: String,
/// <p>The IP endpoint and p... | Rust | 0 |
s not None and len(login_hwnd_list) > 0:
for login_hwnd in login_hwnd_list:
if click_login_page(login_hwnd):
logger("官服点击登录")
return True
# 再试b服
login_hwnd = hwnd_util.get_login_hwnd_bilibili()
if click_login_page(login_hwnd):
logger("b服点击登录")
... | Python | 1 |
}
#[inline]
fn debug_r1st_tol(&self, other: &HashMap<K, VB, S>, tol: &Self::Tol) -> Self::DebugTol {
if self.len() == other.len() && self.len() == tol.len() {
let mut result = HashMap::with_hasher(self.hasher().clone());
for (k, v) in self {
result.insert(k.clone... | Rust | 0 |
nce
# - *Option 4:* "hammersly" = Hammersly sequence
# - *Option 5:* "lhs" = latin hypercube sequence
# - *Option 6:* "grid" = uniform grid sequence
# 4) **num_ips** : int
# - *Summary:* the number of points to explore with the initial point generator before using the reg... | Python | 1 |
calls.append(msg)
# test PLM_sent flag
out = Msg.OutStandard.direct(addr, 0x0D, 0x00)
handler = IM.handler.StandardCmd(out, device.handle_engine, callback)
flags = Msg.Flags(Msg.Flags.Type.DIRECT_ACK, False)
msg = Msg.InpStandard(addr, addr, flags, 0x0D, 0x00)
r = ... | Python | 1 |
you can create a `BrowserWsConfig` object with `BrowserWsConfig::new()`. It can
//! then be used as a transport.
//!
//! Listening on a websockets multiaddress isn't supported on emscripten. Dialing a multiaddress
//! which uses `ws` on top of TCP/IP will automatically use the `XMLHttpRequest` Javascript object.
//!
/... | Rust | 0 |
s[asm]) \
for asm, list_block in block_lengths.items()))/num_genomes
average_n50 = sum(
(calculate_ng50(get_lengths(list_block), sum(get_lengths(list_block))) \
for _, list_block in block_lengths.items()))/num_genomes
print("Number_blocks","Number_blocks_all_asm", "Average_cove... | Python | 1 |
will fail and throw an `Error`.
fn parse_special_tag(&mut self, token: &mut TagToken) {
assert_eq!(self.base_parser.consume_char(), ':');
match token.name.as_str() {
"rating" => {
let rating_string = self.base_parser.consume_while(valid_rating);
token.rat... | Rust | 0 |
return InvokeViaPolicy("Reset");
}}
STDMETHODIMP PyGEnum{enumtype}::Clone(
/* [out] */ IEnum{enumtype} __RPC_FAR *__RPC_FAR *ppEnum)
{{
PY_GATEWAY_METHOD;
PyObject * result;
HRESULT hr = InvokeViaPolicy("Clone", &result);
if ( FAILED(hr) )
return hr;
/*
** Make sure we... | Python | 1 |
c", "test.json"), "0e9e8ffd8ee90ddf1f58d6dc2e02de7b"],
"test_public": [
os.path.join("fewclue_cluewsc", "test_public.json"),
"027bc101f000b632ef45ed6d86907527",
],
},
"labels": None,
},
"csl": {
"... | Python | 1 |
import os
import numpy as np
import torch
import torch.nn as nn
from typing import Callable, List, Tuple, Dict
from torch.utils.data.dataloader import DataLoader
from dynamics import BaseDynamics
from utils.scaler import StandardScaler
from utils.logger import Logger
class RNNDynamics(BaseDynamics):
def __init__... | Python | 1 |
nput shape
- 3D tensor with shape: ``(batch_size, field_size, embedding_size)``.
Output shape
- 2D tensor with shape: ``(batch_size, ltl_hidden_size*embedding_size)``.
Arguments
- **field_size** : positive integer, number of feature groups
- **embedding_size** : positive integer, embeddi... | Python | 1 |
as_ref() == Some(&path) {
return;
}
// Generate the update
let update = FileUpdate::ChangedOrder(path.clone(), after.clone());
// Update the file list
let _ = self.core.future_desync(move |core| {
let after = after.as_ref();
let after = afte... | Rust | 0 |
import pytest
import leaguepedia_parser
@pytest.mark.parametrize("team_tuple", [("tsm", "TSM"), ("IG", "Invictus Gaming")])
def test_get_long_team_name(team_tuple):
assert (
leaguepedia_parser.get_long_team_name_from_trigram(team_tuple[0])
== team_tuple[1]
)
@pytest.mark.parametrize(
"te... | Python | 1 |
s[:, k]
cur_box_preds = box_preds
selected = []
if box_scores.shape[0] > 0:
box_scores_nms, indices = torch.topk(box_scores, k=min(nms_config.NMS_PRE_MAXSIZE, box_scores.shape[0]))
boxes_for_nms = cur_box_preds[indices]
keep_idx, selected_scores = getattr... | Python | 1 |
# remove split flags
splitFlags = [ImageFlags.SplitRightLeft, ImageFlags.SplitLeftRight, ImageFlags.SplitRight,
ImageFlags.SplitLeft]
for f in splitFlags:
flags &= ~f
... | Python | 1 |
# Numbers
(r'[-+]?\d+', Number.Integer),
],
}
class AheuiLexer(RegexLexer):
"""
Aheui is esoteric language based on Korean alphabets.
"""
name = 'Aheui'
url = 'http://aheui.github.io/'
aliases = ['aheui']
filenames = ['*.aheui']
tokens = {
... | Python | 1 |
inks::No
&& (options.ext.custom_flags & winbase::FILE_FLAG_OPEN_REPARSE_POINT) == 0;
if enforce_dir || enforce_nofollow {
let metadata = f.metadata().map_err(OpenUncheckedError::Other)?;
if enforce_dir {
// Require a directory. It may see... | Rust | 0 |
-> Data
where
I: Into<Vec<Evidence>>,
{
Data {
evidence: Some(into_evidence.into()),
}
}
/// Convert this evidence data into a vector
pub fn into_vec(self) -> Vec<Evidence> {
self.iter().cloned().collect()
}
/// Iterate over the evidence data
... | Rust | 0 |
let split = match mem::take(self) {
Self::Empty => return Err(ItemStackError::EmptyStack),
Self::Filled(mut stack) => stack.split(amount),
};
let (stack, res) = match split {
Ok((original, new)) => (original, Ok(new)),
Err((original, error)) => (S... | Rust | 0 |
key from https://www.fireworks.ai/. Set `FIREWORKS_API_KEY` env var.",
)
PipelineRegistry.register_alias(
"gladia-streaming",
GladiaStreamingPipeline,
default_config={
"sample_rate": 16000,
"channels": 1,
"sample_width": 2,
"chunksize_ms":... | Python | 1 |
import allure
import pytest
from pages.login_page import LoginPage
from decouple import config
from pages.application import Application
from pages.short_form import ShortFormPage
from pages.full_form import FullForm
from pages.select_configure import SelectConfigure
from pages.notify_client import NotifyClient
from pa... | Python | 1 |
.len()).all_equal();
if !all_equal_len {
selected_columns = selected_columns
.into_iter()
.map(|series| {
if series.len() == 1 && height > 1 {
series.expand_at_index(0, height)
} else {
... | Rust | 0 |
, SmolStr>,
#[serde(default)]
rescue: Vec<RescueItem>,
},
}
impl Action {
pub fn modify_request(&self) -> Option<&RequestModifications> {
match self {
Action::Invoke { modify_request, .. } => modify_request.as_ref(),
Action::NextHandler => None,
Acti... | Rust | 0 |
"""
Walk Agent over IPv6
++++++++++++++++++++
Send a series of SNMP GETNEXT requests with the following options:
* with SNMPv3 with user 'usr-md5-none', MD5 auth and no privacy protocols
* over IPv6/UDP
* to an Agent at [::1]:161
* for two OIDs in tuple form
* stop on end-of-mib condition for both OIDs
This script p... | Python | 1 |
super().exec_module(module)
module.__class__ = DelayedImportErrorModule
class DelayedImportErrorModule(types.ModuleType):
def __getattribute__(self, attr):
"""Trigger a ModuleNotFoundError upon attribute access"""
spec = super().__getattribute__("__spec__")
# allows isinstance and ... | Python | 1 |
.CreateSwapChainForHwnd(
self.device.as_raw() as *mut _,
win32_window.hwnd.unwrap(),
&sc_desc,
ptr::null(),
ptr::null_mut(),
&mut swap_chain1 as *mut *mut _
)};
if winerror::SUCCEEDED(hr) {
Ok(unsafe {ComPtr::from_raw(sw... | Rust | 0 |
"""
Copyright (c) 2024 WindyLab of Westlake University, China
All rights reserved.
This software is provided "as is" without warranty of any kind, either
express or implied, including but not limited to the warranties of
merchantability, fitness for a particular purpose, or non-infringement.
In no event shall the auth... | Python | 1 |
if columns.debug_loclists {
out.write_u32(proj(self.debug_loclists))?;
}
if columns.debug_rnglists {
out.write_u32(proj(self.debug_rnglists))?;
}
if columns.debug_str_offsets {
out.write_u32(proj(self.debug_str_offsets))?;
}
if columns.... | Rust | 0 |
id: LineId::ThreeKind,
value: None,
calc: calchand::calc_3k,
},
LineData {
id: LineId::FourKind,
value: None,
calc: calchand::calc_4k,
},
LineData {
id: LineId::SmallStraight,
value: None,
... | Rust | 0 |
, serialize_into};
extern crate app_dirs;
use app_dirs::{app_root, AppDataType, AppInfo};
extern crate ggez;
use ggez::conf::{Conf, WindowMode, WindowSetup};
use ggez::event;
use ggez::event::{EventHandler, Keycode, Mod};
use ggez::graphics;
use ggez::graphics::spritebatch::SpriteBatch;
use ggez::graphics::{Color, Dr... | Rust | 0 |
from sklearn.externals import joblib
from sklearn.pipeline import Pipeline, FeatureUnion
from sklearn.preprocessing import StandardScaler
import pandas as pd
import logging
logging.basicConfig(level=logging.INFO)
from config import *
from utils import *
from transforms import *
def gen_pipe_union():
tf_selector_... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.