text string | label_name string | labels int64 |
|---|---|---|
pl<A, E> SectionHeaderParser<A, E>
where
A: AddressWidth,
E: DataEncoding,
{
pub fn new() -> Self {
Self::default()
}
}
impl<A, E> Default for SectionHeaderParser<A, E>
where
A: AddressWidth,
E: DataEncoding,
{
fn default() -> Self {
Self {
address_width: std::ma... | Rust | 0 |
Multiply => (1, 19),
NumSubtract => (1, 20),
Tab => (2, 0),
Q => (2, 1),
W => (2, 2),
E => (2, 3),
R => (2, 4),
T => (2, 5),
Y => (2, 6),
U => (2, 7),
I => (2, 8),
O => (2, 9),
... | Rust | 0 |
ImplDetail for SuicideDetail {
fn platform() -> &'static str { "amdgpu" }
fn kernel_instance() -> Option<KernelInstanceRef<'static>> {
#[inline(always)]
fn kill() -> ! {
// the real intrinsic needs a single argument.
amdgcn_kill(false);
}
Some(kill.kernel_... | Rust | 0 |
どれだけ、テクスチャを移動させれば良いのかを返す
///
fn fix_collision_bottom(
&mut self,
ctx: &mut ggez::Context,
info: &CollisionInformation,
_: Clock,
) -> f32 {
let area = self.get_collision_size(ctx);
info.object1_position.unwrap().y - (info.object2_position.unwrap().y + area.y)... | Rust | 0 |
ormfiss, 10000)
fissnorm = geompy.MakeMirrorByPlane(normfiss, plansim)
grps = [ grp for grp in groups if grp.GetName() == 'FACE2']
_ = maillageComplet.Reorient2D( grps[0], fissnorm, grps[0].GetID(1))
_ = maillageComplet.GetMesh().CreateDimGroup( grps, SMESH.NODE, 'FACE2' )
logging.info("export maillage fini"... | Python | 1 |
exist("a9292zw"));
assert!(!exist("mcd"));
}
// Copyright 2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use crate::address::Address;
use derive_more::From;
/// Identifies the validated issuer of an output.
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, From, packable::Packable)]
#[cfg_attr(feature =... | Rust | 0 |
as unsafe extern "C" fn(_: *const libc::c_void, _: *mut libc::c_void, _: OPJ_UINT32) -> (),
),
];
static mut j2k_memory_marker_handler_tab: [opj_dec_memory_marker_handler_t; 23] = [
{
let mut init = opj_dec_memory_marker_handler {
id: 0xff90 as libc::c_int as OPJ_UINT32,
states: (J2K_STATE_MH as... | Rust | 0 |
e, expectedID):
"""This function builds a method that runs the CanonicalID
test for the given set of inputs"""
filename = datapath(filename)
def test(self):
xrds = etxrd.parseXRDS(file(filename).read())
self._getCanonicalID(iname, xrds, expectedID)
return... | Python | 1 |
// }
pub fn get_symbol(&self) -> &'static str {
"ContractParam:" + ContractParam[&self.param_type]
}
pub fn export(&self) -> &self {
// ContractParam { param_type: self.param_type.clone(), value: Some(self.value.clone()) })
&self
}
pub fn equal<T>(&self, other: &Cont... | Rust | 0 |
SUCCESSFUL_FUTURE]),
finished)
self.assertEqual(set([future]), pending)
class ThreadPoolWaitTests(ThreadPoolMixin, WaitTests, BaseTestCase):
def test_pending_calls_race(self):
# Issue #14406: multi-threaded race condition when waiting on all
# ... | Python | 1 |
\"type\": \"invalid-challenge-01\",
\"status\": \"pending\",
\"url\": \"https://example.com/chall/jYWxob3N0OjE\",
\"token\": \"<KEY>
}
]
}";
let a = Authorization::from_str(data);
assert!(a.is_ok());
let a = a.unwrap();
assert_eq!(a.... | Rust | 0 |
"""Tests for cardinality constraints in Bayesian Consistency Networks."""
import pytest
from bcn import BayesianConsistencyNetwork
def test_cardinality_k1_lowers_sum():
"""k=1 constraint should push sum of beliefs below ~1.3."""
print("\n=== Test: Cardinality k=1 ===")
bcn = BayesianConsistencyNetwork(... | Python | 1 |
return False
def show_usage():
print("Usage: python reconstruct_mosaic.py <tiles_directory> [tiles_mapping_file]")
print(" tiles_directory: Directory containing the original tile images")
print(" tiles_mapping_file: Path to tiles.txt file (default: tiles.txt)")
print("")
print("This program rec... | Python | 1 |
610,
),
(
vec![
"R98,U47,R26,D63,R33,U87,L62,D20,R33,U53,R51",
"U98,R91,D20,R16,D67,R40,U7,R15,U6,R7",
],
410,
),
];
for case in cases {
assert_eq!(par... | Rust | 0 |
(tmdb_parser.vote_average)
if tmdb_parser.genre_ids:
genre = ET.SubElement(root, "genre")
genre_item = ET.SubElement(genre, "item")
genre_item.text = tmdb_parser.get_genres_str()
media_dir = self.fs_manager.get_dest_dir(target_dir, self.CAT_NAME_TV, self.CAT_NAME_MO... | Python | 1 |
cudaHostRegisterDefault: u32 = 0;
pub const cudaHostRegisterPortable: u32 = 1;
pub const cudaHostRegisterMapped: u32 = 2;
pub const cudaHostRegisterIoMemory: u32 = 4;
pub const cudaPeerAccessDefault: u32 = 0;
pub const cudaStreamDefault: u32 = 0;
pub const cudaStreamNonBlocking: u32 = 1;
pub const cudaEventDefault: u3... | Rust | 0 |
nteger, unique=True, primary_key=True)
unique_id = db.Column(db.String(36), nullable=False, unique=True, default=set_uuid)
input_id = db.Column(db.String(36), default=None)
channel = db.Column(db.Integer, default=None)
name = db.Column(db.Text, default='')
custom_options = db.Column(db.Text().with_... | Python | 1 |
::new(IA32_X2APIC_TMR0),
tmr1: MSR::new(IA32_X2APIC_TMR1),
tmr2: MSR::new(IA32_X2APIC_TMR2),
tmr3: MSR::new(IA32_X2APIC_TMR3),
tmr4: MSR::new(IA32_X2APIC_TMR4),
tmr5: MSR::new(IA32_X2APIC_TMR5),
tmr6: MSR::new(IA32_X2APIC_TMR6),
tmr7: M... | Rust | 0 |
em_1, x_cell_0)
x_cell_2 = self.cell_2(x_cell_0, x_cell_1)
x_cell_3 = self.cell_3(x_cell_1, x_cell_2)
x_cell_4 = self.cell_4(x_cell_2, x_cell_3)
x_cell_5 = self.cell_5(x_cell_3, x_cell_4)
x_cell_6 = self.cell_6(x_cell_4, x_cell_5)
x_cell_7 = self.cell_7(x_cell_5, x_cell_6... | Python | 1 |
import numpy as np
# Calculates the position of the minimum
def kpath_position(kpoints, energies, kpoint_value, kpoint_name):
max_index = np.where(energies == max(energies))[0]
min_index = np.where(energies == min(energies))[0]
if len(max_index) >= 1:
max_index = max_index[0]
if len(min_index... | Python | 1 |
cc.d2cfgr.modify(|_, w| unsafe {
w.d2ppre1() // D2 contains APB1
.bits(ppre1_bits)
.d2ppre2() // D2 also contains APB2
.bits(ppre2_bits)
});
// APB4 Prescaler
rcc.d3cfgr.modify(|_, w| unsafe {
w.d3ppre() // D3 contains APB4... | Rust | 0 |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
import sys
from jupyterlab_server.workspaces_app import (
WorkspaceExportApp,
WorkspaceImportApp,
WorkspaceListApp,
)
def test_workspace_apps(jp_environ, tmp_path):
sys.argv = [... | Python | 1 |
] = np.column_stack([f0, f1])
out["G"] = self.constraints(X, f0, f1, g)
class DASCMOP7(DASCMOP):
def __init__(self, difficulty_factors, **kwargs):
super().__init__(3, 7, difficulty_factors)
def constraints(self, X, f0, f1, f2, g):
a = 20.
b = 2. * self.eta - 1.
d = 0.... | Python | 1 |
t.record_local_for(futex_ptr, &val);
}
fn mask_low_bit<T>(p: RemotePtr<T>) -> RemotePtr<T> {
RemotePtr::from(p.as_usize() & !1usize)
}
/// "Thaw" a frozen interrupted syscall if `t` is restarting it.
/// Return true if a syscall is indeed restarted.
///
/// A postcondition of this function is that `t.ev()` i... | Rust | 0 |
, '')}'")
# 输出消息来源和原文信息
logger.info("=" * 80)
logger.info(f"📨 消息来源: {source.upper()}")
logger.info(f"🆔 消息ID: {message_id}")
if source == 'telegram':
logger.info(f"👤 用户: {username}")
if chat_title:
... | Python | 1 |
inp_nsecs /= 60;
let mins = inp_nsecs % 60;
inp_nsecs /= 60;
let hours = inp_nsecs % 24;
inp_nsecs /= 24;
let days = inp_nsecs % 7;
inp_nsecs /= 7;
let weeks = inp_nsecs;
if weeks > 0 {
self.writ... | Rust | 0 |
uct BindImageMemoryInfo {
pub sType : StructureType,
pub pNext : *const void,
pub image : Image,
pub memory : DeviceMemory,
pub memoryOffset : DeviceSize,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct PhysicalDevice16BitStorageFeatures {
pub sType : StructureType,
pub pNext : *mut void,
pub storageBuff... | Rust | 0 |
import numpy as np
from easy_tpp.utils.const import PredOutputIndex
from easy_tpp.utils.metrics import MetricsHelper
@MetricsHelper.register(name='rmse', direction=MetricsHelper.MINIMIZE, overwrite=False)
def rmse_metric_function(predictions, labels, **kwargs):
"""Compute rmse metrics of the time predictions.
... | Python | 1 |
(&ffi::def_log_source as *const _ as *mut _) };
#[no_mangle]
pub unsafe extern "C" fn mrcp_plugin_logger_set(logger: *mut ffi::apt_logger_t) -> ffi::apt_bool_t {
ffi::apt_log_instance_set(logger);
ffi::TRUE
}
#[no_mangle]
pub unsafe extern "C" fn mrcp_plugin_log_source_set(orig_log_source: *mut ffi::apt_log_s... | Rust | 0 |
example!(v, check_moment!(c, [2013, 8, 12]), "말복");
example!(v, check_moment!(c, [2013, 10, 31]), "핼러윈", "핼러윈데이");
example!(v, check_moment!(c, [2013, 10, 1]), "국군의날");
example!(v, check_moment!(c, [2013, 10, 2]), "노인의날");
example!(v, check_moment!(c, [2013, 10, 25]), "독도의 날");
}
pub fn examples_n... | Rust | 0 |
"""More iterations"""
import numpy as np
import numpy.random as npr
import matplotlib.pyplot as plt
import pickle
from functools import partial
import itertools as it
from hypergrad.data import load_data
from hypergrad.nn_utils import make_nn_funs, BatchList
from hypergrad.optimizers import sgd
layer_sizes = [784, 2... | Python | 1 |
oined_or_invited_or_knocked_users, newly_left_users
@attr.s(slots=True, auto_attribs=True)
class RoomSyncResultBuilder:
"""Stores information needed to create either a `JoinedSyncResult` or
`ArchivedSyncResult`.
Attributes:
room_id
rtype: One of `"joined"` or `"archived"`
events: ... | Python | 1 |
self.as_str() == other.as_str()
}
}
impl Eq for regex_Regex {}
impl Hash for regex_Regex {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.as_str().hash(state);
}
}
impl Serialize for regex_Regex {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
... | Rust | 0 |
Ok(hash)
} else {
Err(Error::WrongLength)
}
}
}
impl Deref for Hash {
type Target = Trits<T1B1>;
fn deref(&self) -> &Trits<T1B1> {
<&Trits>::from(&self.0 as &[_])
}
}
impl DerefMut for Hash {
fn deref_mut(&mut self) -> &mut Trits<T1B1> {
<&mut Trits>::f... | Rust | 0 |
def set_single_unique_affinity(gpu_id, nproc_per_node):
devices = [device(i) for i in range(nproc_per_node)]
socket_affinities = [dev.getCpuAffinity() for dev in devices]
siblings_list = get_thread_siblings_list()
siblings_dict = dict(siblings_list)
for idx, socket_affinity in enumerate(socket_affin... | Python | 1 |
from httpx import AsyncClient
import ormsgpack
from nonebot.log import logger
from .config import config
from .exception import (
APIException,
HTTPException,
AuthorizationException,
)
from .request_params import ChunkLength, ServeTTSRequest
class FishAudioAPI:
"""
FishAudioAPI类, 用于调用FishAudio的AP... | Python | 1 |
r3t_max, r3t_max_dim = label_red3t[index_t].max(dim=1)
dimt = (r3_max_dim == label.to(device)).sum() # 预测均值等于真实标签的概率
r3_mix = label_red3_one * (r3_max >= r3_max.mean()).unsqueeze(1).repeat(1, clas).type(torch.float) + \
label_red3[... | Python | 1 |
import abc
import six
import os
import time
import torch
from simseg.utils.collections import AttrDict
from simseg.core import (
Hook,
HookMode,
get_priority,
get_hook_mode
)
from simseg.utils import is_list_of, logger, ENV
__all__ = ['BaseRunner']
@six.add_metaclass(abc.ABCMeta)
class BaseRunner:
... | Python | 1 |
|| hash_vss_certs(&vss_certs) != h2
{
return Err(Error::WrongMpcProof);
}
},
_ => return Err(Error::WrongMpcProof)
};
},
SscProof::Shares(h1, h2) => {
... | Rust | 0 |
obal_rank}.pt"
if checkpoint_file.is_file():
state_dict = torch.load(str(checkpoint_file))
self.load_state_dict(state_dict)
# if the context checkpoint does not exist, new global ranks are in play
# in this case iterations and consumed samples need to be synced
i... | Python | 1 |
# 442. Find All Duplicates in an Array
# Given an integer array nums of length n where all the integers of nums are in the range [1, n] and each integer appears at most twice, return an array of all the integers that appears twice.
# You must write an algorithm that runs in O(n) time and uses only constant auxiliary s... | Python | 1 |
work>NUMBER_OF_WORK:
work=NUMBER_OF_WORK
# Check if work has changed
global previous_work
if previous_work is None or work != previous_work:
print(work,NUMBER_OF_WORK)
automatic_work_function(work,NUMBER_OF_WORK,batch_size_saved)
... | Python | 1 |
ditionTrue(Label.L1, input_condition=AND_1)
AND_2.Add(FlagEnabled(flag_2))
AND_2.Add(FlagEnabled(flag_3))
GotoIfConditionTrue(Label.L2, input_condition=AND_2)
End()
# --- Label 0 --- #
DefineLabel(0)
AND_2.Add(AttackedWithDamageType(attacked_entity=attacked_entity, attacker=attacker))
... | Python | 1 |
p+1_f64;
const log2_e: c_double = 0x1.71547652b82fep+0_f64;
const log10_e: c_double = 0x1.bcb7b1526e50ep-2_f64;
const ln_2: c_double = 0x1.62e42fefa39efp-1_f64;
const ln_10: c_double = 0x1.26bb1bbb55516p+1_f64;
const sqrt2: c_double = 0x1.6a09e667f3bcdp+0_f64;
const div_1_sqrt2: c_double = 0x1.6... | Rust | 0 |
import pytest
from plugin import PluginManager
from plux import PluginDisabled
from tests.plugins import sample_plugins
def test_load_functional_plugins(sample_plugin_finder):
manager = PluginManager("namespace_3", finder=sample_plugin_finder)
plugins = manager.load_all()
assert len(plugins) == 2
a... | Python | 1 |
han Client.timeout.
Returns:
Response[Union[HTTPValidationError, ResponseModel]]
"""
kwargs = _get_kwargs(
webcast_id=webcast_id,
)
response = await client.get_async_httpx_client().request(**kwargs)
return _build_response(client=client, response=response)
async def asyncio(... | Python | 1 |
n_samples, z, sos=None):
# generate random z
batch_size = 1
sentences_length = torch.tensor([1])
idx_sample = []
if sos is None:
x = torch.zeros(1,1,self.vocab_size).to(self.device)
x[:,:,30] = 1
hidden_decoder = self.init_hidden_decoder(z)
hidden_decoder = (hidden_decoder,... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
from mmseg.models import FPN
def test_fpn():
in_channels = [64, 128, 256, 512]
inputs = [
torch.randn(1, c, 56 // 2**i, 56 // 2**i)
for i, c in enumerate(in_channels)
]
fpn = FPN(in_channels, 64, len(in_channels))
outpu... | Python | 1 |
image_bytes = byte_stream.getvalue()
mem_stream = winsdk.windows.storage.streams.InMemoryRandomAccessStream()
writer = winsdk.windows.storage.streams.DataWriter(mem_stream)
writer.write_bytes(image_bytes)
writer.store_async()
mem_st... | Python | 1 |
lename))
return msg
def send(mail, server='localhost'):
"""
Sends the given mail.
:type mail: Mail
:param mail: The mail object.
:type server: string
:param server: The address of the mailserver.
"""
sender = mail.get_sender()
rcpt = mail.get_recipients()
session = smtpl... | Python | 1 |
se {
(vec![], vec![])
};
uids.append(&mut uid);
let u = match cache_pool.get_users(uids).await {
Ok(u) => u,
Err(e) => {
if let ResError::IdsFromCache(uids) = e {
should_update_u = true;
db_pool.get_users(&uids).await?
} else ... | Rust | 0 |
#!/usr/bin/env python3
Node = __import__('2-build_decision_tree').Node
Leaf = __import__('4-build_decision_tree').Leaf
Decision_Tree = __import__('4-build_decision_tree').Decision_Tree
def example_0():
leaf0 = Leaf(0, depth=1)
leaf1 = Leaf(0, depth=2)
leaf2 = Leaf(1, depth=2)
internal_node = Node(feat... | Python | 1 |
int(color_palette[9+3*i] * 255)))
# vis_image = vu.init_multi_vis_image(category_to_id[goal_name], color)
vis_image = vu.init_multi_vis_image(object_category[goal_name], color)
vis_image[50:530, 15:495] = sem_map_vis
color_black = (0,0,0)
pattern = r'<centroid: (.*?), (.*?), number: (.*?)>'... | Python | 1 |
well("A3")],
# reuse=True,
# )
# protocol.comment(f"{example_4} 🔼🔼🔼🔼🔼🔼🔼")
# example_5 = "Distribute mix=true, During mixing, all aspirates on repetitions > 1 LPD with wet tip"
# protocol.comment(f"{example_5} 🔽🔽🔽🔽🔽🔽🔽")
# pipette.distribute(
# volume=total_volume,
#... | Python | 1 |
from ... import options as opts
from ... import types
from ...charts.chart import Chart
from ...globals import ChartType
class Sunburst(Chart):
def set_sunburst_spec(
self,
category_field: types.Optional[str] = None,
value_field: types.Optional[str] = None,
center_x: types.Optional... | Python | 1 |
from dataclasses import dataclass
__all__ = ["LanguagePreference"]
@dataclass(frozen=True)
class LanguagePreference:
"""
Represents a language and its weight from the `Accept-Language` header.
:param language: The language code (e.g., "en-US", "fr").
:param weight: The weight (priority) of the lang... | Python | 1 |
import tensorflow as tf
import numpy as np
inputs = tf.keras.Input(shape=(28, 28))
x = tf.keras.layers.Flatten()(inputs)
x1 = tf.keras.layers.Dense(128, activation='relu')(x)
x2 = tf.keras.layers.Dense(128, activation='relu')(x1)
outputs = tf.keras.layers.Dense(10, activation='softmax')(x2)
activation_model = tf.ker... | Python | 1 |
/ let Reverse(tmp) = pq.pop().unwrap();
// // println!("{} {}", tmp, n);
// max[tmp as usize] = n;
// }
// pq.push(Reverse(n));
// }
// let mut ans = vec![];
// for &n in nums1.iter() {
// ans.push(max[n as usize]);
... | Rust | 0 |
fn test_rposition() {
let b: &IndexSlice<IdxSz, [i32]> = IndexSlice::new(&[1, 2, 3, 5, 5]);
assert_eq!(b.rposition(|&v| v == 9), None);
assert_eq!(b.rposition(|&v| v == 5), Some(IdxSz::from_raw(4)));
assert_eq!(b.rposition(|&v| v == 3), Some(IdxSz::from_raw(2)));
assert_eq!(b.rposition(|&v| v == 0)... | Rust | 0 |
#!/usr/bin/python3
import sys
lazy_paginator = __import__('2-lazy_paginate').lazy_paginate
try:
for page in lazy_paginator(100):
for user in page:
print(dict(user))
except BrokenPipeError:
sys.stderr.close()
| Python | 1 |
7831.2e34lp.1.1596163007831.1596163007831.1.4; _bfs=1.4; hotelhst=2012709687; _bfi=p1%3D102002%26p2%3D102002%26v1%3D4%26v2%3D2; _jzqco=%7C%7C%7C%7C%7C1.2138894140.1596163010271.1596163010271.1596163280878.1596163010271.1596163280878.0.0.0.2.2; __zpspc=9.1.1596163010.1596163280.2%234%7C%7C%7C%7C%7C%23; _gat=1; appFloatC... | Python | 1 |
4\x0e\xff\xc1\xc0\xbf";
instructions = [
LiteralHeader {
mode: IncrementalIndexing,
name: LiteralHeaderName::Index(unsafe { Index::new(8) }),
value: b"307".to_tendril(),
},
IndexedHeader {
index: unsafe { Index::new(65) },
},
In... | Rust | 0 |
s of `reusable-fmt`
// SPDX-License-Identifier: WTFPL
#![cfg_attr(not(feature = "std"), no_std)]
//! This crate provides compile-time defined format strings support for
//! [`std::fmt`] macros.
//!
//! # Example
//!
//! ```
//! use reusable_fmt::*;
//!
//! // This defines your format strings
//! fmt_reuse! {
//! ... | Rust | 0 |
ontinue;
}
addrs.push(addr);
}
addrs
}
}
#[test]
fn test_handshake() {
let rng = fastrand::Rng::new();
let network = Network::Mainnet;
let mut peer = Peer::genesis("alice", [48, 48, 48, 48], network, vec![], rng);
let outbound = ([241, 19, 44, 19], 8333).into... | Rust | 0 |
run(([0, 0, 0, 0], 8080)).await;
Ok(())
}
#![allow(mixed_script_confusables)]
use nannou::prelude::*;
mod circ_harmonics;
mod spherical_harmonics;
use circ_harmonics::*;
use spherical_harmonics::SphericalHarmonics;
use std::f32::consts::PI;
const TWOPI: f32 = PI * 2.0;
// ----------------------------------------... | Rust | 0 |
enum Level {
High(u16),
Low(u16),
}
/// Construct the leader
const fn leader(toggle: bool, rc6len: u16) -> [Level; 12] {
use Level::*;
[
// Leader
High(6 * rc6len),
Low(2 * rc6len),
// Start bit after leading pause. Always one
High(rc6len),
Low(rc6len),
... | Rust | 0 |
MASTEMA = 2151009
sm.setSpeakerID(MASTEMA)
if sm.sendAskYesNo("#h #. Have you fulfilled your mission?"):
sm.flipDialoguePlayerAsSpeaker()
sm.sendNext("#p2151009#, I wanted to talk to you...")
sm.setSpeakerID(MASTEMA)
sm.sendSay("(Eh?! #h # wanted to talk to me!?) Ah, yes? About what?")
sm.flipDia... | Python | 1 |
t2 = _mm_load_si128(ap(i + 3 * NLANES)); // [a12,..,a15]
let next3 = _mm_load_si128(ap(i + 4 * NLANES)); // [a16,..a19]
let compare0 = _mm_alignr_epi8(next0, current, EWIDTH); // [a1,..,a4]
let compare1 = _mm_alignr_epi8(next1, next0, EWIDTH); // [a5,..,a8]
... | Rust | 0 |
from pyspark.sql import SparkSession
from pyspark.sql.functions import col, to_timestamp, when
# Initialiser SparkSession
spark = SparkSession.builder.appName("NettoyageDonneesSismiques").getOrCreate()
spark.sparkContext.setLogLevel("ERROR")
chemin_dataset_sismique = "hdfs://namenode:9000/user/hive/warehouse/seismic_d... | Python | 1 |
orch.int64)
assert query_label.shape == (batch_dim, n_usamples)
# ----Transform support sets and query sets with Tukey's Ladder of Power transformation ----# 对支持集和查询集的特征数据进行 Tukey's Ladder of Power 转换,即对特征数据进行幂次操作。
support_data = torch.pow(support_data, dc_tukey_lambda)
... | Python | 1 |
Affects flags: N, H, C
#[inline(always)]
pub fn add_16(cpu: &mut Cpu, bus: &mut Bus, dest: &dyn AddressingMode<u16>, src: &dyn AddressingMode<u16>) {
let src_val = src.read(cpu, bus);
let dest_val = dest.read(cpu, bus);
dest.write(cpu, bus, dest_val.wrapping_add(src_val));
cpu.regs.set_carry(dest_val... | Rust | 0 |
se crate::errors::VMError;
use crate::transcript::TranscriptProtocol;
/// Creates an aggregated Schnorr private key for signing from
/// a single party's set of private keys.
/// Mirrors the MuSig multi-party aggregation scheme so that
/// aggregated pubkeys are consistent across both methods.
pub fn aggregated_privke... | Rust | 0 |
class Solution:
"""
@param n: an integer
@return: the number of solutions
"""
def threeSum2(self, n):
ans = 0
nums = []
for a in range(n + 1):
if a * a > n:
break
nums.append(a * a)
nums.append(a * a)
nums.appen... | Python | 1 |
< state_info.total_locked_amount
&& staker_info_1.locked_amount + staker_info_2.locked_amount + Uint128::from(10u128)
> state_info.total_locked_amount
);
// Increase the amount of the second lock
let token_info = mock_info(VOTING_TOKEN, &[]);
let increase_amou... | Rust | 0 |
"""
GTSAM Copyright 2010-2019, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
See LICENSE for the license information
Values unit tests.
Author: Frank Dellaert & Duy Nguyen Ta (Python)
"""
# pylint: disable=invalid-name, E1101, E0611
import unittest
import numpy as np
import gtsa... | Python | 1 |
import re
class PIP_GenderDynamicPrompt:
@classmethod
def INPUT_TYPES(cls):
return {
"required": {
"base_prompt": ("STRING", {
"multiline": True,
"default": "一个人喝咖啡"
}),
"male_prefix": ("STRING", {
... | Python | 1 |
///
/// _e.g._ `192.168.1.2`
fn logical_address(&self, interface: Option<&str>) -> Result<String, ReadoutError>;
/// This function should return the physical address, i.e. _MAC address_ of the
/// specified interface.
///
/// _e.g._ `52:9a:d2:d3:b5:fd`
fn physical_address(&self, interface:... | Rust | 0 |
S: IndexedInput<'a>,
E: std::error::Error + From<(S::Span, String)>,
{
assert!(exps.len() == prods.len(), "Expected exactly as much expressions as producers.");
let iexp = build_iregexp(exps);
let states = build_states(&iexp);
DFA::new(states, prods, chars, input)
}
use crate::dyn... | Rust | 0 |
self.right.left_index() {
index + 1
} else {
panic!("left should have a index")
};
self.right.set_right(data[0].clone(), index);
index
} else {
panic!("Tre... | Rust | 0 |
(fdv.v.len() * 12);
for frame in fdv.v.iter() {
let fdq: FrameDataQ<Complete> = FrameDataQ::from_framedata(frame);
let fdq = codec.encode(fdq);
let mut rmp = fdq.to_rmp();
buf.append(&mut rmp);
}
(filename.to_string(), buf)
}
<filename>src/translator/japanese.rs
use std::cmp:... | Rust | 0 |
SmallStdDev=1.0,
LargeStdDev=2.0):
upperband_Small, middleband_Small, lowerband_Small = \
talib.BBANDS(close,
timeperiod=timeperiod,
nbdevup=SmallStdDev,
nbdevdn=SmallStdDev,
matype=talib.MA_... | Python | 1 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/trace/v1/trace_service.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.... | Python | 1 |
if random.random() < opt['select_rate']:
cropped_num = obj.process(path, opt, usm_sharper)
start_index += cropped_num
print(start_index, path)
else:
print("SKIP")
print('All processes done.')
def main(args):
opt = {}
in... | Python | 1 |
from typing import Optional, Type
from langchain_core.callbacks import CallbackManagerForToolRun
from langchain_core.pydantic_v1 import BaseModel
from langchain_core.tools import BaseTool
from langchain_community.utilities.polygon import PolygonAPIWrapper
class Inputs(BaseModel):
"""Inputs for Polygon's Financi... | Python | 1 |
[cfg(target_endian = "big")]
static ENDIANNESS: Endianness = BigEndian;
#[cfg(target_endian = "little")]
static ENDIANNESS: Endianness = LittleEndian;
#[deriving(Eq, Clone, ToStr)]
enum Alignment {
Aligned,
Unaligned
}
#[deriving(Eq, Clone, ToStr)]
enum Endianness {
LittleEndian,
BigEndian
}
stati... | Rust | 0 |
: *mut *mut xcb_generic_error_t,
) -> *mut xcb_dri3_query_version_reply_t {
sym!(self, xcb_dri3_query_version_reply)(c, cookie, e)
}
/// Returns `true` iff the symbol `xcb_dri3_query_version_reply` could be loaded.
#[cfg(feature = "has_symbol")]
pub fn has_xcb_dri3_query_version_reply(&self... | Rust | 0 |
criptors(&self, writer: &mut DescriptorWriter) -> Result<()> {
self.inner.get_configuration_descriptors(writer)
}
fn get_bos_descriptors(&self, writer: &mut BosWriter) -> Result<()> {
self.inner.get_bos_descriptors(writer)
}
fn reset(&mut self) {
self.inner.reset();
sel... | Rust | 0 |
assert_eq!(format.destination_register, 4);
assert_eq!(format.immediate, 0);
}
#[test]
fn test_creation_mov() {
let format = ImmediateOp::from(0x2754);
assert_eq!(format.op, OpCodes::MOV);
assert_eq!(format.destination_register, 7);
assert_eq!(format.immediate, 84);
... | Rust | 0 |
> f.write_str("OR")?,
}
}
Ok(())
}
}
impl fmt::Display for Expression {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str(&self.original)
}
}
impl PartialEq for Expression {
fn eq(&self, o: &Self) -> bool {
// The expressions can be sem... | Rust | 0 |
_options.push(5);
}
if crate::util::bench_level() >= 2 {
rows_options.push(1);
}
let bencher_options: Vec<Box<dyn util::HashAggrBencher>> =
vec![Box::new(util::NormalBencher), Box::new(util::BatchBencher)];
for rows in &rows_options {
for bencher in &bencher_options {
... | Rust | 0 |
#!/bin/env python
import argparse
import csv
from xml.etree import ElementTree as ET
OFX_DECLARATION = [('OFXHEADER', 200),
('VERSION', 211),
('SECURITY', 'NONE'),
('OLDFILEUID', 'NONE'),
('NEWFILEUID', 'NONE')]
DEFAULT_CURRENCY = 'EUR'
... | Python | 1 |
friction = grav * nmanning_riv**2 / hydro_vtv.wdsrf_bsn[i]**(7.0 / 3.0) * abs(hydro_vtv.momen_riv[i])
hydro_vtv.momen_riv[i] = (hydro_vtv.momen_riv[i] - (sum_mflux_riv[i] - sum_zgrad_riv[i]) / catch_riverlakenetwork.riverarea[i] * dt_this) / \
(1 + friction * dt... | Python | 1 |
f2f => ff_cast(ff_res, ff_a64, env_dst),
_ => (),
};
let rd = flexfloat_get_bits(ff_res);
rd as u8
}
/// conversions from fp8 and fp8alt
pub unsafe fn ff_instruction_cvt_from_b(
rs1: u64,
op: FfOpCvt,
_fpmode_src: bool,
fpmode_dst: bool,
) -> i32 {
let ff_a8: *mut flexfloat_t =... | Rust | 0 |
end_y = int(round(end[1] - miny))
if start_x < 0 or start_y < 0 or end_x < 0 or end_y < 0:
msg = (
"Invalid edge coordinates: "
f"start_x={start_x}, "
f"start_y={start_y}, "
f"end_x={end_x}, "
... | Python | 1 |
RADIUS.powf(2.0);
let debug_mode = false;
let predators = vec![Vector2::new(width / 2.0, height / 2.0)];
let max_speed = DEFAULT_MAX_SPEED;
let max_steer = DEFAULT_MAX_STEER;
let align_factor = DEFAULT_ALIGN_FACTOR;
let center_factor = DEFAULT_COHESION_FACTOR;
let... | Rust | 0 |
ts, input_shape, num_class, iou_threshold=0.413, score_threshold=0.3):
"""
Apply Non-Maximum suppression
ref: https://www.tensorflow.org/api_docs/python/tf/image/combined_non_max_suppression
:param model_ouputs: yolo model model_ouputs
:param input_shape: size of input image
:return: nmsed_boxes... | Python | 1 |
: u32,
/// Specifies the first group of 4 hexadecimal digits.
pub data2: u16,
/// Specifies the second group of 4 hexadecimal digits.
pub data3: u16,
/// Array of 8 bytes. The first 2 bytes contain the third group of 4 hexadecimal digits. The remaining 6 bytes contain the final 1... | Rust | 0 |
# 用于在docker中运行, 在docker中我设置会将此文件重命名为settings.py用于docker的部署
from binblog.settings_example import *
DEBUG = os.getenv('DEBUG', 'False').lower() in ('true', 'yes', 'y')
# 覆盖原先settings里的一些配置
# https://docs.travis-ci.com/user/database-setup/
DATABASES['default'] = {
'ENGINE': 'django.db.backends.mysql',
'NAME': os... | Python | 1 |
#!/usr/bin/env python3
##
## EPITECH PROJECT, 2020
## main.py
## File description:
## blabla
##
import math
import sys
import string
def horner(poly, n, x):
result = poly[0]
for i in range(1, n):
result = result*x + poly[i]
return result
def make_expression(yolo):
number_string = yolo.split(... | Python | 1 |
the cache should also remove the entry
reddit.handler.evict('https://api.reddit.com/r/python')
assert not reddit.handler.cache
def test_content_rate_limit(reddit, oauth, refresh_token):
# Make sure the test suite is configured to use the custom handler
assert isinstance(reddit.handler, RequestHeaderR... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.