text string | label_name string | labels int64 |
|---|---|---|
bPpSttNtMw4UQ1bGiVzEM-94QqkwHT',
}
PRETRAINED_MODEL_CONFIG_JSON = 'https://drive.google.com/open?id=15JnXi7L6LeEB2fq4dFK2WRvDKyX46hVi'
PRETRAINED_SPECIAL_VOCAB_PKL = 'https://drive.google.com/open?id=1nTQVe2tfkWV8dumbrLIHzMgPwpLIbYUd'
PAPER_TASK_TO_INTERNAL = {
'lm': 'lm',
'lmrev': 'reverse_lm',
'lmall': ... | Python | 1 |
# Matrix Keypad
# NerdCave - https://www.youtube.com/channel/UCxxs1zIA4cDEBZAHIJ80NVg - Subscribe if you found this helpful.
# Github - https://github.com/Guitarman9119
from machine import Pin
import utime
# Create a map between keypad buttons and characters
matrix_keys = [['1', '2', '3', 'A'],
['4', '... | Python | 1 |
.)
| ty::Str => return,
ty::Ref(..) => {
let place = builder.load_operand(place).deref(builder.cx());
codegen_collectable_calls_for_value(builder, place, substs)
},
ty::Adt(adt_def, substs) => {
let set_col_did = match buil... | Rust | 0 |
iter()
.map(|(pair, trade_amount)| {
let cloned_api_key = api_key.clone();
async move {
let client = reqwest::ClientBuilder::new()
.timeout(Duration::new(3, 0))
.user_agent("gp-v2-services/2.0.0")
.build()
... | Rust | 0 |
ow = windows.get_primary().unwrap();
let mut width = window.width() - SIDE_PANEL_WIDTH;
let mut height = window.height();
if width > height
{
width = height;
}
if width < height
{
height = width;
}
for (sprite_size, mut sprite) in q.iter_mut()
{
sprite.size = Vec2::new(
(sprite_si... | Rust | 0 |
he buffer do we truncate, to
# reduce the amount of memory thrashing. This heuristic
# can be changed or removed later.
if unread > 0:
return
if unread > 0:
# move unread data to the front
view = self._buffer.getbuffer()
view[:unread] = v... | Python | 1 |
class Solution:
def findFarmland(self, land: List[List[int]]) -> List[List[int]]:
# runs dfs at the top left coordinate, returns bottom right coordinate
ans = []
visited = set()
for i in range(len(land)):
for j in range(len(land[0])):
if land[i][j] == 1 a... | Python | 1 |
.unwrap();
self.level.state = BatteryLevel::get_current(self).unwrap();
Ok(())
}
}
#[derive(Serialize, Debug)]
pub struct BatteryLevel {
pub state: u8,
}
impl Sensor<BatteryProvider> for BatteryLevel {
type StateType = u8;
fn new() -> Self {
BatteryLevel { state: 0... | Rust | 0 |
pub fn SteamAPI_ISteamInput_StopAnalogActionMomentum(
self_: *mut ISteamInput,
inputHandle: InputHandle_t,
eAction: InputAnalogActionHandle_t,
);
}
extern "C" {
pub fn SteamAPI_ISteamInput_GetMotionData(
self_: *mut ISteamInput,
inputHandle: InputHandle_t,
) -> InputMotionData_t;
}
extern "C" {
pub fn St... | Rust | 0 |
a=b=c=10
print(a,b,c)
a,b,c = 5,10,15
print(a,b,c)
colors = ["red","blue","green"]
a,b,c = colors
print(a)
print(b)
print(c)
a = "Focus"
b = "on"
c = "yourself"
print(a + b + c)
print(a, b, c)
x = "calm"
def myfunc():
print("Keep yourself " + x)
myfunc() | Python | 1 |
let tx_hash = signed_tx.hash();
self.utxo
.insert((tx_hash, idx), (tx_out.value, tx_out.recipient_addr));
idx += 1;
}
// println!("After state update");
// for (key, val) in self.utxo.iter() {
// println!("key: {:?}, val: {:?}", key... | Rust | 0 |
iate representation of a given mnemonic
/// phrase. One can use this intermediate representation to translate
/// mnemonic from one [`Language`](./dictionary/trait.Language.html)
/// to another. **However** keep in mind that the [`Seed`](./struct.Seed.html)
/// is linked to the mnemonic string in a specific language, i... | Rust | 0 |
parse(&self, input: &HStringArg) -> Result<(Option<JsonArray>, bool)> { unsafe {
let mut result = null_mut(); let mut out = zeroed();
let hr = (self.get_vtbl().TryParse)(self.get_abi() as *const _ as *mut _, input.get(), &mut result, &mut out);
if hr == S_OK { Ok((JsonArray::wrap(result), out))... | Rust | 0 |
t::Reserved(asset_a, 2, 1000000000000).into(),
orml_tokens::Event::Reserved(asset_b, 3, 2000000000000).into(),
orml_tokens::Event::Reserved(asset_b, 2, 2000000000).into(),
orml_tokens::Event::Reserved(asset_b, 3, 4000000000).into(),
Event::IntentionResolvedDirectTrade(
user_2,
user_3,
user_2_sel... | Rust | 0 |
from __future__ import print_function
import os, sys
from pymol import cmd, testing, stored, invocation
class TestInvocation(testing.PyMOLTestCase):
@testing.foreach.zip(('.pymolrc.py', '.pymolrc', 'pymolrc.pml', 'pymolrcextra.py'))
@testing.requires_version('1.7.1')
def test_get_user_config(self, basena... | Python | 1 |
object.instance, func_index);
let result = invoke_fn(&result_object.instance);
assert_eq!(result, 4294967249.0 as f64);
}
// Line 204
#[test]
fn c85_l204_assert_malformed() {
let wasm_binary = [
40, 103, 108, 111, 98, 97, 108, 32, 102, 51, 50, 32, 40, 102, 51, 50, 46, 99, 111, 110,
115, 116... | Rust | 0 |
= " This defines the data structure for image scaling mode"]
#[doc = ""]
pub type aom_scaling_mode_t = aom_scaling_mode;
pub const AOM_CONTENT_DEFAULT: aom_tune_content = 0;
pub const AOM_CONTENT_SCREEN: aom_tune_content = 1;
pub const AOM_CONTENT_FILM: aom_tune_content = 2;
pub const AOM_CONTENT_INVALID: aom_tune_con... | Rust | 0 |
470175814,
0.1184975106627491,
0.10703910172433752,
0.09349724616351245,
0.07813544947557043,
0.06125247712955459,
0.04317587117024172,
0.02424860077153178,
0.003952569169960447,
];
let points = vec![
[-1.0000000000000004],
[-0.9855... | Rust | 0 |
100
)
def test_qualitative_torchtransform_wrapper():
# second just qualitative test with real images
class ToFloat:
def __call__(self, sample):
for key in _get_relevant_spatial_keys(sample):
sample[key] = sample[key].astype(np.float32)
return sample
pre... | Python | 1 |
iter = W;
}
#[doc = "`reset()` method sets LOCK to value 0"]
impl crate::Resettable for LOCK_SPEC {
#[inline(always)]
fn reset_value() -> Self::Ux {
0
}
}
<filename>src/test/ui/associated-consts/associated-const-resolution-order.rs<gh_stars>1000+
// run-pass
struct MyType;
impl MyType {
const ... | Rust | 0 |
ion;
pub use cortex_m::interrupt::Mutex;
pub use cortex_m::peripheral::syst::SystClkSource;
pub use cortex_m::peripheral::Peripherals;
use cortex_m::{
asm::{self, bkpt, dsb},
interrupt::CriticalSection,
register::control,
};
use cortex_m_rt::exception;
use crate::kernel::tasks::{schedule, TaskManager};
us... | Rust | 0 |
me()
time.sleep(0.01)
cache = nyx.cache()
with cache.write() as writer:
writer.record_relay('3EA8E960F6B94CE30062AA8EF02894C00F8D1E66', '208.113.165.162', 1443, 'caersidi1')
time.sleep(0.01)
after = time.time()
self.assertTrue(before < cache.relays_updated_at() < after)
@patch('nyx.... | Python | 1 |
= self.temp_map.map(p1_frame);
Ok(&mut p1_table[page.p1_index()])
}
}
#[cfg(riscv64)]
impl<'a> Mapper for RecursivePageTable<'a> {
fn map_to(
&mut self,
page: Page,
frame: Frame,
flags: PageTableFlags,
allocator: &mut impl FrameAllocator,
) -> Result<MapperF... | Rust | 0 |
"""
Classifies: CHEBI:17389 2-monoglyceride
"""
"""
Classifies: CHEBI:174752 2-monoglyceride
"""
from rdkit import Chem
from rdkit.Chem import AllChem
def is_2_monoglyceride(smiles: str):
"""
Determines if a molecule is a 2-monoglyceride based on its SMILES string.
A 2-monoglyceride has a single fatty acid... | Python | 1 |
extern crate r2d2;
extern crate r2d2_diesel;
pub mod schema;
pub mod models;
use diesel::pg::PgConnection;
use r2d2::{ Pool, Config };
use r2d2_diesel::ConnectionManager;
use dotenv::dotenv;
use std::env;
pub fn create_db_pool() -> Pool<ConnectionManager<PgConnection>> {
dotenv().ok();
let database_url = e... | Rust | 0 |
edge_centrality = self.compute_edge_centrality(graph)
indices_to_keep = self.prune_edges(edge_centrality, graph.number_of_edges())
# Create a new graph using the edges that have been kept
src_nodes, dst_nodes = graph.edges()
src_nodes = src_nodes[ind... | Python | 1 |
adjust/2
now_add_lust *= adjust
# W扩张修正
adjust = attr_calculation.get_ability_adjust(character_data.ability[12])
now_add_lust /= adjust * adjust
now_add_lust = int(now_add_lust)
base_chara_state_common_settle(character_id, now_add_lust, 17, base_value = 0, ability_level = character_data.abilit... | Python | 1 |
� 3♦", 543, HandRankName::Flush, HandRankClass::AceHighFlush)]
#[case("A♦ Q♦ T♦ 6♦ 2♦", 544, HandRankName::Flush, HandRankClass::AceHighFlush)]
#[case("A♦ Q♦ T♦ 5♦ 4♦", 545, HandRankName::Flush, HandRankClass::AceHighFlush)]
#[case("A♦ Q♦ T♦ 5♦ 3♦", 546, HandRankName::Flush, HandRankClass::AceHighFlush)]
... | Rust | 0 |
import sympy as sym
import faultdiagnosistoolbox as fdt
import matplotlib.pyplot as plt
model_def = {
'type': 'Symbolic',
'x': ['pump_V_flow', 'valve0_V_flow', 'valve1_V_flow', 'tank1_level', 'der_tank1_level'],
'f': ['f_tank1leak', 'f_valve0', 'f_valve1', 'f_pumpSlow'],
'z': ['FI1', 'FI2', 'LI3', 'FI4... | Python | 1 |
import base64
import hashlib
import uuid
import requests
from Crypto.Cipher import AES
from Crypto.Cipher import PKCS1_v1_5
from Crypto.PublicKey import RSA
from Crypto.Util.Padding import pad
class WeicoSpider(object):
app_info_dct = {
"weicoabroad": {
"from": "1299295010",
"pin"... | Python | 1 |
import insightconnect_plugin_runtime
from .schema import (
DownloadSandboxInvestigationPackageInput,
DownloadSandboxInvestigationPackageOutput,
Input,
Output,
Component,
)
from insightconnect_plugin_runtime.exceptions import PluginException
# Custom imports below
import time
from datetime import da... | Python | 1 |
const HELP_MESSAGE: &str = r#"rasswd 0.1.0
<NAME> <<EMAIL>>
A fast and simple password generator
USAGE:
rasswd [LETTERS] [PASSWORD_LENGTH]
FLAGS:
-h, --help Prints help information
LETTERS:
l Lowercase letters
L Uppercase letters
p punctuations
d digits
EXAMPLES:
rasswd ... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pwn import *
host = "10.211.55.19"
port = 8888
host = "ast-alloc.chal.ctf.westerns.tokyo"
port = 10001
context.arch = "amd64"
r = remote(host,port)
def malloc(size,data):
r.recvuntil("choice:")
r.sendline("1")
r.recvuntil(":")
r.sendline(str(size... | Python | 1 |
attribute
pub fn log<K: ToString, V: ToString>(key: K, value: V) -> LogAttribute {
LogAttribute {
key: key.to_string(),
value: value.to_string(),
}
}
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InitResponse<T = Empty>
where
T: Clone + fmt::Debug + Parti... | Rust | 0 |
ageValue<T>>::key()
}
fn exists() -> bool {
U::exists(&RuntimeStorage)
}
fn get() -> Self::Query {
U::get(&RuntimeStorage)
}
fn put<Arg: Borrow<T>>(val: Arg) {
U::put(val.borrow(), &RuntimeStorage)
}
fn mutate<R, F: FnOnce(&mut Self::Query) -> R>(f: F) -> R {
U::mutate(f, &RuntimeStorage)
}
fn kill() ... | Rust | 0 |
ve across GC call to"
"</label>\n"
"<div class='accorntent'>\n"
).format(
**quoted_dict(result),
symbol_url=sourcelink(symbol=result["mangled"]),
cfgid=cfgid,
),
file=html,... | Python | 1 |
# Copyright (c) 2025 Kodo Robotics
#
# 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 wri... | Python | 1 |
ption as e:
# ff.dismiss()
try:
ff.find_element_by_xpath('//*[@id="onesignal-popover-cancel-button"]').click()
except:
pass
# print('FAILED')
try:
ff.find_element_by_xpath('/html/body/div[21]/div/div/div/div/div/div/div/div[1]/div/div/div/div/div/div[4]/div/div').click()
except:
... | Python | 1 |
let func = self.find_fn(fn_name).unwrap();
func.find_tag(name)
} else {
None
}
}
pub fn find_gtag(&self, name: &str) -> Option<CType> {
find_tag(&self.tags, name)
}
pub fn set_val(&mut self, name: &str, val: Vec<Node>) -> Result<(), &str> {
if le... | Rust | 0 |
x02B\x1f\xa0{k\x04\x81\xf0\xbf\xc7#\x85\
@\xe0\x03pd\xe9`\xb0\xe7\x0f\x00\x01,Y\x00\x84\
?\x00\x04\xb1T\x01\x10\xfe\x00\x10\xc8\x12\x05@\xf8\x03\
@0s\x17\x00\xe1\x0f\x00\x01\xcdY\x00\x84?\x00\x04\
5W\x01\x10\xfe\x00\x10\xd8\x1c\x05@\xf8\x03@p\xad\
\x0b\x80\xf0\x07\x80\x04Z\x16\x00\xe1\x0f\x00I\xb4*\x00\
\xc2\x1f\x00\x1... | Python | 1 |
args=cur_args,
embedding_dim=50)
if y_pred is None:
logger.warning("未获得{}的预测结果".format(sub_name))
continue
probabilities = torch.sigmoid(y_pr... | Python | 1 |
(<music21.pitch.Pitch E5>,)
>>> pChord.pitches = [60]
>>> pChord.pitches
(<music21.pitch.Pitch C4>,)
Notice that setting pitches has now just cleared any existing notes, pitched or unpitched:
>>> pChord.notes
(<music21.note.Note C>,)
'''
pitches... | Python | 1 |
# cogs/utility.py
import discord
import time
from discord.ext import commands
from discord import app_commands
class UtilityCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name="ping", description="Check bot latency.")
async def ping(self, interaction: discord.Inte... | Python | 1 |
}
}
fn set_link(&mut self, path: &PathBuf) {
unsafe {
let c_str = CString::new(path.to_str().unwrap()).unwrap();
ffi::archive_entry_set_link(self.entry(), c_str.as_ptr());
}
}
fn set_mode(&mut self, m: mode_t) {
unsafe { ffi::archive_entry_set_mo... | Rust | 0 |
{
t[table[idx] as usize] = idx as u8;
}
t
}
},
}
}
fn process(&mut self, data: &[u8], out: &mut Vec<u8>) -> CipherResult<()> {
out.reserve(data.len());
for d in data.iter() {
out.pus... | Rust | 0 |
'⮁', '꤂',
'ꯝ', 'ﱩ', '𐧦', '℥', '勉', '𝦤', '\u{1b6d}', '𐠕', '𛀢', '𖠶', '璘',
'𒂖', '𝘣', '𞠃', '𛃘', 'Ⳇ', '㋖', '寳', '𖤎', '𛈋', '𛀰', 'ꚧ',
'𓆒', 'ᒹ', 'ẟ', '⾇', '\u{ab67}', 'ﵮ', 'ⅴ', 'い', '⮪', '北', 'ᾞ', 'ᯥ',
'\u{119cb}', '\u{114b3}', 'ﱧ', 'ᾋ', '߉', 'Խ', '𐲟', '෫', 'ꛬ', '𒈆', 'ਏ',
'∼', 'ꅺ', 'ꡫ', '㎂',... | Rust | 0 |
;
pub struct UBasicRoom {
my_key: userKey,
user_key: std::collections::HashMap<bytes::Bytes, userKey>,
nick_key: std::collections::HashMap<String, bytes::Bytes>,
cmd_tx: Option<tokio::sync::mpsc::UnboundedSender<RoomControlCommand>>,
}
#[async_trait]
impl UChatRoom for UBasicRoom {
fn on_create(&mut self, cmd_tx... | Rust | 0 |
def job_scheduling(jobs):
jobs.sort(key=lambda x: x[2], reverse=True)
max_deadline = max(job[1] for job in jobs)
dp = [0] * (max_deadline + 1)
for job in jobs:
job_id, deadline, profit = job
for i in range(deadline, 0, -1):
dp[i] = max(dp[i], dp[i-1])
dp[i] = ma... | Python | 1 |
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const D3DCLIPSTATUS_STATUS: i32 = 1i32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const D3DCLIP_BACK: i32 = 32i32;
#[doc = "*Required features: 'Win32_System_SystemServices'*"]
pub const D3DCLIP_BOTTOM: i32 = 8i32;
#[doc = "*Requi... | Rust | 0 |
}
}
clean::Type::Tuple(tys) => {
work.extend(tys.into_iter());
}
clean::Type::Slice(ty) => {
work.push_back(*ty);
}
clean::Type::Array(ty, _) => {
work.push_back(*ty);
}
c... | Rust | 0 |
2, args, varargs1)
}
}
(FunType(rt1, args1, varargs1), FunTypeIncomplete(rt2)) => {
doFunType(rt1, rt2, args1, varargs1)
}
(FunTypeIncomplete(rt1), FunType(rt2, args2, varargs2)) => {
doFunType(rt... | Rust | 0 |
&Bytes::from_str(&self.text, self.encoding));
}
}
}
impl_serialize!(TextChunk);
impl_user_data!(TextChunk<'_>);
impl Debug for TextChunk<'_> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
f.debug_struct("TextChunk")
.field("text", &self.as_str())
.field("last_... | Rust | 0 |
ices[j]).abs2() as f64).sqrt();
dist[j][i] = dist[i][j];
}
for k in 0..n {
for i in 0..n {
for j in 0..n {
let tmp = dist[i][k] + dist[k][j];
dist[i][j].setmin(tmp);
}
}
}
let mut order = vec![];
let mut used = vec![false; n];
let mut parent = vec![!0; n];
let mut last = vec![true; n];
for _... | Rust | 0 |
import requests
from django.core.exceptions import ValidationError
from django.utils.translation import gettext_lazy as _
def validate_isin(isin):
response = requests.get(f"https://www.cdcp.cz/isbpublicjson/api/VydaneISINy?isin={isin}", timeout=5)
if response.status_code != 200 or not response.json().get("vyd... | Python | 1 |
block(l_conf.peer_id, AtHeight::At(height))
.unwrap_or_else(|e| {
status_err!("could not retrieve trusted header: {}", e);
std::process::exit(1);
});
let predicates = ProdPredicates;
let hasher = ProdHasher;
if let Err(err) = predicates.validator_sets_match(&trusted_... | Rust | 0 |
,
merge_mode: Some(MergeMode::Zero),
sae: false,
mask: Some(MaskReg::K1),
broadcast: Some(BroadcastMode::Broadcast1To8),
},
&[98, 226, 157, 209, 188, 2],
OperandSize::Qword,
)
}
<gh_stars>1-10
use crate::{
biginteger::BigInteger768 as BigIn... | Rust | 0 |
n zelzal.text:
aa = zilzal.replace(".apk filesize is above 50MB so you can download only using link", "**- حجم التطبيق اكبر من 50MB ؟!\n- قم بتحميل التطبيق عبـر البوت\n- ادخل للبوت @uploadbot وارسل الرابـط بالاسفـل**\n\n")
zz = aa.replace(" if you still want it as file copy th... | Python | 1 |
}
}
//! Plugin (SIP003)
//!
//! ```plain
//! +------------+ +---------------------------+
//! | SS Client +-- Local Loopback --+ Plugin Client (Tunnel) +--+
//! +------------+ +---------------------------+ |
//! ... | Rust | 0 |
try:
from importlib.metadata import version
from importlib.metadata import PackageNotFoundError
except ModuleNotFoundError:
# Try backported to PY<38 `importlib_metadata`.
from importlib_metadata import version
from importlib_metadata import PackageNotFoundError
import rdkit
import packaging.versi... | Python | 1 |
(id, todo) }),
],
div![
C![
C.flex,
C.flex_row,
C.font_display,
C.p_5,
C.text_light_3,
C.text_sm
],
div![C![C.flex_auto], format!("{} items left", todos.len())],
... | Rust | 0 |
use
//! privileged system registers from userspace to check CPU feature support.
//!
//! AArch64 system registers ID_AA64ISAR0_EL1, ID_AA64PFR0_EL1, ID_AA64ISAR1_EL1
//! have bits dedicated to features like AdvSIMD, CRC32, AES, atomics (LSE), etc.
//! Each part of the register indicates the level of support for a cert... | Rust | 0 |
from enum import Enum
from sqlalchemy import Column, String, Enum as SQLEnum, Integer
from sqlalchemy.orm import relationship
from core.db_models.BaseSQLModel import BaseSQLModel
class VectorDBType(Enum):
OPENSEARCH = 'OPENSEARCH'
MILVUS = 'MILVUS'
class VectorDBModel(BaseSQLModel):
"""
SQLAlchemy... | Python | 1 |
# Functions for extracting Mel and MFCC information from a raw Wave file
# T = time step, F = frame (every ~100 timesteps or so)
# Waveform: shape(T), values (limited range integers)
# MFCC + d + a: shape(F, 13 * 3 see figure 1)
# Output of Layer 1 Conv: shape(F, 39, 768)
# From paper:
# 80 log-mel filterbank feature... | Python | 1 |
THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
//... | Rust | 0 |
def main():
P = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_.'
while True:
a = input().split()
k = int(a[0])
if k ==0 :
break
s = list(a[1])
for i in range(len(s)):
s[i] = P[(P.find(s[i])+k)%28]
print(''.join(s)[::-1])
if __name__ =="__main__":
main() | Python | 1 |
y;
}
self.current_x = x;
self.current_y = y;
polygon.p.push(SvgPoint { x, y, marker: false });
},
... | Rust | 0 |
,
(
&[
Token::Symbol(Symbol::Underscore),
Token::Whitespaces,
Token::Identifier(Identifier {
kind: IdentifierKind::Bare,
name: String::from("abc"),
}),
... | Rust | 0 |
16).try_into().unwrap();
let port = x_port_field ^ magic_cookie_upper_16;
family_field &= 0b_0000_0000_1111_1111;
let address = match family_field {
0x_01 => {
// TODO: assert that remainder is &[]
let (x_address_field, _remainder) = x_address_field.split_at(4);
... | Rust | 0 |
key.starts_with(prefix) {
if short_key == prefix {
return PrefixSearchResult::Match(&verb);
}
found_index = index;
nb_found += 1;
continue;
}
}
if verb.long... | Rust | 0 |
serving_method(self, images, **kwargs):
"""
Run as a service.
"""
images_decode = copy.deepcopy(images)
for image in images_decode:
image['content'] = base64_to_cv2(image['content'])
image['style'] = base64_to_cv2(image['style'])
results = self.st... | Python | 1 |
.as_str() ).expect( &format!( "Env variable {} does't exist.", env_name.as_str() ) )
}
}
val
}
#[derive( Debug, serde::Deserialize )]
#[serde(untagged)]
enum Field<T>
{
EnvLike( String ),
Raw( T ),
}
impl <T : std::fmt::Debug + Serialize> serde::Serialize for Field<T>
{
fn serialize<S>( &self, s : S ) -... | Rust | 0 |
from typing import ClassVar
from .....core.utils.types import Compatibility, Contract
from ...__utils__.mixins.openrouter_text_to_text.interface import UniversalModelMixin
from ...__utils__.mixins.openrouter_text_to_text.meta import generate_standard_compatibility, generate_standard_contract
from ...__utils__.mixins.o... | Python | 1 |
el((batch, len(batch)))
else:
test_output, test_loss, test_acc = model(batch)
test_outputs.append(test_output)
test_output = np.concatenate(test_outputs)
if args.multi_label:
if not isinstance(test_output, np.ndarray):
test_output = test_output.nu... | Python | 1 |
import time
from custom_logging import log
import telebot
from project_path import ProjectPath as pp
import json
"""def say( s ):
print(s)"""
def wait( formated_time ):
wait_h, wait_m = tuple( map( int, formated_time.split(':') ) )
t = time.localtime(time.time())
while not t.tm_hour *100 + t.tm_min... | Python | 1 |
section_1_pointer, &mut section_1_size, &mut section_2_pointer, &mut section_2_size, 0)) {
let mut write_sample: *mut i16 = section_1_pointer as *mut i16;
let mut read_sample: *mut i16 = sound_buffer.memory as *mut i16;
for _ in 0..section_1_size/(sound_output.sound_buffer_bytes_per_sample a... | Rust | 0 |
import polars as pl
import pandas as pd
import pytest
from datetime import datetime, timedelta, timezone
from lumibot.entities.bars import Bars
from lumibot.entities.asset import Asset
from lumibot.constants import LUMIBOT_DEFAULT_PYTZ
def _make_minute_df(start_epoch: int, minutes: int = 12):
rows = []
for i... | Python | 1 |
will be converted into a JSON response
// with a status code of `201 Created`
(StatusCode::CREATED, Json(user))
}
// the input to our `create_user` handler
#[derive(Deserialize)]
struct CreateUser {
username: String,
}
// the output to our `create_user` handler
#[derive(Serialize)]
struct User {
id: u... | Rust | 0 |
loat))
languages = parameters.get('languages', [])
language_types = {'none', 'conversational', 'professional', 'native or bilingual'}
for language in languages:
assert languages[language].lower() in language_types
experience = parameters.get('experience', [])
for tech in experience:
... | Python | 1 |
ult()
}
}
}
/// A distributed algorithm that defines a message flow.
pub trait DistAlgorithm: Send + Sync {
/// Unique node identifier.
type NodeId: NodeIdT;
/// The input provided by the user.
type Input;
/// The output type. Some algorithms return an output exactly once, others return... | Rust | 0 |
#!/usr/bin/env python3
#
# Randomly initialize a tiny model and its quantized version
# Then it can be trained in example_train_tiny.py
import torch
from transformers import AutoTokenizer, BitsAndBytesConfig, Qwen3MoeConfig
from qwen3_moe_fused.modular_qwen3_moe_fused import Qwen3MoeFusedForCausalLM
from qwen3_moe_fu... | Python | 1 |
T_URI_SINK,
URIType::Src => gst_sys::GST_URI_SRC,
URIType::__Unknown(value) => value,
}
}
}
#[doc(hidden)]
impl FromGlib<gst_sys::GstURIType> for URIType {
fn from_glib(value: gst_sys::GstURIType) -> Self {
skip_assert_initialized!();
match value {
0 ... | Rust | 0 |
# Copyright 2010 New Relic, 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 to in writ... | Python | 1 |
Value describes the value contained in a `PropPayload`
#[derive(Debug, PartialEq, Clone)]
pub enum PropValue {
Bool(bool),
U8(u8),
U16(u16),
U32(u32),
U64(u64),
U128(u128),
Usize(usize),
I8(i8),
I16(i16),
I32(i32),
I64(i64),
I128(i128),
Isize(isize),
F64(f64),
... | Rust | 0 |
<Bearer>,
Authorization<String>,
CacheControl,
Cookie,
Connection,
ContentEncoding,
ContentLanguage,
ContentLength,
ContentType,
Date,
ETag,
Expect,
Expires,
From,
Host,
IfMatch,
IfModifiedSin... | Rust | 0 |
if weight_sum > 0 else None
else:
final_price_target = None
# 5. 止损价格融合
stop_losses = [d.stop_loss for d in decisions if d.stop_loss is not None]
if stop_losses:
weighted_sl_sum = 0.0
weight_sum = 0.0
... | Python | 1 |
transform_swaps_handedness: object_to_world.swaps_handedness(),
// Cylinder
radius,
z_min: z_min.min(z_max),
z_max: z_min.max(z_max),
phi_max: radians(clamp_t(phi_max, 0.0, 360.0)),
material: None,
}
}
// Shape
pub fn object_b... | Rust | 0 |
"""Test cases for ``revealjs-break`` directive."""
from __future__ import annotations
from typing import TYPE_CHECKING
import pytest
from testutils import soup_html
if TYPE_CHECKING:
from sphinx.testing.util import SphinxTestApp
@pytest.mark.sphinx("revealjs", testroot="default")
def test_on_revealjs_builder(... | Python | 1 |
:>{pad}} {self.tot_timesteps}\n"""
f"""{'Iteration time:':>{pad}} {iteration_time:.4f}s\n"""
f"""{'Total time:':>{pad}} {self.tot_time:.4f}s\n"""
f"""{'ETA:':>{pad}} {self.tot_time / (locs['it'] + 1) * (
locs['num_learning_iterations'] - locs['it']):.1f... | Python | 1 |
`,so if you defined your own enum with
/// // a `Some(T)` variant,you could also use the operator with that enum.
/// assert_eq!( foo.field_mut(fp!( ooo? )), Some(&mut (66,99)) );
/// assert_eq!( foo.field_mut(fp!( ooo?.0 )), Some(&mut 66) );
/// assert_eq!( foo.field_mut(fp!( ooo?.1 )), Some(&mut 99) )... | Rust | 0 |
"{}", result)
}
}
impl PolymerBuilder {
pub fn from_input(lines: &[String]) -> Self {
let mut pair_insertion = HashMap::new();
for l in lines.iter().skip(2) {
let x: Vec<&str> = l.split(" -> ").collect();
pair_insertion.insert(x[0].to_string(), x[1].chars().next().unwra... | Rust | 0 |
9nYBNywahnt5kIeuT1rTvTsMBZWvmUoEVUj1Xg8XXQkBvb9Ozy
Gqy/G/p8KDDpzMP/U+XCnUeHiXTZrgnqgBIc2cKeCVvWFqDi0GRFGzyaXLaX3PPm
M7DJ0MIPL1qgmcDq6+7Ze0gJ9SrDYFAeLmbuT1OqDfufXWQl/82JXeiwU2cOpqWq
7n5fvPOWim7l1tzQ+dSiMRRm0xa6uNexCJww3oJSwvMbAmgzvOhqqhlqv+K7u0u7
FrFFojESsL36Gq4GBrISnvu2tk7u4GGNTYYQbQIDAQABAoIBAADrqWDQnd5DVZEA
lR+WINiWu... | Python | 1 |
}
/// Saves image to download directory.
fn save_image(&self, file_path: &str, bytes: &[u8]) {
write(file_path, bytes)
.with_context(|e| {
error!("Failed to save image!");
trace!("A downloaded image was unable to be saved...");
format!("{}... | Rust | 0 |
from .logger import logger
TEXT_FUNC_ENABLE = True
try:
import numpy as np
import jieba
except:
TEXT_FUNC_ENABLE = False
logger.warning("无法导入 numpy 或 jieba 库,无法使用记忆增强功能")
def compare_text(text1: str, text2: str) -> float:
if not TEXT_FUNC_ENABLE:
return 0
long_text = text1 if len(tex... | Python | 1 |
onstraint()) }
}
// TODO reindexing
//pub fn reindex_shape<S: Shape>(&mut self, shape: S) {
// unsafe { cpSpaceReindexShape(self.ptr, shape.to_shape()); }
//}
//pub fn reindex_shapes_for_body(&mut self, body: Body) {
// unsafe { cpSpaceReindexShapesForBody(self.ptr, body.ptr); }
/... | Rust | 0 |
from src.widgets.slider import Slider
class UI:
def __init__(self, app) -> None:
self.app = app
# Create radius slider.
self.radius_slider = Slider(
x=20,
y=20,
width=200,
min_val=100,
max_val=400,
start_val=250,
... | Python | 1 |
case_function_output_by_nullable_reference() {
let input = Span::new(b"function &f(): ?int {}");
let output = Ok((
Span::new_at(b"", 22, 1, 23),
Statement::Function(
Function {
name : Span::new_at(b"f", 10, 1, 11),
inputs... | Rust | 0 |
/ MSK (minimum shift keying) generic packet type.
Msk = 3,
}
impl PacketType {
/// Create a new `PacketType` from bits.
///
/// # Example
///
/// ```
/// use stm32wl_hal::subghz::PacketType;
///
/// assert_eq!(PacketType::from_raw(0), Ok(PacketType::Fsk));
/// assert_eq!(PacketT... | Rust | 0 |
instance.
pub fn new() -> Self {
Self::default()
}
fn decode_item(b: [u8; 8]) -> i64 {
BigEndian::read_i64(&b)
}
}
impl_decode!(I64beDecoder, i64);
/// Decoder which decodes `i64` values by little-endian byte order.
///
/// # Examples
///
/// ```
/// use bytecodec::Decode;
/// use byt... | Rust | 0 |
ry:
image_list = get_image_list(args.classes, class_map, annotations)
if args.max_images is not None:
np.random.seed(args.seed)
selected_index = np.random.choice(
len(image_list), size=args.max_images)
image_list = [image_list[i] for i in selected_inde... | Python | 1 |
]["data"])
big_df = pd.concat(objs=[big_df, temp_df], ignore_index=True)
big_df.reset_index(inplace=True)
big_df["index"] = range(1, len(big_df) + 1)
big_df.columns = [
"序号",
"股票代码",
"股票简称",
"_",
"_",
"首次预约时间",
"一次变更日期",
"二次变更日期",
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.