text string | label_name string | labels int64 |
|---|---|---|
struct Pallet<T>(_);
#[pallet::hooks]
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
fn on_runtime_upgrade() -> Weight {
use frame_support::storage::migration::move_storage_from_pallet;
if Self::current_storage_version() == V1
&& Self::on_chain_storage_... | Rust | 0 |
3a1f4b17b1cffd",
"features":{
"extras":[
"rand/simd_support"
]
},
"yanked":false,
"links":null
});
tracing_subscriber::fmt().with_max_level(Level::INFO).init();
// Scary
let _ = fs::remove_dir_all("e2e_test_repo");
let _ = fs::remove_dir... | Rust | 0 |
import os
import sys
import fnmatch
sys.path.append('sptk')
import numpy as np
from sklearn.preprocessing import StandardScaler
from sklearn.externals import joblib
from sptktools import w2r
from extract import ext_mcep, ext_mfcc, ext_pitch, ext_f0, ext_logf0
from converter import mcep2vec, mfcc2vec, pitch2vec, vec2... | Python | 1 |
um()
sum_diag2_X = _sqn(diag_X)
sum_diag2_Y = _sqn(diag_Y)
Kt_XX_sums = K_XX.sum(axis=1) - diag_X
Kt_YY_sums = K_YY.sum(axis=1) - diag_Y
K_XY_sums_0 = K_XY.sum(axis=0)
K_XY_sums_1 = K_XY.sum(axis=1)
Kt_XX_sum = Kt_XX_sums.sum()
Kt_YY_sum = Kt_YY_sums.sum()
K_XY_sum = K_XY_... | Python | 1 |
o [the specification][spec].
//!
//! [spec]: http://cr.yp.to/snuffle/spec.pdf
//!
/// Algorithm block size
pub const BLOCK_SIZE: usize = 64;
// http://cr.yp.to/snuffle/spec.pdf
fn rotl(n: u32, s: u8) -> u32 {
(n << s) | (n >> (32 - s))
}
fn quarterround(y: &[u32], z: &mut [u32]) {
//
// If y = (y0, y1, y... | Rust | 0 |
ticks(ticks: u16) -> Self {
Duration { inner: ticks }
}
/// Returns the total number of timer ticks contained by this `Duration`
pub fn as_ticks(&self) -> u16 {
self.inner
}
}
// Used internally by RTIC to convert the duration into a known type
impl TryInto<u32> for Duration {
type... | Rust | 0 |
s": 2,
"max_workers": 2,
},
},
autoscaler_v2=autoscaler_v2,
idle_timeout_minutes=999, # it could idle killed before the killer.
)
cluster.start()
ray.init()
wait_for_condition(lambda: len(list_nodes()) > 2)
... | Python | 1 |
import sciwing.constants as constants
from sciwing.infer.classification.classification_inference import (
ClassificationInference,
)
from sciwing.modules.embedders.bow_elmo_embedder import BowElmoEmbedder
from sciwing.modules.bow_encoder import BOW_Encoder
from sciwing.models.simpleclassifier import SimpleClassifie... | Python | 1 |
from PyFlow.Core.Common import *
from PyFlow.Core import FunctionLibraryBase
from PyFlow.Core import IMPLEMENT_NODE
import math
import random
import GIS2BIM_Lib
class DemoLib(FunctionLibraryBase):
'''doc string for DemoLib'''
def __init__(self, packageName):
super(DemoLib, self).__init__(packageName)... | Python | 1 |
terminal emulator.
//!
//! This provides basic support for various standards of control codes and escape sequences:
//! * ANSI
//! * VT100
//! * xterm
//!
//! This terminal emulator also supports Unicode characters;
//! see the [unicode-segmentation](https://crates.io/crates/unicode-segmentation) crate.
//! This sup... | Rust | 0 |
,
bp_set: &mut bool,
) -> Result<(), Error> {
use Action::*;
use EventKind::*;
let vcpu = event.get_vcpu();
dom.toggle_event(vcpu, PF, true).await?;
dom.toggle_event(vcpu, Breakpoint, true).await?;
dom.toggle_event(vcpu, SingleStep, true).await?;
if !*bp_set {
debug!("bp addres... | Rust | 0 |
nion_type = FromPrimitive::from_u8(
reader.read_u8()?
).unwrap_or(UnionType::Unset);
self.stream.push(TDFToken::UnionStart(union_type.clone()));
if union_type != UnionType::Unset {
self.des_label(reader)?;
let type_tag = reader.read_u8()?;
... | Rust | 0 |
o
[a| @ s d Z ddlmZmZmZ ddlmZmZmZ ddlm Z ddl
mZmZ ddl
mZ ejZejZejZejjZejjZejjZejjZe Zeddedd edd
eddeddedd
eddeddeddd ZG dd deZdd Zdd ZG dd dZeeefZ G dd de... | Python | 1 |
onent: u8,
chunk_exponent: u8,
/// Independent from the superchunk_exponent, although it may not be larger than self.max_lods().
num_lods: u8,
}
impl OctreeChunkIndex {
pub fn new_empty(superchunk_exponent: u8, chunk_exponent: u8, num_lods: u8) -> Self {
validate_params(superchunk_exponent, chu... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description: weather tool
"""
import json
import requests
from agentica.tools.base import Tool
from agentica.utils.log import logger
class WeatherTool(Tool):
def __init__(self):
super().__init__(name="get_weather_tool")
self.register(se... | Python | 1 |
import faiss
import numpy as np
from scipy import sparse
from scipy.sparse import csr_matrix
from tqdm import tqdm
from fairseq.data import Dictionary
dstore_size = 153225485
# dstore_size = 112733184
vec_dim = 1024
sample_per_word = 2
ckpt_path = 'checkpoints/wikitext103-bpe/'
# ckpt_path = 'checkpoints/wikitext103... | Python | 1 |
64, "number", std::f64::MIN, std::f64::MAX);
impl_json_schema_definition!(bool, "boolean");
impl_json_schema_definition!(String, "string");
impl_json_schema_definition!(&str, "string");
impl_json_schema_definition!(uuid::Uuid, "uuid");
impl_json_schema_definition!([i8], "array", "integer", std::i8::MIN, std::i8::MA... | Rust | 0 |
12));
let p_inf = Point::new(f64::INFINITY, 1.);
assert!(p.abs_diff_ne(&p_inf, 1e-2));
}
#[test]
fn test_relative_eq() {
let delta = 1e-6;
let p = Point::new(1.0, 1.0);
let p_x = Point::new(1.0 - delta, 1.0);
assert!(p.relative_eq(&p_x, 1e-2, 1e-2));
... | Rust | 0 |
| format : [ip] [alrogrithm]'
| overview: cargo run --release"
| usage: cargo run --release -- [db_file] [alrogrithm]"
| exit: quit or exit or Ctrl+C
+-----------------------------------------------------------------+`"#
);
if... | Rust | 0 |
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1
import typing, winrt
import enum
_ns_module = winrt._import_ns_module("Windows.Devices.Display")
try:
import winrt.windows.foundation
except:
pass
try:
import winrt.windows.graphics
except:
pass
class DisplayMoni... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import homework_location_wizard
| Python | 1 |
is wrong", stringify!($t));
)*}
}
#[test]
fn same() {
use crate::os::raw;
ok!(c_char c_schar c_uchar c_short c_ushort c_int c_uint c_long c_ulong
c_longlong c_ulonglong c_float c_double);
}
#[allow(dead_code)]
#[derive(Debug, Copy, Clone, PartialEq)]
pub enum LowDepthColour {
Black,
Blue,
Green,... | Rust | 0 |
volume_db = -65.25 * (1 - volume/100.0)
volume_control.SetMasterVolumeLevel(volume_db, None)
print(f"音量设置为: {volume}%")
return
except:
pass
# 方案2:使用PowerShell
... | Python | 1 |
Unary::from((crate::UnaryCode::$code, Box::new($expr)));
assert_eq!(result, expected.to_expr())
}
};
}
#[cfg(test)]
mod tests {
use super::*;
test!(sin_float: "SIN 1.0" -> Sin + 1.0.into());
test!(chain_rule_float: "SIN COS 1.0" -> Sin + Expr::from(Unary::from((UnaryCode::Cos, Box... | Rust | 0 |
TestDatabase,
&environment0,
Variance::Invariant,
&a,
&ty!(apply (item 0) (expr b)),
)
.unwrap();
table
.relate(
interner,
&TestDatabase,
&environment0,
Variance::Invariant,
&a,
... | Rust | 0 |
from django_filters import FilterSet
from .models import News
'''
Создаем свой набор фильтров для модели News.
FilterSet, который мы наследуем,
должен чем-то напомнить знакомые вам Django дженерики.
'''
class NewsFilter(FilterSet):
class Meta:
# В Meta классе мы должны указать Django модель, в которой бу... | Python | 1 |
ing>,
start_idx: usize,
pwd_len: usize,
result: String,
out_buf: &mut String,
) {
if result.len() == pwd_len {
if check_condition(&result) {
out_buf.push_str(&result);
out_buf.push_str("\n");
}
return;
}
let end_idx = vec.len() - (pwd_len - re... | Rust | 0 |
,
)
} else {
(
outer_length_start,
inner_length_start,
outer_length_end,
inner_length_end,
)
};
... | Rust | 0 |
s(pred_dict, metas)
for k, (boxes, scores, labels) in enumerate(bboxes):
outputs[k].update(
{
"boxes_3d": boxes.to("cpu"),
"scores_3d": scores.cpu(),
"l... | Python | 1 |
ecast_until', type = int, default=0)
given_year = request.args.get('given_year', type = int, default=2020)
territory_id = request.args.get('territory_id', type = int, default=34)
session = requests.Session()
df = PopInfoForAPI.get_detailed_pop(session, territory_id,
... | Python | 1 |
}.str};
// bad str
const B: &str = unsafe { SliceTransmute { repr: SliceRepr { ptr: &42, len: 999 } }.str};
//~^ ERROR it is undefined behavior to use this value
// bad str
const C: &str = unsafe { SliceTransmute { bad: BadSliceRepr { ptr: &42, len: &3 } }.str};
//~^ ERROR it is undefined behavior to use this value
//... | Rust | 0 |
cpgf._import("cpgf", "builtin.core");
cpgf._import("cpgf", "builtin.debug");
def start() :
driverType = irr.driverChoiceConsole();
if driverType == irr.EDT_COUNT :
return 1;
device = irr.createDevice(driverType, irr.dimension2d_u32(640, 480));
if device == None :
return 1;
device.setWindowCaption("cpgf Irr... | Python | 1 |
r::runner()
}
mod error {
#[allow(unused)]
use super::runner;
#[test]
fn too_few_args() {
assert_eq!(
runner().err(
"@use \'sass:map\';\
\na {b: map.deep-remove((c: d))}\n"
),
"Error: Missing argument $key.\
\n ,--> inp... | Rust | 0 |
t N: usize> super::aes256::DecryptionKey for DecryptionKey<N> {
type Block = __m128i;
type KeyRound = KeyRound;
#[inline(always)]
fn keyround(&self, index: usize) -> &Self::KeyRound {
unsafe {
unsafe_assert!(index < N);
self.0.get_unchecked(index)
}
}
}
/// ... | Rust | 0 |
}
let linear_index = LinearIndex::from_stream(stream)?;
Ok(Reference { bins, linear_index })
}
/// Returns all bins for the reference.
pub fn bins(&self) -> &HashMap<u32, Bin> {
&self.bins
}
/// Returns linear index.
pub fn linear_index(&self) -> &LinearIndex ... | Rust | 0 |
`lerp_unclamped_precise` which constrains `factor` to be between 0 and 1
/// (inclusive).
///
/// ```
/// use vek::ops::Lerp;
///
/// assert_eq!(Lerp::lerp_precise(10, 20, -1.0_f32), 10);
/// assert_eq!(Lerp::lerp_precise(10, 20, -0.5_f32), 10);
/// assert_eq!(Lerp::lerp_precise(10, 20,... | Rust | 0 |
pred_list = [pred[key] for key in pred]
result["wcs"] = compute_wcs_unlabeled(gt, pred_list, "sIoU")
result["ifa"] = 1
except:
pass
return result
def get_chunk_number(filename):
try:
num = filename.spli... | Python | 1 |
.cycle()
.take(50000)
.collect();
*/
for image_filepath in get_image_filepaths_from_commandline() {
create_image_output_dir(&image_filepath, "");
create_image_output_dir(&image_filepath, "centered");
create_image_output_dir(&image_filepath, "preview");
let image... | Rust | 0 |
ns, Reason, macros::check}};
use serenity::model::prelude::*;
use serenity::prelude::*;
use songbird::{
model::payload::{ClientConnect, ClientDisconnect, Speaking},
Event, EventContext, EventHandler as VoiceEventHandler,
};
use crate::utils::queue::TrackQueue;
use tokio::sync::RwLock;
pub struct TrackEndNoti... | Rust | 0 |
import re
import subprocess as sp
import sys
from cleo import Command as BaseCommand
from clikit.args import StringArgs
from clikit.io import NullIO
APP_NAME = "trakt-scrobbler"
CMD_NAME = "trakts"
platform = sys.platform
class Command(BaseCommand):
def call_sub(self, name, args="", silent=False):
"""cal... | Python | 1 |
em suspend and shutdown.
///
/// Internally, `PowerMonitor` uses D-Bus signals to notice when the system is preparing to sleep or shutdown. It also
/// uses systemd inhibitor locks to prevent the system from doing so until its callback has completed.
///
/// See [the systemd documentation](https://www.freedesktop.org/w... | Rust | 0 |
09>\xdfVr\xb8s\x1b=]T\xdf\xcb\
G\x9cH\x07\xfe\x99H\xce\xc4\xb6\xb1\xad\x03\xc0\xa0l\
\xb1\xe6i\x02Q\xdc\x92\xa6\x03\xef)M3h%\xe3\
\x98\xe2{j\x00D\xa2p\x95m\x84s=\x9f\x81\xe3\
4\xad\x01z\x8dsR\x16\x12\xde9\x89t\xa0,\xbd\
V\xb6\x8a\xe4\xe9$\xa0M\xf0\x8b\xec0[\x8b\x19\xcf\
,\x9eu\x890\xc4\xef\xbb-\xd6\x0c\xbf\x9d\x81\xef\... | Python | 1 |
&p[1..],
&m.filepath,
m.point,
SearchType::StartsWith,
Namespace::Both,
&session
);
for m in external_search_matches {
matches.push(m);
}
}
}
matches
}
/... | Rust | 0 |
fn promote(&self, message_id: &str) -> Result<WalletMessage> {
crate::block_on(async {
self.account_handle
.promote(&RustMessageId::from_str(&message_id)?)
.await?
.try_into()
})
}
/// Reattach message.
fn reattach(&self, message_... | Rust | 0 |
stener<Event> for Arc<RwLock<ListenerStruct>> {
/// async fn on_event(&self, event: &Event) -> Option<AsyncDispatchResult> { None }
/// }
///
///
/// let listener = Arc::new(RwLock::new(ListenerStruct {}));
/// let mut dispatcher: AsyncDispatcher<Event> = AsyncDispatcher::new();
///
... | Rust | 0 |
: Vec<ProtoPathBuf>,
/// All parsed `.proto` files including dependencies of input files.
pub file_descriptors: Vec<protobuf::descriptor::FileDescriptorProto>,
/// Description of the parser (e.g. to include in generated files).
pub parser: String,
}
#[cfg(test)]
mod test {
use std::collections::Has... | Rust | 0 |
writable half of an object returned from `AsyncRead::split`.
#[derive(Debug)]
pub struct WriteHalf<T> {
handle: BiLock<T>,
}
fn lock_and_then<T, U, E, F>(
lock: &BiLock<T>,
cx: &mut task::Context,
f: F
) -> Poll<Result<U, E>>
where F: FnOnce(&mut T, &mut task::Context) -> Poll<Result<U, E>>
{
... | Rust | 0 |
rocksdb.delete(&full_key)?;
self.save_meta(key, &meta, true)?;
Ok(true)
} else {
Ok(false)
}
}
}
}
pub fn map_for_each<F>(&self, key: &str, mut f: F) -> Result<u64>
where
F: FnMut(&str, B... | Rust | 0 |
b fn testcase_06_right_edge< T: harness::EmulatorInterface >() {
static ROM: &'static [u8] = include_bytes!( "../roms/sprite_hit_tests_2005.10.05/06.right_edge.nes" );
harness::standard_testcase::< T >( ROM, "cd8c9e59befaa11d5a261492fe0d2125", 23 );
}
pub fn testcase_07_screen_bottom< T: harnes... | Rust | 0 |
umerate(zip(self.blocks_vis, self.blocks_lwir)):
x_vis = blk_vis(x_vis)
print('x_vis.shape:', x_vis.shape) # 全部是 (bs, h//16, w//16, 1024)
# x_lwir = blk_lwin(x_lwir)
import pdb; pdb.set_trace()
outputs = [self.out_norm(x).permute(0, 3, 1, 2).contiguous()]... | Python | 1 |
(&pool, check_insert.id).await;
// Delete the changelog entry
let deleted = Changelog::delete_changelog(&pool, new_cl_id).await.unwrap();
assert!(deleted);
}
#[actix_web::test]
async fn test_db_changelog() {
use crate::models::models::*;
use chrono::NaiveDateTime;
let (_, pool) = get_config().a... | Rust | 0 |
import pytest
import numpy as np
from src.hand_detector import HandDetector
@pytest.fixture
def fake_frame():
# Create a fake OpenCV image (480x640 RGB)
return np.zeros((480, 640, 3), dtype=np.uint8)
def test_detect_hands_with_landmarks(mocker, fake_frame):
# Arrange: Patch MediaPipe Hands API
mock_... | Python | 1 |
>;
fn next(&mut self) -> Option<Self::Item> {
RUNTIME.block_on(self.async_stream.next())
}
}
use crate::{
display::splash::{spacer, step},
questions::options::get_options,
};
pub enum Options {
Default,
Resize,
Custom,
}
pub fn main() -> Options {
// Ask for output questions;
... | Rust | 0 |
import os
from typing import Literal, Optional
from dataclasses import dataclass, field
from datasets import DownloadMode
@dataclass
class EvaluationArguments:
r"""
Arguments pertaining to specify the evaluation parameters.
"""
task: str = field(
metadata={"help": "Name of the evaluation task... | Python | 1 |
"""
DS18x20 temperature sensor driver for MicroPython.
This driver uses the OneWire driver to control DS18S20 and DS18B20
temperature sensors. It supports multiple devices on the same 1-wire bus.
The following example assumes the ground of your DS18x20 is connected to
Y11, vcc is connected to Y9 and the data pin is co... | Python | 1 |
available_assets = settings.get_cryptobot_assets()
assets_text = ", ".join(available_assets)
await callback.message.edit_text(
f"🪙 <b>Пополнение криптовалютой</b>\n\n"
f"Введите сумму для пополнения в рублях от 100 до 100,000 ₽:\n\n"
f"💰 Доступные активы: {assets_text}\n"
... | Python | 1 |
}
};
// drop(q);
println!(
"Listening to channel: {} with status {}",
req.channel, req.status
); // debug
while let Ok(task) = rcv.recv_async().await {
// println!("want {:#?} and got {:#?}", req.status, t... | Rust | 0 |
"""
"""
import os
from os.path import join
from typing import Callable, Optional
from .base import ImageDatasetBase
class FoolingImages(ImageDatasetBase):
"""
From the paper *Deep neural networks are easily fooled: High confidence predictions for unrecognizable images*.
.. image:: https://i.stack.img... | Python | 1 |
..")
self.is_running = True
try: self.reset_game()
except EngineCommunicationError:
_d_print("错误:无法启动游戏,引擎通信失败。程序将退出。")
self.game_over = True
if self.game_over:... | Python | 1 |
t x_input, 1e-6);
// Check that x vector was left exactly unchanged
assert_matrix_eq!(x, x_input);
assert_matrix_eq!(j_fd, j(DVectorSlice::from(&x)), comp = abs, tol = 1e-6);
}
//! Tests auto-converted from "sass-spec/spec/non_conformant/extend-tests/184_test_control_flow_if.hrx"
#[test]
#[ignore] // wron... | Rust | 0 |
return []
for instruction in get_function_instructions('start'):
opcodes.discard(instruction.opname)
self.assertEqual(set(), opcodes)
def test_gc(self):
self.run_case("gc")
def test_line(self):
self.run_case("line")
class DTraceNormalTests(TraceTests):
... | Python | 1 |
ddr)
pluginsdk.Run()
pluginsdk.Wait()
allocated.append((bufferAddr, amount))
#at crypt gen random
pluginsdk.x64dbg.DbgCmdExec('deleteBPX kernel32.LocalAlloc')
for ind, entry in enumerate(allocated):
data = ""
index = 0x1C
for i in range(entry[1]-0x1C):
... | Python | 1 |
},
0usize,
concat!(
"Offset of field: ",
stringify!(HSM_CLIENT_TPM_INTERFACE_TAG),
"::",
stringify!(hsm_client_tpm_create)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<HSM_CLIENT_TPM_INTERFACE_TAG>())).hsm_client_... | Rust | 0 |
arrangement for your tasks around existing calendar commitments.
You can check back in a few moments or try with a simpler task description.
"""
else:
error_msg = result.get("error", "Unknown error")
return f"""
❌ **Scheduling Error**
I... | Python | 1 |
.unwrap();
block_on(lexer.consume_char_if(|c| {
assert_eq!(c, 'd');
true
}))
.unwrap()
.unwrap();
block_on(lexer.consume_char_if(|c| {
assert_eq!(c, '\n');
true
}))
.unwrap()
.unwrap();
// en... | Rust | 0 |
output: &mut Vec<u8>,
storage: &Storage,
repository: &mut ContextKeyValueStore,
stats: &mut SerializeStats,
strings: &StringInterner,
) -> Result<(), SerializationError> {
if let Some(shape_id) = repository.make_shape(dir)? {
serialize_shaped_directory(
shape_id,
dir... | Rust | 0 |
st<LogWeight> = TextParser::from_text_string(
"0\t1\t12\t25\n\
1\n",
)?;
let fst_2: VectorFst<LogWeight> = TextParser::from_text_string(
"1\t0\t12\t25\n\
0\n",
)?;
assert!(isomorphic(&fst_1, &fst_2)?);
Ok(())
}
}
use env_lo... | Rust | 0 |
use google::assistant::embedded::v1alpha2::*;
use google::r#type::*;
//use dasp_signal::{self as signal, Signal};
//use dasp_signal::interpolate::Converter;
pub mod google {
pub mod api {
include!("api/google.api.rs");
}
pub mod r#type {
include!("api/google.r#type.rs");
}
pub mod... | Rust | 0 |
PositiveInteger::from_str("-100000"),
Ok(NonPositiveInteger((-100000).to_bigint().unwrap()))
);
assert_eq!(
NonPositiveInteger::from_str("-1"),
Ok(NonPositiveInteger((-1).to_bigint().unwrap()))
);
assert_eq!(
NonPositiveInteger::from_str(... | Rust | 0 |
# -*- coding: utf-8 -*-
"""inference.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1vrhoqMgvRHUqaHHUBKzst1pEYkgrWwza
"""
!pip install tensorflow
import os
import numpy as np
from tensorflow import keras
from tensorflow.keras.models import load_model
... | Python | 1 |
; BORDER-TOP: #000 0px; BORDER-RIGHT: #000 0px"
width="50"></TD>
<TD style="BORDER-BOTTOM: #000 0px; BORDER-LEFT: #000 0px; BORDER-TOP: #000 0px; BORDER-RIGHT: #000 0px"
width="50"></TD>
<TD style="BORDER-BOTTOM: #000 0px; BORDER-LEFT: #000 0px; BORDER-TOP: #000 0px; BORDER-RIGHT: #000 0px... | Rust | 0 |
format!("Futura Extra Black Condensed {}", (dim.0 as f32 / 13.0).floor() as u32).as_str());
let image_surface = pangocairo::cairo::ImageSurface::create(Format::ARgb32, dim.0 as i32, 10000 as i32).unwrap();
let pixel_size;
{
let cairo_ctx: pangocairo::cairo::Context = pangocairo::cairo::Context::new(&image_sur... | Rust | 0 |
import glob
import os
import pickle
import cv2
import joblib
import numpy as np
from utils.transforms import swap_axes
def preprocess_3dpw(dataset_path, split, out_file):
# data we'll save
output = {
'vid_name': [],
'frame_id': [],
'joints3D': [],
'joints2D': [],
'sha... | Python | 1 |
;
pub const THREAD_SCHED_FIFO_INFO: u32 = 12;
pub const THREAD_STANDARD_POLICY: u32 = 1;
pub const THREAD_STANDARD_POLICY_COUNT: u32 = 0;
pub const THREAD_EXTENDED_POLICY: u32 = 1;
pub const THREAD_TIME_CONSTRAINT_POLICY: u32 = 2;
pub const THREAD_PRECEDENCE_POLICY: u32 = 3;
pub const THREAD_AFFINITY_POLICY: u32 = 4;
p... | Rust | 0 |
# -*- coding: utf-8 -*-
import os
from agents import Agent, function_tool
from openai import OpenAI
# Plantilla de prompt para análisis de datos
DATA_ANALYSIS_PROMPT = """
Analiza los siguientes datos: {data}
Tu trabajo es responder a la siguiente pregunta: {prompt}
"""
@function_tool
async def analyze_sales_data(pr... | Python | 1 |
import os
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
import csv
import tkinter as tk
from tkinter import filedialog, messagebox, Toplevel, Button, Label, ttk, BooleanVar
import numpy as np
from math import log, log10, sqrt
def custom_message_box(parent, callback_open_png, callback_open_f... | Python | 1 |
` Color math
/// `shbo4321`
/// * `s`: 0 = Add, 1 = Subtract
/// * `h`: Enable half-color math (the result of color math is divided by 2, in most cases)
/// * `bo4321`: Enable color math on **B**ackdrop, **O**BJ, BG4/3/2/1
cgadsub: u8,
/// `$2132` COLDATA: Fixed color data
/// Each write ca... | Rust | 0 |
else {
let _1: N = na::one();
let denom = _1 / ray.dir[i];
let mut inter_with_near_plane = ((*self.mins())[i] - ray.orig[i]) * denom;
let mut inter_with_far_plane = ((*self.maxs())[i] - ray.orig[i]) * denom;
if inter_with_near_plane... | Rust | 0 |
>) -> crate::Result<String> {
let bytes = bytes.as_ref();
if bytes.is_empty() {
// UTF16 decoding requires at least 2 bytes for it not to error.
return Ok("".to_string());
}
match self {
Encoding::Latin1 => Ok(string_from_latin1(bytes)),
En... | Rust | 0 |
unwrap(),
ExitCode::OK,
);
rt.expect_send(
*STORAGE_POWER_ACTOR_ADDR,
PowerMethod::CurrentTotalPower as u64,
RawBytes::default(),
TokenAmount::from(0u8),
RawBytes::serialize(current_power).unwrap(),
ExitCode::OK,
... | Rust | 0 |
RS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.co... | Python | 1 |
&input.image_id {
scope_1009.string(var_1010);
}
#[allow(unused_mut)]
let mut scope_1011 = writer.prefix("InstanceType");
if let Some(var_1012) = &input.instance_type {
scope_1011.string(var_1012);
}
#[allow(unused_mut)]
let mut scope_1013 = writer.prefix("KernelId");
if... | Rust | 0 |
ot modified.
///
///@param[in] compare The value to compare against
#[link_name = "\u{1}_ZNK4seal7BigUInt9comparetoEm"]
pub fn seal_BigUInt_compareto1(
this: *const seal_BigUInt,
compare: u64,
) -> ::std::os::raw::c_int;
}
extern "C" {
///Divides two BigUInts and returns the quot... | Rust | 0 |
#!/usr/bin/env python3
from __future__ import annotations
if __name__ != "__main__":
raise ImportError(f"{__name__} should not be used as a module.")
import os
import sys
from typing import Any, Callable
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), "../../"))
from gles3_builders i... | Python | 1 |
from .dpt import DepthAnythingV2
import torch
def get_depth_anything_v2(checkpoint_path = '', encoder = None, activation = 'relu', scale_factor = 1.0, inv_prediction = False, input_size_width = 518, input_size_height = 518, freeze_encoder = False, input_channels=3, nopretrain=False, _state_dict = None):
assert en... | Python | 1 |
s actually containing an element of the
// correct subgroup
let arr = GenericArray::from_slice(&checked_slice[..Grp::ElemLen::to_usize()]);
let beta = Grp::from_element_slice(arr)?;
let (server_s_pk, remainder) = tokenize(&checked_slice[Grp::ElemLen::to_usize()..], 2)?;
if !rema... | Rust | 0 |
t::KeepAlive).is_ok(), <Error<T>>::PayRegisterFail);
}
if SpreadUrls::<T>::contains_key(&hash, &relation) {
ensure!(T::SpreadCurrency::transfer(&sender, &fund, x2, ExistenceRequirement::KeepAlive).is_ok(), <Error<T>>::PayFundFail);
ensure!(T::SpreadCurrency::transfer(&sender, &relation, x4, ExistenceReq... | Rust | 0 |
-------------------------
tol = 1e-3
## identify frequency of interest
f_, f_idx = spod.find_nearest_freq(freq_req=1/12.5, freq=spod.freq)
modes_at_freq = spod.get_modes_at_freq(freq_idx=f_idx)
# coeffs = np.load(file_coeffs)
# recons = np.load(file_dynamics)
# pr... | Python | 1 |
sh_ten.key = f'{sh_ten.key}.{split_name}'
chunk_sh_tens.extend(split_chunks)
split_start += split_size
assert split_start == orig_sh_ten_no_data.local_shape[split_dim], (
split_start,
orig_sh_ten_no_data.local_shape[split_dim],
)
ass... | Python | 1 |
"""
Finalynx - Tutorial 1.3 - Control login and cache
=================================================
This tutorial shows how to clear the cache and login again to Finary
if you have changed your password or if you want to refresh your data.
Try it out by running:
> python3 examples/tutorials/3_login.py
See expl... | Python | 1 |
irst lines.
///
pub const NCDIRECT_OPTION_INHIBIT_SETLOCALE: NcDirectFlag_u64 =
ffi::NCDIRECT_OPTION_INHIBIT_SETLOCALE as NcDirectFlag_u64;
/// [`NcDirectFlag_u64`] flag that inhibits registration of the `SIGINT`,
/// `SIGSEGV`, `SIGABRT` & `SIGQUIT` signal handlers.
pub const NCDIRECT_OPTI... | Rust | 0 |
mn=2, padx=10, pady=5)
code = ttk.Entry(win)
code.grid(row=4, column=3, columnspan=2, padx=10, pady=5)
# interval selector (https://www.pythontutorial.net/tkinter/tkinter-menubutton/)
ttk.Label(win, text="Refresh Interval").grid(sticky=ttk.E, row=5, column=2, padx=10, pady=5)
options = ("Time in Seconds",.1,.5,1,5,30,... | Python | 1 |
(Cow::Borrowed).collect();
SupportedEventResult {
event_name: Cow::Borrowed(event_name),
arg_names,
}
... | Rust | 0 |
;
/// A UART we can access from anywhere (with run-time lock checking).
static GLOBAL_UART: spin::Mutex<Option<bsp::hal::uarte::Uarte<bsp::pac::UARTE0_NS>>> =
spin::Mutex::new(None);
#[macro_export]
macro_rules! print {
($($arg:tt)*) => {
{
use core::fmt::Write as _;
if let Som... | Rust | 0 |
for field in self.fields:
self.fields[field].widget.attrs.update({
'class': 'form-control',
'autocomplete': 'off'
})
class UserForgotPasswordForm(PasswordResetForm):
"""
Запрос на восстановление пароля
"""
def __init__(self, *args, **kwarg... | Python | 1 |
> {
Ok(())
}
/// Semantic action for production 78:
///
/// factor: "\(" logical_or "\)";
///
fn factor_3(
&mut self,
_l_paren: &ParseTreeStackEntry,
_logical_or: &ParseTreeStackEntry,
_r_paren: &ParseTreeStackEntry,
_parse_tree: &Tree<ParseTreeTy... | Rust | 0 |
5o78vrtm as ovcoe2ir141, zftu6w6onrr, ibusmumcgjo as g0a4netfo4z, xtt6r5ccs60
ks7dlnxubz1
import sdy7indxc9i, fz9rlv07_qt as mjewfq7xwyg, bvp7dbb9cup, g9iu92xog67 as rtmcyqxsjjf, cx96xy50ro_, az71l08wacu as xfsh1fu8jeu, r4x4xoq8ntn, cttgpkaaa7c as f15x1qd_s5c, rrmu_0y58oj as us65g2jp0y2, y9m9sysi2r8
pass
... | Python | 1 |
Fg d ddddZ y)z+https://www.youtube.com/watch?v=DeumyOzKqgIz+https://www.youtube.com/watch?v=OkpIoEC44kkz+https://www.youtube.com/watch?v=6d5SS0gS5bUz+https://www.youtube.com/watch?v=XO8wew38VM8)skyfallsangtenumillionaireN)music Lc:\Users\aadar\OneDrive\Desktop\HARRY P... | Python | 1 |
import logging
from sage.all import ZZ
from sage.all import matrix
from shared import small_roots
from shared.polynomial import max_norm
def integer_bivariate(p, k, X, Y, echelon_algorithm="default", roots_method="groebner"):
"""
Computes small integer roots of a bivariate polynomial.
More information: ... | Python | 1 |
'], quote_key)
is_found = False
# fuzzy search
for saved_pair in quote_cache:
saved_title, saved_quote = saved_pair
if saved_title != entry['title']:
continue
if fuzz.ratio(saved_quote, quote_key) > MATCH_PERCENT_THRESHOLD:
print 'found match!'
pri... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.