text string | label_name string | labels int64 |
|---|---|---|
ED: char = '\n';
const CARRIAGE_RETURN: char = '\r';
const HEADER_PREFIX: u8 = b'#';
/// An async VCF reader.
///
/// The VCF format has two main parts: 1) a header and 2) a list of VCF records.
///
/// Each header line is prefixed with a `#` (number sign) and is terminated by the header header
/// (`#CHROM`...; incl... | Rust | 0 |
# Copyright 2022-2023 OmniSafe Team. 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 applicable ... | Python | 1 |
import re
import numpy as np
import pytest
import pandas as pd
class TestSetitemValidation:
def _check_setitem_invalid(self, arr, invalid):
msg = f"Invalid value '{str(invalid)}' for dtype {arr.dtype}"
msg = re.escape(msg)
with pytest.raises(TypeError, match=msg):
arr[0] = in... | Python | 1 |
nce)
def get_csv_body(self):
lines = ""
keys = list(self.get_keys())
keys.sort()
for properties_key in keys:
line = properties_key + "," + self.extract_rvi_parameters(
properties_key) + ","
for title in self.csv_header:
if titl... | Python | 1 |
_POLICY,
PowerButtonDc: POWER_ACTION_POLICY,
SleepButtonAc: POWER_ACTION_POLICY,
SleepButtonDc: POWER_ACTION_POLICY,
LidCloseAc: POWER_ACTION_POLICY,
LidCloseDc: POWER_ACTION_POLICY,
DischargePolicy: [SYSTEM_POWER_LEVEL; NUM_DISCHARGE_POLICIES],
GlobalFlags: ULONG,
}}
pub type PGLOBAL_USER_P... | Rust | 0 |
685688894042',
}
headers_2 = {
'authority': 'www.xiaohongshu.com',
'accept': 'application/json, text/plain, */*',
'accept-language': 'zh-CN,zh;q=0.9',
'cache-control': 'no-cache',
'content-type': 'application/json;charset=UTF-8',
'cookie': 'xhsTrackerId=026c0cb3-a700-4cb3-8028-aa9250a459fb; xhs... | Python | 1 |
}
}
impl<R, G, B> From<(R, G, B)> for Pixel where R: Into<Sample>, G: Into<Sample>, B: Into<Sample> {
#[inline] fn from((r,g,b): (R, G, B)) -> Self { Self::rgb(r,g,b) }
}
impl<R, G, B, A> From<(R, G, B, A)> for Pixel where R: Into<Sample>, G: Into<Sample>, B: Into<Sample>, A: Into<Sample> {
#[inline] fn... | Rust | 0 |
def get_script():
# Este script en Frida bypasea la librearia IOSSecuritySuite
return """
const moduleName = "IOSSecuritySuite"; // Reemplaza con el nombre real del módulo
const functionNamePattern = /^\$s16IOSSecuritySuite[A-Za-z0-9]+amI[A-Za-z0-9_]+$/; // Reemplaza con el patrón de función deseado
... | Python | 1 |
{
name: TEST_USERNAME.to_owned(),
password: <PASSWORD>.to_owned(),
admin: false,
};
ctx.user_manager.create(&new_user).unwrap();
let token = ctx
.user_manager
.login(TEST_USERNAME, <PASSWORD>_PASSWORD)
.unwrap();
let authorization = ctx
.user_manager
.authenticate(&token, AuthorizationScope::Polar... | Rust | 0 |
remote_dir").unwrap(); // Unwrap is safe - required by clap
let remote_port = m.value_of("port");
let verbose_mode = m.is_present("verbose");
let mut ignore_strings = get_ignore_strings(m);
let log = setup_log(&base_dir, verbose_mode, true);
info!(log, "Starting BindRS");
master::run(
... | Rust | 0 |
")
return df
# join today and yesterday dataframe (depend on init_df)
def init2_df(df_t, df_y):
df = df_y.join(df_t,
(df_y["character_name"] == df_t["character_name"]), # 각 인스턴스의 식별자를 닉네임으로 밖에 가져올 수 없음.
"inner")
df = df.withColumn("level_up_amount",
... | Python | 1 |
(wallet.address_at(false, 0)?, "bc1q2amk0dcqqs2gqfa6ju2td2xx42zz93n80paztjueltjefjugyv0qh6dtdx");
assert_eq!(wallet.address_at(true, 0)?, "bc1qcgsxne2nppzu38yshxmls4ayzje8k3xk48r592wvpuyzgfayayasweyn85");
}
Ok(())
}
//Test builder using mnemonics and setting data
fn se... | Rust | 0 |
ss_path = Path::new(&args.path);
{
if transport == "unix" {
super::check_unstable(state, "Deno.listen");
}
if transport == "unixpacket" {
super::check_unstable(state, "Deno.listenDatagram");
}
permissions.check_read(&address_path)?;
permissions.c... | Rust | 0 |
from amitools.vamos.libcore import *
from amitools.vamos.machine import *
from amitools.vamos.lib.VamosTestLibrary import VamosTestLibrary
from amitools.vamos.mem import MemoryAlloc
from amitools.fd import read_lib_fd
from amitools.vamos.machine.opcodes import op_jmp
def libcore_patch_multi_trap_test(capsys):
nam... | Python | 1 |
pub const NAME: &str = "name";
pub const TYPE: &str = "type";
pub const REF: &str = "ref";
pub const VALUE: &str = "value";
pub const ITEM_TYPE: &str = "itemType";
pub const BASE: &str = "base";
pub const USE: &str = "use";
pub const TARGET_NAMESPACE: &str = "targetNamespace";
pub const ... | Rust | 0 |
receive()).unwrap(), frame0);
defmt::assert_eq!(block!(state.can1.receive()).unwrap(), frame1);
defmt::assert_eq!(block!(state.can1.receive()).unwrap(), frame2);
// There should be no more data in transit.
defmt::assert!(state.can1.is_transmitter_idle());
defmt::assert!(matches!... | Rust | 0 |
t @{filename}@:@{line:MBIERROR}@ has no free'
replace['outcome'] = 'ERROR: RequestLeak'
replace['errormsg'] = 'ERROR: RequestLeak'
replace['start1'] = gen.start[s]("1")
replace['free1'] = ' /* MBIERROR MISSING: ' + Reqfree + ' */'
gen.make_file(template, f'Res... | Python | 1 |
self.color.w < 1.0
}
fn accept(&self, visitor: &mut dyn Visitor) -> Result<(), Box<dyn Error>> {
visitor.visit_constant_texture(&self)
}
}
#[cfg(test)]
mod constant_texture_test {
use super::*;
use crate::random;
#[test]
fn value_test() {
let t = ConstantTexture::new(Colo... | Rust | 0 |
) -> Vec<u8> {
let mut result = self.coefficient_arrays[0].clone();
for i in 1..self.coefficient_arrays.len() {
mulassign_scalar(&mut result, x);
add_assign(&mut result, &self.coefficient_arrays[i]);
}
return result;
}
pub fn mul_poly(&self, other: &Polyn... | Rust | 0 |
import os
import json5
import json
from typing import Dict
import sys
from functools import partial
from PyQt6.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout,
QTableWidget, QTableWidgetItem, QLineEdit, QPushButton,
QLabel, QMessa... | Python | 1 |
"""
Implementation is from here: https://gist.github.com/stefanonardo/693d96ceb2f531fa05db530f3e21517d by stefanonardo
"""
import numpy as np
class EarlyStopping(object):
def __init__(self, mode='min', min_delta=0, patience=10, percentage=False):
self.mode = mode
self.min_delta = min_delta
... | Python | 1 |
_WIDTH: Metre = Metre::new(3.5);
/// Width in metres
#[must_use]
pub fn width(&self, locale: &Locale, highway: HighwayType) -> Metre {
match self {
Lane::Separator { markings } => markings.width(locale),
Lane::Travel {
width, designated, ..
} => w... | Rust | 0 |
Game<'a> {
Game::ClShowOthers(i)
}
}
#[derive(Clone, Copy)]
pub struct SvMotd<'a> {
pub message: &'a [u8],
}
#[derive(Clone, Copy)]
pub struct SvBroadcast<'a> {
pub message: &'a [u8],
}
#[derive(Clone, Copy)]
pub struct SvChat<'a> {
pub team: i32,
pub client_id: i32,
pub message: &'a ... | Rust | 0 |
}
pub fn error(&self) -> ScMutableString {
ScMutableString::new(self.id, idx_map(IDX_RESULT_ERROR))
}
pub fn feedback(&self) -> ScMutableString {
ScMutableString::new(self.id, idx_map(IDX_RESULT_FEEDBACK))
}
pub fn timestamp(&self) -> ScMutableInt64 {
ScMutableInt64::new(s... | Rust | 0 |
y = 0.0;
let mut min_set = false;
let mut max_set = false;
// solve lx * x + c = 0
let x = -lc[n] / lx[n];
for i in 0..lx.shape().0 {
if i != n {
// replace y in all other formulas and solve lx * x + ly * y + lc >=0 for x
let c = lx[i] * x + lc[i];
let ans = -c / ly[i];
if ly[i] =... | Rust | 0 |
unsafe {
DMatrix::<ScalarType>::new_uninitialized(self.nrows(), rhs.ncols()).assume_init()
};
for (col_idx, mut col) in result_matrix.column_iter_mut().enumerate() {
col.copy_from(&self.diagonal.component_mul(&rhs.column(col_idx)));
}
result_matrix
}
}
/// ... | Rust | 0 |
std::collections::HashSet;
fn hash<T: Hash>(t: &T) -> u64 {
let mut s = DefaultHasher::new();
t.hash(&mut s);
s.finish()
}
let s = Secp256k1::new();
let mut set = HashSet::new();
const COUNT : usize = 1024;
for _ in 0..COUNT {
... | Rust | 0 |
Returns
-------
bads : list of lists of int
For each epoch, the indices of the bad channels.
"""
metrics = {
'amplitude': lambda x: np.ptp(x, axis=2),
'deviation': lambda x: _deviation(x),
'variance': lambda x: np.var(x, axis=2),
'median_gradie... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.http import route
from odoo.addons.im_livechat.controllers.chatbot import LivechatChatbotScriptController
from odoo.addons.im_livechat.tools.misc import force_guest_env
class CorsLivechatChatbotScriptController(LivechatChatbotScript... | Python | 1 |
LL, return the next registered bitstream filter"]
#[doc = " after f, or NULL if f is the last one."]
#[doc = ""]
#[doc = " This function can be used to iterate over all registered bitstream"]
#[doc = " filters."]
pub fn av_bitstream_filter_next(f: *const AVBitStreamFilter) -> *mut AVBitStreamFilter;... | Rust | 0 |
(dead_code, non_upper_case_globals)] pub const RGB8: types::GLenum = 0x8051;
#[allow(dead_code, non_upper_case_globals)] pub const RGB8I: types::GLenum = 0x8D8F;
#[allow(dead_code, non_upper_case_globals)] pub const RGB8UI: types::GLenum = 0x8D7D;
#[allow(dead_code, non_upper_case_globals)] pub const RGB8_SNORM: types:... | Rust | 0 |
main() {
let mc_data = MinecraftData::for_version("1.14.4");
println!("Loading asset metadata");
let mc_assets = MinecraftAssets::new("assets/1.14.4", &mc_data).unwrap();
App::new()
.insert_resource(AssetServerSettings {
asset_folder: String::from("../../assets"),
})
... | Rust | 0 |
value='google',
interactive=True
)
generate_button = gr.Button("生成图像")
sd_image = gr.Image(type='pil', label="Generated image", image_mode='RGB', visible=True)
save_folder = gr.Textbox(label="save folder", in... | Python | 1 |
ace,
"affinity-pod",
"tail -f /dev/null",
vec![(affinity_label, "yes")],
vec![],
))?)
.await?;
framework
.wait(
namespace,
vec!["pods/affinity-pod"],
WaitFor::Condition("initialized"),
vec!["--tim... | Rust | 0 |
pdate
@registry.register_model("pythia_question_only")
class PythiaQuestionOnly(Pythia):
def __init__(self, config):
super().__init__(config)
def forward(self, sample_list):
text_embedding_total = self.process_text_embedding(sample_list)
text_embedding_total = text_embedding_total.new_z... | Python | 1 |
_dim_small, self.three_dim , optimize=True)
# sum and multiply:trigger sum_of_products_contig_stride0_outstride0_two
def time_einsum_sum_mul(self, dtype):
np.einsum(",i...->", 300, self.three_dim_small, optimize=True)
# sum and multiply:trigger sum_of_products_stride0_contig_outstride0_two
def... | Python | 1 |
Unbind,
gles2::{Gles2Renderer, Gles2Texture, Gles2Error}
},
},
reexports::{
nix::sys::stat::dev_t,
wayland_server::protocol::{wl_buffer, wl_surface},
},
utils::{Logical, Point, Buffer as BufferCoords, Rectangle},
wayland::{
compositor::{
with_... | Rust | 0 |
rect")
}
}
/// Draw the filled rectangles.
pub fn fill_rects(&self, rects: impl IntoIterator<Item = Rect>) {
let rects: Vec<_> = rects.into_iter().map(|r| r.into()).collect();
let ret = unsafe {
bind::SDL_RenderFillRects(self.renderer.as_ptr(), rects.as_ptr(), rects.len... | Rust | 0 |
from_dir(entry.path())?
.into_iter()
.map(Arc::new)
.collect::<Vec<_>>();
resources.insert(lang.parse::<LanguageIdentifier>()?, lang_resources);
}
}
}
let mut bundles = HashMap::new()... | Rust | 0 |
_(group['weight_decay'], p.data)
adam_norm = adam_step.pow(2).sum().sqrt()
if weight_norm == 0 or adam_norm == 0:
trust_ratio = 1
else:
trust_ratio = weight_norm / adam_norm
state['weight_norm'] = weight_norm
... | Python | 1 |
# build_multi_model_embeddings.py
import os
import pickle
from deepface import DeepFace
def build_multi_model_embedding_db(identity_folder, models=["SFace"]):
for model_name in models:
embedding_db = {}
for person_name in os.listdir(identity_folder):
person_path = os.path.join(identit... | Python | 1 |
_serial() {
let host = Host {
..Default::default()
};
let devices: Vec<_> = host.devices().expect("to query devices");
let expected_device = devices.first().expect("found a device");
let device = host
.device_or_default::<String>(None, AndroidStorageInput::Auto)
.expect("co... | Rust | 0 |
ckpoint_vars=True)
self.assertIsInstance(var_map, dict)
self.assertIn('another_variable', var_map)
def test_loss_results_are_correct_with_random_example_sampling(
self,
use_keras):
with tf.Graph().as_default():
_, num_classes, _, _ = self._create_model(
random_example_sam... | Python | 1 |
56, Uint256};
use cosmwasm_std::{Coin, Decimal, Uint128};
#[test]
fn tax_rate_querier() {
let mut deps = mock_dependencies(&[]);
deps.querier.with_tax(Decimal::percent(1), &[]);
assert_eq!(
query_tax_rate(deps.as_ref()).unwrap(),
Decimal256::percent(1),
);
}
#[test]
fn test_compute_ta... | Rust | 0 |
new(1, 1, 1)),
Cuboid::new(Point3::new(1, 1, 1), Point3::new(3, 3, 3)),
Some(Cuboid::new(Point3::new(1, 1, 1), Point3::new(1, 1, 1))));
check_intersection(
Cuboid::new(Point3::new(0, 0, 0), Point3::new(10, 10, 10)),
Cuboid::new(Point3::new(1, 5, -10), Point3::new... | Rust | 0 |
input.dataset_group_arn {
object.key("DatasetGroupArn").string(var_130.as_str());
}
Ok(())
}
pub fn serialize_structure_crate_input_delete_dataset_import_job_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::DeleteDatasetImportJobInput,
) -> Result<(), aws_... | Rust | 0 |
anyhow::Error> {
let mut stdout = StandardStream::stdout(conf.color.clone().into());
// TODO make colors configurable
let mut filename_color = ColorSpec::new();
filename_color.set_fg(Some(Color::Magenta));
let default_color = ColorSpec::new();
let mut line_number_color = ColorSpec::new();
li... | Rust | 0 |
// Create a new allocation for the value given and merge the two
// allocations. This will also perform all remaining validity checks.
match self.allocate_slice_copy::<T, V>(values) {
Err(e) => Err(e.map(|()| (allocation,))),
Ok(val_alloc) => unsafe {
Ok(... | Rust | 0 |
, 7),
Shuffle::ABDC => u32x8::new(0, 1, 2, 3, 5, 4, 7, 6),
};
// Note that this gets turned into a generic LLVM
// shuffle-by-constants, which can be lowered to a simpler
// instruction than a generic permute.
_mm256_per... | Rust | 0 |
# Generated by Django 2.2.20 on 2022-11-28 23:35
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('jobs', '0003_scheduled_start_default'),
]
operations = [
migrations.RenameField(
model_name='job',
old_name='create_time',
... | Python | 1 |
flag("-O1")
.flag("-Wno-everything")
.compile("colorchord");
println!(r"cargo:rustc-link-search=.");
let m = [
"color.h",
"configs.h",
"decompose.h",
"dft.h",
"filter.h",
"hook.h",
"notefinder.h",
"outdrivers.h",
"parameter... | Rust | 0 |
max_points=max_points, html_pre_block=html_pre_block
) # singleton
def fin():
_grader.write_points() ... | Python | 1 |
// "::",
// stringify!(attrs_opt)
// )
// );
// assert_eq!(
// unsafe { &(*(::std::ptr::null::<_htmlElemDesc>())).attrs_depr as *const _ as usize },
// 48usize,
// concat!(
// "Offset of field: ",
// stringify!(_htmlElemDesc),
// "::",
// stringify!(attrs_depr)
//... | Rust | 0 |
": "did-communication",
"recipientKeys": ["did:indy:idunion:QowxFtwciWceMFr7WbwnM#verkey"],
"routingKeys": [],
"priority": 0
}]
});
let v_from_doc: Value = serde_json::from_str(doc.to_string().unwrap().as_str()).unwrap();
let v_from_s... | Rust | 0 |
_link([local_id]).unwrap(); // Never fails since local_id is valid
}
self.raw_links_mut().clear();
self
}
/// Clears the nodes of the top level. Nested hypergraphs remain unchanged.
///
/// # Remarks
///
/// This method has no effect on the allocated capacity.
pub fn... | Rust | 0 |
unwrap();
}
} else {
process_contains(&message, &ctx).await;
}
trigger_inchannel(&message, &ctx).await;
}
async fn allowed_channel(
command_channel: Option<ChannelId>,
message_channel: ChannelId,
ctx: &Context,
) -> bool {
match command_channel {
Some(ref chan) => {
if chan != &message_... | Rust | 0 |
),
];
// Assign the residues and check that the main residue was not modified.
cuboid.assign_residues(&residues);
assert_eq!(cuboid.residue.unwrap(), residue);
// Assert that the coordinate vector contains the component-relative positions.
assert_eq!(cuboid.coor... | Rust | 0 |
lue_for_unsigned!(u32, U32);
impl_tovalue_for_unsigned!(u64, U64);
impl_tovalue_for_unsigned!(usize, USIZE);
macro_rules! impl_tovalue_for_bits {
( $ToType:ty, $Const:tt ) => {
impl ToValue<$ToType> for B0 {
const VALUE: $ToType = Self::$Const;
}
impl ToValue<$ToType> for B1 {
... | Rust | 0 |
ype, ReadImage, WriteImage};
use crate::longnam::*;
use crate::tables::{
ColumnIterator, ConcreteColumnDescription, DescribesColumnLocation, FitsRow, ReadsCol,
WritesCol,
};
use std::ffi;
use std::ops::Range;
/// Struct representing a FITS HDU
#[derive(Debug, PartialEq)]
pub struct FitsHdu {
/// Informatio... | Rust | 0 |
gen_ty_15::IFLA_PORT_RESPONSE;
pub const __IFLA_PORT_MAX: _bindgen_ty_15 = _bindgen_ty_15::__IFLA_PORT_MAX;
#[repr(u32)]
#[non_exhaustive]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum _bindgen_ty_15 {
IFLA_PORT_UNSPEC = 0,
IFLA_PORT_VF = 1,
IFLA_PORT_PROFILE = 2,
IFLA_PORT_VSI_TYPE = 3,
IFLA_PORT_INSTANC... | Rust | 0 |
, '🧀'), ('🌭', '🌭'), ('🌮', '🌮'), ('🌯', '🌯'), ('🍿', '🍿'), ('🍾', '🍾'), ('🏏', '🏏'), ('🏐', '🏐'), ('🏓', '🏓'), ('🏹', '🏹'), ('\U0001f923', '\U0001f923'), ('\U0001f924', '\U0001f924'), ('\U0001f922', '\U0001f922'), ('\U0001f927', '\U0001f927'), ('\U0001f920', '\U0001f920'), ('\U0001f921', '\U0001f921'), ('\U0... | Python | 1 |
from simulator import Simulator
import argparse
if __name__=="__main__":
parser = argparse.ArgumentParser(description='Process simulation parameters.')
# Adding arguments
parser.add_argument('-n', '--num_nodes', type=int, required=True, help='Number of nodes')
parser.add_argument('-txm', '--txnDelay_... | Python | 1 |
TICK_SRC_A::AUXIO2,
1 => TICK_SRC_A::AUXIO1,
0 => TICK_SRC_A::AUXIO0,
_ => unreachable!(),
}
}
#[doc = "Checks if the value of the field is `AUX_TIMER2_CLKSW_RDY`"]
#[inline(always)]
pub fn is_aux_timer2_clksw_rdy(&self) -> bool {
*self == TICK_SRC_A:... | Rust | 0 |
(0x07 << 24)) | ((value as u32 & 0x07) << 24);
self.w
}
}
#[doc = "Field `gain_ctrl9_rosdac_i_bw1` reader - "]
pub struct GAIN_CTRL9_ROSDAC_I_BW1_R(crate::FieldReader<u8, u8>);
impl GAIN_CTRL9_ROSDAC_I_BW1_R {
#[inline(always)]
pub(crate) fn new(bits: u8) -> Self {
GAIN_CTRL9_ROSDAC_I_BW1_R(... | Rust | 0 |
#! /usr/bin/env python
'''
Parse the results of the performance test into a CSV for loading into
a results table or spreadsheet.
'''
import sys
import re
results_file = sys.argv[1]
num_copies = sys.argv[2]
## Get number of rows
num_rows = 100 * int(num_copies)
## Open the perf results file
with open(results_file, '... | Python | 1 |
s_check_func(&status) {
addr.do_send(retry_msg);
}
}
Err(e) => {
handle_mailbox_error_with_resend(
"schedule_status_check",
e,
&error_recipient,
... | Rust | 0 |
# Copyright (C) 2021 - 2024 ANSYS, Inc. and/or its affiliates.
# SPDX-License-Identifier: MIT
#
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limita... | Python | 1 |
#
# General code for JSBeautifier unpackers infrastructure. See README.specs
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
"""General code for JSBeautifier unpackers infrastructure."""
import pkgutil
try:
import re2 as re
except ImportError:
import re
from jsbeautifier.unpackers import ev... | Python | 1 |
eck'].strftime("%Y-%m-%d %H:%M:%S") if self.stats.get('last_check') else "никогда"
last_post = self.stats['last_post'].strftime("%Y-%m-%d %H:%M:%S") if self.stats.get('last_post') else "никогда"
return (
"📊 <b>Статус бота</b>\n\n"
f"<b>Состояние:</b> {status}\n"
... | Python | 1 |
<https://www.gnu.org/licenses/>.
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::unnecessary_cast)]
#![allow(clippy::unused_unit)]
#![allow(clippy::upper_case_acronyms)]
use frame_support::{
pallet_prelude::*,
traits::{Currency, ExistenceRequirement::KeepAlive},
transactional,
};
use frame_system::pal... | Rust | 0 |
://stackoverflow.com/questions/40792801/best-way-to-concatenate-vectors-in-rust#40795247
users.append(&mut new_users_vec);
rate_limits = new_rate_limits;
match new_users["meta"]["next_token"].as_str() {
Some(next_token) => page_token = Some(next_token.into()),
None => br... | Rust | 0 |
from flask import Blueprint, request, jsonify
from app.models import EmotionData, db
import logging
# Create a Blueprint for the emotion API
emotion_bp = Blueprint('emotion_api', __name__)
# Set up logging
logger = logging.getLogger(__name__)
@emotion_bp.route('/api/emotion', methods=['POST'])
def receive_emotion_da... | Python | 1 |
"""SCons.Scanner.RC
This module implements the dependency scanner for RC (Interface
Definition Language) files.
"""
#
# __COPYRIGHT__
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software with... | Python | 1 |
K_COMMAND: i32 = 0x19;
pub const EVT_DATA_BUFFER_OVERFLOW: i32 = 0x1A;
STRUCT! {#[repr(packed)] struct evt_data_buffer_overflow {
link_type_: u8,
}}
pub const EVT_DATA_BUFFER_OVERFLOW_SIZE: usize = 1;
pub const EVT_MAX_SLOTS_CHANGE: i32 = 0x1B;
STRUCT! {#[repr(packed)] struct evt_max_slots_change {
handle: u16,... | Rust | 0 |
3.rs
//! Continuously measure the ambient light color using
//! two VEML6040 which share the same address through a TCA9548A
//! and print it to an SSD1306 OLED display.
//!
//! This example is runs on the STM32F3 Discovery board using I2C1.
//!
//! ```
//! F3 <-> TCA9548A <-> Display <-> VEML6040 <-> VEML6040
//! GN... | Rust | 0 |
::*;
use bevy_prototype_debug_lines::DebugLines;
use heron_core::{CollisionShape, RigidBody, SensorShape};
use crate::shape3d_wireframe::{
add_capsule, add_convex_hull, add_cuboid, add_height_field, add_rounded_cuboid, add_sphere,
};
use super::DebugColor;
fn add_shape_outlines(
shapes: Query<
'_,
... | Rust | 0 |
lepath.replace('.pth', '_pca.pkl')
joblib.dump(self.faiss_pca, pca_path)
save_dict['pca_path'] = pca_path
print(f"FAISS索引已保存到: {faiss_path}")
print(f"PCA模型已保存到: {pca_path}")
else:
# 保存原始latent features
save_dict['train_latent_features'] = ... | Python | 1 |
################################################################################
# SampleAddRenderMaterials.py
# Copyright (c) 2018 Robert McNeel & Associates.
# See License.md in the root of this repository for details.
################################################################################
import Rhino
impor... | Python | 1 |
else {
ops[pos as usize] = 0;
}
index += 4;
} else if op == 8 {
let a = ops[index + 1];
let b = ops[index + 2];
let c = ops[index + 3];
// assert!(mc == 0);
let pos = get_pos(... | Rust | 0 |
// PostId 1
assert_ok!(_create_default_comment()); // CommentId 1
// Try to catch an error updating a comment with the same ipfs_hash
assert_noop!(_update_comment(
None,
None,
Some(self::comment_update(self::comment_ipfs_hash()))
),
Error::<Test>::CommentIPFSHashNotDiffer);
});... | Rust | 0 |
"length": ent_len,
"operation": "measurement",
"waveforms": {
"I": "zero_wf",
"Q": "zero_wf",
},
},
"laser_pi": {
"digital_marker": "ON_red",
"length": red_length,
"operation": "control",
... | Python | 1 |
ap::ArgMatches;
use indicatif::{ProgressBar, ProgressStyle};
use rust_decimal::Decimal;
use secp256k1::SecretKey;
use std::str::FromStr;
use wagyu_ethereum::{EthereumExtendedPublicKey, EthereumNetwork};
#[cfg(not(tarpaulin_include))]
pub fn parse_decimal(matches: &ArgMatches, key: &str) -> Result<Decimal> {
let in... | Rust | 0 |
CANOPY_BED: u16 = 6160;
pub const ROYAL_CANOPY_BED_SEED: u16 = 6161;
pub const THRONE: u16 = 6162;
pub const THRONE_SEED: u16 = 6163;
pub const BANQUET_DINING_CHAIR: u16 = 6164;
pub const BANQUET_DINING_CHAIR_SEED: u16 = 6165;
pub const BANQUET_TABLE: u16 = 6166;
pub const BANQUET_TABLE_SEED: u16 = 6167;
pub const CAST... | Rust | 0 |
if recall_per_class is not None and i < len(recall_per_class):
per_class_metrics[class_name]['recall'] = float(recall_per_class[i])
if ap50_per_class is not None and i < len(ap50_per_class):
per_class_metrics[clas... | Python | 1 |
after")
rm = mr.spawn(test_threaded)
rm.execute()
logs = str(rm.fetch_log()).strip()
assert logs == "inner\nafter"
def test_align_series(setup):
t = np.random.rand(10, 3)
pdf = pd.DataFrame(t)
df = md.DataFrame(pdf, chunk_size=(5, 3))
r = df[0] != df.sort_index()[0].shift(-1)
expe... | Python | 1 |
import os
import torch
import torch.nn.functional as F
from torch_geometric.data import NeighborSampler
class _GraphSampling(torch.nn.Module):
# Implemented base on https://github.com/rusty1s/pytorch_geometric/blob/master/examples/graph_saint.py
def __init__(self, args, data, train_idx, processed_dir):
... | Python | 1 |
lims = [
np.min([ax.get_xlim(), ax.get_ylim()]),
np.max([ax.get_xlim(), ax.get_ylim()]),
]
ax.plot(lims, lims, 'r--', alpha=0.75, zorder=0)
ax.set_xlabel("Real Values")
ax.set_ylabel("Predicted Values")
ax.set_title(f'Metric: {metric}')
ax.grid(... | Python | 1 |
new(None).unwrap();
let ver_key2 = VerKey::new(&gen, &sign_key2).unwrap();
let ver_keys = vec![&ver_key1, &ver_key2];
let signature1 = Bls::sign(&message, &sign_key1).unwrap();
let signature2 = Bls::sign(&message, &sign_key2).unwrap();
let signatures = vec. See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [txfqs](txfqs) module"]
pub type TXFQS = crate::Reg<u32, _TXFQS>;
#[allow(missing_docs)]
#[doc(hidden)]
pu... | Rust | 0 |
import logging
import csle_common.constants.constants as constants
from csle_common.dao.emulation_config.emulation_env_config import EmulationEnvConfig
from csle_common.util.emulation_util import EmulationUtil
from csle_common.dao.emulation_config.vulnerability_type import VulnType
class VulnerabilitiesController:
... | Python | 1 |
s_sys::Function>);
# [ wasm_bindgen ( structural , method , getter , js_class = "HTMLElement" , js_name = onclick ) ]
#[doc = "Getter for the `onclick` field of this object."]
#[doc = ""]
#[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/onclick)"]
#[doc = ""]... | Rust | 0 |
te of fps of the video since rendering speed is unknown.
fps = int(self.video_fps / 2)
self._video_process = Process(
target=save_video,
args=(self._video_queue, self._video_path % self._video_idx, fps),
)
self._vide... | Python | 1 |
# -----------------------------------------------------------------------------
# MIT License
#
# Copyright (c) 2024 Ontolearn Team
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without r... | Python | 1 |
# -*- coding: utf-8 -*-
"""helpers to work with strings"""
from __future__ import absolute_import, unicode_literals
import re
import logging
log = logging.getLogger(__name__)
def unicode_truncate(s, length):
""""Truncate string after `length` bytes less trailing unicode char."""
if isinstance(s, str):
... | Python | 1 |
l.addfirst(element)
elif n == 3:
element = eval(input("Enter the element: "))
position = int(input("Enter the position: "))
if position >0 and position <= len(l)+1:
l.addany(element, position)
else:
print("Invalid position")
... | Python | 1 |
_rgb)
caption = k3d_wrapper.get_image_caption(input_image)
if enable_redux:
redux_hparam = {
'image': k3d_wrapper.to_512_tensor(input_image).unsqueeze(0).clip(0., 1.),
'prompt_embeds_scale': 1.0,
'pooled_prompt_embeds_scale': 1.0,
'strength': 0.5
... | Python | 1 |
import gcc
# from gcc.event import PLUGIN_FINISH_TYPE
from gcc.event import PLUGIN_FINISH_DECL
from node import TREE_CODE, TREE_TYPE, IS_NULL_TREE
from node import get_tree_code_name
from node import IDENTIFIER_POINTER, DECL_ASSEMBLER_NAME, DECL_INITIAL
from node import DECL_SOURCE_FILE, DECL_SOURCE_LINE, DECL_SOURCE_C... | Python | 1 |
ev'] = disk[3:]
ret.append(diskstat)
self.old_stat[disk] = self.curr_stat[disk]
return ret
def get_stat(self, stat_name, replace=None):
stat_file = stat_file_config[stat_name]
command = 'cat ' + stat_file
res = super().exec_command(command,self.conn)
... | Python | 1 |
self.enable_interaction_commands_b_checkbox.isChecked())
self.dg_controller.enable_ton_commands = self.enable_ton_commands_checkbox.isChecked()
# 同步交互模式状态变量
self.dg_controller.enable_interaction_mode_a = self.enable_inter... | Python | 1 |
[derive(Debug, Copy, Clone, PartialEq)]
#[cfg_attr(feature = "plugins", derive(HeapSizeOf, Deserialize, Serialize))]
pub struct Matrix4 {
pub m11: f32, pub m12: f32, pub m13: f32, pub m14: f32,
pub m21: f32, pub m22: f32, pub m23: f32, pub m24: f32,
pub m31: f32, pub m32: f32, pub m33: f32, pub m34: f32,
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.