text string | label_name string | labels int64 |
|---|---|---|
from ..utils import get_params
NODE_TYPE = 'merge_methods/n_model_interpolation'
NODE_CATEGORY = 'Merge method'
def execute(node, inputs):
params = get_params(node)
if len(inputs) < 2:
raise ValueError('N-model interpolation requires at least two inputs')
weights_str = params.get('weights', '')
... | Python | 1 |
# Ventriloquist - Build 0.1
# insert a dummy dsig table with unique numbers into .otf fonts
# the idea is to kill two birds with one stone
# this idea needs lots of testing
# to do: add SerialDump[] to a txt file for record keeping
#
# jackson@okaytype.com
from fontTools.ttLib import TTFont
from mojo.compile import *... | Python | 1 |
import os
import numpy as np
from numba import jit
# detect whether to use parallel or not
numba_threads = int(os.getenv("NUMBA_NUM_THREADS", "1"))
parallel = True if numba_threads != 1 else False
@jit(nopython=True)
def fun_jit(mu, x, coeffs, scalar, lower, upper):
"""Bisection function"""
return (
... | Python | 1 |
if type_key not in self.website_metadata:
raise ValueError(f"`{type_key}` is invalid.")
for website_item in self.website_metadata[type_key]:
website_key = website_item['key']
if os.path.exists(os.path.join(DIR_PATH,
f"history_data/{today}/screenshot/{typ... | Python | 1 |
import contextlib
import unittest as ut
from ctypes import HRESULT, POINTER, WinDLL, c_uint32, pointer
import comtypes.client
from comtypes import GUID
class Test_IMFAttributes(ut.TestCase):
def test_imfattributes(self):
with contextlib.redirect_stdout(None): # supress warnings, see test_client.py
... | Python | 1 |
import os
os.environ["CHALLENGE_ERRORS"] = "False"
HOST_CONFIG_FILE_PATH = "github/host_config.json"
CHALLENGE_CONFIG_VALIDATION_URL = "/api/challenges/challenge/challenge_host_team/{}/validate_challenge_config/"
CHALLENGE_CREATE_OR_UPDATE_URL = "/api/challenges/challenge/challenge_host_team/{}/create_or_update_gith... | Python | 1 |
: light_projection,
view: light_view,
};
let light_context = Context {
camera,
..*params.0
};
let draw_params = glium::DrawParameters {
depth: glium::Depth {
test: glium::DepthTest::IfLessOrEqual,
write: tr... | Rust | 0 |
/// db.insert_event("0", Timestamp::new(43, Scale::Picosecond), SignalValue::new(0x1338));
/// db.insert_event("0", Timestamp::new(44, Scale::Picosecond), SignalValue::new(0x1339));
///
/// let mut events = db.get_timestamps();
/// let values = vec![0, 42, 43, 44];
///
/// for (i, event) in e... | Rust | 0 |
e_read_block_response(
buf: &[u8],
target_word: &[SLMPDeviceBlock],
target_bit: &[SLMPDeviceBlock],
) -> (
Vec<SLMPDeviceBlockData<u16>>,
Vec<SLMPDeviceBlockData<bool>>,
) {
let mut ret_w = Vec::new();
let mut ret_b = Vec::new();
let mut buf = Vec::from(buf);
for db in target_word.it... | Rust | 0 |
import setuptools
with open("README.md") as fp:
long_description = fp.read()
setuptools.setup(
name="rekognition_lambda_s3_trigger",
version="0.0.1",
description="A CDK Python app for demonstration purposes",
long_description="Image classification based on S3 trigger",
long_description_cont... | Python | 1 |
ONGODB_OPS_COUNT.clone())) {
debug!(logger, "Failed to register MONGODB_OPS_COUNT"; "error" => ?error);
}
if let Err(error) = registry.register(Box::new(MONGODB_OP_ERRORS_COUNT.clone())) {
debug!(logger, "Failed to register MONGODB_OP_ERRORS_COUNT"; "error" => ?error);
}
if let Err(error... | Rust | 0 |
_string <Span, &str>, add_return_error!(
SyntaxErrors::StartOfError.into(), delimited!(
tag!("\""),
map!(escaped!(take_while1!(not_escape_dq), '\\', anychar), |ref s|s.fragment.0),
return_error!(SyntaxErrors::UnterminatedDoubleQuotedString.into(), tag!("\""))
)));
named!(single_quoted_strin... | Rust | 0 |
draw(FAUCET, withdraw_amount)
.assert_failure_with_exit_code(NOT_RECIPIENT_ERROR_CODE);
}
#[ignore]
#[test]
fn test_admin_release() {
// Use FAUCET as ADMIN.
let config: VestingConfig = Default::default();
let init_balance = U512::from(DEFAULT_ACCOUNT_INITIAL_BALANCE);
VestingTest::new(FAUCET, ... | Rust | 0 |
winsAtLPGA, "winsAtLPGA",
/// `wins at majors`:
winsAtMajors, "winsAtMajors",
/// `wins at NWIDE`:
winsAtNWIDE, "winsAtNWIDE",
/// `wins at other tournaments`:
winsAtOtherTournaments, "winsAtOtherTournaments",
/// `wins at pga`:
winsAtPGA, "winsAtPGA",
/// `wins at pro tournament... | Rust | 0 |
# robustness_evaluation.py
import os
import matplotlib.pyplot as plt
def plot_robustness_vs_attack(defense_names, attack_names, robustness_results, dataset_name):
fig = plt.figure()
for defense_name in defense_names:
robustness_scores = robustness_results[defense_name]
for attack_name in attac... | Python | 1 |
elf) -> SelectExpr {
self.into_simple_expr().into()
}
}
impl SimpleExpr {
/// Express a logical `AND` operation.
///
/// # Examples
///
/// ```
/// use sea_query::{*, tests_cfg::*};
///
/// let query = Query::select()
/// .columns(vec
/// method.
pub fn DrawThemeBackground(self,
hdc: HDC, iPartId: co::VS_PART, iStateId: co::VS_STATE,
... | Rust | 0 |
00;
#[bench]
fn bench_brute_force_range_search(b: &mut Bencher) {
let mut pset = PointSet::new();
let mut rng = thread_rng();
for _ in 0 .. SIZE {
pset.insert(rng.gen());
}
let rect = RectHV::new(0.4, 0.4, 0.6, 0.6);
b.iter(|| {
assert!(pset.range_search(&rect).next().is_some()... | Rust | 0 |
_case_globals)] pub const UNSIGNED_INT_SAMPLER_CUBE: types::GLenum = 0x8DD4;
#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_VEC2: types::GLenum = 0x8DC6;
#[allow(dead_code, non_upper_case_globals)] pub const UNSIGNED_INT_VEC3: types::GLenum = 0x8DC7;
#[allow(dead_code, non_upper_case_globals)] pub c... | Rust | 0 |
comments/rjpf7f/comment/hqfeyxv/?utm_source=share&utm_medium=web2x&context=3
const TRANSFORMS: [Transform3; 24] = [
Transform3 { coords: [[ 1, 0, 0, 0], [ 0, 1, 0, 0], [ 0, 0, 1, 0], [0, 0, 0, 1]] },
Transform3 { coords: [[ 1, 0, 0, 0], [ 0, 0, -1, 0], [ 0, 1, 0, 0], [0, 0, ... | Rust | 0 |
}
if !value.is_object() {
return None;
}
match String::expand_json(&mut value["field_name"]) {
Some(v) => value["field_name"] = v,
None => (),
}
match Vec::<String>::expand_json(&mut value["tags"]) {
Some(v) => value["tags"] = v,
None => (),
}
match TypeSt... | Rust | 0 |
s = data_characteristics.get('channels', 3)
complexity = data_characteristics.get('complexity_score', 0.5)
# Configuración adaptativa
if complexity < 0.3:
config = {
'features': [32, 64, 128, 256],
'num_timesteps': 500,
'time_emb_dim': 128
}
elif ... | Python | 1 |
event.event_type in (HistoryEventType.RECEIVE, HistoryEventType.WITHDRAWAL) and
event.amount in (usdc_amount, eth_amount)
): # no break statement here because we expect two events
event.counterparty = CPT_RUNMONEY
event.location_label = user... | Python | 1 |
= match event.endianness {
Endianness::LittleEndian => u32::from_le_bytes(flags),
Endianness::BigEndian => u32::from_be_bytes(flags),
};
let bank_type = match BankType::try_from(flags) {
Ok(bank_type) => bank_type,
Err(_) => return Err(TryEventViewFromSliceError::UnknownFlag),
... | Rust | 0 |
+ "="*60)
print("Testing with exact decimal arithmetic:")
def exact_troposphere_check(x):
"""Troposphere check using exact decimal arithmetic"""
d = Decimal(str(x))
return (d * 10) % 5 == 0
exact_discrepancies = []
for x in [0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0,
1.1, 1.2, 1.3, 1.4,... | Python | 1 |
ft, .. }, Direction::Left) => Some(*left),
(Horizontal { right, .. }, Direction::Right) => Some(*right),
(Vertical { up, .. }, Direction::Up) => Some(*up),
(Vertical { down, .. }, Direction::Down) => Some(*down),
(DLCorner { down, .. }, Direction::Down) => Some(*down),
... | Rust | 0 |
setAssetContent(
UnsetAssetContentArguments {
key: key.clone(),
content_encoding: encoding_details.content_encoding.clone(),
},
));
}
}
}
}
pub(crate) fn set_encodings(
operations: &mut V... | Rust | 0 |
#!/usr/bin/python
import cv2
from sick import *
print("<<<< initing sick")
sick = SICK("COM10")
while True:
print(".")
if sick.get_frame():
print(sick.cartesian)
cv2.imshow("img", sick.image)
cv2.waitKey(5)
#print(f'logging coordinates(): {sick.log()}')
| Python | 1 |
t result = diesel::update(users)
.filter(email.eq(user.email))
.set(&updates)
.get_result::<UserChange>(conn)?;
Ok(result)
}
pub fn find_by(data: FindBy, pool: web::Data<Pool>) -> Result<User, ServiceError> {
use crate::schema::users::dsl::{email, id, users};
let conn = &pool.get().... | Rust | 0 |
>(seq1: &[T], seq2: &[T]) -> f32 {
let n = seq1.len() + seq2.len();
if n == 0 {
1.0
} else {
2.0 * seq1.len().min(seq2.len()) as f32 / n as f32
}
}
/// Internal utility to calculate an upper bound for a ratio for
/// [`get_close_matches`]. This is based on Python's difflib approach
///... | Rust | 0 |
elf::row(&field, 2)) )
.or( Self::row_winner(Self::col(&field, 0)) )
.or( Self::row_winner(Self::col(&field, 1)) )
.or( Self::row_winner(Self::col(&field, 2)) )
.or( Self::row_winner(Self::diagonal(&field)) )
.or( Self::row_winner(Self::reverse_diagonal(&field... | Rust | 0 |
Reset state */
synctex_ctxt = default_synctex_ctxt;
if synctex_enabled {
set_int_par(IntPar::synctex, 1);
} else {
set_int_par(IntPar::synctex, 0);
/* \synctex=0 : don't record stuff */
};
}
/* Free all memory used, close the file if any,
* It is sent locally when there is a ... | Rust | 0 |
st.Load())
assert deserializer._extract_value_from_ast(name_node) is None
# Call returns None
call_node = ast.Call(func=ast.Name(id="foo", ctx=ast.Load()), args=[], keywords=[])
assert deserializer._extract_value_from_ast(call_node) is None
# UnaryOp USub (negative)
usub_node = ast.UnaryOp(op=... | Python | 1 |
"system" fn(stream: VertexStreamATI, x: GLint, y: GLint, z: GLint);
/// glVertexStream3ivATI
/// * `stream` group: VertexStreamATI
pub type glVertexStream3ivATI_t = unsafe extern "system" fn(stream: VertexStreamATI, coords: *const [GLint; 3]);
/// glVertexStream3sATI
/// * `stream` group: VertexStreamATI
pub type gl... | Rust | 0 |
mp(&self, other: &Self) -> Option<Ordering> {
if self.x == other.x && self.y == other.y {
Some(Ordering::Equal)
} else if self.x < other.x && self.y < other.y {
Some(Ordering::Less)
} else if self.x > other.x && self.y > other.y {
Some(Ordering::Greater)
... | Rust | 0 |
import uuid
from flask import request
from flask.views import MethodView
from flask_smorest import Blueprint, abort
from db import stores
blp = Blueprint("Stores", __name__, description="Operations on stores")
@blp.route("/store/<string:store_id>")
class Store(MethodView):
def get(cls, store_id):
try:
... | Python | 1 |
be a
/// root CA.
#[structopt(long = "certs", requires = "KEY_FILE")]
pub cert_file: Option<PathBuf>,
/// The CA certificate for HTTP Gateway TLS encryption
///
/// Read the CA certificate from CA_CERT_FILE. This should contain PEM-format certificate that
/// can be used to validate client ... | Rust | 0 |
# -*- coding: utf-8 -*-
from odoo import api, models, fields, _
from odoo.exceptions import UserError, ValidationError
class ResCompany(models.Model):
_inherit = 'res.company'
@api.model
def _adjust_wh_cn_name(self):
companys = self.env['res.company'].with_context(active_test=False, lang='zh_CN'... | Python | 1 |
}
#[doc = "no description available"]
#[inline(always)]
pub fn visible(self) -> &'a mut W {
self.variant(USB0_NEEDCLK_A::VISIBLE)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
... | Rust | 0 |
import os
import tempfile
import streamlit as st
from model import DocumentLoader
def upload_and_process_document() -> list:
st.write('#### Upload a Document file')
browse, url_link = st.tabs(
['Drag and drop file (Browse files)', 'Enter document URL link']
)
with browse:
upload_file... | Python | 1 |
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = value;
self.w
}
}
impl R {
#[doc = "Bits 0:7 - Priority of interrupt 84"]
#[inline(always)]
pub fn pri84(&self) -> PRI84_R {
PRI84_R::new(self.bits)... | Rust | 0 |
str = "I am studying from Gecvcollege"
print(str.endswith("app")) | Python | 1 |
from threading import Thread, Event
import time
STOP_TASK = Event()
def do_something():
for i in range(50):
if STOP_TASK.is_set():
break
print(f'{i}-', end='', flush=True)
time.sleep(.5)
def interrupt():
time.sleep(99)
print("STOPPING!")
STOP_TASK.set()
if __name_... | Python | 1 |
r. Latince karakterleri kullanan bazı dillerde karar vermek için daha fazla girdiye ihtiyacımız var.", WINDOWS_1254);
}
#[test]
fn test_simplified() {
check("这是一个字符编码测试。", GBK);
}
#[test]
fn test_traditional() {
check("這是一個字符編碼測試。", BIG5);
}
#[test]
fn test_ko() {
... | Rust | 0 |
# 第 0001 题: 做为 Apple Store App 独立开发者,你要搞限时促销,为你的应用生成激活码(或者优惠券),使用 Python 如何生成 200 个激活码(或者优惠券)?
'''
想法思路:
1. 字符串方式
2. 时间戳方式
3. UUID全局标识符,使用uuid1或者uuid5算法
4. 加密算法
'''
import random, string, time, math, uuid
chars = string.ascii_letters + string.digits
def gen1():
'''
根据26个大小写字母和数字随机选择10个
涉及... | Python | 1 |
impl Default for Perlin {
fn default() -> Self {
Self::new()
}
}
use juniper::GraphQLInterface;
#[derive(GraphQLInterface)]
struct Character(i32);
fn main() {}
<filename>src/lib.rs
#![forbid(unsafe_code)]
// to avoid the warning from diesel macros
#![allow(proc_macro_derive_resolution_fallback)]
#[ma... | Rust | 0 |
269, data3: 19606, data4: [164, 139, 107, 166, 172, 227, 156, 118] };
pub const CLSID_WICHeifDecoder: ::windows_sys::core::GUID = ::windows_sys::core::GUID { data1: 3919882250, data2: 17662, data3: 19940, data4: [137, 113, 113, 80, 177, 10, 81, 153] };
pub const CLSID_WICHeifEncoder: ::windows_sys::core::GUID = ::windo... | Rust | 0 |
increase < 0.0 {
decr.dont_decrease_x_when_neg();
}
});
} else {
player_velocity.x = 0.0;
}
} else {
eprintln!(
... | Rust | 0 |
import pytest
import torch
from espnet2.asr.postencoder.hugging_face_transformers_postencoder import (
HuggingFaceTransformersPostEncoder,
)
@pytest.mark.parametrize(
"model_name_or_path",
[
"akreal/tiny-random-bert",
"akreal/tiny-random-gpt2",
"akreal/tiny-random-xlnet",
... | Python | 1 |
V: Visitor<'de>,
{
visitor.visit_newtype_struct(self)
}
fn deserialize_seq<V>(self, visitor: V) -> Result<V::Value>
where
V: Visitor<'de>,
{
visitor.visit_seq(Seq {
dec: self.dec,
seq: self.obj,
})
}
fn deserialize_tuple<V>(se... | Rust | 0 |
class Library:
def __init__(self, listOfBooks):
self.books = listOfBooks
def displayAvailableBooks(self):
print("Books present in this library are: ")
for book in self.books:
print(" *" + book)
def borrowBook(self, bookName):
if bookName in self.books:
... | Python | 1 |
Target,
{
/// Makes a new UniquePtr wrapping a null pointer.
///
/// Matches the behavior of default-constructing a std::unique\_ptr.
pub fn null() -> Self {
UniquePtr {
repr: T::__null(),
ty: PhantomData,
}
}
/// Allocates memory on the heap and makes a ... | Rust | 0 |
xclude 16905
if left_arm_var < th and right_arm_var < th:
if verbose:
print("skip - check_static_motion left var {}, right var {}".format(left_arm_var, right_arm_var))
return True
else:
if verbose:
print("pass - check_static_motion left... | Python | 1 |
Kind,
message: String,
) -> Self {
Self { in_module: container, kind: DefDiagnosticKind::MacroError { ast, message } }
}
pub(super) fn unresolved_macro_call(
container: LocalModuleId,
ast: AstId<ast::MacroCall>,
path: ModPath,
) -> Self {
Self { in_module... | Rust | 0 |
mplingParams,
prompt_ids: list[int],
output_ids: list[int],
) -> Optional[partial[torch.Tensor]]:
"""Return state representation for new request
Returns None if logits processor is not applicable to request
Args:
params: request sampling params
prompt_ids:... | Python | 1 |
# This file is part of wger Workout Manager.
#
# wger Workout Manager is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# wger W... | Python | 1 |
from .MAE_ViT_MsLd import MAE_ViT_MsLd
from models_mae.MLP import MLP
class MAE_ViT_MsLdLeCd(MAE_ViT_MsLd):
"""Masked Autoencoder with VisionTransformer backbone"""
def __init__(
self,
loss_e=None,
loss_cd=None,
predictor_hidden_size=2048,
**kwargs,
):
super... | Python | 1 |
ml_correct_divergent += 1
if traditional_prediction == case["actual_winner"]:
traditional_correct_divergent += 1
ml_divergent_accuracy = ml_correct_divergent / len(divergent_cases)
traditional_divergent_accurac... | Python | 1 |
mts)
}
xcfg::XCheckType::None | xcfg::XCheckType::Disabled => quote_expr!(cx, None),
xcfg::XCheckType::Fixed(id) => quote_expr!(cx, Some(($tag, $id))),
xcfg::XCheckType::Djb2(ref s) => {
let id = djb2_hash(s);
exp.insert_djb2_name(id, s.cl... | Rust | 0 |
_STATUS2: KSPROPERTY_VIDCAP_VIDEODECODER = 5i32;
#[doc = "*Required features: 'Win32_Media_KernelStreaming'*"]
pub type KSPROPERTY_VIDCAP_VIDEOENCODER = i32;
#[doc = "*Required features: 'Win32_Media_KernelStreaming'*"]
pub const KSPROPERTY_VIDEOENCODER_CAPS: KSPROPERTY_VIDCAP_VIDEOENCODER = 0i32;
#[doc = "*Required fe... | Rust | 0 |
if c.args[1] == "CALLS"
]
# Verify IMPORTS relationships
imports_rels = [
c
for c in mock_ingestor.ensure_relationship_batch.call_args_list
if c.args[1] == "IMPORTS"
]
# Should have service mesh function definitions
assert len(defines_rels) >= 6, (
f"Expected... | Python | 1 |
f.write(f"Recall: {recall:.4f}\n")
f.write(f"F1-Score: {f1:.4f}\n")
# File path to save the trained model
model_save_path = './source/models/gcn_model.pth'
# Save the model state_dict after training
torch.save(model.state_dict(), model_save_path)
print(f"Model saved... | Python | 1 |
"""
Maker Coin
name: maker_coin.py
by: Gumyr
date: Febrary 27, 2024
desc:
This example creates the maker coin as defined by Angus on the Maker's Muse
YouTube channel. There are two key features:
1) the use of DoubleTangentArc to create a smooth transition from the
central dish to the external arc... | Python | 1 |
81195213738894724493026768189881462108541310;
fn print_usage(program: &str, opts: Options)
{
let brief = format!("Usage: {} [options]", program);
print!("{}", opts.usage(&brief));
}
fn main() {
let args: Vec<String> = env::args().collect();
let program = args[0].clone();
let mut opts = Options::new();
o... | Rust | 0 |
self.current_version.patch + 1,
),
}
}
fn get_updated_version_from_user(&self) -> Option<Version> {
loop {
print!(
"Current version of {} is {}. Enter new version (leave blank for unchanged): ",
self.name, self.current_ve... | Rust | 0 |
::read_i32(&bytes[12..16]),
]);
}
/// Writes a [uuid::Uuid] in the Minecraft 1.16+ format
/// (TAG_Int_Array of length 4). Requires the `uuid` feature.
#[cfg(feature = "uuid")]
pub fn uuid(&mut self, uuid: uuid::Uuid) {
self.uuid_bytes(*uuid.as_bytes());
}
// todo: list lis... | Rust | 0 |
{
Err(self.mk_error(LexErrorKind::UnknownDeclaration, i))
} else {
Err(self.mk_error(LexErrorKind::PrematureEnd, i - 1))
}
}
fn parse_rules(&mut self, mut i: usize) -> LexBuildResult<usize> {
loop {
i = self.parse_ws(i)?;
if i == self.src... | Rust | 0 |
rch.index_select(f0, dim=0, index=nzindex).cpu().numpy()
time_org = self.hop_length / sampling_rate * nzindex.cpu().numpy()
time_frame = np.arange(pad_to) * self.hop_length / sampling_rate
vuv_vector = F.interpolate(vuv_vector[None, None, :], size=pad_to)[0][0]
if f0.shape[0] <= 0:
... | Python | 1 |
}
/// Print a line of text to the VGA buffer with a given color.
/// Defaults are : `red`, `green` and `blue`.
#[macro_export]
macro_rules! print_color {
(red $($arg:tt)*) => (
$crate::drivers::vga::WRITER.lock().set_color($crate::drivers::vga::Color::Red, $crate::drivers::vga::Color::Black);
$crat... | Rust | 0 |
ame.split('/')
if labelname[-1]=='':
labelname=labelname[-2]
else:
labelname=labelname[-1]
################################################
## REMOVE JSON AND DUPLICATES ##
################################################
deleted_files=list()
# rename files appropriately
for i in range(len(li... | Python | 1 |
forward_backward(data, teacher_temp=teacher_temp)
# clip gradients
if fp16_scaler is not None:
if cfg.optim.clip_grad:
fp16_scaler.unscale_(optimizer)
for v in model.student.values():
v.clip_grad_norm_(cfg.optim.clip_grad)
fp1... | Python | 1 |
utral"
if attention_score > 0.55:
brain_state = "engaged"
elif relaxation_score > 0.35:
brain_state = "relaxed"
logger.info(f"FINAL SCORES:")
logger.info(f" Attention: {attention_score:.6f}")
logger.info(f" Relaxa... | Python | 1 |
in the contract state. Thus **if the
/// `StateBox` is dropped without calling [`delete`](StateBox::delete)
/// then the value will remain in contract state, leading to a space leak.**
///
/// Note that this dropping can happen implicitly via assignment. For
/// example,
///
/// ```no_run
... | Rust | 0 |
low(missing_docs)]
tonic::include_proto!("inx");
}
/// Rexports of [`tonic`] types.
pub mod tonic {
pub use tonic::{
transport::{Channel, Error},
Request, Response, Status,
};
}
pub use self::proto::{inx_client as client, inx_server as server};
#[cfg(feature = "types")]
pub use self::type... | Rust | 0 |
rain_rock_ma_40.nif", 0x6223_0326, 0x5BCB_AFDD),
(r"meshes\x\terrain_rock_ma_07.nif", 0x6223_0326, 0x5BCB_B3CD),
(r"meshes\x\terrain_rock_ma_67.nif", 0x6223_0326, 0x5BCB_B3D5),
(r"meshes\x\terrain_rock_ma_57.nif", 0x6223_0326, 0x5BCB_B3D9),
(r"meshes\x\terrain_rock_ma_06.nif", 0x6223_0326, 0x5BCB_B7... | Rust | 0 |
for arg in args {
write!(f, "{}{}", sep, pr(arg))?;
sep = ", ";
}
write!(f, ")")
}
TmntK::Assert { cond, expected, .. } => write!(f, "assert!({} == {})", pr(cond), expected),
_ => panic!("unsupported terminator {:?}", tmnt),
}
}
}
struct PrTmnt<'tcx> {
... | Rust | 0 |
var("CARGO_CFG_TARGET_FAMILY").unwrap();
let target_env = var("CARGO_CFG_TARGET_ENV").unwrap();
let target_triple = var("TARGET").unwrap();
let mut base_config = cc::Build::new();
base_config.include(".");
base_config.include("libusb/libusb");
if target_os == "macos" {
base_config.define("OS_DARWIN", Some("1... | Rust | 0 |
", deprecated)]
#[cfg(any(feature = "v2_14", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v2_14")))]
#[doc(alias = "webkit_dom_document_get_embeds")]
fn embeds(&self) -> Option<DOMHTMLCollection>;
#[cfg_attr(feature = "v2_22", deprecated)]
#[cfg(any(feature = "v2_16", featu... | Rust | 0 |
# Import other files
from Participant import Participant as p
import DataRetrieval
import Plots
import MLP
import DimReduction
# Import libraries
import numpy as np # type: ignore
# Paths
visualization_path = './Visualizations/'
# Parameters
num_participants = 30
num_trials = 75
k = 25
# Printing Options - if toggl... | Python | 1 |
from fastapi import FastAPI, Request, status, BackgroundTasks, Response
from fastapi.responses import StreamingResponse
from starlette.background import BackgroundTask as StarletteBackgroundTask
from urllib.parse import unquote
from minio import Minio
from usecase.aligmnent_usecase import AligmentUsecase
import open3... | Python | 1 |
.char_data.insert(
'E',
CharData {
uvs: Vec4::new(0.3628866, 0.04347826, 0.37216496, 0.6521739),
bounds: Vec2::new(0.375, 0.5833333),
bearing: Vec2::new(0.125, 0.0),
advance: 0.5,
},
);
font_data.char_data.insert(
'F',
Char... | Rust | 0 |
tialEq)]
pub enum RXDP_A {
#[doc = "1: received data plus upstream port data line"]
RECEIVED = 1,
}
impl From<RXDP_A> for bool {
#[inline(always)]
fn from(variant: RXDP_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `RXDP`"]
pub type RXDP_R = crate::pac::generic::R<bool, RXDP_A... | Rust | 0 |
_nodes = data.x.shape[0]
num_hyperedges = num_nodes
incidence_matrix = torch.zeros(num_nodes, num_nodes)
for i in range(num_nodes):
# Find nodes in the same community
same_community = (
(community_assignments == community_assignments[i])
.... | Python | 1 |
first insert'}
id_one = sync_insert_test_obj(sync_shard, data_one)
data_two = {'num': 4, 'related_id': id_one, 'text': 'second insert'}
id_two = sync_insert_test_obj(sync_shard, data_two)
data_three = {'num': 5, 'related_id': id_one, 'text': 'third insert'}
id_three = sync_insert_test_obj(sync_shard... | Python | 1 |
parent: Arc::downgrade(&get_current_thread().process),
child: Vec::new(),
child_exited: Vec::new(),
wake_callbacks: Vec::new(),
}),
})
}
/// 分配、映射并初始化线程的用户栈
pub fn alloc_user_stack<'a, 'b>(
&'a self,
arguments: &[&str],
... | Rust | 0 |
("const _".into(), None)
} else {
(format!("const {}", it.name()?), it.name().map(name))
}
},
_ => return None,
}
}
} else if let Some(mac) = ast::MacroCall::cast(node.clone()) {
let last_toke... | Rust | 0 |
import os
from dotenv import load_dotenv
load_dotenv()
os.environ["OPENAI_API_KEY"] = os.getenv("OPENAI_API_KEY")
from langchain.prompts import PromptTemplate, FewShotPromptTemplate
from langchain import LLMChain
from langchain.chat_models import ChatOpenAI
import streamlit as st
llm = ChatOpenAI(model = "gpt-3.5-tu... | Python | 1 |
rlhf_engine.critic , args.critic_lora_module_name,
args.critic_lora_dim)
if args.only_optimize_lora:
rlhf_engine.critic = only_optimize_lora_parameters(rlhf_engine.critic )
rlhf_engine.critic = make_model_gradient_check... | Python | 1 |
import os
import json
import csv
<<<<<<< HEAD
=======
import seaborn as sns
>>>>>>> 1faa5ff97e308c736376616e21df72d5a2804e60
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg as FigureCanvas
from matplotlib.figure import Figure
import matplotlib as mpl
import matplotlib.pyplot as plt
mpl.rcParams['figur... | Python | 1 |
f) -> Self {
let origin_square = self.origin_square().transpose();
let dest_square = self.destination_square().transpose();
let mut transposed_move = Move(self.0);
transposed_move.0 &= !0xfff; // Clearing the old squares
transposed_move.0 |= u16::from(origin_square) + (u16::from(... | Rust | 0 |
# coding: utf-8
"""
Twitter OpenAPI
Twitter OpenAPI(Swagger) specification
The version of the OpenAPI document: 0.0.1
Contact: yuki@yuki0311.com
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
import unittest
from twitter_o... | Python | 1 |
0.0, 1.0);
pub const COLOR_ORANGE900: Vec4 = vec4(0.901_960_8, 0.317_647_07, 0.0, 1.0);
pub const COLOR_ORANGEA100: Vec4 = vec4(1.0, 0.819_607_85, 0.501_960_8, 1.0);
pub const COLOR_ORANGEA200: Vec4 = vec4(1.0, 0.670_588_25, 0.250_980_4, 1.0);
pub const COLOR_ORANGEA400: Vec4 = vec4(1.0, 0.568_627_5, 0.0, 1.0);
pub co... | Rust | 0 |
starts_with("mapper/") {
let device_path = Path::new(&device_path).canonicalize()?;
device_path.file_name().unwrap().to_string_lossy().into_owned()
} else {
device.to_string()
}
};
let point = match sc.... | Rust | 0 |
CK_X9_42_DH_KDF_TYPE,
pub ulOtherInfoLen: CK_ULONG,
pub pOtherInfo: *const CK_BYTE,
pub ulPublicDataLen: CK_ULONG,
pub pPublicData: *const CK_BYTE,
pub ulPrivateDataLen: CK_ULONG,
pub hPrivateData: CK_OBJECT_HANDLE,
pub ulPublicDataLen2: CK_ULONG,
pub pPublicData2: *const CK_BYTE,
p... | Rust | 0 |
rt.epoch;
let deadline = self.deadline(rt);
let expiration = deadline.period_end() + lifetime_periods * rt.policy.wpost_proving_period;
// Precommit
let pre_commit_params =
self.make_pre_commit_params(sector_no, precommit_epoch - 1, expiration, deal_ids);
let precom... | Rust | 0 |
"]
pub const AOM_CICP_TC_RESERVED_3: aom_transfer_characteristics = 3;
#[doc = "BT.470 System M (historical)"]
pub const AOM_CICP_TC_BT_470_M: aom_transfer_characteristics = 4;
#[doc = "BT.470 System B, G (historical)"]
pub const AOM_CICP_TC_BT_470_B_G: aom_transfer_characteristics = 5;
#[doc = "BT.601"]
pub const AOM_... | Rust | 0 |
import matplotlib.pyplot as plt
import numpy as np
from tqdm import tqdm
path = r'G:\毕业设计\中期\绘图图片\handdepthnet_pred\PNG'
def save_fig(data, name):
plt.close()
plt.figure()
plt.imshow(data, cmap='jet')
plt.axis('off')
plt.savefig(name, bbox_inches='tight', dpi=600, pad_inches=0.0)
# def save_fig... | Python | 1 |
t_anno['gt_boxes_upright_depth'].shape[-1],
origin=(0.5, 0.5, 0.5)).convert_to(box_mode_3d)
labels_3d = gt_anno['class']
else:
gt_boxes = box_type_3d(np.array([], dtype=np.float32))
labels_3d = np.array([], dtype=np.int64)
for i in range(len(labels_3d... | Python | 1 |
d::JSIMD_AVX2 as libc::c_uint != 0 {
return 1 as libc::c_int;
}
if simd_support & crate::src::simd::x86_64::jsimd::JSIMD_SSE2 as libc::c_uint != 0 {
return 1 as libc::c_int;
}
return 0 as libc::c_int;
}
#[no_mangle]
pub unsafe extern "C" fn jsimd_can_quantize_float() -> libc::c_int {
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.