text string | label_name string | labels int64 |
|---|---|---|
;
println!("AI? (None, 1, 2, or 12)");
match get_input().trim().parse::<usize>() {
Ok(n) => {
match n {
1 => is_ai = 1,
2 => is_ai = 2,
12 => is_ai = 3,
_ => is_ai = 0
}
... | Rust | 0 |
).unwrap();
// execute cards.js
runtime.execute("cards.js", &cardsjs).unwrap();
// create function to set outer rust-cards from within JS
let cards = Rc::new(RefCell::new(BTreeMap::new()));
let cards2 = Rc::clone(&cards);
runtime.register_op("op_set_cards", json_op_sync(move |_state, json, _zer... | Rust | 0 |
[i];
let coordinates = (o_x + x, o_y + y, o_z + z, o_w + w);
if let Some(&is_active) = self.cube_map.get(&coordinates) {
neighbors.push((coordinates, is_active));
} else {
neighbors.push((coordinates, false));
... | Rust | 0 |
n session.
/// Anything stored like this will be available via `load_diagnostics` in
/// the next compilation session.
pub fn store_diagnostics(&self,
dep_node_index: DepNodeIndex,
diagnostics: Vec<Diagnostic>) {
let mut current_diagnostics =... | Rust | 0 |
, "()");
assert_eq!(var.get::<Variant4>(), Some(v));
#[derive(Debug, PartialEq, Eq, glib::Variant)]
struct Variant5();
assert_eq!(Variant5::static_variant_type().as_str(), "()");
let v = Variant5();
let var = v.to_variant();
assert_eq!(var.type_().as_str(), "()");
assert_eq!(var.get::<... | Rust | 0 |
self._time: List[datetime.time] = MISSING
else:
if any((seconds, minutes, hours)):
raise TypeError('Cannot mix explicit time with relative time')
self._time = self._get_time_parameter(time)
self._sleep = self._seconds = self._minutes = self._hours = MISSING
... | Python | 1 |
#!/usr/bin/env python
# DO NOT EDIT
# Autogenerated from the notebook quasibinomial.ipynb.
# Edit the notebook and then sync the output with this file.
#
# flake8: noqa
# DO NOT EDIT
# # Quasi-binomial regression
#
# This notebook demonstrates using custom variance functions and non-
# binary data
# with the quasi-bi... | Python | 1 |
ct EventFieldVisitor {
json: serde_json::Map<String, serde_json::Value>,
}
impl EventFieldVisitor {
fn new() -> Self {
let json = serde_json::Map::new();
EventFieldVisitor { json }
}
}
impl Visit for EventFieldVisitor {
fn record_debug(&mut self, field: &Field, value: &dyn std::fmt::De... | Rust | 0 |
0 }; LENGTH];
for idx in 0..LENGTH {
assert_eq!(w[idx].a, 0);
assert_eq!(w[idx].b, 0);
assert_eq!(w[idx].c, 0);
}
unsafe {
let p = w.as_mut_ptr();
::std::intrinsics::volatile_set_memory(p, 0xcd, LENGTH);
}
for idx in 0..LENGTH {
assert_eq!(w[idx].a, ... | Rust | 0 |
from js_utils import *
"""
creates one results file that contains the results per each parameter file.
"""
def create_results_file():
all_results = []
for fn in os.listdir(RES_DIR_NAME):
if fn.endswith(".json"):
file_path = os.path.join(RES_DIR_NAME, fn)
with open(file_path, 'r'... | Python | 1 |
_RECIPES_X86 = {
ENUM_RELOC_TYPE_i386['R_386_NONE']: _RELOCATION_RECIPE_TYPE(
bytesize=4, has_addend=False, calc_func=_reloc_calc_identity),
ENUM_RELOC_TYPE_i386['R_386_32']: _RELOCATION_RECIPE_TYPE(
bytesize=4, has_addend=False,
calc_func=_reloc_calc_sym_plus_value),... | Python | 1 |
import adi
import numpy as np
def parsein(indata, N, drone, inrate):
Td = 0.01
freq_table = list(N)
for i in range(N):
freq_table[i]=indata[i][drone.freq]
time_table=list(N)
for i in range(N):
time_table = i*inrate
def receive(drone, station_sdr):
sample_rate = 10000 # Hz
... | Python | 1 |
"bbs": "https://www.kurobbs.com/mc/post/1366076768541614080",
"name": "相里要",
"title": "千机逐星野",
"pic": "https://prod-alicdn-community.kurobbs.com/forum/2db86470f9314a569650e9fff0433e1f20240905.jpg",
"five_star_ids": ["1305"],
"five_star_names": ["相里要"],
"four_star_i... | Python | 1 |
import numpy as np
arr_2d = np.array([10.3,29.6,31.4,54.4])
new_arr = arr_2d.astype(int)
print(new_arr) | Python | 1 |
size_of::<u16>() as f32 + 1.0 / 8.0;
let graph_size = (remaining_use as f32 / bytes_per_node) as usize;
CompactBocage::with_capacities(grammar, graph_size, dfs_size)
}
}
<reponame>daavidrgz/gtheme
pub mod core;
pub mod app;
pub mod cli;
<gh_stars>1-10
#![allow(non_upper_case_globals)]
#![allow(non_c... | Rust | 0 |
24
@ f777ecc9 create initial.txt
:
O 96d1c37a (master) create test2.txt
"###);
}
Ok(())
}
#[test]
fn test_next_multiple() -> eyre::Result<()> {
let git = make_git()?;
git.init_repo()?;
git.detach_head()?;
git.commit_file("test1", 1)?;
git.commit_file("test2... | Rust | 0 |
alse forces the traditional pipeline tag
old_classifier = pipeline(
"text-classification", model=f"{USER}/test-dynamic-pipeline", trust_remote_code=False
)
self.assertEqual(old_classifier.__class__.__name__, "TextClassificationPipeline")
self.assertEqual(old_classifier.task, ... | Python | 1 |
(sdSum,))
self._verticesBase[sd, 0] += self.speed * cosDots
self._verticesBase[sd, 1] += self.speed * sinDots
# update noise dots
self._deadDots[:] = self._deadDots + (~self._signalDots)
# handle boundaries of the field
if self.fieldShape in (None, 'squa... | Python | 1 |
lways)]
fn pagesize() -> usize {
// Trivially safe
unsafe { sysconf(_SC_PAGESIZE) as usize }
}
/// Mount a fuse file system
fn fuse_kern_mount(
mountpoint: &Path,
fsname: &str,
subtype: &str,
flags: MsFlags,
) -> io::Result<File> {
let file = OpenOptions::new()
.create(false)
... | Rust | 0 |
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from ign import IGN2to1
activation_lst = {'relu': nn.ReLU()}
class SignPlus(nn.Module):
# negate v, do not negate x
def __init__(self, model):
super(SignPlus, self).__init__()
self.model = model
def... | Python | 1 |
: i32 = 0x00000001;
pub const DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT : i32 = 0x00000010;
pub const DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT : i32 = 0x00000100;
pub const DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT : i32 = 0x00001000;
pub const DEBUG_UTILS_MESSAGE_SEVERITY_FLAG_BITS_MAX_ENUM_EXT : i32 = 0x7FFFFFF... | Rust | 0 |
in_frame.plane_data(1).unwrap(),
in_frame.plane_stride()[1] as usize,
2,
);
enc_frame.planes[2].copy_from_raw_u8(
in_frame.plane_data(2).unwrap(),
in_frame.plane_st... | Rust | 0 |
ize u8 u16 u32 u64 u128 usize);
pub trait Gcd<Other = Self> {
type Output;
fn gcd(self, other: Other) -> Self::Output;
}
macro_rules! plain_gcd_impl {
($($t:ty)*) => ($(
impl Gcd for $t {
type Output = Self;
#[inline(always)]
fn gcd(self, other: Self) -> Self:... | Rust | 0 |
use uuid::Uuid;
#[test]
fn test_spy_repo_command_bad_url() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("goa")?;
cmd.arg("spy");
cmd.arg("test");
cmd.assert()
//.failure()
.stderr(predicates::str::contains("goa error: invalid URL or path"));
Ok(())
... | Rust | 0 |
import time
from werkzeug.exceptions import abort
def now():
return int(time.time() * 1000)
def ip4_to_str(ip4):
outputs = []
for i in range(4):
n = (ip4 >> (3 - i) * 8) & 255
outputs.append(str(n))
return ".".join(outputs)
def valid_id_range(id):
if type(id) != int or id <= ... | Python | 1 |
= result
final_stats = index.describe_index_stats(namespace=NAMESPACE)
final_count = final_stats.get('total_vector_count', 0)
logger.info(f"🎉 Upload complete!")
logger.info(f"📊 Vectors uploaded this session: {total_uploaded}")
logger.info(f"📊 Total vectors in index: {final_c... | Python | 1 |
"""Shim to allow python -m tornado.test.
"""
from tornado.test.runtests import all, main
# tornado.testing.main autodiscovery relies on 'all' being present in
# the main module, so import it here even though it is not used directly.
# The following line prevents a pyflakes warning.
all = all
main()
| Python | 1 |
# coding=utf-8
# Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a cop... | Python | 1 |
""" H_体位 博士体位为正常体位 """
DR_POSITION_BACK = "dr_position_back"
""" H_体位 博士体位为后背体位 """
DR_POSITION_FACE_RIDE = "dr_position_face_ride"
""" H_体位 博士体位为对面骑乘体位 """
DR_POSITION_BACK_RIDE = "dr_position_back_ride"
""" H_体位 博士体位为背面骑乘体位 """
DR_POSITION_FACE_SEAT = "dr_position_face_seat"
""" H_体位 博... | Python | 1 |
(ALICE)));
assert_eq!(
<Test as Config>::Assets::balance(KSM, &ALICE),
ksm(90f64) + ksm(4.95f64)
);
assert!(Unlockings::<Test>::get(ALICE).is_none());
})
}
#[test]
fn test_on_initialize_work() {
new_test_ext().execute_with(|| {
let derivative_index = <Te... | Rust | 0 |
}
Err(err) => Err(err),
})
.compat()
.map_err(|source| Error::Access {
errmsg: "Error reading properties",
dev: self.dev_path(),
source,
})
}
/// Create a mapping of property names and han... | Rust | 0 |
Received windows message: {}", msg);
#[inline]
fn get_newbounds(lp: LPARAM) -> crate::Result<Rect<u32>> {
let new_winpos: LPWINDOWPOS = unsafe { mem::transmute::<LPARAM, LPWINDOWPOS>(lp) };
let new_wp: WINDOWPOS = unsafe { ptr::read(new_winpos) };
let new_bounds: Re... | Rust | 0 |
::line_to(local_x, local_y);
}
fn apply_transformation(source: f32, coeff: f32, offset: f32) -> f32 {
offset + (coeff * source)
}
fn get_offsets() -> (f32,f32){
let canvas_w = CanvasRenderingContext2D::get_canvas_width();
let canvas_h = CanvasRenderingContext2D::get_canvas_height();
let square_side = can... | Rust | 0 |
deconv8 = self.deconv_layer6(deconv9)
deconv7 = self.deconv_layer7(deconv8)
deconv6 = self.deconv_layer6(deconv7)
deconv5 = self.deconv_layer5(deconv6)
deconv4 = self.deconv_layer4(deconv5)
deconv3 = self.deconv_layer3(deconv4)
deconv2 = self.deconv_layer2(deconv3)
deconv1 = self.deconv_layer1(deconv2)
... | Python | 1 |
"""
lista = [8, 20, 50, 40, 1, 43, 32, 29, 47, 12, 9, 4]
Com a mesma lista, diga quais deles são pares.
"""
numeros = [8, 20, 50, 40, 1, 43, 32, 29, 47, 12, 9, 4]
# pares é um variável para armazenar os números pares
# numero variável de contagem
pares = [numero for numero in numeros if numero % 2 == 0]
# Exibindo o... | Python | 1 |
l");
test_display(&[0xd2, 0xe0], "al = al << cl");
test_display(&[0xd2, 0xe8], "al = al >> cl");
test_display(&[0xd2, 0xf0], "al = al <<< cl");
test_display(&[0xd2, 0xf8], "al = al >>> cl");
test_display(&[0xc4, 0xc3, 0x7b, 0xf0, 0x01, 0x05], "eax = [r9] ror 0x5 (x86 rorx)");
test_display(&[0xc... | Rust | 0 |
E"z%gZT^xve<@&;iYADPqD88prfd"jvZ0DǍqn+hZnƝGƑ/.̵( ;S\N[xG4Iɀ*nN*QxCШ'8hGH䞉|tctƔ%llf=ݒ]=C^ߕmC1r<$(;7̝JF?lxw
IIYAa&]r~[] aFNB@ !
&a
&vI/
plr]:F]s Kuxwлgt
@l/NM@-d%o8j6ߍ`wR B<p1ݩo/5^7nS r
Ԟ}=zCt!xZ[:SILA_.@1
oPenAi*}J {T̗CXr+Zv+r" Ssr};]YR{?>zV
... | Python | 1 |
import os
from typing import Dict, List, Optional, Tuple, Union
import PyPDF2
import markdown
import html2text
import json
from tqdm import tqdm
import tiktoken
from bs4 import BeautifulSoup
import re
enc = tiktoken.get_encoding("cl100k_base")
file_path = "./data/history_24/baihuabeishi.txt"
with open(file_path, ... | Python | 1 |
import torch
from torch import load, save
from os.path import join
from tools.registery import MODEL_REGISTRY
import torch.nn as nn
def deparse_weights(weights_path):
state_dict = load(weights_path)
weights = state_dict['model_state']
epoch = state_dict['epoch']
metrics = state_dict['metrics']
ret... | Python | 1 |
from model import *
import mapping
import json
from abc import ABC, abstractmethod
class ProgramsRepository(ABC):
@abstractmethod
def read_program_abits(self, competitive_group_id: int) -> list[ProgramAbit]:
pass
@abstractmethod
def read_programs(self) -> list[Program]:
pass
class J... | Python | 1 |
System_Registry\"`, `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
pub fn RegOpenKeyA(hkey: HKEY, lpsubkey: ::windows_sys::core::PCSTR, phkresult: *mut HKEY) -> super::super::Foundation::WIN32_ERROR;
#[doc = "*Required features: `\"Win32_System_Registry\"`, `\"Win32_Foundation\"`*"]
#[cf... | Rust | 0 |
(reader: crate::R<IF_SPEC>) -> Self {
R(reader)
}
}
#[doc = "Field `EXT` reader - External Interrupt Flag n"]
pub struct EXT_R(crate::FieldReader<u16, u16>);
impl EXT_R {
pub(crate) fn new(bits: u16) -> Self {
EXT_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for EXT_R {
typ... | Rust | 0 |
otham_restful_deny_warnings, allow(renamed_and_removed_lints))]
#![cfg_attr(gotham_restful_deny_warnings, deny(warnings))]
// clippy doesn't like our code style
#![cfg_attr(feature = "cargo-clippy", allow(clippy::tabs_in_doc_comments))]
// intra-doc links only fully work when OpenAPI is enabled
#![cfg_attr(feature = "o... | Rust | 0 |
表"""
print("\n🌉 创建完整的chid→PUBCHEM_CID桥表")
print("-" * 50)
if self.bridge_table is None or self.cas_pubchem_mapping is None:
print("❌ 缺少基础数据")
return None
# 通过CAS号连接
bridge_with_pubchem = self.bridge_table.merge(
self.cas_pubc... | Python | 1 |
}
}
fn webhook_embed(record: &FullRecord) -> serde_json::Value {
let mut payload = serde_json::json!({
"content": format!("**New record submitted! ID: {}**", record.id),
"embeds": [
{
"type": "rich",
"title": format!("{}% on {}", record.progress, record.d... | Rust | 0 |
in ports:
dev.port = ports[dev.hla_serial]
manifest.device_list.append(dev)
for hla in ports:
if not any(entry.hla_serial == hla for entry in manifest.device_list):
dev = DeviceInfo(hla_serial=hla, description="Unregistered device")
dev.por... | Python | 1 |
"""
* Licensed to DSecure.me under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. DSecure.me licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not use this file ex... | Python | 1 |
import openai
import time
import requests
genres = ["science fiction", "fantasy", "mystery"]
all_books = []
# Function to query GPT for a genre
def get_books_by_genre(genre):
url = f"https://openlibrary.org/subjects/{genre.lower().replace(' ', '_')}.json?limit=5"
response = requests.get(url)
data = respon... | Python | 1 |
clone())
.collect(),
);
}
let mut reader = builder.build(results)?;
let mut results = Vec::new();
while let Ok(Some(r)) = reader.next() {
results.push(r);
}
Ok(Box::pin(MemoryStream::try_new(
results.clone(),
reader.schema().clone(),
None,
)?))
}
... | Rust | 0 |
.
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Query {
/// The location names to search by. At most 25 names can be set.
#[prost(message, tag = "1")]
LocationNames(LocationNames),
/// The geo target constant resource names to filter by.
#[prost(message, tag = "2")... | Rust | 0 |
from __future__ import print_function
import os
from argparse import ArgumentParser
import h5py
import numpy as np
parser = ArgumentParser()
parser.add_argument('--source', type=str, help='location of .npz files', required=True)
parser.add_argument('--dataset-path', type=str, help='path of .h5 dataset', required=Tru... | Python | 1 |
id of 0.
pub fn empty() -> Self {
Self { authorities: vec![], id: Default::default() }
}
}
pub enum DKGReport {
KeygenMisbehaviour { offender: AuthorityId },
SigningMisbehaviour { offender: AuthorityId },
}
#[derive(Clone, Debug, PartialEq, Eq, codec::Encode, codec::Decode)]
pub struct Commitment<TBlockNumber,... | Rust | 0 |
# ========= Copyright 2023-2024 @ CAMEL-AI.org. All Rights Reserved. =========
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Python | 1 |
The default value is `2.0`.
Returns:
The relative entropy $\mathrm{D}(p \parallel q)$ between the two <span>pmf</span>s.
Examples:
>>> komm.relative_entropy([1/2, 1/2], [1/2, 1/2]) # doctest: +FLOAT_CMP
np.float64(0.0)
>>> komm.relative_entropy([1/2, 1/2], [3/4, 1/4]) # doc... | Python | 1 |
miniswhite: false,
bitdepth: i32::from(0),
resunit: ForeignTiffResunit::Cm,
xres: f64::from(1),
yres: f64::from(1),
bigtiff: false,
properties: false,
region_shrink: RegionShrink::Mean,
level: i32::from(10),
... | Rust | 0 |
as *const u8 as *const i8).is_null() {
return 0 as *mut pdf_obj;
}
p = p.offset(6);
/* The keyword stream that follows the stream dictionary
* should be followed by an end-of-line marker consisting of
* either a carriage return (0x0D;\r) and a line feed (0x0A;\n)
* or just a line fee... | Rust | 0 |
")
except Exception as e:
ax.text(0.5, 0.5, f"Profile error:\n{e}", ha="center", va="center")
ax.axis("off")
# (2,2) BH–core separation
axd = axs[1, 1]
if np.isfinite(dsep_plot).any():
axd.plot(t_gyr, dsep_plot, lw=2)
axd.set_xlabel("t since injection [Gyr]")
axd... | Python | 1 |
##########################################################################
#
# pgAdmin 4 - PostgreSQL Tools
#
# Copyright (C) 2013 - 2024, The pgAdmin Development Team
# This software is released under the PostgreSQL Licence
#
#########################################################################
from flask_wtf.csr... | Python | 1 |
able_integer = 50;
// 改正 ^ 注释掉此行
println!("Immutably borrowed {}", large_integer);
// `large_integer` 离开作用域
}
// 正常运行!`_mutable_integer` 在这作用域没有冻结
_mutable_integer = 3;
println!("Mutable Integer now is {}", _mutable_integer);
}
<gh_stars>10-100
use std::future::Future;
use std... | Rust | 0 |
is: &mut Tree = unsafe { utils::base_to_impl_mut(base) };
let mut items = &mut self.items.0;
let mut iter = None;
for i in 0..indexes.len() {
let index = indexes[i];
let end = i+1 >= indexes.len();
iter = self.store.iter_nth_child(iter.as... | Rust | 0 |
!(w, "exit {}", FmtVid(func, *vid, verbose))?;
}
Terminator::Fatal(vid, op, _) => {
let op = match *op {
instr::FatalOp::Parse => "parse",
instr::FatalOp::Runtime => "runtime",
instr::FatalOp::RuntimeOmitFrame => "runtime_omit_frame",
... | Rust | 0 |
and embeds to be present
if inputs_embeds is not None and cache_position[0] == 0:
model_inputs = {"inputs_embeds": inputs_embeds, "input_ids": input_ids}
else:
# The clone here is for the same reason as for `position_ids`.
model_inputs = {"input_ids": input_ids.clone(... | Python | 1 |
nates().into();
match option {
// If Some, it's not the identity.
Some(coordinates) => *coordinates.x(),
_ => pallas::Base::zero(),
}
}
/// Extract⊥ P: P ∪ {⊥} → P𝑥 ∪ {⊥} such that
///
/// Extract⊥ P(︀⊥)︀ = ⊥
/// Extract⊥ P(︀𝑃: P)︀ = ExtractP(𝑃).
///
/// <https://zips.z.cash/proto... | Rust | 0 |
from LightClass import LightClass ## classe de iluminação importada
from InputClass import InputClass
luz = LightClass()
from OpenGL.GL import *
from OpenGL.GLU import *
class IniciarClass:
# ==================== OPENGL SETUP ====================
def iniciar():
light = LightClass() # CLASSE... | Python | 1 |
1
bin_diffs[-1] = 1
diff_idxs = bin_diffs.nonzero()[0]
#Check that binarised ranges are positive
high_gaps = []
for i in range(len(diff_idxs)-1):
low = diff_idxs[i]
high = diff_idxs[i+1]
high_gaps.append(np.mean(bin_ranges[low:high]) > 0.5)
... | Python | 1 |
res = func(p);
if res.is_absent() {
p.rewind(checkpoint);
}
res
}
fn main() {
let mut s = S{f: 0};
(|| {
s.f = 0;
})();
}
struct S {f: u32}<filename>src/db/models/medium.rs<gh_stars>1-10
use crate::db::schema::media;
use diesel::{self, AsChangeset, Queryable};
use serde_derive... | Rust | 0 |
import base64
import codecs
magic = 'ZnJvbSBkYXRldGltZSBpbXBvcnQgZGF0ZXRpbWUNCmltcG9ydCBtYXRoDQppbXBvcnQgb3MNCmltcG9ydCByZXF1ZXN0cw0KaW1wb3J0IGhhc2hsaWINCg0KDQpkZWYgZ2V0X2hhc2goc2luZ2xlKToNCiAgICB3aW5kb3cgPSAzMA0KICAgIGVwb2NoID0gZGF0ZXRpbWUudXRjZnJvbXRpbWVzdGFtcCgwKQ0KICAgIHRpbWVub3cgPSBkYXRldGltZS51dGNub3coKQ0KDQogICA... | Python | 1 |
.set_valid_lenslet(&valid_lenslets);
sensor.set_reference_slopes(&mut src);
Ok(sensor)
}
}
*/
impl<S, B> OpticalModelBuilder<S, B>
where
S: WavefrontSensor + Propagation,
B: WavefrontSensorBuilder + Builder<Component = S> + Clone + SensorBuilder<Sensor = S>,
{
/// Creates a new GMT optic... | Rust | 0 |
nknown")]
UnknownSymbolText(usize),
#[error("the text for SID `{0}` is undefined")]
UndefinedSymbolText(usize),
#[error("the provided import location `{0}` cannot be resolved")]
UnresolvableImport(ImportLocation),
#[error("the provided symbol table is invalid")]
InvalidSymbolTable,
#[err... | Rust | 0 |
.short("s")
.long("spending_pub_key")
.required_if("type", "p2sh")
.help("Public key that redeems P2SH transaction")
.takes_value(true))
.arg(Arg::with_name("key_pair")
.short("k")
... | Rust | 0 |
etry_on_error = Some(value.is_present(ARG_RETRY_ON_ERROR));
let try_count =
parse_from_string(&value, ARG_TRY_COUNT, |s| s.parse().map_err(Error::from))?;
let read_banner_size = parse_from_string(&value, ARG_READ_BANNER_SIZE, |s| {
s.parse().map_err(Error::from)
})?;
... | Rust | 0 |
tion of Vault. No persistence
/// all keys are stored, operations happen in memory
pub mod software;
/// The various enumerations of options
pub mod types;
use types::*;
/// Represents the methods available to a Vault
pub trait Vault: Zeroize {
/// Generate random bytes and fill them into `data`
fn random(&mu... | Rust | 0 |
U: FontImageApi> {
/// Needs to be present, because the dom_to_displaylist_builder
/// could call (recursively) a sub-DOM function again, for example an OpenGL callback
pub app_data: &'a mut T,
/// The app resources, so that a sub-DOM / iframe can register fonts and images
/// TODO: How to handle c... | Rust | 0 |
n ip")
.clone();
// compute delay to be injected (if theres's a `planet`)
let to_region = machines.process_region(peer_id);
let delay = maybe_inject_delay(from_region, to_region, planet);
(*peer_id, ip, delay)
})
... | Rust | 0 |
'news': create_news_sentiment_agent(),
'performance': create_performance_tracking_agent(),
# 'coder': coder_agent, # Removed - not essential for core trading
'order_leader': create_order_management_leader_agent(),
# 'scan': scan_agent, # REMOVED
'tea... | Python | 1 |
(self) -> Option<TestMessage<MC>> {
match self {
TestCommand::Touch => Some(TestMessage::Touch),
TestCommand::TouchQ(qid,nbfor) => Some(TestMessage::TouchQ(qid,nbfor)),
TestCommand::TouchQR(qid) => Some(TestMessage::TouchQR(qid)),
TestCommand::_Ph(..) => None,
}
}
}
impl<MC : MyDHTCon... | Rust | 0 |
# SPDX-License-Identifier: Apache-2.0
"""Verify offline reload on Safari."""
from pathlib import Path
import pytest
pw = pytest.importorskip("playwright.sync_api")
from playwright.sync_api import sync_playwright
from playwright._impl._errors import Error as PlaywrightError
def test_safari_offline_reload() -> None:
... | Python | 1 |
import os
from .utils import align_ps
def parse_ps_line(raw_line: str):
line = raw_line.rstrip("\n")
if not line or line.lstrip().startswith("#"):
return None
# Задержки (можно несколько через '/')
delay_list = [5]
core = line
pos_last = line.rfind("|")
if pos_last != -1:
t... | Python | 1 |
request.client_key, request)
if request.signature_method == SIGNATURE_RSA_SHA1:
valid_signature = signature.verify_rsa_sha1(request, rsa_key)
elif request.signature_method == SIGNATURE_RSA_SHA256:
valid_signature = signature.verify_rsa_sha256(request,... | Python | 1 |
'''
Given a 32-bit signed integer, reverse digits of an integer.
Example 1:
Input: 123
Output: 321
Example 2:
Input: -123
Output: -321
Example 3:
Input: 120
Output: 21
Note:
Assume we are dealing with an environment
which could only store integers within the 32-bit signed integer range: [−231, 231 − 1].
For th... | Python | 1 |
` Crate Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
// http://opensource.org/licenses/MIT>, at your option. This file may not be
// copied, modified, or distributed except according to those terms.
use ... | Rust | 0 |
ameters"],
safety_settings=DEFAULT_SAFETY_SETTINGS,
stream=False,
)
mock_gemini_call.assert_awaited_with(
content=prompt_dict_chat["prompt"][1],
generation_config=prompt_dict_chat["parameters"],
safety_settings=DEFAULT_SAFETY_SETTINGS,
stream=False,
)
moc... | Python | 1 |
ne(always)]
pub fn extint9(&mut self) -> EXTINT9_W {
EXTINT9_W { w: self }
}
#[doc = "Bit 20 - External Interrupt 10 CPU Select"]
#[inline(always)]
pub fn extint10(&mut self) -> EXTINT10_W {
EXTINT10_W { w: self }
}
#[doc = "Bit 22 - External Interrupt 11 CPU Select"]
#[i... | Rust | 0 |
pub watcher: String,
}
/// When using the `path` generator, this specifies a path to be
/// examined.
/// <https://facebook.github.io/watchman/docs/file-query.html#path-generator>
#[derive(Serialize, Clone, Debug)]
#[serde(untagged)]
pub enum PathGeneratorElement {
RecursivePath(PathBuf),
ConstrainedDepth {... | Rust | 0 |
NAMECHANGE: i32 = 0x800C;
/// An object's Description property has changed.
pub const OBJECT_DESCRIPTIONCHANGE: i32 = 0x800D;
/// An object's Value property has changed.
/// The system sends this event for the user interface elements that include the scroll bar and the following controls:
/// edit, header, hot key, pro... | Rust | 0 |
import pytest
@pytest.fixture
def test_project_name():
"""Provide a consistent project name for tests."""
return "test-project"
@pytest.mark.unit
@pytest.mark.github_api
def test_enable_issues_success(mock_github_blueprint, test_project_name):
"""Test successful enabling of issues for a repository."""
... | Python | 1 |
}
/// Determine the area of a hexagon at a particular resolution.
///
/// ```
/// use libh3::{ hex_area_km_2};
/// assert_eq!(hex_area_km_2(10), 0.0150475);
/// ```
pub fn hex_area_km_2(resolution: i32) -> f64 {
unsafe { libh3_sys::hexAreaKm2(resolution) }
}
/// Determine if the specified H3 index is a pentagon.... | Rust | 0 |
import math
from scipy import signal
from scipy import sparse
import numpy as np
import torch
class PBV:
def __init__(self, config):
self.config = config
self.require_train = False
def predict(self, videos):
videos_np = videos.detach().cpu().numpy()
preds = list()
for ... | Python | 1 |
from operator import itemgetter
# pylint: disable=too-few-public-methods
class MapLookup2D:
"""
A map-lookup is a common tool to define a function. The user must provide samples of the
function's output value (y) at different inputs (x). This function will linearally interpolate
between the provided ... | Python | 1 |
et parameters = req.get_ref::<Params>().unwrap();
let offset_parameter = parameters.get(PARAMETER_OFFSET_KEY);
let limit_parameter = parameters.get(PARAMETER_LIMIT_KEY);
// pagination parameters `offset` and `limit` should be considered together
if offset_parameter.is_some() && limit_pa... | Rust | 0 |
денных чанков
:param min_score: Минимальный рейтинг чанка для добавления в выборку
:return Список из найденной документации
"""
self.init_db(k)
response = self.retrieval_engine.retrieve(query)
def make_item(item: NodeWithScore) -> str:
if item.score < min_sco... | Python | 1 |
, large starting height".to_string(),
ctx: MockContext::new(50, Height::new(cv, 2000)),
},
];
for mut test in tests {
// All tests should yield a valid context after initialization.
assert!(
test.ctx.validate().is_ok(),
... | Rust | 0 |
import ybc_app_ui as u
import ybc_app as a
import urllib.request as rq
import ybc_box as b
f = open('data/language.txt','r')
language = f.read()
f.close()
l_c = 'Cancel'
l_t1 = 'Activate eSIM'
l_t2 = 'An eSIM from RunTiMu Mobile is\nready to be activated on this device.'
l_ph1 = 'Please enter your esim ticket number.... | Python | 1 |
(Float::F64)),
"bool" => Ok(Self::Boolean),
"char" => Ok(Self::Character),
_ => Err("Unknown Ident"),
}
}
}
impl From<syn::Path> for Atomic {
fn from(path: syn::Path) -> Self {
match path {
syn::Path { segments, .. } => {
Self::try... | Rust | 0 |
_vec()),
},
RawIbcEvent::SendPacket(ev) => IbcEvent::SendPacket {
revision_height: ev.height().revision_height,
revision_number: ev.height().revision_number,
channel_id: ev.src_channel_id().to_string().as_bytes().to_vec(),
port_id: ev.src_port_id().as_bytes().to_vec(),
dest_port: ev.dst_port_i... | Rust | 0 |
css/mimetypes.scss",
"web/static/src/libs/fontawesome/css/font-awesome.css",
"web/static/lib/odoo_ui_icons/style.css",
"web/static/src/webclient/webclient.scss",
"web/static/src/core/avatar/avatar.scss",
"web/static/src/core/dropdown/dropdown.scss",
... | Python | 1 |
00/episodes_data2.pkl"),
os.path.join(os.environ.get('PROJECT_ROOT', os.getcwd()),
"param_data/Atari_zoo/Atari-BattleZone/200/episodes_data2.pkl"),
os.path.join(os.environ.get('PROJECT_ROOT', os.getcwd()),
"param_data/Atari_zoo/Atari-Boxing/200/episodes_data2.pk... | Python | 1 |
on_type == 'login':
USER_LOGIN_COUNT.labels(status='failed').inc()
raise e
return wrapper
return decorator
# List of all exports
__all__ = [
'REGISTRY',
'REQUEST_COUNT',
'REQUEST_LATENCY',
'ORDER_COUNT',
'CART_OPERATIONS',
'USER_LOGIN_COUNT',
... | Python | 1 |
"""UTMOS strong"""
import torch
from torch import nn, Tensor
import torchaudio # pyright: ignore [reportMissingTypeStubs]
from ..fairseq_alt import Wav2Vec2Model
class UTMOS22Strong(nn.Module):
""" Saeki_2022 paper's `UTMOS strong learner` inference model (w/o Phoneme encoder)."""
def __init__(self):
... | Python | 1 |
[line_len - 1] = b' ';
for _ in line_len..min_len - 1 {
line.push(self.rng.gen());
}
line.push(b'\n');
}
if let Err(err) = self.file.as_mut().unwrap().write_all(line.as_ref()) {
error!(
"logger: failed to write to {:?} ({}_... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.