text string | label_name string | labels int64 |
|---|---|---|
from freshen import *
from nose.tools import *
def flunker():
raise Exception("FAIL")
@Given("^passing$")
def passing(table):
pass
@Given("^failing$")
def failing(string):
flunker()
@Given("^passing without a table$")
def pass_without_table():
pass
@Given("^failing without a table$")
def fail_with... | Python | 1 |
ger.warning("More than one harmful word/phrase found in prompt: %s", prompt)
for word in self._blacklisted_words:
if word in prompt:
harmful_word = word
break
# If not blacklisted words found, try to find [masked words]
if... | Python | 1 |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | Python | 1 |
/tools/mod.rs
pub mod crop;
pub mod ellipse;
pub mod eyedropper;
pub mod fill;
pub mod freehand;
pub mod line;
pub mod navigate;
pub mod path;
pub mod pen;
pub mod rectangle;
pub mod select;
pub mod shape;
pub mod shared;
pub mod spline;
pub mod text;
// A HTTP query server based on CCHs.
#![feature(proc_macro_hygiene... | Rust | 0 |
ount': t['amount'],
'type': t['type'],
'description': t['description']
} for t in analyzer.transactions])
df['date'] = pd.to_datetime(df['date'], errors='coerce')
# Daily spending chart
daily_spending = df[df['type'] == 'DEBIT'].groupby('date')['amount'].sum().reset_index()
fig_dail... | Python | 1 |
local_aggregation_type=self.model_cfg.LOCAL_AGGREGATION_TYPE,
num_reduced_channels=self.model_cfg.get('NUM_REDUCED_CHANNELS', None),
num_channels_of_local_aggregation=self.model_cfg.NUM_CHANNELS_OF_LOCAL_AGGREGATION,
neighbor_distance_multiplier=2.0
... | Python | 1 |
<u32 as IntoDeserializer<Error>>::into_deserializer(index);
let value = seed.deserialize(deserializer)?;
Ok((value, self))
}
}
impl<'de, 'a> VariantAccess<'de> for &'a mut Deserializer<'de> {
type Error = Error;
#[inline]
fn unit_variant(self) -> Result<()> {
Ok(())
}
... | Rust | 0 |
# Quando usado parenteses é uma tupla, serve para listas que não podem ser alteradas.
time = ("Ronaldo", "Romario", "Neymar", "Pelé", "Ronaldinho")
print (time)
#time.append("Coutinho")
# Adicionando itens a um set
x = set()
x.add(19)
x.add(18)
x.add(10)
x.add(10)
print(x)
#Bolean | Os valores boleanos podem ser a... | Python | 1 |
page: usize = 1;
loop {
let data = client.get(&next_url).send().await?.text().await?;
let data: Value = serde_json::from_str(&data).unwrap();
let data = data.as_object().unwrap();
let packages = data.get("packages").unwrap().as_array().unwrap();
fo... | Rust | 0 |
_base_ = ['co_dino_5scale_r50_8xb2_1x_coco.py']
pretrained = 'https://github.com/SwinTransformer/storage/releases/download/v1.0.0/swin_large_patch4_window12_384_22k.pth' # noqa
# model settings
model = dict(
backbone=dict(
_delete_=True,
type='SwinTransformer',
pretrain_img_size=384,
... | Python | 1 |
# there are different escape sequence ,they are
# \n = new line
# \"" or \'' = to use double quote or single quote in a string
# \\ = if you want to use back slash
a= "hi dhanish is a good boy \n" \
" and he is a bad boy too"
print(a)
a= "hi dhanish is a good \"boy\" "
print(a)
a= "hi dhanish is a good 'boy'"
prin... | Python | 1 |
aging-induced error is uniform across temperature"]
pub const rs2_dsm_correction_model_RS2_DSM_CORRECTION_AOT: rs2_dsm_correction_model = 1;
#[doc = "< Thermal-over-aging; aging-induced error changes alongside temperature"]
pub const rs2_dsm_correction_model_RS2_DSM_CORRECTION_TOA: rs2_dsm_correction_model = 2;
pub con... | Rust | 0 |
from .base import BaseAWQForCausalLM
from transformers.models.opt.modeling_opt import OPTForCausalLM, OPTDecoderLayer
class OptAWQForCausalLM(BaseAWQForCausalLM):
layer_type = "OPTDecoderLayer"
max_new_tokens_key = "max_position_embeddings"
@staticmethod
def get_model_layers(model: OPTForCausalLM):
... | Python | 1 |
# Copyright 2025 SqueezeBits, Inc.
#
# 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 required by applicable law or agreed to in wri... | Python | 1 |
0b0_0000),
R1: CoreRegisterAddress(0b0_0001),
R2: CoreRegisterAddress(0b0_0010),
R3: CoreRegisterAddress(0b0_0011),
R4: CoreRegisterAddress(0b0_0100),
R5: CoreRegisterAddress(0b0_0101),
R6: CoreRegisterAddress(0b0_0110),
R7: CoreRegisterAddress(0b0_0111),
R8: CoreRegisterAddress(0b0_1000... | Rust | 0 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
@Description: 人脸识别存储
@Author: Kermit
@Date: 2024-02-19 17:10:54
"""
from typing import Callable
import numpy as np
from store.store import Store
class FaceRecognitionStore:
"""人脸识别存储"""
def __init__(
self,
store_creater: Callable[[bool, int]... | Python | 1 |
lf._input.process_frame(EndFrame(), FrameDirection.DOWNSTREAM)
if self._output:
await self._output.process_frame(EndFrame(), FrameDirection.DOWNSTREAM)
async def _on_audio_track_subscribed(self, participant_id: str):
await self._call_event_handler("on_audio_track_subscribed", participan... | Python | 1 |
Field::Name => {
if name.is_some() {
return Err(de::Error::duplicate_field("name"));
}
name = Some(map.next_value()?);
}
}
}
... | Rust | 0 |
Process().open_files()),
"memory_info": psutil.Process().memory_info()._asdict()
}
return HealthCheckResult(
status=status,
message=message,
details=details,
timestamp=time.time(),
check_duration_ms=... | Python | 1 |
it group with reference counted context. | [`CBox<T>`](crate::boxed::CBox) | [`CArc<Ctx>`](crate::arc::CArc) |
//! | `MyGroupBaseMut<T>` | Base by-mut-ref CGlue trait group. | `&mut T`. | [`NoContext`](crate::trait_group::NoContext) |
//! | `MyGroupBaseCtxMut<T, Ctx>` | Base by-mut-ref CGlue trait group with a context.... | Rust | 0 |
.DEF_PERFORMANCE_HISTORY_ON_RESCHEDULE,
help='default history(in sec) to be collected on a job '
'reschedule'),
cfg.IntOpt('performance_timestamp_overlap',
default=constants.TelemetryCollection
.DEF_PERFORMANCE_TIMESTAMP_OVERLAP,
... | Python | 1 |
import pytest
from ape.utils.misc import LOCAL_NETWORK_NAME
from tests.conftest import geth_process_test
@pytest.fixture
def mock_geth_sepolia(ethereum, geth_provider, geth_contract):
"""
Temporarily tricks Ape into thinking the local network
is Sepolia so we can test features that require a live
net... | Python | 1 |
utex();
// sync::test::philosopher_using_monitor();
// sync::mpsc::test::test_all();
}
/// Global heap allocator
///
/// Available after `memory::init()`.
///
/// It should be defined in memory mod, but in Rust `global_allocator` must be in root mod.
#[global_allocator]
static HEAP_ALLOCATOR: LockedHeap = Locked... | Rust | 0 |
mlist/jsons/undefiable_list_separated", true)?;
// We call "adjust_versions" manually here.
// "load_dochy_file"/"load_history_file" automatically adjusts versions, so calling this manually isn't necessary.
let r = adjust_versions(new, old, true)?;
let mut r = RootIntf::new(r);
//"list" is undefin... | Rust | 0 |
('\u{0261}') /* IPA's /g/ */ => if strict { panic!("'\u{0261}' looks like 'g', but it is not.") } else { low!(G) },
Some(a @ ('\u{0251}' /* IPA's /ɑ/ */ | 'α')) => if strict { panic!("'{}' looks like 'a', but it is not.", a) } else { low!(A) },
Some('ο') => if strict { panic!("'ο' looks like 'o', but it... | Rust | 0 |
fonts });
}
fn check_state(
mut commands: Commands,
mut state: ResMut<State<GameState>>,
asset_server: Res<AssetServer>,
loading_state: Res<LoadingState>,
) {
if LoadState::Loaded
!= asset_server.get_group_load_state(loading_state.fonts.iter().map(|handle| handle.id))
{
return;... | Rust | 0 |
some() {
let cmd = self.parse_pipe();
cmds.extend(quote!(.pipe(#cmd)));
if !matches!(self.iter.peek(), Some(ParseArg::Pipe)) {
self.iter.next();
break;
}
self.iter.next();
}
cmds
}
fn parse_pipe(&mut sel... | Rust | 0 |
B, N, C, H, W = images.shape
elif len(images.shape) == 4 and mode =='multi_view':
N, C, H, W = images.shape
B = 1
images, cameras = images[None], cameras[None]
elif len(images.shape) == 4 and mode =='single_view':
B, C, H, W = images.shape
... | Python | 1 |
es: `\"Win32_Media_Multimedia\"`*"]
pub const MCI_DGV_SETVIDEO_SRC_PAL: i32 = 16387i32;
#[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"]
pub const MCI_DGV_SETVIDEO_SRC_PAL_S: i32 = 32787i32;
#[doc = "*Required features: `\"Win32_Media_Multimedia\"`*"]
pub const MCI_DGV_SETVIDEO_SRC_RGB: i32 = 16385i32;
#[do... | Rust | 0 |
assert_eq!(leasingmanager.is_enabled(), false);
leasingmanager.enable();
assert_eq!(leasingmanager.is_enabled(), true);
}
#[ink::test]
fn disable_works() {
let mut leasingmanager = LeasingManager::new(instantiate_erc20_contract(), true);
... | Rust | 0 |
aracter, remove that character and return the resulting string.
fn find_prototype_fabric_id(string1: &str, string2: &str) -> Option<String> {
let mut index_of_diff = 0;
let mut got_diff = false;
let mut got_too_many_diffs = false;
let zipped_iterator = string1.chars().zip(string2.chars());
for (i, ... | Rust | 0 |
= ""]
#[doc = " \\param xyz_image"]
#[doc = " Handle to output xyz image."]
#[doc = ""]
#[doc = " \\remarks"]
#[doc = " \\p depth_image must be of format ::K4A_IMAGE_FORMAT_DEPTH16."]
#[doc = ""]
#[doc = " \\remarks"]
#[doc = " The \\p camera parameter tells the function what the perspe... | Rust | 0 |
metryFilter()
XZGeom.SetInputData(XZGrid)
XZGeom.SetExtent(0,2,0,2,0,2)
XZMapper = vtkPolyDataMapper()
XZMapper.SetInputConnection(XZGeom.GetOutputPort())
XZActor = vtkActor()
XZActor.SetMapper(XZMapper)
XZActor.SetPosition(4,2,0)
ren1.AddActor(XZActor)
# 3D
XYZPts = vtkPoints()
XYZPts.SetNumberOfPoints(8)
XYZPts.SetPo... | Python | 1 |
essageBox.Yes | QtWidgets.QMessageBox.No,
QtWidgets.QMessageBox.Yes
)
if reply == QtWidgets.QMessageBox.Yes:
process = subprocess.Popen(args=[sys.executable, '-m', 'tools.config_editor'],
close_fds=False,
... | Python | 1 |
fn trans_exchange_free_ty<'a, 'tcx>(bcx: &Builder<'a, 'tcx>, ptr: LvalueRef<'tcx>) {
let content_ty = ptr.ty.to_ty(bcx.tcx());
let def_id = langcall(bcx.tcx(), None, "", BoxFreeFnLangItem);
let substs = bcx.tcx().mk_substs(iter::once(Kind::from(content_ty)));
let callee = Callee::def(bcx.ccx, def_id, s... | Rust | 0 |
= load_answersfile_data(dst)
assert "computed" not in answers
def test_conditional_computed_value(tmp_path_factory: pytest.TempPathFactory) -> None:
src, dst = map(tmp_path_factory.mktemp, ("src", "dst"))
build_file_tree(
{
src / "copier.yml": (
"""\
f... | Python | 1 |
}
_ => {}
}
if app_control.should_terminate_process() {
*control_flow = winit::event_loop::ControlFlow::Exit
}
});
}
}
<gh_stars>0
use std::fmt; // Import `fmt`
// aruments are in the reverse()
// returns are after the ->
fn reverse(pair... | Rust | 0 |
); //t0.norm();//24
t0.sub(&t2); t0.norm();//25
t0.mul(&z3);//26
y3.add(&t0); //y3.norm();//27
t0.copy(&self.y); t0.mul(&self.z);//28
t0.dbl(); t0.norm(); //29
z3.mul(&t0);//30
x3.sub(&z3); //x3.norm();//31
t0.dbl(); t0.norm();//32
t1.dbl(); t1.norm();//33
z3.copy(&t0); z3.mul(&... | Rust | 0 |
32_Security_Authentication_Identity\"`*"]
pub const NameCanonical: EXTENDED_NAME_FORMAT = 7i32;
#[doc = "*Required features: `\"Win32_Security_Authentication_Identity\"`*"]
pub const NameUserPrincipal: EXTENDED_NAME_FORMAT = 8i32;
#[doc = "*Required features: `\"Win32_Security_Authentication_Identity\"`*"]
pub const Na... | Rust | 0 |
case)]
pub fn IEEE_lt(input: [SecretI64; 2]) -> SecretI64 {
let ans = unsafe { execute_garbled_circuit!(FP_LT(input) -> SecretI64) };
ans
}
#[inline(always)]
#[allow(non_snake_case)]
pub fn IEEE_floor(input: SecretI64) -> SecretI64 {
let ans = unsafe { execute_garbled_circuit!(FP_FLOOR(input) -> SecretI64)... | Rust | 0 |
#!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import sys
f = open(sys.argv[2], 'w+')
f.write(sys.argv[1])
f.close()
| Python | 1 |
None => {},
Some(node) => {
add_entries_to_cheapest_to_target_node!(node, target, 0);
},
}
for hop in last_hops.iter() {
if first_hops.is_none() || hop.src_node_id != network.our_node_id { // first_hop overrules last_hops
if network.nodes.get(&hop.src_node_id).is_some() {
if first_hops.is_som... | Rust | 0 |
nt",
"contact_email": "COF@communities.gov.uk",
"instructions_json": {
"en": "You must have received an invitation to apply. If we did not invite you, first <a href='https://www.gov.uk/guidance/community-ownership-fund-round-4-how-to-express-your-interest-in-applying'>express your interest i... | Python | 1 |
uf);
PluginWrapper::<P>::handle(plugin, |p| {
P::MainThread::value_to_text(p.main_thread().as_ref(), param_id, value, &mut writer)
.map_err(PluginWrapperError::with_severity(CLAP_LOG_ERROR as i32))
})
.is_some()
&& writer.finish()
}
unsafe extern "C" fn text_to_value<'a, P: Plug... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2015 Tecnativa - Jairo Llopis
# Copyright 2016 Tecnativa - Vicent Cubells
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
{
"name": "Require accepting legal terms to checkout",
"summary": "Force the user to accept legal tems to buy in the web shop",
"... | Python | 1 |
x = cx.argument::<JsNumber>(0)?.value() as usize;
{
let this = cx.this();
let guard = cx.lock();
let ref_ = &(*this.borrow(&guard)).index;
let mut send_index = ref_.lock().unwrap();
send_index.replace(index);
}
... | Rust | 0 |
import _plotly_utils.basevalidators
class LineValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="line", parent_name="layout.newselection", **kwargs):
super(LineValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | Python | 1 |
#!/usr/bin/python
"""
(gdb) disassemble vulnerable
Dump of assembler code for function vulnerable:
0x0000000010000794 <+0>: mflr r0
...
0x00000000100007f4 <+96>: ld r0,16(r1)
0x00000000100007f8 <+100>: mtlr r0
0x00000000100007fc <+104>: ld r31,-8(r1)
0x0000000010000800 <+108>: blr
0x... | Python | 1 |
# *****************************************************************************
# Copyright (c) 2019-2020, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions o... | Python | 1 |
return Response({"success": f"You have unfollowed {username}."}, status=status.HTTP_200_OK)
except CustomUser.DoesNotExist:
return Response({"error": "User not found."}, status=status.HTTP_404_NOT_FOUND)
return Response({"error": "Username is required."}, status=status.HTTP_400_... | Python | 1 |
with warnings.catch_warnings():
warnings.simplefilter("ignore")
p1.train(str(record.seq[:20000]))
# pickle/unpickle the TrainingInfo
ti = pickle.loads(pickle.dumps(p1.training_info))
p2 = GeneFinder(meta=False, training_info=ti, min_gene=60)
# make sure the same ... | Python | 1 |
}
})
.collect();
let checks: TokenStream2 = choices
.iter()
.zip(weights_opt.iter())
.enumerate()
.filter(|(_, (_, weight))| weight.is_some())
.map(|(i, (choice, _))| {
let body = body_fn(choice, i)?;
Ok(quote! { if roll < ... | Rust | 0 |
}
}
}
impl StaticType for RelayType {
fn static_type() -> Type {
unsafe { from_glib(ffi::nice_relay_type_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for RelayType {
unsafe fn from_value_optional(value: &glib::Value) -> Option<Self> {
Some(FromValue::from_value(value))
... | Rust | 0 |
0..KYBER_K {
aes256ctr_squeezeblocks(&mut buf.coeffs, NOISE_NBLOCKS, &mut state);
state.n = _mm_loadl_epi64([nonce, 0].as_ptr() as *const __m128i);
nonce += 1;
poly_cbd_eta1_90s(&mut sp.vec[i], &buf);
}
for i in 0..KYBER_K {
aes256ctr_squeezeblocks(&mut buf.coeffs, C... | Rust | 0 |
jump
Instr("JUMP_FORWARD", label2),
label,
Instr("LOAD_CONST", 1),
Instr("STORE_NAME", "x"),
Instr("LOAD_NAME", "test"),
Instr("POP_JUMP_IF_TRUE", label3),
label2,
Instr("JUMP_FORWARD", label... | Python | 1 |
if itemType(item) in [1,2]:
outputStack.push(float(item))
#if operator
elif itemType(item) == 0:
while operatorStack.__len__() > 0 and operatorStack.peek() != "(" and popFromOperatorStack(item,operatorStack.peek()):
outputStack.push(operatorStack.pop())
... | Python | 1 |
h_stars>1-10
use crate::Garbler;
/// Trait for values that can be garbled
pub trait Garble: Sized {
/// Output type after a garbling
///
/// In most cases, this will be the same as the input type.
type Output;
/// Garble the data with the given garbler
fn garble<G>(self, garbler: &mut G) -> Se... | Rust | 0 |
Self(point.compress().to_bytes())
}
}
impl TryFrom<&PodRistrettoPoint> for RistrettoPoint {
type Error = Curve25519Error;
fn try_from(pod: &PodRistrettoPoint) -> Result<Self, Self::Error> {
CompressedRistretto::from_slice(&pod.0)
.decompress()
... | Rust | 0 |
1829680439\"},\"messageId\":1638,\"publishDate\":\"2024-09-29T06:53:10Z\",\"message\":\"সিএসকে এমএস ধোনিকে ৪ কোটি টাকায় আনক্যাপড খেলোয়াড় হিসেবে ধরে রাখতে পারবে, কারণ আইপিএলের একটি পুনর্জীবিত নিয়ম ভারতীয় খেলোয়াড়দের, যারা পাঁচ বছর ধরে আন্তর্জাতিক ক্রিকেট থেকে অবসর নিয়েছে, আনক্যাপড হিসেবে শ্রেণীবদ্ধ করার অনুমতি দে... | Python | 1 |
al(self, pos, max_pos),
TerminalSymbol::Metasymbol(metasymbol) => match metasymbol {
Metasymbol::Empty => self.to_epsilon_ast(pos),
Metasymbol::Failure => self.to_failed_ast(pos),
Metasymbol::Any(n) => self.to_any_ast(pos, max_pos, *n),
Metasym... | Rust | 0 |
ER_CORE_CONTROLLER_DOWNGRADE: u32 = 5000;
/// Ticks per body part that invader cores of each level take to spawn defensive
/// creeps.
#[inline]
pub fn invader_core_creep_spawn_time(core_level: u32) -> Option<u32> {
match core_level {
1 => Some(0),
2 => Some(6),
3 => Some(3),
4 => S... | Rust | 0 |
// * Is a memory leak possible in safe code?
// * Yes: If the user uses something like `Box::leak()`, `ManuallyDrop`, or
// `core::mem::forget`, the destructor will not be called even though the struct
// is dropped. However, it is documented tha... | Rust | 0 |
;color: #008B8B;">Sizler için Derlediklerimiz</h3>**', unsafe_allow_html=True)
random_home = df[~df["price"].isna()].sample(5)
for i, col in enumerate(columns):
with col:
col.markdown(f"""
<div style="border: 1px solid #dee2e6; border-radius: 0.25rem; margin-bottom: 1rem; pa... | Python | 1 |