text string | label_name string | labels int64 |
|---|---|---|
=VAJiNvQskTA",
"tmp9BJsWJ",
"tmp9BJsWJ",
1565733600.0,
None,
9.0,
None,
"youtube VAJiNvQskTA",
),
Video(
"https://www.youtube.com/watch?v=rYneNOGiYWI",
"tmpnmofZb",
"tmpnmofZb",
1565301600.0,
None,
9.0,
... | Python | 1 |
class Solution:
def findPairs(self, nums: List[int], k: int) -> int:
ans = 0
numToIndex = {num: i for i, num in enumerate(nums)}
for i, num in enumerate(nums):
target = num + k
if target in numToIndex and numToIndex[target] != i:
ans += 1
del numToIndex[target]
return ans... | Python | 1 |
::Error;
use crate::hash::H256;
/// Interface for interacting with the state's Sparse Merkle Tree (SMT).
///
/// The SMT can be modeled as a `FixedVector[Account, 2**256]`. It's merkle tree structure is as
/// follows:
///
/// ```text
/// root
/// / \
/// ... ... <= intermediate n... | Rust | 0 |
ed(&self) -> crate::NiterResult<bool>;
fn is_advertising(&self) -> crate::NiterResult<bool>;
fn start_advertising(&self, name: &str) -> crate::NiterResult<()>;
fn stop_advertising(&self) -> crate::NiterResult<()>;
fn register_gatt(&self) -> crate::NiterResult<()>;
fn unregister_gatt(&self) -> crate:... | Rust | 0 |
# INTERFASES EN PYTHON
from abc import ABC, abstractmethod
class ProcesoPago(ABC):
@abstractmethod
def procesoPago(self, cantidad: float) -> None:
pass
@abstractmethod
def reembolsoPago(self, transaccionId: str) -> None:
pass
class Paypal(ProcesoPago):
def procesoPa... | Python | 1 |
y(labels_dict[label]) for label in labels_dict]
except:
data = labels_dict # was already in format TODO: this is unsafe
# Plot the KDE using seaborn
for i in range(len(data)):
sns.kdeplot(data[i], fill=True, label=list(labels_dict.keys())[i])
# Set labels and title
plt.xlabel(labe... | Python | 1 |
&Position
) -> Result<bool, Vec<TypeErr>> {
let res: Vec<bool> =
self.union.iter().map(|c| c.has_parent(name, ctx, pos)).collect::<Result<_, _>>()?;
Ok(res.iter().all(|b| *b))
}
}
impl HasParent<&DirectName> for ClassTuple {
fn has_parent(&self, name: &DirectName, ctx: &Context... | Rust | 0 |
bus.0 - input.earliest);
println!("{:?}: {:?} {:?}", label, first_bus, answer);
}
struct Bus {
id: u64,
index: u64,
}
/// Takes a string that is either "x" or an integer, and returns
/// the corresponding Bus spec.
fn parse_bus(bus_str: &str, index: u64) -> Option<Bus> {
if bus_str == "x" {
O... | Rust | 0 |
x2_t) -> u32;
#[link_name = "llvm.aarch64.neon.uaddv.i32.v8i8"]
fn vaddv_u8_(a: uint8x8_t) -> u8;
#[link_name = "llvm.aarch64.neon.saddv.i32.v8i16"]
fn vaddvq_s16_(a: int16x8_t) -> i16;
#[link_name = "llvm.aarch64.neon.saddv.i32.v4i32"]
fn vaddvq_s32_(a: int32x4_t) -> i32;
#[link_name = "llv... | Rust | 0 |
graph::Values>);
impl<'a> Compact for UncompactedEnv<'a> {
type Output = ();
fn compact(&self, ctx: &mut CompactContext) -> Self::Output {
ctx.env = self.0.as_ref().map(|x| Env(x.compact(ctx)))
}
}
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Env(pub Values);
impl Decompact for Env... | Rust | 0 |
b
};
}
/// Aligns an address to a boundary
#[macro_export]
macro_rules! align {
($n:expr, $d:expr) => {
($n + ($d - 1)) & !($d - 1)
};
}
/// Evaluates to true if an address is aligned to a boundary
#[macro_export]
#[allow(clippy::nonminimal_bool)]
macro_rules! is_aligned {
($addr:expr, $d:expr... | Rust | 0 |
设置请求头
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {api_key}'
}
# 构建请求数据
data = {
"model": llm_model_name,
"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": full_prompt}],... | Python | 1 |
t) # type: ignore
# Get raw predictions for test set
test_predictions = trainer.predict(test_dataset)
# Save failing cases
failing_cases = save_failing_cases(test_predictions.predictions, test_predictions.label_ids, test_data, training_args.output_dir)
# Add failing cases summary to wandb
if... | Python | 1 |
ferences to trait impls which handle different types of messages.
pub struct MessageHandler<CM: Deref, RM: Deref> where
CM::Target: ChannelMessageHandler,
RM::Target: RoutingMessageHandler {
/// A message handler which handles messages specific to channels. Usually this is just a
/// [`ChannelManager`] object or ... | Rust | 0 |
e we created the pointer with Box::leak(), we can recreate the box to drop it
unsafe { Box::from_raw(self.inner.as_ptr()) };
}
#[cfg(feature = "println")]
println!("{:?} dropend {:p}", current().id(), self);
}
}
impl<I: Interner> PartialEq for Interned<I> {
fn eq(&self, oth... | Rust | 0 |
response_delay, now)
})
}
MldPacket::MulticastListenerReport(msg) => {
handle_mld_message(self, device, msg.body(), |_, MldGroupState(state)| {
state.report_received()
})
}
MldPacket::MulticastListenerDon... | Rust | 0 |
ogPost {
req: user_req.clone(),
permalink: permalink_value,
},
) {
Ok(row) => {
let q: WgoBlogPost = row.get(0);
let t = &t(&q.data.lang.code);
let html = Post {
domain: &config.server.domain,
title: &form... | Rust | 0 |
import typing
property_mapper = {
'*': {
'wifiRssi': 'wifiRSSI'
},
'STH0A': {
'a': 'alarmStatus',
'b': 'temperature',
'c': 'humidity',
'd': 'temperatureUnit',
'e': 'temperatureRange',
'f': 'humidityRange',
'g': 'alarmEnabled',
'h': 'co... | Python | 1 |
ained = True
model.feature_names = ["feature_1", "feature_2", "feature_3"]
model.target_name = "target"
model.predict.return_value = np.random.random(100)
model.feature_importance.return_value = pd.DataFrame(
{
"feature": ["feature_1", "feature_2", "feature_3"],
"importan... | Python | 1 |
_img = x2bot_img[:, :, :, int(W / 2):W] # 右下角
##-------------- Stage 1---------------------
# 计算表面特征
x1ltop = self.shallow_feat1(x1ltop_img) # torch.Size([1, 96, 256, 256])
x1rtop = self.shallow_feat1(x1rtop_img)
x1lbot = self.shallow_feat1(x1lbot_img)
x1rbot = self.sha... | Python | 1 |
method_def.flags.contains(HhasMethodFlags::IS_CLOSURE_BODY) {
w.write_all(b" isClosureBody")?;
}
w.write_all(b" ")?;
braces(w, |w| {
ctx.block(w, |c, w| {
print_body(c, w, body, &method_def.coeffects, &dv_labels)
})?;
newline(w)?;
w.write_all(b" ")
}... | Rust | 0 |
7.15"))
assert pnl == Money(582.03640000, USDT)
assert position.realized_pnl == Money(-62.10910720, USDT)
assert position.commissions() == [Money(62.10910720, USDT)]
def test_calculate_unrealized_pnl_for_long_inverse() -> None:
instrument = TestInstrumentProviderPyo3.xbtusd_bitmex()
order = TestO... | Python | 1 |
![Package::from("foo.bar.packageA")],
);
assert_eq!(parsed.unwrap(), expect);
}
}
<gh_stars>0
use crate::frame::{
Content, EncapsulatedObject, ExtendedLink, Picture, PictureType, SynchronisedLyrics,
SynchronisedLyricsType, TimestampFormat,
};
use crate::stream::encoding::Encoding;
use crate... | Rust | 0 |
Const, c2: Const) {
let res = fold_neg(&ExprKind::Const(c1)).unwrap().unwrap();
assert_eq!(res, c2)
}
}
<filename>k8s-openapi-codegen/src/logger.rs<gh_stars>10-100
pub(crate) fn make_local_logger(version_name: &'static str) -> env_logger::Logger {
let mut builder = env_logger::Builder::new();
bui... | Rust | 0 |
> "fullscreenchange", FullScreenError => "fullscreenerror", Resize => "resize",
Scroll => "scroll", Cut => "cut", Copy => "copy", Paste => "paste",
KeyDown => "keydown",
KeyPress => "keypress", AuxClick => "auxclick", Click => "click", ContextMenu => "contextmenu", DblClick => "dblclick",
MouseDown => ... | Rust | 0 |
score >= 30:
screen.blit(b_img,(0,0))
draw_text(screen, "score: 30", 35, WIDTH/2-80, 0)
time.sleep(1)
screen.fill("green")
draw_text(screen, "You win!", 200, WIDTH/2,150)
pygame.display.flip()
wl_sd[1].play()
time.sleep(3)
pygame.quit()
exi... | Python | 1 |
/// - the type implementing SqlConvertible is not convertible from i64
fn try_from_i64(_: &i64) -> Result<Self> {
Self::default_err("i64")
}
/// # Failures
///
/// - [SpringError::Sql](crate::error::SpringError::Sql) when:
/// - the type implementing SqlConvertible is not convertibl... | Rust | 0 |
/// The process ID of the owner
Process,
/// ISO Latin-1 (+TAB+NEWLINE) text
String,
/// A list of valid target atoms
Targets,
/// The task ID of the owner
Task,
/// The text in the owner's choice of encoding
Text,
/// The timestamp used to acquire the selection
Timestamp,
/// The name of the user running... | Rust | 0 |
; clear everything
trace!("Wiping cache");
self.lru_storage.clear();
self.lru_child_storage.clear();
self.lru_hashes.clear();
self.modifications.clear();
}
}
}
pub type SharedCache<B, H> = Arc<Mutex<Cache<B, H>>>;
/// Fix lru storage size for hash (small 64ko).
const FIX_LRU_HASH_SIZE: usize = 65_53... | Rust | 0 |
Rapier will call `EventHandler::handle_intersection_event` and
/// `EventHandler::handle_contact_event` whenever relevant for this collider.
const COLLISION_EVENTS = 0b0001;
}
}
impl Default for ActiveEvents {
fn default() -> Self {
ActiveEvents::empty()
}
}
/// Trait implemented ... | Rust | 0 |
_values_in_files};
pub fn generate_new_application(name: &str) {
create(format!("{}/", name), false);
create(format!("{}/src", name), false);
create(format!("{}/src/ui", name), false);
create(format!("{}/src/ui/components", name), false);
create(format!("{}/public", name), false);
write_all(format!("{}/s... | Rust | 0 |
.0),
( 0.0, 0.0, 1.0, 0.0),
( 0.0, 0.0, 0.0, 1.0),
)
}
pub fn view_transform(from: Tuple4, to: Tuple4, up: Tuple4) -> Matrix {
let forward = (to - from).normalize();
let left = forward.cross(up.normalize());
let trueup = left.cross(forward);
let m = matrix(
( ... | Rust | 0 |
from __future__ import absolute_import
from __future__ import print_function
import pyverilog.vparser.ast as vast
from pyverilog.ast_code_generator.codegen import ASTCodeGenerator
def main():
# Define ports
a = vast.Ioport(vast.Input('A'))
b = vast.Ioport(vast.Input('B'))
sel = vast.Ioport(vast.Input('... | Python | 1 |
ethabi::Token::Uint(ethereum_types::U256::from(*val));
// create call for foo
let returns = runtime.function(&mut store, "setFoo", &[eval]);
assert_eq!(returns, vec![]);
// create call for foo
let returns = runtime.function(&mut store, "getFoo", &[]);
let eval = ethab... | Rust | 0 |
sk.as_ptr(),
ffi::secp256k1_nonce_function_rfc6979,
ptr::null()
),
1
);
}
RecoverableSignature::from(ret)
}
/// Generates a random keypair. Convenience function for `key::SecretKey::new`
/// and `key::Pu... | Rust | 0 |
FILTER_COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x84,
D3D11_FILTER_COMPARISON_MIN_POINT_MAG_MIP_LINEAR = 0x85,
D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_MIP_POINT = 0x90,
D3D11_FILTER_COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x91,
D3D11_FILTER_COMPARISON_MIN_MAG_LINEAR_MIP_POINT = 0x94,
D3D11_FI... | Rust | 0 |
# coding=utf-8
# 这是一个 **功能残缺** 的facebook
#
# 使用方法:
# 1. 复制本文件到 zmirror 根目录(wsgi.py所在目录), 并重命名为 config.py
# 2. 修改 my_host_name 为你自己的域名
#
# 各项设置选项的详细介绍请看 config_default.py 中对应的部分
# 本配置文件假定你的服务器本身在墙外
# 如果服务器本身在墙内(或者在本地环境下测试, 请修改`Proxy Settings`中的设置
#
# 存在很多问题. 最大的问题是当地址栏发生改变时, 不会自动刷新, 以后会加入刷新脚本
#
# Github: https://gi... | Python | 1 |
t.find_state(9)
self.assertIsNotNone(ts)
self.assertEqual(ts.frame_id, 9)
with self.assertRaises(IndexError):
t.find_state(10)
t.append(TrackState(10))
self.assertIsNotNone(t.find_state(10))
self.assertEqual(t.find_state(10).frame_id, 10)
def test_track_... | Python | 1 |
grid),3);
}
}<gh_stars>1-10
//
// main
// authored by d-exclaimation
//
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use] extern crate rocket;
#[macro_use] extern crate rocket_contrib;
mod db;
mod model;
mod config;
use rocket_contrib::json::{Json, JsonValue};
use std::collections::HashMap;
use rocket::confi... | Rust | 0 |
#!/usr/bin/env python3
"""
测试checkbox级联选择功能
"""
import sys
import os
import tempfile
from pathlib import Path
# 添加src目录到Python路径
sys.path.insert(0, str(Path(__file__).parent.parent / "src"))
# 设置环境变量以支持无头模式
os.environ['QT_QPA_PLATFORM'] = 'offscreen'
from PySide6.QtWidgets import QApplication
from PySide6.QtCore im... | Python | 1 |
# This code is based on the Summary Evaluation in LightRAG codebase.
import re
import os
import time
import json
import jsonlines
import argparse
import pandas as pd
from openai import OpenAI
import multiprocessing as mp
from functools import partial
INCLUDE_COL = [
"Comprehensiveness",
"Diversity",
"Emp... | Python | 1 |
0x1D);
opcode!(ORA_ABS_Y, 0x19);
opcode!(ORA_IX_IND, 0x01);
opcode!(ORA_IND_IX, 0x11);
opcode!(PHA, 0x48);
opcode!(PLA, 0x68);
opcode!(PHP, 0x08);
opcode!(PLP, 0x28);
opcode!(ROL_A, 0x2A);
opcode!(ROL_ZPG, 0x26);
opcode!(ROL_ZPG_X, 0x36);
opcode!(ROL_ABS, 0x2E);
opcode!(ROL_ABS_X, 0x3E);
opcode!(ROR_A, 0x6A);
opcod... | Rust | 0 |
W => pos.0 -= instr.value as isize,
Action::L => dir = (dir + 360 - instr.value) % 360,
Action::R => dir = (dir + instr.value) % 360,
_ => panic!("Unexpected instr {:?}", instr),
}
}
(pos.0.abs() + pos.1.abs()) as usize
}
pub(crate) fn distance_from_origin_after_fol... | Rust | 0 |
FormDeserializer<'de> {
input: std::iter::Peekable<
std::collections::hash_map::Iter<
'de,
std::borrow::Cow<'de, str>,
std::borrow::Cow<'de, [String]>,
>,
>,
}
macro_rules! from_string_forms_key_impl {
($($t:ty => $method:ident)*) => {$(
fn $... | Rust | 0 |
arbitrary_types_allowed = True
def __init__(self, query_pipeline: QueryPipeline) -> None:
"""Initialize."""
super().__init__()
self.query_pipeline = query_pipeline
self.predict_modules = []
for module in query_pipeline.module_dict.values():
if isinstance(modul... | Python | 1 |
>,
/// The maximum number of documents in a capped collection. The `size` limit takes precedence
/// over this option. If a capped collection reaches the size limit before it reaches the
/// maximum number of documents, MongoDB removes old documents.
#[builder(default)]
max: Option<i64>,
/// T... | Rust | 0 |
input = Span::new(b"b'");
let output = Err(Error::Error(Context::Code(input, ErrorKind::Alt)));
assert_eq!(string_single_quoted(input), Err(Error::Error(Context::Code(input, ErrorKind::Custom(StringError::TooShort as u32)))));
assert_eq!(string(input), output);
assert_eq!(literal(inpu... | Rust | 0 |
n(func(*args, **kwargs))
# 这里是为了日常任务的check问题
async def run_sched_func_with_return(self, func: Callable, *args, **kwargs):
scheduler = self._scheduler
if scheduler is not None and not scheduler.closed:
return await func(*args, **kwargs)
def run_sched_func_bg(self, *args, **kwarg... | Python | 1 |
r_id: &str,
view: &str,
hash: &str,
) -> Result<crate::types::DndEndSchema> {
let mut query_args: Vec<(String, String)> = Default::default();
if !hash.is_empty() {
query_args.push(("hash".to_string(), hash.to_string()));
}
if !user_id.is_empty() {
... | Rust | 0 |
ned = 'weights/vggface2_weights.pt', device = 'cpu'):
if isinstance(device, str):
if (device == 'cuda' or device == 'gpu') and torch.cuda.is_available():
device = torch.device(device)
else:
device = torch.device('cpu')
model = InceptionResnetV1().to(device)
model... | Python | 1 |
) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "Slave Interrupt Enable Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crat... | Rust | 0 |
def compute_next_bn_1d(layer_name, resnet):
list_layer = extract_layers(resnet)
assert layer_name in list_layer
if layer_name == list_layer[-1]:
return None
next_bn = list_layer[list_layer.index(layer_name) + 1]
if extract_layer(resnet, next_bn).__class__.__name__ == 'BatchNorm1d':
r... | Python | 1 |
from re import compile
def is_valid_email(email: str) -> dict:
email_pattern = compile(r"([A-Za-z0-9]+[.-_])*[A-Za-z0-9]+@(gmail.com|yahoo.com)$")
if not email_pattern.match(email):
return {"valid": False, "message": "The email address you entered is invalid. Please check the format of your "
... | Python | 1 |
s: `\"Win32_Graphics_Gdi\"`*"]
pub const DISPLAY_DEVICE_ACTIVE: u32 = 1u32;
#[doc = "*Required features: `\"Win32_Graphics_Gdi\"`*"]
pub const DISPLAY_DEVICE_ATTACHED: u32 = 2u32;
#[doc = "*Required features: `\"Win32_Graphics_Gdi\"`*"]
pub const DISPLAY_DEVICE_ATTACHED_TO_DESKTOP: u32 = 1u32;
#[doc = "*Required featur... | Rust | 0 |
data.extend([IR.ConstantExpr(ord(x))
for x in line.expect("STRING").value])
else:
data.append(FE.parse_expr(line))
next = line.expect(',', 'EOL').type
return data
def readData(line):
"Read charmap-translated data from a comma-separated list"
... | Python | 1 |
)
.arg("precheck")
.arg(package_artifacts_path("signed_with_correctly_signed_app").as_os_str())
.assert()
.success()
.stdout(predicate::str::contains("not all checks were performed"));
}
#[test]
pub fn test_precheck_package_fail() {
Command::cargo_bin("xcnotary")
.un... | Rust | 0 |
t_cap": 2809147102329,
# "total_shares": 43191068609,
# "benefit": {
# "requirement": 1000000,
# "description": "a 10% Education Course Duration Reduction"
# }
# },
# "26": {
# "name": "International School TC",
# "acronym": "IST",
# "current_price": 317.84,
# "market_cap": 268278917341,
# "tota... | Python | 1 |
def read_file(file_path, encoding='latin-1'):
with open(file_path, encoding=encoding or 'utf-8') as f:
return f.read()
def zeros_dict(words_list):
return dict(zip(words_list,[0]*len(words_list))) | Python | 1 |
return
def show_character_cards(self, character_id):
"""显示指定角色的所有卡牌"""
import duckdb
print(f"进入show_character_cards函数,角色ID={character_id}")
try:
# 连接数据库
con = duckdb.connect(DB_PATH)
print(f"已连接数据库: {DB_PATH}")
... | Python | 1 |
_features = private_key.cpu_features;
let private_key = private_key.bytes_less_safe().try_into_()?;
#[cfg(target_arch = "arm")]
{
if cpu::arm::NEON.available(cpu_features) {
static MONTGOMERY_BASE_POINT: [u8; 32] = [
9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,... | Rust | 0 |
Err(HaltReason::StackOverflow),
};
}
PopSlot2 => {
let obj = match self.scratch[1] {
Some(obj) => obj,
None => return Err(HaltReason::EmptyScratch)
};
match self.stack.push(o... | Rust | 0 |
ads, opcodes::sdr::*};
//!
//! # const FAST_READ_QUAD_IO: u8 = 0;
//! # const READ_STATUS_REGISTER_1: u8 = 0;
//! const SEQ_READ: Sequence = SequenceBuilder::new()
//! .instr(Instr::new(CMD, Pads::One, FAST_READ_QUAD_IO))
//! .instr(Instr::new(RADDR, Pads::Four, 0x18))
//! .instr(Instr::new(DUMMY, Pads::Fou... | Rust | 0 |
rax");
}
println!(" mov rsp, rbp");
println!(" pop rbp");
println!(" ret");
}
// Copyright 2022 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use crate::{AsyncError, AsyncResult, EventAsync, Exec... | Rust | 0 |
import torch
@torch.no_grad()
def concat_all_gather(tensor):
"""
Performs all_gather operation on the provided tensors.
*** Warning ***: torch.distributed.all_gather has no gradient.
"""
tensors_gather = [torch.ones_like(tensor)
for _ in range(torch.distributed.get_world_size())]
torch.distributed.all_gather(t... | Python | 1 |
ror("Invalid topic name: {name:?}")]
InvalidTopic { name: String },
#[error("Invalid topic filter: {pattern:?}")]
InvalidFilter { pattern: String },
#[error("MQTT client error: {0}")]
ClientError(#[from] rumqttc::ClientError),
#[error("Stream error: {0}")]
StreamError(Box<Error>),
#[... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in complia... | Python | 1 |
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = "j E Y г."
TIME_FORMAT = "G:i"
DATETIME_FORMAT = "j E Y г. G:i"
YEAR_MONTH_FORMAT = "F Y г."
MONTH_D... | Python | 1 |
Key;
pub struct DefaultInputHandler;
impl DefaultInputHandler {
pub fn new() -> DefaultInputHandler {
DefaultInputHandler
}
}
impl InputHandler for DefaultInputHandler {
fn start(&mut self) -> io::Result<()> {
// Do nothing
Ok(())
}
fn stop(&mut self) -> io::Result<()> {
... | Rust | 0 |
\
\x88o\x88\xadl\xc7\xcc\x1c\xfb\xaf\xe3\xb0\xcc\xff\xec\x0b\
\x00<\xe4\x1a\xe1\xc3\xa5Q\x14\xd3\xf0O\xdf\xeb\x1d\xc5\
\x97!\xc4\x1d\x03\xe1!\xad\xc1\xe6\xc1\xee\xc1N\xb1\xb5\
\xbe\x02#\x5c\x03\x88\xd8\xac!R\xa1\x18hz\xaa\x7f\
\x89Y\x1c\x0a\x8a\x0f\xdc\x18t|5Fx\x1c\xcd\xf8\
\xae\xa8\xc6a\x84h\xcb\x18\xa1\x08\x05S\xc6\x... | Python | 1 |
me.sleep(0.5)
vehicle.mode = VehicleMode("AUTO")
# Görev waypoint’lerini bitene kadar bekle
print("Görev başladı, waypoint’leri izliyorum...", flush=True)
total_wp = vehicle.commands.count
while True:
next_wp = vehicle.commands.next
print(f" • Next waypoint: {next_wp}/{total_wp}"... | Python | 1 |
", derive(Serialize, Deserialize))]
pub struct RandomUpdateCommandClearArg {
// special fields
#[cfg_attr(feature = "with-serde", serde(skip))]
pub unknown_fields: ::protobuf::UnknownFields,
#[cfg_attr(feature = "with-serde", serde(skip))]
pub cached_size: ::protobuf::CachedSize,
}
impl<'a> ::std::... | Rust | 0 |
i as f64),
&DVector::from_fn(m, |j, _| j as f64),
);
File::create(filename)?.write_all(&bytes)
}
pub fn to_gplot_matrix_bytes(
data: &DMatrix<f64>,
x_coords: &DVector<f64>,
y_coords: &DVector<f64>,
) -> Vec<u8> {
let (m, n) = data.shape();
assert_eq!(x_coords.len(), n);
assert... | Rust | 0 |
với ý nghĩa, đặc biệt là để chế giễu hoặc giễu cợt. \
Được thực hiện để làm tổn thương cảm xúc của ai đó, chỉ trích hoặc diễn đạt điều gì đó theo cách hài hước
2. Có sự không khớp giữa văn bản (trong Chú thích hoặc OCR) và hình ảnh gợi ý sự châm biếm thông qua sự mâu thuẫn hoặc cường điệu.
3. Sử dụng phép cường điệu đ... | Python | 1 |
0x03) << 14);
self.w
}
}
#[doc = "Reader of field `SENSITIVE_CORE_X_DRAM0_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_0`"]
pub type SENSITIVE_CORE_X_DRAM0_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_0_R = crate::R<u8, u8>;
#[doc = "Write proxy for field `SENSITIVE_CORE_X_DRAM0_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_0`"]
pub struct SENSITIVE... | Rust | 0 |
format!("{}{}", TOP_RIGHT_CORNER, HORIZONTAL_BAR)),
)
);
// MESSAGE + TRACES
let log = Log::info().stack("", |stack| {
stack
.show_stack_numbers(true)
.trace("File2", |trace| trace)
.trace("File1", |trace| trace)
... | Rust | 0 |
ms, demisto.getLastRun())
for indicators_batch in batch(indicators, batch_size=2000):
demisto.createIndicators(indicators_batch) # type: ignore
demisto.setLastRun({"last_successful_run": str(now)})
else:
raise NotImplementedError(f"Command {command} is not i... | Python | 1 |
ook_TA_Get_BlockedStartTime(obj: usize) -> f32;
fn GrapplingHookPickup_SetBlockedStartTime(obj: usize, new_val: f32);
fn SpecialPickup_GrapplingHook_TA_Get_BlockedStartPos(obj: usize, result: *mut Vector);
fn GrapplingHookPickup_SetBlockedStartPos(obj: usize, new_val: *mut Vector);
fn SpecialPickup_Grap... | Rust | 0 |
uments(arg.to_owned());
assert_eq!(expected, extended);
}
}
}
<gh_stars>0
//! Encoding of portable pixmap Images
pub use self::encoder::PPMEncoder as PPMEncoder;
#[allow(deprecated)]
pub use self::decoder::PPMDecoder as PPMDecoder;
mod encoder;
mod decoder;
#[cfg(test)]
mod test {
use col... | Rust | 0 |
import builtins
import io
import requests
from modules import shared
from modules.logging_colors import logger
original_open = open
original_get = requests.get
original_print = print
class RequestBlocker:
def __enter__(self):
requests.get = my_get
def __exit__(self, exc_type, exc_value, traceback... | Python | 1 |
in register X
macro_rules! test_RES_b_r_X {
($ ( $name: ident : ($instr: expr, $bit: expr, $x: ident), )* ) => {
$(
#[test]
fn $name() {
{
let machine = test_cpu(&[0xCB, $instr], |cpu| { cpu.regs.$x = 1 << $bit; });
assert_eq!(machine.clock_cycles(), ... | Rust | 0 |
# Copyright (c) 2025, Al-Aswany and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class MSDepartment(Document):
def on_update (self):
self.update_company_count(self.company)
def after_delete(self):
self.update_company_count(self.compan... | Python | 1 |
for generic symbols before adding new XFree86-specific
* symbols here.
*
* X.Org will not be adding to the XF86 set of keysyms, though they have
* been adopted and are considered a "standard" part of X keysym definitions.
* XFree86 never properly commented these keysyms, so we have done our
* best to explain the... | Rust | 0 |
);
assert_eq!(object.tr_ids.client_tr_id.unwrap(), CLTRID.into());
assert_eq!(object.tr_ids.server_tr_id, SVTRID.into());
}
}
<gh_stars>0
struct Day1 {}
impl Day1 {
pub fn sonar_sweep(input: Vec<String>) -> i32 {
let sonars: Vec<i32> = input
.into_iter()
.map(|s|... | Rust | 0 |
urce, sourcePersona)
nodeNameSet.add(source)
if (target not in nodeNameSet):
self.buildNode(targetDim,target, targetPersona)
nodeNameSet.add(target)
if ((source,target) not in edgeSet):
fromName = source
toName = target
if meName == 'end':
... | Python | 1 |
# y1 = [7913, 41611, 5704, 31606, 15119, 52997, 4596, 10413, 4670, 9391, 414, 7196, 9501, 7485, 1226, 812, 13030]
# y2 = [4701, 35261, 3043, 8306, 13342, 2304, 2179, 9366, 3077, 8766, 407, 5883, 6396, 2069, 970, 775, 9803]
y1 = [ 31873, 34004, 29688, 38513,
31606, 33967, 23247, 23104, 6293, 341, 7948, 11449, 25... | Python | 1 |
from model.insumo import Semente, Fertilizante, Defensivo, Implemento
from model.cultura import Cultura
# Sementes
sem1 = Semente(nome='Certificada RR', id=101, valor=100, cultura='Soja', tecnologia='Não Transgenica')
sem2 = Semente(nome='VT Pro 2', id=102, valor=120, cultura='Milho', tecnologia='Transgenica')
# Fer... | Python | 1 |
y = conv_transpose_module(x)
print(y.shape)
def test_single_input_masked_conv_transpose(self):
bm.random.seed()
x = jnp.ones((1, 8, 8, 8, 3))
m = jnp.tril(jnp.ones((3, 3, 3, 3, 4)))
conv_transpose_module = bp.layers.ConvTranspose3d(
in_channels=3,
... | Python | 1 |
Coord),
Death,
}
<gh_stars>0
use crate::face_texture_map::FaceTextureMap;
use mipmap::Mipmap;
use std::error::Error;
use std::sync::Arc;
use voxelcraft_id::{FaceId, ModId};
use wgpu::{Device, Queue};
#[derive(Default, Debug, Clone)]
pub struct FaceTextureMapBuilder {
images: Vec<(FaceId, &'static Mipmap<'stati... | Rust | 0 |
}
},
{
"mark": {
"type": "point",
"filled": True
},
"encoding": {
"color": {
"field": 'Model',
... | Python | 1 |
import pygame as pg
import time
class Sound:
def __init__(self, bg_music):
pg.mixer.init()
pg.mixer.music.load(bg_music)
pg.mixer.music.set_volume(0.20)
jump_sound = pg.mixer.Sound('sounds/jump.wav')
gameover_sound = pg.mixer.Sound('sounds/gameover.wav')
meow_sound... | Python | 1 |
r {
matrix: Arc<Mutex<LedMatrix>>,
}
impl MatrixHolder {
pub fn new() -> Self {
Self {
matrix: Arc::new(Mutex::new(LedMatrix::new())),
}
}
pub fn lock_matrix(&mut self) -> MutexGuard<LedMatrix> {
self.matrix.lock().unwrap()
}
}
unsafe impl Send for MatrixHolder... | Rust | 0 |
ration, IMUOffset},
report::{InputReport, InputReportMode},
stick::StickCalibration,
};
pub const VENDOR_ID: u16 = 0x057E;
pub const PRODUCT_ID_JOYCON_L: u16 = 0x2006;
pub const PRODUCT_ID_JOYCON_R: u16 = 0x2007;
pub const PRODUCT_ID_PROCON: u16 = 0x2009;
pub const SUB_COMMAND_IN_HEADER_BYTES: usize = 11;
pub... | Rust | 0 |
import json
__all__ = (
"QuillParseError",
"Quill",
)
from django.utils.html import strip_tags
class QuillParseError(Exception):
def __init__(self, value):
self.value = value
def __str__(self):
return "Failed to parse value(%s)" % self.value
class Quill:
def __init__(self, jso... | Python | 1 |
,
Side::Front | Side::Back => Axis::Z,
}
}
}
#[inline]
pub fn popcount_64(mut x : u64) -> u8 {
x = (x & 0x5555555555555555u64) + ((x >> 1) & 0x5555555555555555u64);
x = (x & 0x3333333333333333u64) + ((x >> 2) & 0x3333333333333333u64);
x = (x & 0x0F0F0F0F0F0F0F0Fu64) + ((x >> 4) & 0x... | Rust | 0 |
Token::View,
"weeks" => Token::Weeks,
"wei" => Token::Wei,
"while" => Token::While,
"years" => Token::Years,
"_" => to_identifier("_"),
id if id_re.is_match(id) => Token::Identifier(id.to_string()),
hex if hex_re.is_match(hex) => Token::HexNumber(hex.to_string())... | Rust | 0 |
x50, 0x50, 0x50, 0x50]
);
use super::def::*;
use super::picman::*;
use super::plane::*;
use super::region::*;
use super::tbl::*;
use super::util::*;
use crate::api::frame::Aligned;
use num_traits::*;
/* padding for store intermediate values, which should be larger than
1+ half of filter tap */
const MC_IBUF_PAD_L: us... | Rust | 0 |
wd) == "2"
for args, kwd in self.argument_combinations_tuple():
with pytest.raises(TypeError):
mod.call("not callable", *args, **kwd)
for args, kwd in self.argument_combinations_tuple(unknown=2):
with pytest.raises(TypeError):
mod.call("not callabl... | Python | 1 |
import random
def generate_private_key(lim):
return random.randint(1, lim - 1)
def generate_public_key(gen, privkey, lim):
return pow(gen, privkey, lim)
privno = 23
g = 5 # generator any no. from 1 to privno-1
alprivkey = generate_private_key(privno)
alpubkey = generate_public_key(g, alprivkey, privno)
b... | Python | 1 |
src/automation.rs
/// An automation sequence which will either be polled to completion or abort
/// early with a fault.
pub trait AutomationSequence<Input, Output> {
/// Extra info attached to a fault.
type FaultInfo;
fn poll(
&mut self,
inputs: &Input,
outputs: &mut Output,
) -... | Rust | 0 |
{
let provider = yahoo::YahooConnector::new();
let resp = provider.search_ticker(\"Apple\").unwrap();
let mut apple_found = false;
println!(\"All tickers found while searching for 'Apple':\");
for item in resp.quotes
{
println!(\"{}\", item.symbol)
}
}
```
"
)]
use chrono::{DateT... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.