text string | label_name string | labels int64 |
|---|---|---|
###############################################################
#
# Lab: Basic server-side template injection (code context)
#
# Hack Steps:
# 1. Fetch the login page
# 2. Extract the csrf token and session cookie to login
# 3. Login as wiener
# 4. Fetch wiener's profile
# 5. Set the preferred ... | Python | 1 |
create a unique name, spawn.
let name_base = screeps::game::time();
let mut additional = 0;
// set the role of the creep on spawn
let mem = memory::MemoryReference::new();
mem.set("role", BasicBuilder::role());
let opts = SpawnOptions::new().memory(mem);
// loo... | Rust | 0 |
_assert!(state == REGISTERING || state == FULL || state == WAKING);
}
}
}
}
impl Default for AtomicWaker {
fn default() -> Self {
Self {
state: AtomicU8::new(WAITING),
waker: UnsafeCell::new(dummy_waker()),
}
}
}
const NOOP_WAKER_VTABLE: RawWaker... | Rust | 0 |
# 如果得分是浮点数,保留4位小数
if isinstance(score, float):
score_str = f"{score:.4f}"
else:
score_str = str(score)
rows.append(f"| {metric} | {score_str} |")
table = "\n".join([header, separator] + rows)
return table
def log(sel... | Python | 1 |
import c302
import sys
import importlib
def setup(
parameter_set,
generate=False,
duration=2000,
dt=0.05,
target_directory="examples",
data_reader=c302.DEFAULT_DATA_READER,
param_overrides={},
verbose=True,
):
ParameterisedModel = getattr(
importlib.import_module("c302.par... | Python | 1 |
up_queues[group_id]
break
except queue.Empty:
# 检查是否超时
current_time = time.time()
if current_time - last_activity_time > timeout_seconds:
logger.warning(f"事件组[{group_id}]超过{timeout_seconds}秒无活动,自动... | Python | 1 |
})
})
.collect::<Result<ArrayVec<_, 10>, _>>()?
.into_inner()
.map(|data| State { energy: data })
.map_err(|_| anyhow::anyhow!("incorrect number of lines"))
}
}
impl Debug for State {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
... | Rust | 0 |
_CORE_ASSET_I_VERSION: VersionT = VersionT {
major: 1u32,
minor: 0u32,
patch: 0u32,
};
pub const TM_ASSET_DATABASE_API_VERSION: VersionT = VersionT {
major: 1u32,
minor: 0u32,
patch: 0u32,
};
pub const TM_TASK_SYSTEM_API_VERSION: VersionT = VersionT {
major: 1u32,
minor: 0u32,
patch:... | Rust | 0 |
sion & Strategic plans
- Financial reports & payments
- Communications & emials
'''
data_agent='''
- Self Performance
- Project
- SOP & learnings
... | Python | 1 |
class TaskFamily:
@staticmethod
def get_tasks() -> dict[str, dict]:
return {
"1": {"topic": "time"},
"2": {"topic": "love"}
}
@staticmethod
def get_instructions(t: dict) -> str:
return f"""Your task is to generate two creative metaphors and two creative s... | Python | 1 |
x(&self, _t0: f64, _t1: f64) -> Option<BoundingBox> {
Some(BoundingBox::AabbF(AabbF {
minimum: self.pmin,
maximum: self.pmax,
}))
}
fn hitter_fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
self.inner_fmt(f)
}
}
impl std::fmt::Display for C... | Rust | 0 |
th = file_elem.get("path", None)
if path:
file_elem.set("path", os.path.normpath(os.path.join(target_dir, os.path.split(path)[1])))
# Store repository info in the table tag set for trace-ability.
self.generate_repository_info_elem_from_reposito... | Python | 1 |
erwise we have the danger of
# malicious clients requesting the same range again and again
last_range = None
for range_val in old_ranges:
# ensure ascending order
if last_range is not None and range_val.start <= last_range.stop:
range_val = Range(min(last_... | Python | 1 |
row's columns.
Returns:
list: A list of tuples containing the standard 7 DB API fields:
https://peps.python.org/pep-0249/#description
"""
def strip_prefix(s: str):
if s.startswith("DB_TYPE_"):
return s[8:]
else:
... | Python | 1 |
out_proxy = mode.tracer.create_proxy(
"call_function", graphsafe_run_with_rng_state, proxy_args, proxy_kwargs
)
return track_tensor_tree(out, out_proxy, constant=None, tracer=mode.tracer)
@graphsafe_run_with_rng_state.py_functionalize_impl
def impl_functional(ctx, op, *args, rng_st... | Python | 1 |
=> unreachable!(),
};
t.inner_mut().content = Content::App(f.clone(), a.clone());
*f = IDENTITY.clone();
*a = Arguments::positionals(&[t.clone().into()]);
return true;
}
}
unsafe impl Send for Thunk {}
unsafe impl Sync for Thunk {}
#[derive(Debug, Eq, PartialEq)]
#[repr... | Rust | 0 |
(&mut w);
self.register.set(w.bits);
}
}
#[doc = r" Value of the field"]
pub struct DbgTim2StopR {
bits: u8,
}
impl DbgTim2StopR {
#[doc = r" Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r" Value of the field"]
pub struct Dbg... | Rust | 0 |
iety_hint}
Villain A: {a.label()} — powers: {', '.join(a.powers) or '—'}
Villain B: {b.label()} — powers: {', '.join(b.powers) or '—'}
Return:
1) ARENA_SIGNATURE (3–6 bullets).
2) PROP_CATALOG (~12 items). Each: name, category, status_start, mass, interaction_hooks, uniqueness_rule, round_weight 1–3.
3) ENV_EVENTS (2... | Python | 1 |
num_units)
V2 = tf.layers.dense(y_enc, pm.num_units)
net = tf.matmul(Q2, tf.transpose(K2, [0, 2, 1]))
net = tf.matmul(net, V2)
net = tf.nn.relu(net)
net += V2
yhat = tf.layers.dense(net, pm.Ty)
loss = tf.reduce_mean(tf.abs(y - yhat), name = 'loss')
lr = tf.train.exponential_decay(0.1, 20000, 100, 0.96, staircase=True)
... | Python | 1 |
[nn.Linear(in_features, 1) for i in range(self.num_experts)])
self.bias = paddle.nn.ParameterList([
paddle.create_parameter(
shape=[in_features, 1],
dtype='float32',
default_initializer=paddle.nn.initializer.Constant(value=0.0))
for ... | Python | 1 |
\ r] r rV r r r
test_multiply s
zTestPoint.test_multiplyc
C sX d\}}}}}}t | j||}t | j||}|| } | | | | | | dS ):We expect that on curve c, (x1,y1) + (x2, y2 ) = (x3, y3).)rX r r( r Nr_
r5 rZ r[ Zx2y2r... | Python | 1 |
_units.sort_by(|a, b| {
a.fitness()
.partial_cmp(&b.fitness())
.unwrap_or(Ordering::Equal)
});
empty_units
}
/// Register a callback to be run at the end of each epoch
pub fn register_callback(&mut self, cb: Box<EpochCb>) -> &mut Self {
se... | Rust | 0 |
.4", "2.4", prebuilt = false),
at!("2.3.7", "2.3.7", "2.3.7", prebuilt = false),
at!("2.3.6", "2.3.6", "2.3.6", prebuilt = false),
at!("2.3.5", "2.3.5", "2.3.5", prebuilt = false),
at!("2.3.4", "2.3.4", "2.3.4", prebuilt = false),
at!("2.3.3", "2.3.3", "2.3.3", prebuilt = false),... | Rust | 0 |
on: Number of tasks.)")
print(f"--minEPT: {args.minEPT} (Description: Minimum number of errands per task.)")
print(f"--maxEPT: {args.maxEPT} (Description: Maximum number of errands per task.)")
print(f"--task_type_rl: {args.task_type_rl} (Description: Relative likelihood of selecting an E or an S location.)... | Python | 1 |
⏳ Окупаемость: 12 месяцев\n\n"
"💡 **Как это работает?**\n"
"1️⃣ Вы покупаете карту.\n"
"2️⃣ Карта начинает приносить доход.\n"
"3️⃣ Окупаемость наступает через 12 месяцев.\n\n"
"Нажмите \"Купить\", чтобы приобрести карту, или \"Назад\", чтобы вернуться."
),
reply_markup=... | Python | 1 |
import pytest
import logging
from unittest.mock import MagicMock
from otel_wrapper.domain.services.logs_service import LogsProcessorService
class TestLogsProcessorService:
"""Test suite for LogsProcessorService."""
def test_init(self):
"""Test initialization of logs service."""
# Create a moc... | Python | 1 |
received a copy of the MIT License
// along with the Jellyfish library. If not, see <https://mit-license.org/>.
//! Range proof gates.
use crate::{
circuit::{Circuit, PlonkCircuit, Variable},
errors::{PlonkError, SnarkError::ParameterError},
};
use ark_ff::{BigInteger, PrimeField};
use ark_std::{string::ToStr... | Rust | 0 |
rics) = init_counters(&node, &addr.to_string()).await;
let handle = Handle::current();
let bob = BobServer::new(Grinder::new(mapper, &node).await, handle, shared_metrics);
info!("Start backend");
bob.run_backend().await.unwrap();
info!("Start API server");
let http_api_port = matches
.... | Rust | 0 |
nd/or nanosecond.
///
/// # Example
///
/// ~~~~
/// use chrono::{NaiveDate, NaiveDateTime, Datelike, Timelike, Weekday};
///
/// let d = NaiveDate::from_ymd(2015, 6, 3);
///
/// let dt: NaiveDateTime = d.and_hms_nano(12, 34, 56, 789_012_345);
/// assert_eq!(dt.year(), 2015);
... | Rust | 0 |
rray,
) -> jstring {
return if let Ok(val) = env.get_byte_array_elements(data, ReleaseMode::NoCopyBack) {
let length = val.size().unwrap_or(0) as usize;
let buf = unsafe {
std::slice::from_raw_parts(
std::mem::transmute::<*mut i8, *mut u8>(val.as_ptr()),
l... | Rust | 0 |
ColumnDesc {
/// The name of the column.
pub name: String,
/// The OID of the column's type.
pub type_oid: u32,
/// The modifier for the column's type.
pub type_mod: i32,
/// True if the column lacks a `NOT NULL` constraint.
pub nullable: bool,
/// Whether the column is part of the t... | Rust | 0 |
lumn].str.strip()
# Print the column values to check if the split and explode operations were successful.
print(f"\nColumn '{column}' values after splitting and exploding:")
print(df_exploded[column].unique())
# Assign the exploded DataFrame back to df
... | Python | 1 |
BLE,
'speech_recognition_available': SPEECH_RECOGNITION_AVAILABLE,
'youtube_dl_available': YOUTUBE_DL_AVAILABLE,
'features': {
'file_analysis': True,
'url_analysis': YOUTUBE_DL_AVAILABLE,
'transcript_extraction': SPEECH_RECOGNITION_AVAI... | Python | 1 |
unt == 2
def test_update_buttons_can_add(self, sample_party_members):
"""追加可能な状態でのボタン更新"""
from src.facilities.ui.guild.party_formation_panel import PartyFormationPanel
panel = Mock()
panel.party_members = sample_party_members # 2人(6人未満)
panel.available_charact... | Python | 1 |
n'] = json.dumps(torrent)
return info
def make_artist_title(group, torrent):
if torrent.get('remasterYear', 0) == 0:
torrent['displayTitle'] = "Original Release"
if group.get("groupRecordLabel") != '':
torrent['displayTitle'] += " / " + group.get("groupRecordLabel")
else:
torrent['displayTitle... | Python | 1 |
LEXICON_RU: dict[str, str] = {'yes': 'ДА!',
'no': 'НЕТ',
'menu_descr': 'Открыть меню',
'welcome':(
"👋 Приветствую! Ты только что присоединился к нашему боту для изучения английского языка! 🇬🇧\n\n"
"Здесь ты можешь:\n"
"- ... | Python | 1 |
from rest_framework import serializers
from .models import JobDetails, JobApplication
from apps.users.models import ApplicantProfile
class JobDetailSerializer(serializers.ModelSerializer):
class Meta:
model = JobDetails
fields = "__all__"
class ApplicationSerializer(serializers.ModelSerializer):... | Python | 1 |
}
]
for p, h in zip(info['position_infer']['position'][1:], info['position_infer']['heading'][1:]):
if p != self.path_eps[ep_id][-1]['position']:
self.path_eps[ep_id].append({
'... | Python | 1 |
deo_fps=}, time={time.time() - st:.3f}s")
# sample_fps = nframes / max(total_frames, 1e-6) * video_fps
return [video,video_motion], sample_fps
# if return_video_sample_fps:
# return video, sample_fps
# return video
else:
assert isinstance(ele["video"], (l... | Python | 1 |
ro:
Quad::ONE,
Quad::NEG_INFINITY.powi(0);
powi_nan_zero:
Quad::ONE,
Quad::NAN.powi(0);
powi_inf_even:
Quad::INFINITY,
Quad::INFINITY.powi(2);
powi_inf_odd:
Quad::INFINITY,
Quad::INFINITY.powi(3);
... | Rust | 0 |
6(0x02, 0x06, 0, 0, 0)
OP_C4(0x01, 0x00000010)
FadeIn(2000, 0)
OP_0D()
Sleep(500)
ChrTalk(
0x0101,
(
'#0010330342V#1020F#4P…………………………………',
TxtCtl.Enter,
TxtCtl.Clear,
'#0010330343V……为……什么……',
TxtCtl.Enter,
TxtCt... | Python | 1 |
"twenty",
"twice",
"twin",
"twist",
"two",
"type",
"typical",
"ugly",
"umbrella",
"unable",
"unaware",
"uncle",
"uncover",
"under",
"undo",
"unfair",
"unfold",
"unhappy",
"uniform",
"unique",
"unit",
"universe",
"unknown",
"unl... | Rust | 0 |
# -*- coding: utf-8 -*-
"""Slot Loader."""
import logging
import sys
from importlib import import_module
from unirobot.utils.unirobot_slot import FULL_MODEL
from unirobot.utils.unirobot_slot import DATALOADER
from unirobot.utils.unirobot_slot import DATASET
from unirobot.utils.unirobot_slot import EVALUATOR
from uniro... | Python | 1 |
_update
# handle a few events, or timeout
self._poll(msg_update)
self._results = []
_winapi.CloseHandle(self._iocp)
self._iocp = None
def __del__(self):
self.close()
class _WindowsSubprocessTransport(base_subprocess.BaseSubprocessTransport):
def _st... | Python | 1 |
y,
}
return {'url': url, 'method': method, 'body': body, 'headers': headers}
def handle_errors(self, code: int, reason: str, url: str, method: str, headers: dict, body: str, response, requestHeaders, requestBody):
#
# {
# "title":"io.javalin.http.BadRequestResp... | Python | 1 |
}
break;
},
_ => return None,
}
let mut position = 10.0;
// Parse fraction
match self.iter.peek() {
Some((_, '.')) => {
self.iter.next();
// Parse fraction
loop {
... | Rust | 0 |
nLinearEnergyConsumptionModel {
phi_min,
alpha,
beta,
}
}
}
impl EnergyConsumptionModel {
/// Energy consumption of a server of some type with utilization $s$.
/// Referred to as $\phi$ in the paper.
pub fn consumption(
&self,
delta: f64,
... | Rust | 0 |
return self._defined_tags
@defined_tags.setter
def defined_tags(self, defined_tags):
"""
Sets the defined_tags of this OceInstanceSummary.
Usage of predefined tag keys. These predefined keys are scoped to namespaces.
Example: `{\"foo-namespace\": {\"bar-key\": \"value\"}}`
... | Python | 1 |
u{102f}\u{1036}းများ ပြ\u{102f}\u{1036}းနေသည\u{1037}\u{103a} အပြ\u{102f}\u{1036}းမျက\u{103a}န\u{103e}ာ",
),
keywords: &[
"ပြ\u{102f}\u{1036}းနေသည\u{1037}\u{103a}မျက\u{103a}လ\u{102f}\u{1036}းများဖြင\u{1037}\u{103a} အပြ\u{102f}\u{1036}းမျက\u{103a}န\u{103e}ာ",
"ပြ\u{... | Rust | 0 |
&self.min_value
}
pub fn get_max_val(&self) -> &Option<Row> {
&self.max_value
}
pub fn get_full_name(&self, partition_id: u64) -> Option<String> {
partition_file_name(self.parent_partition_id, partition_id)
}
pub fn to_active(&self, active: bool) -> Partition {
... | Rust | 0 |
ush((word.to_string(), freq.clone()));
});
vec.sort_by(|x, y| x.0.cmp(&y.0));
for (word, freq) in vec {
writeln!(f, "{:>32}: {}", word, freq)?;
}
Ok(())
}
}<filename>hermes/src/client.rs
use crate::connection::Connection;
use crate::message::{Message, Messageable}... | Rust | 0 |
from __future__ import annotations
import os
import dash
# dos and bs data from local jsons
from monty.serialization import loadfn
import crystal_toolkit.components as ctc
from crystal_toolkit.helpers.layouts import H1, Container
from crystal_toolkit.settings import SETTINGS
# assets folder set for visual styles o... | Python | 1 |
losses_m.update(reduced_loss.item(), input.size(0))
prec1_m.update(prec1.item(), output.size(0))
prec5_m.update(prec5.item(), output.size(0))
batch_time_m.update(time.time() - end)
end = time.time()
if args.local_rank == 0 and (last_batch or batch_idx %... | Python | 1 |
/// When PTRACE_SYSCALL is used, there will be three events:
/// EnteringSyscallPtrace to run the process until it gets into the kernel,
/// then EnteringSyscall and ExitingSyscall. We need three events to handle
/// PTRACE_SYSCALL with clone/fork/vfork and execve. The tracee must run to
/// the EnteringSyscallPtrace s... | Rust | 0 |
s */
uart.lcrh.write(|w| {
w.uart_lcrh_wlen().bits(0x3)
});
/* Enable UART module */
uart.ctl.modify(|_, w| w.uart_ctl_uarten().bit(true));
}
use libyobicash::crypto::hash::digest::YDigest64;
use libyobicash::crypto::mac::YMACCode;
use libyobicash::data::YData as LibData;
use serde_json;
u... | Rust | 0 |
) -> f64 {
let mut k1 = a;
let mut k2 = a + b;
let mut k3 = a;
let mut k4 = a + 1.0;
let mut k5 = 1.0;
let mut k6 = b - 1.0;
let mut k7 = k4;
let mut k8 = a + 2.0;
let mut pkm2 = 0.0;
let mut qkm2 = 1.0;
let mut pkm1 = 1.0;
let mut qkm1 = 1.0;
let mut r = 1.0;
let... | Rust | 0 |
println!("Sccs {:?}", sccs);
println!("Sccs (Tarjan) {:?}", tsccs);
return false;
}
true
}
}
quickcheck! {
fn kosaraju_scc_is_topo_sort(g: Graph<(), ()>) -> bool {
let tsccs = kosaraju_scc(&g);
let firsts = vec(tsccs.iter().rev().map(|v| v[0])... | Rust | 0 |
,
sh_qp_v_offset: i8,
w_lcu: u16,
h_lcu: u16,
w_scu: u16,
h_scu: u16,
w: u16,
h: u16,
tracer: &mut Option<Tracer>,
pic: &Option<Rc<RefCell<EvcPic>>>,
map_scu: &mut [MCU],
map_split: &[LcuSplitMode],
map_mv: &Option<Rc<RefCell<Vec<[[i16; MV_D]; REFP_NUM]>>>>,
map_refi:... | Rust | 0 |
mary = step_proposer(validators, header.parent_hash(), step);
// Do not report this signer.
if skipped_primary != me {
// Stop reporting once validators start repeating.
if !reported.insert(skipped_primary) { break; }
trace!(
target: "engine",
"Reporting benign misbehaviour (cause: sk... | Rust | 0 |
G
+ std::cmp::max(ETHERNET_MIN_BODY_LEN_NO_TAG, IPV4_MIN_HDR_LEN)
);
let body = vec![0; frame_size - (ETHERNET_HDR_LEN_NO_TAG + IPV4_MIN_HDR_LEN)];
let mut buf = body
.into_serializer()
.encapsulate(Ipv4PacketBuilder::new(
// Use the remote IP as the destination s... | Rust | 0 |
tart_object();
crate::json_ser::serialize_structure_crate_model_aws_sns_topic_subscription(
&mut object_1570,
item_1569,
)?;
object_1570.finish();
}
}
array_1568.finish();
}
if let Some(var_1571) ... | Rust | 0 |
"""
Nom du projet : Rue en Folie - Grille et obstacles
Auteur : Rafael Rico et Luca Giubbilei
Date : 02/09/2025
Version : 1.0
Description : jeu pour tester les mouvements des blocs
"""
import pygame
import random
pygame.init()
L, H = 800, 600
fenetre = pygame.display.set_mode((800, 600))
# Param... | Python | 1 |
;
use super::Handle;
use super::Outputs;
use super::Popup;
#[allow(unused)]
struct Inner {
wl_surface: surface::Surface,
wl_xdg_surface: wlc::Main<xdg_surface::XdgSurface>,
wl_xdg_popup: wlc::Main<xdg_popup::XdgPopup>,
wl_xdg_pos: wlc::Main<xdg_positioner::XdgPositioner>,
}
impl From<Inner> for std::s... | Rust | 0 |
SES = crate::Reg<u32, _FLASH_MAX_ERASE_PULSES>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _FLASH_MAX_ERASE_PULSES;
#[doc = "`read()` method returns [flash_max_erase_pulses::R](flash_max_erase_pulses::R) reader structure"]
impl crate::Readable for FLASH_MAX_ERASE_PULSES {}
#[doc = "Flash Maximum Erase Pulses"]
pu... | Rust | 0 |
else:
print(f"Frame count: {len(ldf.frames)}")
if extended:
print("Signals (width, name):")
for signal in ldf.signals:
print(f"\t{signal.width},{signal.name}")
else:
print(f"Signal count: {len(ldf.signals)}")
def print_slave_info(slave: LinSlave):
print(f"N... | Python | 1 |
= AutoscalingGroupStatus
@property
def MaxNodesNum(self):
r"""最大节点数量
注意:此字段可能返回 null,表示取不到有效值。
:rtype: int
"""
return self._MaxNodesNum
@MaxNodesNum.setter
def MaxNodesNum(self, MaxNodesNum):
self._MaxNodesNum = MaxNodesNum
@property
def MinNodesNum(se... | Python | 1 |
s no quantifier or the `?`
/// quantifier.
Once(&'a str),
/// Used when a capture has at least 1 matches and has the `*` or the `+`
/// quantifiers.
Many(Vec<&'a str>),
}
#[doc = include_str!("docs/args.md")]
#[derive(PartialEq, Eq, Clone, Debug, Default)]
pub struct Args<'c, 't> {
/// The trailing part of the t... | Rust | 0 |
in 0..=top {
window.push(i);
assert_eq!(window.query(), i);
}
for _i in 0..=top {
assert_eq!(window.query(), top);
window.pop();
}
}
fn test_sum<Window>()
where
Window: FifoWindow<Sum<i32, i32>>
{
let mut window = Window::new();
let top = 1000;
let mut runni... | Rust | 0 |
db, 0xc1bdceee, 0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be, 0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
// round 2
0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa, 0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0... | Rust | 0 |
AudioFormat::MACE3 => (1296122675, None),
AudioFormat::MACE6 => (1296122678, None),
AudioFormat::ULaw => (1970037111, None),
AudioFormat::ALaw => (1634492791, None),
AudioFormat::QDesign => (1363430723, None),
AudioFormat::QDesign2 => (1363430706, Non... | Rust | 0 |
": 100.0},
layer_name="Transformed"
)
self.assertIn("local vector_ids = {1}", rotate_code)
self.assertIn("TranslationMatrix2D(-100.0, -100.0)", rotate_code)
self.assertIn("RotationMatrix2D(45.0)", rotate_code)
self.assertIn("TranslationMatrix2D(100.0, 100.0)"... | Python | 1 |
#Written by Jesse Weinstein <jessw@netwood.net>.
#Released under the Python license on Sat Jan 22 02:56:11 2005.
#shortForm.py
#Short Form prevents the Python shell from printing out giant piles of text.
#Python version: er, 2.3 and later. Or maybe earlier versions...
#http://www.netwood.net/usr/jessw
#Possible catego... | Python | 1 |
}",
"\u{a77d}",
"\u{a780}",
"\u{a782}",
"\u{a784}",
"\u{a786}",
"\u{a78b}",
"\u{a78d}",
"\u{a790}",
"\u{a792}",
"\u{a796}",
"\u{a798}",
"\u{a79a}",
"\u{a79c}",
"\u{a79e}",
"\u{a7a0}",
"\u{a7a2... | Rust | 0 |
.part {
Part::One => run_1(&table),
Part::Two => run_2(&table),
};
println!(
"The most optimal seating order is\n {}\nwith a happiness delta of {}.",
order.join(", "), delta
);
},
Err(e) => eprintln!("E... | Rust | 0 |
unc = convert_to_remote(func, remote)
time_f = func.time_evaluator(func.entry_name, ctx, number=n_times)
cost = time_f(a, b, bias, c).mean
try:
np.testing.assert_allclose(np.dot(a_np, b_np.T) + bias_np, c.asnumpy(), rtol=1e-1)
except Exception as e:
pass
print(e)
return co... | Python | 1 |
"""
Plugin for ResolveURL
Copyright (C) 2023 gujal
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
... | Python | 1 |
f.config.measurement.copy(), inplace=True) # type: ignore
counts = (
self.sampling_backend.run(measurement_qc, shots=num_shots)
.result()
.get_counts()
)
simulation_result.save_timestep_counts(counts, step)
... | Python | 1 |
, mock_prompt_confirm_password
):
# mock delete_user_account response
mock_server.router.delete(
mock_server.endpoints.delete_user_account.path
).respond(200)
# mock password prompting
mock_prompt_confirm_password.return_value = "dummy_password"
# assert... | Python | 1 |
ng.gen_range(1..10_001);
let mut w = world
.filter(id.eq(w_id))
.load::<World>(&conn)?
.pop()
.unwrap();
w.randomnumber = this.rng.gen_range(1..10_001);
Ok(w)
... | Rust | 0 |
ive(Debug, Clone, Default)]
pub struct OpDelete {
pub path: String,
}
impl OpDelete {
pub fn new(path: &str) -> Self {
Self {
path: path.to_string(),
}
}
}
#[derive(Debug, Clone, Default)]
pub struct OpList {
pub path: String,
}
impl OpList {
pub fn new(path: &str) -> ... | Rust | 0 |
metrics.get('quote_count', 0) * 1.8
)
# Store high engagement tweets
if engagement_score > 10:
high_engagement_tweets.append({
'text': tweet.text,
'engagement': engagement_score,
'id': tweet.id
}... | Python | 1 |
ach().cpu()
if self.clamp:
images[k] = torch.clamp(images[k], -1., 1.)
self.log_local(pl_module.logger.save_dir, split, images,
pl_module.global_step, pl_module.current_epoch, batch_idx)
logger_log_images = self.logger_log_... | Python | 1 |
::delete(
user_permissions.filter(user_id.eq(item_user_id)),
)
.execute(db)
}
}
<filename>CXT/xsd10/src/xml_to_xsd/nested_particle.rs
use crate::model::complex_types::explicit_group::ExplicitGroup;
use crate::model::elements::ElementType;
use crate::model::groups::nested_particle::Ne... | Rust | 0 |
def mostrar_tarefas(tarefas):
# Exibe a lista de tarefas.
if len(tarefas) > 0:
print("\nLista de Tarefas:")
for indice, tarefa in enumerate(tarefas):
print(f"{indice}. {tarefa}")
else:
print("\nLista de tarefas vazia!")
def adicionar_tarefa(tarefas):
# Adiciona uma n... | Python | 1 |
elds[vep_csq_fields_map['field2index']['HGVSc']] != "":
hgvsc = str(csq_fields[vep_csq_fields_map['field2index']['HGVSc']].split(':')[1])
else:
if len(primary_csq_pick) == 1:
if 'HGVSc' in primary_csq_pick[0]:
if primary_csq_pick[0]['HGVSc'] is not Non... | Python | 1 |
er.address.clone();
drop(session_reader);
let mut message_buffer = Vec::new();
loop {
let message = connection.receive(&mut message_buffer).await;
match message {
ClientMessage::Greeting(greeting) => {
connection
... | Rust | 0 |
allenges:
# Add if the user has solved the challenge or not
if request.user.is_authenticated and challenge.solved(request.user):
challenge_to_add = (challenge, True)
else:
challenge_to_add = (challenge, False)
# Add challenge to category
if challenge.cate... | Python | 1 |
(warp_train_path, "img2"), 5)
create_virtual_images(os.path.join(warp_test_path, "img1"), 3)
create_virtual_images(os.path.join(warp_test_path, "img2"), 3)
create_virtual_images(os.path.join(comp_train_path, "warp1"), 5)
create_virtual_images(os.path.join(comp_train_path, "warp2"), 5)
create_vi... | Python | 1 |
#encoding: utf-8
""" this file aims at pruning source/target vocabulary of the trained model using a shared vocabulary. It depends on the model implementation, and has to be executed at the root path of the project. Usage:
python prune_model_vocab.py path/to/common.vcb path/to/common.vcb path/to/src.vcb path/to/tgt.v... | Python | 1 |
: F) where F: FnMut(&str) -> *const raw::c_void {
unsafe {
storage::VertexP4uiv = FnPtr::new(metaloadfn(&mut loadfn, "glVertexP4uiv", &[]))
}
}
}
#[allow(non_snake_case)]
pub mod Viewport {
... | Rust | 0 |
tree
/// where the node was added. All nodes in the valid_policy_tree expect the root node have a parent.
/// The parent is the node whose evaluation caused a child node to be added. Child-less nodes are
/// periodically pruned from the valid_policy_tree.
///
/// The first five fields are established when a node is cre... | Rust | 0 |
convert and migrate values to istio attributes
fn process_istio_attr(&self, attr: &mut AttributeWrapper);
}
<filename>linked-data/src/blog.rs
use crate::IPLDLink;
use std::time::{SystemTime, UNIX_EPOCH};
use serde::{Deserialize, Serialize};
use cid::Cid;
/// A micro blog post (Twitter-sytle).
/// Recursive pin... | Rust | 0 |
oint3D::default();
assert!(p1.x() == 0.0);
assert!(p1.y() == 0.0);
assert!(p1.z() == 0.0);
assert!(*p1.abs() == 0.0);
let mut p2 = Point3D::new(1.0, 0.0, 0.0);
assert!(p2.x() == 1.0);
assert!(p2.y() == 0.0);
assert!(p2.z() == 0.0);
assert!(*p2.abs() == 1.0);
let p3 = Point3D::... | Rust | 0 |
_ascii_stride_neither_aligned, load16_unaligned, store16_unaligned);
ascii_to_basic_latin_simd_stride!(ascii_to_basic_latin_stride_neither_aligned, load16_unaligned, store8_unaligned);
unpack_simd_stride!(unpack_stride_neither_aligned, load16_unaligned, store8_unaligned);
basic_latin_to_ascii_... | Rust | 0 |
stream_oxide.total_out += push_dict_out(state, next_out);
stream_oxide.adler = state.m_decomp.adler32().unwrap_or(0).into();
if (status as i32) < 0 {
return Err(MZError::Data);
}
if (status == TINFLStatus::NeedsMoreInput) && (orig_avail_in == 0) {
return Err(MZE... | Rust | 0 |
assert_eq!(nutriment.name, "fiber");
// assert_eq!(nutriment.op, "lt");
// assert_eq!(nutriment.value, 500);
// }
// else {
// panic!("Not an Nutriment")
// }
// }
}
<gh_stars>10-100
use std::io::Write;
use std::mem::size_of;
use std::slice::{from_r... | Rust | 0 |
lobDetector {
#[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() }
}
impl core::AlgorithmTrait for PtrOfSimpleBlobDetector {
#[inline] fn as_raw_mut_Algorithm(&mut self) -> *mut c_void { self.inner_as_raw_mut() }
}
impl crate::features2d::Feature2DTraitConst for PtrOfSimpleBlobDetec... | Rust | 0 |
/// let mut sc = ScannerU8Slice::new("1 2.5".as_bytes());
///
/// assert_eq!(Some(1.0), sc.next_f64().unwrap());
/// assert_eq!(Some(2.5), sc.next_f64().unwrap());
/// ```
#[inline]
pub fn next_f64(&mut self) -> Result<Option<f64>, ScannerError> {
self.next_parse()
}
}
impl<'a> ... | Rust | 0 |
def calculate_price(num_people, is_qyl=False, is_xxj_mhzl = False):
# 定义单个景点的票价
qyl_price = 35
xxj_mhzl_price = 35
# 定义组合票价
combo_price = 70
# 判断逻辑
if is_qyl:
total_price = num_people * qyl_price
elif is_xxj_mhzl:
total_price = num_people * xxj_mhzl_price
else:
... | Python | 1 |
ntains(&point.id) {
assert_approx_eq!(radius, (block.args_ring.rmin + block.args_ring.rmax) / 2.0, 1e-17);
}
if [32, 48, 49, 72, 130, 78, 109, 44, 39, 38].contains(&point.id) {
assert_approx_eq!(radius, block.args_ring.rmax, 1e-17);
}
}
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.