text string | label_name string | labels int64 |
|---|---|---|
OS bits into a usable VCoreRange
pub trait Vos: private::Sealed {
/// Get the range based on the type
fn range() -> VCoreRange;
}
#[doc(hidden)]
/// Helper trait to correlate vcore ranges with maximum frequencies
pub trait FreqLimit: private::Sealed {
fn max_freq() -> Hertz;
}
/// Range 1 is the "high per... | Rust | 0 |
or polled"]
#[derive(Debug)]
pub struct SyncBlockingPermitFuture<'a> {
futr: Mutex<BlockingPermitFuture<'a>>
}
impl<'a> SyncBlockingPermitFuture<'a> {
/// Construct given `Semaphore` reference.
pub fn new(semaphore: &'a Semaphore) -> SyncBlockingPermitFuture<'a>
{
SyncBlockingPermitFuture {
... | Rust | 0 |
eption as ex:
public.print_log("error info: {}".format(ex))
return public.return_message(-1, 0, str(ex))
if not hasattr(get, 'product_id'):
return public.return_message(-1, 0, public.lang("product_id Parameter ERROR!"))
product_id = get.product_id
# ikey = ... | Python | 1 |
_v = arg.pop("ticksuffix", None)
_v = ticksuffix if ticksuffix is not None else _v
if _v is not None:
self["ticksuffix"] = _v
_v = arg.pop("ticktext", None)
_v = ticktext if ticktext is not None else _v
if _v is not None:
self["ticktext"] = _v
... | Python | 1 |
#[doc(no_inline)] pub use core::prelude;
#[doc(no_inline)] pub use core::{Result, Error, ErrorKind};
#[doc(no_inline)] pub use core::{PortSettings, BaudRate, CharSize, Parity, StopBits, FlowControl};
#[doc(no_inline)] pub use core::{SerialPort, SerialPortSettings};
pub use core::BaudRate::*;
pub use core::CharSize::*... | Rust | 0 |
onal[List[int]] = None
) -> List[int]:
"""
Create a mask from the two sequences passed to be used in a sequence-pair classification task. An XLM sequence
pair mask has the following format:
```
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1
| first sequence | second sequ... | Python | 1 |
import numpy as np
from HE import histogram_equalization
def adaptive_histogram_equalization(img_arr, level=256, window_size=32, affect_size=16):
arr = img_arr.copy()
m, n = img_arr.shape
# Caculate the number of rows and columns
rows = (m - window_size) // affect_size + 1
cols = (n - window_size) ... | Python | 1 |
amPConf,
)
cs.store(
group="optimizer",
name="aggmo",
node=AggMoConf,
)
cs.store(
group="optimizer",
name="apollo",
node=ApolloConf,
)
cs.store(
group="optimizer",
name="diffgrad",
node=DiffGradConf,
)
cs.store(
... | Python | 1 |
);
(*log).file = bindings::ngx_conf_open_file((*cf).cycle, &mut ngx_http_access_log);
if (*log).file.is_null() {
return NGX_CONF_ERROR!();
}
lmcf = *ngx_http_conf_get_module_main_conf!(cf, ngx_http_log_module)
as *mut ngx_http_log_main_conf_t;
fmt = (*lmcf).formats.elts as *mut ngx... | Rust | 0 |
nput));
Ok(())
}
fn part2(input: &[(usize, usize, char, String)]) -> usize {
input
.iter()
.filter(|e| {
let pos1 = e.0;
let pos2 = e.1;
let mut count = 0;
e.3.chars().enumerate().for_each(|(idx, ch)| {
if (pos1 == idx || pos2 == ... | Rust | 0 |
pper case
for c in buf[0..count].iter_mut() {
if 0x61 <= *c && *c <= 0x7a {
*c &= !0x20;
}
}
let mut write_offset = 0;
while write_offset < count {
match serial.write(&buf[... | Rust | 0 |
await data_pipeline.fetch_asset_universe(symbol_list, start_date, end_date)
features_data = await data_pipeline.create_features_dataset(symbol_list, start_date, end_date)
# Train HMM
click.echo(f"🔍 Training HMM with {regimes} regimes...")
hmm_model = AdvancedBaumWelchHMM(n_components=regimes, ran... | Python | 1 |
eaves = 32;
let setup_params = compound_proof::SetupParams {
vanilla_params: &porc::SetupParams {
leaves,
sectors_count: 2,
challenges_count: 2,
},
engine_params: params,
partitions: None,
};
let pu... | Rust | 0 |
nv3x3 if depthwise else conv3x3
stem = conv3x3(input_ch, stem_ch[0], "stem", "1", 2)
stem += conv_type(stem_ch[0], stem_ch[1], "stem", "2", 1)
stem += conv_type(stem_ch[1], stem_ch[2], "stem", "3", 2)
self.add_module("stem", nn.Sequential((OrderedDict(stem))))
current_stirde = 4
... | Python | 1 |
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
# --------------------------------------------------------
# References:
# DeiT: https://github.com/facebookresearch/deit
#... | Python | 1 |
# External imports
import segmentation_models_pytorch as smp
def Unet(cfg, input_size, num_classes):
return smp.Unet(
encoder_name=cfg["encoder"]["model_name"],
encoder_weights="imagenet",
in_channels=input_size[0],
classes=num_classes,
decoder_attention_type="scse",
)
... | Python | 1 |
rt),
'--model', args.model,
'--output_type', args.output_type,
'--max_new_tokens', str(args.max_new_tokens),
'--temperature', str(args.temperature),
'--presence_penalty', str(args.presence_penalty),
]
if len(device) < len(gpus):
cmd... | Python | 1 |
new_post_in_user(user_id: Path<Id>) -> impl Responder {
format!("POST /post/user/{}", user_id.into_inner())
}
pub async fn get_all_posts_in_topic(db: Data<Db>, topic_id: Path<Id>) -> impl Responder {
match Post::get_in_topic(&db.pool, topic_id.into_inner()).await {
Ok(p) => respond::ok(p),
Err(... | Rust | 0 |
V_A_H(images_path=val_images_path,
audio_path=val_audio_path,
haptic_path=val_tactile_path,
images_class=val_images_label,
transform=None)
#print(train_data_set)
tra... | Python | 1 |
new(tx).to_row());
rows.push(TxConfRow::new(tx, blockhash).to_row());
let txid = full_hash(&tx.txid()[..]);
for (txo_index, txo) in tx.output.iter().enumerate() {
if !txo.script_pubkey.is_provably_unspendable() {
rows.push(TxOutRow::new(&txid, txo_index, txo).to_row());
}
}
... | Rust | 0 |
u32) & 0x01) << 11);
self.w
}
}
impl R {
#[doc = "Bit 0 - PIOn_0."]
#[inline(always)]
pub fn isense0(&self) -> ISENSE0_R {
ISENSE0_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - PIOn_1."]
#[inline(always)]
pub fn isense1(&self) -> ISENSE1_R {
ISENSE1_R::new((... | Rust | 0 |
arsed, &new, rcx)
}
fn recover_node_and_children(reparsed: &Self, new: &Self, rcx: RewriteCtxtRef) {
<[T] as RecoverChildren>::recover_node_and_children(&reparsed, &new, rcx)
}
fn recover_node_restricted(old_span: Span, reparsed: &Self, new: &Self, rcx: RewriteCtxtRef) {
<[T] as Recove... | Rust | 0 |
""" =================================================
Copyright (C) 2018 Vikash Kumar
Author :: Vikash Kumar (vikashplus@gmail.com)
Source :: https://github.com/vikashplus/robohive
License :: Under Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may ob... | Python | 1 |
yew::html! {
<li class="page-item disabled">
<a class="page-link" href="#">{ "»" }</a>
</li>
}
}
}
</ul>
}
}
fn changed(&mut self, ctx: &yew::Context<Self>... | Rust | 0 |
system_tests() {
// Get all files in the tests/source directory.
let files = fs::read_dir("tests/source").expect("Couldn't read source dir");
// Turn a DirEntry into a String that represents the relative path to the
// file.
let files = files.map(get_path_string);
let (_reports, count, fails) =... | Rust | 0 |
MIPS_ARCH_32R2: u32 = 0x7000_0000;
/// MIPS64r2 code.
pub const EF_MIPS_ARCH_64R2: u32 = 0x8000_0000;
// MIPS values for `Sym32::st_shndx`.
/// Allocated common symbols.
pub const SHN_MIPS_ACOMMON: u16 = 0xff00;
/// Allocated test symbols.
pub const SHN_MIPS_TEXT: u16 = 0xff01;
/// Allocated data symbols.
pub const S... | Rust | 0 |
, 2, yeelight::CfAction::Recover)
}
fn police(brightness: i8) -> PresetValue {
let duration = 300;
let (red, blue) = (0xFF_00_00, 0x00_00_FF);
let expr = FlowExpresion(vec![
FlowTuple::rgb(duration, red, brightness),
FlowTuple::rgb(duration, blue, brightness),
]);
PresetValue::Flow(... | Rust | 0 |
func.collide(curr_bot.as_mut(), that_bot.as_mut());
}
}
active.push(curr_bot);
}
}
fn find_bijective_parallel<A: Axis, F: ColMulti<T = I>>(
&mut self,
axis: A,
cols: (PMut<[I]>, PMut<[I]>),
func: &mut F,
) {
... | Rust | 0 |
util::error::*, util::pdv_utilities::*,
validator::pdv_trust_anchor::PDVTrustAnchorChoice, validator::policy_utilities::*,
CertificationPath, NameConstraintsSet,
};
use const_oid::db::rfc5280::ANY_POLICY;
use const_oid::db::rfc5912::*;
use der::{asn1::ObjectIdentifier, Decode, Encode};
use x509_cert::ext::pkix:... | Rust | 0 |
shape.is_fully_defined():
initializer = init_ops.zeros_initializer()
return create_slot_with_initializer(
primary, initializer, slot_shape, dtype, name,
colocate_with_primary=colocate_with_primary,
copy_xla_sharding=copy_xla_sharding)
else:
if isinstance(primary, variables.Variable... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import odoo.addons.web.tests.test_js
import odoo.tests
@odoo.tests.tagged("post_install", "-at_install")
class WebSuite(odoo.tests.HttpCase):
def setUp(self):
super().setUp()
env = self.env(user=sel... | Python | 1 |
import math
import vsketch
class LissajousSketch(vsketch.SketchClass):
n_points = vsketch.Param(100)
radius = vsketch.Param(264.0) # ~ WIDTH/4 at 96 DPI
freq_x = vsketch.Param(2.0)
freq_y = vsketch.Param(3.0)
def draw(self, vsk: vsketch.Vsketch) -> None:
# Letter size in landscape, measur... | Python | 1 |
ole_id: web::Path<i64>,
auth: AuthToken,
) -> Result<HttpResponse> {
auth.require_permission(Permission::role__delete)?;
role_service::role_delete(&pool, role_id.into_inner()).await?;
Ok(HttpResponse::NoContent().finish())
}
#[api_v2_operation(summary = "Assign a specific role to an user", tags(Roles))... | Rust | 0 |
s None:
abort(400, 'Invalid game_id')
if user.expires_at < time():
user = refresh_access_token(user)
channel_id = game.channel_id
if channel_id is None:
create_match_data = {
'access_tokens': [user.access_token],
'nicks': {user.discord_id: user.id}
... | Python | 1 |
import io
from avro.io import DatumReader, BinaryDecoder
import json
import logging
class AvroDeserializer():
"""
Decodes the given schema for the user and returns the decoded data.
Wrapper for the AvroDeserializer.
Attributes:
schema (Schema): the schema loaded from a schema file
"""
... | Python | 1 |
::rb_cTime);
define_class!(TrueClass => ffi::rb_cTrueClass);
define_class!(UnboundMethod => ffi::rb_cUnboundMethod);
define_class!(ArgError => ffi::rb_eArgError);
define_class!(EOFError => ffi::rb_eEOFError);
define_class!(EncCompatError => ffi::rb_eEncCompatError);
define_class!(EncodingError => ffi::rb_eEncodingError... | Rust | 0 |
// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR P... | Rust | 0 |
ProviderKey], kid: &str) -> Result<SupportedPublicKey, ()> {
let matching: Vec<&ProviderKey> = key_set
.iter()
.filter(|key| key.use_ == "sig" && key.kid == kid)
.collect();
// Verify that we found exactly one key matching the key ID.
if matching.len() != 1 {
return Err(());... | Rust | 0 |
pub mod parse;
pub fn parse(buf: &[u8]) -> parse::Lines<'_> {
parse::Lines::new(buf)
}
use crate::access_control;
use serum_common::pack::Pack;
use serum_lockup::accounts::Safe;
use serum_lockup::error::LockupError;
use solana_sdk::account_info::{next_account_info, AccountInfo};
use solana_sdk::info;
use solana_... | Rust | 0 |
_bool().unwrap();
assert_eq!(verify_ok, false);
// Recoverable signature
let output = setup.cli(&format!(
"util sign-data --binary-hex 0xdeadbeef --privkey-path {} --recoverable",
account_privkey
));
let value: serde_yaml::Value = serde_yaml::from_str(&ou... | Rust | 0 |
# Copyright 2022 Webull
#
# 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 agreed to in writing, software... | Python | 1 |
d
{
self.kind
}
pub fn to_code(&self) -> &'static str
{
self.kind.to_code()
}
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PunctuationKind
{
Backslash,
BraceLeft,
BraceRight,
BracketLeft,
BracketRight,
ChannelSetLeft,
ChannelSetRight,
Comma,
Equal,
LeftArrow,
Ampersand,
ParenLeft,
P... | Rust | 0 |
r mkv files in subdirectories as well")
args = vars(parser.parse_args())
set_ref_file_vars(args["reference_file"], args["chapter_reference_file"] )
if args["directory"] is None:
args["directory"] = getcwd()
set_mapping(load_json_file(episodes_ref_file), load_json_file(chapters_ref_file))
... | Python | 1 |
s_with("missing field"))
}
_ => panic!("Expecting error to be InvalidConfigFile."),
};
Ok(())
}
#[test]
fn test_parse_config_file_no_server_port() -> Result<()> {
let config_file = Tempfile::create(
r#"
{
"server": "127.0.0.1",... | Rust | 0 |
import py
from unityparser.utils import UnityDocument
class TestSmartScalarValueTypes:
def test_types(self, fixtures):
base_file_path = py.path.local(fixtures['MultipleTypesDoc.asset'])
doc = UnityDocument.load_yaml(str(base_file_path), try_preserve_types=True)
multi_types = doc.entry
... | Python | 1 |
nodes: vec![0; num_nodes],
visited_flag: 1,
}
}
pub fn is_visited(&self, node: NodeId) -> bool {
self.nodes[node] == self.visited_flag
}
pub fn set_visited(&mut self, node: NodeId) {
self.nodes[node] = self.visited_flag;
}
pub fn unvisit_all(&mut se... | Rust | 0 |
amazing title");
assert_eq!(
true,
adr_sut
.content
.contains("== This is a new completly amazing title")
);
}
#[test]
fn test_split_path() {
let base_path = Path::new("/tmp/adr-samples/src");
let file_path = Path::new... | Rust | 0 |