text string | label_name string | labels int64 |
|---|---|---|
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: v1/batch_delete.proto
# Protobuf Python Version: 5.26.1
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.pro... | Python | 1 |
interface: &InterfaceName,
unset: bool,
network: NetworkOpt,
) -> Result<(), Error> {
let config = InterfaceConfig::from_interface(interface)?;
if !unset && config.interface.listen_port.is_none() {
println!(
"{}: you need to set a listen port for your interface first.",
... | Rust | 0 |
inner: bool,
escape: Escaping,
line_prefix: Option<&[u8]>,
) -> Result<(), Error> {
(&self).write_to(writer, inner, escape, line_prefix)
}
fn count_max_streak(&self, char: u8, carry: usize) -> (usize, usize) {
(&self).count_max_streak(char, carry)
}
}
//endregio... | Rust | 0 |
olynomial<G::ScalarField>>;
type Proof = Proof<G>;
type Error = BoxedError;
fn setup(_rng: &mut impl RngCore) -> Result<Self::PublicParameters, Self::Error> {
Ok(())
}
fn index(
_public_params: &Self::PublicParameters,
predicate_params: &Self::PredicateParams,
pre... | Rust | 0 |
#!/usr/bin/env python3
from re import sub
import subprocess
import os
from sys import argv
# Change working dir to the script path
os.chdir(os.path.dirname(os.path.abspath(__file__)))
subprocess.run(['mcrl22lps', '-vn', 'peg_solitaire.mcrl2', 'peg_solitaire.lps'], check=True)
run = subprocess.run(['lpssuminst', '-... | Python | 1 |
r __getstate__ s zsocket.__getstate__c C s6 t | }| j| j| j| j|d}|| |S )zdup() -> socket object
Duplicate the socket. Return a new socket object connected to the same
system resource. The new socket is non-inheritable.
r6 )dupr6 r@ ... | Python | 1 |
from fastapi import APIRouter
from core.settings.settings import settings
from accounts.routers.endpoints import accounts
router = APIRouter()
router.include_router(
accounts.router,
prefix=f'{settings.app.api_v1_str}/accounts',
tags=['Информация об аккаунтах'],
)
| Python | 1 |
ating_mul(10), i8::MAX;
C36: i8::MIN.saturating_mul(10), i8::MIN;
C37: 100i8.saturating_neg(), -100;
C38: (-100i8).saturating_neg(), 100;
C39: i8::MIN.saturating_neg(), i8::MAX;
C40: i8::MAX.saturating_neg(), i8::MIN + 1;
C57: 100i8.saturating_abs(), 100;
C58: (... | Rust | 0 |
std::cmp::Ordering;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_first_half() {
let erosion = build_erosion_level((10, 10), 510, false);
print_cave(&erosion);
assert_eq!(calc_danger(&erosion), 114);
}
#[test]
fn test_second_half() {
let erosion = bui... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
pd.set_option('display.float_format', '{:.0f}'.format)
pd.set_option('show_dimensions', False)
# 1.
df = pd.read_csv('Melbourne_housing.csv', na_values=['missing', 'inf'],)
missing_counts = df.isna().sum()
print("Количество пропусков по столбцам:")
print(missing_co... | Python | 1 |
Move DST mip into COPY_DST state
//
command_buffer.cmd_resource_barrier(
&[],
&[RafxTextureBarrier {
texture,
src_state: RafxResourceState::UNDEFINED,
dst_state: RafxResourceState::COPY_DST,
queue_transition: RafxBar... | Rust | 0 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Dict
from typing_extensions import Required, Annotated, TypedDict
from ..._utils import PropertyInfo
__all__ = ["ZoneReplaceParams"]
class ZoneReplaceParams(TypedDict, total=... | Python | 1 |
hs: Box::new(sub.clone()),
rhs: Box::new(mod_.clone()),
};
let neq = Expr::Neq {
lhs: Box::new(concat.clone()),
rhs: Box::new(not.clone()),
};
// Test expression string
let expr_str = String::from(
"(((4 + $myvar) - -4 * $myvar++) ... | Rust | 0 |
5783, data2: 0, data3: 16, data4: [128, 0, 0, 170, 0, 56, 155, 113] };
pub const WMMEDIASUBTYPE_WebStream: ::windows_sys::core::GUID = ::windows_sys::core::GUID { data1: 2002933716, data2: 50727, data3: 16843, data4: [143, 129, 122, 199, 255, 28, 64, 204] };
pub const WMMEDIASUBTYPE_YUY2: ::windows_sys::core::GUID = ::... | Rust | 0 |
from pymongo import MongoClient
import pandas as pd
import math
# Load your books data
books_df = pd.read_csv('books_data.csv')
# Debug: Print initial data
print("Initial DataFrame:")
print(books_df.head())
# Create a mapping dictionary to store unique book_ids for each normalized_title
title_to_book_id = {}
# Assi... | Python | 1 |
):
adj_dict[(source, dest)] = 1
add_budget -= 1
pbar.update(1)
pbar.close()
def _delete_edges(self, to_be_deleted_set, adj_dict):
"""Performs the deletion of the nodes
Args:
to_be_deleted_set (set): set of Nodes to be deleted ... | Python | 1 |
ident, $value:expr, $fmt:expr;)*
_, $other_fmt:expr;
}) => {
__create_protocol_enum_inner!($(#[$attr])* (pub ($($vis)+)) enum $name: $repr { $($variant, $value, $fmt;)* _, $other_fmt; });
};
($(#[$attr:meta])* enum $name:ident: $repr:ty {
$($variant:ident, $value:expr, $fmt:expr;)*
... | Rust | 0 |
#! /usr/bin/env python
import threading
import time
THREADS = 4
MAX_COUNT = 10000000
class ReaderWriterFaster(object):
def __init__(self):
self.writer = threading.Lock()
self.mx = threading.Lock()
self.entry = threading.Lock()
self.exit = threading.Lock()
self.readers_in =... | Python | 1 |
((cross + line.cross) / 2.0, 0.0)
}
}
}
AlignContent::SpaceAround => {
let s = (cross - line.cross) / (line.items.len() + 1) as f32;
if self.flex.flex_wrap != FlexWrap::WrapReverse {
... | Rust | 0 |
idxs + begin_idxs).T.flatten()
return seq_idx
def __getitem__(self, index):
vpath, vlen, aid = self.video_info.iloc[index]
assert vlen > 0
# if (vpath == 'Kinetics400/frame_150/train/lswHseMTGL0_000097_000107'):
# print(vpath, vlen, aid)
idx_block = self.id... | Python | 1 |
93), false);
assert_eq!(Dollars::new(-81.58) == Dollars::new(81.58), false);
assert_eq!(Dollars::new(781.48) == Dollars::new(87468.84), false);
}
#[test]
fn add() {
// Test 1
let dollars1 = Dollars::new(5.54);
let dollars2 = Dollars::new(8.94);
assert_eq!(dollars1 + dollars2, Dollars::new(14.48));
/... | Rust | 0 |
.unwrap();
assert_ne!(dk, dk_diff_salt);
}
#[test]
fn test_derive_key_err_diff_len() {
let password = Password::from_slice(&[0u8; 64]).unwrap();
let salt = Salt::from_slice(&[0u8; 64]).unwrap();
let dk = derive_key(&password, &salt, 3, 1024, 32).... | Rust | 0 |
crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [misc_... | Rust | 0 |
equal the given
/// type.
fn has_type(ty: Ty) -> Self {
Expectation { ty }
}
/// This expresses no expectation on the type.
fn none() -> Self {
Expectation { ty: Ty::Unknown }
}
}
/// A type. This is based on the `TyKind` enum in rustc (librustc/ty/sty.rs).
///
/// This should... | Rust | 0 |
s.MultiPage"),
("4C599241-6926-101B-9992-00000B65C6F9", "Forms.Image (may trigger CVE-2015-2424)"),
("4D3263E4-CAB7-11D2-802A-0080C703929C", "AutoCAD 2000-2002 Document"),
("5E4405B0-5374-11CE-8E71-0020AF04B1D7", "AutoCAD R14 Document"),
("64818D10-4F9B-11... | Rust | 0 |
et w = char_pw(Some(p), Side::Left);
if w != Scaled::ZERO {
let k = new_margin_kern(-w, last_leftmost_char, Side::Left);
*LLIST_link(k) = q;
q = k as i32;
}
}
if get_glue_par(GluePar::left_skip).ptr() != 0 {
let r = new_... | Rust | 0 |
from math import factorial, log
from sklearn.neighbors import KDTree
import csv
from collections import defaultdict
import numpy as np
from scipy import *
from pylab import *
import pywt
import pandas as pd
vec = []
chan = ['Fp1','AF3','F3','F7','FC5','FC1','C3','T7','CP5','CP1','P3','P7','PO3','O1','Oz','Pz','Fp2','... | Python | 1 |
"""
Archivo: programa_01py
Autor: Edwin Yoner
Fecha: 15/02/2025
Descripción:
Este módulo demuestra diferentes formas de calcular el cuadrado de cada número en una lista,
utilizando funciones tradicionales, `map` con funciones definidas y `lambda`,
así como listas por comprensión para una solución más efici... | Python | 1 |
Some(entry) = key_dir.next().await {
let entry = entry?;
let path = entry.path();
if let Some(extension) = path.extension() {
if extension == "pub" && path.is_file().await {
if let Some(key_id) = path.file_stem() {
let mut sign_key_file = fs::File... | Rust | 0 |
from collections.abc import Iterator
from django.core.management.base import BaseCommand
from safe_eth.eth import get_auto_ethereum_client
from ...models import EthereumTx
class Command(BaseCommand):
help = "Fix EIP1559 transactions"
def __init__(self, *args, **kwargs):
super().__init__(*args, **k... | Python | 1 |
print('my code on entry')
| Python | 1 |
mut self: Pin<&'_ mut Self>,
cx: &'_ mut Context,
) -> Poll<Self::Output>
{
match self.as_mut().pinned_future_mut().poll(cx) { //
| Poll::Pending => Poll::Pending,
| Poll::Ready(output) => {
let f =
self.unpinned_f_opt_mut()
... | Rust | 0 |
__author__ = 'chris'
import time
import sys
from daemon import Daemon
from twisted.internet import reactor
from txjsonrpc.netstring.jsonrpc import Proxy
def run_echoserver():
def getNew():
time.sleep(1)
d = proxy.callRemote('getnew')
d.addCallbacks(echo, printError)
def echo(messages)... | Python | 1 |
,
RSA_PSS_3072_SHA512,
RSA_PSS_4096_SHA512,
}
pub enum SignatureAlgorithmFamily {
ECDSA,
EdDSA,
RSA,
}
impl SignatureAlgorithm {
pub fn family(&self) -> SignatureAlgorithmFamily {
match self {
SignatureAlgorithm::ECDSA_P256_SHA256 | SignatureAlgorithm::ECDSA_K256_SHA256 => ... | Rust | 0 |
();
let mut tweeter = tw::TwitterCache::load_cache(&mut display_info);
display_info.status("Cache loaded".to_owned());
let (twete_tx, twete_rx) = chan::sync::<(u8, Vec<u8>)>(0);
let (coordination_tx, coordination_rx) = chan::sync::<(u8, TwitterConnectionState)>(0);
for (ref profile_name, ref pro... | Rust | 0 |
RefWrapFuture<P>
where
P: Deref + Clone,
P::Target: StreamMuxer,
{
inner: OutboundSubstreamRefFuture<P>,
}
impl<P> Future for OutboundSubstreamRefWrapFuture<P>
where
P: Deref + Clone,
P::Target: StreamMuxer,
{
type Item = Option<SubstreamRef<P>>;
type Error = IoError;
fn poll(&mut self... | Rust | 0 |
import random
from models.layers import *
class VGGSNN(nn.Module):
def __init__(self):
super(VGGSNN, self).__init__()
pool = SeqToANNContainer(nn.AvgPool2d(2))
#pool = APLayer(2)
self.features = nn.Sequential(
Layer(2,64,3,1,1),
Layer(64,128,3,1,1),
... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master... | Python | 1 |
(),
hex.as_ptr(),
network_type.to_c_value(),
&mut address,
)
};
let result = match error_code {
0 => {
let address_obj = unsafe { collect_cstring_and_free(address) }?;
Address::from_string(&address_obj)
}
_ => Err(handle.get_error(error_code)),
... | Rust | 0 |
r: the CP field for directional BLE detection.
// What we want is LLID = 10 (start of data pdu), Length 0 = controller event start and MD = 0 = last controller packet in event. NESN SN and CP can be what they want. RTU = for future use should always be 0 for now. We can filter extra packets like this.
// So we want 10x... | Rust | 0 |
# Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Fixer that changes filter(F, X) into list(filter(F, X)).
We avoid the transformation if the filter() call is directly contained
in iter(<>), list(<>), tuple(<>), sorted(<>), ...join(<>), or
for V in <>:.
NOTE: This... | Python | 1 |
m",
(0x3, 0x4) => "Konami",
(0x3, 0x5) => "Hector",
(0x3, 0x7) => "Taito",
(0x3, 0x8) => "Hudson",
(0x3, 0x9) => "Banpresto",
(0x4, 0x1) => "UbiSoft",
(0x4, 0x2) => "Atlus",
(0x4, 0x4) => "Malibu",
(0x4, 0x6) => ... | Rust | 0 |
from sortedcontainers import SortedSet
'''
init - przekazanie slow z pliku do obiektu SortedSet ( znany npp z cpp set naklepany w C )
process - funkcja dostajaca linijke, zwraca pare (optymalny tekst, wynik tekstu) (para dla rekurencji)
idea funkcji polega na podzieleniu tekstu na 2 czesci gdzie 1 czesc MUSI byc popraw... | Python | 1 |
(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct Secret {
/// The header for this packet.
pub header: Header,
/// The encrypted secret to inject.
pub ciphertext: Vec<u8>,
}
impl codicon::Decoder<()> for Secret {
type Error = std::io::Error;
fn decode(mut reader: impl Read, _:... | Rust | 0 |
import struct
def p(x):
return struct.pack('<I', x)
rop = open('input.bin').read()
def fix(rop, pattern, subst):
pattern = ''.join(pattern)
subst = ''.join(subst)
assert rop.count(pattern) == 1, str(rop.count(pattern))
return rop.replace(pattern, subst)
def xor(a, b):
return ''.join(chr(ord(... | Python | 1 |
pGraphics,
brush: *mut GpBrush,
rects: *const GpRect,
count: INT,
) -> GpStatus;
}
extern "C" {
#[link_name = "\u{1}GdipFillPolygon"]
pub fn GdipFillPolygon(
graphics: *mut GpGraphics,
brush: *mut GpBrush,
points: *const GpPointF,
count: INT,
f... | Rust | 0 |
>; 64],
}
const I_START_1: Interval = "start the 1st timer";
const I_START_2: Interval = "start the 2nd timer";
const I_START_4: Interval = "start the 4th timer";
const I_START_8: Interval = "start the 8th timer";
const I_START_16: Interval = "start the 16th timer";
const I_START_32: Interval = "start the 32nd timer";... | Rust | 0 |
ble = more_itertools.spy([1,2,3,4,5], 3)
"""peekable"""
# Conviente al iterable en un objeto al que se le pueve visualizar la primera posicion con el metodo peek() y se le puede agregar elementos antes con prepend()
peekable = more_itertools.peekable(['a', 'b'])
peekable.prepend("x","w", "z")
#print(peekable.peek(def... | Python | 1 |
}
}
impl DerefMut for Template {
fn deref_mut(&mut self) -> &mut Handlebars {
&mut self.0
}
}
/// Disables HTML escaping which is enabled by default in Handlebars.
fn never_escape(data: &str) -> String {
String::from(data)
}
#[cfg(test)]
mod test {
use std::collections::BTreeMap;
use su... | Rust | 0 |
stderr(), "{}", s.trim()),
Err(e) => writeln!(&mut io::stderr(), "{:?}: {}", proc_out.stderr, e),
};
}
match proc_out.status.code() {
Some(0) | Some(1) => {} // expected
Some(st) => bail!("child process exit with {}", st),
None => bail!(
"child process ex... | Rust | 0 |
], '%Y-%m-%d %H:%M:%S')
time_dict['tol_time'].append(end_time - start_time)
train_p = False
for idx, line in enumerate(F):
# Time
try:
timestamp = datetime.strptime(line[:19],
... | Python | 1 |
# Generated by Django 3.2.20 on 2023-11-08 13:55
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('order', '0025_auto_20210922_1857'),
]
operations = [
migrations.AlterModelOptions(
name='orderdiscount',
options={'ordering... | Python | 1 |
= y_sqr.clone() - one.clone();
let v = y_sqr * d_bn.clone() + one.clone();
let v_inv = expmod(&v, &(q.clone() - BigInt::from(2)), &q);
let x_sqr = u * v_inv;
let q_plus_3_div_8 = (q.clone() + BigInt::from(3i32)) / BigInt::from(8i32);
let mut x = expmod(&x_sqr, &q_plus_3_div_8, &q);
if BigInt:... | Rust | 0 |
log_zn / LOG10_2).log10() / LOG10_2;
iteration = iteration + 1.0 - nu;
}
iteration
}
static DONE_QUEUED: u8 = 2;
static DONE_LOADED: u8 = 1;
fn addQueue(mut tracingGlobal: &mut TracingGlobal, p: usize) {
if tracingGlobal.done[p] & DONE_QUEUED == DONE_QUEUED {
return;
}
tracingGlobal.done[p] |= DON... | Rust | 0 |
Version: {self.project_version}")
def display_edit_info(self):
"""Display edit information."""
print(f"Original Author: {self.original_author}")
print(f"Original Author Email: {self.original_author_email}")
print(f"Last Edit Date: {self.last_edit_date}")
print(f"Last Edit Au... | Python | 1 |
# uncompyle6 version 3.9.1
# Python bytecode version base 3.7.0 (3394)
# Decompiled from: Python 3.12.2 (main, Feb 6 2024, 20:19:44) [Clang 15.0.0 (clang-1500.1.0.2.5)]
# Embedded file name: output/Live/mac_universal_64_static/Release/python-bundle/MIDI Remote Scripts/FANTOM/mixer.py
# Compiled at: 2024-03-09 01:30:22... | Python | 1 |
dec_u16))(i)
}
fn hex_u8(i: &str) -> IResult<&str, u8> {
map_res(preceded(tag("0x"), hex_digit1), |s| {
u8::from_str_radix(s, 16)
})(i)
}
fn dec_u8(i: &str) -> IResult<&str, u8> {
map_res(digit1, u8::from_str)(i)
}
fn bin_u8(i: &str) -> IResult<&str, u8> {
map_res(preceded(tag("0b"), bin_dig... | Rust | 0 |
core::ecs::Entity;
use amethyst_core::math::{one, zero, Isometry3, Point, Vector3};
use amethyst_physics::{objects::*, servers::*, PtReal};
use log::error;
use nphysics3d::{
math::{Force, ForceType},
object::{
BodyPartHandle as NpBodyPartHandle, Collider as NpCollider, ColliderDesc as NpColliderDesc,
... | Rust | 0 |
from test_helpers.utils import skip_if_no_google
from aioptus import Task, eval
from aioptus.dataset import Sample
from aioptus.scorer import includes
@skip_if_no_google
def test_google_safety_settings():
safety_settings = dict(
dangerous_content="medium_and_above",
hate_speech="low_and_above",
... | Python | 1 |
mut r| r.next());
if peer_addr.is_err() || peer_addr.as_ref().unwrap().is_none() {
return Err(std::io::Error::new(
std::io::ErrorKind::Other,
"ERROR: couldn't parse pubkey@host:port into a socket address",
));
}
let pubkey = hex_utils::to_compressed_pubkey(pubkey.unwrap());
if pubkey.is_none() {
return... | Rust | 0 |
fn next(&mut self) -> Option<Self::Item> {
// Don't render anything if the rectangle has no border or fill color.
if self.style.stroke_color.is_none() && self.style.fill_color.is_none() {
return None;
}
loop {
let mut out = None;
// Finished, i... | Rust | 0 |
play_type: Vec<DisplayType>,
pub display_no_output: Vec<DisplayType>,
pub cli_args: Vec<String>,
pub nvim_pid: usize,
}
#[derive(Clone, Default, Debug)]
///data that can be saved/accessed between Arc 2 interpreter runs
pub struct InterpreterData {
///indentifies the current interpreter (so that data ... | Rust | 0 |
_string, UtilError};
use super::Config;
#[derive(Debug, Fail)]
pub enum NetworkError {
#[fail(display = "could not create directory '{}': {}", _0, _1)]
CreateDir(String, #[cause] io::Error),
#[fail(display = "could not remove directory '{}': {}", _0, _1)]
RemoveDir(String, #[cause] io::Error),
#... | Rust | 0 |
movies = []
movies.append(input("Enter the 1st movie:"))
movies.append(input("Enter the 2nd movie:"))
movies.append(input("Enter the 3rd movie:"))
print(movies) | Python | 1 |
class Solution:
def gardenNoAdj(self, n: int, paths: List[List[int]]) -> List[int]:
ans = [0] * n # ans[i] := 1, 2, 3, or 4
graph = [[] for _ in range(n)]
for a, b in paths:
u = a - 1
v = b - 1
graph[u].append(v)
graph[v].append(u)
for i in range(n):
used = [False] * 5... | Python | 1 |
default)]
pub options: BasicConsumeOptions,
#[serde(default)]
pub arguments: FieldTable,
}
#[derive(Default)]
pub struct RestoredTopology {
pub(crate) queues: Vec<Queue>,
pub(crate) channels: Vec<RestoredChannel>,
}
impl RestoredTopology {
pub fn queue(&self, index: usize) -> Queue {
s... | Rust | 0 |
) -> Self {
Self { miss: AtomicU64::new(0), evict: AtomicU64::new(0), flush: AtomicU64::new(0) }
}
pub fn clear(&self) {
self.miss.store(0, Ordering::Relaxed);
self.evict.store(0, Ordering::Relaxed);
self.flush.store(0, Ordering::Relaxed);
}
}
/// Basic performance model of... | Rust | 0 |
ctabbed_options>())).sepchan as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(nctabbed_options),
"::",
stringify!(sepchan)
)
);
assert_eq!(
unsafe { &(*(::core::ptr::null::<nctabbed_options>())).separator as... | Rust | 0 |
YOLO("yolov8s-worldv2.yaml") # no YOLO11n-world model yet
model.train(
data={"train": {"yolo_data": ["dota8.yaml"]}, "val": {"yolo_data": ["dota8.yaml"]}},
epochs=1,
imgsz=32,
cache="disk",
close_mosaic=1,
trainer=WorldTrainerFromScratch,
)
def test_yolov10():
... | Python | 1 |
from django.urls import path
from dj_rest_auth.app_settings import api_settings
from dj_rest_auth.views import (
LoginView, LogoutView, PasswordChangeView, PasswordResetConfirmView,
PasswordResetView, UserDetailsView,
)
urlpatterns = [
# URLs that do not require a session or valid token
path('passwo... | Python | 1 |
# Copyright 2017-2023 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Python | 1 |
ECTILE_WIDTH // 2, player.y, PROJECTILE_WIDTH, PROJECTILE_HEIGHT)
projectiles.append(projectile)
SHOOT_SOUND.play()
last_shot_time = current_time
keys = pygame.key.get_pressed()
if keys[pygame.K_LEFT] and player.x - PLAYER_VEL >= 0:
player.x -= PLAYER_V... | Python | 1 |
l.import_state(meta_path=[mock]):
del mock['top_level'].__package__
module = self.__import__('top_level')
self.assertEqual(module.__package__, '')
# [package]
def test_package(self):
with self.mock_modules('pkg.__init__') as mock:
with util.im... | Python | 1 |
id<D, T>) -> bool
where
D: PartialEq,
T: PartialEq + Copy,
{
if g1.data.len() != g2.data.len() || g1.shape.ne(&g2.shape) {
return false;
}
if !match (g1.no_data_value, g2.no_data_value) {
(None, None) => true,
(Some(_), None) => false,
(_, Some(y)) => g1.is_no_data(y... | Rust | 0 |
_layout() {
let mut writer = Writer::new(&Options::default()).unwrap();
assert_eq!(writer.physical_layout.bound, 0);
writer.write_physical_layout();
assert_eq!(writer.physical_layout.bound, 3);
}
<filename>magnetite/src/cmdlet/seed/mod.rs
use std::collections::HashMap;
use std::fs::File;
use std::io::Re... | Rust | 0 |
fmt=f"%(asctime)s [%(levelname)s|DP={dist.get_rank(parallel_context.dp_pg)}|PP={dist.get_rank(parallel_context.pp_pg)}|"
f"TP={dist.get_rank(parallel_context.tp_pg)}{expert_parallel_log}{'|' + node_name if node_name else ''}]: %(message)s",
datefmt="%m/%d/%Y %H:%M:%S",
)
log_level = log_leve... | Python | 1 |
}
}
pub fn timeout(&self) -> u64 {
self.timeout_
}
pub fn excluded(& self) -> &[&str] {
&*self.excluded_
}
pub fn included(&self) -> &[&str] {
&*self.included_
}
}
impl<'r> Default for Config<'r> {
fn default() -> Config<'r> {
Config {
... | Rust | 0 |
ans = question.get("user", {}).get("answer")
if ans is not None:
return ans
return self.submit_problem_answer(leaf_id, exercise_id, problem_id)
def process_exercise(self, name: str, leaf_id: int) -> None:
try:
print(f"开始处理习题: {name}")
exercise_id ... | Python | 1 |
Value::decode_unknown(&mut data, wire_type)
}
} else if field.field_type.wire_type() == wire_type {
Value::decode(&mut data, wire_type, &field.field_type, ctx)
} else {
Value::decode_unknown(&mut data, w... | Rust | 0 |
.values(&values)
.submit();
assert_eq!(result.unwrap(), ());
}
#[test]
fn test_recv_value_list_conversion() {
let empty: [c_char; ARR_LENGTH] = [0; ARR_LENGTH];
let mut metric: [c_char; ARR_LENGTH] = [0; ARR_LENGTH];
metric[0] = b'h' as c_char;
... | Rust | 0 |
ll=True)
self.logger.info(f'Installing service -> {const.DEFAULT_CONFIGS}/systemd/zeek.service')
sysctl.install_and_enable(os.path.join(const.DEFAULT_CONFIGS, 'systemd', 'zeek.service'))
class UninstallManager(install.BaseUninstallManager):
"""
Manage Zeek uninstallation process
"""
... | Python | 1 |
#[doc = "Writes raw bits to the register."]
pub unsafe fn bits(&mut self, bits: u16) -> &mut Self {
self.0.bits(bits);
self
}
}
#[doc = "USB PLL Clock Divider Buffer control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with... | Rust | 0 |
r::Div2,
q: None,
p: None,
}
}
}
#[derive(Clone, Copy, Eq, PartialEq)]
pub enum PllSrc {
HSI16,
HSE(Hertz),
}
#[derive(Clone, Copy)]
pub enum Pllm {
Div1,
Div2,
Div3,
Div4,
Div5,
Div6,
Div7,
Div8,
}
impl From<Pllm> for u8 {
fn from(v: Pl... | Rust | 0 |
_bytes()
);
// Invalid base64 encoding.
assert!(matches!(
fetch_from_str_url("data:application/json;base64,Y").unwrap_err(),
FetchError::DecodeError(_)
));
// Missing ,data
assert!(matches!(
fetch_from_str_url("data:text/plain;base64;... | Rust | 0 |
def get_dataset(self, type_path) ->Seq2SeqDataset:
n_obs = self.n_obs[type_path]
max_target_length = self.target_lens[type_path]
dataset = self.dataset_class(self.tokenizer, type_path=type_path, n_obs
=n_obs, max_target_length=max_target_length, extra_task=self.
extra_task, **self.dataset_kw... | Python | 1 |
debug!(self.logger, "volume = {}", volume);
Ok(volume)
}
}
pub(crate) fn event_stream(&self) -> Result<VolumeEvents, Win32Error> {
Ok(VolumeEvents::new(self.volume()?)?)
}
}
/// Describes an error that occurred while retrieving a property from a device.
#[derive(Debu... | Rust | 0 |
_loc_19EF(): pass
label('loc_19EF')
LoadChip('ED6_DT07/CH00170._CH', 'ED6_DT07/CH00170P._CP', 16)
LoadChip('ED6_DT07/CH00171._CH', 'ED6_DT07/CH00171P._CP', 17)
Jump('loc_1A1D')
def _loc_1A06(): pass
label('loc_1A06')
LoadChip('ED6_DT27/CH04080._CH', 'ED6_DT27/CH04080P._CP', 16)
Loa... | Python | 1 |
ME: &'static Property<'static, String, proxy_wasm::types::ByteString> =
&Property {
path: Path {
inner: PathKind::Static(&["request", "scheme"]),
},
_type: PhantomData,
_proxy_wasm_type: PhantomData,
};
/// Referer request header.
... | Rust | 0 |
pq.push((Reverse(0), map));
while let Some((Reverse(cost), map)) = pq.pop() {
if map.rooms == target_rooms() {
return cost;
}
for (m, c) in move_out(&map).chain(move_in(&map)) {
let cost = cost + c;
match visited.entry(m) {
Entry::Occu... | Rust | 0 |
# Copyright 2025 Canonical Ltd. This software is licensed under the
# GNU Affero General Public License version 3 (see the file LICENSE).
import asyncio
from unittest.mock import Mock, patch
import uuid
import pytest
from maascommon.tracing import (
get_or_set_trace_id,
get_trace_id,
set_trace_id,
T... | Python | 1 |
4**3, 2)
}
})
return result
# 性能监控相关接口
@router.get("/performance/stats")
async def performance_stats():
"""获取性能监控统计"""
monitor = get_performance_monitor()
stats = monitor.get_current_stats()
return {
"performance_stats": stats,
"monitoring_active": moni... | Python | 1 |
));
let b = actor!(s, B::init(123), ret_panic!("Actor B died"));
call!([a], A::ret_test(b.clone(), aux.si()));
aux.run(s);
aux.check_scores();
}
#[test]
fn ret_some() {
let mut stakker = Stakker::new(Instant::now());
let s = &mut stakker;
let mut aux = Aux::new(s);
let a = actor_new!(... | Rust | 0 |
Fine Disregard For Awkward Facts",
"GSV Anticipation Of A New Lover's Arrival, The",
"GSV Bad For Business",
"GSV Bora Horza Gobuchul",
"GSV Cargo Cult",
"GSV Congenital Optimist",
"GSV Contents May Differ",
"GSV Death And Gravity",
"GSV Determinist",
"GSV Dressed Up To Party",
... | Rust | 0 |
and legend ---
home_team_id = match_df[home_conditional]['teamId'].iloc[0]
away_team_id = match_df[away_conditional]['teamId'].iloc[0]
home_team_name = match_df[home_conditional]['teamName'].iloc[0]
away_team_name = match_df[away_conditional]['teamName'].iloc[0]
DC_to_FC = ax.transData.transform
... | Python | 1 |
ceives one acknowledgment after a byte was sent.
fn recv_ack(&mut self) -> anyhow::Result<(), TmError<E>> {
self.clk.set_low()?;
self.dio.set_low()?;
self.set_delay_us();
self.clk.set_high()?;
let is_dio_low: bool = self.dio.is_low()?;
// wait a few cycles for ACK t... | Rust | 0 |
path: target_path.to_string(),
},
)?;
Ok(f_protocol.message_engine(|d| f_protocol.recv(Some(d)), Duration::from_secs(2), &state)?)
}
pub fn download_partial(
host_ip: &str,
host_port: u16,
remote_addr: &str,
source_path: &str,
target_path: &str,
prefix: Option<String>,
c... | Rust | 0 |
ize))
.current_tpsno = l_current_part;
if l_num_parts != 0 as libc::c_int as libc::c_uint {
(*(*(*p_j2k).cstr_index)
.tile_index
.offset((*p_j2k).m_current_tile_number as isize))
.nb_tps = l_num_parts;
(*(*(*p_j2k).cstr_index)
.tile_index
.offset((*p_j2k).m_curr... | Rust | 0 |
(20),
BTreeSet::from_iter(vec![test_node(5), test_node(15), test_node(25)])
);
let mut authorized_nodes = Pallet::<Test>::get_authorized_nodes(&test_node(20));
authorized_nodes.sort();
assert_eq!(
authorized_nodes,
vec![test_node(5), test_node(10), test_node(15), test_node(25), test_node(30)]
);
})... | Rust | 0 |
# coding=utf-8
#
# Copyright (c) 2017 Illumina, Inc.
# All rights reserved.
#
# This file is distributed under the simplified BSD license.
# The full text can be found here (and in the LICENSE file in the root folder of
# this distribution):
#
# https://github.com/Illumina/licenses/blob/master/Simplified-BSD-License.tx... | Python | 1 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use super::interface::Interface;
use raft::{
eraftpb::{Message, MessageType},
storage::MemStorage,
Config, Raft, Result, NO_LIMIT... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.