text string | label_name string | labels int64 |
|---|---|---|
dsp_description.user_data.callbacks.set_pos_callback = dsp_description.set_position;
dsp_description.user_data.callbacks.set_param_callback = dsp_description.set_parameter;
dsp_description.user_data.callbacks.get_param_callback = dsp_description.get_parameter;
unsafe { transmute::<&m... | Rust | 0 |
cntr.enter(|app, _| {
app.app_write.as_ref().map(|slice| if slice.len() == 6 {
self.kernel_tx.take().map(|data| {
for (out, inp) in data.iter_mut()
.zip(slice.as_ref()[0..slice.len()].iter()) {
*out = *... | Rust | 0 |
"""
Matplotlib Example: Subplots
Author: "Prince Raj Kiran"
Description:
This script demonstrates how to create multiple plots (line + bar)
in a single figure using Matplotlib's subplot functionality.
"""
import matplotlib.pyplot as plt
import numpy as np
# --------------------------------------------------------
# ... | Python | 1 |
from django.db import models
from django.contrib.auth.models import User
class Materia(models.Model):
nome = models.CharField(max_length=50)
def __str__(self):
return self.nome
class Serie(models.Model):
nome = models.CharField(max_length=50)
def __str__(self):
return str(self.nome)
... | Python | 1 |
xcept Exception as e:
logger.error(f"Error in reassignment: {e}")
self.message_user(request, f"Successfully reassigned {len(weapon_ids)} weapons.")
return None
def display_qr_code(self, obj):
if not obj.qr_code:
return "No QR Code... | Python | 1 |
{
if let Err(ref e) = run() {
eprintln!("Error: {}", e);
process::exit(1);
}
}
use std::env;
use std::path::Path;
use std::process::Command;
#[allow(dead_code)]
fn make_debug(dir: &Path, carg: &str) {
let status = Command::new("make").current_dir(dir).arg("-C").arg(carg).arg("config=debug_... | Rust | 0 |
import numpy as np
import pandas as pd
from skimage import transform
import numpy as np
import torch
from torch.utils.data import Dataset
import cv2
class forensics_datareader(Dataset):
def __init__(self, csv_file, transform=None):
self.data_path_details = pd.read_csv(csv_file,header=None)
self.tra... | Python | 1 |
URATION_MS));
}
if esc_timer_needs_reset {
focus_esc_timer.reset();
}
tui.console
.display_messages(&mut update_parameters.message_sink);
app.draw(
terminal.create_root_window(),
&mut tui,
... | Rust | 0 |
import urllib.parse
from .once import OnceIE
class GameSpotIE(OnceIE):
_VALID_URL = r'https?://(?:www\.)?gamespot\.com/(?:video|article|review)s/(?:[^/]+/\d+-|embed/)(?P<id>\d+)'
_TESTS = [{
'url': 'http://www.gamespot.com/videos/arma-3-community-guide-sitrep-i/2300-6410818/',
'md5': 'b2a30de... | Python | 1 |
import cv2
# 读取图像
img = cv2.imread(r'C:\Users\Administrator\Desktop\1.jpg')
if img is None:
print("错误:无法读取图像,请检查路径")
exit()
# 实验(4):转换为HSV并分离显示通道
hsv_img = cv2.cvtColor(img, cv2.COLOR_BGR2HSV)
h, s, v = cv2.split(hsv_img)
cv2.imshow('H Channel', h)
cv2.imshow('S Channel', s)
cv2.imshow('V Channel', v)
cv2.wai... | Python | 1 |
fn get_8_words(b: &mut Bencher) {
let mut qv = QueryVec::new();
let ids: Vec<usize> = (0..8).collect();
qv.push(&ids[..]);
b.iter(|| qv.get(0));
}
#[bench]
fn get_4_words(b: &mut Bencher) {
let mut qv = QueryVec::new();
let ids: Vec<usize> = (0..4).collect()... | Rust | 0 |
from great_ape_safe import GreatApeSafe
from helpers.addresses import r
techops = GreatApeSafe(r.badger_wallets.techops_multisig)
# contract
upkeep_manager = techops.contract(r.badger_wallets.upkeep_manager)
def cancel_member(targert_member=None):
"""
Cancels a member's Upkeep job
"""
members = upk... | Python | 1 |
sibleOnly": {
"def": BoolDef,
"kwargs": {
"label": "Visible Only",
}
}
}
defs = super(ExtractAlembic, cls).get_attribute_defs()
defs.extend([
UISeparatorDef("sep_alembic_options"),
UILabelDe... | Python | 1 |
ure = self._get_gem_signature(gem_dict)
if gem_signature not in self._dedup_set:
self._dedup_set.add(gem_signature)
self.gems.append(gem_dict)
self.tree.insert("", tk.END, values=(format_gem_str(gem_dict),))
converted_count ... | Python | 1 |
nt
122 => Any::BigInt(decoder.read_i64()),
// CASE 121: boolean (false)
121 => Any::Bool(false),
// CASE 120: boolean (true)
120 => Any::Bool(true),
// CASE 119: string
119 => Any::String(decoder.read_string().into()),
// CA... | Rust | 0 |
);
ms -= current_ms;
}
}
}
impl DelayMs<u16> for Delay {
fn delay_ms(&mut self, ms: u16) {
self.delay_us(ms as u32 * 1_000);
}
}
impl DelayMs<u8> for Delay {
fn delay_ms(&mut self, ms: u8) {
self.delay_ms(u16(ms));
}
}
impl DelayUs<u32> for Delay {
fn delay... | Rust | 0 |
t MyHandler {
invoke_count: usize,
}
impl Service<LambdaEvent<Request>> for MyHandler {
type Error = Error;
type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Error>>>>;
type Response = Response;
fn poll_ready(&mut self, _cx: &mut core::task::Context<'_>) -> core::task::Poll<Result<(... | Rust | 0 |
from zkay.examples.scenario import ScenarioBuilder
a = 'a'
sb = ScenarioBuilder('NestedPrivateIfStatements', 'code/NestedPrivateIfCond.zkay').set_users(a)
sb.set_deployment_transaction(owner=a)
sb.add_balance_assertion(0)
# Test outer private if
sb.add_transaction('test_if_outer', [101], user=a)
sb.add_state_assertio... | Python | 1 |
# [12, 11, 13, 5, 6] -> asc
# [12, 12, 13, 5, 6] key = 11
# [11, 12, 13, 5, 6]
# [11, 12, 13, 5, 6] key = 13
# [11, 12, 13, 5, 6] key = 5
# [11, 12, 13, 13, 6]
# [11, 12, 12, 13, 6]
# [11, 11, 12, 13, 6]
# [5, 11, 12, 13, 6]
# [5, 11, 12, 13, 6] key = 6
# [5, 11, 12, 13, 13]
# [5, 11, 12, 12, 13]
# [5, 11, 11, 12, ... | Python | 1 |
t first = input.pop().context(errors::InvalidValue {
reason: "empty value list".to_string(),
})?;
let mut accumul = Self::parse_single(first)?;
for val in input {
let parsed = Self::parse_single(val)?;
accumul = Self::merge(accumul, parsed)?;
}
... | Rust | 0 |
be returned in response to this command.
pub fn test_node_get<N>(node_id: N) -> Message
where
N: Into<u8>,
{
Message::new(node_id.into(), CommandClass::POWER_LEVEL, 0x05, vec![])
}
/// This command is used to report the latest result of a test frame
/// transmission started by ... | Rust | 0 |
s, tag),
entity: self.entity,
components: self.components,
}
}
fn insert(self, world: &mut World)
where
<TS as ConsFlatten>::Output: TagSet + TagLayout + for<'a> Filter<ChunksetFilterData<'a>>,
ComponentTupleSet<
<CS as ConsFlatten>::Output,
... | Rust | 0 |
"""Resource sharing analytics schemas."""
from typing import Dict, List, Optional
from pydantic import BaseModel, Field
from datetime import datetime
class ResourceUsageMetrics(BaseModel):
"""Resource usage metrics over time."""
total_usage: float = Field(..., description="Total resource usage")
average_u... | Python | 1 |
# noinspection PyUnusedLocal
# skus = unicode string
from typing import Counter
def checkout(skus):
items_with_prices = {"A" : 50,"B":30,"C":20,"D":15,"E":40,"F":10,"G":20,"H":10,"I":35,"J":60,"K":70,"L":90,"M":15,"N":40,"O":10,"P":50,
"Q":30,"R":50,"S":20,"T":20,"U":40,"V":50,"W":20,"X":... | Python | 1 |
ZMA_PATH: &str = "unlzma";
const DEFAULT_7Z_PATH: &str = "7z";
const DEFAULT_TAR_PATH: &str = "tar";
const DEFAULT_RAR_PATH: &str = "rar";
const DEFAULT_UNRAR_PATH: &str = "unrar";
const DEFAULT_ZSTD_PATH: &str = "zstd";
const DEFAULT_UNZSTD_PATH: &str = "unzstd";
const DEFAULT_PZSTD_PATH: &str = "pzstd";
fn main() ->... | Rust | 0 |
ms(x, axis=0)
prediccion = modelo_cargado.predict(x)
indice_clase = int(np.argmax(prediccion))
confianza = float(np.max(prediccion)) * 100
nombre_clase = clases_dict.get(indice_clase + 1, "Clase desconocida")
return {
"id": indice_clase + 1,
"nombre": no... | Python | 1 |
elif block_name and block_name != "null":
solid_ground += 1
ground_types.append(block_name)
# 分析稳定性
total_ground = solid_ground + air_holes
if total_ground > 0:
stability_ratio = solid_ground / total_grou... | Python | 1 |
},
StraightFlush {
rank: char,
},
}
#[derive(Copy, Clone, Debug)]
struct Card {
rank: char,
suit: char,
}
impl Card {
fn new(card: &str) -> Card {
let chars: Vec<char> = card.chars().collect();
assert!(card.len() == 2 || card.len() == 3);
let rank;
let suit... | Rust | 0 |
= -3,
MultiaccountDetected = -4,
ServerError = -5,
CuttingEdgeMultiplayer = -6,
AccountPasswordRest = -7,
VerificationRequired = -8,
}
impl LoginReply for LoginFailed {
fn val(self) -> i32 {
self as i32
}
}
pub enum LoginSuccess {
Ver... | Rust | 0 |
harConstant(_, _), Expr::StringConstant(_, _)) => (),
// 123.456 in "xxxx"
#[cfg(not(feature = "no_float"))]
(x @ Expr::FloatConstant(_, _), Expr::StringConstant(_, _)) => {
return Err(PERR::MalformedInExpr(
"'in' expression for a string expects a string, not a float... | Rust | 0 |
row in confidence_rows:
bucket = row["confidence_bucket"]
agent = row["agent"]
if bucket not in bucket_values or agent not in bucket_values[bucket]:
continue
value = row.get("diou")
if value is not None:
... | Python | 1 |
s = config['epochs']
neval = config['eval_interval']
logging.info('Training Start')
for ep in range(nepochs):
logging.info(f'Epoch [{ep + 1}/{nepochs}]')
res = {'ep': ep + 1}
train_meters = train_hashing(optimizer, model, codebook, train_loader, loss_param)
scheduler.step(... | Python | 1 |
#Coffee to Code
def coffee_to_code() -> str:
coffee = "coffee"
replace_dict = {"ff": "d", "ee": "e"}
coffee = list(coffee.lower())
def replace(coffee: list) -> str:
"""
Replaces the indexes at which "ff" and "ee" are found.
"""
for pattern in replace_dict:
... | Python | 1 |
p
'# alloys_kites_grasp -> compressors_recruit_audit'
lmsrt696ahu = b''
global jup9bfzw_yq
nonlocal zow3xvcck5z
'# alloys_kites_grasp -> compressors_recruit_audit'
agnz2ou6o3r
assert 0
return kc7ifgfjl9f
from zt2tmlw_1ef import hjjsi9wv03b, s1bionxvla4, kr3_cdvwg_9 as zuu7uvhf19f, r5... | Python | 1 |
# Copyright 2015-2025 Earth Sciences Department, BSC-CNS
#
# This file is part of Autosubmit.
#
# Autosubmit is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | Python | 1 |
ftLevel {
fn default() -> Self {
Self::Rookie
}
}
/// Token info
#[derive(Encode, Decode, Clone, Eq, PartialEq, MaxEncodedLen, RuntimeDebug)]
pub struct TokenInfo<AccountId, Data, TokenMetadataOf> {
/// Token metadata
pub metadata: TokenMetadataOf,
/// Token owner
pub owner: Option<AccountId>,
/// Token Prope... | Rust | 0 |
value,
}
}
pub fn set_my_hand(&mut self, hand: Hand) {
self.my_hand = Some(hand);
}
pub fn get_my_hand(&self) -> &Hand {
match &self.my_hand {
None => panic!("No hand!"),
Some(hand) => &hand,
}
}
pub fn get_my_hand_option(&self) -> &Opti... | Rust | 0 |
uation_level = args.single::<usize>().ok();
let target = args.single::<String>().ok();
let res = ojichat::get_message(target, emoji_num, punctuation_level);
msg.channel_id.say(&ctx.http, &res.to_string()).await?;
Ok(())
}
use std::fs;
fn main() {
let step: usize = fs::read_to_string("input")
... | Rust | 0 |
IVE_UNDEFINED = 0,
D3D10_SB_PRIMITIVE_POINT = 1,
D3D10_SB_PRIMITIVE_LINE = 2,
D3D10_SB_PRIMITIVE_TRIANGLE = 3,
D3D10_SB_PRIMITIVE_LINE_ADJ = 6,
D3D10_SB_PRIMITIVE_TRIANGLE_ADJ = 7,
D3D11_SB_PRIMITIVE_1_CONTROL_POINT_PATCH = 8,
D3D11_SB_PRIMITIVE_2_CONTROL_POINT_PATCH = 9,
D3D11_SB_PRIMIT... | Rust | 0 |
t: u32, level: i32) -> Result<Cookie<'_, Conn, GetCompressedTexImageARBReply>, ConnectionError>
where
Conn: RequestConnection + ?Sized,
{
let request0 = GetCompressedTexImageARBRequest {
context_tag,
target,
level,
};
request0.send(conn)
}
#[derive(Debug, Clone, PartialEq, Eq)]
... | Rust | 0 |
CC::SignedGreaterThan => CC::NLE,
IntCC::SignedLessThanOrEqual => CC::LE,
IntCC::SignedLessThan => CC::L,
IntCC::UnsignedGreaterThanOrEqual => CC::NB,
IntCC::UnsignedGreaterThan => CC::NBE,
IntCC::UnsignedLessThanOrEqual => CC::BE,
IntCC::UnsignedLessThan => CC::B,
... | Rust | 0 |
else:
now_p = (0, -start_length)
pos.append(now_p)
now_dir = "up"
for i in range(space_num):
now_p = (now_p[0] + space_dist, now_p[1])
pos.append(now_p)
if now_dir == "up":
now_p = (now_p[0], now_p[1] + one_mid... | Python | 1 |
e:
name = tensor.name
expected_rank_dict = {}
if isinstance(expected_rank, (int, long)):
expected_rank_dict[expected_rank] = True
else:
for x in expected_rank:
expected_rank_dict[x] = True
actual_rank = tensor.shape.ndims
if actual_rank not in expected_rank_dict:
scope_name = tf.get_va... | Python | 1 |
~Scheduler = Local::take();
// ... allowing us to give it away when performing a
// scheduling operation.
sched.terminate_current_task()
};
return wrapper;
}
/// Destroy coroutine and try to reuse stack segment.
pub fn recycle(self, stack_pool: &mut Stac... | Rust | 0 |
<'a> Foo<'a> {
fn x(&self) -> &'a i32 { self.x }
}
fn main() {
////////////////////////////////////////////////////////////////////////////////
// In structs
let y = &5; // This is the same as `let _y = 5; let y = &_y;`.
let f = Foo { x: y };
println!("{}", f.x);
/////////////////////////... | Rust | 0 |
ange {
vk::ImageSubresourceRange {
aspect_mask: map_image_aspects(range.aspects),
base_mip_level: range.levels.start as _,
level_count: (range.levels.end - range.levels.start) as _,
base_array_layer: range.layers.start as _,
layer_count: (range.layers.end - range.layers.start... | Rust | 0 |
from typing import List
class Solution:
def findMaxFish(self, grid: List[List[int]]) -> int:
def DFS(row,col):
if (row<0 or row==n or col<0 or col==m or visited[row][col]==1) or grid[row][col]==0:
return 0
visited[row][col]=1
diractions = [[1,0],[-1,0],[0,... | Python | 1 |
S256Cipher::new(&composite_key.master_key(), &header.iv)?;
let payload_compressed = cipher.decrypt(&payload_encrypted)?;
let mut payload: Vec<u8> = Vec::new();
if header.compressed {
let mut zip = GzDecoder::new(&payload_compressed[..]);
zip.read_to_end(&mut payload)?;
... | Rust | 0 |
s!(
handle.recv().await,
AllMessages::NetworkBridge(
NetworkBridgeMessage::SendRequests(
mut reqs, IfDisconnected::ImmediateError
)
) => {
let reqs = reqs.pop().unwrap();
let outgoing = match reqs {
Requests::StatementFetching(outgoing) => outgoing,
_ => panic!("Unexpec... | Rust | 0 |
_file(&self, _: &str) -> Self {
CliProgress(self.0.clone())
}
}
impl CliProgress {
fn new() -> Self {
let mut progress = ProgressBar::new(363);
progress.show_speed = false;
progress.show_time_left = false;
progress.format("[#> ]");
progress.message("Downloading P... | Rust | 0 |
onst LANES: usize> From<[$type; LANES]> for $name<LANES> where Self: crate::LanesAtMost32 {
fn from(array: [$type; LANES]) -> Self {
Self(array)
}
}
impl <const LANES: usize> From<$name<LANES>> for [$type; LANES] where $name<LANES>: crate::LanesAtMost32 {
... | Rust | 0 |
<Wp, T> Div<T> for Luv<Wp, T>
where
T: FloatComponent,
Wp: WhitePoint,
{
type Output = Luv<Wp, T>;
fn div(self, c: T) -> Self::Output {
Luv {
l: self.l / c,
u: self.u / c,
v: self.v / c,
white_point: PhantomData,
}
}
}
impl<Wp, T> Div... | Rust | 0 |
distance = nx.shortest_path_length(
neighborhood_graph, cell, node, weight="distance"
)
state = character_matrix.loc[node].iloc[character]
# state = character_matrix.loc[node, character]
if distance <= max_neighbor_distance and state != -1:
if type(state)... | Python | 1 |
fn next(&mut self) -> Option<usize> {
while self.cur_word == 0 {
if self.word_idx + 1 >= self.words.len() {
return None;
}
self.word_idx += 1;
self.cur_word = self.words[self.word_idx];
}
let bitidx = self.cur_word.trailing_zeros(... | Rust | 0 |
Finish left pack
right_pack.end();
right_pack
}
#![feature(proc_macro_hygiene, decl_macro)]
#[macro_use]
extern crate rocket;
#[macro_use]
extern crate rocket_contrib;
#[macro_use]
extern crate serde_derive;
extern crate argon2;
extern crate rand;
use rocket::http::Status;
use rocket::request::{self, FromReq... | Rust | 0 |
'w': -1001511455705,
'x': -1001637846600,
'y': -1002060032686,
}
news = asyncio.run(parse_filter_news(channels=channels,
KEYWORDS=KEYWORDS,
filename='IMOEX_news',
days_back=120,
... | Python | 1 |
ADM', 'CIPO', 'BICIPO', 'Ensemble'],
'Accuracy': ['N/A', 'N/A', 'N/A', 'N/A'],
'Precision': ['N/A', 'N/A', 'N/A', 'N/A'],
'Recall': ['N/A', 'N/A', 'N/A', 'N/A'],
'F1-Score': ['N/A', 'N/A', 'N/A', 'N/A'],
'Status': ['Not Trained', 'Not Train... | Python | 1 |
"Non-literal int_map_id value for field {}: {}, value: {:?}",
field.ident.as_ref().unwrap().to_string(),
token.to_string(),
token
)),
};
token.parse::<i64>().expect(&format!(
"Non-inte... | Rust | 0 |
(
core.fragment.has_out_def(shader::defs::F_COLOR),
"FragmentCore needs F_COLOR output for deferred shading scene pass"
);
let mut fragment = core
.fragment
.with_in_def(shader::defs::V_WORLD_POS)
.with_in_def(shader::defs::V_WORLD_NORMAL)
.with_out(F_WORLD_POS, ... | Rust | 0 |
id = eos_token_id
super().__init__(bos_token_id=bos_token_id, eos_token_id=eos_token_id, **kwargs)
class GPT2OnnxConfig(OnnxConfigWithPast):
def __init__(
self,
config: PretrainedConfig,
task: str = "default",
patching_specs: List[PatchingSpec] = None,
use_past: bo... | Python | 1 |
import math
import numpy as np
from matplotlib import cm
import matplotlib.pyplot as plt
def solution(x, t) :
return 2.0 * t + (np.power(x, 2) - 2) * np.sin(t) + np.cos(math.pi * t) * np.cos(math.pi * x)
def f(x, t) :
return -np.power(x, 2) * np.sin(t)
# սկզբնական պայմանների սահմանում
def initial1(x) :
... | Python | 1 |
from pandac.PandaModules import Vec4
from direct.directnotify import DirectNotifyGlobal
from pirates.creature.DistributedCreature import DistributedCreature
from pirates.pirate import AvatarTypes
from pirates.npc.Boss import Boss
CreatureTypes = {AvatarTypes.Crab: AvatarTypes.Crab,AvatarTypes.RockCrab: AvatarTypes.Crab... | Python | 1 |
#import Regesitry
from deeplib.utils.registry import Registry
HEAD_REGISTRY = Registry('head')
def build_head(cfg):
"""Build head from config."""
head_type = cfg.model.head.name
head = HEAD_REGISTRY.get(head_type)(cfg)
return head
| Python | 1 |
e(0)
tf.random.set_seed(1)
logits = rng.randn(batch_size, num_classes)
# Test if there's no change to logits when mean_field_factor < 0.
logits_no_change = ed.layers.utils.mean_field_logits(
logits, covmat=None, mean_field_factor=-1)
# Test if mean_field_logits functions as a temperature s... | Python | 1 |
future used as a noop result of middleware.
pub type NoopFuture = Pin<Box<dyn Future<Output = Option<Response>> + Send>>;
/// Dummy future used as a noop call result of middleware.
pub type NoopCallFuture = Pin<Box<dyn Future<Output = Option<Output>> + Send>>;
/// No-op middleware implementation
#[derive(Clone, Debug... | Rust | 0 |
"""
Implementation of "Convolutional Sequence to Sequence Learning"
"""
import torch.nn as nn
from onmt.encoders.encoder import EncoderBase
from onmt.utils.cnn_factory import shape_transform, StackedCNN
SCALE_WEIGHT = 0.5 ** 0.5
class CNNEncoder(EncoderBase):
"""Encoder based on "Convolutional Sequence to Seque... | Python | 1 |
.enforce(evts)
}
}
fn finish(&mut self) -> Option<Vec<Event>> {
None
}
}
<filename>src/rs/server/src/handlews.rs<gh_stars>10-100
use std::borrow::Cow;
use std::collections::HashMap;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::Arc;
use bb8_postgres::tokio_postgres::{
typ... | Rust | 0 |
_folder(test_name: &str) -> TestFolder {
// Ensure test dir exists and is empty
let mut test_path = std::fs::canonicalize(std::env::temp_dir()).unwrap();
test_path.push("weldr");
test_path.push("tests");
test_path.push(test_name);
if test_path.is_dir() {
std::fs::remove_dir_all(&test_pat... | Rust | 0 |
from flet import (
AppBar,
AppView,
Colors,
Column,
ControlEvent,
CrossAxisAlignment,
MainAxisAlignment,
Page,
RouteChangeEvent,
SelectionArea,
Text,
TextThemeStyle,
Theme,
View,
ViewPopEvent,
VisualDensity,
app_async,
)
from .controls import game, in... | Python | 1 |
config.database_path = config.config_path / 'test_acestream.db'
# Ensure required attributes exist
config.base_url = "http://localhost:6878/ace/getstream?id="
config.ace_engine_url = "http://localhost:6878"
config.rescrape_interval = 24
# Set TESTING environment variable for in-memory d... | Python | 1 |
functions generated by Skolemization.
pub(super) const SKOLEM_FN_PREFIX: &str = "f#";
// Creates the database instance name for the given constant.
#[inline]
pub(super) fn constant_instance_name(c: &syntax::Const) -> String {
format!("@{}", c.name())
}
// Creates the database instance name for the given function... | Rust | 0 |
) -> ::std::fmt::Result {
f.debug_struct(&format!("GraniteWidgetsAlertViewClass @ {:?}", self as *const _))
.finish()
}
}
#[repr(C)]
pub struct _GraniteWidgetsAlertViewPrivate(c_void);
pub type GraniteWidgetsAlertViewPrivate = *mut _GraniteWidgetsAlertViewPrivate;
#[repr(C)]
#[derive(Copy, Clone... | Rust | 0 |
:param _PullExpired: 播放过期时间(单位:分钟)
注意:此字段可能返回 null,表示取不到有效值。
:type PullExpired: int
:param _PushState: 是否开启推流鉴权(1:开启,0:关闭)
注意:此字段可能返回 null,表示取不到有效值。
:type PushState: int
:param _PushSecret: 推流密钥(仅支持字母数字,长度0-10位)
注意:此字段可能返回 null,表示取不到有效值。
:type PushSecret: str
:param ... | Python | 1 |
register to support reads of
// GICD_ISPENDRn or GICD_ICPENDRn.
if !self.is_pending(irq, target_cpu) {
self.set_pending(irq, target_cpu).unwrap();
}
Ok(())
}
fn clear_sgi_pending(
&mut self,
irq: IRQ,
source_cpu: CPU,
target_cpu: CPU... | Rust | 0 |
#!/usr/bin/env python
"""
-------------------------------------------------
@File : validator.py
@Date : 2024/07/23
@Desc : None
@Version : 1.0
-------------------------------------------------
Change Activity:
@Date : 2024/07/23
@Author : Plord117
@Desc : None
-------... | Python | 1 |
{
E::default_bits()
}
}
impl<E: DecodeBe> DecodeBe for Option<E> {
type Context = E::Context;
#[inline(always)]
fn decode_offset(
data: &[u8],
offset: &mut usize,
sd: &mut ShouldDecode,
ctx: &mut Self::Context,
bits: usize,
) -> Result<Self> {
... | Rust | 0 |
from ipysheet import sheet, cell, hold_cells
>>>
>>> sheet(rows=10,columns=10)
>>> with hold_cells()
>>> for i in range(10):
>>> for j in range(10):
>>> cell(i, j, value=i * 10 + j)
>>> # at this line, the Cell widgets are added
"""
gl... | Python | 1 |
'pub async fn mut_args(a: usize)'
pub async fn mut_args(mut a: usize) {}
// @has async_fn/fn.mut_ref.html '//pre[@class="rust fn"]' 'pub async fn mut_ref(x: i32)'
pub async fn mut_ref(ref mut x: i32) {}
trait Bar {}
impl Bar for () {}
// @has async_fn/fn.quux.html '//pre[@class="rust fn"]' 'pub async fn quux() -> ... | Rust | 0 |
reset()` method sets CH4DATA to value 0"]
impl crate::Resettable for CH4DATA_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
pub mod grpc_service;
pub mod jwt_token_service;
<reponame>SimonFJ20/brainfuck-in-rust
mod parser;
mod vm;
use std::env::args;
use std::fs::read_to_string;
use ... | Rust | 0 |
실행됩니다:
fit(epochs, model, loss_func, opt, train_dl, valid_dl)
###############################################################################
# 마치면서
# -----------------
#
# 이제 PyTorch를 사용하여 다양한 유형의 모델을 학습하는 데 사용할 수 있는 일반 데이터 파이프 라인과
# 훈련 루프가 있습니다.
# 이제 모델 학습이 얼마나 간단한지 확인하려면 `mnist_sample 노트북 <https://github.com/fast... | Python | 1 |
copyback: bool) -> io::Result<SocketAddr> {
let mut listener = TcpListener::bind(("127.0.0.1", 0)).await?;
let addr = listener.local_addr()?;
tokio::spawn(async move {
while let Some(socket_res) = listener.incoming().next().await {
let mut socket: TcpStream = match socket_res {
... | Rust | 0 |
ER \
//! -RSAPublicKey_out \
//! -outform DER \
//! -out public_key.der
//! ```
//!
//! ```
//! use ring::{rand, rsa, signature};
//!
//! # #[cfg(feature = "std")]
//! fn sign_and_verify_rsa(private_key_path: &std::path::Path,
//! public_key_path: &std::path::P... | Rust | 0 |
C_INS_TWNEI = 883
PPC_INS_TWLLTI = 884
PPC_INS_TWLGTI = 885
PPC_INS_TWUI = 886
PPC_INS_WAITRSV = 887
PPC_INS_WAITIMPL = 888
PPC_INS_XNOP = 889
PPC_INS_XVMOVDP = 890
PPC_INS_XVMOVSP = 891
PPC_INS_XXSPLTD = 892
PPC_INS_XXMRGHD = 893
PPC_INS_XXMRGLD = 894
PPC_INS_XXSWAPD = 895
PPC_INS_BT = 896
PPC_INS_BF = 897
PPC_INS_BDN... | Python | 1 |
self.IKFK_spine.setProperty("Object", gqt.fakeTranslate("biped_body", "spineUI_C0_ctl", None, -1))
self.IKFK_spine.setProperty("fkControls", gqt.fakeTranslate("biped_body", "spine_C0_fk0_ctl,spine_C0_fk1_ctl,spine_C0_fk2_ctl,spine_C0_fk3_ctl,spine_C0_fk4_ctl", None, -1))
self.IKFK_spine.setProperty("i... | Python | 1 |
or(f"Error generating response: {e}")
return "앗, 미안! 다시 말해줄래?"
@trace_chatbot_method("collect_story_elements")
async def collect_story_elements(
self,
user_input: str,
target_element: str,
child_age: int
) -> Dict[str, Any]:
"""Extract story elements ... | Python | 1 |
::clone_on_ref_ptr)]
#![warn(clippy::dbg_macro)]
#![warn(clippy::debug_assert_with_mut_call)]
#![warn(clippy::default_trait_access)]
#![warn(clippy::doc_markdown)]
#![warn(clippy::empty_line_after_outer_attr)]
#![warn(clippy::explicit_into_iter_loop)]
#![warn(clippy::explicit_iter_loop)]
#![warn(clippy::fallible_impl_f... | Rust | 0 |
import pytest
from ....tests.utils import get_graphql_content
SHIPPING_ZONES_QUERY = """
query GetShippingZones($channel: String) {
shippingZones(first: 100, channel: $channel) {
edges {
node {
warehouses {
id
}
}
}
}
}
"""
@pytest.mark.django_db
@pytest.mark.coun... | Python | 1 |
alue_from_str("--font-funcs")?,
variations: parser.opt_value_from_fn("--variations", parse_string_list)?.unwrap_or_default(),
shaper: parser.opt_value_from_fn("--shaper", parse_string_list)?.unwrap_or_default(),
shapers: parser.opt_value_from_fn("--shapers", parse_string_list)?.unwrap_or_default... | Rust | 0 |
\xfc\xc1\xff\x30\x0f\x0c\x07\xe3'\
b'\x03\x18\xc0\xc6\x3f\x3f\x0f\xc7\x83\x00\xc0\xc0\x30\x30\xff\xcc'\
b'\x3f\xf2\x00\x18\x00\x06\x00\x01\x80\x00\x7f\x80\x1f\x80\x00\x00'\
b'\x00\x00\x00\x00\x00\x00\x00\x00\x01\xfc\x07\xf8\x00\x60\x01\x80'\
b'\x06\x00\x18\x00\x60\x01\x80\x00\x1f\xfe\x7f\xfc\x00\x00\xc6... | Python | 1 |
skMetadata)
# Get domain information from metadata
domain = task_metadata.main_task_name
assert domain, "Main task must be set in metadata"
domain = domain.replace("generate_", "").replace("_monitor_data", "")
# Load domain info
domain_requirements = ""
try:
domains_path = DATA_DIR ... | Python | 1 |
ze('mask_fraction', [0.5, 1.0])
@pytest.mark.parametrize('training', [True, False])
def test_masking(self, patch_size: int, mask_fraction: float, training: bool):
"""Test SSL pretrain masking."""
num_subbands = 32
num_frames = 5000
num_channels = 1
batch_size = 8
... | Python | 1 |
# This file has been modified by the Nextpy Team in 2023 using AI tools and automation scripts.
# We have rigorously tested these modifications to ensure reliability and performance. Based on successful test results, we are confident in the quality and stability of these changes.
import pytest
from nextpy.interfaces... | Python | 1 |
LENGTH,
KeyType::EccCompact => ecc_compact::PUBLIC_KEY_LENGTH,
};
data.resize(key_size, 0);
reader.read_exact(&mut data[1..])?;
Ok(PublicKey::from_bytes(data)?)
}
}
//! Trait to build INSERT SQL statement.
use crate::{error::ToqlError, query::field_path::FieldPath, sql_ex... | Rust | 0 |
from player2024s.predict_role import Predictions
from player2024s.info_types import PredictionRole
from player2024s.stance import Stance
from player2024s.langchain import OpenAIAgent
from typing import Dict, List
openai_agent = OpenAIAgent(temperature=1)
def get_tactic(
my_agent_id: str,
my_agent_role... | Python | 1 |
target_len,
to_target[2] / to_target_len,
]
eye_zoom=[
look[0] * zoom_dist,
look[1] * zoom_dist,
look[2] * zoom_dist
]
eye[0] += eye_zoom[0];
eye[1] += eye_zoom[1];
eye[2] += eye_zoom[2];
if (rclick_held):
# affect target too if right click is held
... | Python | 1 |
0 else " - odd")
#
# elif num2 == 0:
# result = f"Cannot divide {num1} by zero"
#
# elif operator == "/":
# result = f"{num1} / {num2} = {(num1 / num2):.2f}"
#
# elif operator == "%":
# result = f"{num1} % {num2} = {num1 % num2}"
#
# print(result)
#
# # HOTEL ROOM
# month = input()
# nights = int(input()... | Python | 1 |
from prowler.lib.check.models import Check, Check_Report_AWS
from prowler.providers.aws.services.vpc.vpc_client import vpc_client
class vpc_flow_logs_enabled(Check):
def execute(self):
findings = []
for vpc in vpc_client.vpcs.values():
if vpc_client.provider.scan_unused_services or vpc... | Python | 1 |
m_attach_fd_checked` could be loaded.
#[cfg(feature = "has_symbol")]
pub fn has_xcb_shm_attach_fd_checked(&self) -> bool {
has_sym!(self, xcb_shm_attach_fd_checked)
}
/// Sends a `Shm::AttachFd` request (unchecked).
#[inline]
pub unsafe fn xcb_shm_attach_fd(
&self,
c: *m... | Rust | 0 |
"""
==============================================
Including upper and lower limits in error bars
==============================================
In matplotlib, errors bars can have "limits". Applying limits to the
error bars essentially makes the error unidirectional. Because of that,
upper and lower limits can be app... | Python | 1 |
"""eMail."""
# standard
import re
# local
from .hostname import hostname
from .utils import validator
@validator
def email(
value: str,
/,
*,
ipv6_address: bool = False,
ipv4_address: bool = False,
simple_host: bool = False,
rfc_1034: bool = False,
rfc_2782: bool = False,
):
"""V... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.