text string | label_name string | labels int64 |
|---|---|---|
import base64
import challenge36_util
import socketserver
import sys
email = ''
salt = 0
v = 0
N = 0xffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117... | Python | 1 |
_TYPE_IOC)
print(f"ARB {us_ask_pricevol.price} @ {eu_bid_pricevol.price} | Vol {vol}")
print(buyResponse)
print(sellResponse)
else:
print("nothing")
else:
print("some market is closed")
"""
# verify that the book exists and that it has at leas... | Python | 1 |
Vec<Val>, env: &HashMap<String, OpType>| {
let quote = expect_quote(stack);
let val = expect_val(stack);
eval_quote("e, stack, env);
stack.push(val);
});
// run quote, accepting no arguments
builtin("nullary", &mut env, |stack: &mut Vec<Val>, env: &HashMap<String, OpType>| {
let quote = expect_quote(s... | Rust | 0 |
for i in range(6):
time.sleep(5)
stats = pool.get_stats()
logger.info(f"[POOL-STATUS] After {(i+1)*5}s - ready={stats['ready_workers']}, spawning={stats['spawning_workers']}, total={stats['total_workers']}")
if stats['ready_w... | Python | 1 |
import seaborn as sns
import matplotlib.pyplot as plt
# Load the sample dataset
tips = sns.load_dataset('tips')
# Use FacetGrid to create a separate boxplot for each group
g = sns.FacetGrid(tips, col='day', col_wrap=2, height=4) # Create a separate plot for each 'day'
g.map(sns.boxplot, 'time', 'total_bill', order=[... | Python | 1 |
LeaderboardSortBy::Rating(Skillset8::Chordjack) => "8",
LeaderboardSortBy::Rating(Skillset8::Technical) => "9",
},
),
])
})
.await?;
let json: serde_json::Value = serde_json::from_str(&json)?;
json["data"]
.array()?
.iter()
.map(|json| {
Ok(LeaderboardEntry {
rank: js... | Rust | 0 |
."]
pub max_vfs: u16,
#[doc = "< Maximum number of VMDq pools."]
pub max_vmdq_pools: u16,
pub rx_offload_capa: u64,
pub tx_offload_capa: u64,
pub rx_queue_offload_capa: u64,
pub tx_queue_offload_capa: u64,
pub reta_size: u16,
#[doc = "< Hash key size in bytes"]
pub hash_key_size:... | Rust | 0 |
# 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 |
# Copyright 2023 The Google Earth Engine Community Authors
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 1 |
Types::SigTypeSecp256k1 as u8,
data: signed_message.signature().bytes().to_vec(),
},
}
}
}
impl TryFrom<&SignedMessageAPI> for SignedMessage {
type Error = SignerError;
fn try_from(signed_message_api: &SignedMessageAPI) -> Result<SignedMessage, Self::Error> {
le... | Rust | 0 |
'ls /tmp/{0}/rucio_testfile_*'.format(tmp_dsn)
print(self.marker + cmd)
exitcode, out, err = execute(cmd)
print(err, out)
self.assertEqual(exitcode, 0)
# cleaning
remove('/tmp/{0}/'.format(tmp_dsn) + basename(tmp_file1))
remove('/tmp/{0}/'.format(tmp_dsn) + basen... | Python | 1 |
:Value) -> zbus::Result<()>;
#[dbus_proxy(property)]
fn address(&self) -> zbus::fdo::Result<String>;
#[dbus_proxy(property)]
fn address_type(&self) -> zbus::fdo::Result<bluez::AddressType>;
#[dbus_proxy(property)]
fn name(&self) -> zbus::fdo::Result<String>;
#[dbus_proxy(property)]
fn a... | Rust | 0 |
from datetime import datetime, timedelta, UTC
from http import HTTPStatus
from fastapi import APIRouter
from fastapi.responses import JSONResponse
from sqlalchemy.orm.exc import NoResultFound
from sqlmodel import col, select
from browserstrategygame.database import (
Building,
DatabaseDep,
MaterialYield,
... | Python | 1 |
# -*- coding: utf-8 -*-
import numpy as np
import pytest
import megengine
from megengine.core._imperative_rt.core2 import apply
from megengine.tensor import Tensor
def elemwise(*args, mode):
from megengine.core.ops.builtin import Elemwise
return apply(Elemwise(mode), *args)
def test_basic_interface():
... | Python | 1 |
egister/response/")
}
fn priority() -> RequestPriority {
RequestPriority::Immediate
}
fn retry() -> bool {
false
}
}
//! Natural actor-critic algorithms.
use crate::{fa::ScaledGradientUpdate, params::*, Handler};
#[derive(Clone, Debug)]
#[cfg_attr(
feature = "serde",
deriv... | Rust | 0 |
'''Текстовый файл 24-320.txt состоит не более чем
из 106 символов и содержит только десятичные цифры
и знаки равенства («=»). Определите максимальную длину
последовательности вида «число1=число2=число3=...=число N»,
в которой нет соседних знаков «=» и хотя бы одно число
равно 77.
В ответе укажите количество симв... | Python | 1 |
impls/basic_fmt_impls.rs
use crate::{
panic_val::{IntVal, PanicVal, PanicVariant, StrFmt},
utils::Packed,
FmtArg, PanicFmt, StdWrapper,
};
macro_rules! primitive_static_panicfmt {
(
fn[$($impl:tt)*](&$self:ident: $ty:ty, $f:ident) {
$($content:tt)*
}
) => {
impl<... | Rust | 0 |
");
}
}
out
}
pub fn build_tsv(name_values:Vec<(&str, String)>) -> String {
name_values.iter().map(|x| format!("{}{}{}{}", x.0, TSV_DELIM, x.1, TSV_EOL) ).collect()
}
<reponame>ootsby/get_the_streamer_game
use ggez::graphics::Rect;
use super::LifeSystem;
#[derive(Debug)]
pub struct SwordLifeSyst... | Rust | 0 |
}
}
<gh_stars>0
// Do not edit manually!
// This file was automatically generated by Sage (and cargo fmt).
use std::ops::{Add, Mul, Neg, Sub};
use curve25519_dalek::scalar::Scalar;
use gridiron::*;
use num_traits::Zero;
use sha2::Digest;
use sha2::Sha512;
use serde::{Deserialize, Serialize};
use rand_core::Rng... | Rust | 0 |
er, {:?}", err);
}
});
let addr = addr_rx.await.unwrap();
let _meter = opentelemetry_dynatrace::new_pipeline()
.metrics(tokio::spawn, move |_: Duration| {
let mut tick_rx = tick_rx.clone();
futures::stream::once(async move {
... | Rust | 0 |
!("d"), as_val!(4));
items.insert(as_val!("e"), as_val!(5));
let op = maps::put_items(&mpolicy, bin_name, &items);
let rec = client.operate(&wpolicy, &key, &[op]).unwrap();
// returns size of map after put
assert_eq!(*rec.bins.get(bin_name).unwrap(), as_val!(5));
let k = as_val!("e");
let o... | Rust | 0 |
# Generated by Django 4.2.7 on 2024-01-24 20:00
import common.utils
import common.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0005_category_slug'),
]
operations = [
migrations.AddField(
model_name='... | Python | 1 |
"""
Write a function that takes in a list and an element and inserts the element before each element in the list, and returns the resulting list.
assert insert_element(['Red', 'Green', 'Black'],'c')==['c', 'Red', 'c', 'Green', 'c', 'Black']
"""
def insert_element(list, element):
new_list = []
for i in range(le... | Python | 1 |
{0,0}`
let a = vec![Nat(0), Nat(0)];
// `{1,2} -> {}`
let wolfram_rule = Rule(vec![Nat(1), Nat(2)], vec![]);
// prints `{}` because `{0,0}` is reduced.
println!("{}", format(&wolfram_rule.parallel(&a)));
// `{a'(1),b'(2)} -> {}`
let avatar_rule = Rule(vec![ava("a", 1), ava("b", 2)], vec![]... | Rust | 0 |
import pytest
import torch
from open_clip.hf_model import _POOLERS, HFTextEncoder
from transformers import AutoConfig
from transformers.modeling_outputs import BaseModelOutput
# test poolers
def test_poolers():
bs, sl, d = 2, 10, 5
h = torch.arange(sl).repeat(bs).reshape(bs, sl)[..., None] * torch.linspace(0.2... | Python | 1 |
of the Fibonnaci sequence is {}", term);
},
2 => {
println!("The 2nd term of the Fibonnaci sequence is {}", term);
},
3 => {
println!("The 3rd term of the Fibonnaci sequence is {}", term);
}
_ => {
p... | Rust | 0 |
:Reg<ccbuf_dith5_mode::CCBUF_DITH5_MODE_SPEC>; 6] {
unsafe {
&*(((self as *const Self) as *const u8).add(112usize)
as *const [crate::Reg<ccbuf_dith5_mode::CCBUF_DITH5_MODE_SPEC>; 6])
}
}
#[doc = "0x70..0x88 - Compare and Capture Buffer"]
#[inline(always)]
pub ... | Rust | 0 |
str: String representation of the error
Returns:
int: Retry delay in seconds, or None if not found
"""
try:
# Look for retryDelay pattern in the error string
# Pattern: 'retryDelay': '18s' or "retryDelay": "18s"
retry_delay_match = re.... | Python | 1 |
}
for i in 0..payload_size {
new_bytes.push(ser[end_head_pos + 8 + i]);
}
assert_eq!(new_bytes.len(), ser.len() + num_extra_bytes as usize);
// and set new opt fields length
let mut wtr = vec![];
wtr.write_u32::<BigEndian>(opt_fields_len + num_extra_bytes as u32)
.unwrap();
for i in 0..wtr.len() {
new_by... | Rust | 0 |
Objectives = ();
fn allow_new_entity(
&self,
_: &BattleState<R>,
_: &Team<R>,
mode: EntityAddition<R>,
) -> WeaselResult<(), R> {
let allowed = match mode {
EntityAddition::CreatureSpawn => *self.allow_new_entities.borrow(),
EntityAddition::Creat... | Rust | 0 |
',
# 'justification': "Both a pound of bricks and a pound of feathers have been defined to have the same weight. The 'pound' is a unit of weight, so any two things that are described as weighing a pound will weigh the same.", 'unit': 'pounds'}
# }
""" # noqa: E501
i... | Python | 1 |
data_len = http2_stream[frame.stream_id]
Payload_flag = True
if not Payload_flag:
continue
else:
# 写入flow_dict
if http['sport'] > http['dport']: # 发出的包
key = (http['src'], http['sport'], http['dst'], h... | Python | 1 |
ion(point[0], point[1])).abs() < 1e-4 );
}
}
#[test]
fn test_poisson_with_boundary_condition() {
fn exact_solution(x: f64, y: f64) -> f64 {
x*x - 0.5*y*y
}
let (physicalnames, points, lines, triangles) =
process_2d_trianglation_file("triangulation.msh"... | Rust | 0 |
"""
RadioPlayerV2, Telegram Voice Chat Bot
Copyright (C) 2021 Asm Safone <https://t.me/AsmSafone>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your ... | Python | 1 |
iscretizer(X, [], feature_names, y,
random_state=20)
explainer_1 = LimeTabularExplainer(X,
feature_names=feature_names,
discretize_continuous=True,
... | Python | 1 |
x.http, "A rank didn't exist for this role.".to_string()).await?;
}
}
Err(ex) => {
error!("Failed to remove role for server: {}", ex);
msg.channel_id.say(&ctx.http, "Failed to remove role from the server.").await?;
... | Rust | 0 |
ND.camel_name()
))
})?;
Ok(unsafe{ Self::new_unchecked(common_ty, lhs, rhs) })
}
/// Creates a new comparison expression between `lhs` and `rhs`.
///
/// # Safety
///
/// This does not check the type validity of `lhs` and `rhs` and thus
/// should be used... | Rust | 0 |
def add_everything_up(a, b):
try:
# Попытка сложить два значения
# Если оба значения одного типа (например, оба числа или обе строки), операция пройдет успешно
return a + b
except TypeError:
# Если типы данных различны (например, одно значение — число, другое — строка),
#... | Python | 1 |
#! /usr/bin/env python3
# $Id$
# Author: Martin Blais <blais@furius.ca>
# Copyright: This module has been placed in the public domain.
"""
Test module for traversals.
"""
from pathlib import Path
import sys
import unittest
if __name__ == '__main__':
# prepend the "docutils root" to the Python library path
#... | Python | 1 |
=box, label=\"{}\"];\n",
i.id,
i.content.replace("\"", "\\\"")
)
.as_str(),
),
GraphNodeType::Choice => res.push_str(
format!(
"D{} [shape=diamond, label=\"{}\"];\n",
i... | Rust | 0 |
{
self.prompt = prompt;
self
}
/// Sets the previous text to use for the test.
fn set_previous(mut self, previous: &'static str) -> Self {
self.previous = previous;
self
}
/// Enables history tracking and sets the history to use ... | Rust | 0 |
you: u16, opp: u16, state: usize) {
let mut you_movs: Vec<(u8, u8, bool)> = vec![];
for shift in 0..15u16{
let you_state = (you >> shift) & 0b11111;
let opp_state = (opp >> shift) & 0b11111;
if (you_state == 0) && (opp_state == 0) {
continue;
}
if you_state == 0 {
let five_movs: Ve... | Rust | 0 |
ValSize::Size1 => panic!("1 bit flag cannot be converted to bytes"),
ValSize::Size8 => 1,
ValSize::Size16 => 2,
ValSize::Size32 => 4,
ValSize::Size64 => 8,
ValSize::Size128 => 16,
ValSize::Size256 => 32,
ValSize::Size512 => 64,
... | Rust | 0 |
from __future__ import annotations
from typing import Type, Optional, Dict, Any, TYPE_CHECKING
from taproot.util import PretrainedModelMixin
if TYPE_CHECKING:
from diffusers.schedulers import FlowMatchEulerDiscreteScheduler
__all__ = ["HunyuanVideoScheduler"]
class HunyuanVideoScheduler(PretrainedModelMixin):
... | Python | 1 |
version)
if not animate:
return cpu
# Make movie files
fps = 4 # Frames per second
plt.movie('frame_*.png', encoder='html', fps=fps,
output_file='movie.html')
# Ex: avconv -r 4 -i frame_%04d.png -vcodec libtheora movie.ogg
#codec2ext = dict(flv='flv', libx64='mp4', libvp... | Python | 1 |
lHandle,
outputType: int32,
adjustmentPoints: *mut float64,
bufferSize: uInt32,
) -> int32;
}
extern "C" {
pub fn DAQmxConnectSCExpressCalAccChans(
calHandle: CalHandle,
channelNames: *const ::std::os::raw::c_char,
connection: *const ::std::os::raw::c_char,
) ... | Rust | 0 |
name: String, meta: MetaValue },
List { name: String, metas: Vec<Meta> },
Path { name: String },
// Extended Meta
Derive { derives: Vec<DeriveMeta> },
Project { project: ProjectMeta },
Filter { filter: FilterMeta },
Aggregate { agg: AggregateMeta },
Tag { tag: Tag },
Render { render:... | Rust | 0 |
atio < 0.6 else '正常'} " \
f"(当前/MA20比值 = {current_volume_ratio:.2f}倍)\n" \
f"• 波动性指标:ATR={current_atr:.2f}, 年化波动率={volatility:.2f}% ({volatility_status})\n\n" \
f"🟢 综合评估\n" \
f"──────────────────────\n" \
f"• 总体评分:{total_score}/100\n"... | Python | 1 |
#[derive(Debug)]
pub struct SubstitutionRates {
pub a: Float,
pub c: Float,
pub g: Float,
pub t: Float,
}
impl SubstitutionRates {
/// Dynamic field access to a specific nucleotide
///
/// ```
/// extern crate pattern_partition_prediction;
/// use pattern_partition_prediction::Subs... | Rust | 0 |
() {
if !input.frontier.less_than(capability.time()) {
output.session(&capability).give((*capability.time(), price));
}
}
maxima.retain(|(capability, _)| input.frontier.less_than(capability));
}
})
... | Rust | 0 |
���', '◙', 'ڂ', '𖢇', 'ꊫ', '🍳',
'𘫂', '𘪾', 'ⷈ', '㇖', 'ﯶ', '⣿', '𛊂', '\u{1ed38}', '🐠', '⅓', 'ᱳ',
'𑠙', 'ﴽ', 'ꅥ', '൬', '᰻', 'ṣ', '☈', '𝐾', 'Ḯ', 'ᬛ', '𖣍', '\u{dca}',
'〘', '⽛', '㊋', '𐳨', 'ꉁ', '𐤷', '𐙴', 'ﴯ', '𑒄', '\u{1e10c}', '𛊏',
'𓊹', '𝐰', 'ᄃ', '\u{1fac0}', '帽', 'ᖻ', '🙐', '𛆯', '㎨', '↪', 'ᑌ',
... | Rust | 0 |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
"""
This is a hardware testing script for PBM
Tested with Feather M4 Express and 2.4" Featherwing
1. Flash board to 4x
2. add 'adafruit_ili9341.mpy' for 4x firmware to /lib/ on board
3. add /examples/images to /images on boar... | Python | 1 |
import pathlib
import subprocess
import sys
import os
import argparse
def isNPY_OLD():
'''
A new random C API was added in 1.18 and became stable in 1.19.
Prefer the new random C API when building with recent numpy.
'''
import numpy as np
ver = tuple(int(num) for num in np.__version__.split('.... | Python | 1 |
ain() {
let filename = "src/input.txt";
let matrix = files::read_in_matrix_as::<u32>(filename);
println!("----- PART 1 -----");
println!("Part 1 Answer: {}", 0);
println!("\n\n----- PART 2 -----");
println!("Part 2 Answer: {}", 0);
}
<gh_stars>1-10
use argh::FromArgs;
use serde::de::{Deseri... | Rust | 0 |
.is_empty()),
version: option_env!("JJS_BUILD_INFO_VERSION").filter(|s| !s.is_empty()),
}
}
pub fn wrap_clap<'a>(app: clap::App<'a>) -> clap::App<'a> {
static STRING_LONG_VERSION: Lazy<String> = Lazy::new(|| format!("{:#?}", BuildInfo::get()));
static STRING_SHORT_VERSION: L... | Rust | 0 |
country_code = {'India': '0091', 'Australia': '0025', 'Nepal': '00977'}
try:
print(country_code['India'])
print(country_code['USA'])
except KeyError:
print('Not found')
print(country_code.get('India', 'Not found')) # search dictionary for country code of India
print(country_code.get('Japan', 'Not found')... | Python | 1 |
unsafe { o.contents.result = std::ptr::null_mut() };
CResult_HTLCUpdateDecodeErrorZPtr { result }
} else {
let err = unsafe { o.contents.err };
unsafe { o.contents.err = std::ptr::null_mut(); }
CResult_HTLCUpdateDecodeErrorZPtr { err }
};
Self {
contents,
result_ok: o.result_ok,
}
}
}
impl... | Rust | 0 |
defined assuming the "single alphabetical tower" goal
def heuristic(self, state_expr):
ordered_goals = sorted(self.problem.goal, key=lambda x: x[2], reverse=True)
# need_to_move = ordered_goals[0][2]
# need_clear = None
need_clear = ordered_goals[0][2]
ordered_goals = [("ontab... | Python | 1 |
, j as i32);
let c = &mut self.cells[i as usize][j as usize];
if c.alive && (neighbors == 2 || neighbors == 3) {
c.queue(true);
} else if !c.alive && neighbors == 3 {
c.queue(true);
} else {
c.que... | Rust | 0 |
Vertex { position: (5.836005, 0.945722, 0.001092),
normal: (0.997356, -0.072614, -0.002907), },
Vertex { position: (5.897758, 1.009309, 0.080583),
normal: (0.054059, 0.926072, -0.373455), },
Vertex { position: (5.895899, 1.18273, 0.164705),
normal: (0.169215, -0.167065... | Rust | 0 |
let updated_content = apply_processing_rules(stored_content_option, &block.content)?;
state.insert(target_id, updated_content.clone());
let updated_block = block.create_copy_with(updated_content);
Some(updated_block)
}
<gh_stars>10-100
#![forbid(unsafe_code)]
use std::path::PathBuf;
use std::{env, ffi, f... | Rust | 0 |
l2, col3, col4, col5 = st.columns(5)
with col1:
fo = st.text_input('MDVP:Fo(Hz)')
with col2:
fhi = st.text_input('MDVP:Fhi(Hz)')
with col3:
flo = st.text_input('MDVP:Flo(Hz)')
with col4:
Jitter_percent = st.text_input('MDVP:Jitter(%)')
... | Python | 1 |
text = sdl2::ttf::init().unwrap();
let mut sdl_canvas = canvas::SdlCanvas::new(&ttf_context);
let mut snake = snake::Snake::new();
sdl_canvas.start(&mut snake);
}
<filename>src/dsa.rs<gh_stars>1-10
//! DSA verification tests
use super::*;
define_test_set!(
"DSA verify",
"dsa_verify_schema.json... | Rust | 0 |
# Copyright (C) 2025 qBraid
#
# This file is part of the qBraid-SDK
#
# The qBraid-SDK is free software released under the GNU General Public License v3
# or later. You can redistribute and/or modify it under the terms of the GPL v3.
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.ht... | Python | 1 |
mponents::Index/>},
}
})
/>
}
}
}
<filename>vendor/dwrote/src/font_file_loader_impl.rs
#![allow(non_snake_case, non_upper_case_globals)]
use std::collections::HashMap;
use std::marker::Send;
use std::sync::atomic::AtomicUsize;
use std::sync::{atomic, Arc, Mut... | Rust | 0 |
import os
from tkinter import *
from tkinter import ttk
from config import APP_NAME, APP_PATH
from logo import APP_ICON
from utils.attributes import *
import home
from features import create_feature, extract_feature, add_feature, merge_feature, move_feature, copy_feature
def on_menu_btn_enter(e):
e.widget.config(bg=... | Python | 1 |
.filter(|&el| el.name == "Rectangle/1")
/// .count();
///
/// assert_eq!(count_rectangle_one, 0);
///
/// ```
pub fn add_obstacle(&mut self) {
let default_obstacle_layout = ObstacleLayout::default();
self.last_obstacle_id += 1;
self.obstacles.push(ObstacleLayout {
... | Rust | 0 |
op(|x: u64| bool_val(x == 0))?,
Instruction::I64Eq => self.binop(|a: u64, b: u64| bool_val(a == b))?,
Instruction::I64Ne => self.binop(|a: u64, b: u64| bool_val(a != b))?,
Instruction::I64LtS => self.binop(|a: u64, b: u64| bool_val(a as i64 == b as i64))?,
Instruction::I6... | Rust | 0 |
self.1, self.2, self.3, self.4, self.5, f(self.6), self.7, self.8, self.9, self.10, self.11, self.12, self.13)
}
}
#[doc = "Mapping `.6` for Tuple14"]
pub trait Tuple14Map6Option<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> {
#[doc = "Mapping `.6` for Tuple14"]
fn map6<U>(self, f: impl FnOnc... | Rust | 0 |
"""
"""
# Created on 2014.08.05
#
# Author: Giovanni Cannata
#
# Copyright 2014 - 2020 Giovanni Cannata
#
# This file is part of ldap3.
#
# ldap3 is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free Software Foundation, either ... | Python | 1 |
to a `WorkflowConfig`,
/// and run them synchronously. Each `WorkflowConfig` includes one or more
/// *requests* that will be called when running it.
///
/// This struct is used by `serde-yaml` to parse the files, so every property
/// in this struct will be a valid value in those files.
#[derive(Debug, Clone, Serializ... | Rust | 0 |
) ).data,
'{0}/{1}_roughPred_{2}.png'.format(opt.experiment, j, n) )
for n in range(0, len(depthPreds) ):
depthOut = 1 / torch.clamp(depthPreds[n] + 1, 1e-6, 10) * segAllBatch.expand_as(depthPreds[n])
vutils.save_image( ( depthOut * segAllBatch.expand_... | Python | 1 |
elf.bits,
self.maxq,
x.stride(0),
x.stride(1),
self.gate_proj.qweight.stride(0),
self.gate_proj.qweight.stride(1),
c.stride(0),
c.stride(1),
self.gate_proj.scales.stride(0),
se... | Python | 1 |
State::Whole => match c {
'.' => {
state = State::Fractional;
true
}
'0'..='9' => true,
_ => false,
},
State::Fractional => matches!(c, '0'..='9'),
});
match state {
... | Rust | 0 |
count reached");
<Subjects<T>>::insert(subject_count, sender.clone());
// Update the subject nonce.
<SubjectCount<T>>::put(subject_count + 1);
// Deposit the event.
Self::deposit_event(RawEvent::SubjectCreated(sender, subject_count));
}
}
}
#[... | Rust | 0 |
import flet as ft
from . import agents_controls, agents_dashboard_functions
# DEFINE OS WIDGETS DA ÁREA DE CRIAÇÃO DE AGENTES
agents_dashboard = [
agents_controls.agents_area,
agents_controls.buttons_bar # ÁREA DE BOTÃO CRIAR AGENTE
]
agents_dashboard_functions.load_agents() # CARREGA AGENTES GUARDADOS NO (SS... | Python | 1 |
bk{\x8b\xfb\x8b\x8dN\x1b\x9b}\x0a\
\xe2\x1b\x06K\x19\x0e\xa7ncy\xac\xe6\x86\x02d\x96\
\xd2\xf6\xd9\xdb\xe6O\x04>\x83\xe3\xddIZ[;\xad\
CK\xf0\x85\x85\xc2\xc9\xf6\x8d&\xc6;=J\xe2\xd9\
\xaef\xb7\xb5\x8a$\xc4\xf7\x1a\x8d\xb5\xc3\xb2YB\x88\
g\xb6\xba\xc2_\xeao\x1418\xf6\x0d\x1b\xe2\x1e\xad\
s\x0e\xa5c\xa6i\xba~\x8f\xac^]M\x... | Python | 1 |
.......\n\
.......\n");
screen.execute_instruction(instructions[0]);
assert_eq!(format!("{}", screen),
"###....\n\
###....\n\
.......\n");
screen.execute_instruction(instructions[1]);
as... | Rust | 0 |
submitted_value in request.extracted_data.items():
extracted_value = original_extracted_fields.get(field_name)
match_status = "UNKNOWN"
if submitted_value is None and extracted_value is None:
match_status = "NO_DATA"
elif submitted_value is None and extracted_value ... | Python | 1 |
p in tp_list:
fo.write("\t"+str(result[data][tp][i]))
fo.write('\n')
def start():
argparser = argparse.ArgumentParser(description='Estimates relative activities of transcriptional regulators from given transcriptome data.')
argparser.add_argument('--network-file', nargs=1, dest='network_file', metav... | Python | 1 |
import sys
import re
def main():
file_path = "testing.txt" if len(sys.argv) < 2 else sys.argv[1]
testing = len(sys.argv) < 2
buffer = open(file_path, 'r').read()
if testing:
print(buffer)
part_one = Solution.solve_one(buffer)
part_two = Solution.solve_two(buffer)
print(f"part ... | Python | 1 |
# Common timeout message that can be used across different timeout scenarios
TIMEOUT_MESSAGE_TEMPLATE = (
"You may wait longer to see additional output by sending empty command '', "
'send other commands to interact with the current process, '
'send keys to interrupt/kill the command, '
'or use the time... | Python | 1 |
put_async("/pause", routes::pause::handler)
.put_async("/resume", routes::resume_playback::handler)
.put_async("/shuffle", routes::shuffle::handler)
.put_async("/repeat",routes::repeat::handler)
.run(req, env)
.await;
let mut response = match response {
Ok(response) =... | Rust | 0 |
import os
import shutil
import sys
# Assuming zenodo_get is installed or PYTHONPATH is set correctly
# to find the zenodo_get package.
try:
from zenodo_get import download
except ImportError:
# Fallback for environments where zenodo_get might not be in the default path yet
# This might happen if tests are ... | Python | 1 |
t ::std::os::raw::c_char,
arg3: ::std::os::raw::c_int,
) -> R_len_t;
}
extern "C" {
pub fn BNDCELL_TAG(e: SEXP) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn SET_BNDCELL_TAG(e: SEXP, v: ::std::os::raw::c_int);
}
extern "C" {
pub fn BNDCELL_DVAL(cell: SEXP) -> f64;
}
extern "C" {
pub fn BND... | Rust | 0 |
break;
}
match (p.expect(Comma), p.at(Eof)) {
(true, true) => {
value(p);
break;
}
(false, false) => {
if p.bump_recover(TokenSet::empty()) {
break;
... | Rust | 0 |
t
elif depth == 16:
encoder = packbits.encode_prediction_16bit
row = _make_constant_row(value, width, depth)
row = row.reshape((1, width))
row = util.ensure_native_endian(row)
encoder(row.flatten())
row = util.ensure_bigendian(row)
row = row.tobytes()
fd.write(zlib.compress(row ... | Python | 1 |
re.
vault
.async_commit(|txn| set_require_receipt(txn, op_hash, false))
.await?;
}
Ok(WorkComplete::Complete)
}
mod bool;
mod float;
mod int;
mod str;
#[cfg(feature = "chrono")]
mod chrono;
#[cfg(feature = "uuid")]
mod uuid;
#[derive(Debug, Copy, Clone)]
#[repr(i16)]
pub enum... | Rust | 0 |
DecodeRsaPrivateKey, EncodeRsaPublicKey};
use pkcs8::{DecodePrivateKey, EncodePublicKey};
use rsa::{PublicKey as _, RsaPrivateKey, RsaPublicKey};
use sha2::{Sha256, Sha384, Sha512};
use signature::{Signature, Signer, Verifier};
use super::{ExportJwks, SigningKeystore, VerifyingKeystore};
use crate::{JsonWebKey, JsonWe... | Rust | 0 |
if self.left_click_count >= 3: # 连续点击3次进入自动模式
self.mode1_continuous = True
self.left_clicking_active = True
else:
self.left_click_count = 1
self.last_left_click_time = current_time
... | Python | 1 |
\x00" as *const u8 as
*const libc::c_char, 318i32);
return
}
handle_tablet_tool_axis(event, libinput_dev);
let mut tevent: *mut libinput_event_tablet_tool =
libinput_event_get_tablet_tool_event(event);
let mut wlr_event: wlr_event_tablet_tool_tip =
{
... | Rust | 0 |
tched stories with query {} (by_date={}, page={}) using {}",
query, by_date, page, request_url
)
);
Ok(response.into())
}
// reorder the front_page stories to follow the same order
// as in the official Hacker News site.
// Needs to do this because stories r... | Rust | 0 |
`varg` and `raw_varg`.
//!
//! The supplied function is preserved and a constructor function is generated
//! with a `_fn_meta` suffix, e.g., `#[rpn_fn] fn foo ...` will preserve `foo` and
//! generate `foo_fn_meta`. The constructor function returns an `rpn_expr::RpnFnMeta`
//! value.
//!
//! The constructor function w... | Rust | 0 |
c_mw::rpc]
pub trait StratumRpc: Sync + Send {
/**
Get all IP addresses from stratum IP pool
Request:
{
"jsonrpc": "2.0",
"method": "get_ip_list",
"params": {
"banned": null
},
"id": 1
}
Respond:
{
"id": 1,
"jsonrpc": "2.0",
"result": {
"Ok": [
{
"ban": false,
"failed_l... | Rust | 0 |
import os
import dotenv
from datetime import datetime
from crewai import Agent, Task
from langchain_openai import ChatOpenAI
from composio_crewai import ComposioToolset, App
dotenv.load_dotenv()
llm = ChatOpenAI(openai_api_key=os.environ["OPENAI_API_KEY"], model_name="gpt-4-turbo-preview")
composio_tool_set = Composi... | Python | 1 |
unsafe {
let mut stat: statfs = mem::zeroed();
if statfs(mount_point_cpath.as_ptr() as *const i8, &mut stat) == 0 {
total_space = u64::from(stat.f_bsize) * stat.f_blocks;
available_space = u64::from(stat.f_bsize) * stat.f_bavail;
let mut vec = Vec::with_capacity(st... | Rust | 0 |
'''
HDMI Type A connector utilities.
Created on 2 Oct 2021
@author: gianni
'''
import anchorscad as ad
from anchorscad import args, datatree, dtfield, CompositeShape, \
shape, surface_args, PathBuilder, LinearExtrude, Box, Shape, \
anchorscad_main, ShapeNode, Maker, ROTX_270, Node, cageof
import numpy as np
... | Python | 1 |
import xml.dom.minidom
import gradio as gr
from modules.core.models.zoo import ModelZoo
from modules.webui import webui_config
from modules.webui.webui_utils import (
get_speaker_names,
get_spk_emotions_from_name,
synthesize_ssml,
)
def apply_spk_and_emotion(xml_content: str, spk: str, emotion: str):
... | Python | 1 |
}
}
#[doc = "Checks if the value of the field is `IOMSTRIFC1_CLKEN`"]
#[inline(always)]
pub fn is_iomstrifc1_clken(&self) -> bool {
*self == CLOCKEN2STAT_A::IOMSTRIFC1_CLKEN
}
#[doc = "Checks if the value of the field is `IOMSTRIFC2_CLKEN`"]
#[inline(always)]
pub fn is_iomstrifc... | Rust | 0 |
async fn move_funds<S, P>(
main_contract: &Contract<Http>,
eth_provider: &EthereumProvider<S>,
depositor_wallet: &Wallet<S, P>,
alice: &mut Wallet<S, P>,
bob: &Wallet<S, P>,
token_like: impl Into<TokenLike>,
deposit_amount: u128,
) -> Result<(), anyhow::Error>
where
S: EthereumSigner + ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.