text string | label_name string | labels int64 |
|---|---|---|
) => Ok(ok),
Err(err) => {
state.send_handshake_error(err.to_string()).await?;
Err(err)
}
}
}
// init: <- pub_key || g^x
let init_message = check_p... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (C) 2021-2025 IGM authors
# Published under the GNU GPL (Version 3), check at the LICENSE file
import tensorflow as tf
def misfit_velsurf(cfg,state):
velsurf = tf.stack([state.uvelsurf, state.vvelsurf], axis=-1)
velsurfobs = tf.stack([state.uvelsurfobs, sta... | Python | 1 |
Uses_texture;
uniform sampler2D tex;
void main() {
highp vec4 tex_color = (int(Uses_texture) != 0) ? texture2D(tex, Tex_coord) : vec4(1, 1, 1, 1);
gl_FragColor = Color * tex_color;
}"#;
fn format_gl(format: PixelFormat) -> u32 {
match format {
PixelFormat::RGB => gl::RGB,
PixelFor... | Rust | 0 |
16x2,
u16x2,
m16x2,
i8x2,
u8x2,
m8x2
);
impl_from!(
i64x2: i64,
i64x2_from,
test_v128 | f64x2,
u64x2,
m64x2,
i32x2,
u32x2,
f32x2,
m32x2,
i16x2,
u16x2,
m16x2,
i8x2,
u8x2,
m8x2
);
impl_from!(
u32x4: u32,
u32x4_from,
test_v128 | f6... | Rust | 0 |
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib import *
# Actual tests
"""Testing logical constructs not/and/or works out ... | Python | 1 |
insert(RigidBodyPositionSync::Discrete)
//.insert(ColliderPositionSync::Discrete)
.insert(ColliderDebugRender::from(config.player_color))
.insert(Player { index: 0 })
.insert(BreakoutCleanup);
}
fn spawn_ball(mut commands: Commands, config: Res<BreakoutConfig>) {
let mut rnd = rand:... | Rust | 0 |
d::process::exit;
#[derive(Debug)]
pub enum CliCommand {
Help,
Config,
Setup,
Branch,
Project,
Version,
Feature,
All,
}
impl CliCommand {
fn command(cmd: &str) -> CliCommand {
match cmd {
"help" => CliCommand::Help,
"project" => CliCommand::Project,
... | Rust | 0 |
hed_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mut self.unknown_fields
}
fn as_any(&self) -> &dyn (::std::any::A... | Rust | 0 |
#coding=utf-8
from aip import AipNlp
import xlrd
import re
import xlwt
import time as t
"""
你的 APPID AK SK
每秒钟只能调用两次
"""
APP_ID = ''
API_KEY = ''
SECRET_KEY = ''
client = AipNlp(APP_ID, API_KEY, SECRET_KEY)
def filter_emoji(content):
try:
# Wide UCS-4 build
cont = re.compile(u'['u'\U0001F300-\U0001F64F' u... | Python | 1 |
from __future__ import unicode_literals
import frappe
def execute():
frappe.db.sql("""
update `tabSalary Structure` ss, `tabSalary Detail` sd
set sd.docstatus=1
where ss.name=sd.parent and ss.docstatus=1 and sd.parenttype='Salary Structure'
""")
| Python | 1 |
import random
from typing import Optional
from ..game import Bot, PlayerPerspective, Move, SchnapsenTrickScorer, RegularMove
from ..deck import Card, Suit
class BullyBot(Bot):
def __init__(self, rand: random.Random, name: Optional[str] = None) -> None:
super().__init__(name)
self.rand = rand
... | Python | 1 |
e {
res.insert(k, Decoded::Bytes(v.0));
}
}
}
res
}
fn spawn_periodic_reader(reader: Store<Secret>) {
tokio::spawn(async move {
loop {
// Periodically read our state
let cms: Vec<_> = reader
.state()
.iter()... | Rust | 0 |
t')
blueprint_transform_list.append((blueprint, transform))
# reset for simulation 1
self.client.reload_world(False)
# workaround: give time to UE4 to clean memory after loading (old assets)
time.sleep(5)
world = self.client.get_world()
traffic_manager = self... | Python | 1 |
# -*- encoding: utf-8 -*-
import pilasengine
# Permite que este ejemplo funcion incluso si no has instalado pilas.
import sys
sys.path.insert(0, "..")
pilas = pilasengine.iniciar()
# Boton
boton = pilas.interfaz.Boton("Hola mundo")
boton.x = -200
def cuando_hacen_click():
boton.decir("Has pulsado el boton!")
bo... | Python | 1 |
from a 64-bit register value, and writes the
/// result to the 64-bit destination register.
///
/// This instruction is used by the alias UMNEGL.
fn umsubl(&mut self, rd: RegA64, rn: RegA64, ra: RegA64, rm: RegA64)
-> Result<(), Self::Error>;
/// [Reference](https://developer.arm.com/doc... | Rust | 0 |
# Create a function sum_numbers that:
# Takes two arguments, a and b.
# Returns the sum of a and b.
str1 = " Sum_Number "
print(str1.center(50,"="))
a = (input(" Enter 1st number:"))
b = (input(" Enter 2nd number:"))
def sum_numbers(a,b):
return a + b
print("The total of", a, "and", b, "=", sum_numbers(a,b)) | Python | 1 |
!
//! - [`RwLockUpgradableGuard`] supports being upgrades into a [`RwLockWriteGuard`].
//!
//! - Guards support [leaking](https://doc.rust-lang.org/nomicon/leaking.html).
//!
//! - [`Once`] owns the value returned by its `call_once` initializer.
//!
//! - [`RwLock`] supports counting readers and writers.
//!
//! Conver... | Rust | 0 |
# Hiding this really important number in an obscure piece of code is brilliant!
# AND it's encrypted!
# We want our biggest client to know his information is safe with us.
bezos_cc_secret = "A:4@r%uL`M-^M0c0AbcM-MFE067d3eh2bN"
# Reference alphabet
alphabet = "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ... | Python | 1 |
use nalgebra::Point3;
use pictor::pipeline::{self, Vertex};
use plexus::prelude::*;
use plexus::primitive;
use plexus::primitive::generate::{Normal, Position};
use plexus::primitive::sphere::UvSphere;
use theon::space::{EuclideanSpace, VectorSpace};
type E3 = Point3<f32>;
fn main() {
let from = Point3::new(0.0, ... | Rust | 0 |
error!("failed to get colorkey gradient from pointer. using default");
ColorKeyGradient{blend_type, keys: Vec::new()}
}
}
}
Box::leak(chunkgen);
}
}
#[no_mangle]
pub extern "C" fn get_mountainous_terrain_chunk_geometry_desc(chunkgen: *mut Mountainous... | Rust | 0 |
::from("CE00C43D881120").packet.value);
}
#[test]
fn part2_example_less_than() {
assert_eq!(1, Transmission::from("D8005AC2A8F0").packet.value);
}
#[test]
fn part2_example_greater_than() {
assert_eq!(0, Transmission::from("F600BC2D8F").packet.value);
}
#[test]
fn part... | Rust | 0 |
, _), _) = &terminal.node;
assert!(!context.frame().generations.contains_key(identifier));
context.register_variable(&mut terminal.node.clone());
});
}
shadow(&mut function.context, context, &function.expression)?;
context.pop_frame();
Ok(())
}
fn shadow(function: &mut FunctionContext, context: &mut Shado... | Rust | 0 |
@ text_embeddings_n.T ## 25000 X 5000 // 605 x 5000 for attack 2
inds = torch.argsort(dist_matrix, dim=1, descending=True) ## shape 885 x 25000 ; [1, 200, 20,..]
inds = inds.to(device) ## this will contain the index of dog image in first k [1, 5, 10]
k_vals = [1, 5, 10]... | Python | 1 |
elf.file.frame_times[self.index as usize] as u32
}
}
type BlendFn = Box<dyn Fn(Color8, Color8, u8) -> Color8>;
fn blend_mode_to_blend_fn(mode: BlendMode) -> BlendFn {
// TODO: Make these statically allocated
match mode {
BlendMode::Normal => Box::new(blend::normal),
BlendMode::Multiply => ... | Rust | 0 |
import logging
from pyrogram.errors import UsernameNotOccupied, PeerIdInvalid
logger = logging.getLogger(__name__)
async def get_user_telegram_id(client, message):
# 默认获取自己的 ID
telegram_id = message.from_user.id
telegram_username = None
logger.debug(f"Default Telegram ID: {telegram_id}")
# 如果回复... | Python | 1 |
ad_doc="multiple choice")
class FlaxAutoModelForNextSentencePrediction(_BaseAutoModelClass):
_model_mapping = FLAX_MODEL_FOR_NEXT_SENTENCE_PREDICTION_MAPPING
FlaxAutoModelForNextSentencePrediction = auto_class_update(
FlaxAutoModelForNextSentencePrediction, head_doc="next sentence prediction"
)
class Flax... | Python | 1 |
);
}
rsp => panic!("unexpected response {:?}", rsp),
}
}
#[test]
fn test_body_structure() {
const RESPONSE: &[u8] = b"* 15 FETCH (BODYSTRUCTURE (\"TEXT\" \"PLAIN\" (\"CHARSET\" \"iso-8859-1\") NIL NIL \"QUOTED-PRINTABLE\" 1315 42 NIL NIL NIL NIL))\r\n";
match parse_response(RES... | Rust | 0 |
from customer import Customer
from coffee import Coffee
from order import Order
print("=== Debugging Coffee Shop Domain ===")
# Test valid customer and coffee creation
try:
alice = Customer("Ken")
bob = Customer("Bob")
latte = Coffee("Latte")
espresso = Coffee("Espresso")
except Exception as e:
pr... | Python | 1 |
layers.append(
dict(
prev_op=expert.up_proj,
layers=[expert.down_proj],
inp=input_feat[f"mlp.experts.{i}.down_proj"],
)
)
# shared expert gate_proj up_pr... | Python | 1 |
elif 'CONTENT STRATEGY' in line.upper():
in_immediate_section = False
continue
if in_immediate_section and line.strip().startswith('-'):
opportunities.append(line.strip().lstrip('- '))
return opportunities[:5]
def _... | Python | 1 |
ex will be unlocked.
///
/// The underlying function does not allow for recursion. If the thread
/// already holds the lock and tries to lock the mutex again, this function
/// will return `None` instead.
#[inline]
pub fn lock(&mut self) -> Option<FastMutexGuard<T>> {
unsafe { ExAcquireFastMutex(&mut *s... | Rust | 0 |
}
}
}
impl<I: Into<SourceItem>, T: Default> From<I> for FilteredItem<T> {
fn from(item: I) -> Self {
Self {
source_item: item.into(),
score: Default::default(),
match_indices: Default::default(),
display_text: None,
}
}
}
impl<T> Fil... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) 2015-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test the CHECKLOCKTIMEVERIFY (BIP65) soft-fork logic
#
from test_framework.test_framework import Bit... | Python | 1 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing import List, Optional
from ..._models import BaseModel
from .api_evaluation_metric_result import APIEvaluationMetricResult
__all__ = ["APIEvaluationPrompt", "PromptChunk"]
class PromptChunk(BaseModel):
chunk_usage... | Python | 1 |
from ...attrs import LIKE_NUM, NORM
from ..norm_exceptions import BASE_NORMS
# fmt: off
_stem_suffixes = [
["ा", "ि", "ी", "ु", "ू", "ृ", "े", "ै", "ो", "ौ"],
["ँ", "ं", "्", "ः"],
["लाई", "ले", "बाट", "को", "मा", "हरू"],
["हरूलाई", "हरूले", "हरूबाट", "हरूको", "हरूमा"],
["इलो", "िलो", "नु", "ाउनु",... | Python | 1 |
226332223a7b226330223a5b302c302c302c302c302c305d2c226331223a5b302c302c302c302c302c305d7d7d2c226331223a7b226330223a7b226330223a5b302c302c302c302c302c305d2c226331223a5b302c302c302c302c302c305d7d2c226331223a7b226330223a5b302c302c302c302c302c305d2c226331223a5b302c302c302c302c302c305d7d2c226332223a7b226330223a5b302c302c302c... | Rust | 0 |
eceiver;
pub fn get_async(q: Query) -> Receiver<Result<CanteenPlan, String>> {
dirty_err_async(move || get(q))
}
#[derive(PartialEq, Copy, Clone, Debug)]
pub enum Query {
ThisWeek,
NextWeek,
}
fn get_url_next_week() -> Result<String, DirtyError> {
let res = reqwest::blocking::get(URL_THIS_WEEK)?;
... | Rust | 0 |
import os
import smtplib
from email.mime.multipart import MIMEMultipart
from email.header import Header
from email.mime.text import MIMEText
from email.mime.image import MIMEImage
import logging
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s - %(name)s - %(levelname)s - %(message)s",
datefmt... | Python | 1 |
return 0.0
lntau = log(1.0 - T/Tc)
return trunc_exp(horner_stable(lntau, coeffs, offset, scale))
def exp_horner_stable_ln_tau_and_der(T, Tc, coeffs, offset, scale):
if T >= Tc:
return 0.0, 0.0
tau = 1.0 - T/Tc
lntau = log(tau)
poly_val, poly_der_val = horner_stable_and_der(lntau, co... | Python | 1 |
Adjust fence id to not leave empty spaces
if self.Geofence0['id'] > len(self.fenceList) + len(self.drawnFenceList):
self.Geofence0['id'] = len(self.fenceList) + len(self.drawnFenceList)
name = "DraftFence"+str(self.Geofence0['id'])
# Check that the geofence polygon is nice
a... | Python | 1 |
self.index.code.as_u64(),
self.index.scope.as_u64(),
T::NAME.as_u64(),
self.pk,
)
};
let nullptr: *mut c_void = null_mut() as *mut _ as *mut c_void;
let size = unsafe { db_get_i64(self.value, nullptr, 0) };
let mu... | Rust | 0 |
parser.add_argument('--ref', type=str, default='latents/ref.npy')
parser.add_argument('--dist', type=str, default='latents/dist.npy')
args = parser.parse_args()
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
ref = prepare_latent(np.load(args.ref)).to(device)
dist = pre... | Python | 1 |
al for DNSSEC" by
//! <NAME>, <NAME>, <NAME>, <NAME>,
//! <NAME>, <NAME>, andd <NAME>.
//! https://eprint.iacr.org/2017/099.pdf
//! We note the V(X)EdDSA signature scheme by <NAME> at
//! https://www.signal.org/docs/specifications/xeddsa/#vxeddsa
//! is almost identical to the NSEC5 construction.
//!
//! We support ind... | Rust | 0 |
ap::get_mut(self, id.team()) {
Some(mut player) => player.party.take(id.index()).map(|p| p.p),
None => None,
}
}
}
// let targets: Vec<TargetLocation<ID>> = match target {
// MoveTargetInstance::Any(id, index) => match user.id() == id {
// true => match index == &instanc... | Rust | 0 |
);
m_data = m_data.replace(&tag_formatted[..], &text[..]);
d_validate_left = m_data.matches('{').count();
d_validate_right = m_data.matches('}').count();
}
m_data = misc::replace_with_numbers(m_data);
m_data = misc::replace_with_letter(m_data);
m_data
}
fn resolve_tag(tag: &s... | Rust | 0 |
nux:
# If we're running outside Docker (in host mode), and would like the Lambda containers to be able
# to access services running on the local machine, return `host.docker.internal` accordingly
result = "host.docker.internal"
if config.is_in_docker:
try:
... | Python | 1 |
TxToken = IpcPhyTxToken<'a>;
fn receive(&'a mut self) -> Option<(Self::RxToken, Self::TxToken)> {
if let Some(data) = self.consumer.poll() {
let rx = IpcPhyRxToken(data);
let tx = IpcPhyTxToken {
producer: &mut self.producer,
};
Some((rx, tx)... | Rust | 0 |
(any(target_arch = "x86_64", target_arch = "aarch64"))]
#[cfg(feature = "emulator")]
pub mod emulator;
//! Module provides OptsError replacement for [`structopt::clap::Error`], used
//! to override [`structopt::StructOpt::from_args()`] so as to propagate
//! errors through `main()` instead of calling [`std::process::ex... | Rust | 0 |
city: "Anytown",
country: "USA",
state: "New York",
street: "101 Main Street",
},
contact_options: [
{
home: {
email: "<EMAIL>",
phone: "212-555-4321",
},
other: {
email: "<EMAIL>",
... | Rust | 0 |
# Copyright 2016 The TensorFlow Authors. 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 applica... | Python | 1 |
Some),
);
}
slots.into_node(JSON_ROOT, children)
}
JSON_STRING => {
let mut elements = (&children).into_iter();
let mut slots: RawNodeSlots<1usize> = RawNodeSlots::default();
let mut current_eleme... | Rust | 0 |
ntrolRegisterA = UCSR0A;
type ControlRegisterB = UCSR0B;
type ControlRegisterC = UCSR0C;
type BaudRateRegister = UBRR0;
}
/// 8-bit timer.
pub struct Timer8;
impl modules::Timer8 for Timer8 {
type CompareA = OCR0A;
type CompareB = OCR0B;
type Counter = TCNT0;
type ControlA = TCCR0A;
ty... | Rust | 0 |
d.isThreePrimeOpenBond():
three_prime_bondPoint_atm1 = s1
#Find 5' and 3' bondpoints of atm2
for s2 in atm2.singNeighbors():
bnd = s2.bonds[0]
if bnd.isFivePrimeOpenBond():
five_prime_bondPoint_atm2 = s2
if bnd.isThreePrimeOpenBond():
... | Python | 1 |
, num_caminhoes)
destinos = [entrega['destino'] for entrega in entregas]
print(f"\n=== CONFIGURAÇÃO INICIAL ===")
print(f"Centros de distribuição: {', '.join(centros_distribuicao)}")
print(f"Total de entregas: {num_entregas}")
print(f"Total de caminhões: {num_caminhoes}")
# Gerar estru... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Unit tests from mathics.builtin.tensor.
"""
import sys
import time
from test.helper import check_evaluation, evaluate
import pytest
@pytest.mark.parametrize(
("str_expr", "msgs", "str_expected", "fail_msg"),
[
("Dimensions[{}]", None, "{0}", None),
("Dimensions[{{... | Python | 1 |
import pytest
import torch
import json
from rlalloc.utils.preprocessing import TraceProcessor
@pytest.fixture
def sample_trace():
return {
"deviceProperties": [{
"totalGlobalMem": 42297786368,
"maxThreadsPerBlock": 1024
}],
"traceEvents": [
{
... | Python | 1 |
inicio = int(input("Digite o inicio: "))
razão = int(input("Digite a razão: "))
i = 0
num = inicio
while i != 10:
print(f"{num}", end="-> ")
num += razão
i += 1
print("FIM!!") | Python | 1 |
let block2 = MicroBlock::from_proto(proto.get_block2())?;
Ok(SlashingProof { block1, block2 })
}
}
#[cfg(test)]
mod tests {
use super::*;
use crate::timestamp::Timestamp;
use stegos_crypto::hash::{Hash, Hashable};
use stegos_crypto::scc;
use stegos_crypto::{init_test_network_prefix, pbc... | Rust | 0 |
art_time': timestamp - len(speech_audio) / self.sample_rate,
'end_time': timestamp,
'duration': len(speech_audio) / self.sample_rate
}
self.speech_sessions.append(session)
# 限制会话历史
if len(self.speech_sessions) > 50:
self.speech_sessio... | Python | 1 |
# Code generated by lark_sdk_gen. DO NOT EDIT.
from pylark.lark_request import RawRequestReq, _new_method_option
import attr
import typing
import io
@attr.s
class UpdateBitableRecordReqFieldsValue(object):
pass
@attr.s
class UpdateBitableRecordReqFields(object):
key: str = attr.ib(
default="", meta... | Python | 1 |
れました: {len(self.action_history)} 個のアクションを実行しました")
except Exception as e:
print(f"\nエラーが発生しました: {e}")
sys.exit(1)
finally:
# リスナーを停止
if self.keyboard_listener and self.keyboard_listener.is_alive():
self.keyboard_listener.stop()
... | Python | 1 |
fg=typer.colors.RED, bold=True))
@CLI.command(rich_help_panel='Actions Commands')
def surveillance(
lat: float, lon: float, num_days: int = typer.Argument(
help="Days of Active Surveillance"),
webhook: str = typer.Argument(help="Discord Webhook url")):
"""
EXPERIMENTAL FEATURE : Work In Pr... | Python | 1 |
ome(Polarity::Positive), Polarity::Negative) => {
self.reset();
Ok(Some(Polarity::Negative))
}
_ => {
self.reset();
Err(())
}
}
}
#[inline]
pub fn reset(&mut self) {
self.p0 = None;
}
}
... | Rust | 0 |
rt=2):
ws.cell(row=i, column=1, value=row[0])
ws.cell(row=i, column=2, value=row[1])
pptx_file = relative_path(r"Data\القطمارس\الايام\القطمارس السنوي ايام (باكر).pptx")
# Extract data from PowerPoint file
prs = pptx.Presentation(pptx_file)
prs2 = Presentation()
prs2.LoadFromFile(ppt... | Python | 1 |
announced by email and follow a 1-year deprecation
* schedule. Send an email to ~sircmpwn/wlroots-announce+subscribe@lists.sr.ht
* to receive these announcements.
*/
// Will log all messages less than or equal to `verbosity`
// If `callback` is NULL, wlr will use its default logger.
// The function can be calle... | Rust | 0 |
vent loop with core_threads = number of logical cores on the machine.
// This runtime is shared among many subsystems: sync, rpc processing, tx broadcasting, price fetcher etc
let runtime = Runtime::with_default_thread_count();
// fetch service
let fetch = fetch::Client::new(FETCH_FULL_NUM_DNS_THREADS).map_err(|e|... | Rust | 0 |
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
extrudes a star polygon along a curve
Inputs:
axis: the axis curve
n : the number of points in the polygon (doubles when star)
r : the radius of the polygon
r2 : second radius to create a star polygon
sa : rotation angle at start (0 if omitted)
... | Python | 1 |
t]] | None = None,
) -> BenchmarkProblem:
"""6D Hartmann problem where first 4 dimensions are discretized."""
dim_int = 4
if bounds is None:
bounds = [
(0, 3),
(0, 3),
(0, 19),
(0, 19),
(0.0, 1.0),
(0.0, 1.0),
]
retu... | Python | 1 |
should_process = True
# 如果应该处理,发送到对话系统
if should_process:
if self.dialogue_system:
... | Python | 1 |
tput_dir) and args.do_train:
raise ValueError("Output directory ({}) already exists and is not empty.".format(args.output_dir))
checkpoint_callback = pl.callbacks.ModelCheckpoint(
filepath=args.output_dir, prefix="checkpoint", monitor="val_loss", mode="min", save_top_k=5
)
train_params = d... | Python | 1 |
# This file is part of Indico.
# Copyright (C) 2002 - 2025 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from indico.core.notifications import email_sender, make_email
from indico.web.flask.templating import get... | Python | 1 |
'B' => BRecord::parse(bytes).map(Record::B),
b'C' => Ok(Record::C),
b'D' => Ok(Record::D),
b'E' => Ok(Record::E),
b'F' => Ok(Record::F),
b'G' => Ok(Record::G),
b'H' => Ok(Record::H),
b'I' => IRecord::parse(bytes).map(Record::I),
... | Rust | 0 |
import torch
from cbm.cbm4mm import cbm4mm
from cbm import cbm_mkl_cpp as cbm_cpp
class cbm4ad(cbm4mm):
'''
CBM matrix representation and support multiplication with dense matrices:
- Represents matrix A @ D^(-1/2)in CBM, where D is a diagonal degree matrix of A.
- Supports matrix products (A @ D^(-1/2... | Python | 1 |
_if_not_exists, self.ty
)?;
for a in &self.add {
a.to_xml(fmt, depth + 2)?;
}
writeln!(fmt, "{}</archive>", prefix)?;
Ok(())
}
}
#[derive(Debug, Default)]
struct Content {
archives: Vec<Archive>,
}
impl C... | Rust | 0 |
, Read, ReadStorage},
GlobalTransform,
};
use crate::{
cam::{ActiveCamera, Camera},
mesh::Mesh,
mtl::{Material, MaterialDefaults, TextureOffset},
pass::set_skinning_buffers,
pipe::{DepthMode, Effect, EffectBuilder},
resources::ScreenDimensions,
screen_space::ScreenSpaceSettings,
ski... | Rust | 0 |
_type;
}
impl LfReturnable for () {
fn lf_type() -> _lf_type { LF_TYPE_VOID }
}
impl From<LfReturn> for () {
fn from(_: LfReturn) -> Self { () }
}
impl LfReturnable for u8 {
fn lf_type() -> _lf_type { LF_TYPE_U8 }
}
impl From<LfReturn> for u8 {
fn from(ret: LfReturn) -> Self {
ret.0 as u8
... | Rust | 0 |
department = contact.getDefaultDepartment()
department = api.get_title(department) if department else ""
properties = self.get_contact_base_properties()
properties.update({
"fullname": api.to_utf8(contact.getFullname()),
"salutation": api.to_utf8(contact.getSalutation... | Python | 1 |
// check that non foldable arguments are folded
// to_timestamp(a) --> to_timestamp(a) [no rewrite possible]
let expr = Expr::ScalarFunction {
args: vec![col("a")],
fun: BuiltinScalarFunction::ToTimestamp,
};
test_evaluate(expr.clone(), expr);
// volatile... | Rust | 0 |
.arguments
.items
.iter()
.map(|arg| arg.wrap(source))
.collect::<Vec<_>>(),
)
.finish()
}
}
impl SourceDebug for StringExpr {
fn fmt(&self, source: &str, f: &mut fmt::Formatter<'_>) -> fmt::Result {
... | Rust | 0 |
LOCATION'' with
minimum enforced-retention for backups of 1 month and 1 day, run:
$ {command} BACKUP_VAULT --location=MY_LOCATION \
--backup-min-enforced-retention="p1m1d"
To create a new backup vault ``BACKUP_VAULT'' in location ``MY_LOCATION'' with
minimum enforced-retent... | Python | 1 |
= ibv_qp_attr_mask(2);
pub const ibv_qp_attr_mask_IBV_QP_DEST_QPN: ibv_qp_attr_mask = ibv_qp_attr_mask(1048576);
pub const ibv_qp_attr_mask_IBV_QP_EN_SQD_ASYNC_NOTIFY: ibv_qp_attr_mask = ibv_qp_attr_mask(4);
pub const ibv_qp_attr_mask_IBV_QP_MAX_DEST_RD_ATOMIC: ibv_qp_attr_mask = ibv_qp_attr_mask(131072);
pub const ib... | Rust | 0 |
DCPIBootService,
]
class DCPIBootClient(StandardASC):
DVA_OFFSET = 0xf00000000
ENDPOINTS = {
0x20: AFKSystemEndpoint,
0x23: DCPIBootEndpoint,
0x24: DCPDPTXEndpoint,
0x2a: DCPDPTXPortEndpoint,
0x27: DCPAVDeviceEndpoint,
0x28: DCPAVServiceEndpoint,
... | Python | 1 |
/////////////////////////////////////////////////
// Resource
////
// Resource Wrapper. Provides OData metadata for any type.
pub struct Resource<T: Serialize + ResourceMetadata> {
resource: T,
odata_id: PathBuf,
odata_type: &'static str,
}
impl<T: Serialize + ResourceMetadata> Resource<T> {
pub fn ne... | Rust | 0 |
ges[2][0],
to_z: parsed_ranges[2][1],
target_status,
})
}
}
#[derive(Debug, Error, Eq, PartialEq)]
pub enum RebootStepFromStrError {
#[error("Encountered wrong prefix in \"{0}\", expecting on of \"on \" or \"off \"")]
WrongPrefix(String),
#[error("Could not parse \"{0}\"... | Rust | 0 |
curr_right_pos_tags = " ".join(new_pos_tags)
yield (
f"W_LEMMA_L_{i + 1}_R_{j + 1}_"
f"[{curr_left_lemmas}]_[{curr_right_lemmas}]"
)
yield (
f"W_POS_L_{i + 1}_R_{j + 1}_"
f"... | Python | 1 |
led before Receiver was attached")
.get_mut();
// Now iterate over all items that we currently have in the channel until it is
// empty again. If all senders are disconnected at some point we remove the GSource
// from the main context it was attached to as it will never ever be called again.
l... | Rust | 0 |
from typing import TYPE_CHECKING
from ...utils import (
DIFFUSERS_SLOW_IMPORT,
OptionalDependencyNotAvailable,
_LazyModule,
get_objects_from_module,
is_torch_available,
is_transformers_available,
)
_dummy_objects = {}
_additional_imports = {}
_import_structure = {"pipeline_output": ["FluxPipe... | Python | 1 |
from typing import Iterable, List
import yaml
with open("environment-unpinned.yaml", "r") as fp:
env_unpinned = yaml.load(
fp.read(),
Loader=yaml.SafeLoader,
)
with open("environment-unpinned-dev.yaml", "r") as fp:
env_unpinned_dev = yaml.load(
fp.read(),
Loader=yaml.SafeLo... | Python | 1 |
print(f'Loaded {train_df.shape[0]} train samples, {eval_df.shape[0]} eval samples and {test_df.shape[0]} test samples from large dataset.')
# Train ViT-Large model
print('\n#--- Training ViT-Large ---\n')
_, history_df, evaluation_df = train(
train_df=train_df,
eval_df=eval_df,
... | Python | 1 |
eys()
}
/// An iterator visiting all values in arbitrary order.
pub fn values(&self) -> Values<String, Value> {
self.map_ref().values()
}
/// An iterator visiting all field-value pairs in arbitrary order.
pub fn iter(&self) -> Iter<String, Value> {
self.map_ref().iter()
}
}... | Rust | 0 |
&mut set, need_to_pass, &mut ans);
ans
}
}
use crate::directory::FileHandle;
use std::io;
use std::ops::Range;
pub use ownedbytes::OwnedBytes;
impl FileHandle for OwnedBytes {
fn read_bytes(&self, range: Range<usize>) -> io::Result<OwnedBytes> {
Ok(self.slice(range))
}
}
<filename>src/rcc... | Rust | 0 |
elf.token()
if tok!="HIERARCHY":
raise (SyntaxError, "Syntax error in line %d: 'HIERARCHY' expected, got '%s' instead"%(self.linenr, tok))
tok = self.token()
if tok!="ROOT":
raise (SyntaxError, "Syntax error in line %d: 'ROOT' expected, got '%s' instead"%(self.linenr, tok))
self._root = Node(root=True)
... | Python | 1 |
' cannot be used for "
f"'{msgids[0]}' and '{msgids[1]}' at the same time."
f" If you're creating an 'old_names' use 'old-{symbol}' as the old symbol."
)
raise InvalidMessageError(error_message)
def get_active_msgids(self, msgid_or_symbol: str) -> list[str]:
"""Retur... | Python | 1 |
nse = session.request("get", "/server")
assert response["is_authenticated"]
session.set_auth_token(pre2_7_token)
response = session.request("get", "/server")
assert response["is_authenticated"]
def test_invalid_jwt(admin_session):
secret_key = "e2e-testing-key"
correct_claims = jwt.decode(adm... | Python | 1 |
:param count: 数量 -1全部/n: 从结束时间向前数n个
:param dividend_type: 除权类型"none" "front" "back" "front_ratio" "back_ratio"
:param callback:
订阅回调函数onSubscribe(datas)
:param datas: {stock : [data1, data2, ...]} 数据字典
:return: int 订阅序号
'''
import datetime as dt
if isinstance(start_time, dt.d... | Python | 1 |
import pandas as pd
from tkinter import Tk, filedialog
import pandas as pd
import matplotlib.pyplot as plt
# ฟังก์ชันสำหรับดึงข้อมูลจากไฟล์ CSV
def load_copol_data(csv_file):
try:
# อ่านข้อมูลจากไฟล์ CSV
data = pd.read_csv(csv_file)
# ตรวจสอบว่ามีคอลัมน์ copol_raw และ copol_nrb หรือไม่
... | Python | 1 |
1, EPT write permissions may be specified at the granularity of 128
/// bytes. See Section 28.2.4.
const SUB_PAGE_WRITE_PERM_EPT = 1 << 23;
/// If this control is 1, all output addresses used by Intel Processor Trace are treated as
/// guest-physical addresses and translated using EPT.... | Rust | 0 |
jogador_1, jogada_1)
jogo = jogo.jogar(jogada_1)
if jogo.venceu():
print(f"{jogador_1.imprimir()} venceu!")
break
# Turno jogador 2
print("Situação do jogo:")
jogo.imprimir()
print("==================================================")
jo... | Python | 1 |
ddress, topology):
"""
Find node from one of its addresses and its topology.
:param address: string
:param topology: Topology instance
:returns: Node object or None
"""
address = '"{}"'.format(address)
return cls.objects.filter(
topology=topolo... | Python | 1 |
of a sample key that are contained in the requested key.
// The larger the contained score, the more RPCs the cluster will receive after this splitting.
let contained_score = sample.contained as f64 / evaluated_key_num;
LOAD_BASE_SPLIT_SAMPLE_VEC
.with_label_values(&... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.