text string | label_name string | labels int64 |
|---|---|---|
x: ::grpcio::RpcContext, req: super::indexrpcpb::ApplyReq, sink: ::grpcio::UnarySink<super::indexrpcpb::MergeResp>);
fn search(&mut self, ctx: ::grpcio::RpcContext, req: super::indexrpcpb::SearchReq, sink: ::grpcio::UnarySink<super::indexrpcpb::SearchResp>);
fn schema(&mut self, ctx: ::grpcio::RpcContext, req: ... | Rust | 0 |
# test for node.id < bucket.end
(list([kademlia.KBucket(0, 4)]), 5),
# test for node.id > bucket.start
(list([kademlia.KBucket(6, 10)]), 5),
# test multiple buckets that don't contain node.id
(list(
[
kademlia.KBucket(1, 5),
kademlia.KB... | Python | 1 |
value = (255 << 16) + (255 << 8) + 255;
}
buff[j * self.w + i] = value
}
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_neighbors() {
let mut w = World::new(3, 3);
w.set_cell(0, 1, true);
w.set_cell(1, 1... | Rust | 0 |
"TFS"),
&("Dawn", "TN", "TN"),
&("Dawson", "TSN", "TSN"),
&("Day", "T", "T"),
&("Daye", "T", "T"),
&("DeGrenier", "TKRN", "TKRN"),
&("Dean", "TN", "TN"),
&("Deekindaugh", "TKNT", "TKNT"),
&("Dennis", "TNS", "TNS"),
&("Denny", "TN", "TN"),
&("Denton", "TNTN", "TNTN"),
&("Desb... | Rust | 0 |
from colorama import Fore, Style
from datetime import datetime
class Log:
_instance = None
def __new__(cls):
if cls._instance is None:
cls._instance = super().__new__(cls)
cls._instance._initialize()
return cls._instance
def _initialize(self):
self.log... | Python | 1 |
from __future__ import annotations
from dataclasses import dataclass
from dataclasses import field
from typing import Optional
from reqconfbot.databases import BasicGuild
from reqconfbot.databases import GuildJSONDatabase
@dataclass
class ZapretnikiGuild(BasicGuild):
coordinates_channel_id: Optional[int] = None... | Python | 1 |
self.is_service_active(service)
@retry(tries=40, sleep_seconds=15)
def is_service_active(self, service: str) -> bool:
"""
Checks if a specific service is active.
Args:
service (str): The name of the service to check.
Returns:
bool: True if the service is... | Python | 1 |
impl<T> Drop for MutexGuard<T> {
fn drop(&mut self) {
unsafe {
(&**self.rc_ref).release_lock();
}
}
}
pub struct LockFuture<T> {
link: Link<MutexWaiter>,
waiter: MutexWaiter,
rc_ref: crate::intrusive::rc::RcRef<*const Mutex<T>>,
}
impl<T> core::future::Future for LockFu... | Rust | 0 |
ockHashParams {
entropy: 128,
hash: Poseidon::default(),
},
},
true,
),
pocklington_hash_256_1: (
PockHash {
inputs: Some(PockHashInputs {
inputs: &["1","2","3","4","5","6","7"... | Rust | 0 |
LabeledEdit_GetHideSelection(AObj: usize) -> bool;
pub fn LabeledEdit_SetHideSelection(AObj: usize, AValue: bool);
pub fn LabeledEdit_GetLabelPosition(AObj: usize) -> TLabelPosition;
pub fn LabeledEdit_SetLabelPosition(AObj: usize, AValue: TLabelPosition);
pub fn LabeledEdit_GetLabelSpacing(AObj: usize) -> i32... | Rust | 0 |
{
self.loopstart = max_index_loop
}
/* Keep the loop end point within the sample data */
if self.loopend < min_index_loop
{
self.loopend = min_index_loop
}
else if self.loopend > max_index_loop
{
self.loopend = max_index_loop
}
/* Keep lo... | Rust | 0 |
and :active nodes, need to select them
// first (to insert their TagId later)
let selected_hover_nodes = match_hover_selectors(
collect_hover_groups(css),
&ui_state.dom.arena.node_layout,
&html_tree,
);
UiDescription {
// NOTE: this clone is necessary, otherwise we wou... | Rust | 0 |
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from typing import List
from course_app.db.models import Lesson
from course_app.db.schema import LessonSchema
from course_app.db.database import SessionLocal
lesson_router = APIRouter(prefix="/lesson", tags=["Lessons"])
def get... | Python | 1 |
import os
import sys
from pathlib import Path
RECORD_STATUS = "status"
STATUS_TOTAL = "total"
STATUS_COMPLETED = "completed"
STATUS_DUPLICATE = "duplicate"
STATUS_FILTERED = "filtered"
STATUS_FAILED = "failed"
STATUS_MOJO_MAP = {
STATUS_COMPLETED: "✅",
STATUS_DUPLICATE: "🔁",
STATUS_FILTERED: "🚫",
S... | Python | 1 |
mConfig,
sender: SyncSender<TelegramMessage>,
) -> TelegramTrackerClient {
let api = telegram::start(
config.phone.to_owned(),
config.telegram_api_id.to_owned(),
config.telegram_api_hash.to_owned(),
config.print_outgoing.to_owned(),
config.... | Rust | 0 |
c\xa5X}\xaey'\xd4\x13H\x93\xc37Z\xa6\
\xa9\xac\xdbG\xe4\xc7-\xab\xc9k\x05\xe8X\xfc\xb9\xa3\
Wu\x8f\xb9B4\xado\xdeJ\xd7\xe5s]\x97\xc0\
\xa5e}\x1d\xfd6\xd5\x1e\x0c\x9e#\x1b.j\xb8\xc5\
9\xb7(\xb9T\xab'\xbf.\xad\xb4\xef\xa2\xd1+u\
\xd7c\xd9<#\xa4\xfcB\xd2\xd4\xc9\xa9x\xae\xefV\
\x10\xe4\xc1\xf6\xd5\x8d\xe7\x08\x09\x01\x12\... | Python | 1 |
import example_utils
from hyperliquid.utils import constants
def main():
address, info, exchange = example_utils.setup(constants.TESTNET_API_URL, skip_ws=True)
# Transfer 1.23 USDC from perp wallet to spot wallet
transfer_result = exchange.usd_class_transfer(1.23, False)
print(transfer_result)
... | Python | 1 |
.takes_value(true)
)
.arg(
Arg::with_name("max-batch-size")
.long("max-batch-size")
.help("Maximum size of a batch of requests")
.default_value("1000")
.takes_value(true),
)
.arg(
Arg::wit... | Rust | 0 |
> {
name: &'a str,
value: u8,
}
impl<'a> CARD<'a> {
/**
* creates a new card from the passed card name
*/
fn new(card_name: &str) -> CARD {
return CARD { name: card_name, value: CARD::determine_value_from_name(card_name) };
}
/**
* returns the value associated with a card... | Rust | 0 |
/// assert_eq!(fn_value.count_basic_blocks(), 2);
/// assert_eq!(fn_value.get_first_basic_block().unwrap(), entry_basic_block);
/// assert_eq!(fn_value.get_last_basic_block().unwrap(), last_basic_block);
/// ```
pub fn append_basic_block(&self, function: &FunctionValue, name: &str) -> BasicBlock {
... | Rust | 0 |
ion", {}).get(
"connection_name", None
)
workflow_args["connection_qualified_name"] = workflow_args.get(
"connection", {}
).get("connection_qualified_name", None)
async for dataframe in raw_input:
if not is_empty_dataframe(... | Python | 1 |
::Error>(())
/// ```
pub fn into_inner(self) -> R {
self.inner
}
/// Reads a raw GFF line.
///
/// This reads from the underlying stream until a newline is reached and appends it to the
/// given buffer, sans the final newline character. The buffer can subsequently be parsed as a
... | Rust | 0 |
ayment);
entry_points
};
let (contract_package_hash, access_uref) = storage::create_contract_package_at_hash();
runtime::put_key(HASH_KEY_NAME, contract_package_hash.into());
runtime::put_key(ACCESS_KEY_NAME, access_uref.into());
let (contract_key, _contract_version) =
storage::ad... | Rust | 0 |
##
## helloapp.py
##
##
## A nice, small 'hello world' Pythonwin application.
## NOT an MDI application - just a single, normal, top-level window.
##
## MUST be run with the command line "pythonwin.exe /app helloapp.py"
## (or if you are really keen, rename "pythonwin.exe" to something else, then
## using MSVC or simil... | Python | 1 |
f) -> u32 {
unsafe { ::std::mem::transmute(self._bitfield_1.get(1usize, 1u8) as u32) }
}
#[inline]
pub fn set_hits_set(&mut self, val: u32) {
unsafe {
let val: u32 = ::std::mem::transmute(val);
self._bitfield_1.set(1usize, 1u8, val as u64)
}
}
#[inline... | Rust | 0 |
= dp
.SPI1
.spi((sck, miso, mosi), spi::MODE_0, 100_000.Hz(), &mut rcc);
let mut scb = cp.SCB;
let mut dma = DMA::new(dp.DMA1, &mut rcc);
let mut pwr = PWR::new(dp.PWR, &mut rcc);
let mut tx_channel = dma.channels.channel3;
// Create the buffer we're going to use for DMA.
// T... | Rust | 0 |
def kilometers_to_miles(kilometers):
conversion_factor = 0.621371
miles = kilometers * conversion_factor
return miles
kilometers = 5
miles = kilometers_to_miles(kilometers)
print(f"{kilometers} kilometers is equal to {miles:.2f} miles.")
| Python | 1 |
.Frame(root)
buttons_frame.pack(pady=5)
start_button = None
stop_button = None
prev_frame = tk.LabelFrame(root, text="Previously Used URLs")
prev_frame.pack(pady=10, fill='both', padx=10)
canvas = tk.Canvas(prev_frame, height=120)
scrollbar = tk.Scrollbar(prev_frame, orient="vertical", co... | Python | 1 |
ave wasted
# computing time for the user.
# Though not necessary, the user is encouraged to use ``validate`` for debugging.
#
# The ``validate`` method runs a series of checks to ensure that
#
# * The ``configs`` are compatible among themselves. For example, it checks if all the ``configs``
# have the same ``forecast... | Python | 1 |
import os
choose_folder = str(input('Escolha o volume: '))
list_of_folders = ['customers', 'orders', 'status']
diretorio = [f"C:\\Users\\johsilva\\Downloads\\{choose_folder}\\{i}" for i in list_of_folders]
for dir in diretorio:
if os.path.exists(dir):
for file_name in os.listdir(dir):
f... | Python | 1 |
"""
FFG-benchmarks
Copyright (c) 2021-present NAVER Corp.
MIT license
"""
from fontTools.ttLib import TTFont
from PIL import Image, ImageFont, ImageDraw
import numpy as np
def get_defined_chars(fontfile):
ttf = TTFont(fontfile)
chars = [chr(y) for y in ttf["cmap"].tables[0].cmap.keys()]
return chars
def... | Python | 1 |
place or moves to the next place if there is no ant in its place',
'choices': [
'The bee moves to the next place, then stings the ant in that place',
'The bee flies to the nearest Ant and attacks it',
'The bee stings the ant in its place or moves to the next place if there... | Python | 1 |
n = int(input())
ans = []
for i in range(n):
a, b = input().split()
a = int(a)
m = a-1
L = b.strip(b[m])
ans.append(L)
for i in range(len(ans)):
print(str(i+1), ans[i]) | Python | 1 |
lt=10,
help="Number of samples to use for calibration. Default is 10.",
)
parser.add_argument(
"--max_seq_length",
type=int,
default=2048,
help="Maximum sequence length of examples to calibrate and evaluate model on. Default is 2048",
)
parser.add_argument(
... | Python | 1 |
) SimpleStaking and Tezedge Contributors
// SPDX-License-Identifier: MIT
use std::collections::VecDeque;
use serde::Deserialize;
use slog::{info, Logger};
use warp::http::StatusCode;
use warp::reject;
use itertools::Itertools;
use crate::constants::MEASUREMENTS_MAX_CAPACITY;
use crate::monitors::resource::{Resource... | Rust | 0 |
while len(params) < 2:
# defaults:
params = params + (1,)
else:
params = tuple(int(p) for p in paramstring.split(';') if len(p) != 0)
if len(params) == 0:
# defaults:
if command in 'JKm':
params = (0,)
... | Python | 1 |
)]
pub fn ef_sw_dbg_jtag_0_dis(&mut self) -> EF_SW_DBG_JTAG_0_DIS_W {
EF_SW_DBG_JTAG_0_DIS_W { w: self }
}
#[doc = "Bits 24:25"]
#[inline(always)]
pub fn ef_sw_dbg_jtag_1_dis(&mut self) -> EF_SW_DBG_JTAG_1_DIS_W {
EF_SW_DBG_JTAG_1_DIS_W { w: self }
}
#[doc = "Bit 23"]
#[i... | Rust | 0 |
CompressThreshold(threshold) => {
compress_threshold = *threshold;
}
}
}
Ok(CatenisClient {
device_credentials,
base_api_url: base_url.join(&Self::merge_url_params(API_BASE_URL_PATH, &[("version", api_version.to_string())]))?,
... | Rust | 0 |
# assign label for each det
label = np.zeros(len(sim), dtype=np.int32)
if gallery_imname in probe_gts: # 遍历全部包含query图像的场景
gt = probe_gts[gallery_imname].ravel()
w, h = gt[2] - gt[0], gt[3] - gt[1]
iou_thresh = min(0.5, (w * h * 1.0) /... | Python | 1 |
pub unknown: u8,
#[auto_struct(derive = objects.len() as u32)]
object_count: u32,
// TODO: Consider using DiffList here. Maybe requires profiling to decide...
#[auto_struct(init = (object_count as usize, ()))]
pub objects: LazyArray<'r, SclyObject<'r>>,
#[auto_struct(pad_align = 32)]
... | Rust | 0 |
# 01 OPERADORES Y ESTRUCTURAS DE CONTROL
"""
* EJERCICIO:
* - Crea e...
* - Utilizando las operaciones con operadores que tú quieras, crea ejemplos
* que representen todos los tipos de estructuras de control que existan
* en tu lenguaje:
* Condicionales, iterativas, excepciones...
"""
# Ejemplos utiliz... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
import time
import urllib
from shinken.log import logger
from .metamodule import MetaModule
class GraphsMetaModule(MetaModule):
_functions = ['get_graph_uris']
_custom_log = "You should configure the module 'graphite' in your br... | Python | 1 |
field: ",
stringify!(cx_rsa_1024_public_key_s),
"::",
stringify!(n)
)
);
}
impl Default for cx_rsa_1024_public_key_s {
fn default() -> Self {
unsafe { ::core::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub struct cx_rsa_1024_private_key_s {
... | Rust | 0 |
assert "FD_EXEC_PATH" in os.environ, \
"Please follow instructions in the docstring of the" +\
"_sesame_plan_with_fast_downward method in planning.py"
sesame_task_planner = CFG.sesame_task_planner
if sesame_task_planner.endswith("-costs"):
use_costs = True
... | Python | 1 |
# Copyright (c) 2016-present, Facebook, Inc.
#
# 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 applicable law or agreed... | Python | 1 |
OTHER REPO THAN THE DOCS SAY
# Hey, thanks for making our lives easier, Canonical :----)
# Seriously, why is Ubuntu even considered to be the default distro
# on GH Actions?
#
# core.<_path_to_target_binary>.<uid>.<boot_id>.<pid>.<timestamp>
#
# Note that we ... | Python | 1 |
et::<ConfigContainer>(&ctx).await;
let config_lock = config.read().await;
if let Some(mut member) = get_member_from_args(&ctx, &msg, &mut args).await {
if let Some(role) = change_assignable(&config_lock, &member, Scheme::Unassign(args.rest())) {
match member.remove_role(&ctx, role).await {
Ok(_) =... | Rust | 0 |
class Solution:
def countSubarrays(self, nums: List[int], k: int) -> int:
kIndex = nums.index(k)
ans = 0
count = collections.Counter()
balance = 0
for i in range(kIndex, -1, -1):
if nums[i] < k:
balance -= 1
elif nums[i] > k:
balance += 1
count[balance] += 1
... | Python | 1 |
rovider/mod.rs
pub type ContactDataProviderConnection = *mut ::core::ffi::c_void;
pub type ContactDataProviderTriggerDetails = *mut ::core::ffi::c_void;
pub type ContactListCreateOrUpdateContactRequest = *mut ::core::ffi::c_void;
pub type ContactListCreateOrUpdateContactRequestEventArgs = *mut ::core::ffi::c_void;
pub ... | Rust | 0 |
"""
Game settings file.
"""
import logging
class ServerSettings(object):
######################################################################
# Base server config
######################################################################
# This is a security setting protecting against host poisoning
... | Python | 1 |
)
value = Value(dt)
r = value.to_repr()
assert r['timestampValue'] == '2018-07-15T11:22:33.456789000Z'
@staticmethod
def test_to_repr_with_blob_value():
value = Value(b'foobar')
r = value.to_repr()
assert r['blobValue'] == 'Zm9vYmFy'
@staticmethod
... | Python | 1 |
, rep_tracker.current_pos_repetitions());
rep_tracker.pop();
}
}
<filename>src/util/util_linux.rs<gh_stars>1-10
use crate::failx::*;
use crate::flag::Flag;
use crate::perm::Perm;
use crate::qualifier::Qualifier;
use crate::sys::*;
use crate::util::util_common;
use nix::unistd::{Gid, Uid};
use scopeguard::d... | Rust | 0 |
USART or the UART peripheral.
/// This parameter can be one of the following values:
/// USART1, USART2, USART3, UART4 or UART5.
/// `USART_IT`: specifies the USART interrupt source to check.
/// This parameter can be one of the following values:
/// * USART_IT_CTS: CTS change interrupt (not available for UART... | Rust | 0 |
n_config.NumberColumn("Total Source", help="Total objects in source schema"),
"Total Destination": st.column_config.NumberColumn("Total Destination", help="Total objects in destination schema")
}
)
# Display summary statistics
total_operations = sum(len(obj_d... | Python | 1 |
acleStasisTrap,
78 => UnitType::ProtossPhoenix,
66 => UnitType::ProtossPhotonCannon,
84 => UnitType::ProtossProbe,
60 => UnitType::ProtossPylon,
894 => UnitType::ProtossPylonOvercharged,
70 => UnitType::ProtossRoboticsBay,
71 => UnitTyp... | Rust | 0 |
_cmd!(
cd ${submodule_path}; git push
);
let _ = cmd_lib::run_cmd!(
cd ${submodule_path}; git remote add upstream ${upstream_url}
);
let _ = cmd_lib::run_cmd!(
cd ${submodule_path}; git fetch upstream
);
let _ = cmd_lib::run_cmd!(
cd ${submodule_path}; git --no-pa... | Rust | 0 |
mit"]
pub mod stx;
#[doc = "Hardware General Call ID\n\nThis register you can [`read`](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/s... | Rust | 0 |
subtype: impl ToString,
args: impl Into<Vec<String>>,
) -> MediaType {
MediaType {
type_category: type_category.to_string(),
subtype: subtype.to_string(),
args: args.into(),
}
}
pub fn parse(src: &str) -> MediaType {
let parts = src.sp... | Rust | 0 |
vs:
# 1. make the localisation network to [batch, 6] via Flatten and Dense.
if self.theta_layer.outputs.get_shape().ndims > 2:
self.theta_layer.outputs = flatten_reshape(self.theta_layer.outputs, 'flatten')
# 2. To initialize the network to the identity transform ini... | Python | 1 |
_secret: self.access_token_secret,
api_key: api_key.into(),
api_secret_key: self.api_secret_key,
}
}
/// Sets the api secret key.
pub fn api_secret_key(
self,
api_secret_key: impl Into<String>,
) -> ClientBuilder<AccessTokenType, AccessTokenSecretType, Ap... | Rust | 0 |
&str = "\u{e961}";
pub const MDL2_MOUSE: &str = "\u{e962}";
pub const MDL2_SMARTCARD: &str = "\u{e963}";
pub const MDL2_SMARTCARD_VIRTUAL: &str = "\u{e964}";
pub const MDL2_MEDIA_STORAGE_TOWER: &str = "\u{e965}";
pub const MDL2_RETURN_KEY_SM: &str = "\u{e966}";
pub const MDL2_GAME_CONSOLE: &str = "\u{e967}";
pub const... | Rust | 0 |
]
#[doc = " \\param [in] range_end The index of the item following the last item of the"]
#[doc = " array object to copy. (range_end range_start) items are copied from index"]
#[doc = " range_start included. The range must be within the bounds of the array:"]
#[doc = " 0 <= range_start < range_end <= nu... | Rust | 0 |
ails.
//!
#![warn(missing_docs)]
// Codegen: introduces USB_IDS, a phf::Map<u16, Vendor>.
include!(concat!(env!("OUT_DIR"), "/usb_ids.cg.rs"));
/// An abstraction for iterating over all vendors in the USB database.
pub struct Vendors;
impl Vendors {
/// Returns an iterator over all vendors in the USB database.
... | Rust | 0 |
: *const c_char,
electrum: *const c_char,
verbosity: u8,
) -> Result<Runtime, RequestError> {
let c_network = unsafe { CStr::from_ptr(network) };
let network = bp::Chain::from_str(c_network.to_str()?)?;
let c_stash_rpc_endpoint = unsafe { CStr::from_ptr(stash_rpc_endpoint) };
let stash_rpc_endp... | Rust | 0 |
n_jwt_grant(
request, self._token_uri, assertion
)
self.token = access_token
self.expiry = expiry
@property
def service_account_email(self):
"""The service account email."""
return self._service_account_email
@_helpers.copy_docstring(cred... | Python | 1 |
import dlib
import cv2
# Initialize dlib's face detector and facial landmarks predictor
detector = dlib.get_frontal_face_detector()
predictor = dlib.shape_predictor("shape_predictor_68_face_landmarks.dat")
# Open the webcam
cap = cv2.VideoCapture(0)
while cap.isOpened():
ret, frame = cap.read()
if not ret:
... | Python | 1 |
import json
import pathlib
from typing import Any
data_path = pathlib.Path('data/config').resolve()
game_mappings_path = data_path / 'game_mappings.json'
output_path = pathlib.Path('src/shared/key_mappings.py')
def load_json(file_path):
with open(file_path, 'r') as f:
return json.load(f)
# Function to genera... | Python | 1 |
nist_cavp_runner("./tests/test_data/third_party/nist/SHA256LongMsg.rsp");
}
#[test]
fn test_nist_cavp_short_msg() {
nist_cavp_runner("./tests/test_data/third_party/nist/SHA256ShortMsg.rsp");
}
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Encode, Decode};
use frame_support::{
decl_module, decl_storag... | Rust | 0 |
0\356\351\377" +\
"\0\0\377\377\0\0\377\377\0\0\377\377\0\0\355\377\34\658\377)CY\377;`" +\
"\202\377Jz\251\377L\177\264\377Bq\245\377.S\204\377\0\0\0\0&GyI\64]\221" +\
"\377Fx\257\377P\207\300\377Y\223\314\377`\235\326\377f\246\334\377m\256" +\
"\342\377l\260\341\377\237\23\23\377\377^H\377\377E6\377\3... | Python | 1 |
])
#if len(hdrLookupBytes) > 0:
# newLookupBytes = []
# for lb in lookupBytes:
# for hlb in hdrLookupBytes:
# newLookupBytes.append(lb + hlb)
# lookupBytes = newLookupBytes
prevHdrLookupBytes = map(lambda x ... | Python | 1 |
mxErrorPALBadReadCount: i32 = -50011;
pub const DAQmxErrorPALBadReadOffset: i32 = -50010;
pub const DAQmxErrorPALBadReadMode: i32 = -50009;
pub const DAQmxErrorPALBadCount: i32 = -50008;
pub const DAQmxErrorPALBadOffset: i32 = -50007;
pub const DAQmxErrorPALBadMode: i32 = -50006;
pub const DAQmxErrorPALBadDataSize: i32... | Rust | 0 |
Qfz d dl mZmZmZ d dlmZ d dlmZ d dlZ d dl
Z
ee Z ed Z
e ddg d Zed
k re d dS dS )
)Flaskrequest send_file)
load_model)ImageNzpath_to_m... | Python | 1 |
u8)
}
#[doc = "Bit 23 - STANDBY_MODE_SEL_EXT_WRT"]
#[inline(always)]
pub fn standby_mode_sel_ext_wrt(&self) -> STANDBY_MODE_SEL_EXT_WRT_R {
STANDBY_MODE_SEL_EXT_WRT_R::new(((self.bits >> 23) & 0x01) != 0)
}
#[doc = "Bits 21:22 - STANDBY_PW_SEL_EXT_WRT"]
#[inline(always)]
pub fn ... | Rust | 0 |
&env, &ops), expected);
}
#[test]
fn reparse_mixed_precedences_mixed_fixities() {
mk_ast_arena!(arena);
let arena = arena.borrow();
let env = MockEnv::new();
let ops = OpTable::new(vec![
("*".to_string(), OpMeta::new(7, Fixity::Left)),
("-".to_string... | Rust | 0 |
Ok(4)
}
}
#[derive(Debug)]
pub(crate) struct SWJClockResponse(pub(crate) Status);
impl Response for SWJClockResponse {
fn from_bytes(buffer: &[u8], offset: usize) -> Result<Self> {
Ok(SWJClockResponse(Status::from_byte(buffer[offset])?))
}
}
use std::any::{Any, TypeId};
pub fn downcast_re... | Rust | 0 |
T, Marker)) -> Self;
}
impl<T> ParseOk for T {
fn from(v: (T, Marker)) -> Self {
v.0
}
}
impl<T> ParseOk<T> for (T, Marker) {
fn from(v: (T, Marker)) -> Self {
v
}
}
impl<T, T2> ParseOk<(T, T2)> for (T, (T2, Marker)) {
fn from(((t, t2), m): ((T, T2), Marker)) -> Self {
(t,... | Rust | 0 |
return {
'detected': momentum_detected,
'score_boost': score_boost,
'alerts': alerts,
'momentum_indicators': momentum_indicators,
'roc_level': indicators.roc,
'volume_spike': indicators.volume_ratio > 1.2,
'atr_volatile... | Python | 1 |
b fn write_only(self) -> MemFlags { self | MemFlags::WRITE_ONLY }
#[inline] pub fn read_only(self) -> MemFlags { self | MemFlags::READ_ONLY }
#[inline] pub fn use_host_ptr(self) -> MemFlags { self | MemFlags::USE_HOST_PTR }
#[inline] pub fn alloc_host_ptr(self) -> MemFlags { self | MemFlags::ALLOC_HOST_PTR ... | Rust | 0 |
import subprocess
def monitor_defender_exploit_guard_logs():
command = 'powershell -Command "Get-WinEvent -FilterHashtable @{LogName=\'Microsoft-Windows-AppLocker/EXE and DLL\'} | Format-Table -Property TimeCreated,Message -AutoSize"'
result = subprocess.run(command, shell=True, capture_output=True, text=True)... | Python | 1 |
from hello_world import Display
Display("This is printing from learn import.py") | Python | 1 |
;
for expr in exprs.iter() {
nodes.push(expr_to_node(expr));
}
match op {
MultiOp::Distinct if exprs.len() == 0 => {
// Z3 doesn't like the expression "(distinct)"
return Node::Atom("true".to_string());
... | Rust | 0 |
0241125/mixed_train_labels_feature_minmax_without_stringtype.npy", allow_pickle=True)
# 20241126 CIC-IDS2019 after do labelencode and all feature minmax 75 25分 FGSM生成的樣本 混合1/2 正常樣本
x_train = np.load(f"./Adversarial_Attack_Test/CICIDS2019/FGSM_Attack/20241125/mixed_train_data_all_feature_... | Python | 1 |
check(&[0, 0, 1, 2, 0, 0], &[0, 0, 1, 2]);
check(&[-1i32 as BigDigit], &[-1i32 as BigDigit]);
}
<reponame>Eric-Arellano/rust
// run-pass
trait Panda<T> {
fn chomp(&self, bamboo: &T) -> T;
}
trait Add<RHS,Result>: Panda<RHS> {
fn add(&self, rhs: &RHS) -> Result;
}
trait MyNum : Sized + Add<Self,Self> {... | Rust | 0 |
tion. You should confirm ownership at vk.com to log in with this IP.',
expected=True)
ERROR_COPYRIGHT = 'Video %s has been removed from public access due to rightholder complaint.'
ERRORS = {
r'>Видеозапись .*? была изъята из публичного доступа в связи с обр... | Python | 1 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
# USing Merge sort
def sortList(self, head: Optional[ListNode]) -> Optional[ListNode]:
if not head or not head.next:
return ... | Python | 1 |
import string
__example_payload__ = 'AND 1=1,<script>alert("1,2,3,4,5);</script>'
__type__ = "enclosing numbers into brackets"
def tamper(payload, **kwargs):
payload = str(payload)
to_enclose = string.digits
if not any(i in list(payload) for i in to_enclose):
return payload
retval = ""
f... | Python | 1 |
,110,100,111,119,115,46,80,101,114,99,101,112,116,105,111,110,46,83,112,97,116,105,97,108,46,83,112,97,116,105,97,108,65,110,99,104,111,114,77,97,110,97,103,101,114,0]) [CLSID_SpatialAnchorManager]);
DEFINE_IID!(IID_ISpatialAnchorManagerStatics, 2296581803, 62391, 16907, 176, 134, 138, 128, 192, 125, 145, 13);
RT_INTER... | Rust | 0 |
map(|tag| tag.name.clone())
.collect::<Vec<String>>();
log::trace!("found these tags in repo: {:?}", tag_names);
let to_patch = git::find_tags_to_patch(current.as_str(), &tag_names)
.context("can't find version to create patches for")?;
log::info!("will create patches from these versions: {... | Rust | 0 |
urned by the VPN service plugin to indicate errors. These codes correspond
/// to errors in the "org.freedesktop.NetworkManager.VPN.Error" namespace.
#[derive(Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Clone, Copy)]
#[non_exhaustive]
#[doc(alias = "NMVpnPluginError")]
pub enum VpnPluginError {
#[doc(alias = "NM_V... | Rust | 0 |
ly<F: Send + 'static + Fn(&mut dyn Any, &dyn WindowOps)>(&self, func: F)
where
Self: Sized,
{
Connection::with_window_inner(self.0, move |inner| {
let window = Window(inner.window_id);
func(inner.callbacks.as_any(), &window);
});
}
#[cfg(feature = "opengl... | Rust | 0 |
>aarch64-switch-rs/ui2d
use crate::scene;
use crate::render;
use crate::color;
use alloc::vec::Vec;
use nx::result::*;
use nx::mem;
use nx::gpu;
use nx::service;
use nx::service::nv;
use nx::service::vi;
use nx::service::applet;
use nx::service::hid;
use nx::input;
pub struct Gui<VS: vi::IRootService + service::IServi... | Rust | 0 |
.map(|e| e.to_float().unwrap())
.collect::<Vec<f64>>(),
),
Edn::Set(_) if !self.iter().unwrap().any(|e| e.to_float().is_none()) => Some(
self.iter()
.unwrap()
.map(|e| e.to_float().unwrap())
.c... | Rust | 0 |
件")
if userInput[1] == "B":
main.main() # 此处B为退出
ui.pluginInfo(localPluginList[userInput[0]]
[0], localPluginList[userInput[0]][1])
wait()
if button_a.value()==0:
print("[GxxkSystem]运行")
exec(localPluginList[userInput[0]][2]+".st... | Python | 1 |
.collect::<Vec<_>>();
// It's stupid that rust doesn't have a partition method yet
// But sort will be comparabily fast (one extra pass only) if numbers don't repeat
file_contents.sort_unstable();
let mut oxygen_slice = &file_contents[0..];
for i in 0..row_size {
if oxygen_slice.l... | Rust | 0 |
// println!("{:?}",z);
// //y 被消费掉
// //let m:Vec<_> = y.filter(|x|*x>25).collect(); //报错
// let m:Vec<_>= z.into_iter().filter(|x|*x>25).collect();
// println!("{:?}",m);
// }
// struct Count {
// count: i32,
// }
//
// impl Count {
// fn new() -> Count {
// Count { count: 0 }
// }
// }... | Rust | 0 |
# This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
INCLUDES = """
/* define our OpenSSL API compatibility level to 1.1.0. Any symbols older than
that will raise an error during compilati... | Python | 1 |
izing a model into representation '{}'.", repr)
}
#[doc = "An error occurred de-serializing a model."]
Deserialization(representation: String, location: String, context: Option<String>) {
description("An error occurred de-serializing a model.")
display("An error occurred... | Rust | 0 |
# Copyright 2021 Google LLC
#
# 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 applicable law or agreed to in writing, ... | Python | 1 |
import librosa
import numpy as np
import tensorflow as tf
from pydub import AudioSegment
from keras.models import load_model
from pygame import mixer
import os
model_rep = load_model('best_model_rep.h5')
model_pro = load_model('best_model_pro.h5')
def detect_prolongation(mfcc):
s = 0
for m in mfcc:
... | Python | 1 |
"""
Test Vehicle Journeys Observation 39
Mandatory elements incorrect in VehicleJourney field
"""
import pytest
from ..conftest import TXCFile, create_validator
OBSERVATION_ID = 39
@pytest.mark.parametrize(
"has_vj_ref, has_profile, expected",
[
pytest.param(True, False, True, id="Has Vehicle Journ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.