text string | label_name string | labels int64 |
|---|---|---|
, ie,
control_points, weights,
degrees, cs, conn)
bfs[iseq, iqp] = bf
bfgs[iseq, iqp] = bfg.T
dets[iseq, iqp] = det
return bfs, bfgs, dets
def eval_variable_in_qp(variable, qps,
... | Python | 1 |
import warnings
warnings.filterwarnings("ignore")
from data import NounChunkDataLoader, NounChunkDataset
from perceptron import RecurrentPerceptron, RecurrentPerceptronStage
from config import THRESHOLD
from tqdm import tqdm
import numpy as np
from sklearn.metrics import accuracy_score
import argparse
import json
... | Python | 1 |
ummary: {member.summary}")
print(f" 🔒 Hash: {member.content_hash[:16]}...")
print(f" ⚙️ Methods: {len(member.methods)}")
# Show methods
for j, method in enumerate(member.methods[:3], 1): # Show max 3 methods
print(f" {j}. ... | Python | 1 |
= {
"eblif": "Extended BLIF hierarchical sequential designs file\n" "generated by YOSYS",
"json": "JSON file containing a design generated by YOSYS",
"synth_log": "YOSYS synthesis log",
"fasm_extra": "Extra FASM generated during sythesis stage. Needed in "
"so... | Python | 1 |
Guardian::NaldThal => "the Traders",
Guardian::Nophica => "the Matron",
Guardian::Nymeia => "the Spinner",
Guardian::Oschon => "the Wanderer",
Guardian::Rhalgr => "the Destroyer",
Guardian::Thaliak => "the Scholar",
}
}
}
impl FromStr... | Rust | 0 |
pSum.sum("aaa".to_string()));
}
}mod erlang_app;
mod erlang_modules;
mod erlang_record_headers;
pub use erlang_app::ErlangApp;
pub use erlang_modules::ErlangModules;
pub use erlang_record_headers::ErlangRecordHeaders;
use crate::{build::Module, config::PackageConfig, fs::OutputFile};
use std::fmt::Debug;
pub tra... | Rust | 0 |
pub available: bool,
pub activity_type: String,
}
<filename>src/hlist.rs
//
// Copyright (c) 2015-2019 Plausible Labs Cooperative, Inc.
// All rights reserved.
//
// This implementation based on List type from:
// https://github.com/epsilonz/shoggoth.rs
//
/// A heterogeneous list that can hold elements of diffe... | Rust | 0 |
import random
print("Házení mincí!")
while True:
vstup = input("Chcete házet mincí? (hazej): ")
if vstup.lower() == "hazej":
vysledek = random.choice(["Panna", "Orel"])
print("Výsledek: ", vysledek)
| Python | 1 |
#!/bin/python
from sub1120 import *
'''
v2 = (char *)&table1 - (char *)table;
table_ptr = table + 8;
v4 = 4i64;
do
{
v5 = *(table_ptr - 8);
v6 = table_ptr[4];
v7 = *(table_ptr - 4) + *table_ptr + *(__int64 *)((char *)table_ptr + v2 - 64);
v8 = (unsigned __int64)*(table_ptr - 8) >> 32;
v9... | Python | 1 |
op(reg) {
ctx.cpu.prefixes |= SEG_PREFIX_ZERO;
codegen::gen_modrm_resolve(ctx, modrm_byte);
codegen::gen_set_reg32(ctx, reg);
}
}
pub fn instr16_8D_reg_jit(ctx: &mut JitContext, _r1: u32, _r2: u32) {
codegen::gen_trigger_ud(ctx);
}
pub fn instr32_8D_reg_jit(ctx: &mut JitContext, _r1: u... | Rust | 0 |
ameter) {
// 模拟常见的 WebGL 参数
const fakeParams = {
37445: 'Intel Inc.',
37446: 'Intel Iris OpenGL Engine',
7937: 'WebKit',
35724: 'WebGL 1.0'
};
return fakeParams[parameter] || g... | Python | 1 |
tree
None => {
// No child here, insert new node in place
self[newindex].parent = Some(parent);
self[parent].left = Some(newindex);
break;
}
}
} else {
... | Rust | 0 |
utenError::Str(format!("eq takes 2 arguments, but given {}", vec.len())))
}
}) as NativeFn));
gltn.insert("symbol?", r(Box::new(|vec: Vec<Val>| {
Ok(r(vec.get(0).ok_or_else(|| GlutenError::Str(format!("symbol? take 1 argument")))?.is::<Symbol>()))
}) as NativeFn));
gltn.insert("vec?", r(... | Rust | 0 |
pub const IMAGE_SYM_DTYPE_NULL: WORD = 0;
pub const IMAGE_SYM_DTYPE_POINTER: WORD = 1;
pub const IMAGE_SYM_DTYPE_FUNCTION: WORD = 2;
pub const IMAGE_SYM_DTYPE_ARRAY: WORD = 3;
pub const IMAGE_SYM_CLASS_END_OF_FUNCTION: BYTE = -1i8 as u8;
pub const IMAGE_SYM_CLASS_NULL: BYTE = 0x0000;
pub const IMAGE_SYM_CLASS_AUTOMATIC... | Rust | 0 |
::cmp::{Ord, Ordering, PartialOrd};
use std::fmt;
use serde::{
de::{self, Deserialize, Deserializer, Visitor},
ser::{Serialize, Serializer},
};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete::{anychar, space0, space1};
use nom::combinator::{all_consuming, eof, map, map_res, ... | Rust | 0 |
feature = 64 * self.output_size
self.fc1 = nn.Linear(in_features=64 * self.output_size, out_features=in_feature//2)
self.classifier = nn.Sequential(
nn.ReLU(),
nn.Dropout(inplace=True),
nn.Linear(in_feature//2, in_feature//2),
nn.ReLU(),
... | Python | 1 |
# Copyright (c) OpenMMLab. All rights reserved.
import torch
import torch.nn as nn
from ..builder import NECKS
@NECKS.register_module()
class GlobalAveragePooling(nn.Module):
"""Global Average Pooling neck.
Note that we use `view` to remove extra channel after pooling. We do not
use `squeeze` as it will... | Python | 1 |
class Solution:
def twoSum(self, nums: List[int], target: int) -> List[int]:
prevMap = {} # val -> index
for i, n in enumerate(nums):
diff = target - n
if diff in prevMap:
return [prevMap[diff], i]
prevMap[n] = i
| Python | 1 |
import os
import json
import aiohttp
import requests
FACEBOOK_AUTH_TOKEN = os.environ.get('FACEBOOK_AUTH_TOKEN')
AUTH_TOKEN = f'Bearer {FACEBOOK_AUTH_TOKEN}'
headers = {
'Authorization': AUTH_TOKEN,
'Content-Type': 'application/json'
}
async def send_text_message(message: str):
SENDER_PHONE = os.environ.... | Python | 1 |
::FieldReader<bool, bool>);
impl CORE_0_SP_SPILL_MIN_RAW_R {
#[inline(always)]
pub(crate) fn new(bits: bool) -> Self {
CORE_0_SP_SPILL_MIN_RAW_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for CORE_0_SP_SPILL_MIN_RAW_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(alw... | Rust | 0 |
e number of challenges to be asked at each iteration.
pub challenge_count: usize,
/// Size of a sealed sector in bytes.
pub sector_size: usize,
/// Number of times we repeat an online Proof-of-Replication in one single PoSt.
pub post_epochs: usize,
pub pub_params_vdf: V::PublicParams,
/// Th... | Rust | 0 |
""" demo6_bp_rects.py - Test rectangles using blueprint presentation """
from pathlib import Path
from tabletqt.tablet import Tablet
from tabletqt.geometry_types import Rect_Size, Position
from tabletqt.graphics.symbol import Symbol
from tabletqt.graphics.text_element import TextElement, TextBlockCorner, HorizAlign
fr... | Python | 1 |
from selenium import webdriver
from selenium.webdriver import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from time import sleep
# get the path to the ChromeDriver executable
driver_path = ChromeDriverMa... | Python | 1 |
self, (group,): (&'a PrimitiveGroup,))
-> groups::OsmObjs<'a>
{
groups::iter(group, self.block)
}
}
pub fn iter<'a>(block: &'a PrimitiveBlock) -> OsmObjs<'a> {
block.get_primitivegroup().iter().flat_map(FnOsmObjs { block: block })
}
pub type Nodes<'a> = FlatMap<slice... | Rust | 0 |
from django.test import TransactionTestCase
from awx.main.models import (
Instance,
InstanceGroup,
)
from awx.main.scheduler.task_manager_models import TaskManagerInstanceGroups
class TestInstanceGroupInstanceMapping(TransactionTestCase):
def sample_cluster(self):
ig_small = InstanceGroup.objects... | Python | 1 |
#[doc = "1.275 V"]
_0,
}
impl DCDC_VDD1P5CTRL_TRG_BOOSTW {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
DCDC_VDD1P5CTRL_TRG_BOOSTW::_10101 => 21,
DCDC_VDD1P5CTRL_TRG_BOOSTW::_1111 => 15,
DCDC_VDD1P5CTRL_TRG... | Rust | 0 |
64>,
dt: u8,
spatial_coverages: &PyList,
) -> PyResult<TimeSpaceMoc<u64, u64>> {
if dt > Time::<u64>::MAX_DEPTH {
Err(exceptions::PyValueError::new_err(format!(
"Time depth must be in [0, {0}]",
Time::<u64>::MAX_DEPTH
)))
} else {
if times_start.len() != t... | Rust | 0 |
rint(Fore.GREEN + f'Dataset x-flips: {args.training_set_kwargs.xflip}')
print()
# Dry run?
if dry_run:
print('Dry run; exiting.')
return
# Create output directory.
print('Creating output directory...')
if os.path.exists(args.run_dir):
shutil.rmtree(args.run_dir)
... | Python | 1 |
from_strings(vec![string]);
res.kind = structs::ResourceKind::Strg(strg);
Ok(())
});
patcher.add_resource_patch((&[elv.pak_name.as_bytes()], elv.control_strg, b"STRG".into()), move |res| {
let string = format!(
"Transport to &main-color=#FF3333;{}&main... | Rust | 0 |
s = hcl.create_schedule([A, B, C, D], maximum2)
f = hcl.build(s)
##############################################################################
# In the above example, we can see that now without the return value, we can
# directly call the defined module. Let's check the results. They should be
# the same as our fir... | Python | 1 |
), ref_mut(types(i32)))]
struct MyIntsExplicit(i32, MyInt, MyIntExplicit);
#[test]
fn explicit_types_struct_tupled() {
let mut input = MyIntsExplicit(42i32, MyInt(42), MyIntExplicit(MyInt(42)));
assert_eq!(
<(i32, MyInt, MyIntExplicit)>::from(input),
(42i32, MyInt(42), MyIntExplicit(MyInt(42)))... | Rust | 0 |
as the source of random numbers. If you'd like
/// to use a custom generator, don't use this method: use either the [`Ulid::from_rng()`] method or the
/// `gen` method on `rand`'s [`Rng`].
#[inline]
pub fn new() -> Self {
Ulid::from_rng(&mut thread_rng())
}
/// Creates a random [`Ulid`] with the curre... | Rust | 0 |
: &DataElementHeader,
) -> Result<PrimitiveValue> {
let len = require_known_length!(header);
// sequence of 64-bit unsigned integers
let n = len >> 3;
let vec: EncodingResult<C<_>> = n_times(n)
.map(|_| self.basic.decode_uv(&mut *from))
.collect();
se... | Rust | 0 |
)
bbox_file = '{}.txt'.format(base_results_path)
else:
bbox_file = '{}/{}.txt'.format(tracker.results_dir, seq.name)
return os.path.isfile(bbox_file)
else:
bbox_files = ['{}/{}_{}.txt'.format(tracker.results_dir, seq.name, obj_id) for obj_id in... | Python | 1 |
# -*- coding: utf-8 -*-
import requests
from core.shells import *
import re
#from core.ip_list import *
#GET_eval_shells_path_pwd = {}
#POST_eval_shells_path_pwd = {}
#GET_exec_shells_path_pwd = {}
#POST_exec_shells_path_pwd = {}
flags = []
cookies = ''
datas = ''
url = ''
command = ''
# Example:POST_data={'x':"syst... | Python | 1 |
age.\n")
while True:
research_topic = Prompt.ask("[bold green]Enter a research topic[/] (or 'exit' to quit)")
if research_topic.lower() in ("exit", "quit", "q"):
console.print("\n[bold blue]Thank you for using the Deep Research web integration demo.[/]")
break
... | Python | 1 |
test_claim_reward() {
let (mut context, mut contract) = setup_contract();
testing_env!(context
.predecessor_account_id(accounts(2))
.attached_deposit(1)
.build());
contract.ft_on_transfer(accounts(3), TEN_PARAS_TOKEN, "".to_string());
test... | Rust | 0 |
u8 as *const c_char,
types: unsafe { &types_null as *const _ },
},
wl_message {
name: b"path\0" as *const u8 as *const c_char,
signature: b"s\0" as *const u8 as *const c_char,
types: unsafe { &types_null as *const _ },
},
wl_message {
name: b"done\0" as *const u8... | Rust | 0 |
t = 0x09, // 조종기 백라이트 설정
ModeController = 0x0A, // 조종기 동작 모드(0x10:조종, 0x80:링크)
Link = 0x0B, // 링크 제어(0:Client Mode, 1:Server Mode, 2:Pairing Start)
ClearMagnetometer = 0x0C, // 지자계 센서 초기화
// 관리자
ClearCounter = 0xA0, // 카운터 클리어(관리자 권한을 획득했을 ... | Rust | 0 |
def main():
d = [
('Hendrix' , '1942'),
('Allman' , '1946'),
('King' , '1925'),
('Clapton' , '1945'),
('Johnson' , '1911'),
('Berry' , '1926'),
('Vaughan' , '1954'),
('Cooder' , '1947'),
('Page' , '1944'),
('Richards' , '1943'),
('Hammett' , '1962'),
('Cobain' , '1967... | Python | 1 |
DebugLevel::Warning, obj: $obj, $($args)*)
}};
($cat:expr, $($args:tt)*) => { {
gst_log_with_level!($cat.clone(), level: $crate::DebugLevel::Warning, $($args)*)
}};
);
#[macro_export]
macro_rules! gst_fixme(
($cat:expr, obj: $obj:expr, $($args:tt)*) => { {
gst_log_with_level!($cat.clone... | Rust | 0 |
ub fn test_heap_checksum(fn_names: &[&str], rt: &mut Runtime) -> u64 {
let fn_ids = fn_names.iter().map(|x| name_to_u128(x)).collect::<Vec<u128>>();
let mut hasher = DefaultHasher::new();
for fn_id in fn_ids {
let term_lnk = rt.read_disk(fn_id);
if let Some(term_lnk) = term_lnk {
let term_lnk = show... | Rust | 0 |
tetime(ref dt) => write!(fmt, "{}", dt),
Literal::Float(ref f) => write!(fmt, "{}", f),
Literal::Integer(ref i) => write!(fmt, "{}", i),
Literal::String(ref s) => write!(fmt, "\"{}\"", s),
}
}
}
#[derive(Clone, Debug, PartialEq, PartialOrd)]
pub enum FnParam {
/// Tr... | Rust | 0 |
::min(min_x, bottom_left_2.0);
max_x = cmp::max(max_x, bottom_left_2.0);
min_y = cmp::min(min_y, bottom_left_2.1);
max_y = cmp::max(max_y, bottom_left_2.1);
let w2 = ((min_x as f32).abs() + (max_x as f32).abs()) as i32 + 1;
let h2 = ((min_y as f32).abs() + (max_y as f32).abs()) as i32 + 1;
let ... | Rust | 0 |
n faces are present in current detection"""
if 'faces' in detection_results and detection_results['faces']:
# Check if any detected face is not 'Unknown'
known_faces = [name for name in detection_results['faces'] if name != 'Unknown']
return len(known_faces) > 0
retur... | Python | 1 |
# from Bio import Entrez, SeqIO
# # Always provide your email when using NCBI's Entrez
# Entrez.email = "wshuai294@gmail.com"
# # The accession number of the sequence you want to download
# accession = "OP255873.1"
# # Fetch the sequence from NCBI
# with Entrez.efetch(db="nucleotide", rettype="fasta", retmode="text"... | Python | 1 |
;
use ffmpeg_sys::AVMediaType;
use std::collections::HashMap;
pub fn create_graph(
filename: &str,
video_indexes: Vec<u32>,
params: HashMap<String, CheckParameterValue>,
) -> Result<Order, String> {
let mut filters = vec![];
let mut inputs = vec![];
let mut outputs = vec![];
for i in video_indexes {
... | Rust | 0 |
# run again. Do not edit this file unless you know what you are doing.
from PySide6 import QtCore, QtWidgets
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QLabel
from videotrans.util import tools
class Ui_zhrecognform(object):
def setupUi(self, zhrecogn):
self.has_done = False
zh... | Python | 1 |
1) [root] -> [root] <a.,%1> ($1)",
// definition of `foo`
"<b.foo,%1> ($1) [root] -> [b.py(6) definition foo] <%1> ($1)",
],
);
}
#[test]
fn cyclic_imports_rust() {
let graph = test_graphs::cyclic_imports_rust::new();
check_partial_paths_in_file(
&graph,
"tes... | Rust | 0 |
# WebStreamer/bot/plugins/stats.py
from pyrogram import filters, errors
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
from WebStreamer.bot import StreamBot
from WebStreamer.bot.database import get_user_traffic_details, get_stats
from WebStreamer.bot.i18n import get_i18n_t... | Python | 1 |
from telegram import Update, InlineKeyboardButton, InlineKeyboardMarkup
from telegram.ext import Updater, CommandHandler, CallbackQueryHandler, CallbackContext
import config
def post(update: Update, context: CallbackContext):
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("🔓 Посмотреть прогноз", ... | Python | 1 |
# Copyright 2024 Wei Luo. All Rights Reserved.
#
# 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 agre... | Python | 1 |
from torch.utils.data import DataLoader
from torchvision import datasets, transforms
def load_mnist():
transform = transforms.Compose(
[transforms.ToTensor(), transforms.Normalize((0.5,), (0.5,))]
)
train_dataset = datasets.MNIST(
root="./data", train=True, download=True, transform=transfo... | Python | 1 |
easurement_invoke(&measurement, arg);
let res: f64 = Fallible::from(res)?.downcast()?;
assert_eq!(res, 1.0);
Ok(())
}
#[test]
fn test_make_base_laplace_vec() -> Fallible<()> {
let measurement = Result::from(opendp_meas__make_base_laplace(util::into_raw(0.0) as *const c_void,... | Rust | 0 |
{
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: 'Media_Core'*"]
#[repr(transparent)]
pub struct TimedTextRubyPosition(pub i32);
impl TimedTextRubyPosition {
pub const Before: Self = Self(0i32);
pub const After: Self = Self(1i32);
pub const Outside: Self = Self(2i32);
}
imp... | Rust | 0 |
y_key(|s| s.distance);
servers.truncate(3);
servers.iter_mut().for_each(|s| {
info!("ping {}", s.sponsor);
s.latency = ping_server(&s.host).unwrap();
info!("{} ping result: {}ms", s.sponsor, s.latency);
});
servers.sort_by(|a, b| a.latency.partial_cmp(&b.latency).unwrap());
l... | Rust | 0 |
odef2.clone()));
let noden2 = Blueprint::new(BuilderComplexNode::new_nodes(nodef3.clone(), noden1.clone()));
let noden3 = Blueprint::new(BuilderComplexNode::new_nodes(noden2.clone(), noden2.clone()));
let artifact_leaf = cache.get_cloned(&leaf1);
let artifact_node = cache.get_cloned(&noden1);
let artifact_root = ... | Rust | 0 |
# cgbookstore/apps/core/recommendations/urls.py
"""
Configuração de URLs para o sistema de recomendações.
Inclui rotas para recomendações tradicionais e integração com API externa.
"""
from django.urls import path
from .api import endpoints
from cgbookstore.apps.core.views.recommendation_views import (
get_recomme... | Python | 1 |
d = from_many_bytes(end);
let offset = from_many_bytes(offset);
for src in begin..=end {
let dst = src - begin + offset;
if dst != 0 {
let key = to_many_bytes(src, len);
let va... | Rust | 0 |
fn update_stable_time(&mut self, context: &UpdateContext, corrected_n2: Ratio) {
if !self.connected {
self.time_above_threshold_in_milliseconds = 0;
return;
}
if !self.activated {
self.time_above_threshold_in_milliseconds = 0;
return;
}... | Rust | 0 |
x11,Write,ACK standby mode on, powerdown on
i2c.write_read(dac_addr, &[0x80], &mut read_buf[..1]); // 1.685635650,20,0x9A,0x80,Write,ACK 1.685955650,21,0x9B,0x00,Read,NAK
i2c.write_read(dac_addr, &[0x88], &mut read_buf[..1]); // 1.686347300,23,0x9A,0x88,Write,ACK gpio? 1.686667300,24,0x9B,0x00,Read,NAK
i2c.... | Rust | 0 |
from ubot import *
__MODULE__ = "profile"
__HELP__ = """
<b>『 ʙᴀɴᴛᴜᴀɴ ᴜɴᴛᴜᴋ ᴘʀᴏꜰɪʟᴇ 』</b>
<b>• ᴘᴇʀɪɴᴛᴀʜ:</b> <code>{0}adminlist</code>
<b>• ᴘᴇɴᴊᴇʟᴀsᴀɴ:</b> ᴜɴᴛᴜᴋ ᴍᴇʟɪʜᴀᴛ sᴛᴀᴛᴜs ᴀᴅᴍɪɴ ɢʀᴜᴘ ᴀɴᴅᴀ.
<b>• ᴘᴇʀɪɴᴛᴀʜ:</b> <code>{0}setbio [ǫᴜᴇʀʏ]</code>
<b>• ᴘᴇɴᴊᴇʟᴀsᴀɴ:</b> ᴜɴᴛᴜᴋ ᴍᴇɴɢᴜʙᴀʜ ʙɪᴏ Aɴᴅᴀ.
<b>• ᴘᴇʀɪɴᴛᴀʜ:</... | Python | 1 |
irmacao = input("Tem certeza que deseja excluir esta venda? (S/N): ").upper()
match confirmacao:
case "S":
print(atualizar(f"DELETE FROM venda WHERE id = {id_venda};"))
print("Venda excluída com sucesso!")
case "N":
... | Python | 1 |
one], an Embedded Operating System.
//!
//! This crate provides shared functionality for all Drone procedural macro
//! crates.
//!
//! [Drone]: https://github.com/drone-os/drone
#![warn(missing_docs, unsafe_op_in_unsafe_fn)]
#![warn(clippy::pedantic)]
#![allow(clippy::module_name_repetitions, clippy::must_use_candida... | Rust | 0 |
'orange', 'red'], alpha=0.7)
ax4.set_title('Avg Performance by Risk', fontweight='bold')
ax4.set_ylabel('Avg FDV Change (%)')
# 5. Momentum vs Performance (middle center)
ax5 = plt.subplot(3, 3, 5)
ax5.scatter(self.df['momentum_score'], self.df['fdv_change_pct'], alpha=... | Python | 1 |
$e:expr) => (match $e {
$ok(v) => v,
ref err => {
let err = err.as_ref().map(|_|()); // map Ok/Some which might not be Debug
rtabort!(concat!("unwrap failed: ", stringify!($e), " = {:?}"), err)
},
})
}
/// A trait for viewing representations from std types
#[doc(hid... | Rust | 0 |
sError:
typer.secho("⚠️ No changes to commit for AGENTS.md (or commit failed).", fg=typer.colors.YELLOW)
except subprocess.CalledProcessError:
typer.secho("⚠️ AGENTS.md not present in 'dev' or checkout failed; skipping.", fg=typer.colors.YELLOW)
except Exception:
# non-fatal: some re... | Python | 1 |
pVal {
fn vis(mods: Modifiers) -> LispVal {
match mods {
Modifiers::PUB => LispVal::atom(AtomId::PUB),
Modifiers::ABSTRACT => LispVal::atom(AtomId::ABSTRACT),
Modifiers::LOCAL => LispVal::atom(AtomId::LOCAL),
Modifiers::NONE => LispVal::nil(),
_ => unreachable!()
... | Rust | 0 |
xpr: Expr<'a>,
rhs: SpSc,
},
}
macro_rules! ass {
($name:ident, $($scalar:path),+ $(,)?) => {
impl crate::lexer::Token<'_> {
fn $name(&self) -> Option<SpSc> {
match self {
$(
Self {
ty: crate::le... | Rust | 0 |
# -*- test-case-name: twisted.words.test -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""Exception definitions for Words
"""
class WordsError(Exception):
def __str__(self) -> str:
return self.__class__.__name__ + ": " + Exception.__str__(self)
class NoSuchUser(WordsError)... | Python | 1 |
Some("1234"),
None,
)
.await
.unwrap();
assert!(projects.is_array());
let p0 = projects.as_array().unwrap().get(0).unwrap();
assert!(p0.is_object());
assert_eq!(p0.get("__typename").unwrap(), "Project");
let p0_topdevs = p0.get("topdev").unwrap();
let p0_topd... | Rust | 0 |
t(',') {
if tok.len() == 0 {
continue;
}
// Allow key-only properties.
let mut kv = tok.splitn(2, '=').collect::<Vec<&str>>();
while kv.len() < 2 {
kv.push("");
}
propset.insert(kv[0].into(), kv[1].into... | Rust | 0 |
)?;
Ok(DecodedMessage {
function_name: result.function_name,
params: output
})
}
/// Decodes output parameters returned by some function call. Returns parametes and function name
pub fn decode_unknown_function_call(
abi: String,
response: SliceData,
internal: bool,
) -... | Rust | 0 |
&mut self, sound: &Sound, volume: f32) {
self.backend
.borrow_mut()
.set_volume(sound.id, clamp_volume(volume));
}
#[inline]
pub fn volume(&self, sound: &Sound) -> f32 {
self.backend.borrow().volume(sound.id)
}
#[inline]
pub fn clean(&mut self) {
... | Rust | 0 |
# -*- coding: utf-8 -*-
''' Circular sector getMidPoint method test.'''
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)"
__copyright__= "Copyright 2023, LCPT and AOO"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
import math
import geom
from misc_utils import log_messages as lms... | Python | 1 |
login_and_get_cookie(self, proxies=None):
"""
使用用户名密码登录获取cookie
"""
try:
logger.info(f"开始使用用户名'{self._username}'登录蜂巢论坛...")
# 采用用户测试成功的方法
return self._login_postman_method(proxies=proxies)
except Exception as e:
logger.... | Python | 1 |
__resolve_type(btf: *const btf, type_id: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__align_of(btf: *const btf, id: __u32) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__fd(btf: *const btf) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn btf__get_raw_data(btf: *const btf, size: *mut __u... | Rust | 0 |
: &HtmlElement, value: Option<&::js_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "HTMLElement" , js_name = oncanplay ) ]
#[doc = "Getter for the `oncanplay` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/... | Rust | 0 |
is_clear());
self.status()?;
Ok(())
}
}
#[allow(dead_code)]
#[repr(C)]
pub enum FlashCommands {
Init = 0x0,
PowerDown = 0x1,
SetReadMode = 0x2,
ReadSingleWord = 0x3,
EraseRange = 0x4,
BlankCheck = 0x5,
MarginCheck = 0x6,
Checksum = 0x7,
Write = 0x8,
WritePr... | Rust | 0 |
4);
encode_ix!(
i8 = u8;
i16 = u16;
i32 = u32;
i64 = u64;
);
impl Encode for types::Bytes<&'_ [u8]> {
#[inline]
fn encode<W: Write>(&self, writer: &mut W) -> Result<(), Error<W::Error>> {
TypeNum::new(major::BYTES << 5, self.0.len() as u64).encode(writer)?;
writer.push(self.0)?;... | Rust | 0 |
let outbound_router_capacity = parse(strings, ENV_OUTBOUND_ROUTER_CAPACITY, parse_number);
let inbound_router_max_idle_age = parse(strings, ENV_INBOUND_ROUTER_MAX_IDLE_AGE, parse_duration);
let outbound_router_max_idle_age = parse(strings, ENV_OUTBOUND_ROUTER_MAX_IDLE_AGE, parse_duration);
l... | Rust | 0 |
import uuid
import os
import edge_tts
import subprocess
import asyncio
from ..provider import TTSProvider
from ..entities import ProviderType
from ..register import register_provider_adapter
from astrbot.core import logger
from astrbot.core.utils.astrbot_path import get_astrbot_data_path
"""
edge_tts 方式,能够免费、快速生成语音,使用... | Python | 1 |
from pylondataprocessingtestcase import PylonDataProcessingTestCase
from pypylon import pylondataprocessing
from pypylon import genicam
import unittest
class RegionTypeTestSuite(PylonDataProcessingTestCase):
def test_presence(self):
self.assertEqual(pylondataprocessing.RegionType_Undefined, -1)
sel... | Python | 1 |
import requests
from youthon.funcs import get_initial_player_response
class Video:
def __init__(self, url: str) -> None:
headers = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36", "X-Amzn-Trace-Id": "Root=1-61acac03-6279b... | Python | 1 |
n_id_string();
let request = ToDeviceRequest::new(req.event_type, &txn_id_string, req.messages);
self.http_client.send(request).await?;
}
if let Some(s) = signature {
self.http_client.send(s).await?;
}
Ok(())
}
/// Cancel the interactive ve... | Rust | 0 |
-> Pin<Box<dyn Future<Output = T> + Sync + Send>>
where
T: PrimeField + Send + Sync + 'static,
{
Box::pin(async move {
// a wrapper struct wrapping a marker used as a key in a typemap
struct TypeKey<T: 'static>(PhantomData<T>);
impl<T: 'static> typemap::Key for TypeKey<T> {
... | Rust | 0 |
//不是拥有者
NotOwner,
//Kitty父母相同
SameParentIndex,
//无效的KittyIndex
InvalidKittyIndex,
//Kitty购买者和拥有者相同
InvalidKittyBuyer,
//Kitty处于非卖状态
KittyIsNotOnSale,
//金额不够
MoneyIsNotEnough
}
#[pallet::call]
impl<T: Config> Pal... | Rust | 0 |
read_queue_e = malloc(system_base_info.sctppcbinfo.ipi_zone_readq) as *mut sctp_queued_to_read;
if !read_queue_e.is_null() {
::std::intrinsics::atomic_xadd(&mut system_base_info.sctppcbinfo.ipi_count_readq, 1u32);
}
if !read_queue_e.is_null() {
memset(
read_queue_e as *mut l... | Rust | 0 |
from __future__ import annotations
from typing import TYPE_CHECKING, TypedDict
if TYPE_CHECKING:
from edgy.core.db.models.model import Model
class ConfigMarshall(TypedDict, total=False):
"""
A `TypedDict` for configuring the behavior and serialization aspects of an Edgy `Marshall`.
Marshalls are use... | Python | 1 |
from fastapi import APIRouter, status
from pydantic import BaseModel
class HealthCheckSchema(BaseModel):
healthy: bool = True
healthcheck_router = APIRouter(
prefix="/healthcheck",
tags=["healthcheck"]
)
healthcheck_schema = HealthCheckSchema()
@healthcheck_router.get(
"",
response_model=Heal... | Python | 1 |
]
fn test_interpolation() {
let t0 = time_point::TimePoint::new(0);
let t1 = t0 + time_point::Duration::from_secs_f64(2.0);
let wp0 = Waypoint::new(t0, 1.0, 5.0, 10f64.to_radians());
let wp1 = Waypoint::new(t1, 1.0, 10.0, -20f64.to_radians());
let motion = wp0.interpolate(&w... | Rust | 0 |
>,
/// Cost of calling the `transfer_from_purse_to_account` host function.
pub transfer_from_purse_to_account: HostFunction<[Cost; 9]>,
/// Cost of calling the `transfer_from_purse_to_purse` host function.
pub transfer_from_purse_to_purse: HostFunction<[Cost; 8]>,
/// Cost of calling the `get_balanc... | Rust | 0 |
import re
filename = "max_dict.txt" # 文件名
j=1
with open("new", "w") as output_file:
with open(filename, "r") as file:
for line in file:
results = []
lists = re.findall(r"\[\[(.*?)\]\]", line) # 查找每个[[]]中的内容
line_lists = []
for i, lst in enumerate(lists):
... | Python | 1 |
class Solution:
def validTicTacToe(self, board: List[str]) -> bool:
def isWin(c: chr) -> bool:
return any(row.count(c) == 3 for row in board) or \
any(row.count(c) == 3 for row in list(zip(*board))) or \
all(board[i][i] == c for i in range(3)) or \
all(board[i][2 - i] == c for ... | Python | 1 |
at32"
img_tensor = GraphTensor(img_shape, dtype, name="data")
# get forward graph and tir graph
fwd_graph = make_fwd_graph(model, [img_tensor])
tir_graph = make_tir_graph(fwd_graph, inference=True)
ctx = tg.get_context_from_session(sess)
inputs_data = np.random.uniform(-1, 1, img_shape).astype(dtype)
in... | Python | 1 |
RenderingComponent, bump: &'bump Bump) -> Node<'bump>
where
'a: 'bump,
{
//return
dodrio!(bump,
<div id="credentials" class="w3-row w3-border w3-black" >
<div class="w3-col m2">
<input id="api_owner" name="api_owner" value={bumpalo::format!(in bump, "{}",
rrc.api_owner)
... | Rust | 0 |
);
b.sort();
let mut candies = Vec::new();
for i in 0..m {
let mut ok = 0;
let mut ng = n - 1;
while (ok as isize - ng as isize).abs() > 1 {
let mid = (ok + ng) / 2;
if a[mid] < b[i] {
ok = mid;
} else {
ng = mid;
... | Rust | 0 |
rapping_mul((*pi).step_l)
.wrapping_add((*pi).resno.wrapping_mul((*pi).step_r))
.wrapping_add((*pi).compno.wrapping_mul((*pi).step_c))
.wrapping_add((*pi).precno.wrapping_mul((*pi).step_p));
if index >= (*pi).include_size {
opj_event_msg(
... | Rust | 0 |
gex;
command!(starboard_channel(ctx, msg, args) {
if msg.guild_id.is_none() {
return Err(CommandError::from(get_msg!("error/no_guild")));
}
let pool = get_pool(&ctx);
let mut starboard = match pool.get_starboard(msg.guild_id.unwrap().0) {
Ok(s) => s,
Err(e) => {
ma... | Rust | 0 |
lsl_aligned[idx_same] += use_freq
improvement = idx_same.any()
lsl_aligned = lsl_aligned.round(decimals)
return lsl_aligned
def reset_timestamps(df, known_freq=None):
"""
Set first timestamp to zero, but keep second column with unchanged timestamps
"""
assert len(df.columns) == 1, f... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.