text string | label_name string | labels int64 |
|---|---|---|
true, value_name = "TUNING", default_value = &TUNING_STR, possible_values = &Tuning::variants())]
tuning: Tuning,
#[structopt(subcommand)]
cmd: Subcommand,
}
#[derive(StructOpt)]
enum Subcommand {
/// Chord chart lookup
Chart {
/// Print out all voicings of <chord> that fulfill the given c... | Rust | 0 |
let collections_vec = file_desc_from_path(&mut bare_repos_cache);
let summary: Vec<RepoInfo> = stats_from_file_desc_list(collections_vec);
let tmp = chkout_list_to_string(limit, summary);
output.push_str(&tmp);
output
}
#[cfg(test)]
mod top_crates_git_repos_bare {
use super::*;
use pretty_asse... | Rust | 0 |
Env::new().filter_or("STYLUS_LOG", default));
match parse_config_from_args().expect("Unable to parse configuration") {
OperationMode::Run(config) => crate::http::run(config).await,
OperationMode::Dump(config) => {
let monitors = parse_monitor_configs(&config.monitor.dir)
... | Rust | 0 |
import difflib
import re
from collections import defaultdict
from typing import Optional, Dict
import difflib
CODE_BLOCK_CHANGE_PATTERN = re.compile(r"```(\w+):([^:]+):(\d+):(\d+)\n([\s\S]*?)```", re.DOTALL)
# TODO 根据prompt的格式修改该正则表达式
CODE_BLOCK_REPLACE_PATTERN = re.compile(
r"```(\w+):([^:\n]+)\n<<<<<<< SEARCH\n... | Python | 1 |
or the additional register state used by Intel® Memory Protection Extensions (`MPX` state) for the 64-bit user-mode `MPX` configuration register `BNDCFGU` and the 64-bit `MPX` status register `BNDSTATUS (`BNDSCR` state).
BNDCSR_MPX = 4,
/// The state component used for the the additional register state used by Intel... | Rust | 0 |
let err = svc_error::Error::builder()
.kind("general", "General API error")
.status(status)
.detail(&format!("invalid request method = '{}'", method))
.build();
let resp = OutgoingResponse::unicast(err, props.to_response(status), props).into_envelope()?;
// Publishing error... | Rust | 0 |
= "
match 0, 1
0, 0 or 1, 1 then -1
_, 0 or _, 99 then -2
x, 0 or x, 2 then -3
0, _ or 1, _ then -4 # The first alternative (0, _) should match
_ then -5
";
test_script(script, Number(-4.0));
}
#[test]
fn match_on_multiple_expressions_with_alternatives_id() {
... | Rust | 0 |
() {
if !matches!(chr, 'A'..='Z' | '_') {
self.rewind();
return;
}
}
}
pub fn parse(&mut self, env: &mut Environment<'_, '_, '_>) -> Result<Value, ParseError> {
match self.peek().ok_or(ParseError::NothingToParse)? {
// note that this is ascii whitespace, as non-ascii characters are invalid.
'... | Rust | 0 |
mitive(method) => method(self, ¬_understood, env),
Method::Interpreter(closure) => {
closure.apply(Some(self), ¬_understood, env)
}
Method::Reader(index) => read_instance_variable(self, *index),
... | Rust | 0 |
enger_Kill_Share_Magrider_HIVE_XP_Target = 1137,
Vehicle_Passenger_Kill_Share_Mosquito_HIVE_XP_Target = 1138,
Vehicle_Passenger_Kill_Share_Prowler_HIVE_XP_Target = 1139,
Vehicle_Passenger_Kill_Share_Reaver_HIVE_XP_Target = 1140,
Vehicle_Passenger_Kill_Share_Scythe_HIVE_XP_Target = 1141,
Vehicle_Pass... | Rust | 0 |
0)
} else {
Err(Error::new(EPERM))
}*/
} else {
Err(Error::new(EBADF))
}
}
fn fstat(&self, id: usize, stat: &mut Stat) -> Result<usize> {
println!("Fstat {}, {:X}", id, stat as *mut Stat as usize);
let files = self.files.lock()... | Rust | 0 |
)
materials.append(Material(data=[float(content[5]), float(content[6])]))
i += 1
break
f.close()
return surfaces, materials
def init_sel(self, div_rate=0.1, draw=True, max_num=200):
device = self.basics.device
conte... | Python | 1 |
else:
df_renew = df[source] # CONVERTIR EN FUNCION
#df2 = create_df(df_renew,source)
df2 = pd.DataFrame({"ds": df[data_yml["date"]], "y": df_renew})
Serie = timeseries()
Serie.name = source
Serie.units = "MWh"
... | Python | 1 |
True,
serialize=False,
verbose_name="Database ID",
),
),
("current_score", models.IntegerField()),
(
"user",
models.OneToOneField(
on_delete... | Python | 1 |
def print_common_numbers(list1, list2):
# Convert lists to sets
set1 = set(list1)
set2 = set(list2)
# Find intersection of sets
common_numbers = set1 & set2
# Print common numbers
for number in common_numbers:
print(number)
# Test the function
list1 = [1, 2, 3, 4, 5]
list2 = [4, 5... | Python | 1 |
from math import radians, cos, sin, asin, sqrt, atan2, degrees
#------------------------------------------------------------
#get from https://stackoverflow.com/questions/4913349/haversine-formula-in-python-bearing-and-distance-between-two-gps-points
#------------------------------------------------------------
def h... | Python | 1 |
doc = "Use the VBUS_VALID_3V detector results for signal reported to the USB controller"]
_1,
}
impl VBUSVALID_SELR {
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[i... | Rust | 0 |
settings.llm.path, local_files_only=True, trust_remote_code=True, revision="v1.1.0")
if not (settings.llm.lora == '' or settings.llm.lora == None):
print('Lora模型地址', settings.llm.lora)
from peft import PeftModel
model = PeftModel.from_pretrained(model, settings.llm.lora,adapter_name=sett... | Python | 1 |
b.rs
#![deny(missing_docs, unsafe_code)]
//! # Queue
//!
//! 消息队列消费相关
//!
use jinshu_rpc::domain::message::Message as RpcMessage;
use std::borrow::Cow;
use std::fmt::Debug;
use std::mem::size_of;
use uuid::Uuid;
/// 配置
pub mod config;
/// 错误
pub mod error;
/// Kafka
pub mod kafka;
/// Pulsar
pub mod pulsar;
/// 对消费到... | Rust | 0 |
");
let (server, address) = rx.recv().expect("Failed to receive server");
(OpenIDServerShutdownHandle(server, join_handle), address)
}
/// The handler for the OpenID server's discovery document endpoint. The discovery document only
/// contains the feilds that are used by the `OpenIdOAuth... | Rust | 0 |
) -> AccountId
where
AccountPublic: From<<TPublic::Pair as Pair>::Public>,
{
AccountPublic::from(get_from_seed::<TPublic>(seed)).into_account()
}
fn get_account_id_from_seed_string<TPublic: Public>(seed: &str) -> AccountId
where
AccountPublic: From<<TPublic::Pair as Pair>::Public>,
{
AccountPublic::fro... | Rust | 0 |
2047, 13835058055282163712, 0, 0, 0, 0],
15754u32 => [0, 0, 9222246136947933184, 0, 0, 0, 562881233944576, 0, 0, 0],
15734u32 => [268434944, 0, 0, 0, 16383, 17870283321406128128, 0, 0, 0, 0],
15457u32 => [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
15512u32 => [0, 0, 1152780767118491648, 0, 0, 0, 70360154243072, 0, 0, 0],
1571... | Rust | 0 |
class Carro:
# Atributo de classe
# Acesso Não precisa de craição de uma instância
rodas = 4
# Contrutor
def __init__(self, marca, ano):
# Atributo de instância
# Acesso - Precisa de criação de instância
self.marca = marca
self.ano = ano
# Método de classe... | Python | 1 |
(Err(err)) => return Poll::Ready(Err(MqttError::from(err))),
Poll::Pending => return Poll::Pending,
}
}
}
}
}
}
pub struct DefaultProtocolServer<Io, Err, InitErr> {
ver: ProtocolVersion,
_t: marker::PhantomData<(Io, Err, InitEr... | Rust | 0 |
channel,
architecture):
if channel == 1:
# 1 channel input
mfcc = getMFCCBands2DMadmom(audio_filename, fs=fs, hopsize_t=hopsize_t, channel=1)
mfcc_scaled = scaler_0.transform(mfcc)
mfcc_reshaped = featureReshape(mfcc_scaled, nlen=7)
m... | Python | 1 |
::TYPE_INT32,
Type::TYPE_FIXED64,
Type::TYPE_FIXED32,
Type::TYPE_BOOL,
Type::TYPE_STRING,
Type::TYPE_GROUP,
Type::TYPE_MESSAGE,
Type::TYPE_BYTES,
Type::TYPE_UINT32,
Type::TYPE_... | Rust | 0 |
# try:
# file = open("tecnologias", 'r')
# content = file.readline()
# while content:
# content = content.rstrip()
# print(content)
# content = file.readline()
# file.close()
# except FileNotFoundError:
# print("Arquivo não encontrado")
# except Exception as e:
# print(f... | Python | 1 |
PWC-Net works on RGB images, we have to convert YUV img into RGB img.
rgb_2 = Image.open(data_list[num * N_seq + ss*(seq + 1)])
rgb_2 = np.array(rgb_2, dtype=np.float32)
rgb_2 = YUV2RGB(rgb_2) # since PWC-Net works on RGB images, we have to convert YUV img into RGB img... | Python | 1 |
from brick_server.auth.auth_server import auth_router
from brick_server.auth.authorization import create_jwt_token, parse_jwt_token
from brick_server.models import get_doc
from brick_server.services.models import jwt_security_scheme
from fastapi import Depends, Path
from fastapi.security import HTTPAuthorizationCredent... | Python | 1 |
return norm_inputs * scale + offset
def smoothed_softmax_cross_entropy_with_logits(**kwargs):
logits = kwargs.get("logits")
labels = kwargs.get("labels")
smoothing = kwargs.get("smoothing") or 0.0
normalize = kwargs.get("normalize")
scope = kwargs.get("scope")
if logits is None or labels... | Python | 1 |
/// Kreyòl ayisyen (Haitian Creole)
Hat = 78,
/// Ilokano (Ilocano)
Ilo = 79,
/// Ikirundi (Rundi)
Run = 80,
/// ChiShona (Shona)
Sna = 81,
/// ئۇيغۇرچە (Uyghur)
Uig = 82,
/// Afrikaans (Afrikaans)
Afr = 83,
/// Lingua Latina (Latin)
Lat = 84,
/// Slovenčin... | Rust | 0 |
"Indicator send when the BLE BUCK asserts blebuck_comp1 for about 21.6us (10 percent margin of error) or more"]
#[inline(always)]
pub fn set4(self) -> &'a mut W {
self.variant(ZEROLENDETECTTRIM_A::SET4)
}
#[doc = "Indicator send when the BLE BUCK asserts blebuck_comp1 for about 16.2us (10 perce... | Rust | 0 |
will you choose to kill yourself?"`')
if x == 54:
await event.edit('`"What’s the best news you\'ve heard in the last 24 hours?"`')
if x == 55:
await event.edit(
'`"What is the most important change that should be made to your country’s education system?"`'
)
if x == ... | Python | 1 |
= prepare_frozen_neuron("static_synapse")
using_static_synapse_hpc = prepare_frozen_neuron("static_synapse_hpc")
assert using_static_synapse_hpc == using_static_synapse
def test_frozen_connected_neuron_before_connect():
using_static_synapse = prepare_frozen_neuron("static_synapse", 0)
using_static_s... | Python | 1 |
bit-wise wrapping operations.
pub mask: SuperUsize,
/// A Vec that holds this RingBuffer's data.
vec: SuperVec,
}
// only outside ring buffer has the drop function.
impl Drop for RingBuffer {
fn drop(&mut self) {
// only dpdk process is responsible for munmap the ringbuffer
if self.sh... | Rust | 0 |
data,
} => {
let message = Message {
msg_type: 1,
piece: *piece,
total_size: Some(*total_size),
};
bencode_serialize_to_writer(message, buf).unwrap();
buf.write_all(data.as_ref())... | Rust | 0 |
|- (<=) =
(@(<=). (!m. m <= 0 <=> m = 0) /\
(!m n. m <= SUC n <=> m = SUC n \/ m <= n)));
("EXP",
|- (EXP) =
(@(EXP). (!m. m EXP 0 = 1) /\ (!m n. m EXP SUC n = m * m EXP n)));
("*", |- (*) = (@(*). (!n. 0 * n = 0) /\ (!m n. SUC m * n = m * n + n)));
("+", |- (+) = (@(+). (!n. ... | Rust | 0 |
import random
def bubble_sort(arr, comparison_function):
swaps = 0
sorted = False
while not sorted:
sorted = True
for idx in range(len(arr) - 1):
if comparison_function(arr[idx], arr[idx + 1]):
sorted = False
arr[idx], arr[idx + 1] = arr[idx + 1]... | Python | 1 |
import unittest
import string
from ..src.idgenerator import (
generate_password,
generate_guid,
generate_credit_card_number,
generate_object_id,
generate_pin_number,
)
from ..src.utils import luhn_checksum
class GeneratorTest(unittest.TestCase):
def test_generate_password(self) -> None:
... | Python | 1 |
messagebox.showerror("Erreur", "Entrez le nom pour supprimer la réservation.")
return
nouvelle_liste = []
supprime = False
try:
with open("fichier.csv", "r", newline='', encoding='utf-8') as f:
reader = csv.reader(f, delimiter=";")
... | Python | 1 |
import discord
from discord import app_commands
from discord.ext import commands
from function import *
class HelpCommand(commands.Cog):
def __init__(self, bot):
self.bot = bot
@app_commands.command(name="help", description="Show help command")
async def helpcommand(self, interaction: discord.Inte... | Python | 1 |
EndIndex: Counter,
Self: NonScalarDim,
Self::Output: NonScalarDim,
{
type Output;
type Index;
}
pub type DFlattenUntilOutput<List, NewName, End, EndIndex> =
<List as DFlattenUntil<NewName, End, EndIndex>>::Output;
pub type DFlattenUntilIndex<List, NewName, End, EndIndex> =
<List as DFlattenUnt... | Rust | 0 |
W_HEIGHT, pixel_fmt); canvas.window(), GT);
msg!(surface.set_blend_mode(BlendMode::Blend); canvas.window(), GT);
let surface_bg = Color::RGBA(palette[8].r, palette[8].g, palette[8].b, 0);
// fill basket by random figures
basket.rnd_fill(figures);
// fps block
let fps = config.get("game", "fps... | Rust | 0 |
c.write_normal(node.inputs[3])
state.out_roughness = c.parse_value_input(node.inputs[1])
if state.parse_opacity:
state.out_opacity = '0.0'
state.out_ior = c.parse_value_input(node.inputs[2])
def parse_bsdfhair(node: bpy.types.ShaderNodeBsdfHair, out_socket: NodeSocket, state: ParserState)... | Python | 1 |
from Config import *
import direct.directbase.DirectStart
from direct.gui.OnscreenText import OnscreenText
from direct.gui.DirectGui import *
from pandac.PandaModules import *
from direct.interval.IntervalGlobal import *
import GUI
import os
import os.path
from operator import itemgetter, attrgetter
# GUI.Blueprint('... | Python | 1 |
umns, field_columns.into())
}
/// Create a SeriesSetPlan that will not produce any Group items
pub fn new(
table_name: Arc<String>,
plan: LogicalPlan,
tag_columns: Vec<Arc<String>>,
field_columns: FieldColumns,
) -> Self {
let num_prefix_tag_group_columns = None;... | Rust | 0 |
class Solution:
def robotWithString(self, s: str) -> str:
ans = []
count = collections.Counter(s)
stack = []
for c in s:
stack.append(c)
count[c] -= 1
minChar = self._getMinChar(count)
while stack and stack[-1] <= minChar:
ans.append(stack.pop())
return ''.join(an... | Python | 1 |
import os
import numpy as np
from config import Config
from env_utils import EnvWrapper
# from env_utils import get_obs, img2gif, render
# "attack" or "return"
subtask = "attack"
cfg = Config(subtask=subtask)
os.makedirs(f"{cfg.base_path}/agents", exist_ok=True)
env = EnvWrapper(cfg)
init_obs = env.reset()
## INIT... | Python | 1 |
igured device GUID
deviceGUID_list = []
# es_input.cfg
es_input_path = Path(args.input)
# gamecontrollerdb.txt
gamecontrollerdb_path = Path(args.gamecontrollerdb_path)
# if the file don't exist don't try to read it
if gamecontrollerdb_path.is_file():
with open(gamecontrollerdb_path... | Python | 1 |
_flow.state_dict(),
'optimizer': optim.state_dict(),
}
save['mlp_cls_state_dict'] = mlp_cls.state_dict()
torch.save(save, base_path_model + log_name + '.pt')
f.write("{},{},{}... | Python | 1 |
th(&self) -> PathBuf {
let maybe_lib = if self.crate_type.ends_with("lib") ||
self.crate_type == "proc-macro" {
"lib"
} else {
""
};
let filename = maybe_lib.to_owned() +
&self.crate_name + &self.extra_filename + ".json";
Path::new(&self.out_dir)
.join("save-analysis")
.join(filename)
}
f... | Rust | 0 |
= "1: Reduces power consumption of the cache system, but inserts a wait state each time there is a cache miss. This mode may not be relevant if CPU performance is required, as the application will be stalled and may lead to increase run time."]
LOW_POWER = 1,
#[doc = "2: The cache system ensures that a cache h... | Rust | 0 |
::new(
Vec3::new(
0.5 * (1.0 + drand48()),
0.5 * (1.0 + drand48()),
0.5 * (1.0 + drand48()),
),
0.5 * (1.0 + drand48()),
... | Rust | 0 |
om_Storage_And_Metadata)r r r r s rV ro /CUDAGraphNode._reconstruct_from_tensor_metadata^ / .5_D)'xxHHUUrU c V [ R R US US US 5 $ )NrY r r rn ro $_construct_storage_from_data_poi... | Python | 1 |
if mem::size_of::<T>() > data.len() {
panic!("trying to load complex struct of size {} vs {}", mem::size_of::<T>(), data.len());
}
assert!(mem::size_of::<T>() <= data.len());
let val = unsafe { ::std::slice::from_raw_parts_mut(data.as_ptr() as *mut T, 1) };
&mut val[0]
}
pub fn data_const_un... | Rust | 0 |
().context("failed downcast to tokio Dir"))?;
block_on_dummy_executor(move || async move {
self.0.hard_link_(src_path, &target_dir.0, target_path)
})
}
async fn set_times(
&self,
path: &str,
atime: Option<wasi_common::SystemTimeSpec>,
mtime: Option<was... | Rust | 0 |
e profile::Profile;
use device::Device;
fn all_platform_ids() -> Vec<cl_platform_id> {
let mut num_platforms = 0;
let ret = unsafe { clGetPlatformIDs(0, ptr::null_mut(), &mut num_platforms) };
assert_eq!(ret, CL_SUCCESS);
if num_platforms == 0 {
return Vec::new()
}
let mut platforms ... | Rust | 0 |
s)
if dklen is None:
dklen = outer.digest_size
if dklen < 1:
raise ValueError(dklen)
dkey = b''
loop = 1
from_bytes = int.from_bytes
while len(dkey) < dklen:
prev = prf(salt + loop.to_bytes(4))
# endianness doesn't matter h... | Python | 1 |
#Updating values
import pandas as pd
data = {
"Name":['Ram','Shyam','Dhansyam','Aditi','Jagdish','Raj','Simran','Aman'],
"Age":[28,34,22,30,29,40,25,32],
"Salary":[50000,60000,45000,52000,49000,70000,48000,58000],
"Performance_score":[85,90,89,78,88,92,90,88]
}
df = pd.DataFrame(data)
print(df)
#.loc(... | Python | 1 |
uint256 q_ecc;
uint256 q_c;
uint256 linearization_polynomial;
uint256 grand_product_at_z_omega;
uint256 w1_omega;
uint256 w2_omega;
uint256 w3_omega;
uint256 w4_omega;
G1Point PI_Z;
G1Point PI_Z_OMEGA;
G1Point recursive_P1;
G1Point ... | Rust | 0 |
,
nonce: 1,
gas_price: BigUint::from_str_radix("04a817c800", 16).unwrap(),
gas_limit: 50000,
to: Some(EthereumAddress::from_str("0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2").unwrap()),
value: BigUint::from_str_radix("0de0b6b3a7640000", 16).unwrap(),
... | Rust | 0 |
#!/usr/bin/env python
# -*- python -*-
#BEGIN_LEGAL
#
#Copyright (c) 2019 Intel Corporation
#
# 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-... | Python | 1 |
const P: Precision = 3;
assert!(P > 1);
let val = FixedP::<P>::from_units_frac(12, 3 * 10u64.pow((P - 1 - 1) as u32))?;
let s = &format!("12.{:0width$}", 3, width = ((P - 1) as usize));
assert_eq!(s.parse::<FixedP<P>>()?, val);
Ok(())
}
... | Rust | 0 |
ompute if we've seen a new checkpoint since the previous batch update
if (isinstance(self.checkpoint_state, CheckpointState) and
self.checkpoint_state.checkpoint != state.checkpoint_prev):
checkpoint = self.checkpoint_state.checkpoint
checkpoint_f_hat, checkpo... | Python | 1 |
verbose: print('set remove_model_str to ', remove_model_str)
if o in ('-B', '--B'):
best_only = True
if verbose: print('best_only is ', best_only)
if o in ('-x', '--x'):
max_models = int(a)
if verbose: print('At most '+ max_models + ' will be created')
... | Python | 1 |
viceFragmentDensityMapOffsetPropertiesQCOMBuilder(Default::default(), std::marker::PhantomData)
}
#[inline]
#[must_use]
pub fn fragment_density_offset_granularity(mut self, fragment_density_offset_granularity: crate::vk1_0::Extent2D) -> Self {
self.0.fragment_density_offset_granularity = fragmen... | Rust | 0 |
}
2 => {
let a = self.elements[0].sample(0.0);
let b = self.elements[0].sample(0.5);
let c = self.elements[1].sample(0.0);
let d = self.elements[1].sample(0.5);
shoelace(a, b) + shoelace(b, c) + shoelace(c, d) + shoe... | Rust | 0 |
import laia.common.logging as log
def test_filepath(tmpdir):
filepath = tmpdir / "test"
log.config(filepath=filepath)
log.info("test!")
log.clear()
assert filepath.exists()
def test_filename(tmpdir):
with tmpdir.as_cwd():
filepath = "test"
log.config(filepath=filepath)
... | Python | 1 |
td::marker::Sync for PongResponse {}
impl PongResponse {
pub fn new() -> PongResponse {
::std::default::Default::default()
}
pub fn default_instance() -> &'static PongResponse {
static mut instance: ::protobuf::lazy::Lazy<PongResponse> = ::protobuf::lazy::Lazy {
lock: ::protobu... | Rust | 0 |
_CONFIG_FILE);
let same_as_last_cfg = fs::read_to_string(&last_cfg_path).map_or(false, |last_cfg| {
toml::to_string(&config).unwrap() == last_cfg
});
if same_as_last_cfg {
return Ok(());
}
// Create parent directory if missing.
if let Err(e) = fs::create_dir_all(&store_path) {
... | Rust | 0 |
from typing import List, Dict, Any, Optional, Tuple
from .base_handler import BaseHandler
from crazy_functions.review_fns.query_analyzer import SearchCriteria
import asyncio
from crazy_functions.crazy_utils import request_gpt_model_multi_threads_with_very_awesome_ui_and_high_efficiency as request_gpt
class 单篇论文分析功能(Ba... | Python | 1 |
xt_qwen_hf = 'llava_next_qwen_hf'
llava_next_video_hf = 'llava_next_video_hf'
llava_next_video_yi_hf = 'llava_next_video_yi_hf'
llava_onevision_hf = 'llava_onevision_hf'
yi_vl = 'yi_vl'
llava_llama3_1_hf = 'llava_llama3_1_hf' # DaozeZhang
llava_llama3_hf = 'llava_llama3_hf' # xtuner
llav... | Python | 1 |
0-extensions/html/vkspec.html#VkDisplayPlaneAlphaFlagBitsKHR)
const VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_BIT_KHR = 0x00000004;
/// See [`VkDisplayPlaneAlphaFlagBitsKHR`](https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkDisplayPlaneAlphaFlagBitsKHR)
const VK_DISPLAY_PL... | Rust | 0 |
tls", feature = "native-tls"))]
pub fn from_conf(conf: crate::Config) -> Self {
let client = aws_hyper::Client::https();
Self {
handle: std::sync::Arc::new(Handle { client, conf }),
}
}
}
<gh_stars>1-10
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file ... | Rust | 0 |
handle).unwrap();
Wallet::delete(&config_wallet, DEFAULT_CREDENTIALS).unwrap();
}
#[test]
fn import_wallet_invalid_path() {
let config_wallet = wallet_config::new();
let non_existant_path = Path::new("PlaceWithoutWindOrWords");
let config_export = wallet_config::export::new(... | Rust | 0 |
BOOK,
UpdateConnectionRequest_Providers::FITBIT,
UpdateConnectionRequest_Providers::GITEA,
UpdateConnectionRequest_Providers::GITHUB,
UpdateConnectionRequest_Providers::GITLAB,
UpdateConnectionRequest_Providers::GOOGLE,
UpdateConnectionRequest_Prov... | Rust | 0 |
Registration
{
pub fn new(name: &'static str, fs: &'static dyn Driver) -> Option<DriverRegistration> {
match S_DRIVERS.write().entry(name)
{
::lib::vec_map::Entry::Vacant(e) => {
e.insert(fs);
Some(DriverRegistration(name))
},
::lib::vec_map::Entry::Occupied(_) => None,
}
}
}
impl Handle
{
pub fn... | Rust | 0 |
assertions, feature = "assert_process_allocs"))] {
assert_no_alloc::assert_no_alloc(f)
} else {
f()
}
}
}
/// Enable the CPU's Flush To Zero flag while this object is in scope. If the flag was not already
/// set, it will be restored to its old value when this gets dropped.
... | Rust | 0 |
a = input()
index = a.find(" ")
print(index)
| Python | 1 |
ase_id_glue=case_id_key,
keep_first_following=False, business_hours=business_hours,
business_hours_slot=business_hours_slots, workcalendar=workcalendar)
efg = efg[[case_id_key, activity_key, activity_key + "_2", "@@flow_time"]]
efg = ef... | Python | 1 |
,
gen_len=descr.shape[-1],
cut_gen_len=None,
do_sample=False,
temperature=0,
stop=None,
top_p=None,
)
self._allocated_tensors[handle] = ... | Python | 1 |
Password,
};
#[derive(Deserialize, Debug)]
struct LoginParameters {
username: String,
password: String,
}
#[derive(Serialize, Deserialize, Debug)]
struct CheckLoginResponse {
success: bool,
}
pub(super) fn config(cfg: &mut web::ServiceConfig) {
cfg.service(
web::resource("/auth/checkLogin... | Rust | 0 |
/// user does not provide a mask then all fields will be overwritten.
#[prost(message, optional, tag = "1")]
pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
/// Required. Updated EndpointPolicy resource.
#[prost(message, optional, tag = "2")]
pub endpoint_policy: ::core::option::O... | Rust | 0 |
dilation=blocks[i]*dilation, BatchNorm=BatchNorm))
return nn.Sequential(*layers)
def forward(self, input):
x = self.conv1(input)
x = self.bn1(x)
x = self.relu(x)
x = self.maxpool(x)
x = self.layer1(x)
low_level_feat = x
x = self.layer2(x)
... | Python | 1 |
本语法使用
data_struct();
}
//**********************************************
fn data_struct()
{
//向量:
let v=vec![1,2,3,3,4,5,6,7,8];
let v2=vec![1;10]; //用10个1初始化 向量
println!("使用向量{},{}",v[2],v2[5]);
for i in &v {
println!("i = {}",i);
}
//移动语义
let v1=v; // v已经失效 由复制粘贴-》剪切粘贴
//运算符:
println!("0b1100 and 0b1010 ... | Rust | 0 |
// #[tracing::instrument(level = "trace")]
async fn tick(&mut self) {
self.raft.tick().await;
}
#[tracing::instrument(level = "trace")]
async fn propose(&mut self, proposal: Proposal, read_only: bool) -> Result<()> {
#[cfg(feature = "tracing")]
{
use runkv_common::ti... | Rust | 0 |
dict1 = {'Gfg': 4, 'is': 7, 'Best': 8, 'for': 6, 'Geeks': 10}
res = sum(dict1.values()) / len(dict1)
print('The computed mean:', res)
'''
# Python3 code to demonstrate working of
# Dictionary Values Mean
# Using sum() + len() + values()
# initializing dictionary
dict1 = {'Gfg': 4, 'is': 7, 'Best': 8, 'for': 6, 'Ge... | Python | 1 |
FAULT_PARSE_ERROR_UNSUPPORTED_ENCODING => Self::ParseErrorUnsupportedEncoding,
ffi::SOUP_XMLRPC_FAULT_PARSE_ERROR_INVALID_CHARACTER_FOR_ENCODING => Self::ParseErrorInvalidCharacterForEncoding,
ffi::SOUP_XMLRPC_FAULT_SERVER_ERROR_INVALID_XML_RPC => Self::ServerErrorInvalidXmlRpc,
ffi:... | Rust | 0 |
))
.expect("Frame producer should not be full because we just checked that");
self.current_frame += 1;
// otherwise, decode some new frames
} else {
let reached_end_of_file = self.decode()?;
if reached_end_of_file {
// if there aren't any new frames and the sound is looping,
// seek back to the... | Rust | 0 |
# This file was automatically created by FeynRules 2.3.49
# Mathematica version: 13.3.1 for Mac OS X ARM (64-bit) (July 24, 2023)
# Date: Mon 12 May 2025 11:37:21
from object_library import all_orders, CouplingOrder
HIG = CouplingOrder(name = 'HIG',
expansion_order = 99,
hier... | Python | 1 |
tage=True,
pretrained=None,
init_cfg=None):
super(SVT, self).__init__(in_channels, embed_dims, patch_sizes,
strides, num_heads, mlp_ratios, out_indices,
qkv_bias, drop_rate, attn_drop_rate,
... | Python | 1 |
[serde(default = "default_false")]
pub is_moderator: bool,
#[serde(default)]
pub is_locked: Option<bool>,
#[serde(default)]
pub is_silenced: Option<bool>,
#[serde(default)]
pub is_suspended: Option<bool>,
#[cfg(feature = "12-63-0")]
#[cfg_attr(docsrs, doc(cfg(feature = "12-63-0")))]
... | Rust | 0 |
ogy;
# use moldybrody::system::Topology;
let sys = ContinuousTopology::new(0.1);
let vt = ", stringify!($cartessian_name), "{coord : [2.0; ", $dim, "]};
let mut move1 = ", stringify!($cartessian_name), "{coord : [0.0; 2]};
move1.coord[0] = 0.05; // length of movement is smaller than 0.1
assert_eq!(sys.check_move(&vt... | Rust | 0 |
ry:
self.logger.warning(f"카테고리 불일치 감지 및 수정: {file_info.get('file_name', 'Unknown')} - "
f"원래: {original_category}, 수정: {corrected_category}")
# 강제 서술 템플릿 적용
file_name = file_info.get('file_name', 'Unknown')
language = code.ge... | Python | 1 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# @Author: Hui
# @Desc: { 公共路由模块 }
# @Date: 2022/05/04 22:40
from fastapi import APIRouter
from .apis import upload_api, areas_api, news_api, enum_api
from .response_models import upload_out, areas_out, news_out
from ...commons.responses.response_model import SuccessModel
rou... | Python | 1 |
State {
PeerSyncState {
best_known_header_hash: json.best_known_header_hash,
best_known_header_number: json.best_known_header_number.map(|number| number.value()),
last_common_header_hash: json.last_common_header_hash,
last_common_header_number: json.last_common_he... | Rust | 0 |
d {
e {
text: "hello world";
}
}
}
}
}
}
}
assert_eq!(root.inner_html(), "");
root.click();
let element = root
.first_element_child()
.unwrap()
.first_element_child()
.unwrap()
.first_element_child()
.unwrap()
.first_element_child()
.unwrap()
.first_elemen... | Rust | 0 |
"A prep"), &proof.a)?;
let b_prep = P::prepare_g2(cs.ns(|| "B prep"), &proof.b)?;
let neg_c = proof.c.clone().negate(cs.ns(|| "neg C"))?;
let neg_c_prep = P::prepare_g1(cs.ns(|| "C prep"), &neg_c)?;
let neg_psi = g_psi.clone().negate(cs.ns(|| "neg inputs"))?;
... | Rust | 0 |
input, br.next_in) as reg_t) << 32;
br.avail_in -= BROTLI_SHORT_FILL_BIT_WINDOW_READ;
br.next_in += BROTLI_SHORT_FILL_BIT_WINDOW_READ;
}
} else if
// BROTLI_ALIGNED_READ == false &&
n_bits <= 8 {
// !BROTLI_ALIGNED_READ && IS_CONSTANT(n_bits) && (n_bits <= 8)) {
if br.bit_pos_ >= 2... | Rust | 0 |
# -*- coding: utf-8 -*-
# @Time : 2024/5/11 20:07
# @Author : chenlelan
# @File : getAttackIp.py
import pandas as pd
def getAttackIp(data_path):
df = pd.read_csv(data_path)
attack_df = df[df["label"] == 1]
# attack_df = df[df.iloc[:, 32] == 1]
attack_ip = attack_df["src_ip"].value_counts().index... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.