text string | label_name string | labels int64 |
|---|---|---|
if (largest_value * inv_multiplier).abs() + 0.5 >= 8192.0 {
exponent = (exponent + 1).min(MAX_EXP);
inv_multiplier = fiddle_exp2(-exponent + 13);
}
(exponent, inv_multiplier)
};
// Quantize and encode values.
let x = (floats.0.abs() * inv_multiplier + 0.5).min(... | Rust | 0 |
from app.core.utils.email import send_email, render_template
from app.core.config import config
async def send_reset_password_email(email: str, token: str) -> None:
message = {
"email": email,
"subject": f"{config.PROJECT_NAME} password reset",
"html": render_template(
"reset-p... | Python | 1 |
as_str())
.with_context(|| format!("failed to retrieve JSON from {}", url))?;
Ok(abi_or_artifact(json))
}
/// Retrieves a contract ABI from the Etherscan HTTP API and wraps it in an
/// artifact JSON for compatibility with the code generation facilities.
fn get_etherscan_contract(address: Address) -> Resul... | Rust | 0 |
return 0.0;
}
let x = &*u.successor;
let y = &*v.successor;
// Nothing happens
if u.position > v.position || x.number == v.number {
return 0.0;
}
let delta_distance = -distance_matrix.get(u.number, x.number)
- distance_matrix.get(v.... | Rust | 0 |
AmoFunction {
pub fn from_func5(func5: u8) -> Self {
match func5 {
0b00010 => AmoFunction::LR,
0b00011 => AmoFunction::SC,
0b00001 => AmoFunction::SWAP,
0b00000 => AmoFunction::ADD,
0b00100 => AmoFunction::XOR,
0b01100 => AmoFunction::... | Rust | 0 |
import os
import multiprocessing as mp
import numpy as np
import plyfile
import torch
NUSCENES_FULL_CLASSES = ( # 32 classes
'noise',
'animal',
'human.pedestrian.adult',
'human.pedestrian.child',
'human.pedestrian.construction_worker',
'human.pedestrian.personal_mobility',
'human.pedestri... | Python | 1 |
"""Tests for the minio component."""
| Python | 1 |
s", 0x5C72_644A, 0xF43F_A839),
(r"textures\tx_w_imperial_broadsword_blade00.dds", 0x5C7E_353B, 0x0EFC_FB0E),
(r"textures\tx_w_imperial_shortsword_guard00.dds", 0x5C7E_353B, 0x6C2D_066E),
(r"textures\tx_w_imperial_broadsword_guard01.dds", 0x5C7E_353B, 0xC105_FCB8),
(r"textures\tx_w_imperial_shortswor... | Rust | 0 |
);
crate::json_ser::serialize_structure_update_flow_source_input(&mut object, input);
object.finish();
Ok(smithy_http::body::SdkBody::from(out))
}
use frame_system::Config as FrameConfig;
use node_template_runtime::{Runtime, Signature, UncheckedExtrinsic};
use sp_runtime::traits::StaticLookup;
use subxt::Co... | Rust | 0 |
ing example we use the `EdgeListInput` which is an input format where
//! each line of a file contains an edge of the graph.
//!
//! ```
//! use std::path::PathBuf;
//!
//! use graph_builder::prelude::*;
//!
//! let path = [env!("CARGO_MANIFEST_DIR"), "resources", "example.el"]
//! .iter()
//! .collect::<PathBu... | Rust | 0 |
ocation that is not a delivery station");
}
}
pub fn unload(
mut car_query: Query<(&mut Car, &Position)>,
mut storage_query: Query<&mut Storage>,
consolidator_query: Query<&StorageConsolidator, With<DeliveryStation>>,
map_query: MapQuery,
mut car_events: EventReader<CarUnloadInstructionEvent>,
... | Rust | 0 |
new(
"inspect.json".to_string(),
triage::Source::Inspect,
json.to_string(),
)
.map_err(|e| EvaluationError::ParseFailure {
message: e.to_string(),
data: json.to_string(),
})?];
let result = triage::analyze(&data_vec, &self.conf... | Rust | 0 |
"""
# For Loop
# Número de 1 a 5
a = 1
for a in range(1, 6) :
print(a)
"""
"""
# For Loop
# Quebrando palavras
b = "Google é demais"
for a in b:
print(f"{a} está dentro da frase {b}")
"""
"""
# For Loop com If&Else
a = True
b = "Compra no valor de R$20,99 e entrega confirmada"
for c in range(3):
if a... | Python | 1 |
.len(), 1);
let target_header = headers.first().unwrap();
assert_eq!(target_header.name, "Location");
assert_eq!(target_header.value, r#"/bor"#);
assert_eq!(action.should_log_request(true, response_status_code), true);
}
#[test]
fn test_rule_with_header_2() {
let router = setup_rule_with_header();... | Rust | 0 |
"template_id": None,
"time": time.time(),
"remark": public.xsssec(get.remark)
}
dp.sql("stacks").insert(pdata)
else:
old_remark = stacks_info['remark']
dp.sql("stacks").where("name=?", (public.xsssec(get.name))).update({"remark": pu... | Python | 1 |
import json
from collections import Counter
def analyze_json_structure(file_path):
field_positions = {}
accept_rate_values = Counter()
total_entries = 0
with open(file_path, "r") as file:
for line_number, line in enumerate(file, 1):
try:
entry = json.loads(line)
... | Python | 1 |
from random import choice
from string import ascii_uppercase
import json
from Logic.Player import Players
from Packets.Messages.Server.GameroomData import GameroomData
from database.DataBase import DataBase
from Utils.Reader import BSMessageReader
class CreateGameroom(BSMessageReader):
def __init__(self, client... | Python | 1 |
cursor_data = data['cursor']
cursor = ''
if cursor_data['has_more']:
cursor = cursor_data['loadmore_cursor']
if media_data and len(media_data) > 0:
author = __extract_author(media_data[0]['item'])
mediaInfo = MediaInfo()
media_list = []
for _item in media_data:
... | Python | 1 |
, D=self.depthformer_dim)
depthformer_token = torch.zeros_like(depthformer_in[0])
cache = None
out_tokens: list[torch.Tensor] = []
for i in range(self.codebooks):
cur_depthformer_input = depthformer_in[i] + depthformer_token
depthformer_out, cache = self.depthfor... | Python | 1 |
assert!(matches!(
col,
Column::Integer(_, IntegerEncoding::I64(_, _))
));
for (scalar, result) in cases.clone() {
assert_eq!(col.might_contain_value(&Value::Scalar(scalar)), result);
}
// Input stored as unsigned column
let input = &... | Rust | 0 |
fct_idx, trait_fct.pos);
gen.emit_ret_void();
}
gen.pop_scope();
gen.generate(vm)
}
use std::borrow::ToOwned;
use std::char;
use rustc_serialize::Decoder as RustcDecoder;
use {Cbor, CborUnsigned, CborBytes, Type, CborResult, CborError, ReadError};
pub struct CborDecoder {
stack: Vec<Cbor>,
}... | Rust | 0 |
scoreboard.score += 1f32;
commands.despawn(collider_entity);
my_events.send(MyEvent {
message: "+1分".to_string(),
});
}
if let Collider::Death = *collider {
scoreboard.score ... | Rust | 0 |
# cinema/management/commands/populate_db.py
from django.core.management.base import BaseCommand
from CinemaApp.models import CinemaRoom, Movie, Schedule, Seat
from django.utils import timezone
import random
from datetime import timedelta
class Command(BaseCommand):
help = 'Populate the database with initial data'... | Python | 1 |
then(|p| {
stmt.query(p.iter().collect())
}).and_then(|rows| {
CallResult::result_set(rows)
});
let ptr = serializeCallResult(callResult);
trace!("Query prepared result - handing out: {:?}", ptr);
ptr
}
#[no_mangle]
pub extern "C" fn sqlQuery(
conn: &driver::PsqlConnection,
... | Rust | 0 |
_or(Duration::new(0, 0));
let tid = self.current_tid.fetch_add(1, Ordering::AcqRel);
// Prepare payload of the request phase, containing the parameters
let mut request_payload = Vec::with_capacity(params.len() * 4);
for p in params {
request_payload.write_u32::<LittleEndian... | Rust | 0 |
gridfs checksum. problem={self.problem_id} checksum={gridfs_checksum}"
)
return minio_checksum == gridfs_checksum
# TODO: hope minio SDK to provide more high-level API
def generate_urls_for_uploading_test_case(
self,
length: int,
part_size: int,
) -> UploadInfo:
... | Python | 1 |
4\x03\x12\x03a\x02-\n(\n\x04\x04\x05\x02\0\x12\x03d\x02\x18\x1a\x1b\
\x20unique\x20version\x20identifier\n\n\r\n\x05\x04\x05\x02\0\x04\x12\
\x04d\x02a-\n\x0c\n\x05\x04\x05\x02\0\x05\x12\x03d\x02\x08\n\x0c\n\x05\
\x04\x05\x02\0\x01\x12\x03d\t\x13\n\x0c\n\x05\x04\x05\x02\0\x03\x12\x03d\
\x16\x17\nH\n\x04\... | Rust | 0 |
reset_flag(netG)
else:
saveModel(opt, netG, netMean, netVar, curNetEnc, optimizerG, optimizerMean, optimizerVar, globalFtrMeanValues, globalFtrVarValues, schedulerG, schedulerMean, schedulerVar, suffix="newest")
# saving model with a different suffix
if (iterId + 1) % op... | Python | 1 |
!(
obj.parse_section(fake_section("tp_btf/foo", bytes_of(&fake_ins()))),
Ok(())
);
assert_matches!(
obj.programs.get("foo"),
Some(Program {
section: ProgramSection::BtfTracePoint { .. },
..
})
);
}
... | Rust | 0 |
tom sanity check for ORCA"""
custom_paths = None
if not self.cfg['sanity_check_paths']:
custom_paths = {'files': [], 'dirs': []}
if self.cfg['files_to_copy']:
# Convert 'files_to_copy' to list of files in build directory
for spec in self.cfg['fil... | Python | 1 |
.20_usize {
for range in named_ranges.iter() {
let found = good_tickets
.iter()
// We have checked the lengths of the vectors, so we may use the index
.all(|t| range.ranges[0].contains(&t[i]) || range.ranges[1].contains(&t[i]));
if found {... | Rust | 0 |
pub fn validate(&self) {
let projects = self.get_all_projects();
let a = self.get_user(ALICE);
// println!("A = {:?}", a);
//assert_eq!(project_names.len(), 5);
//assert!(false);
}
}
#[test]
fn init_sanity() {
let mut state = State::new();
state.create_alice()... | Rust | 0 |
lp="coder names to exclude (may be specified multiple times)",
)
parser.add_option(
"-i",
"--include",
dest="include",
action="append",
default=[],
help="coder names to include, same format as exclude",
)
parser.add_option(
"-f",
"--file",
... | Python | 1 |
an_squared_error(output_img, desired_img,
weights=mask, scope=scope)
def get_cosine_distance_loss(predictions, targets, dim=1, scope=None):
'''Assume predictions and targets are vectors
'''
if scope is not None:
scope = scope + '_cos_dist_loss'
# unit-normalize
normalized_p... | Python | 1 |
# from src.games.reversi.reversi_nnnet import NNetWrapper as NNet
from src.games.reversi.reversi_nnet import NNetWrapper as NNet
from src.lib.mcts import MCTS
self.n1 = NNet(self.game, args) if nnet is None else nnet
self.choice_mode = choice_mode
self.args = args
self.m... | Python | 1 |
.unwrap()
.as_array()
.unwrap();
assert!(!series.is_empty());
let entry = series.first().unwrap().as_object().unwrap();
assert_eq!(
entry.get("metric").unwrap().as_str().unwrap(),
"foo.counter"
);
assert_eq!(entry.get("t... | Rust | 0 |
def outerFun(gname):
def innerFun():
print("Hello World")
print(f"Gretings {gname}")
innerFun()
outerFun("Rahul")
| Python | 1 |
import json
import os
import hashlib
import pandas as pd
import numpy as np
from copy import deepcopy
def check_create_folder(file_path):
if '/' in file_path:
folder_path = '/'.join(file_path.split('/')[:-1])
if not os.path.exists(folder_path):
os.makedirs(folder_path)
def save_json(... | Python | 1 |
import numpy as np
import torch
from training.training.utils import recursive_to
def dace_batch_to(batch, device, label_norm):
seq_encodings, attention_masks, loss_masks, run_times, labels, sample_idxs = batch
recursive_to(seq_encodings, device)
recursive_to(attention_masks, device)
recursive_to(run_... | Python | 1 |
extern crate libc;
extern crate libsensors_sys as libsensors;
pub use libsensors::sensors_feature_type as FeatureType;
pub use libsensors::sensors_subfeature_type as SubfeatureType;
use std::ffi::CStr;
use std::marker::PhantomData;
use std::path::{Path, PathBuf};
use std::sync::{Once, ONCE_INIT};
static INIT: Once =... | Rust | 0 |
print ('\x1b[36m||')
open('CP/'+cpc,'a').write(idf+' • '+pw+'\n')
akun.append(idf+' • '+pw)
cp+=1
break
elif "c_user" in ses.cookies.get_dict().keys():
ok+=1
coki=po.cookies.get_dict()
... | Python | 1 |
# Copyright 2024 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 |
ion<(D::Note, D::Recipient)>> {
batch_note_decryption(ivks, outputs, try_compact_note_decryption_inner)
}
fn batch_note_decryption<D: BatchDomain, Output: ShieldedOutput<D, CS>, F, FR, const CS: usize>(
ivks: &[D::IncomingViewingKey],
outputs: &[(D, Output)],
decrypt_inner: F,
) -> Vec<Option<FR>>
wher... | Rust | 0 |
Python, m: &PyModule) -> PyResult<()> {
m.add_wrapped(pyo3::wrap_pyfunction!(launch_appenders))?;
m.add_wrapped(pyo3::wrap_pyfunction!(create_rt))?;
m.add_class::<QueueReceiver>()?;
Ok(())
}
<gh_stars>0
// This file was generated by gir (https://github.com/gtk-rs/gir)
// from gir-files (https://github... | Rust | 0 |
BR-DCA" => "Rio de Janeiro",
"1KLSB-BR-DD" => "São Paulo",
"1KLSB-BR-E" => "Brazil: South Region",
"1KLSB-BR-EA" => "Parana",
"1KLSB-BR-EB" => "Santa Catarina",
"1KLSB-BR-EC" => "Rio Grande do Sul",
"1KLSC" => "Colombia",
"1KLSC-CO-A" => "Colombia: Amazonian Region",
"1KLSC-CO-B" => "Col... | Rust | 0 |
isdead,
mob,
missile_flag,
} = data;
let mut buckets = Array2D::<Bucket>::new(BUCKETS_X, BUCKETS_Y);
(&*ent, &pos, &rot, &team, &plane, &player_flag)
.join()
.filter(|(ent, _, _, _, _, _)| isspec.get(*ent).is_none() && isdead.get(*ent).is_none())
.for_each(|(ent, pos, rot, team, plane, _)| {
... | Rust | 0 |
eq_m256i(r, _mm256_setzero_si256());
let r = _mm256_maskz_shldi_epi32::<2>(0b11111111, a, b);
let e = _mm256_set1_epi32(6);
assert_eq_m256i(r, e);
}
#[simd_test(enable = "avx512vbmi2,avx512vl")]
unsafe fn test_mm_shldi_epi32() {
let a = _mm_set1_epi32(1);
let b = _mm... | Rust | 0 |
import torch
from typing import Union
from numpy import ndarray
from torch import Tensor
from utils.public_function import (
check_para,
ElectronInfo,
)
from libs.C_extension import get_hij_torch
class CIWavefunction:
"""
CI Wavefunction class
"""
coeff: Tensor
space: Tensor
device:... | Python | 1 |
following conditions
// are met:
//
// - Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in
// ... | Rust | 0 |
print(f"\n开始生成靓号 (使用{('助记词' if mode == 'mnemonic' else '私钥')}模式),请稍等...")
start_time = time.time()
try:
generator.generate_addresses(patterns, count)
except KeyboardInterrupt:
print("\n程序已停止")
finally:
generator.stop()
end_time = time.time()
print(f"\n总... | Python | 1 |
self.canvas = iface.mapCanvas()
self.unitsComboBox.addItems(DISTANCE_LABELS)
def setPoint(self, pt):
self.pt = pt
def accept(self):
closeline = self.closeLineCheckBox.isChecked()
declination = self.declinationSpinBox.value()
try:
valuestr = str(self.values... | Python | 1 |
marily as a lint.
#[derive(Debug, Clone)]
pub struct Cube<const N: usize> {
/// Faces of the cube, ordered F R U B L D.
faces: [Face<N>; 6],
}
/// A face of an NxN cube.
/// Not `Copy` primarily as a lint.
#[derive(Debug, Clone)]
pub struct Face<const N: usize> {
rows: [[Colour; N]; N],
}
/// The colour o... | Rust | 0 |
x09\xd3\x93C\x08\x84&\xe5PX\x00\xadU\x1e\xc8\xc0\
\x06V\x00q\x10!\x18NR{\xe2\xc1\x1cCg\x98\
\x07\xe3\x02\xfeC)\xd9\xad<Y\x0a\xf2\xd7\x03\x86e\
u\x0f\xc0\xc2z1w\x8f\x8aj\xcc\x80\xdaE\xb8\x8c\
\x18\xc7)\x19\xb9|P\xa8\xa7\xfa\x89\x13\x22?\x98O\
\x818\x8e\x83\xc8\x00\xf7\x00ET,~\x0f\x1b\x5c\x95\
@\xb8\x10.\xe3'\x87\xc0\xcd... | Python | 1 |
([0; LEN]);
b.iter(|| {
data.iter()
.cloned()
.chain([1].iter().cloned())
.chain([2].iter().cloned())
.collect::<Vec<_>>()
});
}
#[bench]
fn bench_nest_chain_chain_collect(b: &mut Bencher) {
let data = black_box([0; LEN]);
b.iter(|| {
data... | Rust | 0 |
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..', '..')))
import utils3d
import numpy as np
import torch
def run():
for i in range(100):
if i == 0:
spatial = []
vertices = np.array([[0, 0, 0], [1, 0, 0], [1, 0, 0]], dtype=flo... | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
g())
except FileNotFoundError:
print(f"Error: File '{script_path}' not found.")
def run_repl(self) -> None:
"""Run the Lunfardo REPL (Read-Eval-Print Loop)."""
default_color = "\x1b[;;m"
while True:
try:
text = input(f"{default_color}Lunfardo... | Python | 1 |
"""
akamai.edgegrid
~~~~~~~~~~~~~~~
This library provides an authentication handler for Requests that implements the
Akamai {OPEN} EdgeGrid client authentication protocol as
specified by https://developer.akamai.com/introduction/Client_Auth.html.
For more information visit https://developer.akamai.com.
usage:
>>... | Python | 1 |
[doc = "*Required features: `\"Win32_System_WindowsProgramming\"`*"]
pub const WLDP_LOCKDOWN_DEFINED_FLAG: u32 = 2147483648u32;
#[doc = "*Required features: `\"Win32_System_WindowsProgramming\"`*"]
pub const WLDP_LOCKDOWN_EXCLUSION_FLAG: u32 = 16u32;
#[doc = "*Required features: `\"Win32_System_WindowsProgramming\"`*"]... | Rust | 0 |
3, ctcif3, cgif3
),
C4: (
ccr4, CCR4,
cndtr4, CNDTR4,
cpar4, CPAR4,
cmar4, CMAR4,
htif4, tcif4,
chtif4, ctcif4, cgif4
),
C5: (
ccr5, CCR5,
cndtr5, CNDTR5,
cpar5, CPAR5,
... | Rust | 0 |
// 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 writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARR... | Rust | 0 |
}
/// Applies damage if this object has Fighter and returns kill XP in an option
/// on this object's death
pub fn take_damage(&mut self, damage: i32, game: &mut Game) -> Option<i32> {
// Apply damage if possible
if let Some(fighter) = self.fighter.as_mut() { // Mutable borrow of &mut ... | Rust | 0 |
Weight, WEIGHT_PER_SECOND},
},
ConsensusEngineId, transactional
};
use frame_system::{EnsureRoot, EnsureOneOf};
use pallet_session::historical as pallet_session_historical;
use pallet_transaction_payment::CurrencyAdapter;
pub use primitives::{
AccountId, AccountIndex, Balance, BlockNumber, DigestItem, Hash,
Index,... | Rust | 0 |
loss_raw = criterion_eval(ensemble_logits, labels)
valid_mask = masks.unsqueeze(-1).expand_as(loss_raw)
loss_sum += (loss_raw * valid_mask).sum().item()
valid_count += valid_mask.sum().item()
valid_mask_2d = valid_mask[..., 0].cpu().numpy()... | Python | 1 |
LeastTime = 4224,
IntervalInt = 4225,
IntervalReal = 4226,
GEInt = 130,
GEReal = 131,
GEDecimal = 132,
GEString = 133,
GETime = 134,
GEDuration = 135,
GEJson = 136,
EQInt = 140,
EQReal = 141,
EQDecimal = 142,
EQString = 143,
EQTime = 144,
EQDuration = 145,
... | Rust | 0 |
."]
pub fn av_bsf_free(ctx: *mut *mut AVBSFContext);
}
extern "C" {
#[doc = " Get the AVClass for AVBSFContext. It can be used in combination with"]
#[doc = " AV_OPT_SEARCH_FAKE_OBJ for examining options."]
#[doc = ""]
#[doc = " @see av_opt_find()."]
pub fn av_bsf_get_class() -> *const AVClass;
... | Rust | 0 |
import re
# check if link is valid
def isDomain(string):
domain = r"^https?://([a-zA-Z0-9.]+)(?:/|$)"
if string is None:
return False
if re.search(domain, string):
return True
else:
return False
link = input("Enter Url: ")
print(isDomain(link))
| Python | 1 |
al secret and the
/// public key of the other participant in the exchange.
pub fn diffie_hellman(&self, public_key: &PublicKey<C>) -> SharedSecret<C> {
diffie_hellman(&self.scalar, public_key.as_affine())
}
}
impl<C> From<&EphemeralSecret<C>> for PublicKey<C>
where
C: Curve + ProjectiveArithmet... | Rust | 0 |
I provided API.\n\nThis register you can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [baw_meas_2](baw_meas_2) module"]
pub type BAW_MEAS_2 = crate::Reg<u32, _BAW_MEAS_2>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct... | Rust | 0 |
from decouple import config
from .base import *
DEBUG = config("DEBUG", default=False, cast=bool)
# Security setting
SECRET_KEY = config("SECRET_KEY")
# Debug should be False in production
DEBUG = False
# Your domain name
DOMAIN = config("DOMAIN")
# Hosts/domain names that Django site can serve
ALLOWED_HOSTS = [
... | Python | 1 |
Some::All`.
impl<T> Default for AllOrSome<T> {
fn default() -> Self {
AllOrSome::All
}
}
impl<T> AllOrSome<T> {
/// Returns whether this is an `All` variant.
pub fn is_all(&self) -> bool {
matches!(self, AllOrSome::All)
}
/// Returns whether this is a `Some` variant.
#[allo... | Rust | 0 |
{
Some(watermarks) => {
let task_number = source_task_id.task_number as usize;
if task_number >= watermarks.len() {
panic!(
"unreached! parent job's parallelism is {}, but reached `task_number` {}",
watermar... | Rust | 0 |
ER BY`).
# * `INSERT INTO`: Thêm dữ liệu mới.
# * `UPDATE`: Cập nhật dữ liệu hiện có (`SET`, `WHERE`).
# * `DELETE`: Xóa dữ liệu (`WHERE`).
# * `CREATE TABLE`: Tạo bảng mới.
# * `ALTER TABLE`: Sửa đổi cấu trúc bảng.
# * `DROP TABLE`: Xóa bảng.
# * `CREATE DATABASE... | Python | 1 |
from typing import Any, Dict, Type, TypeVar, Union
import attr
from ..types import UNSET, Unset
T = TypeVar("T", bound="ApiBatchFieldUpdate")
@attr.s(auto_attribs=True)
class ApiBatchFieldUpdate:
"""Represents batch update of a single field to a given value.
Attributes:
update_type (str):
... | Python | 1 |
don't want to depend on that
data: usize,
}
impl ActivityData {
pub fn new() -> ActivityData {
Default::default()
}
pub fn update(&mut self, new_data: &ActivityData) {
self.data = self.data + new_data.data;
}
pub fn is_changed(&self, other: &ActivityData) -> bool {
self.... | Rust | 0 |
ogger.error(f"Message: {exception.error.message}")
raise
# 翻译openai API函数
async def translate_openai(text, source_lang, target_lang, session):
url = openai_url
headers = {
"Authorization": "Bearer %s" % openai_api_key,
"Content-Type": "application/json"
}
prompt = openai_prompt... | Python | 1 |
def wrapper(*args: Any, **kwargs: Any) -> TestResult:
"""Check the device's hardware model and conditionally run or skip the test.
This wrapper inspects the hardware model of the device the test is run on.
If the model is in the list of specified platforms, the test is either skippe... | Python | 1 |
# -*- coding: utf-8 -*-
"""tradeclose."""
from .baserequest import BaseRequest
class TradeCloseRequest(BaseRequest):
"""create a TradeCloseRequest.
TradeCloseRequest is used to build the body to close a trade.
The body can be used to pass to the TradeClose endpoint.
"""
def __init__(self, units... | Python | 1 |
est]
fn reading_hashmap_set_from_lua_works() {
let mut lua = Lua::new();
lua.execute::<()>(r#"v = { [1] = 2, [2] = 3, [3] = 4 }"#).unwrap();
let read: HashMap<_, _> = lua.get("v").unwrap();
assert_eq!(
read,
[2., 3., 4.].iter().enumerate()
.m... | Rust | 0 |
e = "dim2")]
use crate::shape::Capsule;
use crate::shape::{HeightField, Shape, SimdCompositeShape};
use crate::utils::hashmap::{Entry, HashMap};
use crate::utils::{IsometryOpt, MaybeSerializableData};
#[cfg(feature = "serde-serialize")]
use erased_serde::Serialize;
#[cfg_attr(feature = "serde-serialize", derive(Serial... | Rust | 0 |
#
# This file is part of the Chemical Data Processing Toolkit
#
# Copyright (C) Thomas Seidel <thomas.seidel@univie.ac.at>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | Python | 1 |
:type RolloverMaxAge: str
:param _RolloverDynamic: 是否开启动态滚动
注意:此字段可能返回 null,表示取不到有效值。
:type RolloverDynamic: str
:param _ShardNumDynamic: 是否开启动态分片
注意:此字段可能返回 null,表示取不到有效值。
:type ShardNumDynamic: str
:param _TimestampField: 时间分区字段
注意:此字段可能返回 null,表示取不到有效值。
:type Ti... | Python | 1 |
be extended to provide validation as in go code
// For now it's fine, because k8s API server will return an error
if field_manager.len() > 128 {
return Err(ErrorKind::RequestValidation("Failed to validate PatchParameters::field_manager!".to_owned()).into())
}
}
... | Rust | 0 |
"""Air Purifier Base Class."""
from __future__ import annotations
import logging
from typing import TYPE_CHECKING
from pyvesync.base_devices.vesyncbasedevice import DeviceState, VeSyncBaseDevice
if TYPE_CHECKING:
from pyvesync import VeSync
from pyvesync.device_map import AirFryerMap
from pyvesync.model... | Python | 1 |
::cmp::min(end - start, 128000) as usize;
let mut buf = Vec::<u8>::new();
buf.resize(buflen, 0);
let result = task::block_in_place(|| fs.file.read_at(&mut buf, start));
let n = match result {
Ok(n) if n == 0 => break,
Ok(n) => n,
... | Rust | 0 |
peOf(Integer)",
language="OCL"
)
constraint_Book_13_1: Constraint = Constraint(
name="constraint_Book_13_1",
context=Book,
expression="context Book inv inv3: self.pages.oclIsTypeOf(String)",
language="OCL"
)
constraint_Library_14_1: Constraint = Constraint(
name="constraint_Library_14_1",
co... | Python | 1 |
# Set
# 1. Unique elements
# 2. Un-ordered elements
# 3. Im-mutable elements
# 4. it-self mutable
# method-1 to define set
setElements = set([2, 3, 4, (5, 5, 5), 3, 2]) # empty set
print("setElements : ", setElements)
# method-2 to define set
setElements2 = {2, 3, 4, 5, 5, 5, 3, 2} # empty dictionary... | Python | 1 |
dbg += &format!("{:.4}", value);
}
eprintln!("{:?} = [{}]", name, dbg);
}
}
Ok(map)
}
<filename>src/interpreter/value/symbol/symbol.rs
#[derive(Debug, Clone, PartialEq, Hash, Eq)]
pub struct Symbol {
name: String,
gensym_id: usize,
}
impl Symbol {
p... | Rust | 0 |
ers, Quam]):
"""Update the relevant parameters if the qubit data analysis was successful."""
with node.record_state_updates():
for q in node.namespace["qubits"]:
if node.outcomes[q.name] == "failed":
continue
q.gate_fidelity[node.parameters.interleaved_gate_operat... | Python | 1 |
ERR_NOT_FOUND : zx_status_t = -25;
pub const ZX_ERR_ALREADY_EXISTS : zx_status_t = -26;
pub const ZX_ERR_ALREADY_BOUND : zx_status_t = -27;
pub const ZX_ERR_UNAVAILABLE : zx_status_t = -28;
pub const ZX_ERR_ACCESS_DENIED : zx_status_t = -30;
pub const ZX_ERR_IO : zx_status_t = -4... | Rust | 0 |
t = int(input())
for _ in range(t):
str = input()
print(str[0]+str[-1]) | Python | 1 |
4]}.json'
if output_file_name in processed_images:
continue
image_path = f"{image_dir_path}/{image_name}"
try:
tag2text_tags = json.load(open(f"{tags_dir_path}/tag2text/{image_name[:-4]}.json", 'r'))
except Exception as e:
print(f"Tag2Text exception a... | Python | 1 |
}
}
}
/// 最后一项,可先偏移
pub fn tail(&self, shift: usize) -> &T {
match shift {
0 => {
return self.q.last().unwrap();
}
_ => {
let x = self.shift(shift);
return x.last().unwrap();
}
... | Rust | 0 |
': (0.3499999940395355, 0.550000011920929, 0.36000001430511475, 1.0),
'MATERIAL': (0.9200000166893005, 0.46000000834465027, 0.5099999904632568, 1.0),
'OBJECT': (0.9300000071525574, 0.6200000047683716, 0.36000001430511475, 1.0),
'ROTATION': (0.6499999761581421, 0.38999998569488525, 0.7... | Python | 1 |
lp",
"Show help about a topic.",
"help [topic]",
&[],
"Show help about a topic or list available commands.",
),
]
}
<reponame>alcarney/gtk4-rs<filename>book/listings/todo/4/window/imp.rs
use std::cell::RefCell;
use std::fs::File;
use gio::Settings;
use glib::... | Rust | 0 |
}
vectors.push(lll.shift_matrix[vec_i].clone());
alphas.push(alpha);
vertices.clear();
}
vectors.shrink_to_fit();
alphas.shrink_to_fit();
(vectors, alphas)
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn test_voronoi_vectors() {... | Rust | 0 |
the search, else returns `Null`.
pub fn find_other(
&self,
view_id: ViewId,
wrap_around: bool,
allow_same: bool,
modify_selection: Option<ModifySelection>,
) {
self.send_edit_cmd(
view_id,
"find_other",
&json!(
... | Rust | 0 |
# Copyright 2025 The Google Research Authors.
#
# 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 agree... | Python | 1 |
# Copyright 2014 NEC Corporation. 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 ... | Python | 1 |
e968:6179::de52:7100]:1789",
"pubKey": "<KEY>",
"version": "0.6.0",
"location": "Glarus",
"layer": 2,
"lastSeen": 1587572945920982000
}
],
"mixProviderNodes":[],
"gatewayNodes": [
{
"clientListener": ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.