text string | label_name string | labels int64 |
|---|---|---|
9\xd0\x9f\x02\xc5\
(\xc19RW\x0b\x85\x11\x00\x94\xdd\x96\xd8\x054\x8a\
\xb9>\xf8\xe8h}o\xa0!\xa0\xa9m\xbf\xf3\xb7\xe6\
\xb8\xf3\xdfas\xec\x02\x80\xde\x10\x00Pj&m\x88\
]C#\xb9\xf4\x81\xb5\xa3u=!`\x17\xbb\xdc\xf9\
\xc7.\xa5\xc1\x9e\x8d]\x00\xd0\x9b0\x01 \xf6\x82\x89\
\xfe4\x94Z\xcd\xf5\x87\xe8\xe7H\xe3\xdb)k\x0f\x18\
\xc0... | Python | 1 |
import os
import json
from connections.rabbitmq_builder_connection import ConsumerAMQP
from connections.database_builder_connection import MongoDB
QUEUE_AMQP = os.getenv('QUEUE_AMQP', 'fila_teste')
EXCHANGE_QUEUE = os.getenv('EXCHANGE_AMQP', 'exchange_teste')
KEY_AMQP = os.getenv('KEY_AMQP', 'chave_teste')
def call... | Python | 1 |
from typing import Dict
from pyinterpolate.semivariogram.experimental.classes.experimental_variogram import ExperimentalVariogram
from pyinterpolate.core.data_models.blocks import Blocks
from pyinterpolate.core.data_models.point_support import PointSupport
from pyinterpolate.kriging.block.area_to_point_poisson_kriging... | Python | 1 |
self.tipoCadenaMensaje = "Menor que"
def m_MAYORIGUAL(self):
self.tipoCadenaMensaje = "Mayor o igual que"
def m_MENORIGUAL(self):
self.tipoCadenaMensaje = "Menor o igual que"
def m_OR(self):
self.tipoCadenaMensaje = "Or"
def m_AND(self):
self.tipoCadenaMensaje = "An... | Python | 1 |
as']
buffer = 1 * 10**9 # 1 Gwei buffer
max_fee_per_gas = base_fee_per_gas + buffer
# # Approve the Uniswap Router to spend your WETH
# approve_txn = token_in_contract.functions.approve(
# router_address,
# amount_in
# ).build_transaction({
# 'from': account,
# 'nonce': web3.eth.get_transaction_count(... | Python | 1 |
(zhù)是苧麻"),
"而繁体字苧(zhù)是苎麻"
);
assert_eq!(
&convert("「乾」其他意义仍然保留的,乾坤、乾隆的乾不簡化为「干」,“乾燥”、“乾爹”的“乾”簡化為“干”"),
"「乾」其他意义仍然保留的,乾坤、乾隆的乾不简化为「干」,“干燥”、“干爹”的“乾”简化为“干”"
);
}
#[test]
fn test_t2s_special_convert_type_2() {
assert_eq!(
&convert(... | Rust | 0 |
ex<I> for Rest<'a, T> {
type Output = I::Output;
#[inline]
fn index(&self, index: I) -> &I::Output {
&(**self)[index]
}
}
impl<'a, T, I: SliceIndex<[T]>> IndexMut<I> for Rest<'a, T> {
#[inline]
fn index_mut(&mut self, index: I) -> &mut I::Output {
&mut (&mut **self)[index]
... | Rust | 0 |
stances_entry = tk.Entry(root, width=10)
num_solve_instances_entry.pack(padx=10, pady=5)
solve_button = tk.Button(root, text="Solve Instances", command=solve_instances)
solve_button.pack(padx=10, pady=5)
neural_button = tk.Button(root, text="Run Neural Script", command=run_neural_script)
neural_button.pack(padx=10, p... | Python | 1 |
for i in (0..segCount as usize).rev() {
if !(cc as i32 <= map.endCount[i] as i32) {
break;
}
if !(cc as i32 >= map.startCount[i] as i32) {
continue;
}
if map.idRangeOffset[i] as i32 == 0 {
gid = (cc as i32 + map.idDelta[i] as i32 & 0xffff)... | Rust | 0 |
"""Support for Lutron shades."""
from __future__ import annotations
import logging
from typing import Any
from homeassistant.components.cover import (
ATTR_POSITION,
CoverEntity,
CoverEntityFeature,
)
from homeassistant.core import HomeAssistant
from homeassistant.helpers.entity_platform import AddEntitie... | Python | 1 |
font is not smaller
let mut dst = Rect::new(
0,
(h - (font_y * 1) - (splits_height * num_panels as u32)) as i32 ,
0,
font_y * 1,
);
let mut idx: usize;
let mut char_num = 0;
let space = coords[14] - coords[13];
for chr in time_str.chars().rev() {
// get th... | Rust | 0 |
// 1.13 (id: 28852, stack: 0)
DarkOakTrapdoor, // 1.13 (id: 10355, stack: 0)
DarkOakWood, // 1.13 (id: 16995, stack: 0)
DarkPrismarine, // 1.13 (id: 19940)
DarkPrismarineSlab, // 1.13 (id: 7577, stack: 0)
DarkPrismarineStairs, // 1.13 (id: 26511, stack: 0)
DeadBrainCoralBlock, // 1.13 (id: 12979... | Rust | 0 |
i].iter().map(|u| u.as_ref()).collect::<Vec<&str>>().join(" ").to_lowercase();
for (key, val) in SPECIAL_CASE_IDIOMS.iter() {
if target_window.contains(key.as_ref()) {
valence = *val;
break;
}
}
let prev_three = tokens[(i - 3)..i].iter().map(|u| u.as_ref()).collect::... | Rust | 0 |
add(proof)?;
debug!("inserting disclosed proof {} into handle map", source_id);
Ok((handle, proof_request))
}
pub fn get_state(handle: u32) -> VcxResult<u32> {
HANDLE_MAP.get(handle, |proof| {
Ok(proof.get_state().into())
}).or(Err(VcxError::from(VcxErrorKind::InvalidConnectionHandle)))
}
pub... | Rust | 0 |
_PA"), "1")
self.assertEqual(env.get("ENABLE_NATIVE_CUDA_GRAPH"), "0")
self.assertEqual(env.get("NUM_NATIVE_CUDA_GRAPH"), "200")
# 7. 采样
self.assertEqual(env.get("MAX_BATCH_SIZE"), "0")
self.assertEqual(env.get("ENABLE_FLASHINFER_SAMPLE_KERNEL"), "1")
# 8. 设备和资源管理
... | Python | 1 |
,
input: PipelineData,
) -> Result<nu_protocol::PipelineData, nu_protocol::ShellError> {
run_with_function(call, input, maximum)
}
fn examples(&self) -> Vec<Example> {
vec![Example {
description: "Find the maximum of list of numbers",
example: "[-50 100 25] |... | Rust | 0 |
# some tests for the renderer classes
from __future__ import annotations
import time
import pytest
from pyinstrument import renderers
from pyinstrument.profiler import Profiler
from .fake_time_util import fake_time
# utils
frame_renderer_classes: list[type[renderers.FrameRenderer]] = [
renderers.ConsoleRende... | Python | 1 |
trivia_commands_ran = await self.karen.trivia_command(ctx.author.id)
do_reward = trivia_commands_ran <= 7
question = random.choice(ctx.l.fun.trivia.questions)
if question.tf:
await self.trivia_true_or_false(ctx, question, do_reward)
else:
await self.trivia_mul... | Python | 1 |
nks with [`.poll_field_chunk()](#method.poll_field_chunk)
/// until `None` is returned, then loop back to step 2.
///
/// Any data before the first boundary and past the end of the terminating boundary is ignored
/// as it is out-of-spec and should not be expected to be left in the underlying stream intact.
/// Please ... | Rust | 0 |
{}\t\t{}\t\t{}",
instance.name, mounted, running, booted
);
}
Ok(())
}
#[test]
fn test_inspect_instance() {
println!("{:#?}", inspect_instance("alpine", "alpine"));
}
#[test]
fn test_container_name() {
assert_eq!(
get_container_ns_name(Path::new("/tmp/"), false).unwrap(),
... | Rust | 0 |
import torch
def compute_rotation_matrix_from_ortho6d(poses):
"""
Code from
https://github.com/papagina/RotationContinuity
On the Continuity of Rotation Representations in Neural Networks
Zhou et al. CVPR19
https://zhouyisjtu.github.io/project_rotation/rotation.html
"""
x_raw = poses[:... | Python | 1 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
from chi_annotator.algo_factory.components import Component
import typing
import numpy as np
MAX_WORDS_IN_BATCH = 10000
if typing.TYPE_CHECKING:
from gensim.models.keyedvectors import KeyedVectors
class EmbeddingExtractor(object):
"""
embedding extractor, 含char... | Python | 1 |
.into_iter()
.collect();
assert_eq!(
rate_limits,
vec![RateLimit {
categories: DataCategories::new(),
scope: RateLimitScope::Organization(42),
reason_code: Some(ReasonCode::new("get_lost")),
retry_af... | Rust | 0 |
from django.db import models
# Create your models here.
class Podcast(models.Model):
title = models.CharField(max_length=100)
about = models.CharField(max_length=1000)
version = models.IntegerField(null=True)
record_time = models.DateTimeField(auto_now_add=True, null=True)
def __str__(self):
return f"... | Python | 1 |
"Option::is_none")]
pub transcoding_url: Option<String>,
#[serde(
rename = "TranscodingSubProtocol",
skip_serializing_if = "Option::is_none"
)]
pub transcoding_sub_protocol: Option<String>,
#[serde(
rename = "TranscodingContainer",
skip_serializing_if = "Option::is_n... | Rust | 0 |
25),
('p1013', '数据科学实战案例', '通过实际案例学习数据分析和机器学习的应用...', 'u1001', '{"tags": ["数据科学", "机器学习", "案例"]}', 200, 85, 30),
('p1014', '健康饮食指南', '科学合理的饮食方案,助你保持健康活力...', 'u1003', '{"tags": ["健康", "饮食", "生活"]}', 160, 65, 22),
('p1015', '户外摄影技巧', '如何在自然环境中捕捉完美的照片...', 'u1002', '{"tags": ["摄影", "户外", "技巧"]}', 170, 70, 24);
"""
def ... | Python | 1 |
D> for Assignment
where
D: compiler_llvm_context::Dependency,
{
fn into_llvm(mut self, context: &mut compiler_llvm_context::Context<D>) -> anyhow::Result<()> {
let value = match self.initializer.into_llvm(context)? {
Some(value) => value,
None => return Ok(()),
};
... | Rust | 0 |
ted_nodes = np.where(degree == 1)
bfs_index = scipy.sparse.csgraph.breadth_first_order(adj_s[i], random.choice(connected_node[0]))
bfs_index = list(np.unique(bfs_index[0]) )+ list(unconnected_nodes[0])
adj_s[i] = adj_s[i][bfs_index, :][:, bfs_index]
x_s[i] = x_s[i][bfs_index, :]
for j in ... | Python | 1 |
# reverse a list
# list1=[1,2,3,4,5,6,7]
# list2=['hey','helolo','haaai']
# list2.reverse()
# list1.reverse()
# print(list1)
# print(list2)
# acsessiing by index
# list1=[[1,2,3],[["a",'b','c'],1,4,2]]
# print(list1[1][0][1])
# to count
# list1=[1,2,3,4,5,5,5,5,5,5,6,7,9,]
# y=list1.count(5)
# print(y)
# ... | Python | 1 |
from __future__ import annotations
import warnings
from typing import Any, Dict, Iterable, Optional
__all__ = ["lazy_import"]
def import_name(name: str, source: str, namespace: Dict[str, Any]) -> Any:
"""
Import ``name`` from ``source`` in ``namespace``.
There are two use cases:
- ``name`` is an ... | Python | 1 |
12, 2, 6, 10, 14, 1, 3, 5, 7, 9, 11, 13, 15][..]),
(17, &[0, 8, 16, 4, 12, 2, 6, 10, 14, 1, 3, 5, 7, 9, 11, 13, 15][..]),
] {
let iter = InterlaceIterator { len: len, next: 0, pass: 0 };
let lines = iter.collect::<Vec<_>>();
assert_eq!(lines, expect);
}
}
//! The `info` subcomma... | Rust | 0 |
import re
from django import template
from django.template.loader import render_to_string
register = template.Library()
admin_re = re.compile(r'^admin\/')
def prepopulated_fields_js(context):
"""
Creates a list of prepopulated_fields that should render Javascript for
the prepopulated fields for both the a... | Python | 1 |
_SEQ_MAJOR_UNPACKED = 0,
CUDNN_RNN_DATA_LAYOUT_SEQ_MAJOR_PACKED = 1,
CUDNN_RNN_DATA_LAYOUT_BATCH_MAJOR_UNPACKED = 2,
}
pub type cudnnRNNPaddingMode_t = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct cudnnRNNStruct {
_unused: [u8; 0],
}
pub type cudnnRNNDescriptor_t = *mut cudnnR... | Rust | 0 |
{
conn::handle(stream)
});
},
Err(e) => {
// Something went wrong...
warn!("Failed to accept incoming connection: {:?}", e);
},
}
}
}
<filename>src/service/tcp.rs<gh_stars>1-10
use crate::client::Client;... | Rust | 0 |
chunk = block.try_into()?;
let chunk = arrow::compute::filter::filter_chunk(&chunk, &array)?;
DataBlock::from_chunk(&schema, &chunk)
}
}
<reponame>IoanThomas/calculate<gh_stars>0
pub struct RpnParseError {
pub message: &'static str,
}
<reponame>unix1986/rucene
// Copyright 2019 Zhizhesihai (Bei... | Rust | 0 |
ndices0 = torch.where(valid0, indices0, indices0.new_tensor(-1))
indices1 = torch.where(valid1, indices1, indices1.new_tensor(-1))
# check if indexed correctly
loss = []
if all_matches is not None:
for b in range(len(dim_m)):
for i in range(int(d... | Python | 1 |
mm_k1z_xmm_xmmm128b16
0x451C_00B6,// EVEX_Vfmaddsub231ph_ymm_k1z_ymm_ymmm256b16
0x461C_00B6,// EVEX_Vfmaddsub231ph_zmm_k1z_zmm_zmmm512b16_er
0x441C_0097,// EVEX_Vfmsubadd132ph_xmm_k1z_xmm_xmmm128b16
0x451C_0097,// EVEX_Vfmsubadd132ph_ymm_k1z_ymm_ymmm256b16
0x461C_0097,// EVEX_Vfmsubadd132ph_zmm_k1z_zmm_zmmm512b16_... | Rust | 0 |
ory_id", "naive", "test_token")
assert parsed_output == "User: Previous question 4\nAssistant: Previous answer 4\nUser: Previous question 5\nAssistant: Previous answer 5\nUser: Previous question 6\nAssistant: Previous answer 6"
@patch('comps.prompt_template.utils.chat_history_handler.requests.get')
def test_chat_... | Python | 1 |
' of type [tcplistener] to the 'Ok()' output of the loop
let server = loop {
let mut input_address = get_address();
// checks if it was empty
if &mut input_address == "" {
// converts to string since it's a type of &str when defined as CONST
input_address = DEFAULT... | Rust | 0 |
html#method.init) method.
/// Otherwise an [`Error::NotInitialized`](enum.Error.html#variant.NotInitialized)
/// will be returned.
pub fn measure(&mut self) -> nb::Result<Measurement,E> {
// Send command to sensor
let mut buffer = String::from("");
buffer.push_str(self.s.read()?.as_s... | Rust | 0 |
3.0,4.0);
let s = scaling(-4.0, 6.0, 8.0);
let exp = Point::new(-8.0, 18.0, 32.0);
assert_point_eq(exp, transform(p, &s).unwrap());
}
#[test]
fn scale_vector() {
let v = Vector::new(2.0,3.0,4.0);
let s = scaling(-4.0, 6.0, 8.0);
let exp = Vector::new(-8.0, 1... | Rust | 0 |
' policy drop;\n'
' ct state established,related accept\n'
' meta iifname != "vif*" accept\n'
' jump qubes-forward\n'
' }}\n'
' chain prerouting {{\n'
' type filter hook prerouting priority -300;\n'
' policy ... | Python | 1 |
# To build locally: python setup.py egg_info -RDb "" bdist_egg
# To release: python setup.py egg_info -RD sdist bdist_egg register upload
# To create a named release: python setup.py egg_info -RDb "a1" sdist bdist_egg register upload
# To release a dev build: python setup.py egg_info -rD sdist bdist_egg register uploa... | Python | 1 |
ame_name() {}
}
impl self::ApiWithCustomVersion<Block> for Runtime {
fn same_name() {}
}
impl runtime_api::Core<Block> for Runtime {
fn version() -> runtime_api::RuntimeVersion {
unimplemented!()
}
fn execute_block(_: Block) {
unimplemented!()
}
fn initialize_block(_: &<Block as BlockT>::Header)... | Rust | 0 |
var_acc += a * a
var = tl.sum(var_acc, axis=0) / N_SIZE
rstd = 1 / tl.sqrt(var + eps)
# write-back mean/rstd
tl.store(mean_ptr + row_idx, mean)
tl.store(rstd_ptr + row_idx, rstd)
# multiply by weight and add bias
for block_n_start_idx in range(0, N_SIZE, BLOCK_N_SIZE):
cols_offs =... | Python | 1 |
pub struct TeamRepoHandler<'octo> {
crab: &'octo Octocrab,
org: String,
team: String,
}
impl<'octo> TeamRepoHandler<'octo> {
pub(crate) fn new(crab: &'octo Octocrab, org: String, team: String) -> Self {
Self { crab, org, team }
}
/// Checks if a team manages a repository, returning the... | Rust | 0 |
Deserializer::new(self))?))
}
}
}
use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::globals::system::SystemCapabilities;
use crate::avm1::object::Object;
use crate::avm1::property_decl::{define_properties_on, Declaration};
use crate::avm1::{AvmString, ScriptObject, Val... | Rust | 0 |
Clone, Serialize, Deserialize)]
pub struct Rest {
pub listen: SocketAddr,
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct P2p {
/// The public address to which other peers may connect to
pub public_address: poldercast::Address,
pub public_id: poldercast::Id,
/// the rendezvous point... | Rust | 0 |
{
self.mpu_rnr_reg().ptr()
}
#[doc="Get the *const pointer for the MPU_RNR register."]
#[inline] pub fn mpu_rnr_ptr(&self) -> *const MpuRnr {
self.mpu_rnr_reg().ptr()
}
#[doc="Read the MPU_RNR register."]
#[inline] pub fn mpu_rnr(&self) -> MpuRnr {
self.mpu_rnr_reg()... | Rust | 0 |
"""Finetuning example.
Trains the torchMoji model on the SemEval emotion dataset, using the 'last'
finetuning method and the class average F1 metric.
The 'last' method does the following:
0) Load all weights except for the softmax layer. Do not add tokens to the
vocabulary and do not extend the embedding layer.
1)... | Python | 1 |
class Solution:
def singleNonDuplicate(self, nums: List[int]) -> int:
l = 0
r = len(nums) - 1
while l < r:
m = (l + r) // 2
if m % 2 == 1:
m -= 1
if nums[m] == nums[m + 1]:
l = m + 2
else:
r = m
return nums[l]
| Python | 1 |
{HashMap, HashSet};
use wasmtime_environ::entity::EntityRef;
use wasmtime_environ::ir::{StackSlots, ValueLabel, ValueLabelsRanges, ValueLoc};
use wasmtime_environ::isa::TargetIsa;
use wasmtime_environ::wasm::{get_vmctx_value_label, DefinedFuncIndex};
use wasmtime_environ::ModuleMemoryOffset;
#[derive(Debug)]
pub struc... | Rust | 0 |
d indexes for indexed rendering,
pub struct WebGLBuffer(pub Reference);
impl Deref for WebGLBuffer {
type Target = Reference;
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[derive(Debug)]
/// an OpenGL shader created with [`GLContext::create_shader`]
pub s... | Rust | 0 |
from opencompass.openicl.icl_prompt_template import PromptTemplate
from opencompass.openicl.icl_retriever import ZeroRetriever
from opencompass.openicl.icl_inferencer import PPLInferencer
from opencompass.datasets import BelebeleDataset, BelebeleEvaluator
belebele_reader_cfg = dict(
input_columns=['flores_passage... | Python | 1 |
import type_enforced
@type_enforced.Enforcer
def my_fn(
a: list[str],
b: dict[str, int],
c: tuple[int, float],
d: set[str],
e: tuple[int | float, ...] = (1.0, 2, 3),
) -> None:
return None
success_1 = True
try:
my_fn(a=["a"], b={"a": 1}, c=(1, 1.5), d={"a"})
except:
success_1 = False... | Python | 1 |
button.hilight = 2
self.down_button = button
redraw = True
else:
if self.hover_widget:
self.hover_widget.focus_leave()
redraw = True
self.hover_widget = None
... | Python | 1 |
nts`
/// elements of the value type.
unsafe fn elementwise_div_f32(
&mut self,
lhs: *const u8,
rhs: *const u8,
dest: *mut u8,
num_elements: usize,
);
}
<gh_stars>0
// Provide an implementation of a serde serialiser for RESP data
use rustdss_data::RespData;
use std::co... | Rust | 0 |
eligible_nodes`.
///
/// This factory requires pods to be labeled with all `REQUIRED_LABELS` and with one additional "id label"
/// that can vary from operator to operator.
///
/// See `generate_ids` for details.
pub struct LabeledPodIdentityFactory {
app: String,
instance: String,
id_label_name: String,
... | Rust | 0 |
#
# Copyright (c) 2023 Airbyte, Inc., all rights reserved.
#
from .source import SourceMailjetSms
__all__ = ["SourceMailjetSms"]
| Python | 1 |
tput[_builtins.str]:
"""
Numerical ID of the parent organization.
"""
return pulumi.get(self, "organization")
@_builtins.property
@pulumi.getter(name="updateTime")
def update_time(self) -> pulumi.Output[_builtins.str]:
"""
The time at which the custom module ... | Python | 1 |
f attn_index == 0:
query = self.attentions[attn_index](
query,
key,
value,
identity if self.pre_norm else None,
query_pos=bev_pos,
key_pos=bev_pos,
... | Python | 1 |
ab\xab\x09l.\x1f\x0a\xd3Z\xb1F\xe3\xbe:\
\x1a\xed\xf5KV\xb0\x97\xf7\xaa\xbf\xef+nV\xf7\x06\
\xb3\xaf\xe1\x8bT\xb5\xd9%t\xc2;\xd9\xe8c\xed\xda\
|\xb72\xf4\xbf\x82\xde\x1c\xd6t\x14\xb5\xfd\xd5\xfe\xd6\
-\xe73ol\xe7\xb84\xeb\xaf\x86\xb1h;b\x8a\
Yl\xd6%\xda\xbb>]\xb5\x97/\x84\xae4+\xff\
\x00\xb4X\x5c5\xbc\xab\xfd\xcf\xbb\x... | Python | 1 |
import numpy as np
from cleantext import clean
from pt_vid.data.cleaning.Strategy import Strategy
class CleanupStrategy(Strategy):
@staticmethod
def _clean_nan(text):
return "" if text is np.nan else text
@staticmethod
def _clean_text(text, **kwargs):
return clean(
text... | Python | 1 |
error!("error: {:?}", err);
panic!("Could not restart Awesome");
}
});
}
fn main() {
let mut opts = getopts::Options::new();
opts.optflag("", "version", "show version information");
let matches = match opts.parse(env::args().skip(1)) {
Ok(m) => m,
Err(f) =>... | Rust | 0 |
from django.core.exceptions import ObjectDoesNotExist
from account.entity.account import Account
from account.entity.account_role_type import AccountRoleType
from account.entity.role_type import RoleType
from account.repository.account_repository import AccountRepository
class AccountRepositoryImpl(AccountRepository... | Python | 1 |
out = self.relu(paddle.add(x, conv))
return conv
class YTRN(nn.Layer):
def __init__(self, in_channels=7, out_channels=512):
super(YTRN, self).__init__()
self.out_channels = out_channels
self.conv = nn.Sequential(
DownSampleBlock(in_channels=7, out_channels=32, stride=... | Python | 1 |
d}")
if sub_exe_process:
sub_exe_process.terminate()
time.sleep(2)
login_wnd_details = hwnd_utils.get_hwnd_details_of_(wechat_hwnd)
login_wnd = login_wnd_details["window"]
login_width = login_wnd_details["width"]
login_height = login_wnd_details["height"]
... | Python | 1 |
.build();
p.cargo("build")
.masquerade_as_nightly_cargo()
.with_status(101)
.with_stderr(
"\
[ERROR] profile inheritance loop detected with profile `release-lto2` inheriting `release-lto`
",
)
.run();
}
#[cargo_test]
fn overrides_with_custom() {
let... | Rust | 0 |
#!/usr/bin/env python
"""
Zero-shot evaluate BERT-MNLI on lexical‐overlap control set
and print per-subcase accuracy.
"""
import argparse, pathlib, torch, pandas as pd
from tqdm.auto import tqdm
from sklearn.metrics import classification_report, confusion_matrix, accuracy_score
from transformers import AutoTokenizer, ... | Python | 1 |
rue, stderr=sp.STDOUT)
return True
except Exception:
return False
class BackendType(Enum):
BATCH = 'batch'
FAAS = 'faas'
class CountDownLatch:
def __init__(self, count):
self.count = count
self.event = threading.Event()
self.lock = threading.Lock()
def un... | Python | 1 |
on(bn.get_price_all()?)?);
println!("Get price:");
println!("{:?}", rt.block_on(bn.get_price("KNCETH")?)?);
println!("Get all tickers:");
println!("{:?}", rt.block_on(bn.get_book_ticker_all()?)?);
println!("Get ticker:");
println!("{:?}", rt.block_on(bn.get_book_ticker("BNBETH")?)?);
println... | Rust | 0 |
lyser = api.env.pg_query_analyser_file % (
os_version,
architecture,
)
api.put(pg_query_analyser, 'pg_query_analyser', mode=0755)
api.sudo(env.pg_query_analyser_command)
api.get('report.html', 'report_%s_%s.html' % (
env.host,
datetime.dat... | Python | 1 |
parent=node, namespace=node)
return
if isinstance(node, ast.comprehension):
add_parent(node.target, parent=node, namespace=namespace)
add_parent(node.iter, parent=node, namespace=namespace)
for if_ in node.ifs:
add_parent(if_, parent=node, namespace=namespace)
... | Python | 1 |
*"]
pub const SCISSOR_TEST: u32 = 3089u64 as u32;
#[doc = "The `WebGL2RenderingContext.POLYGON_OFFSET_FILL` const."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"]
pub const POLYGON_OFFSET_FILL: u32 = 32823u64 as u32;
#[doc = "Th... | Rust | 0 |
from io import BytesIO
import os
import pandas as pd
import boto3
def read_local_table(key):
location = key['input_address']
part_data = pd.read_table(location,
delimiter="|",
header=None,
na_values='-')
return p... | Python | 1 |
import logging
import os
from datetime import datetime
from src.auth.command import AuthorizeCommand, SubmitFormCommand, SubmitLoginCommand
from src.core import CalendarConfig, CommandContext, CommandPipeline, Publisher, gakko_config
from src.integrations.google.calendar_repository import GoogleCalendarRepository
from... | Python | 1 |
'Ar':0.98,
'K':2.03,
'Ca':1.74,
'Sc':1.44,
'Ti':1.32,
'V':1.22,
'Cr':1.18,
'Mn':1.17,
'Fe':1.17,
'Co':1.16,
'Ni':1.15,
'Cu':1.17,
'Zn':1.25,
'Ga':1.26,
'Ge':1.22,
'As':1.2,
'Se':1.16,
'Br':1.14,
'Kr':1.12,
'Rb':2.16,
'Sr':1.91,
'Y':1.... | Python | 1 |
println!(
"Manhattan distance: {}",
final_ship.x.abs() + final_ship.y.abs()
);
println!("--- part II -----------------------------------------");
let final_ship = input.lines().fold(ship, |ship, instruction| {
let next = navigate_pt2(&ship, instruction);
println!("{:?}",... | Rust | 0 |
tialize SIFT feature detector
sift = cv2.SIFT_create()
# Detect keypoints and compute descriptors for both images
keypoints_1, descriptors_1 = sift.detectAndCompute(centered1, None)
keypoints_2, descriptors_2 = sift.detectAndCompute(centered2, None)
# Match descriptors between the two images using ... | Python | 1 |
wordspec_combos(
spec.wordsize,
spec.input_endian,
spec.output_endian,
spec.width.unwrap(),
extended_search,
)
.into_iter()
.map(move |wordspec| {
let rev = match spec.width {
None => Err(CheckReverserError::MissingParameter("width")),
... | Rust | 0 |
alysisColumns.adjustment_1,
TMLEAnalysisColumns.adjustment_0,
}
missing_input = sorted(
col for col in required_input_cols if col not in initial_estimates_df.columns
)
if missing_input:
raise ValueError(f"TMLE analysis missing required columns: {missing_input}")
# Filter TML... | Python | 1 |
const GPIO_SDIO_INT_V: u32 = 4294967295;
pub const GPIO_SDIO_INT_S: u32 = 0;
pub const GPIO_PCPU_INT1_REG: u32 = 1061175400;
pub const GPIO_PROCPU_INT_H: u32 = 4194303;
pub const GPIO_PROCPU_INT_H_V: u32 = 4194303;
pub const GPIO_PROCPU_INT_H_S: u32 = 0;
pub const GPIO_PCPU_NMI_INT1_REG: u32 = 1061175404;
pub const GP... | Rust | 0 |
from __future__ import print_function
from CGAL.CGAL_Kernel import Point_3
from CGAL.CGAL_Kernel import Vector_3
from CGAL.CGAL_Point_set_3 import Point_set_3
from CGAL.CGAL_Point_set_processing_3 import *
import os
datadir = os.environ.get('DATADIR', '../data')
datafile = datadir + '/oni.xyz'
print("Running read_xy... | Python | 1 |
#! /usr/bin/env python3
# -*- coding: utf-8 -*-
"""Test for time-depth separable convolution (TDS) encoder."""
import importlib
import numpy as np
import pytest
import torch
from neural_sp.models.torch_utils import np2tensor
from neural_sp.models.torch_utils import pad_list
def make_args(**kwargs):
args = dict... | Python | 1 |
youthful",
"yucky",
"yummy",
"zealous",
"zeroed",
"zinc",
"zooming",
];
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file,... | Rust | 0 |
"#
);
test!(
del1,
r#"
del(.foo)
"#,
r#"
{"foo": 42, "bar": 9001, "baz": 42}
"#,
r#"
{"bar": 9001, "baz": 42}
"#
);
test!(
del2,
r#"
del(.[1, 2])
"#,
r#"
["foo", "bar", "baz"]
"#,
r#"
["foo"]
"#
);
test!(
getpath1,
r#"
getpat... | Rust | 0 |
file_size,
prot=mmap.PROT_READ,
flags=mmap.MAP_PRIVATE | mmap.MAP_POPULATE, # type: ignore [attr-defined]
)
os.close(fd)
arr = np.frombuffer(mm, dtype=np.uint8)
addr = arr.__array_interface__["data"][0]
assert gpu... | Python | 1 |
pub fn put(&mut self, key: K, value: V) -> Result<()> {
// try inserting into WAL else fail the operation
// might need to acquire lock over memory before mutating memory
let wal_insert_result = self.persistence.insert(key.clone(), value.clone());
if wal_insert_result.is_ok() {
... | Rust | 0 |
n parens(i: &str) -> IResult<&str, ast::Expression, VerboseError<&str>> {
delimited(space0, delimited(tag("("), expression, tag(")")), space0)(i)
}
fn order_by_clause_for_within_group(i: &str) -> IResult<&str, ast::OrderByExpression, VerboseError<&str>> {
map(
preceded(tuple((tag("order"), space1, tag(... | Rust | 0 |
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
"""Type aliases for anomaly detection.
This module provides type aliases used throughout the anomalib library. The aliases
include:
- ``NORMALIZATION``: Type for normalization methods and configurations
- ``THRESHOLD``: Type for thre... | Python | 1 |
:
self.ui.listWidget.clear() # 清空listWidget
self.image_files = None
self.img_path = None
self.num = 0
video_save_path = QtWidgets.QFileDialog.getExistingDirectory(self, "选择图片保存文件夹")
if video_save_path:
self.video_save_path = video_save_path
v... | Python | 1 |
# @Time : 2024/2/9 11:39
# @Author : zhangchenming
from stereo.modeling.trainer_template import TrainerTemplate
from .lightstereo import LightStereo
__all__ = {
'LightStereo': LightStereo,
}
class Trainer(TrainerTemplate):
def __init__(self, args, cfgs, local_rank, global_rank, logger, tb_writer):
... | Python | 1 |
"""
This is pure Python implementation of linear search algorithm
For doctests run following command:
python3 -m doctest -v linear_search.py
For manual testing run:
python3 linear_search.py
"""
def linear_search(sequence: list, target: int) -> int:
"""A pure Python implementation of a linear search algorithm
... | Python | 1 |
ent_session", mock.MagicMock()
) as mock_session:
mock_response = mock.MagicMock(status=404)
mock_session.post = mock.MagicMock(
return_value=mock.MagicMock(
__aenter__=mock.CoroutineMock(return_value=mock_response)
)
)
... | Python | 1 |
'static str;
fn try_from(value: &str) -> Result<Self, Self::Error> {
Ok(match value {
"bool" => PrimitiveType::Bool,
"i8" => PrimitiveType::I8,
"i16" => PrimitiveType::I16,
"i32" => PrimitiveType::I32,
"i64" => PrimitiveType::I64,
"isi... | Rust | 0 |
l = Poll.query.get(poll_id)
if not poll:
flash('Anket bulunamadı.', category='error')
return redirect(url_for('views.home'))
# Bitiş zamanını kontrol et
if poll.end_time and poll.end_time > datetime.utcnow():
flash('Oylama sonuçları henüz erişilebilir değil.', category='error')
... | Python | 1 |
{device::DevPath, surface::DrmSurfaceInternal, DrmError, DrmSurface};
use crate::backend::SwapBuffersError;
use slog::{debug, error, o, trace, warn};
/// Simplified abstraction of a swapchain for gbm-buffers displayed on a [`DrmSurface`].
#[derive(Debug)]
pub struct GbmBufferedSurface<D: AsRawFd + 'static> {
curr... | Rust | 0 |
d_uv_basis.next().is_some() {
return Err(PlonkError::IteratorOutOfRange);
}
Ok(result)
}
}
/// Private helper methods
impl<E, F, P> Verifier<E>
where
E: PairingEngine<Fq = F, G1Affine = GroupAffine<P>>,
F: RescueParameter + SWToTEConParam,
P: SWModelParameters<BaseField = F>... | Rust | 0 |
ments
/// * `version` - A ConfidentialTransaction version.
/// * `locktime` - A ConfidentialTransaction locktime.
///
/// # Example
///
/// ```
/// use cfd_rust::ConfidentialTransaction;
/// let tx = ConfidentialTransaction::new(2, 0).expect("Fail");
/// ```
pub fn new(version: u32, locktime: u32) -... | Rust | 0 |
_case_types)]
pub type PFN_glProgramUniform1ui64vARB = unsafe extern "system" fn(
_program: GLuint,
_location: GLint,
_count: GLsizei,
_value: *const GLuint64,
);
#[allow(non_camel_case_types)]
pub type PFN_glTexEnvxvOES =
unsafe extern "system" fn(_target: GLenum, _pname: GLenum, _params: *const GL... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.