text string | label_name string | labels int64 |
|---|---|---|
/// Internet.
pub fn to_human_str(&self) -> String {
match self {
ApprovalState::Draft => "Draft".to_string(),
ApprovalState::Submitted => "Submitted".to_string(),
ApprovalState::Approved => "Approved".to_string(),
ApprovalState::Rejected => "Rejected".to_stri... | Rust | 0 |
# Copyright New York University and the in-toto contributors
# SPDX-License-Identifier: Apache-2.0
# TODO: Add module docstring and remove pylint exemption in in-toto/in-toto#126
# pylint: disable=missing-docstring
from securesystemslib.exceptions import Error
class SignatureVerificationError(Error):
"""Indicate... | Python | 1 |
SETTINGS = {
"download_path": None,
"authorization": None,
"use_oversea_cdn": None,
"use_webp": None,
"proxies": None,
"api_url": None,
"HC": None,
"CBZ": None,
"cbz_path": None,
"api_time": 0.0,
"API_COUNTER": 0,
"loginPattern": "0",
"salt": None,
"username": Non... | Python | 1 |
use std::sync::mpsc;
use std::thread;
use tokio_current_thread;
#[test]
fn log_test() {
simple_logger::init_with_level(log::Level::Debug).unwrap_or_default();
info!("log test");
assert_eq!(2 + 2, 4);
}
#[test]
fn correct_transfer() {
simple_logger::init_w... | Rust | 0 |
).len(), 3);
// Test append works
assert_eq!(check!(fs::metadata(&tmpdir.join("h"))).len(), 3);
{
let mut f = check!(c(&a).open(&tmpdir.join("h")));
check!(f.write("bar".as_bytes()));
}
assert_eq!(check!(fs::metadata(&tmpdir.join("h"))).len(), 6);
// Test .append(true) equals .... | Rust | 0 |
::GString, glib::Error>;
/// ## `feature`
/// feature name
///
/// # Returns
///
/// [`true`] if feature is available, [`false`] if not or on error.
#[doc(alias = "arv_device_is_feature_available")]
fn is_feature_available(&self, feature: &str) -> Result<bool, glib::Error>;
//#[doc(alias = "arv_device_read_m... | Rust | 0 |
(1usize);
// We can't assert that the metric is not present, since `GET /metrics`
// will bump the request count, lol
metric.assert_in(&metrics).await;
}
#[tokio::test]
async fn admin_transport_metrics() {
let _trace = trace_init();
let fixture = Fixture::inbound().await;
let metrics = fixture... | Rust | 0 |
)
events = [(e.wall_time, e.step, e.numpy.tolist()) for e in histograms]
return (events, "application/json")
@wrappers.Request.application
def tags_route(self, request):
ctx = plugin_util.context(request.environ)
experiment = plugin_util.experiment_id(request.environ)
in... | Python | 1 |
from customtkinter import *
from app.localstorage import LocalStorage
class NavigationFrame(CTkFrame):
def __init__(self, master, controller, **kwargs):
super().__init__(master, height=720, **kwargs)
session = LocalStorage()
self.user = session.shelf['user'] if session.shelf['user'] is no... | Python | 1 |
from RePoE.parser import Parser_Module
from RePoE.parser.util import call_with_default_args, write_json
def _convert_mods(row):
class_to_key = {
"Amulet": "Amulet_ModsKey",
"Belt": "Belt_ModsKey",
"Body Armour": "BodyArmour_ModsKey",
"Boots": "Boots_ModsKey",
"Bow": "Bow_Mo... | Python | 1 |
ings.number_field
....: backend='normaliz',
....: rays=[(0, 0, 1), (0, 1, -1), (1, 0, -1)]); q
A 3-dimensional polyhedron in AA^3 defined as the convex hull of 1 vertex and 3 rays
sage: -q # ... | Python | 1 |
, Trailer};
use crate::model::{Code, Problem};
/// Canonical lint ID
pub const CONFIG: &str = "duplicated-trailers";
const TRAILERS_TO_CHECK_FOR_DUPLICATES: [&str; 3] =
["Signed-off-by", "Co-authored-by", "Relates-to"];
const FIELD_SINGULAR: &str = "field";
/// Description of the problem
pub const ERROR: &str = ... | Rust | 0 |
from Crypto.Cipher import PKCS1_v1_5
from Crypto import Random
from Crypto.PublicKey import RSA
import base64
def rsa_ecb_decrypt(encrypted_bytes: bytes, private_key_b64: str) -> bytes:
"""
rsa解密
:param encrypted_text_base64: Base64编码的密文
:param private_key_b64: Base64编码的私钥字符串
:return: 解密后的字节数据
... | Python | 1 |
.rs
* ------- */
use crate::code::UnOp;
use crate::code::UnOp::*;
use crate::words::{StaxResult, Word};
use std::io::prelude::*;
use std::io;
pub fn do_un(op: UnOp, w: Word) -> StaxResult {
match op {
Print => {
w.print();
io::stdout().flush().ok().expect("stdout could not be flushed.");
return Ok(No... | Rust | 0 |
let ijoint = interaction.data.locked_axes.bits() as usize;
let i1 = ids1.active_set_offset;
let i2 = ids2.active_set_offset;
let conflicts =
self.body_masks[i1] | self.body_masks[i2] | joint_type_conflicts[ijoint];
let conflictfree_targets = !(conflict... | Rust | 0 |
from pyrogram import filters
from pyrogram.types import Message
from MrArman import app
from MrArman.misc import SUDOERS
from MrArman.utils.database import blacklist_chat, blacklisted_chats, whitelist_chat
from MrArman.utils.decorators.language import language
from config import BANNED_USERS
@app.on_message(filters.... | Python | 1 |
how::Result;
use necsim_core::{
impl_report,
lineage::MigratingLineage,
reporter::{
boolean::{Boolean, False, True},
FilteredReporter, Reporter,
},
};
use necsim_core_bond::{NonNegativeF64, PositiveF64};
use necsim_impls_std::event_log::recorder::EventLogRecorder;
use necsim_partition... | Rust | 0 |
"\u{edc}",
];
const REGEXES: [&str; 4] = [
"^\\p{Script=Lao}+$",
"^\\p{sc=Lao}+$",
"^\\p{Script=Laoo}+$",
"^\\p{sc=Laoo}+$",
];
for regex in REGEXES {
let regex = tc.compile(regex);
for code_point in CODE_POINTS {
regex.test_succeeds(code_poin... | Rust | 0 |
E + 0x0c, (psb1 << 16) | prb1);
write32(BASE + 0x10, (psb2 << 16) | prb2);
}
unsafe fn set_burst_blanking_interval_1(be1: u32, bs1: u32, be3: u32, bs3: u32) {
assert!(be1 <= 0x7ff);
assert!(bs1 <= 0x1f);
assert!(be3 <= 0x7ff);
assert!(bs3 <= 0x1f);
write32(BASE + 0x14, (be3 << 21) | (bs3 << 16)... | Rust | 0 |
er.
pub fn as_str(&self) -> &str {
match self {
ApiName::GetClip => "GET_CLIP",
ApiName::GetDashStreamingSessionUrl => "GET_DASH_STREAMING_SESSION_URL",
ApiName::GetHlsStreamingSessionUrl => "GET_HLS_STREAMING_SESSION_URL",
ApiName::GetImages => "GET_IMAGES",
... | Rust | 0 |
SpriteConsole {
/// Initializes the console.
pub fn init(width: u32, height: u32, sprite_sheet: usize) -> Box<SpriteConsole> {
// Console backing initialization
let new_console = SpriteConsole {
width,
height,
sprites: Vec::new(),
is_dirty: true,
... | Rust | 0 |
new(&PackageId::new($name, "1.0.0", ®istry_loc()).unwrap(),
[])
)
)
fn registry_loc() -> SourceId {
let remote = "http://example.com".to_url().unwrap();
SourceId::new(RegistryKind, remote)
}
fn pkg(name: &str) -> Summary {
Summary::new(&pkg_i... | Rust | 0 |
delta = float(auc) - float(prev_auc)
delta_s = f"{delta:+.3f}"
lines.append(_run_row(r, delta_s))
prev_auc = float(auc) if isinstance(auc, (int, float)) else prev_auc
lines.append("")
return "\n".join(lines) + "\n"
def main() -> None:
parser = a... | Python | 1 |
# Copyright 2022 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, s... | Python | 1 |
import openai
import os
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
# Get OpenAI API key from environment variables
api_key = os.getenv('open_api_key')
if api_key is None:
raise ValueError("API key is not set. Check your .env file.")
# Initialize OpenAI client with t... | Python | 1 |
import paypalrestsdk
paypalrestsdk.configure({
"mode": "sandbox",
"client_id": "ARQqV2O6Do6sriib90sG3Bt7Mt9aCEB47Ul26OpMOqFty7xJPjpI6pz603DOwKezYVNhPn38KaLChkUB",
"client_secret": "ED-0003TD_GD5oU2hZ-SctyUBUqNPytrQVPzTYNeCFlf7LbQFp0goW7dTk2S1hBoh339q8EMffME0QXM",
})
| Python | 1 |
3, 0x5a, 0x2c, 0x45,
0xd6, 0xd3, 0x21, 0x66, 0x9e, 0xbf, 0xb8, 0x59, 0x99, 0x03, 0xa6, 0x40, 0x7d, 0xd3,
0x82, 0x09, 0x76, 0x01,
],
default_d: [
0xa1, 0xe0, 0xf5, 0x3c, 0x47, 0x3e, 0xd9, 0x8c, 0x17, 0xb6, 0xd0,
],
default_pk... | Rust | 0 |
, msg.channel_id);
return;
}
if msg.content == "!tzbot" {
if let Err(why) = msg.channel_id.say("Pong!") {
log!("Error sending message: {:?}", why);
}
}
let result = convert(&msg.content);
match result {
None => {
... | Rust | 0 |
}
}
entry = ((entry as usize) + (*entry).length as usize) as *const MADTEntryHeader;
}
println!("CPUS: {}", NUM_CPUS);
}
}
}
const HEADER: &[u8] = "RSD PTR ".as_bytes();
impl RootSystemDescription {
fn rsdt_32(&self) -> &'static RootSystemDescriptionTable32 {
unsa... | Rust | 0 |
# Declare a function named `join`
# that accepts two strings as parameters
# and returns their concatenation separated
# by whitespace ' '.
#
# For example, call of `join("a", "b")` should return "a b"
def join(str1: str, str2: str) -> str:
return f"{str1} {str2}"
# Do not change the below's code
if __name__ == ... | Python | 1 |
: u32 = 9u32;
#[doc = "*Required features: `\"Win32_Devices_ImageAcquisition\"`*"]
pub const WIA_PATCH_CODE_CUSTOM_BASE: u32 = 32768u32;
#[repr(C)]
#[doc = "*Required features: `\"Win32_Devices_ImageAcquisition\"`*"]
pub struct WIA_PATCH_CODE_INFO {
pub Type: u32,
}
impl ::core::marker::Copy for WIA_PATCH_CODE_INFO... | Rust | 0 |
Drr(L\x92\x82\xc1\xe4\xac\xbe\xe5\x99=F\
\xad(\xd9\xbe\xf2\xeb\xa2-\x8b\x17|\xb1\xf9\x9f\x0d\x83\
\x09\xd9\x92\xd9s\xfc?\xd9\xbd\xc7\xdd\x93\x98\xd6k\x9c\
Fg\xd4\x1d\x92P\x83)\x8a,1E\x91\x8fu\xa3\
\xa9\x1c\x01T\x91VQ\xd9\x03B)\x14YFtR\
\x0e\xea\xcb\xb7r;\xd6\xcf\xc9\x1c6\xf9\xb6\xf3b\x93\
\xbbM\xb5F%u\xd7\xeaM\x06\xa0\... | Python | 1 |
ent) => {
unsafe { &(*(0 as *const $ty)).$field as *const _ as usize }
};
}
#[macro_use]
extern crate num_derive;
mod asm;
mod baseline;
mod boots;
mod bytecode;
mod cannon;
mod compiler;
mod cpu;
mod disassembler;
mod driver;
mod dseg;
mod error;
mod gc;
mod handle;
mod masm;
mod mem;
mod object;
mod os;... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
file_path = "match_data_20250110_154758.txt"
data = pd.read_csv(file_path)
data['CS_Per_Min'] = data['CS'].str.extract(r'\((\d+\.?\d*)\)').astype(float)
def safe_int_conversion(value):
try:
return int(value)
except (ValueError, IndexError):
... | Python | 1 |
Trans,Trans,Trans,Trans,Trans,Trans,Trans,Trans,Trans, Trans, Trans ],
// ],
// ];
// const CUT: Action = m(&[LShift, Delete]);
// const COPY: Action = m(&[LCtrl, Insert]);
// const PASTE: Action = m(&[LShift, Insert]);
// const L2_ENTER: Action = HoldTap {
// timeout: 140,
// hold: &l(2),
// tap: &k(E... | Rust | 0 |
"""
读取配置文件
"""
import os
import yaml
absPath = os.path.abspath(".")
# 配置文件路径
config_path = absPath + "/config/config.yaml"
class Config:
"""
配置类, 读取配置文件,并将路径信息从相对路径转化为绝对路径。
"""
def __init__(self):
with open(config_path, "r", encoding="utf-8") as f:
self.config = yaml.load(f, Loa... | Python | 1 |
@property
def mp(self):
"""
Returns the Mean Precision of all classes.
Returns:
(float): The mean precision of all classes.
"""
return self.p.mean() if len(self.p) else 0.0
| Python | 1 |
self.last_index = self.items.len();
self.items.push_back(Item {
offset,
next_offset: 0,
data,
children: Vec::new(),
});
Ok(())
}
/// Transform this `Tree` into its items.
pub fn into_items(self) -> VecDeque<Item<T>> {
... | Rust | 0 |
}
Err(error) => {
if std::mem::discriminant(error) != std::mem::discriminant(&expected_value) {
AssertionFailure::from_spec(self)
.with_expected(format!("Err({:?})", &expected_value))
.with_actual(format!("Err(... | Rust | 0 |
#!/usr/bin/env python3
import xml.etree.ElementTree as ET
graph = [] # граф связей машин между собой
vms = {} # вспомогательный словарь сопоставлений id машин и их имён
# вспомогательный словарь соспоставлений шейпов и типов машин
vmtypes = {
'mxgraph.cisco.routers': 'router',
'mxgrap... | Python | 1 |
import pandas as pd
# 创建数据框
data = pd.DataFrame({
'Excess_Rate': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 30, 40, 50],
'Al_Capacity': [5.50, 5.55, 5.61, 5.67, 5.72, 5.78, 5.83, 5.89, 5.94, 6.00, 6.05, 6.11, 6.16, 6.21, 6.27, 6.32, 6.38, 6.43, 6.49, 6.54, 6.60, 7.15, 7.70, 8.25... | Python | 1 |
64::from_str(&json)
.with_context(|| format!("JSON `{}` cannot be parsed as u64", json))
.map_err(DeterministicHostError::from)
}
/// Expects a decimal string.
pub(crate) fn json_to_f64(
&self,
json: String,
gas: &GasCounter,
) -> Result<f64, Deterministi... | Rust | 0 |
from .api import _shard_tensor, load_with_process_group, shard_module, shard_parameter
| Python | 1 |
::core::mem::transmute(wszDeviceId), ::core::mem::transmute(role)).ok()
}
}
unsafe impl ::windows::core::Interface for IPolicyConfigVista {
type Vtable = IPolicyConfigVista_abi;
const IID: ::windows::core::GUID = ::windows::core::GUID::from_u128(0x568b9108_44bf_40b4_9006_86afe5b5a620);
}
impl ::core::conve... | Rust | 0 |
t.text().newline_count();
if let Some(nt) = t.next_sibling_or_token() {
if let Some(nnt) = nt.next_sibling_or_token() {
if nt.kind() == WHITESPACE && nnt.kind() == NEWLINE {
return Some(newline_count);
}
}
}
None
}
#![feature(plugin)]
extern crate ... | Rust | 0 |
};
use lib::{Eoip, TunnelConfig};
const VERSION: &'static str = env!("CARGO_PKG_VERSION");
const HELP_MESSAGE: &str = r#"eoip-rs
USAGE:
eoip-rs [OPTIONS]
OPTIONS:
-l, --local IP address of local tunnel endpoint
-r, --remote IP address of remote tunnel endpoint
-t, --tunid Tunnel ID
... | Rust | 0 |
ize_cost_per_byte = v;
}
// uint64 sig_verify_cost_ed25519 = 4;
pub fn get_sig_verify_cost_ed25519(&self) -> u64 {
self.sig_verify_cost_ed25519
}
pub fn clear_sig_verify_cost_ed25519(&mut self) {
self.sig_verify_cost_ed25519 = 0;
}
// Param is passed by value, moved
p... | Rust | 0 |
let region_id = region_id.remove();
// We can delete this region. So we need to tell the larger
// layer that one of its subregion is being deleted.
// The next call to `complete_removals` on the larger layer
// w... | Rust | 0 |
_SAMPLED means the span is not sampled.
pub const TRACE_FLAG_NOT_SAMPLED: u8 = 0x00;
/// TRACE_FLAG_SAMPLED is a bitmask with the sampled bit set. A SpanContext
/// with the sampling bit set means the span is sampled.
pub const TRACE_FLAG_SAMPLED: u8 = 0x01;
/// TRACE_FLAGS_DEFERRED is a bitmask with the deferred bit s... | Rust | 0 |
def test_step1(helper):
show = helper.show_task("db1", "sc1", "ts003_ts1")
show_params = helper.show_task_parameters("db1", "sc1", "ts003_ts1")
# Parameter is in private preview
# assert show["scheduling_mode"] == "FLEXIBLE"
assert show["warehouse"] is None
assert show["schedule"] == "6 hours"... | Python | 1 |
# SPDX-License-Identifier: BSD-3-Clause
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
import math
import numpy as np
import mujoco, mujoco_viewer
from tqdm import tqdm
from collections import deque
from scipy.spatia... | Python | 1 |
return Strng
# Cham Final & Subjoined
def FixCham(Strng,reverse=False):
Strng = Strng.replace("\u02BD","")
## Check Differences between Vietnamese Cham & Cambodian Cham
ListCAll = '('+'|'.join(GM.CrunchSymbols(GM.Consonants,'Cham')) + ')'
ListVow = '('+'|'.join(GM.CrunchSymbols(GM.Vowels,'Cham'))... | Python | 1 |
hysAddr, ap0: AccessPermission, ap1: AccessPermission, ap2: AccessPermission,
ap3: AccessPermission, cache: bool, buffer: bool) -> SecondLevelDescriptor {
SecondLevelDescriptor(SecondLevelDescriptor::SMALL_DESCRIPTOR |
addr.value() & 0xFFFFF000 |
... | Rust | 0 |
ml_protocol_version > 1 {
let dimension: i32 = Serializable::read_from(buf)?;
Some(dimension)
} else {
None
};
debug!("FML|HS ServerHello: fml_protocol_version={}, override_dimension={:?}", fml_protocol_version,... | Rust | 0 |
_box_tensor : torch.Tensor
The tensor of prediction bounding box after NMS.
gt_box_tensor : torch.Tensor
The tensor of gt bounding box.
"""
pred_box_tensor, pred_score = self.post_processor.post_process(
data_dict, output_dict
)
gt_box_tensor =... | Python | 1 |
input_key_material: *mut ockam_vault_secret_t,
derived_outputs_count: u8,
derived_outputs: *mut ockam_vault_secret_t,
) -> ockam_error_t;
}
extern "C" {
#[doc = " @brief Encrypt a payload using AES-GCM."]
#[doc = " @param vault[in] Vault object to use for e... | Rust | 0 |
std::process::exit(0);
},
Err(e) => Err(ioerr!(e.kind(), "fork: {}", e)),
}
}
#[allow(unused_variables)]
#[allow(unused_assignments)]
#[allow(dead_code)]
use std::env;
use std::fs;
use adw::prelude::*;
use adw::{ActionRow, ApplicationWindow, HeaderBar};
use adw::gtk::{Application, Box, ListBox, ... | Rust | 0 |
ing_lot(&self, _code: &str) -> Option<ParkingLot> {
Some(ParkingLot {
code: "shopping",
name: "shopping",
open_hour: 0,
close_hour: 23,
})
}
}
#[test]
pub fn test_enter_parking_lot() {
let repository = MockParkingLotRepository {};
let result = EnterParkingLot::new(repository).exec... | Rust | 0 |
import os
import subprocess
import csv
import pandas as pd
from tqdm import tqdm
from pathlib import Path
import io
# Function to parse eggnog-mapper output and prepare for KEGG-Decoder
def parse_emapper(input_file, temp_folder):
# Read the input file with progress bar
with tqdm(total=1, desc="Reading eggNOG... | Python | 1 |
::Label>() {
Ok((rest, LocToken::new(span, Token::LabelLiteral(label))))
} else {
Err(nom::Err::Incomplete(nom::Needed::Unknown))
}
}
Err(nom::Err::Failure(e)) => Err(nom::Err::Error(e)),
Err(e) => Err(e),
}
}
named!(lex_label<Span, Lo... | Rust | 0 |
else:
for uvtex in context.active_object.data.uv_textures:
if uvtex.active_render == True:
for uvdata in uvtex.data:
if uvdata.image is not None:
img = uvdata.image
break
if img ... | Python | 1 |
_fd: c_int) -> Result<Event> {
let event_data = EventData::new(event_fd)?;
Ok(Event::from_event_data(event_data))
}
// Find the correct gpiochip device based on its label
pub fn find_gpiochip() -> Result<File> {
let driver_name = b"pinctrl-bcm2835\0";
for idx in 0..=255 {
let gpiochip = OpenOp... | Rust | 0 |
use hal::prelude::*;
use hal::pwm::{self, Pwm};
use hal::serial::{Config, Serial};
use hal::stm32;
use hal::timer::Timer;
use joystick::{Joystick, JoystickConfig};
use robot::Robot;
type LogUart = Serial<stm32::USART1>;
type BlueLed = PC14<Output<PushPull>>;
type RedLed = PC15<Output<PushPull>>;
type Pwm1 = Pwm<stm32... | Rust | 0 |
ub struct Rotor {
/// The letters, in order, that A, B, C etc are wired to. Accounts for ring setting
pub wiring: Vec<char>,
/// The letters with notches next to them
pub notches: [char; 2],
/// How far the rotor has rotated in its slot. An offset of 0 indicates that 'A' is showing in
/// the ... | Rust | 0 |
# -*- coding: utf-8 -*-
# pylint: disable=all
# flake8: noqa
# type: ignore
# mypy: ignore-errors
#!/usr/bin/env python3
"""
🔄 Quick Session Creator - Alternative Methods
เนื่องจาก GUI browser ไม่ทำงานใน codespace
"""
import json
import requests
import os
from datetime import datetime
def method_1_sample_session():
... | Python | 1 |
from SPARQLWrapper import SPARQLWrapper, JSON
SPARQLPATH = "http://xxx.xxx.xxx.xxx/sparql" # depend on your own internal address and port, shown in Freebase folder's readme.md
# pre-defined sparqls
sparql_head_relations = """\nPREFIX ns: <http://rdf.freebase.com/ns/>\nSELECT ?relation\nWHERE {\n ns:%s ?relation ?x .... | Python | 1 |
.clone().unwrap_or_default(),
);
match event.content {
MessageEventContent::Text(ref content) => {
rocketchat_api.chat_post_message(&content.body, channel_id)?;
}
MessageEventContent::Image(ref content) => {
let mimetype = content.clon... | Rust | 0 |
from django.core.management import call_command, BaseCommand
from datetime import datetime
class Command(BaseCommand):
"""
Команда для создания резервной копии базы данных
"""
def handle(self, *args, **options):
self.stdout.write('Waitining for database dump...')
call_command(
... | Python | 1 |
from collections import defaultdict
import itertools
import copy
grid = list(map(list, open(0).read().splitlines()))
ROW = len(grid)
COL = len(grid[0])
antennas = defaultdict(list)
for r in range(ROW):
for c in range(COL):
x = grid[r][c]
if x != '.':
antennas[x].append((r,c))
def in... | Python | 1 |
Set up and start a timer; set it to fire interrupts every 5 seconds.
let mut timer = Timer::new_tim3(dp.TIM3, 0.2, &clock_cfg);
timer.enable_interrupt(TimerInterrupt::Update); // Enable update event interrupts.
timer.enable();
let mut debounce_timer = Timer::new_tim15(dp.TIM15, 5., &clock_cfg);
de... | Rust | 0 |
path = $path)]
struct _Dummy;
}
};
(@inner $module:ident, $path: expr, ($($signature:expr => $alias:expr),*)) => {
#[allow(dead_code)]
#[allow(missing_docs)]
#[allow(unused_imports)]
#[allow(unused_mut)]
#[allow(unused_variables)]
pub mod $module {
#[derive(ethabi_derive::EthabiContract)]
... | Rust | 0 |
_by(den)
.enumerate()
.filter(|(i, line)| line[i * num % line.len()])
.count()
}
#[aoc_generator(day4)]
fn d4g(input: &str) -> Vec<Vec<(String, String)>> {
input
.split("\n\n")
.map(|line| {
line.split_whitespace()
.map(|entry| entry.split(":").ma... | Rust | 0 |
expect("obtained cargo-guppy's PackageGraph");
//! // The second argument to HakariBuilder::new specifies a Hakari (workspace-hack) package. At
//! // the moment cargo-guppy does not have such a package, and it is a TODO to add one.
//! let hakari_builder = HakariBuilder::new(&package_graph, None)
//! .expect("Haka... | Rust | 0 |
."]
#[doc = " <tt>\\see vxMapImagePatch</tt> to obtain direct memory access to the image data."]
#[doc = " \\note <tt>\\ref vxMapImagePatch</tt> and <tt>\\ref vxUnmapImagePatch</tt> may be called with"]
#[doc = " a uniform image reference."]
#[doc = " \\ingroup group_image"]
pub fn vxCreateUniformIm... | Rust | 0 |
fn bodavdd1(&self) -> BODAVDD1R {
let bits = {
const MASK: bool = true;
const OFFSET: u8 = 10;
((self.bits >> OFFSET) & MASK as u32) != 0
};
BODAVDD1R { bits }
}
}
<reponame>Nukesor/Pueuew
use anyhow::{anyhow, bail, Context, Result};
use pueue_lib::netwo... | Rust | 0 |
self.0
}
}
impl From<crate::W<EXTSCN_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<EXTSCN_SPEC>) -> Self {
W(writer)
}
}
#[doc = "External Sensor Enable for input/output pair 0.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum EXTS_EN0_A {
#[doc = "0: Dis... | Rust | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Licensed under the GNU General Public License, version 3.
# See the file http://www.gnu.org/licenses/gpl.txt
from pisi.actionsapi import shelltools
from pisi.actionsapi import autotools
from pisi.actionsapi import pisitools
from pisi.actionsapi import get
def setup():
... | Python | 1 |
params={'q': keyword, 'page': p, 'sort': sorting}).content
else:
url = constant.ARTIST_URL + keyword + '/' + ('' if sorting == 'recent' else sorting)
response = request('get', url=url, params={'page': p}).content
if response is None:
logger.warning(f'No ... | Python | 1 |
'a> {
pub fn new(service_name: &'a str) -> Self {
ServiceEventHandler { service_name }
}
const RUNNING: ServiceStatus = ServiceStatus {
service_type: ServiceType::OWN_PROCESS,
current_state: ServiceState::Running,
controls_accepted: ServiceControlAccept::STOP,
exit_c... | Rust | 0 |
each pattern has the same index as in `replacements`.
to_redact: RegexSet,
/// Used to replace substrings of matching text, each pattern has the same index as in
/// `to_redact`.
replacements: Vec<PatternReplacer>,
}
struct PatternReplacer {
matcher: Regex,
replacement: &'static str,
}
impl ... | Rust | 0 |
t Some(norm) = params.norm {
match norm {
NormalizationFactor::One => {
// Slaney-style mel is scaled to be approx constant energy per channel
// enorm = 2.0 / (mel_f[2:n_mels+2] - mel_f[:n_mels])
// weights *= enorm[:, np.newaxis]
... | Rust | 0 |
from uuid import UUID
from vellum_ee.workflows.display.editor import NodeDisplayComment, NodeDisplayData, NodeDisplayPosition
from vellum_ee.workflows.display.nodes import BaseFinalOutputNodeDisplay
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay
from ...nodes.output_user_question import OutputU... | Python | 1 |
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.contrib.auth.validators import UnicodeUsernameValidator
class User(AbstractUser):
email = models.EmailField( unique=True)
USERNAME_FIELD='email'
REQUIRED_FIELDS = ['username']
username=models.CharField(max_len... | Python | 1 |
-> None:
eps_fns = sorted(replay_dir.glob('*.npz'))
for eps_fn in tqdm(eps_fns):
if self._full:
break
episode = load_episode(eps_fn)
if relabel:
episode = relabel_episode(env, episode, goal_func)
# for field in dataclasses.... | Python | 1 |
uint32): 0xe0f
renewal_t1_time_value (uint32): 0x707
rebinding_t2_time_value (uint32): 0xc4d
subnet_mask (ip): 255.255.255.0
broadcast_address (ip): 192.168.43.255
router (ip_mult): {192.168.43.242}
domain_name_server (ip_mult): {192.168.43.242}
vendor_specific (opaque):
0000 41 4e 44 52 4f 49 44 5f 4d 45 54 45 52 45... | Python | 1 |
systick.clear_current();
p.systick.enable_counter();
p.systick.enable_interrupt();
Peripherals {
led: {
let pad = p.iomuxc.gpio_b0_03;
hal::gpio::IO03::gpio2(pad).fast(&mut p.iomuxc.gpr).output()
},
ccm: p.ccm,
pit: ... | Rust | 0 |
"""
生成 .h5 数据文件
"""
import argparse
from dataset import prepare_data
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Building the training patch database")
parser.add_argument("--gray", default=True, action='store_true', help='prepare grayscale database instead of RGB')
# Preproces... | Python | 1 |
default();
let _m2 = Model2::default();
let _m3 = Model3::default();
let _m4 = Model4::default();
let _m5 = Model5::default();
assert_eq!(Model0::write_concern(), Some(WriteConcern::builder()
.w(Some(Acknowledgment::Majority))
.w_timeout(Some(std::time::Duration::from_secs(10)))
... | Rust | 0 |
nn.functional.binary_cross_entropy_with_logits(
coord_mask_pred.F.squeeze(1), coord_mask_5, reduction='mean'
) / math.log(2) # 各层stage-one的坐标损失
if torch.sum(coord_mask_5) == 0:
lower_fea_tilde = lower_fea_tilde_pos
... | Python | 1 |
# from .glm3_agent import create_structured_glm3_chat_agent
from .qwen_agent import create_structured_qwen_chat_agent
| Python | 1 |
from django.shortcuts import render
from rest_framework import generics
from .models import SpyCat
from .serializers import SpyCatSerializer
# List of all cats
class SpyCatList(generics.ListCreateAPIView):
queryset = SpyCat.objects.all()
serializer_class = SpyCatSerializer
def perform_create(self, seriali... | Python | 1 |
);
for i in 0..len {
for j in i..len {
for k in j..len {
if (rating[i] < rating[j] && rating[j] < rating[k])
|| (rating[i] > rating[j] && rating[j] > rating[k])
{
teams += 1;
}
}
}
}
... | Rust | 0 |
"detects_unmaintained",
Some(cfg),
None,
|ctx, _, tx| {
advisories::check(
ctx,
&dbs,
lock,
Option::<advisories::NoneReporter>::None,
tx,
);
},
)
.unwrap();
let un... | Rust | 0 |
# holidays
# --------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Authors: Vacanza Team and individual contributors (see CONTRIBUTORS f... | Python | 1 |
llBehaviorInputStr::WhenAnySucceeded => {
KillBehavior::WhenAnyExitedWithStatus(ExitStatusPattern::Success)
}
KillBehaviorInputStr::WhenAnyFailed => {
KillBehavior::WhenAnyExitedWithStatus(ExitStatusPattern::Failed)
}
},... | Rust | 0 |
tent-Type": "application/json",
},
)
if response.status_code != 200:
raise RuntimeError(
f"OpenAI API error: {response.status_code} - {response.text}"
)
result = response.json()
response_text = (
result.get("choices", [{}]... | Python | 1 |
racters = string.chars();
for _ in 0..maximum_number_of_characters
{
let character = characters.next().unwrap();
result.push(replacement_function(character));
}
}
/// Suitable for RFC 5424, for example
#[inline]
pub fn to_8bit_encoding_replacement_function_us_ascii_printable(character: char, us_ascii_replace... | Rust | 0 |
hass.bus.async_fire(f"{DOMAIN}_stream_start", {"event_id": event_id, "type": "image_analysis"})
accumulated_text = ""
for line in response.iter_lines():
if line:
try:
... | Python | 1 |
use chrono::prelude::*;
use ical::parser::ical::component::IcalCalendar;
const CALENDAR_URL : &str = "https://calendar.google.com/calendar/ical/1b1et1slg27jm1rgdltu3mn2j4@group.calendar.google.com/public/basic.ics";
use super::CalendarEvent;
use tracing::{error, info};
#[derive(Error, Debug)]
enum CalendarFetchEr... | Rust | 0 |
();
let __temp0 = __action197(
input,
__2,
);
let __temp0 = (__start0, __temp0, __end0);
__action459(
input,
__0,
__1,
__temp0,
__3,
__4,
__5,
__6,
)
}
#[allow(unused_variables)]
fn __action476<
'input,
>(
input... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.