text string | label_name string | labels int64 |
|---|---|---|
"""
Python initialization entrypoint. This is always run when any part of the app is imported.
It should run all configuration which requires any state (services, ENV, etc) so we get an immediate failure on startup.
This ensures that a deploy does not go out which fails *after* the health probes succeed.
"""
from pat... | Python | 1 |
return pub_ver, local_ver
# Implementations
def update(file_name, pattern, repl, dry_run=False):
update = []
hit_counter = 0
need_update = False
with open(file_name) as file:
for l in file:
result = re.findall(pattern, l)
if result:
assert len(result)... | Python | 1 |
': 0,
'min_th0': 0,
'min_th1': 0,
'min_th2': 0,
'portsmin': 0,
'portstend': 2688,
'priority': 0,
'qenable': 'en',
'schedule_mode': 'shared',
'shaping_step': 0,
'sharpedwe... | Python | 1 |
class LatentFormat:
scale_factor = 1.0
latent_rgb_factors = None
taesd_decoder_name = None
def process_in(self, latent):
return latent * self.scale_factor
def process_out(self, latent):
return latent / self.scale_factor
class SD15(LatentFormat):
def __init__(self, scale_facto... | Python | 1 |
".8bit." in f.name or ".8bit-" in f.name}
other_files = set(all_files) - fp16_files - bit8_files
if not variant: # ModelRepoVariant.DEFAULT evaluates to empty string for compatability with HF
files = other_files
elif variant == "fp16":
files = fp16_files
elif variant == "8bit":
... | Python | 1 |
d == '(' || d == '{').collect();
assert!(cons.len() > 0 && cons[0] != "");
cons[0].to_string()
}
// First return value is text; second return value is a CSS class
pub fn html_of_effect(eff: &Effect) -> (String, String) {
match *eff {
Effect::TimeBegin(ref msg) => {
(msg.clone(),
... | Rust | 0 |
# -*- coding: utf-8 -*-
''' Test simplified dynamic analysis of a single span rail bridge.'''
from __future__ import print_function
__author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AOO)"
__copyright__= "Copyright 2015, LCPT and AOO"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
impor... | Python | 1 |
from selenium.webdriver.common.by import By
class BasePageLocators():
LOGIN_LINK = (By.CSS_SELECTOR, "#login_link")
LOGIN_LINK_INVALID = (By.CSS_SELECTOR, "#login_link_inc")
BASKET_LINK = (By.XPATH, "//a[text()='Посмотреть корзину']")
USER_ICON = (By.CSS_SELECTOR, ".icon-user")
class LoginPageLocato... | Python | 1 |
'.jpeg', '.jpg', '.lpcm', '.m4a', '.m4v', '.mkv', '.mlp', '.mmf',
'.mov', '.mp2', '.mp3', '.mp4', '.mpc', '.mpeg', '.mpg', '.oga', '.ogg', '.ogv', '.opus', '.png', '.rm',
'.rmvb', '.rtsp', '.sbc', '.spx', '.svcd', '.swf', '.tak', '.thd', '.tta', '.vc1', '.vcd', '.vid', '.vob',
'.wav'... | Python | 1 |
import math
import numpy as np
import torch
from tensorized_filters.utils.logger import logger
from tensorized_filters.utils.hankel import get_hankel
def get_spectral_filters(
seq_len: int,
K: int,
use_hankel_L: bool = False,
device: torch.device = None,
dtype: torch.dtype = torch.bfloat16,
)... | Python | 1 |
import azure.ai.vision as visionsdk
import streamlit as st
from streamlit_lottie import st_lottie , st_lottie_spinner
import json
# Azure Vision API credentials
key = "a85b1db65bb24616ba084b707f1a1ddf"
endpoint = "https://shreyaobj.cognitiveservices.azure.com/"
import io
def load_lottiefile(file_path):
with io.ope... | Python | 1 |
# inherited by CreatureFiller
import csv, os
class CreatureLoader:
beastiary = None
@classmethod
def load_beastiary(cls, path):
"""
beastiary is the Monster Manual, minus the copyrighted creatures.
`load_beastiary(path)` (formerly just `_beastiary`) is a function while beastiary... | Python | 1 |
_score(y_test_3class_cv, y_pred_cv)
cv_scores.append(score)
logger.info(f" Fold {fold+1}: {score:.1%}")
if len(cv_scores) < 3:
logger.warning("⚠️ Insufficient CV folds completed")
return False
cv_mean = np.mean(cv_scores)
cv_std = np.std(cv_scores)
... | Python | 1 |
process),
app_flash_size,
memory_padding_size + memory_size,
);
}
(None, 0, 0)
}
#[allow(clippy::cast_ptr_alignment)]
fn sp(&self) -> *const usize {
self.current_stack_pointer.get() as *const usize
}
/// Checks if the buffer repre... | Rust | 0 |
from sklearn.metrics import roc_auc_score, average_precision_score
def auc_roc(y_true, y_pred):
""" Compute the area under the ROC curve
Parameters
----------
y_true: array
true scores
y_pred: array
target scores
Returns
-------
float
the area under the ROC cu... | Python | 1 |
import math
import numpy as np
import unittest
from numba import njit
from numba.extending import register_jitable
from numba.tests.support import TestCase
RISKFREE = 0.02
VOLATILITY = 0.30
A1 = 0.31938153
A2 = -0.356563782
A3 = 1.781477937
A4 = -1.821255978
A5 = 1.330274429
RSQRT2PI = 0.3989422804014326779399460... | Python | 1 |
#[test]
fn test_update() {
let mut meaning_of_life: Pack<i32> = Pack::load_or_init(
PathBuf::from("data/pack_test"),
"meaning_of_life_update",
)
.unwrap();
*(meaning_of_life.as_mut()) = 17;
&mut meaning_of_life.update(|i| *i = 42);
assert_eq!(*(meaning_of_life), 42);
}
#[test]
... | Rust | 0 |
ata: &mut EngineDataT, tick: u64);
fn think(&mut self, engine_data: &mut EngineDataT, tick: u64) -> Option<SceneChangeEvent<SceneChangeParamsT>>;
}
#[derive(Debug, Copy, Clone)]
pub enum SceneChangeEvent<T> {
PushScene(T),
SwapScene(T),
PopScene,
}
pub struct SceneStack<'a, EventT, SceneChangeParamsT,... | Rust | 0 |
aardering in waarderingen:
gedeeld_met_onz = ruimte.gedeeld_met_aantal_onzelfstandige_woonruimten or 1
gedeeld_met_counter[gedeeld_met_onz][
woningwaardering.criterium.bovenliggende_criterium.id
if woningwaardering.criterium
and woningwaardering.cr... | Python | 1 |
Exports the X509 certificate into a PEM object
pub fn to_pem(&self) -> DiplomatResult<Box<Pem>, Box<PickyError>> {
let pem = err_check!(self.0.to_pem());
Ok(Box::new(Pem(pem))).into()
}
pub fn get_ty(&self) -> CertType {
self.0.ty().into()
}
... | Rust | 0 |
:signer_account_id(), "Signer must be an owner");
let tokens_to_print: u128 = amount.into();
self.token.internal_deposit(&self.owner_id, tokens_to_print);
log!("{} tokens were printed and deposited to owner's account", tokens_to_print);
}
/// Set a new exchange price for FT token
pu... | Rust | 0 |
_bindgen_union_align: [u32; 32usize],
}
extern "C" {
#[link_name = "\u{1}_res_9_ninit"]
pub fn res_9_ninit(arg1: res_9_state) -> ::std::os::raw::c_int;
}
extern "C" {
#[link_name = "\u{1}_res_9_getservers"]
pub fn res_9_getservers(
arg1: res_9_state,
arg2: *mut res_9_sockaddr_union,
... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
class DeleteTableColumnsRequest(object):
_types = {
"column_start_index": int,
"column_end_index": int,
}
def __init__(self, d=None):
... | Python | 1 |
# Write a program to find out whether a student has passed or failed if it requires a
# total of 40% and at least 33% in each subject to pass. Assume 3 subjects and
# take marks as an input from the user.
a1 = int(input("enter the marks1 of the student: "))
a2 = int(input("enter the marks2 of the student: "))
a3 = int... | Python | 1 |
-15, [1.7, -0.5, 1.2])
q_meas, v_meas = device.measureState()
x_measured = np.concatenate([q_meas, v_meas])
Tmpc = len(contact_phases)
nk = 2
force_size = 6
device.showTargetToTrack(
mpc.getDataHandler().getFootPose("left_sole_link"),
mpc.getDataHandler().getFootPose("right_sole_link"),
)
v = np.zeros(6)
v... | Python | 1 |
{},{}", rd, frs1, frs2),
FclassS(r"fclass\.s\s+{},{}", rd, frs1),
FcvtSW(r"fcvt\.s\.w\s+{},{}{}", frd, rs1, rm),
FcvtSWu(r"fcvt\.s\.wu\s+{},{}{}", frd, rs1, rm),
FmvWX(r"fmv\.w\.x\s+{},{}", frd, rs1),
// RV64F
FcvtLS(r"fcvt\.l\.s\s+{},{}{}", rd, frs1, rm),
FcvtLuS(r"fcvt\.lu\.s\s+{},{}{}", ... | Rust | 0 |
_options_props(value: &str) -> Result<OptionsProps, String> {
let value = value.trim();
match TO_OPTIONS_PROPS_HASH.get(value) {
Some(options_props) => Ok(*options_props),
None => Err(format!("Invalid OptionsProps value: {}", value)),
}
}
#[cfg(any(feature = "gas", feature = "intel", feature = "masm", feature =... | Rust | 0 |
{ UPDATE }),
value(UserPrivilegeType::Delete, rule! { DELETE }),
value(UserPrivilegeType::Create, rule! { CREATE }),
value(UserPrivilegeType::Drop, rule! { DROP }),
value(UserPrivilegeType::Alter, rule! { ALTER }),
value(UserPrivilegeType::Super, rule! { SUPER }),
value(U... | Rust | 0 |
break
except:
logger.error(f"[LOTS COPY] Не удалось получить данные о лоте {i.id}.")
logger.debug("TRACEBACK", exc_info=True)
time.sleep(2)
attempts -= 1
else:
bot.send_message(tg_msg.chat.id... | Python | 1 |
import os
import unittest
import random
import string
from django.conf import settings
from challenges.utils import get_file_content
from base.utils import get_queue_name
class BaseTestCase(unittest.TestCase):
def setUp(self):
self.test_file_path = os.path.join(
settings.BASE_DIR, "examples"... | Python | 1 |
import os
from dotenv import load_dotenv
from langchain_openai import OpenAIEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_community.document_loaders import TextLoader
# ======================
# 1. Konfiguratsiya
# ======================
load_dotenv()
DATA_FILES = [
"data/courses.tx... | Python | 1 |
for number in numbers {
boards.iter_mut().for_each(|b| b.mark(number));
if let Some(winner) = boards.iter().find(|b| b.is_winner()) {
let unmarked_sum = winner
.unmarked_numbers()
.iter()
.map(|n| *n as u32)
.reduce(|a, b| a... | Rust | 0 |
#!/usr/bin/python3 -u
import zlib
from random import randint
import os
from Crypto.Cipher import Salsa20
flag = open("./flag").read()
def compress(text):
return zlib.compress(bytes(text.encode("utf-8")))
def encrypt(plaintext):
secret = os.urandom(32)
cipher = Salsa20.new(key=secret)
return cipher.... | Python | 1 |
#Ejercicio 8: Factorial de un numero positivo
#Hacer un programa para calcular el factorial de un numero positivo
while True: #Comprueba que se seleccione correctamente el numero, simula un ciclo do-while
num = int(input('Ingresa el numero positivo para calcular su factorial:'))
if num >= 0:
break ... | Python | 1 |
ram3, log_likelihood)) )
loc, sc = estimate_laplace_params(col)
p = DistributionParams(DistributionType.LAPLACE, loc, sc, 0.0, 0.0)
log_likelihood = column_loglik(col, p)
candidates.append( (aic(log_likelihood, 2), DistributionParams(p.type, p.param1, p.param2, p.param3, log_likelihood))
best_aic,... | Python | 1 |
access_control::clock(clock_acc_info)?;
let registrar = access_control::registrar(registrar_acc_info, program_id)?;
let _reward_q = access_control::reward_event_q(
reward_event_q_acc_info,
registrar_acc_info,
®istrar,
program_id,
)?;
let pool_mint = access_control::mi... | Rust | 0 |
fault", &default_content, Vec::default());
// Create a CsmlBot
let bot = CsmlBot::new(
DEFAULT_ID_NAME,
DEFAULT_BOT_NAME,
None,
vec![default_flow],
DEFAULT_FLOW_NAME,
);
// Create an Event
let event = Event::default();
// Create context
let context ... | Rust | 0 |
output())?;
let output = String::from_utf8_lossy(&output.stdout);
Ok(output.contains("msvcp140_2.dll"))
}
pub fn restart_steamvr_with_timeout(alvr_dir: &Path) -> StrResult {
trace_err!(Command::new(alvr_dir.join(exec_fname("ALVR launcher")))
.arg("--restart-steamvr")
.status())?;
Ok((... | Rust | 0 |
# enquanto Verdadeiro
# se chão
# passo
#se buraco
# pula
#se moeda
# pega
#se troféu
# pula
# interrompa
#pega
while True:
if chão
passo
if buraco
pula
if moeda
pega
if troféu
pula
break
pega | Python | 1 |
DICT.get(base, ZERO_LIST) for base in read[start:end]]
encoded_read = [BASE_DICT.get(base, ZERO_LIST)
for base in read[:max_len]]
# elif read_len == max_len:
# encoded_read = [BASE_DICT.get(base, ZERO_LIST) for base in read]
else:
encoded_read = [ZERO_LIST] * max_... | Python | 1 |
ctions are not billable, where 0 = live mode, 1 = test
/// mode.
#[serde(
default,
skip_serializing_if = "default_ext::DefaultExt::is_default",
with = "crate::serde::i32_as_bool"
)]
pub test: bool,
/// integer; default 2
/// Auction type, where 1 = First Price, 2 = Secon... | Rust | 0 |
if slots.get("RegExpMatcher").is_some() {
// first argument is another `RegExp` object, so copy its pattern and flags
if let Some(body) = slots.get("OriginalSource") {
regex_body =
from_value(body.clone()).expect("Could not convert... | Rust | 0 |
# Copyright 2025 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 1 |
#!/usr/bin/fontforge -script
#
# Generates a small LSP symbol icons font using 'Symbols Nerd Font'
#
# Usage:
# fontforge -script generate-font.py
#
# References:
# https://www.nerdfonts.com/font-downloads
# https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.0/NerdFontsSymbolsOnly.zip
#
import fontforge
# ... | Python | 1 |
rm_lo.T
all_pmat = pred_world_to_cam_4x4_lo.reshape(B, lo_num, 4, 4)
all_pmat_num = all_pmat.shape[1]
# all
points3D_expand = (
points3D[:, None]
.expand(-1, all_pmat_num, -1, -1)
.reshape(B * all_pmat_num, P, 3)
)
points2D_expand = (
points2D[:, None]
.... | Python | 1 |
(
fontName=fn,
fontSize=fs,
backgroundColor=Color(1, 1, 0),
**makeBorder(1, "solid", Color(1, 0, 0))),
Word(
text="Lorem",
fontName=fn,
fontSize=fs),
BoxEnd(),
Space(
... | Python | 1 |
"""ISY utils."""
from __future__ import annotations
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.entity_registry as er
from .const import _LOGGER, DOMAIN
@callback
def _async_cleanup_registry_entries(hass: HomeAssistant, entry_id: str) -> None:
"""Remove extra entities tha... | Python | 1 |
inner = m.group(1)
add(inner)
if not inner.lstrip().startswith("{"):
# LLM 偶尔会漏掉开头的花括号,尝试补上
add("{" + inner + "}")
# 按花括号成对匹配提取
for obj in LLMSummariser._iter_balanced_json_objects(text):
add(obj)
return candidates
... | Python | 1 |
inciple']}, the linguistic aspect of {t['linguistic_aspect']}, and how they can be applied to the cognitive task of {t['cognitive_task']}.",
"The framework design is innovative, well-structured, and effectively integrates quantum and linguistic concepts.",
"The quantum-linguistic mapping is clea... | Python | 1 |
Self {
goal_id: status.goal_id,
status: status.state as u8,
text: status.text,
}
}
}
impl From<GoalStatusRaw> for GoalStatus {
fn from(status: GoalStatusRaw) -> Self {
Self {
goal_id: status.goal_id,
state: status.status.try_in... | Rust | 0 |
(flags.RESOURCERECORDSETS_FORMAT)
def Run(self, args):
api_version = util.GetApiFromTrackAndArgs(self.ReleaseTrack(), args)
messages = apis.GetMessagesModule('dns', api_version)
dns_client = util.GetApiClient(api_version)
zone_ref = util.GetRegistry(api_version).Parse(
args.zone,
p... | Python | 1 |
winner_dialog.exec()
if self.eth_checkbox.isChecked():
ethaddr = ice.privatekey_to_ETH_address(dec)
eth_keys.append(ethaddr)
if ethaddr in addfind or ethaddr[2:] in addfind:
found += 1
self.found_keys_scanne... | Python | 1 |
nType_WREN_TYPE_FOREIGN {
panic!("Rust method called with unknown receiver type.");
}
let vector3_ptr: *mut Vector3 = unsafe { bindings::wrenGetSlotForeign(vm, 0) as _ };
let vector3 = unsafe { vector3_ptr.as_mut().unwrap() };
println!("{:?}", vector3);
}
extern "C"... | Rust | 0 |
import os
import sys
PROJECT_ROOT = os.path.abspath(os.path.join(
os.path.dirname(__file__),
os.pardir)
)
sys.path.append(PROJECT_ROOT)
from RFEM.initModel import Model
from RFEM.initModel import GetModelParameters, GetModelMainParameters, GetModelId, GetName, GetLanguage, GetVersion
sys.path.append('..')
from... | Python | 1 |
0,T11,T12,T13>, _7, T7, V7 }
enum_variant!{ Enum14<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>, _8, T8, V8 }
enum_variant!{ Enum14<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>, _9, T9, V9 }
enum_variant!{ Enum14<T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13>, _10, T10, V10 }
enum_variant!{ Enum14<T0,T1,T2,T3,T4,T5... | Rust | 0 |
,E7,EZ]),(EPI2, [EU,SZ,HU,HZ]),(EPI2, [EK,S7,S9,E8]),(EPI2, [H8,H7,GK,H9]),],
[-150, 50, 50, 50],
);
// ../../testdata/games/solo/13-eichel-solo.html has wrong format
test_rules(
"../../testdata/games/solo/130-gras-solo.html",
sololike(EPlayerIndex::EPI0, EFarbe::Gras, ESoloLike::Sol... | Rust | 0 |
inal de prohibición de teléfonos móbiles",
"teléfono móbil",
],
},
#[cfg(feature = "gu")]
crate::Annotation {
lang: "gu",
tts: Some("કોઈ મોબાઇલ ફોન નહી\u{a82}"),
keywords: &[
"કૉલ\u{acd}સ નહી\u{a82}",
... | Rust | 0 |
.0*(2.0*sin(x-1.0/(sin(y*5.0)+(5.0-1.0/z))))))",
"x*0.2*5.0/4.0+x*2.0*4.0*1.0*1.0*1.0*1.0*1.0*1.0*1.0+7.0*sin(y)-z/sin(3.0/2.0/(1.0-x*4.0*1.0*1.0*1.0*1.0))",
];
const BENCH_EXPRESSIONS_REFS: [fn(f64, f64, f64) -> f64; N] = [
|x, y, z| x.sin() + y.sin() + z.sin(),
|x, y, z| x.powi(2) + y * y + z.powf(... | Rust | 0 |
'''You are given an array of strings tokens that represents an arithmetic expression in a Reverse Polish Notation.
Evaluate the expression. Return an integer that represents the value of the expression.
https://leetcode.com/problems/evaluate-reverse-polish-notation/description/'''
from typing import List
class Solu... | Python | 1 |
debt: debt_info.debt.clone(),
link_cost: exit_route.refmetric,
price_to_exit: exit_route.price,
stats: *stats_entry,
})
} else {
output.push(nonviable_node_info(
nickname,
neigh_route.metric,... | Rust | 0 |
.copy_from_slice(&buf[first_byte..first_byte + $len]);
Ok(HighZeroBytesDroppedVarInt(<$val_type>::from_be_bytes(bytes)))
} else {
// If the encoding had extra zero bytes, return a failure even though we know
// what they meant (as the TLV test vectors require this)
Err(DecodeError::InvalidValue)... | Rust | 0 |
ate(x, size=(features1.size(2), features1.size(3)), mode='bilinear', align_corners=True)
x = self.upconv2(x)
if self.attention:
x = x + features1 * att_up
else:
x += features1
segm_pred2 = torch.sigmoid(self.act(features2))
rbox2 = torch.sigmoid(self.rbox(features2)) * 128
... | Python | 1 |
# -*- encoding:utf-8 -*-
# __author__=='Gan'
# Write a program to find the n-th ugly number.
# Ugly numbers are positive numbers whose prime factors only include 2, 3, 5.
# For example, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12 is the sequence of the first 10 ugly numbers.
# Note that 1 is typically treated as an ugly number, a... | Python | 1 |
import matplotlib
matplotlib.use("Agg")
from pylab import *
import h5py
# Plot parameters
params = {
"axes.labelsize": 10,
"axes.titlesize": 10,
"font.size": 12,
"legend.fontsize": 12,
"xtick.labelsize": 10,
"ytick.labelsize": 10,
"text.usetex": True,
"figure.figsize": (3.15, 3.15),
... | Python | 1 |
min_ratio_diff_in_charge = np.inf
while REQUIRED_PRECISION * 100 < abs(min_ratio_diff_in_charge):
grid, min_ratio_diff_in_charge = update_grid(grid)
grid_list.append(grid.copy())
return grid_list
def animate_heat_diffusion(grid_list: list[np.ndarray], interval) -> None:
"""
Animate th... | Python | 1 |
ory_response.status_code == 200:
history_data = history_response.json()
message_count = len(history_data.get('messages', []))
print(f" ✅ Retrieved {message_count} messages from history")
else:
print(f" ❌ Failed to get history: {history_response.status_code}")
... | Python | 1 |
{
state: AtomicUsize::new(0),
}
}
}
pub mod result;
pub mod util;
pub mod ipc;
pub mod diag;use crate::context::UniformLocation;
use crate::core::*;
pub enum UniformType {
Value,
Vec2,
Vec3,
Vec4,
Mat2,
Mat3,
Mat4,
}
pub trait PrimitiveDataType: DataType + Copy + Default {
f... | Rust | 0 |
let unset =
r.synthetic() && r.osm_tags.get(osm::NAME) == Some(&"Streety McStreetFace".to_string());
let lanes_unknown = r.osm_tags.contains_key(osm::INFERRED_SIDEWALKS);
let spec = r.get_spec();
let center_pts = PolyLine::new(r.center_points.clone());
let mut obj = Object::... | Rust | 0 |
from_pretrained(
str(config.bert_name), use_fast=config.use_fast
)
def __call__(self, video_id):
caption = self.data[video_id]
if isinstance(caption, str):
import json
caption = json.loads(caption)
cap = []
for clip_idx, text_clip ... | Python | 1 |
return get_densenet(201, **kwargs)
def dilated_densenet121(dilate_scale, **kwargs):
return get_dilated_densenet(121, dilate_scale, **kwargs)
def dilated_densenet161(dilate_scale, **kwargs):
return get_dilated_densenet(161, dilate_scale, **kwargs)
def dilated_densenet169(dilate_scale, **kwargs):
return... | Python | 1 |
d_plural.into()).expect("`msgid_plural` contains an internal 0 byte");
unsafe {
CStr::from_ptr(ffi::dcngettext(
domainname.as_ptr(),
msgid.as_ptr(),
msgid_plural.as_ptr(),
n as c_ulong,
category as i32,
))
.to_str()
.expect(... | Rust | 0 |
let Some(ref p) = *RUST_SRC_PATH {
p
} else {
return;
};
let searchstr = if searchstr.ends_with("!") {
let len = searchstr.len();
&searchstr[..len - 1]
} else {
searchstr
};
for macro_file in &[
"libstd/macros.rs",
"libcore/macros.rs",
... | Rust | 0 |
Asset(s) (`assets`) have been destroyed on the `origin` system and equivalent assets should be
/// created on this system.
///
/// Some orders are given (`effects`) which should be executed once the corresponding derivative assets have
/// been placed into `holding`.
///
/// - `assets`: The asset(s) that are min... | Rust | 0 |
.borrow_mut().reserve(IMGUI_RESERVE);
});
imgui::Window::new(&imgui::im_str!("{}", label))
.bg_alpha(1.) // See comment on fn redraw_skia
.flags(imgui::WindowFlags::NO_RESIZE | imgui::WindowFlags::NO_COLLAPSE)
.position_pivot([0.5, 0.5])
... | Rust | 0 |
yle, DeriveInput, Ident};
#[proc_macro_derive(CaoStorage, attributes(cao_storage_table, cao_storage_iterby))]
pub fn derive_storage(input: TokenStream) -> TokenStream {
let input = parse_macro_input!(input as DeriveInput);
impl_storage(input)
}
#[derive(Debug)]
struct TableMeta {
/// type of the key/id
... | Rust | 0 |
use gl::{
self,
types::GLuint,
};
pub struct FrameBuffer {
frame_buffer: GLuint,
}
impl FrameBuffer {
pub fn new() -> Self {
let mut frame_buffer: GLuint = 0;
unsafe {
gl::GenFramebuffers(1, &mut frame_buffer);
}
FrameBuffer {
frame_buffer
... | Rust | 0 |
nse is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use std::sync::atomic::AtomicUsize;
use std::sync::atomic::Ordering;
use std::sync::Arc;
use comm... | Rust | 0 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing_extensions import Literal, TypedDict
__all__ = ["VectorStoreListParams"]
class VectorStoreListParams(TypedDict, total=False):
after: str
"""A cursor for use in pagination.
... | Python | 1 |
_REFRESH")
.parse::<u64>()
.unwrap()
* 60,
),
time_between_redis_calls: Duration::from_millis(
env_or_panic("MILLIS_BETWEEN_REDIS_CALLS")
.parse::<u64>()
.unwrap(),
),
... | Rust | 0 |
# Copyright 2020 Dragonchain, Inc.
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
# 6. Tr... | Python | 1 |
""""""
"""
Структура документа (навигатор):
Редактор Word
Вид --> Галка "Область навигации"
Редактор LibreOffice
Форма --> Панель навигации
Поиск:
Редактор LibreOffice
Правка --> Найти Ctrl + F
Правка --> Найти и заменить Ctrl + H
Шаблоны:
\n Новая строка
. Любой символ, кроме символа новой строки. Если... | Python | 1 |
"""This module contains the bot's updated text adventure command."""
# TODO: Fix PCGame script not being reloaded on bot reload
import crescent
from hikari import Message, MessageCreateEvent, GatewayBot
from hikari.snowflakes import Snowflake
from PCBot.PCGame import backend_ActionScreen, backend_GameState, backend_S... | Python | 1 |
();
for &elt in &insert {
map.insert(elt, ());
}
assert_eq!(map.keys().count(), map.len());
assert_eq!(map.keys().count(), insert.len());
for (a, b) in insert.iter().zip(map.keys()) {
assert_eq!(a, b);
}
for (i, k) in (0..insert.len()).zi... | Rust | 0 |
x31BD
@scena.Code('func_20_31BD')
def func_20_31BD():
If(
(
(Expr.PushValueByIndex, 0x4),
(Expr.PushLong, 0x8),
Expr.Equ,
Expr.Return,
),
'loc_320E',
)
FadeOut(300, 0, 100)
SetMessageWindowPos(-1, -1, -1, -1)
TalkSetChrName('')... | Python | 1 |
Formatter<'static> {
use CliFormat::*;
match format {
alternating => Formatter::AlternatingBullets,
asterisks => Formatter::AsteriskBullets,
dashes => Formatter::DashBullets,
numbers => Formatter::Numbers,
pluses => Formatter::PlusBullets,
... | Rust | 0 |
// 执行惩罚协议,获取订单剩余金额
let price = agreement.fault_excution();
// 获取质押
let mut staking = Staking::<T>::get(agreement.provider.clone()).unwrap();
staking.penalty_amount(price);
T::Currency::transfer(&Self::staking_pool(), &agre... | Rust | 0 |
from __future__ import print_function
import numpy
import pickle
class AutoEncoder:
def __init__(self, nvis, nhid, iscale=0.1,
activation_fn=numpy.tanh,
params=None):
self.nvis = nvis
self.nhid = nhid
self.activation_fn = activation_fn
if params is None:
... | Python | 1 |
ome(destination_arc_process) = process.upgrade() {
// `__lumen_builtin_receive_wait` will notice it has timed out, so only need to
// stop waiting
destination_arc_process
.scheduler()
.unwrap()
... | Rust | 0 |
0 {
return;
}
self.data_buffer.extend_from_slice(data);
if complete {
let bytes = if self.data_buffer[attribute.length - 1] != 0 {
&self.data_buffer
} else {
&self.data_buffer[0..(attribute.length - 1)]
};
... | Rust | 0 |
dy::PaymentReceived(payment) => Ok(vec![
JournalEntry(date, payment.account, Debit(payment.amount)),
JournalEntry(
date,
String::from("Accounts Receivable"),
Credit(payment.amount),
),
... | Rust | 0 |
i_0.saturating_add(i_npos_ideal.saturating_sub(i_0) * compute_inflation::<P>(
x,
x_ideal,
d
))
}
#[cfg(test)]
mod test {
use sp_arithmetic::{PerThing, Perbill, PerU16, Percent, Perquintill};
use super::*;
/// This test the precision and panics if error too big error.
///
/// error is asserted to be less... | Rust | 0 |
entry!");
}
const height = size.blockSize;
const width = size.inlineSize;
send_msg_resized(width, height);
});
resizeObserver.observe(element);
}
"#)]
extern "C" {
fn __wasm_rend3_framework_register_resize_observer_impl(element: &web_sys::Element, callback: &JsValue);
}
pub... | Rust | 0 |
()
.await
.context("failed to get streaming text completion")?;
let mut text_completions = Vec::new();
while let Some(text_completion) = text_completion_stream.next().await {
let text_completion = text_completion
.context("failed to connect to textsynth api for next text com... | Rust | 0 |
from __future__ import division, print_function
import numpy
import scipy
import scipy.signal
from transitleastsquares import transitleastsquares
def loadfile(filename):
data = numpy.genfromtxt(filename, delimiter=",", dtype="f8, f8", names=["t", "y"])
return data["t"], data["y"]
if __name__ == "__main__":
... | Python | 1 |
[1];
if let Some((look_low, look_high)) = self.look_for_comparision {
if low == look_low && high == look_high {
self.bot_comparing = Some(bot_nr);
}
}
self.value_to_target(low_target, low);
self.value_to_target(high_targ... | Rust | 0 |
write!(buf, "Newsgroups: {}\r\n", opts.group)?;
write!(buf, "Distribution: local\r\n")?;
write!(buf, "Message-Id: <{}>\r\n", msgid)?;
if opts.headfeed {
write!(buf, "Bytes: 17\r\n")?;
}
write!(buf, "Date: {}\r\n", util::UnixTime::now().to_rfc2822())?;
write!... | Rust | 0 |
lear previous state
self.vl_agent.reset()
response = self.vl_agent.step(msg)
if not response or not response.msgs:
logger.error("Model returned empty response")
return (
"Failed to generate an answer. "
"The mode... | Python | 1 |
while True:
s = input()
if s ==".": break
stack = []
for c in s:
if c in "{[(":
stack.append(c)
elif c in ")}]":
if not stack: print("no");break
res = stack.pop()
if c == ")":
if res != "(": print("no"); break
e... | Python | 1 |
Some(value) => Some(value.as_str()),
None => None,
}
}
/// Returns the value that is associated with the specified parameter parsed to the specified type.
pub fn get_param_as<T: FromStr>(&self, name: &str) -> Option<Result<T, T::Err>> {
match self.params.get(name) {
... | Rust | 0 |
eplace("%WER ", "")
wer_lines.append(line_r)
if len(wer_lines) > 0:
wer_lines.sort(reverse=True)
line = wer_lines[0]
line_split = line.split(None, 1)
wer = line_split[0]
line_resul... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.