text string | label_name string | labels int64 |
|---|---|---|
, 0, 0, 0, 0, 0, 1];
let string = String::from("test");
// Simple transformations from primitive Avro Schema types
// to Avro Values.
let valid_pairings = vec![
(ScalarType::Bool, Datum::True, Value::Boolean(true)),
(ScalarType::Bool, Datum::False, Value::Boolean... | Rust | 0 |
node types. This way, computing the falseness of a
/// node is one [`HashMap`] lookup and some row transpositions.
#[derive(Debug, Clone)]
pub(super) struct FalsenessTable {
falseness: HashMap<RowRange, Vec<(RowRange, RowBuf)>>,
}
impl FalsenessTable {
/// Creates a `FalsenessTable` capable of efficiently gen... | Rust | 0 |
self, exec_ctx, trace_ctx, &mut completeness_updater, SubtreeType::Left)?;
// execute a right subtree of par
let right_result = execute_subtree(self, exec_ctx, trace_ctx, &mut completeness_updater, SubtreeType::Right)?;
completeness_updater.set_completeness(exec_ctx);
prepare_par_resul... | Rust | 0 |
ion_id: i32,
orders: HashMap<i32, TypeOrders>,
}
/// `WorkerHandler` struct ...
pub struct WorkerHandler {
region_id: i32,
running: Arc<Mutex<bool>>,
worker: Arc<Mutex<Worker>>,
clients: ClientList,
}
impl WorkerHandler {
/// `WorkerHandler` constructor ...
pub fn new(region_id: i32, clien... | Rust | 0 |
w: &'a mut W,
}
impl<'a> _TMRB6TRIGW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: TMRB6TRIGW) -> &'a mut W {
{
self.bits(variant._bits())
}
}
#[doc = "Trigger source is disabled. value."]
#[inline]
pub fn dis(self) -> &'... | Rust | 0 |
wRound(15, 4, 1, 700),
Event::CollatorLeft(2, 400, 700),
Event::CollatorChosen(5, 1, 700),
Event::NewRound(20, 5, 1, 700),
];
assert_eq!(events(), expected);
});
}
#[test]
fn collator_selection_chooses_top_candidates() {
ExtBuilder::default()
.with_balances(vec![
(1, 1000),
(2, 1000),
(... | Rust | 0 |
RwLock<QC>,
locked_qc: RwLock<QC>,
nodes: RwLock<HashMap<Hash, Node>>,
proposals: RwLock<HashMap<Hash, Node>>,
support: Arc<S>,
}
impl<S> Storage<S>
where
S: ConsensusSupport,
{
pub fn new(support: Arc<S>) -> CommonResult<Self> {
let genesis_qc = Self::get_genesis_qc(&support)?;
let this = Self {
base_c... | Rust | 0 |
ity(arguments: Term) -> u8 {
match arguments.decode().unwrap() {
TypedTerm::Nil => 0,
TypedTerm::List(cons) => cons.count().unwrap().try_into().unwrap(),
_ => {
panic!(
"Arguments {:?} are neither an empty nor a proper list",
arguments
... | Rust | 0 |
from scipy.spatial.transform import Rotation as R # type: ignore
import numpy as np
class event:
def __init__(self, inertial_coordinates):
"""
Generates an "Event" at a particular coordinate in the inertial frame.
The velocity is (0,0,0) (static event) by default.
The luminosity i... | Python | 1 |
# -*- coding: utf-8 -*-
# $Id: de.py 8006 2016-12-22 23:02:44Z milde $
# Authors: Engelbert Gruber <grubert@users.sourceforge.net>;
# Lea Wiemann <LeWiemann@gmail.com>
# Copyright: This module has been placed in the public domain.
# New language mappings are welcome. Before doing a new translation, please
# ... | Python | 1 |
import pandas as pd
from rdkit import Chem
import random
from tqdm import tqdm
from timeout_decorator import timeout, TimeoutError
from itertools import product
# 示例数据框
df = pd.read_csv('/home/dy/sw/big/Ga_nosame.csv')
# 定义数据增广函数
def randomize_smiles(smiles, random_type="shuffle"):
mol = Chem.MolFromSmiles(smile... | Python | 1 |
let (mut p, track) = new();
p.play(track).unwrap();
thread::sleep(Duration::from_secs(5));
p.drain_sink();
thread::sleep(Duration::from_secs(3));
p.replay();
thread::sleep(Duration::from_secs(5));
}
// do_skip_duration will resolve to infinite loop when skip... | Rust | 0 |
<KEY>",
"<KEY>",
"0x2c0e9f70303690b7e14cb877cd268d9781e0050668e9665f04ea09f94ab0817c",
"<KEY>",
"0x274b78559e51e5426dc8ff296a065973bee858b2434639f66f58d466f9d99af4",
"<KEY>",
"0x597a123502768a985def858caf2fc0b2de9e4c4226799a5dc592de58d6a35f56",
"0x2a0c027d819603f0735178ad5f7bf87ca5b9387ed0a3... | Rust | 0 |
import os
import time
from playwright.sync_api import Playwright, sync_playwright, expect
from dotenv import load_dotenv
from tqdm import tqdm
load_dotenv()
UID = os.environ.get("UID")
KEY = os.environ.get("KEY")
time_set = 60*5
def run(playwright: Playwright) -> None:
browser = playwright.chromium.launch(headles... | Python | 1 |
#-----------------------------------------------------------------------------
# Copyright (c) 2005-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | Python | 1 |
class Argument:
"""
Class representing an argument in the argumentation framework.
Attributes:
text (str): The text of the strongest supporting phrase.
polarity (str): The polarity of the argument ('POS' or 'NEG').
supporters (list): List of supporting arguments.
attackers (l... | Python | 1 |
import torch
from scipy.spatial.transform import Rotation as R
from utils.commons.tensor_utils import convert_to_tensor
def rot2euler(rot, use_radian=True):
r = R.from_matrix(rot)
return r.as_euler('xyz', degrees=not use_radian)
def euler2rot(euler, use_radian=True):
r = R.from_euler('xyz',euler, degrees... | Python | 1 |
self) -> impl Iterator<Item = &Checksum> {
self.iter().filter_map(|l| l.checksum.as_ref())
}
/// Iterate by emission [Token].
pub fn iter_emit_tokens<'a>(&'a self) -> impl Iterator<Item = Token<'input>> + 'a {
TokenizingIterator {
field_iterator: self.iter_fields().peekable(),
... | Rust | 0 |
params": {},
"message": "149aafa27b041f3523c53d7acba1905fa6b1c90f9fef137568101f44b531a3cb"
},
"cipher": {
"function": "aes-128-ctr",
"params": {
"iv": "264daa3f303d7259501c93d997d84fe6"
... | Rust | 0 |
.await?;
continue;
}
Err(e) => {
return Err(e.into());
}
}
}
}
async fn send(
&self,
provider: &PF::Provider,
nonce: U256,
) -> ProviderResult<
TransactionSubmission... | Rust | 0 |
v], None);
y4m_enc.write_frame(&rec_frame).unwrap();
}
use anyhow::Result;
fn main() -> Result<()> {
let o = Opts::from_args();
let v = Vector::new(16374, 257, 14);
let rz = RotateZoom::new(o.width, o.height);
let bit_depth = 8;
let csp = match (o.chroma_sampling, bit_depth) {
(Chro... | Rust | 0 |
opcao = ''
while opcao != 'sair':
print('Menu:')
print('1 - Textos: ')
print('2 - Calculos: ')
print('3 - Docs: ')
opcao = inp('D') | Python | 1 |
break
else:
print("Opción no válida del submenu, debe estar entre 1 y 3")
else:
if opcion == 2 :
usuario = input("Ingrese el nuevo usuario: ")
c... | Python | 1 |
from ast import BoolOp
from ast import Expr
from ast import Load
from ast import Module
from ast import Name
from ast import Or
from ast import Slice
from ast import Starred
from ast import Store
from ast import Subscript
from ast import Tuple
tree = Module(
body=[
Expr(
value=Subscript(
... | Python | 1 |
from django.shortcuts import render, redirect
from django.http import HttpResponse
from django.contrib.auth.models import User
from django.contrib.messages import constants
from django.contrib import messages
from django.contrib import auth
# Create your views here.
def cadastro(request):
if request.method == "GET... | Python | 1 |
et.json
- post.json
- put.json
- delete.json{nc}
{green}In Read Only mode we create files like get.json,
post.json, put.json, and delete.json, instead of index.json{nc}
{green}Thus as per above structure:{nc}
{cyan}/pets{nc} will have {purple}GET{nc} ... | Rust | 0 |
import sys
from ctypes import *
libxpa=cdll.LoadLibrary("../../libxpa.so.1.0")
libc=cdll.LoadLibrary(None);
#xpa_t = c_void_p
#xpa = xpa_t(None)
c_byte_p = POINTER(c_byte)
##############
NXPA = 10
##############
def free_bufs(p_arr, len):
for i in range(len):
if p_arr[i]:
print "fre... | Python | 1 |
# from Ultroid import by @PacarFerdilla
# en to id by @PacarFerdilla
# Thanks Ultroid
from telethon.tl.functions.channels import GetFullChannelRequest as getchat
from telethon.tl.functions.phone import CreateGroupCallRequest as startvc
from telethon.tl.functions.phone import DiscardGroupCallRequest as stopvc
from tele... | Python | 1 |
5.12","tradedate":"2015-02-09 00:00:00","changes":"-2.77"}
pub indx_code: String,
pub tclose: String,
pub tradedate: String,
pub changes: String,
}<filename>examples/iter_mdo.rs<gh_stars>100-1000
// Copyright (c) 2014 <NAME> <texitoi(a)texitoi.eu>
//
// This work is free. You can redistribute it and/or ... | Rust | 0 |
);
assert_matches!(stream.next(), Ok(Some(v)) if v == "");
assert_matches!(stream.next(), Ok(Some(v)) if v == "a");
assert_matches!(stream.next(), Ok(Some(v)) if v == "z");
// End of stream
assert_matches!(stream.next(), Ok(None));
assert_matches!(stream.next(), Ok(None));
}
#[test]
fn shou... | Rust | 0 |
TYPE_NETWORK: u32 = 16777216;
pub const BASS_DEVICE_TYPE_SPEAKERS: u32 = 33554432;
pub const BASS_DEVICE_TYPE_LINE: u32 = 50331648;
pub const BASS_DEVICE_TYPE_HEADPHONES: u32 = 67108864;
pub const BASS_DEVICE_TYPE_MICROPHONE: u32 = 83886080;
pub const BASS_DEVICE_TYPE_HEADSET: u32 = 100663296;
pub const BASS_DEVICE_TYP... | Rust | 0 |
from legged_gym import LEGGED_GYM_ROOT_DIR
import numpy as np
import yaml
class Config:
def __init__(self, file_path) -> None:
with open(file_path, "r") as f:
config = yaml.load(f, Loader=yaml.FullLoader)
self.control_dt = config["control_dt"]
self.msg_type = config["... | Python | 1 |
_system(Box::new(system));
let mut env = RedirGuard::new(&mut env);
let redir = "3> foo".parse().unwrap();
block_on(env.perform_redir(&redir)).unwrap();
env.system.write(Fd(3), &[42, 123, 57]).unwrap();
let state = state.borrow();
let file = state.file_system.get("foo").... | Rust | 0 |
import math
def polygon(sides, lenght):
area = (sides * lenght ** 2) / (4 * math.tan(math.pi / sides))
return area
print(polygon(4, 25)) | Python | 1 |
\xe1\xb0M\xc9j\xca$W4A[\
Il\xaf\x18\xec\xdf\x8c\xe5%\xbf\x00\x1a\xf8\x1a\x22\xd0\
\x1b\x82\xf9P(\xd8[7\xbf\x95l\xc6\x1b\x965\xa7\
TRX-\xe9\xba\xe6*\x19\x8b9<\xaa\xe7m6\
\x02\x83G\xf2\x9e\x98\xc3\xf2H9\x07\x98\xcfo\x90\x0c\
<\x9e\x9c`\x9e\xfbC\xff&G\x07?\x0b\xb5\x01>\
vk\xfc\xb7\xd6\x01\xe8\x19\x087\xf6\xc4\xfc\x051\x9f... | Python | 1 |
_id: &str,
) -> Result<types::ResponseInvoiceBillingGroup, AivenError> {
let url = &format!(
"/billing-group/{billing_group}/invoice",
billing_group = encode_param(billing_group_id),
);
let response = make_request!(self, reqwest::Method::GET, url)?;
Ok(response.json().await?)
}
/// Assign project to ... | Rust | 0 |
,
ITEM_EFFECT_CAP_CHANCE_LEGEND = 1009,
ITEM_EFFECT_CAP_CHANCE_HEAVY = 1010,
ITEM_EFFECT_CAP_CHANCE_REPEAT = 1011,
ITEM_EFFECT_CAP_CHANCE_MULTI_THROW = 1012,
ITEM_EFFECT_CAP_CHANCE_ALWAYS = 1013,
ITEM_EFFECT_CAP_CHANCE_SINGLE_THROW = 1014,
}
impl ::protobuf::ProtobufEnum for ItemEffect {
fn... | Rust | 0 |
let k = r3.wrapping_mul(INV);
let mut carry = 0;
::mac_with_carry(r3, k, SIX_MODULUS[0], &mut carry);
r4 = ::mac_with_carry(r4, k, SIX_MODULUS[1], &mut carry);
r5 = ::mac_with_carry(r5, k, SIX_MODULUS[2], &mut carry);
r6 = ::mac_with_carry(r6, k, SIX_MODULUS[3], &mut carry);
r7 = ::mac_with_carr... | Rust | 0 |
# Given an integer array nums, return true if there exists a triple of indices (i, j, k) such that i < j < k and nums[i] < nums[j] < nums[k]. If no such indices exists, return false.
# Example 1:
# Input: nums = [1,2,3,4,5]
# Output: true
# Explanation: Any triplet where i < j < k is valid.
# Example 2:
# Input: ... | Python | 1 |
in a_len..b_len {
inserts.push(b_children[i].clone());
}
let patch = Patch::Insert(inserts);
result.insert(parent_index, patch);
}
}
pub fn patch<T: Display + Eq>(
root: &Rc<Node<T>>,
patches: &HashMap<u32, Patch<T>>
) {
let mut index = 0;
apply(root, patches, &... | Rust | 0 |
Div,
Le,
Lt,
Ge,
Gt,
Eq,
Neq,
And,
Or,
}
//A variable in which the size must be specified (in arguments or return vars)
#[derive(Debug, Clone)]
pub struct Arg {
pub name: String,
pub size: Loc<Const>,
}
#[derive(Debug, Clone)]
pub struct Function {
pub name: Loc<String>,
... | Rust | 0 |
"""
Load all the meshes we can get our hands on and check things, stuff.
"""
try:
from . import generic as g
except BaseException:
import generic as g
class OFFTests(g.unittest.TestCase):
def test_comment(self):
# see if we survive comments
file_name = "comments.off"
m = g.get_mes... | Python | 1 |
),
)
}
fn get_balance(account_id: AccountId) -> Balance {
ink_env::test::get_account_balance::<ink_env::DefaultEnvironment>(account_id)
.expect("Cannot set account balance")
}
fn set_balance(account_id: AccountId, balance: Balance) {
... | Rust | 0 |
s/user_details.ui")]
pub struct UserDetailsWidget {
#[template_child]
pub scrolled_window: TemplateChild<gtk::ScrolledWindow>,
#[template_child]
pub user_name: TemplateChild<gtk::Label>,
#[template_child]
pub user_playlists: TemplateChild<gtk::FlowBox>,
}
#... | Rust | 0 |
rotobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> HdfsPathHandleProto {
HdfsPathHandleProto::new()
}
fn descriptor_static() -> &'static ::protobuf::reflect::MessageDescriptor {
static descriptor: ::protobuf::rt::LazyV2<::protobuf::reflect::MessageDes... | Rust | 0 |
"b" }, column: "abc")
y = x.abc
"#,
expect: expect![[r#"
error: string is not Label (argument column)
┌─ main:2:58
│
2 │ x = columns(table: { a: 1, b: "b" }, column: "abc")
│ ... | Rust | 0 |
nnectionError):
await make_request(proxy=proxy, url=TEST_URL_IPV4)
@pytest.mark.parametrize('url', (TEST_URL_IPV4, TEST_URL_IPV4_HTTPS))
@pytest.mark.skipif(SKIP_IPV6_TESTS, reason="TravisCI doesn't support ipv6")
@pytest.mark.asyncio
async def test_socks5_proxy_ipv6(url, target_ssl_context):
proxy = Prox... | Python | 1 |
Ok(())
}
pub fn render(
&mut self,
rg: &mut rg::TemporalRenderGraph,
) -> Option<rg::ReadOnlyHandle<Image>> {
if self.texture.is_none() {
const PIXEL_BYTES: u32 = 8;
if let Some(image) = self.image.take() {
self.texture = Some(Arc::new(
... | Rust | 0 |
fig,
update,
frames=range(max(traj_lens)),
fargs=(ax, fig),
interval=10
)
if savefile is not None:
try:
writervideo = animation.FFMpegWriter(fps=1 / dt, codec='libx264')
except:
writervideo = animation.FFMpegWriter(fps=1 / dt)
ani... | Python | 1 |
def enable_default_handler() ->None:
"""Enable the default handler of the HuggingFace Diffusers' root logger."""
_configure_library_root_logger()
assert _default_handler is not None
_get_library_root_logger().addHandler(_default_handler)
| Python | 1 |
}
#[doc = "Checks if the value of the field is `ENABLED`"]
#[inline(always)]
pub fn is_enabled(&self) -> bool {
**self == REG_GPIO_1_I_A::ENABLED
}
}
impl core::ops::Deref for REG_GPIO_1_I_R {
type Target = crate::FieldReader<bool, REG_GPIO_1_I_A>;
#[inline(always)]
fn deref(&sel... | Rust | 0 |
# Copyright (c) Alibaba, Inc. and its affiliates.
from typing import List
from modelscope.outputs import OutputKeys
from modelscope.pipelines.nlp import DialogStateTrackingPipeline
def tracking_and_print_dialog_states(
test_case, pipelines: List[DialogStateTrackingPipeline]):
import json
pipelines_le... | Python | 1 |
equest, GetMessagesResponse, StoreMessageRequest, StoreMessageResponse,
};
use tonic::{Request, Response, Status};
use xactor::Service;
/// GrpcService implements MultiSigService
#[derive(Debug)]
pub(crate) struct GrpcService {}
impl Default for GrpcService {
fn default() -> Self {
info!("Multisig message... | Rust | 0 |
import psycopg2
from psycopg2 import sql
from faker import Faker
import random
import string
from datetime import datetime, timedelta
import db_manager
def main():
# 建立数据库连接
with open('db_link.txt', 'r', encoding='utf-8') as file:
db_link = file.readlines()
db_link = [line.strip() for line in db_l... | Python | 1 |
class Solution:
#1. constructor
def __init__(self):
self.array = []
#2. Helper function
def twoSumHelper(self, iVal, nums,lo,hi):
#a. While loop
while lo<hi:
temp = iVal+nums[lo]+nums[hi]
if temp<0:
lo+=1
if temp... | Python | 1 |
"""MCP protocol endpoints."""
import json
import asyncio
import time
from fastapi import APIRouter, Request, HTTPException, Depends
from fastapi.responses import JSONResponse, StreamingResponse
from src.core.logging import get_logger
from src.core.elasticsearch import ElasticsearchClient
from src.api.dependencies imp... | Python | 1 |
lumns, desc=f'[{__class__.__name__}] Batch WOE'):
try:
if isinstance(self.woe_type, ManuallyBins):
_bins = self.bins.get(woe_column)
else:
_bins = self.bins
woe_fun = self.woe_type(
variables=self.df[... | Python | 1 |
(6, (6, 6)),
(6, (6, 6)),
];
for (expected, (a, b)) in ts {
assert_eq!(expected, gcd(a, b), "gcd({}, {})", a, b);
assert_eq!(expected, gcd(b, a), "gcd({}, {})", b, a);
}
}
#[test]
fn test_multi() {
let ts = vec![
(ve... | Rust | 0 |
tool_name = "BlueWhale"
type_tool = "Multi-Tools"
version = "0.0.2"
github_url = "https://github.com/Megamichi123/BlueWhale"
config_url = "https://raw.githubusercontent.com/Megamichi123/BlueWhale/refs/heads/main/configs/config.py"
main_dev = "m3gamichi"
creator = "loxy0dev"
platform = "Windows & Linux"
license = "./L... | Python | 1 |
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 writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY... | Rust | 0 |
usize> = g_set.clone();
g_t_set.remove(&transfer_family);
// We prefer to have graphics and present on the same queue
let gp_set: HashSet<usize> = p_set.intersection(&g_set).map(|x|*x).collect();
// Lets try for both of the above
let gp_t_set: HashSet<usize> =... | Rust | 0 |
: Duration = Duration::from_secs(60);
pub(crate) const NOTIFIER_DELIVERY_TIMEOUT: Duration = Duration::from_secs(20);
pub struct Monitor;
impl Monitor {
pub fn new() -> Monitor {
Monitor {}
}
pub(crate) async fn run(&mut self, mut notifier: Notifier, mut packet_sender: PacketSender) {
pri... | Rust | 0 |
ecuted")
return
successful = [r for r in self.results if r.success]
failed = [r for r in self.results if not r.success]
print("\n" + "="*60)
print("📊 EXECUTION SUMMARY")
print("="*60)
print(f"Total commands: {len(self.results)}")
pri... | Python | 1 |
if grants:
for grant in grants:
if grant.get("CreationDate"):
grant.update({ 'CreationDate': grant.get('CreationDate').astimezone(tzutc()).isoformat() })
... | Python | 1 |
_CS0.\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor infor... | Rust | 0 |
_with_corrupt_rumor_file(tmpdir: &TempDir) -> Server {
SWIM_PORT.compare_and_swap(0, 6666, Ordering::Relaxed);
GOSSIP_PORT.compare_and_swap(0, 7777, Ordering::Relaxed);
let swim_port = SWIM_PORT.fetch_add(1, Ordering::Relaxed);
let swim_listen = format!("127.0.0.1:{}", sw... | Rust | 0 |
# Copyright © 2021-Present DQOps, Documati sp. z o.o. (support@dqops.com)
#
# This file is licensed under the Business Source License 1.1,
# which can be found in the root directory of this repository.
#
# Change Date: This file will be licensed under the Apache License, Version 2.0,
# four (4) years from its last... | Python | 1 |
EIO as isize);
} else {
syscall_state.emulate_result(0);
}
}
fn verify_ptrace_options(t: &RecordTask, syscall_state: &mut TaskSyscallState) -> bool {
// We "support" PTRACE_O_SYSGOOD because we don't support PTRACE_SYSCALL yet
let supported_ptrace_options = PTRACE_O_TRACESYSGOOD
| PTRAC... | Rust | 0 |
completed
# Attention: broker could reject order if not enough cash
if order.status in [order.Completed]:
if order.isbuy():
self.broker_message = 'BUY executed,\nPrice: {:.5f}, Cost: {:.4f}, Comm: {:.4f}'. \
format(order.executed.price,
... | Python | 1 |
from bs4 import BeautifulSoup
import requests
from findmyhash.algo import Algo
from findmyhash.errors import *
from .Service import Service
class MD5DECRYPTION(Service):
NAME = "md5decryption"
HOST = "http://md5decryption.com"
ALGO_SUPPORTED = [Algo.MD5]
@classmethod
def algo_supported(cls,... | Python | 1 |
ts)
# 结合多个损失
total_loss = self.alpha * bce + self.beta * dice + self.gamma * ssim
return total_loss
class CombinedLoss_pro(nn.Module):
def __init__(self, alpha=0.5, beta=0.5, gamma=0.5, delta=0.3):
super().__init__()
self.bce_loss = BCEWithLogitsLoss()
... | Python | 1 |
ce::{Reduce, Reducer};
pub use tract_core::ops::nn::{
elu, hard_sigmoid, leaky_relu, parametric_softplus, scaled_tanh, selu, sigmoid, softplus,
softsign, threshold_relu, DataFormat,
};
use piece::Piece;
use board::{Board, Move};
pub struct Game<P1, P2> {
board: Board,
turn: Piece,
black: P1,
w... | Rust | 0 |
ged &= np.all(np.abs(old_tau - tau) / tau < delta_auto_corr)
if converged:
break
old_tau = tau
end = time.time()
elapsed = end - start
print('total time', elapsed)
with open('timing_before.txt', 'w') as f:
f.write('start time'+str(start))
f.write('end time '+str(end))
f.write('total time ... | Python | 1 |
t keeps the program running continuously
for index, authorization in enumerate(credentials):
info = get_user_info(apikey, authorization)
print(f"{Fore.CYAN+Style.BRIGHT}============== [ Account {index} | {info['first_name']} ] ==============")
if not upgrade_success.get(auth... | Python | 1 |
ntity,
};
Err(Error::ResponseError(local_var_error))
}
}
use guppy_controller::arm_controller::{ArmPositions, EndEffectorPose};
use kiss3d::{
event::{Action, Key},
scene::SceneNode,
window::Window,
};
use nalgebra::{Isometry3, Point2, Point3, Translation3, UnitQuaternion, Vector3};
use s... | Rust | 0 |
import random
def obtener_palabra_aleatoria():
with open("palabras.txt", "r") as archivo:
palabras = [linea.strip() for linea in archivo]
palabra_aleatoria = random.choice(palabras)
return palabra_aleatoria
def mostrar_tablero(palabra_secreta, letras_adivinadas):
tablero=""
for letra in p... | Python | 1 |
.decode())
kkk3 = 'pay1_ddan_count_'+self.current_admin_dict.get('uuid')
ddan_count = SiteRedis.get(kkk3)
if not ddan_count:
_f11 = {'callback_statu': CallbackState.NOT_CALLEDBACK, 'is_lose': True, 'order_time': {'$gte': start_time, '$lte': end_time}}
_f11.update(_fff22)... | Python | 1 |
return False
def main():
"""Main function."""
print("🎯 Basic Qwen2.5-VL Test for M1 Pro")
print("📋 This test will:")
print(" 1. Load Qwen2.5-VL-3B-Instruct model")
print(" 2. Process a test image")
print(" 3. Generate OCR text")
print(" 4. Check for hanging/timeout issues")
... | Python | 1 |
attr(parent, child_name)
old_attribute = parent.__dict__.get(child_name)
if old_attribute is not None and isinstance(old_attribute, staticmethod):
old_child = staticmethod(old_child)
self.cache.append((parent, old_child, child_name))
setattr(parent, child_name, new_child)
def UnsetAll(self):
... | Python | 1 |
DPTR => 0x03,
STATER::RDSRCDATA => 0x04,
STATER::WRDSTDATA => 0x05,
STATER::WAITREQCLR => 0x06,
STATER::WRCHCTRLDATA => 0x07,
STATER::STALLED => 0x08,
STATER::DONE => 0x09,
STATER::PERSCATTRANS => 0x0a,
STATER::_Reserved(bit... | Rust | 0 |
= transform.transform_point(&source_point);
assert!((translated_point.x() - 41.0).abs() < 0.001);
assert!((translated_point.y() - 45.0).abs() < 0.001);
}
#[test]
fn rotate_about_center() {
let transform = Transformation::Rotate(f64::consts::PI/2.0, (0.0, 0.0));
le... | Rust | 0 |
location_insensitive_subset_error_exists("'a", "'c"));
}
#[test]
fn successes_in_subset_relations_dataset() {
let successes = ["valid_subset", "implied_bounds_subset"];
// these tests have no illegal access errors or subset errors
for test_fn in &successes {
let facts_dir = Path::new(env!("CARGO_M... | Rust | 0 |
in ud:
ud[t] = 1
else:
ud[t] += 1
self.update_touch_label(ud['label'], touch)
def on_touch_up(self, touch):
if touch.grab_current is not self:
return
touch.ungrab(self)
ud = touch.ud
self.canvas.remove_group(ud['group'])
se... | Python | 1 |
new_pos);
return (*new_pos, target_cell);
}
}
panic!("Illegal state: Invalid transition map for {:?} {:?}", pos, movement);
}
pub fn cell(&self, pos: &Pos) -> &Cell
{
&self.map[pos.x][pos.y]
}
pub fn policy_iteration(&self, discount: f32, max_de... | Rust | 0 |
home/ti/Downloads/DATASETS/out_data_crop/"
# pairs_filepath = "/home/ti/Downloads/insightface/src/data/pairs.txt"
# alternative_lst = "/home/ti/Downloads/insightface/src/data/crop.lst"
# test_txt = "/home/ti/Downloads/DATASETS/out_data_crop/test.txt"
# img_ext = ".png"
# arguments to pass in comman... | Python | 1 |
ey, count)
print(" - %2u quant range = %6u blocks" % dat)
print("")
# -------------------------------------------------------------------------
# Refinement usage
total_count = 0
better_count = 0
could_have_count = 0
success_count = 0
refinement_step = []
for ... | Python | 1 |
var20 = var21;
} else {
let var22 = self.global206;
var20 = var22;
}
if var20 & 1i32 != 0 {
self.wasm_interrupts_index__handleInterrupt... | Rust | 0 |
OXOXOX/OXOXOXO O";
pos = if let Some(pos) = Position::from_xfen(xfen) {
pos
} else {
panic!(Log::print_fatal(&format!("Invalid xfen=|{}|", xfen)))
};
Log::print_debug(&pos.pos());
/*
[Next 43 piece(s) | Go O]
+---+---+---+---+---+---+---+ Please select a file. Example `do d`
6 | X | O | X | O... | Rust | 0 |
t):
return SimpleInferer()
def train_handlers(self, context: Context):
handlers = super().train_handlers(context)
if context.local_rank == 0:
handlers.append(TensorBoardImageHandler(log_dir=context.events_dir, batch_limit=4, tag_name="train"))
return handlers
def va... | Python | 1 |
enLabel.adjustSize()
self.blueLabel.adjustSize()
self.opacityLabel.adjustSize()
def showEvent(self, e):
self.updateStyle()
super().showEvent(e)
def __connectSignalToSlot(self):
""" connect signal to slot """
self.cancelButton.clicked.connect(self.reject)
... | Python | 1 |
ne;
extern crate grpc;
extern crate protobuf;
extern crate shared;
extern crate storage;
extern crate wabt;
extern crate wasm_prep;
pub mod engine_server;
use clap::{App, Arg};
use engine_server::*;
use execution_engine::engine::EngineState;
use storage::gs::inmem::InMemHist;
fn main() {
let matches = App::new("... | Rust | 0 |
import datetime
import uuid
import factory.fuzzy
from pcapi.core.factories import BaseFactory
from pcapi.core.users import factories as users_factories
from pcapi.utils import date as date_utils
from . import models
class SpecialEventFactory(BaseFactory):
class Meta:
model = models.SpecialEvent
ex... | Python | 1 |
"vsb",
f"--database={database}",
f"--workload={workload}",
"--loglevel=debug",
"--overwrite",
]
proc = subprocess.Popen(
args + extra_args,
stdout=PIPE,
stderr=PIPE,
env=env,
text=True,
)
try:
stdout, stderr = proc.c... | Python | 1 |
CH7LIMITL_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "Disable"]
#[inline(always)]
pub fn disabled(self) -> &'a mut W {
self.variant(CH7LIMITL_A::DISABLED)
}
#[doc = "Enable"]
#[inline(always)]
pub fn enabled(self) -> &'a mut W {
s... | Rust | 0 |
age,
bind_flags: self.bind_flags,
cpu_access_flags: self.cpu_access_flags,
misc_flags: self.misc_flags,
structure_byte_stride: self.structure_byte_stride,
}
}
pub fn usage(self, usage: Usage) -> BufferDesc<Bw, Usage, Bf> {
BufferDesc {
... | Rust | 0 |
import logging
import aiohttp
from bs4 import BeautifulSoup
import re
from aiogram import Router, types
from aiogram.fsm.context import FSMContext
from aiogram.utils.keyboard import InlineKeyboardBuilder
from bot.handlers.handler import PoemWriting # Импортируем состояния
import keyboards as kb
import asyncio
rhyme_r... | Python | 1 |
] {
*index += 1;
let got = deserialize_fixlen(6, bits, index).low_u128();
nam = nam + add * got;
add = add.saturating_mul(64);
}
*index = *index + 1;
return nam;
}
// Many elements, unknown length
pub fn serialize_list<T>(serialize_one: impl Fn(&T, &mut BitVec) -> (), values: &[T], bits: &mut B... | Rust | 0 |
version = (3, 1, 1)
import bpy
from bpy.props import StringProperty
class ARMORED_OT_toggle_tool(bpy.types.Operator):
'''Toggles the specified tool.
armoredColony.com '''
bl_idname = 'view3d.armored_toggle_tool'
bl_label = 'ARMORED Toggle Tool'
bl_options = {'REGISTER'}
name: StringProperty(name... | Python | 1 |
fprob: &mut Vec<Vec<ProbT>>,
posterior: &mut Vec<(usize, usize, ProbT)>,
chr_len: usize,
) -> Result<(), Box<dyn Error>> {
let itrees: Vec<IntervalTree<u32, ProbT>> = cell_records
.into_iter()
.map(|cell_records| {
let mut tree = IntervalTree::new();
for record i... | Rust | 0 |
g
bounds = g.getBounds()
x = bounds[2]
pricecode = Ean5BarcodeWidget(x=x, value=price, price=True,
humanReadable=True,
barHeight=self.barHeight, quiet=self.quiet)
g.add(pricecode)
return g
def _add... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.