text string | label_name string | labels int64 |
|---|---|---|
}
/// Change the buffer/block size configuration while the audio thread is still
/// running. Support for this will depend on the backend.
///
/// If the given config is invalid, an error will be returned with no
/// effect on the running audio thread.
#[allow(unused_variables)]
fn change_b... | Rust | 0 |
one + Send + 'static,
{
// Proxies everything if there is no ACL configured.
if server.context().acl().is_none() {
return ProxyAssociation::associate_proxied(src_addr, server, sender).await;
}
// Create a socket for receiving packets
let local_addr = SocketAddr::... | Rust | 0 |
"""Test DIDWebRegistry."""
import re
import pytest
from ..registry import DIDWebRegistry
DID_WEB = re.compile(
r"^did:web:[a-z0-9]+(?:\.[a-z0-9]+)*(?::\d+)?(?:\/[^#\s]*)?(?:#.*)?\s*$"
)
TEST_WED_DID_0 = "did:web:example.com/anoncreds/v0/SCHEMA/asdf"
TEST_WED_DID_1 = "did:web:example.com"
TEST_WED_DID_2 = "did... | Python | 1 |
.await
.map_err(|_err| Status::InternalServerError)?
{
return Err(Status::InternalServerError);
}
// student permission
let student_id = new.student_id.clone();
if !db
.run(move |client| student::permission(client, &student_id, &group_id))
.await
.map... | Rust | 0 |
# Funkcijos "ar_berniukas" aprašymas
def ar_berniukas(mokinys):
# gauti paskutinę raidę
raide = mokinys[-1]
# Jeigu vardas baigesi S, tuomet mes radome berniuką ir IŠEINAME iš funkcijos
if raide == "s":
# Grąžinamas rezultatas True - reiškia radome berniuką
return True
# Jeigu ... | Python | 1 |
(&hex::encode(a));
}
io::copy(&mut a.as_ref(), art)
}
Hex => {
let mut i = HexInput::new(r);
io::copy(&mut i, art)
}
}
}
fn str_opt<'a>(s: &'a Option<String>, d: &'static str) -> &'a str {
if let Some(s) = s {
&s
} else {
d
}
}
fn main_() -> Result<(), BishopCliErro... | Rust | 0 |
)?;
}
} else {
let (pa, fused) = &*op.micro_ops.as_ptr();
let c_store = c_storage.wrap(&c.view_mut());
let mut f = Vec::with_capacity(fused.len() + 1);
f.push(FusedSpec::AddMatMul {
k: geometry.k,
a: op.mmm.a_packed(size... | Rust | 0 |
b' => {
'c',
'd',
'e',
},
}
};
let mut manual_tree = Tree::new('a');
{
let mut root = manual_tree.root_mut();
let mut node = root.append('b');
node.append('c');
node.append('d');
node.append('e');
... | Rust | 0 |
ues()]
ideal_Q_values = [value[1] for value in constellation_map.values()]
# Plot constellation map
plt.figure(figsize=(8, 8))
plt.scatter(I_points, Q_points, marker='o', color='b')
plt.scatter(ideal_I_values, ideal_Q_values, marker='o', color='r')
plt.xlabel('I')
plt.ylabel('Q')
plt.title('Constellation Map (Average ... | Python | 1 |
&E>
where
E: ::std::fmt::Display + ::std::fmt::Debug + Send + Sync + 'static,
{
self.inner.downcast_ref::<E>()
}
/// The lowest level cause of this error — this error's cause's cause's cause etc.
pub fn root_cause(&self) -> &(d... | Rust | 0 |
stroke_color(rgba(255,255,255,192));
vg.stroke();
paint = vg.radial_gradient(ax,ay, 7.0,9.0, rgba(0,0,0,64), rgba(0,0,0,0));
vg.begin_path();
vg.rect(ax-20.0,ay-20.0,40.0,40.0);
vg.circle(ax,ay,7.0);
vg.path_winding(Solidity::HOLE);
vg.fill_paint(paint);
vg.fill();
vg.restore();
... | Rust | 0 |
(
"generate",
should_continue,
{END: END, "reflect": "reflect"}
)
builder.add_edge("planner", "research_plan")
builder.add_edge("research_plan", "generate")
builder.add_edge("reflect", "research_critique")
builder.add_edge("research_critique", "generate")
graph = builder.compile(checkpointer=memory)
f... | Python | 1 |
dyn Error>> {
let mut decoder = Decoder::new(chunk);
decode_frames(&mut decoder)
}
#[allow(dead_code)]
fn decode_frames<R: Read>(decoder: &mut Decoder<R>) -> Result<Vec<f32>, Box<dyn Error>> {
let mut frames = Vec::new();
loop {
match decoder.next_frame() {
Ok(Frame { data, channels... | Rust | 0 |
= serde_json::from_str(&response)?;
Ok(result)
}
pub(crate) async fn get_projects(endpoint: &str) -> Result<Projects, RmError> {
let response = reqwest::get(endpoint).await?.text().await?;
let result: Projects = serde_json::from_str(&response)?;
Ok(result)
}
#[cfg(test)]
mod tests {
use super::*;... | Rust | 0 |
segmk.add_site_tag(site, 'IDELMUXE3.P2', 0)
elif d['mux_config'] == 'idelay':
segmk.add_site_tag(site, 'IDELMUXE3.P0', 1)
segmk.add_site_tag(site, 'IDELMUXE3.P1', 0)
segmk.add_site_tag(site, 'IDELMUXE3.P2', 0)
elif d['mux_config'] == 'none':
... | Python | 1 |
, as_attachment=True, download_name="resume.pdf")
# except Exception as e:
# traceback.print_exc()
# return jsonify({"error": str(e)}), 500
# @app.route("/uploads/<filename>")
# def uploaded_file(filename):
# return send_from_directory(UPLOAD_FOLDER, filename)
# if __name__ == "__main__":
# ... | Python | 1 |
"` header if we've been asked to
if add_if_match {
req.headers_mut().set(IfMatch::Any);
}
// add request body if there is any
if let Some(body) = body {
let serialized = serde_json::to_string(&body)?;
... | Rust | 0 |
# Conversions
print("Conversion".center(60,"-"))
print("{val} {val} {val}".format(val = "A"))
print("{val!s} {val!r} {val!a}".format(val = "A"))
print("-" * 60)
print("The number {num} {num} {num}".format(num=36))
print("The number {num} {num:f} {num:b}".format(num=36))
print("The number {num:10} {num:f} {num:b}".form... | Python | 1 |
25519::Public>("Charlie//stash"),
get_account_id_from_seed::<sr25519::Public>("Dave//stash"),
get_account_id_from_seed::<sr25519::Public>("Eve//stash"),
get_account_id_from_seed::<sr25519::Public>("Ferdie//stash"),
]
}
// Elexeum-navtive chain spec
#[cfg(feature = "elexeum-native")]
use elexeum_runtime as elexe... | Rust | 0 |
# 최대 hp: 몬스터 공격력 * ceil(몬스터 공격력 / 용사 공격력)
import math
end = 0 #max_hp
N, H_atk, = map(int, input().split())
data = []
for i in range(N):
t, a, h = map(int, input().split())
data.append((t, a, h))
#몬스터인 경우
if t == 1:
end += a * math.ceil(h / H_atk)
def simulation(max_hp, H_atk):
cur_hp = max... | Python | 1 |
on - MIN_LON) * 8) + scale * 0.7 * np.cos((lat - MIN_LAT) * 9) + np.random.normal(0, noise, len(coords)))
coords = np.column_stack([xx.ravel(), yy.ravel()])
grid_soil_perm = np.clip(smooth_field(coords, 0.55, 0.20, noise=0.02), 0.05, 0.95)
grid_rainfall = smooth_field(coords, 2400, 120, noise=5.0)
grid_dtw = np.clip(s... | Python | 1 |
# coding=utf-8
# Copyright 2024 HuggingFace 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 ag... | Python | 1 |
'''
Description:
Given two arrays of integers nums and index. Your task is to create target array under the following rules:
Initially target array is empty.
From left to right read nums[i] and index[i], insert at index index[i] the value nums[i] in target array.
Repeat the previous step until there are no elements ... | Python | 1 |
_none().0, caps.0))
}
}
fn get_compatible_pad_template(&self, compattempl: &PadTemplate) -> Option<PadTemplate> {
unsafe {
from_glib_none(ffi::gst_element_get_compatible_pad_template(self.to_glib_none().0, compattempl.to_glib_none().0))
}
}
fn get_context(&self, con... | Rust | 0 |
$(
print!("test {} ... ", stringify!($name));
match $name {
Ok(_) => {
println!("{}", "ok".green());
oks += 1;
}
E... | Rust | 0 |
plaza;
pub mod btc_price_bot;
pub mod guess_number;
pub use phala_types::contract::*;
fn account_id_from_hex(s: &str) -> Result<AccountId> {
let bytes = hex::decode(s)
.map_err(Error::msg)
.context("Failed to decode AccountId hex")?;
AccountId::try_from(&bytes[..])
.map_err(|err| anyh... | Rust | 0 |
ack
.back()
.expect("Lexer failed due to empty context");
let (match_type, rules) = RULES_BY_CONTEXT.get(current_context).unwrap();
let matches = rules.iter().enumerate().filter_map(|(i, (reg, _, _))| {
let reg_match = reg
.find_from_pos(input, current... | Rust | 0 |
st, src)
}
/// Accumulate signed area with even-odd fill rule.
fn accumulate_odd_fallback(dst: &mut [u8], src: &mut [i16]) {
let mut sum = 0;
for (d, s) in dst.iter_mut().zip(src.iter_mut()) {
sum += *s;
*s = 0;
let v = sum & 0xFF;
let odd = sum & 0x100;
let c = (v - odd... | Rust | 0 |
#!/usr/bin/env python3
import os
import requests
import re
def manual_license_download(url, package_name):
folder_path = os.path.join(".", "internal", "embedded", "_data", "licenses", package_name)
license_file_name = os.path.normpath(os.path.join(folder_path, "LICENSE"))
if not os.path.exists(license_fil... | Python | 1 |
#!/usr/bin/python3
# script that takes in the name of a state as an argument,
# and lists all 'cities' of that state, using the database 'hbtn_0e_4_usa'
"""
import 'sys' & 'MySQLdb'
"""
import sys
import MySQLdb
if __name__ == "__main__":
db = MySQLdb.connect(user=sys.argv[1], passwd=sys.argv[2], db=sys.argv[3]... | Python | 1 |
}
"nistp521" => {
let val = parse_openssh_buffer(inp)?;
if val[0] != 4 || val.len() != 133 {
return Err(SSHKeyParseError::InvalidECPointCompression);
}
let x = U576::from_bytes(&val[1..67]);
let y... | Rust | 0 |
is relative, b is relative */
|| op == (x + 20000) /* dest is relative */
|| op == (x + 20100) /* dest is relative, a immediate */
|| op == (x + 21100) /* dest is relative, a immediate, b immediate */
|| op == (x + 21200) /* dest is relative, a relative, b immediate */
|| op == (x + 22100) /* dest... | Rust | 0 |
atProp.html)
/// - `optrhs` - Transpose right hand side before the function is performed, uses one of the values of [MatProp](./enum.MatProp.html)
///
/// # Return Values
///
/// The result Array of matrix multiplication
#[allow(unused_mut)]
pub fn matmul<T>(lhs: &Array<T>, rhs: &Array<T>, optlhs: MatProp, optrhs: MatP... | Rust | 0 |
ay = AgentArray.GetNeutralArray()
spirit_pet_array = AgentArray.GetSpiritPetArray()
minion_array = AgentArray.GetMinionArray()
npc_minipet_array = AgentArray.GetNPCMinipetArray()
item_array = AgentArray.GetItemArray()
gadget_array = AgentArray.GetGadgetArray()
de... | Python | 1 |
freq1 word_type1
/// word2 freq2 word_type2
/// ...
/// Word type may be ignored
pub fn load_user_dict(&mut self, f_name: &str) -> Result<(), std::io::Error> {
self.check_initialized();
let mut contents = String::new();
File::open(&f_name)?.read_to_string(&mut contents)?;
... | Rust | 0 |
} else if tof.starts_with(b"MZ") {
ids.push(DataCell::StaticId("dos_exe"))?;
} else if tof.starts_with(b"ZM") {
ids.push(DataCell::StaticId("dos_exe"))?;
ids.push(DataCell::StaticId("dos_exe_zm"))?;
} else if tof.starts_with(b"\x1F\x8B") {
ids.push(Data... | Rust | 0 |
?)?$ # Group
'''
),
('bare',
# Show.Name.102.Source.Quality.Etc-Group
'''
^(?P<series_name>.+?)[. _-]+ # Show_Name and separator
(?P<season_num>\d{1,2}) # 1
... | Python | 1 |
type MS = MultiServiceImpl<ServiceID, ConnID, Codecs> ;
fn main()
{
flexi_logger::Logger::with_str( "warn, tungstenite=warn, mio=warn, ws_stream_tungstenite=warn, hyper=warn, tokio=warn" ).start().unwrap();
rt::spawn( accept_ws() ).expect( "spawn accept_ws" );
... | Rust | 0 |
le' or cls_is_owner:
is_init = name == '__init__'
is_special = not is_init and name.startswith('__') and name.endswith('__')
is_private = not is_init and not is_special and name.startswith('_')
inc_init = app.config.napoleon_include_init_with_doc
inc_special =... | Python | 1 |
let mut params = None;
for item in &list.nested {
match item {
syn::NestedMeta::Meta(syn::Meta::NameValue(nv))
if nv.path.get_ident().map(|id| *id == "iter").unwrap_or(false) =>
{
kind = Some(CpuDirectiveMethodKind::parse_from(... | Rust | 0 |
win=float(gross_profit / winning_trades) if winning_trades > 0 else 0,
avg_loss=(
float(gross_loss / (len(df) - winning_trades))
if (len(df) - winning_trades) > 0
else 0
),
max_win=float(df["pnl"].max()),
max_loss=float(df["... | Python | 1 |
class Solution:
@functools.lru_cache(None)
def canWin(self, currentState: str) -> bool:
# If any of currentState[i:i + 2] == "++" and your friend can't win after
# Changing currentState[i:i + 2] to "--" (or "-"), then you can win
return any(True
for i, (a, b) in enumerate(zip(currentState... | Python | 1 |
test]
fn format_string() {
let x = 6;
let y = 5;
assert_ge!(x, y, "{} is greater or equal to {}", x, y);
}
#[test]
#[should_panic]
fn incorrect() {
assert_ge!(5, 6);
}
}
<reponame>sd2k/social-image
use rand::{self, Rng};
use sha2::{Digest, Sha256};
pub struct Fil... | Rust | 0 |
r
)
self.request_context.message = PresentationRequest()
handler = test_module.PresentationRequestHandler()
responder = MockResponder()
with self.assertRaises(test_module.HandlerException) as err:
await handler.handle(self.request_context, responder)
assert (
... | Python | 1 |
of this disease. Analyze one disease in reasoning step.
3. Return in following json format:
{{
"reason_step":" ..."
}}
"""
}
api_response = query([system_message, user_message])
try:
api_response = api_response.strip().replace('```json','').replace(... | Python | 1 |
ar_create(par: *mut lv_obj_t, copy: *const lv_obj_t) -> *mut lv_obj_t;
}
extern "C" {
#[doc = " Set a new value on the bar"]
#[doc = " @param bar pointer to a bar object"]
#[doc = " @param value new value"]
#[doc = " @param anim LV_ANIM_ON: set the value with an animation; LV_ANIM_OFF: change the value ... | Rust | 0 |
ription -->
/// @brief Initializes this vp_pool_t
///
/// <!-- inputs/outputs -->
/// @param gs the gs_t to use
/// @param tls the tls_t to use
/// @param sys the bf_syscall_t to use
/// @param intrinsic the intrinsic_t to use
///
pub fn initialize(
&mut self,
... | Rust | 0 |
import logging
import time
from multiprocessing import Process, Queue
from threading import Thread
from typing import Dict, Optional, Callable
from playsound import playsound
from fishy import helper
from fishy.helper.config import config
from fishy.helper.hotkey import process
from fishy.helper.hotkey.process import... | Python | 1 |
# mic_audio = audio_recorder("", icon_size="2x", key="mic_audio")
qa_audio_bytes = audio_recorder("", icon_size="2x")
prompt = cols[2].chat_input(chat_input_placeholder, key="prompt")
# if qa_audio_bytes:
# # user_query, is_success = audio2text(qa_audio_bytes, from_language=st.sessi... | Python | 1 |
DDL_ACE_COND_DEVICE_ATTRIBUTE_PREFIX: &'static str = "@DEVICE.";
pub const SDDL_ACE_COND_TOKEN_ATTRIBUTE_PREFIX: &'static str = "@TOKEN.";
extern "system" {
pub fn ConvertSidToStringSidA(Sid: PSID, StringSid: *mut LPSTR) -> BOOL;
pub fn ConvertSidToStringSidW(Sid: PSID, StringSid: *mut LPWSTR) -> BOOL;
pub ... | Rust | 0 |
'video'],
help='input file type')
args = parser.parse_args()
# set paths
input_root = args.input_root
output_root = args.output_root
assert input_root != output_root
if not exists(output_root):
os.makedirs(output_root, exist_ok=True)
# prepare and find un-processed
inpu... | Python | 1 |
data(&path){
Ok((x_ptr, y_ptr)) => (x_ptr, y_ptr),
Err(e) => panic!("{}", e.get_ref().unwrap()),
};
let x = *x_ptr;
let y = *y_ptr;
let alpha = 0.01; // the learning speed
let mut theta = vec![0.0, 0.0]; // set theta 0 and theta 1 to 0.0
match linear_regression::cost_functi... | Rust | 0 |
.html" }
/// Render the HTML error page
pub fn render_error(ErrorContext) { "pages/error.html" }
}
impl Templates {
/// Render all templates with the generated samples to check if they render
/// properly
pub async fn check_render(&self) -> anyhow::Result<()> {
check::render_login(self).aw... | Rust | 0 |
# Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 1 |
str_is_nqchar("\u{000B}"));
assert!(! str_is_nqchar("\u{000C}"));
assert!(! str_is_nqchar("\u{000D}"));
assert!(! str_is_nqchar("\u{000E}"));
assert!(! str_is_nqchar("\u{000F}"));
assert!(! str_is_nqchar("\u{0010}"));
assert!(! str_is_nqchar("\u{0011}"));
assert!(! str_is_nqchar("\u{0012}")... | Rust | 0 |
"consensus_raft".into(),
ConsensusType::Bft => "consensus_bft".into(),
};
execute_init_chain(InitChainOpts {
chain_name: chain_name.into(),
config_dir: config_dir.into(),
})
.unwrap();
execute_init_chain_config(InitChainConfigOpts {
chain_name: chain_name.into(),
... | Rust | 0 |
print('Hello, world! lalala 12345678') | Python | 1 |
import cv2
import torch
import numpy as np
import pandas as pd
import copy
seed = 42
torch.seed = seed
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
def preproc_mlp(image) -> torch.Tensor:
""" Preprocess image for input to model.
Args: image: OpenCV image in BGR format
Return: te... | Python | 1 |
ostname",
name=TEST_ZEROCONF_NAME,
port=None,
properties={ZEROCONF_MAC: TEST_MAC},
type="mock_type",
),
)
assert result["type"] == "form"
assert result["step_id"] == "user"
assert result["errors"] == {}
result = await hass.config_entries.flow... | Python | 1 |
) {
if let Some(state) = self.elements.get_mut(&id) {
state.current_tab = tab;
} else {
self.elements.put(
id,
ElementState {
current_tab: tab,
..ElementState::default()
},
);
... | Rust | 0 |
_Exedit_TraScript_ProcessingTrackBarIndex = Self::getHex(
iniFilePath.as_ptr(),
appName.as_ptr(),
b"Exedit_TraScript_ProcessingTrackBarIndex\0".as_ptr(),
);
self.m_Exedit_TraScript_ProcessingObjectIndex = Self::getHex(
iniFilePath.as_ptr(),
app... | Rust | 0 |
0-9]){0,1}[0-9]))\b",
replacement: "<REDACTED-IPV4: {}>",
use_map: MapType::Function(redact_ipv4),
},
// First line of matcher: IPv6 without ::
// Second line: IPv6 with embedded ::
// Third line: IPv6 starting with :: and 3-7 non-zero fields
// Fourth line: IPv6 with 3-7 non-zero fi... | Rust | 0 |
const ALchar) } == AL_TRUE {
Ok($ext{
$($const_: {
let e = unsafe { api.alGetEnumValue(concat!(stringify!($const_), "\0").as_bytes().as_ptr() as *const ALchar) };
if e != 0 && unsafe { api.alGetError() } == AL_NO_ERROR {
Ok(e)
} else {
Err(ExtensionError)
}
}... | Rust | 0 |
eq(&value_valid));
assert_that!(&passport.with_ecl("hzl").ecl, eq(&value_valid));
assert_that!(&passport.with_ecl("oth").ecl, eq(&value_valid));
assert_that!(&passport.with_ecl("abc").ecl, eq(&value_invalid));
}
#[test]
fn passport_with_pid_validates_value() {
let passport... | Rust | 0 |
&mut self,
/// problem: &mut Problem<O>,
/// state: IterState<P, G, J, H, F>,
/// ) -> Result<(IterState<P, G, J, H, F>, Option<KV>), Error> {
/// // Compute single iteration of algorithm, update `state`.
/// // Implementing this method is required.
/// Ok((state, None))
/// ... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
from sympy import residue, Symbol, Function, sin, S, I, pi, exp, log, pi, factorial
from sympy.utilities.pytest import XFAIL, raises
from sympy.abc import x, y, z, a, s
def test_basic1():
assert residue(1/x, x, 0) == 1
assert residue(-2/x, x, 0) == -2
assert residue(81/x, x, 0) == 81
assert residue(1/... | Python | 1 |
3 {
has_automation = true;
automation_wrapper.add(&build_lfo_row(relm, &model.variable_range, 0, lfo_x));
automation_wrapper.add(&build_lfo_row(relm, &model.variable_range, 1, lfo_y));
automation_wrapper.add(&build_lfo_row(relm, &model.var... | Rust | 0 |
port: u16,
/// RTP synchronisation source assigned by the server to the client.
pub ssrc: u32,
}
use crate::ffi3::object::*;
use std::os::raw::{c_char, c_int, c_void};
#[cfg_attr(windows, link(name = "pythonXY"))]
extern "C" {
#[cfg_attr(PyPy, link_name = "PyPyCapsule_Type")]
pub static mut PyCapsule_... | Rust | 0 |
import gc
from os.path import dirname, join
import multiprocessing
import sys
import time
import unittest
import warnings
from unittest.suite import TestSuite
from numba.testing import load_testsuite
try:
import faulthandler
except ImportError:
faulthandler = None
else:
try:
# May fail in IPython... | Python | 1 |
could add other handle-like types in the future.
/// And it's possible that we'll want to optimize the representation, possibly
/// by finding an unused bit in the `RawHandle` and `RawSocket` representations
/// which we can repurpose as a discriminant.
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Ord, PartialOrd)... | Rust | 0 |
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 1 |
copied().collect();
let mut iter = x.union(&y);
assert_eq!(iter.size_hint(), (3, Some(5)));
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.size_hint(), (2, Some(4)));
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.size_hint(), (1, Some(2)));
}
#[test]
// Only tests the simple function d... | Rust | 0 |
kadot_transaction_loc(Origin::signed(LOC_OWNER1), LOC_ID, LOC_REQUESTER_ID));
assert_err!(LogionLoc::make_void_and_replace(Origin::signed(LOC_OWNER1), LOC_ID, REPLACER_LOC_ID), Error::<Test>::ReplacerLocAlreadyVoid);
});
}
#[test]
fn it_fails_replacing_with_loc_already_replacing_another_loc() {
new_test_ext().exec... | Rust | 0 |
signal: array-like
:type n_coeff: integer
:type q_oversample: int
:type window: array-like
:return: Tuple of Gabor coefficients, biorthogonal window associated with the synthesis window.
:rtype: tuple
"""
if n_coeff is None:
n_coeff, _ = divider(signal.shape[0])
if q_oversample ... | Python | 1 |
from argparse import ArgumentParser
from collections import defaultdict
import os
if __name__ == '__main__':
parser = ArgumentParser()
parser.add_argument('--save_dir', '-s', type=str, help='Directory containing input video frames.')
parser.add_argument('--label_dir', '-l', type=str, help='Directory cont... | Python | 1 |
import asyncio
import threading
import queue
from time import sleep
import worker
import byLinkWorker
from src.mainSrc.search_bot.bots.utils.databaseManagment import db, COLLECTION, get_document, set_user_data
from database.mongodb import Database
from datetime import datetime
import pytz
import os
import json
LISTENE... | Python | 1 |
match jete_de_de {
3 => ajouter_chapeau_fantaisie(),
7 => enleve_chapeau_fantaisie(),
autre => deplace_joueur(autre),
}
fn ajouter_chapeau_fantaisie() {}
fn enleve_chapeau_fantaisie() {}
fn deplace_joueur(nombre_cases: u8) {}
// ANCHOR_END: here
}
<gh_stars>1000+
// run... | Rust | 0 |
_KEY::KEY_LEFTSHIFT, EV_KEY::KEY_5],
// Safety: We know this method will only be called after
// needs_multikey returns true
_ => unsafe { unreachable_unchecked() },
}
}
/// Get the key at (posx, posy), if it exists
pub fn get_key(&self, pos: Point) -> Option<EV_... | Rust | 0 |
rmal."]
TCRW_1,
}
impl From<TCRW_A> for bool {
#[inline(always)]
fn from(variant: TCRW_A) -> Self {
match variant {
TCRW_A::TCRW_0 => false,
TCRW_A::TCRW_1 => true,
}
}
}
#[doc = "Reader of field `TCRW`"]
pub type TCRW_R = crate::R<bool, TCRW_A>;
impl TCRW_R {
#[doc = r"Get enumerated valu... | Rust | 0 |
thislist = ["apple", "banana", "cherry"]
thislist.append("watermelon")
print(thislist)
#['apple', 'banana', 'cherry', 'watermelon'] | 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 under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
r#"
[package]
authors = ["konstin <<EMAIL>>"]
name = "info-project"
version = "0.1.0"
description = "A test project"
homepage = "https://example.org"
keywords = ["ffi", "test"]
[lib]
crate-type = ["... | Rust | 0 |
&[]
}
}
use aoc_runner_derive::{aoc, aoc_generator};
use itertools::Itertools;
use std::collections::BinaryHeap;
use std::error::Error;
use std::fmt;
use std::iter::Sum;
use std::ops::{Add, AddAssign, Neg};
use std::str::FromStr;
type NodeIndex = usize;
#[derive(Debug, Copy, Clone)]
enum Dir {
Left,
... | Rust | 0 |
- General Purpose Fuse 27"]
#[inline(always)]
pub fn gpf27(&self) -> GPF27_R {
GPF27_R::new(((self.bits >> 27) & 0x01) != 0)
}
#[doc = "Bit 28 - General Purpose Fuse 28"]
#[inline(always)]
pub fn gpf28(&self) -> GPF28_R {
GPF28_R::new(((self.bits >> 28) & 0x01) != 0)
}
#[... | Rust | 0 |
df.sort_values(by=['trade_date'], ascending=False, inplace=True)
df = df.reindex(columns=[
"ts_code",
"trade_date",
"open",
"high"... | Python | 1 |
# --8<-- [start:setup]
import polars as pl
# --8<-- [end:setup]
# --8<-- [start:vertical]
df_v1 = pl.DataFrame(
{
"a": [1],
"b": [3],
}
)
df_v2 = pl.DataFrame(
{
"a": [2],
"b": [4],
}
)
df_vertical_concat = pl.concat(
[
df_v1,
df_v2,
],
how="... | Python | 1 |
amount(order, market)?;
if order.price > 0 {
msg!("Trigger market order should not have price");
return Err(ErrorCode::InvalidOrder);
}
if order.trigger_price == 0 {
msg!("Trigger market order trigger_price == 0");
return Err(ErrorCode::InvalidOrder);
}
if order.qu... | Rust | 0 |
@property
def init_dict(self):
return get_consistency_vae_config()
| Python | 1 |
.to_format_element(formatter),
JsAnyForInitializer::JsAnyExpression(expr) => expr.to_format_element(formatter),
}
}
}
#![recursion_limit = "256"]
#![forbid(unsafe_code)]
use indicatif::{
ProgressBar,
ProgressDrawTarget,
ProgressStyle,
};
use num_derive::{
FromPrimitive,
ToPr... | Rust | 0 |
}
#[test]
fn current_process_handle_kind() {
unsafe {
let handle = WinHandle::from_raw(GetCurrentProcess()).unwrap();
assert_eq!(HandleKind::Process, handle.kind().unwrap());
}
}
#[test]
fn current_thread_handle_kind() {
unsafe {
let h... | Rust | 0 |
# Simply loads a couple of plugins to ensure that definitions get updated
# correctly.
from paraview.simple import *
from paraview import print_error, print_info
import sys
from paraview import smtesting
smtesting.ProcessCommandLineArguments()
LoadDistributedPlugin('SurfaceLIC', ns=globals())
filename = smtesting.Da... | Python | 1 |
.4f}\n'
f'Test Loss: {test_loss:.4f} - Test Accuracy: {test_accuracy:.4f}\n'
f'F1 Score: {f1:.4f}\n\n')
if test_accuracy > best_test and precision == 1:
folder_name = f"iteration_{iteration}_epoch_{epoch + 1}_acc_{te... | Python | 1 |
Metadata(Role::Timestamp));
}
Ok(trusted_timestamp)
}
None => Err(Error::MissingMetadata(Role::Timestamp)),
}
}
}
#[cfg(test)]
mod test {
use super::*;
use crate::crypto::{HashAlgorithm, PrivateKey, SignatureScheme};
use crate::interchange... | Rust | 0 |
from django.apps import apps
from django.contrib.auth.models import Group, Permission
from django.db.models.signals import post_migrate
from django.dispatch import receiver
UPLOADER_GROUP = 'uploader'
VIEWER_GROUP = 'viewer'
@receiver(post_migrate)
def create_roles_and_permissions(sender, **kwargs):
# Solo ejecut... | Python | 1 |
.0625, 1.1484, 1.2495, 1.3506, 1.4516, 1.5619],
charged_dmg1: [0.4386, 0.4743, 0.51, 0.561, 0.5967, 0.6375, 0.6936, 0.7497, 0.8058, 0.867, 0.9371, 1.0196, 1.1021, 1.1845, 1.2745],
charged_dmg2: [1.24, 1.333, 1.426, 1.55, 1.643, 1.736, 1.86, 1.984, 2.108, 2.232, 2.361, 2.5296, 2.6982, 2.8669, 3.0355],
plungi... | Rust | 0 |
_value: Evaluation,
// Maximum depth used to produce the move.
actual_depth: u8,
// Nodes explored at each depth.
nodes_explored: Vec<u64>,
pv: Vec<<E::G as Game>::M>,
wall_time: Duration,
}
impl<E: Evaluator> Drop for LazySmp<E>
where
<E::G as Game>::S: Clone + Zobrist,
<E::G as Game>:... | Rust | 0 |
from __future__ import annotations
import re
# https://en.cppreference.com/w/c/keyword
_keywords = [
'auto', 'break', 'case', 'char', 'const', 'continue', 'default', 'do', 'double',
'else', 'enum', 'extern', 'float', 'for', 'goto', 'if', 'inline', 'int', 'long',
'register', 'restrict', 'return', 'short', ... | Python | 1 |
phics_Direct2D_Common\"`*"]
pub struct D2D_MATRIX_4X4_F {
pub Anonymous: D2D_MATRIX_4X4_F_0,
}
impl ::core::marker::Copy for D2D_MATRIX_4X4_F {}
impl ::core::clone::Clone for D2D_MATRIX_4X4_F {
fn clone(&self) -> Self {
*self
}
}
#[repr(C)]
#[doc = "*Required features: `\"Win32_Graphics_Direct2D_Com... | Rust | 0 |
rn == "pattern8" and src_col == 2:
if " " in value:
value = value.split(" ")[0]
else:
value = value.replace(" ", "")
ne... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.