text string | label_name string | labels int64 |
|---|---|---|
64, // Offset 40
/// Last usable LBA (secondary partition table first LBA - 1)
pub last_usable: u64, // Offset 48
/// UUID of the disk
pub disk_guid: uuid::Uuid, // Offset 56
/// Starting LBA of partition entries
pub part_start: u64, // Offset 72
/// Number of partition entries
pub num_p... | Rust | 0 |
.status()
{
Ok(_) => true,
Err(_) => false,
}
}
fn download_if_update(&self, url: &str, output_filename: &str) -> bool {
match Command::new("curl")
.args(&["-o", output_filename, "-z", output_filename, "-L", url])
.status()
... | Rust | 0 |
* Get a webinar.
*
* This function performs a `GET` to the `/webinars/{webinarId}` endpoint.
*
* Zoom users with a [Webinar Plan](https://zoom.us/webinar) have access to creating and managing Webinars. Webinar allows a host to broadcast a Zoom meeting to up to 10,000 attendees.<br>Use this API to ge... | Rust | 0 |
or torch.device): CUDA devices
:attr:`modules`, :attr:`inputs`, :attr:`kwargs_tup` (if given), and
:attr:`devices` (if given) should all have same length. Moreover, each
element of :attr:`inputs` can either be a single object as the only argument
to a module, or a collection of positional arguments.
... | Python | 1 |
import logging
from fastapi import APIRouter, HTTPException, BackgroundTasks
from mcp_explorer.client.mcp_client import client
from mcp_explorer.models import Query
logger = logging.getLogger("mcp_explorer.api.routes.query")
router = APIRouter()
@router.post("/query", response_model=str)
async def process_query(qu... | Python | 1 |
> ({
macro_rules! __with_ty__ {( $_ $T:ident ) => ( $($body)* )}
use crate::datatypes::PrimitiveType::*;
use crate::types::days_ms;
match $key_type {
Int8 => __with_ty__! { i8 },
Int16 => __with_ty__! { i16 },
Int32 => __with_ty__! { i32 },
Int64 => __with_ty__! { i64 },
... | Rust | 0 |
"""CRUD tests for UserMap"""
import pytest
from .schema import DBAddrToUsername
class TestAddrToUsernameTable:
"""CRUD tests for AddrToUsername table"""
@pytest.mark.docker
def test_create_addr_to_username(self, db_session):
"""Create and entry"""
user_map = DBAddrToUsername(address="1"... | Python | 1 |
# -------------------------------------------------------------
#
# 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 unde... | Python | 1 |
henticationToken,
"name": "testtask",
"parentID": sectionID,
"priority": "High",
"description": "Nothing here",
}))
data = json.loads(response.json()['data'])
itemID = data["itemID"]
itemList.append(itemID)
url = "/todolist/api/task/add"
response = client.post(ur... | Python | 1 |
))); break; }
}
let dir_getter = || -> Option<(f64, f64)> {
let delta = tracking_pos - pd.mount_data.calibration.as_ref().unwrap().origin;
let len = delta.dist_from_origin();
if len < MIN_VECTOR_LENGTH {
must_show_error.replace(Some(
... | Rust | 0 |
ending on
/// your system the systems zoneinfo file is located in `/etc/localtime`.
pub fn new(zoneinfofile: &Path) -> Result<ZoneInfo, std::io::Error> {
let mut file = try!(File::open(&zoneinfofile));
let mut buffer = Vec::<u8>::new();
try!(file.read_to_end(&mut buffer));
let mu... | Rust | 0 |
# list of data for generate the random dname option for the certificate issue
common_names = ["example.com", "mydomain.com", "testsite.org", "randomdomain.net", "demoapp.org", "sampleapp.com", "projectx.net", "webportal.com"]
org_units = ["IT", "Development", "Support", "Sales", "HR", "Legal", "Finance", "Marketing",... | Python | 1 |
from_columns(0..arity, ArrangementFlavor::Local(oks, errs))
}
ArrangementFlavor::Trace(_, oks, errs) => {
let oks = oks.reduce_abelian::<_, OrdValSpine<_, _, _, _>>(
"Threshold",
move |_k, s, t| {
for (record, count)... | Rust | 0 |
#This tests that the duty cycle of PWM is (approximately) correct.
from microbit import *
def pins_connected(p0, p1):
for i in 0,1,0,1,0,1,0,1:
p0.write_digital(i)
if p1.read_digital() != i:
return False
p1.write_digital(i)
if p0.read_digital() != i:
return ... | Python | 1 |
from web3.contract import ImplicitContract
from web3 import Web3
from cobra.test.log import Log
from .event import get_event_signatures, get_event_processors
class Instance:
"""Deployed instance of a contract"""
def __init__(self, _web3: Web3, address, interface):
self.web3 = _web3
self.__add... | Python | 1 |
# Copyright 2016 Free Software Foundation, Inc.
# This file is part of GNU Radio
#
# SPDX-License-Identifier: GPL-2.0-or-later
#
"""
Converter for legacy block tree definitions in XML format
"""
from ..core.io import yaml
from . import xml
def from_xml(filename):
"""Load block tree description from xml file"""
... | Python | 1 |
ubscription;
use crate::callback::Consumer;
use crate::result::TockResult;
use crate::syscalls;
use core::marker::PhantomData;
use libtock_core::shared_memory::SharedMemory;
const DRIVER_NUMBER: usize = 0x40004;
pub const RECV_BUFFER_SIZE: usize = 64;
pub const SEND_BUFFER_SIZE: usize = 64;
mod command_nr {
pub ... | Rust | 0 |
ideo_url}: {e}")
return {"plays": 0} # Ensure we don't mark it complete
finally:
driver.quit()
def run_metadata_jobs():
jobs = get_pending_jobs()
print(f"📦 Found {len(jobs)} video metadata jobs")
for job in jobs:
video_url = job["url"]
print(f"🔍 Processing: {video_ur... | Python | 1 |
if let Instance::Attached(a, i) = self {
Some((a, *i))
} else {
None
}
}
}
map_index!(AREA_INDICES, Area, AreaIndex,);
map_index!(BODY_INDICES, Body, BodyIndex,);
map_index!(JOINT_INDICES, Joint, JointIndex,);
map_index!(SHAPE_INDICES, Shape, ShapeIndex,);
map_index!(SPACE_INDICES, Space, SpaceIndex,);
i... | Rust | 0 |
options -- pick one!")
sys.exit(1)
if args.aln_quality is not None:
AlignmentSet.AlnThreshold = args.aln_quality
if args.export is not None:
args.no_web = True
if args.type!="batch" and args.format is None and not args.export.lower()[-3:] in ["svg", "png", "pdf"]:
... | Python | 1 |
nsform(X_source_test)
pca_target = PCA(n_components=4) # Changed the components to mix up the set
X_target_train_pca = pca_target.fit_transform(X_target_train)
X_target_test_pca = pca_target.transform(X_target_test)
# SVM linear
svm_source = SVC(kernel='linear', C=1, probability=True)
svm_source.fit(X_source_train_pc... | Python | 1 |
{
self.expr_bin_and(*b_lhs, *b_rhs, exit, result_reg)
},
tast::BinaryOp::Or => {
self.expr_bin_or(*b_lhs, *b_rhs, exit, result_reg)
},
}
},
tast::ExprKind::Call(name, para... | Rust | 0 |
ed())),
],
Box::new(BasicBlock("n3".to_owned())),
),
BasicBlock("return".to_owned()),
]),
ast
);
}
#[test]
fn ast_ifelse_cascade() {
let cstore = condition::Storage::new();
let cctx = cstore.cctx();
let v_c1 = cond_s(cctx, "c1");
... | Rust | 0 |
from teuthology import misc
def get_remote(ctx, cluster, service_type, service_id):
"""
Get the Remote for the host where a particular role runs.
:param cluster: name of the cluster the service is part of
:param service_type: e.g. 'mds', 'osd', 'client'
:param service_id: The third part of a role,... | Python | 1 |
if let Ok(member) = guild.member(ctx, user).await {
if let Ok(permissions) = member.permissions(&ctx).await {
return permissions;
}
}
Permissions::empty()
}
#[inline]
fn require_permission(permissions: Permissions, require: Permissions) -> CommandResult<()> {
if permissions.cont... | Rust | 0 |
import sys
from dataclasses import dataclass
@dataclass
class WindowsConsoleFeatures:
"""Windows features available."""
vt: bool = False
"""The console supports VT codes."""
truecolor: bool = False
"""The console supports truecolor."""
try:
import ctypes
from ctypes import LibraryLoader... | Python | 1 |
elf.iter()
.map(|elem| (elem.0.into_debug_with(cx), elem.1.into_debug_with(cx))),
)
.finish()
}
}
impl<T> DebugWith for std::sync::Arc<T>
where
T: DebugWith,
{
fn fmt_with<Cx: ?Sized>(&self, cx: &Cx, fmt: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
... | Rust | 0 |
ln!("attributes: {:?}", csbi.attributes());
println!("terminal window dimentions {:?}", csbi.terminal_window());
println!("terminal size {:?}", csbi.terminal_size());
}
fn multiple_screen_buffers() {
// create new screen buffer
let screen_buffer = ScreenBuffer::create();
// which to this screen bu... | Rust | 0 |
rites
/// * 100 = 16x16 and 64x64 sprites
/// * 101 = 32x32 and 64x64 sprites
/// * 110 = 16x32 and 32x64 sprites ('undocumented')
/// * 111 = 16x32 and 32x32 sprites ('undocumented')
/// * `nn`: Name select - Offset between sprite/name tables
/// * `bbb`: Address select of first sprite/name... | Rust | 0 |
ield: ",
// stringify!(_xsltKeyDef),
// "::",
// stringify!(name)
// )
// );
// assert_eq!(
// unsafe { &(*(::std::ptr::null::<_xsltKeyDef>())).nameURI as *const _ as usize },
// 24usize,
// concat!(
// "Offset of field: ",
// ... | Rust | 0 |
full")]
pub fn visit_pat_type<'ast, V>(v: &mut V, node: &'ast PatType)
where
V: Visit<'ast> + ?Sized,
{
for it in &node.attrs {
v.visit_attribute(it);
}
v.visit_pat(&*node.pat);
tokens_helper(v, &node.colon_token.spans);
v.visit_type(&*node.ty);
}
#[cfg(feature = "full")]
pub fn visit_pa... | Rust | 0 |
// First we search through the ancestors of start_version until hitting the root.
let mut current_version = start_version;
while let Some(node_bytes) = txn.get(current_version.into_sled_key())? {
let node = unsafe { ArchivedIVec::<VersionNode>::new(node_bytes) }.deserialize();
if current_ve... | Rust | 0 |
ITY;
pub const IFA_TARGET_NETNSID: _bindgen_ty_44 = _bindgen_ty_44::IFA_TARGET_NETNSID;
pub const __IFA_MAX: _bindgen_ty_44 = _bindgen_ty_44::__IFA_MAX;
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_44 {
IFA_UNSPEC = 0,
IFA_ADDRESS = 1,
IFA_LOCAL = 2,
IFA_LABEL =... | Rust | 0 |
import os
import sys
import argparse
from shutil import copyfile, copytree, rmtree
from urllib import request
from zipfile import ZipFile
from pathlib import Path
# GODOT_PATH = os.environ["GODOT_PATH"]
GODOT_PATH = "/home/lupoglaz/Projects/godot32"
def download_unpack(rewrite=False):
# url = 'https://download.pytor... | Python | 1 |
of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
diagnostics_data::{Data, Logs, Severity},
diagnostics_reader::{ArchiveReader, SubscriptionResultsStream},
fidl::endpoints::create_endpoints,
fidl_fuchsia_io::DirectoryMarker,
fidl_fuchsia_sys2::Ch... | Rust | 0 |
from phi.aws.resource.secret.manager import SecretsManager
from phi.aws.resource.secret.reader import read_secrets
| Python | 1 |
ub(crate) fn store_byte(&mut self, addr: Word, byte: Byte) {
match addr.get() {
0xFF04 => {
self.divider = byte;
self.cycle_count = 0;
}
0xFF05 => self.counter = byte,
0xFF06 => self.modulo = byte,
0xFF07 => self.control... | Rust | 0 |
self.traces = []
def remove_trace(self,tr_id):
print "remove trace %d" % tr_id
def add_trace(self, tr):
print "Add trace"
################################################################################
# Usage as script
######################################################################... | Python | 1 |
Box_::into_raw(f),
)
}
}
fn connect_property_y_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId {
unsafe extern "C" fn notify_y_trampoline<P, F: Fn(&P) + 'static>(
this: *mut ffi::WebKitDOMHTMLImageElement,
_param_spec: glib::ffi::gpointer,
... | Rust | 0 |
&str = "min_price_per_gas_unit";
/*!
This is a small crate that just export one macro that allow you to have code
conditionally of the rust version.
The [`if_rust_version!`](macro.if_rust_version.html) macro allows you to still
support older version
of rustc while still using conditionally new features of the compil... | Rust | 0 |
_name = (ty_var.value.clone().into_inner(), ty_var.loc);
$context.source_map.add_struct_type_parameter_mapping(
$context.current_struct_definition_index(),
source_name,
)?;
}
};
(struct_decl: $context:expr, $location:expr) => {
$context
... | Rust | 0 |
'sample_false_negatives': [ { 'smiles': 'C(CC[NH3+])CC[NH+](C)C',
'name': 'N,N-dimethyl-cadaverine(+2)',
'reason': 'No secondary ammonium group '
'(N+ with two carbons) found'}],
'attem... | Python | 1 |
break Some(t);
}
}
}
/// Find the first prime number smaller than `target`. If target is less than 3, then [None]
/// will be returned.
#[cfg(not(feature = "big-table"))]
pub fn prev_prime<T: PrimalityBase>(target: &T, config: Option<PrimalityTestConfig>) -> Option<T>
where
for<'r> &'r T: Primality... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
"""Unit tests."""
import argparse
import itertools
import json
import os
import subprocess
import sys
import time
import unittest
import uuid
import torch
from domainbed import datasets
from domainbed import hparams_registry
from domainbed impor... | Python | 1 |
ror> {
let gg = get_grammar_grammar();
parse_grammar_with_grammar(&gg, input)
}
<reponame>MichaelMcCulloch/stellarust
use std::{
fs,
path::{Path, PathBuf},
process::Command,
};
use anyhow::Result;
const CAMPAIGN_UNE_ROOT_RELATIVE: &str =
"stellarust/res/test_data/campaign/unitednationsofearth_... | Rust | 0 |
self.ratio_w_electron_photon, photon_n, self.photon_p,
self.photon_beta_x, self.photon_beta_y, self.photon_beta_z )
# Count the total number of new photons
cumul_nscatter_per_batch = perform_cumsum( nscatter_per_batch, use_cuda )
N_created = int( cumul_nscatter_per_batch[-1... | Python | 1 |
eC, 3 |
recv_mpst_g_from_d, RoleD, 4 |
recv_mpst_g_from_e, RoleE, 5 |
recv_mpst_g_from_f, RoleF, 6 |
recv_mpst_g_from_h, RoleH, 7 |
recv_mpst_g_from_i, RoleI, 8 |
recv_mpst_g_from_j, RoleJ, 9 |
recv_mpst_g_from_k, RoleK, 10 | =>
RoleG, MeshedChannelsEleven, 11
);
// H
create_recv_mpst_se... | Rust | 0 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2024 sqlmap developers (https://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
import re
from lib.core.compat import xrange
from lib.core.enums import PRIORITY
__priority__ = PRIORITY.NORMAL
def dependencies():
pass
def tamper(payload, **kwargs):
... | Python | 1 |
yment_worker_id=deployment_worker_id)
return True, ""
# return result.stdout
except subprocess.CalledProcessError as e:
uninstall_pod_deployment(workspace_id, deployment_id, deployment_worker_id)
err_msg = e.stderr.strip()
print(e.stdout, file=sys.stderr)
print(err_m... | Python | 1 |
t bank = Bank32View::try_from_le_bytes(&buffer);
assert!(matches!(
bank,
Err(TryBankViewFromSliceError::UnknownDataType)
));
}
#[test]
fn valid_be_bank32_views() {
let buffer = [66u8, 65, 78, 75, 0, 0, 0, 1, 0, 0, 0, 0];
let bank = Bank32View::try_from_be_bytes(&buffer).unwrap();
as... | Rust | 0 |
from fastapi import FastAPI,Query,HTTPException
from pydantic import BaseModel
from typing import Optional
import json
app = FastAPI()
#libro va a ser siempre el constructor que paso para modificar luego el Json
#libros va a ser el nombre y variable del json con los datos
#Libro es el Objeto que adentro esta construid... | Python | 1 |
scenario_unlocks,
effort_point=effort_result,
unit_list=[
LiveRewardResponseUnitList.from_unit_data(
unit_data_full, position=i + 1, before_love=before_after_loves.before[i]
)
for i, unit_data_full in enumerate(unit_deck_full_info)
],
b... | Python | 1 |
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException, NoSuchElement... | Python | 1 |
# coding:utf-8
import requests
from lib.core.common import url_handle,get_random_ua
from lib.core.poc import POCBase
# ...
import urllib3
urllib3.disable_warnings()
class POC(POCBase):
_info = {
"author" : "jijue", # POC作者
"version" : "1", # POC版本,默认是1
... | Python | 1 |
import numpy as np
from PyQt5.QtGui import QImage
import os
import cv2
def qimage_to_np(img):
img = img.convertToFormat(QImage.Format.Format_RGB888)
w, h = img.width(), img.height()
img_bits = img.bits()
img_bits.setsize(w * h * 3)
np_img = np.frombuffer(img_bits, dtype=np.uint8).reshape((h, w, 3)... | Python | 1 |
#!/usr/bin/env python3
# vim: set expandtab tabstop=4 shiftwidth=4:
# Copyright 2019-2020 Christopher J. Kucera
# <cj@apocalyptech.com>
# <http://apocalyptech.com/contact.php>
#
# This Borderlands 3 Hotfix Mod is free software: you can redistribute it
# and/or modify it under the terms of the GNU General Public Licens... | Python | 1 |
> =
std::future::Ready<Result<S, Infallible>>;
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn traits() {
use crate::test_helpers::*;
assert_send::<IntoMakeService<()>>();
assert_sync::<IntoMakeService<()>>();
}
}
/**
* Copyright © 2019
* <NAME> <<EMAIL>>,
* <NA... | Rust | 0 |
ndexBuilder(nil)
if err != nil {
t.Fatalf("NewIndexBuilder: %v", err)
}
b.AddFile("banzana", []byte("x orange y"))
// --------0123456
b.AddFile("banana", []byte("x apple y"))
// --------789012
sres := searchForTest(t, b, &query.Substring{
Pattern: "anan",
FileName: true,
})
matches := sres.Files
if l... | Rust | 0 |
ectId,
start_time: u64,
payload: Bytes,
// Used for KafkaMessage::key
#[serde(skip)]
event_id: EventId,
}
#[derive(Clone, Debug, Serialize)]
struct SessionKafkaMessage {
org_id: u64,
project_id: ProjectId,
session_id: Uuid,
distinct_id: Uuid,
quantity: u32,
seq: u64,
re... | Rust | 0 |
# Copyright 2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Minimum seats in events",
"version": "17.0.1.0.0",
"author": "Tecnativa, Odoo Community Association (OCA)",
"license": "AGPL-3",
"website": "https://github.com/OCA/event",
... | Python | 1 |
)),
n2i(f64::NEG_INFINITY, 2.0)
);
assert_eq2!(
n2i(0.0, 0.0).mul_add(n2i(-5.0, 3.0), n2i(f64::NEG_INFINITY, 2.0)),
n2i(f64::NEG_INFINITY, 2.0)
);
assert_eq2!(
n2i(0.0, 0.0).mul_add(n2i(1.0, 3.0), n2i(f64::NEG_INFINITY, 2.0)),
n2i(f64::NEG_INFINITY, 2.0)
);
... | Rust | 0 |
Output = FieldElement2625;
fn mul(self, _rhs: &'b FieldElement2625) -> FieldElement2625 {
/// Helper function to multiply two 32-bit integers with 64 bits
/// of output.
#[inline(always)]
fn m(x: u32, y: u32) -> u64 { (x as u64) * (y as u64) }
// Alias self, _rhs for more r... | Rust | 0 |
from urllib.parse import urlparse
def extract_domain_name(url):
"""Extracts the domain name from a given URL, without subdomains or TLDs."""
parsed_url = urlparse(url)
domain = parsed_url.netloc
# Remove 'www.' if present
if domain.startswith('www.'):
domain = domain[4:]
# Split by '... | Python | 1 |
transparency_pixel: None,
palette: None,
})
}
// Autogenerated from KST: please remove this line if doing any edits by hand!
extern crate kaitai_struct;
extern crate rust;
use kaitai_struct::KaitaiStruct;
use rust::EnumIntRangeU;
#[test]
fn test_enum_int_range_u() {
if let Ok(r) = EnumIntRan... | Rust | 0 |
_current_active_user),
editor_service: ScriptEditorService = get_script_editor_svc_depends()
) -> APIResponse[Dict[str, Any]]:
"""验证剧本完整性"""
try:
# 检查剧本权限
script = editor_service.script_repository.get_script_by_id(script_id)
if not script:
raise HTTPException(status_code=... | Python | 1 |
onst VkPhysicalDeviceExternalFenceInfo,
pExternalFenceProperties: *mut VkExternalFenceProperties,
)
;
pub type PFN_vkGetPhysicalDeviceExternalSemaphoreProperties =
unsafe extern "C" fn(
physicalDevice: VkPhysicalDevice,
pExternalSemaphoreInfo: *const VkPhysicalDeviceExternalSemaphoreInf... | Rust | 0 |
{
Option::<_>::from_glib_full(gst_sys::gst_date_time_new_from_iso8601_string(
string.to_glib_none().0,
))
.ok_or_else(|| glib_bool_error!("Failed to create DateTime from ISO-8601 string"))
}
}
pub fn from_unix_epoch_local_time(secs: i64) -> DateTime ... | Rust | 0 |
invocations
// - after that it assumes the widget is no longer drawn.
kbgp.common.nodes.retain(|_, data| data.seen_this_frame);
for node_data in kbgp.common.nodes.values_mut() {
node_data.seen_this_frame = false;
}
let Kbgp { common, state } = &mut *kbgp;
match state {
KbgpState:... | Rust | 0 |
.as_mut_slice(), &[2, 3]);
iter.next_back();
assert_eq!(iter.as_slice(), &[2]);
assert_eq!(iter.as_mut_slice(), &[2]);
}
#[test]
fn test_into_iter_clone() {
// Test that the cloned iterator yields identical elements and that it owns its own copy
// (i.e. no use after... | Rust | 0 |
.t, self.precision);
let e=gauss_pol(self.n, self.q,self.mu,self.sigma,self.t, self.precision);
Key{sk:sk.clone(),pk:(a.clone(),&(&a*&sk)+&e)}
}
}
/// Definition of the trait Encryption. It generates a ciphertext given a plaintext message m and a pk.
pub trait Encryption<T,U> {
fn encryption(&se... | Rust | 0 |
import data_utils
def _get_feed_dict_for_others(model, x_batch, y_batch, x_lens, use_pos=True, use_ner=False, use_deprel=True):
feed = {model.word_inputs:x_batch[data_utils.WORD_FIELD], model.labels:y_batch, model.seq_lens:x_lens}
if use_pos:
feed[model.pos_inputs] = x_batch[data_utils.POS_FIELD]
i... | Python | 1 |
from collections import defaultdict, deque
import csv
import networkx as nx
import argparse
import copy as cp
import matplotlib.pyplot as plt
import networkit as nk
def read_group(group_file):
ctgs_set = set()
with open(group_file, 'r') as file:
for line in file:
if line.startswith('u'):
... | Python | 1 |
et.is_none() && ethereum_valset.nonce == 0 {
// bootstrapping case
return;
} else if cosmos_valset.is_none() {
error!("Cosmos does not have a valset for nonce {} but that is the one on the Ethereum chain! Possible bridge highjacking!", ethereum_valset.nonce);
return;
}
let co... | Rust | 0 |
), "0n");
assert_eq!(
forward(&mut context, "BigInt.asIntN(2, -123456789012345678901n)"),
"-1n"
);
assert_eq!(
forward(&mut context, "BigInt.asIntN(2, -123456789012345678900n)"),
"0n"
);
assert_eq!(
forward(&mut context, "BigInt.asIntN(2, 1234567890123456789... | Rust | 0 |
ic__hdr__t),
"::",
stringify!(iop_tag)
)
);
}
pub const ic_status_t_IC_MSG_OK: ic_status_t = 0;
pub const ic_status_t_IC_MSG_EXN: ic_status_t = 1;
pub const ic_status_t_IC_MSG_RETRY: ic_status_t = 2;
pub const ic_status_t_IC_MSG_ABORT: ic_status_t = 3;
pub const ic_status_t_IC_MSG_IN... | Rust | 0 |
mallHeadImgUrl
except Exception as e:
logger.error(e)
return ''
def get_video_poster(self, md5: str) -> str | None:
pass
def get_video(self, md5: str) -> str | None:
pass
def get_member_head(self, username: str) -> bytearray | None:
sm = self.client.get... | Python | 1 |
pe) / (1 - pe) if (1 - pe) != 0 else 0.0
return kappa, po, pe, contingency
# ask user for the number of decimal places for rounding (can be negative)
round_decimals, ok = QInputDialog.getInt(
None, "Rounding", "Enter the number of decimal places for rounding (can be negative)", value=3, minVa... | Python | 1 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: defs/defines.proto
"""Generated protocol buffer code."""
from google.protobuf.internal import enum_type_wrapper
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_po... | Python | 1 |
VT_HARDWARE_STATUS, false)?
.visit_field::<flatbuffers::ForwardsUOffset<flatbuffers::Vector<'_, flatbuffers::ForwardsUOffset<super::tracker::TrackerData>>>>("trackers", Self::VT_TRACKERS, false)?
.finish();
Ok(())
}
}
pub struct DeviceDataArgs<'a> {
pub id: Option<&'a super::super::datatypes::Device... | Rust | 0 |
0000000;
pub const TAB1: u32 = 0o0004000;
pub const TAB2: u32 = 0o0010000;
pub const TAB3: u32 = 0o0014000;
pub const XTABS: u32 = 0o0014000;
pub const BSDLY: u32 = 0o0020000;
pub const BS0: u32 = 0o0000000;
pub const BS1: u32 = 0o0020000;
pub const VTDLY: u32 = 0o0040000;
pub const ... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from vtkmodules.vtkFiltersSources import vtkSphereSource
from vtkmodules.vtkInteractionWidgets import vtkTextWidget
from vtkmodules.vtkRenderingCore import (
vtkActor,
vtkPolyDataMapper,
vtkRenderWindow,
vtkRenderWindowInteractor,
vtkRenderer,
)
impor... | Python | 1 |
phas = [10, 100, 1e3, 1e4, 1e5, 1e6]
pipeline = make_pipeline(
preprocessor,
# last n_confounds columns in X will be used as confounds.
ConfoundRemover(n_confounds=n_cnfds),
RidgeCV(
alphas=alphas, store_cv_values=True,
scoring="neg... | Python | 1 |
"retrieval_config"],
)
tools.append(dataset_retrieval)
# 11.检测是否关联工作流,如果关联了工作流则将工作流构建成工具添加到tools中
if app_config["workflows"]:
workflow_tools = self.app_config_service.get_langchain_tools_by_workflow_ids(
[workflow["id"] for workflow in app_config["wor... | Python | 1 |
N = int(input())
side = input().split(' ')
height = input().split(' ')
Side = []
Height = []
for i in range(N+1):
Side.append(int(side[i]))
for i in range(N):
Height.append(int(height[i]))
area = 0
for i in range(N):
area += (Side[i] + Side[i+1]) * Height[i] / 2
print(area)
| Python | 1 |
/// for more info.
pub struct GdnLayer {
beta: Array1<WeightPrecision>,
gamma: Array2<WeightPrecision>,
}
impl GdnLayer {
pub fn new(beta: Array1<WeightPrecision>, gamma: Array2<WeightPrecision>) -> Self {
Self { beta, gamma }
}
/// Performs GDN on the input with the layer parameters.
... | Rust | 0 |
r + '.300d.npy'
wiki_path = join(data_wiki_path, 'wikipedia/')
wiki_samples_articles = join(wiki_path, 'sample_articles.txt')
mcr_path = join(data_mcr_path, 'mcr_data/')
alice_path = join(data_alice_path, 'alice_data/')
stanford_path = join(data_path, 'stanford-postagger-2017-06-09/')
stanford_ner_path = join(data_pat... | Python | 1 |
from fastapi import HTTPException, status
class MemeHTTTPException(HTTPException):
status_code = 500
detail = ""
def __init__(self):
super().__init__(status_code=self.status_code, detail=self.detail)
class AddingMemeMetadataHTTTPException(MemeHTTTPException):
detail = "Ошибка добавления мет... | Python | 1 |
from pathlib import Path
from .base import BaseSetting
BASE_DIR = Path(__file__).parent.parent
class DBSettings(BaseSetting):
POSTGRES_HOST: str
POSTGRES_PORT: int
POSTGRES_DB: str
POSTGRES_USER: str
POSTGRES_PASSWORD: str
db_settings = DBSettings()
| Python | 1 |
map.insert("nonce".into(), nonce.to_string());
map.insert("realm".into(), realm.clone());
map.insert("uri".into(), format!("{}", ctx.uri));
map.insert("qop".into(), self.1.get("qop").unwrap().clone());
map.insert("algorithm".into(), "SHA-512-256".into());
map.insert("cno... | Rust | 0 |
}
Reinterpret(OperandCategory::SrcDestRegOrDeref) => {
// these instructions can read two disp8/disp16, so the first one can be handled
// normally, but the second will need some fixing up...
let operands = words.next()?;
inst.length += 1;
inst... | Rust | 0 |
1].
let lambda: T;
if (c_eigs[0] - *c.get_unchecked([1, 1])).abs() <
(c_eigs[1] - *c.get_unchecked([1, 1])).abs() {
lambda = c_eigs[0];
} else {
lambda = c_eigs[1];
}
let b_pp = *b.get_unchecked([p, p]);
let mut alpha = (b_pp * b_pp) - ... | Rust | 0 |
f.bin_name} exists")
return
if self.is_processing():
logging.info(f"{self.file_path} installing")
return
self.clear_package()
self.download_package()
self.unpack_install()
self.clear_package()
if __name__ == "__main__":
UvInstaller = Mcp... | Python | 1 |
EEFY.
pub signed_commitment_stream: BeefySignedCommitmentStream<BT, BeefySignature>,
/// Executor to drive the subscription manager in the BEEFY RPC handler.
pub subscription_executor: SubscriptionTaskExecutor,
}
/// Full client dependencies.
pub struct FullDeps<C, P, SC, B, BT: BlockT> {
/// The client instance t... | Rust | 0 |
ssociated array to `allocations`
/// which indicates which allocations were changed (if any).
///
/// Possible error values:
///
/// - `ash::vk::Result::INCOMPLETE` if succeeded but didn't make all possible optimizations because limits specified in
/// `defrag_info` have been reached, negative... | Rust | 0 |
Nonblocking<S>
where
S: SharedSchema,
{
Nonblocking { schema }
}
#[allow(missing_docs)]
#[derive(Debug)]
pub struct Nonblocking<S> {
schema: S,
}
impl<'a, S> IntoEndpoint<'a> for Nonblocking<S>
where
S: SharedSchema<Context = ()>,
{
type Output = (GraphQLResponse,);
type Endpoint = Nonblockin... | Rust | 0 |
:new(T::try_from_type(type_id, &*data)?))
}),
}
}
}
impl<T> Unmarshaller<T>
where
T: TypedEnum,
{
pub fn new(
known_types: BTreeMap<u16, UnmarshallFn<Error>>,
encoding: EncodingType,
) -> Self {
Self {
known_types: known_types
.int... | Rust | 0 |
"class": "logging.StreamHandler",
"formatter": "log-format",
},
"file": {
"level": "INFO",
"class": "logging.FileHandler",
"filename": os.path.join(LOGS_DIRECTORY, "django.log"),
"formatter": "log-format",
},
"access-f... | Python | 1 |
#!/usr/bin/python
"""
Extract SetId, Id, NDC from fields in SPL
TODO(mattmo): Logging to a file when fields are not present.
"""
from lxml import etree
from io import BytesIO
import re
# http://www.fda.gov/ForIndustry/DataStandards/StructuredProductLabeling/ucm162061.htm
DUNS_OID = '1.3.6.1.4.1.519.1'
NDC_OID = '2.... | Python | 1 |
from django.db import models
from django.db.models import Avg, F
# Create your models here.
class Vendor(models.Model):
name = models.CharField(max_length=255)
contact_details = models.TextField()
address = models.TextField()
vendor_code = models.CharField(max_length=50, unique=True)
on_time_delive... | Python | 1 |
dEmulsionNk(self, Mass, KE):
KEM = KE / Mass
LKEM = np.log10(KEM)
if KEM < 0.0001:
return 479.210 * pow(KEM, 0.675899)
else:
Rs = 6.05595
Rs += 1.38639 * LKEM
Rs += -0.302838 * LKEM**2
Rs += -0.0602134 * LKEM**3
Rs ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.