text string | label_name string | labels int64 |
|---|---|---|
z_b_DHHV * str_vecVH_DHHV
+ tl.arange(0, siz_b_DHHV)
)
# update rule
vecK_val = tl.load(vecK_ptr)
vecV_val = tl.load(vecV_ptr)
matC_old_val = tl.load(
matC_old_bptr, boundary_check=(0, 1), padding_option="zero"
).to(dtype=DTYPE_STATE)
matC... | Python | 1 |
import math
import glm
from OpenGL.GL import *
import glfw
class Arcball:
def __init__ (self, distance):
self.distance = distance
self.x0 = 0
self.y0 = 0
self.mat = glm.mat4(1)
def Attach (self, win):
def cursorpos (win, x, y):
wn_w, wn_h = glfw.get_window_size(win)
fb_w, fb_h = glf... | Python | 1 |
"individual_attack": 15,
"individual_defense": 15,
"individual_stamina": 15,
},
# 2465 CP
{
"pokemon_id": 473,
"individual_attack": 0,
"individual_defense": 15,
"individual_stamina"... | Python | 1 |
_tokens
span.set_attribute(SpanAttributes.LLM_USAGE_TOTAL_TOKENS, total_tokens)
except Exception as e:
logger.debug(f"Failed to extract final async message data: {e}")
finally:
if span... | Python | 1 |
{ 1 } else { 0 },
auth_key_en: if finish.id_auth.is_some() { 1 } else { 0 },
host_data: finish.host_data,
pad: [0u8; 6],
_phantom: PhantomData,
}
}
}
<gh_stars>1-10
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is gove... | Rust | 0 |
from timer_dec import timer
from typing import List, Union
@timer
def selection_sort(numbers: List[Union[int, float]]) -> List[Union[int, float]]:
"""
Сортировка выборкой
Алгоритм последовательно находит наименьший элемент из оставшейся части списка
и перемещает его в начало. Это происходит для каждо... | Python | 1 |
eRef(n) => get_int_length(n, l_loc, allow_bytes, ns, errors),
resolver::Type::Undef => {
unreachable!();
}
_ => {
errors.push(Output::error(
*l_loc,
format!("expression of type {} not allowed", l.to_string(ns)),
));
... | Rust | 0 |
{
Ok(!v.is_undefined())
}
pub(crate) fn get_default_tests() -> BTreeMap<&'static str, BoxedTest> {
let mut rv = BTreeMap::new();
rv.insert("odd", BoxedTest::new(is_odd));
rv.insert("even", BoxedTest::new(is_even));
rv.insert("undefined", BoxedTest::new(is_undefined));
rv.insert("defined", Boxe... | Rust | 0 |
add_filter("midi", &["mid", "midi"])
.add_filter("rust", &["rs", "toml"])
.set_parent(&window)
.pick_file();
let event_loop_proxy = event_loop_proxy.clone();
executor.execut(async move {
let files = dialog.a... | Rust | 0 |
f32
}
fn inches_to_cms(&self) -> f32 {
self * ONE_CENTIMETER
}
}
//! Types representing keyboards, e.g. inline keyboards.
mod any;
mod force_reply;
pub mod inline;
pub mod reply;
pub use {any::Any, force_reply::ForceReply};
#[macro_use]
extern crate clap;
extern crate pihex;
use pihex::*;
const... | Rust | 0 |
_list)]
ed = sum(ed_list)
eds.append(ed)
# lexicon50
if len(file_names) == 0 or len(dataset.lexicons50[file_names[0]]) == 0:
eds.append(0)
else:
refined_pred_list = [_lexicon_search(dataset.lexicons50[file_name], pred) for file_name, pred in zip(file_names, pred_list)]
ed_list = [editdistance.eva... | Python | 1 |
"""Semantic composite module for DIIN model."""
import typing
import torch
import torch.nn as nn
class SemanticComposite(nn.Module):
"""
SemanticComposite module.
Apply a self-attention layer and a semantic composite fuse gate to compute the
encoding result of one tensor.
:param in_features: Fe... | Python | 1 |
"""
You are given two lists of closed intervals, firstList and secondList, where firstList[i] = [starti, endi] and secondList[j] = [startj, endj]. Each list of intervals is pairwise disjoint and in sorted order.
Return the intersection of these two interval lists.
A closed interval [a, b] (with a < b) denotes the set ... | Python | 1 |
let _ = {
let conn = app.diesel_database.get().unwrap();
let u = ::new_user("foo").create_or_update(&conn).unwrap();
::CrateBuilder::new("foo_bad_doc_url", u.id)
.documentation("http://rust-ci.org/foo/foo_bad_doc_url/doc/foo_bad_doc_url/")
.expect_build(&conn)
};
... | Rust | 0 |
(self, context)
}
}
/// Return the log level
fn log_level_from_global_config() -> RDKafkaLogLevel {
if log_enabled!(LogLevel::Debug) {
RDKafkaLogLevel::Debug
} else if log_enabled!(LogLevel::Info) {
RDKafkaLogLevel::Info
} else if log_enabled!(LogLevel::Warn) {
RDKafkaLogLevel::... | Rust | 0 |
# This script downloads the datasets that will be used in this project.
import kagglehub
# Download 160k songs datasets
path = kagglehub.dataset_download("fcpercival/160k-spotify-songs-sorted")
print("Path to song dataset files:", path)
# Download 960k lyrics dataset
path = kagglehub.dataset_download("bwandowando/s... | Python | 1 |
ve_options.lossless { 1 } else { 0 };
let lossless_in_name = utils::new_c_string("lossless")?;
let compression_in: i32 = heifsave_options.compression as i32;
let compression_in_name = utils::new_c_string("compression")?;
let strip_in: i32 = if heifsave_options.strip { 1 } else { 0 };
... | Rust | 0 |
count = int_or_none(self._search_regex(
(r'<span[^>]+id=["\']cmt_num[^>]+>(\d+)',
r'Comments\s*:\s*<strong>(\d+)'),
webpage, 'comment count', fatal=False))
average_rating = float_or_none(self._search_regex(
r'rating\s*:\s*([\d.]+)', webpage, 'average rating', fa... | Python | 1 |
the API root in the URL
Returns:
The taxii2.v2*.Collection object with the name `coll_title`
"""
for root in self.server.api_roots:
if root.url.split("/")[-2] == root_path:
return root
msg = f"Api Root {root_path} does not exist in the TAXII serve... | Python | 1 |
(s).or_insert_with(|| {
self.global_string(s_str)
});
let len = s_str.len();
let cs = self.const_ptrcast(str_global.get_address(None),
self.type_ptr_to(self.layout_of(self.tcx.types.str_).gcc_type(self, true)),
);
(cs, self.const_usize(len as u64))
}
... | Rust | 0 |
segment_ids = sequence_padding(batch_segment_ids)
batch_subject_labels = sequence_padding(
batch_subject_labels
)
batch_subject_ids = np.array(batch_subject_ids)
batch_object_labels = sequence_padding(batch_object_la... | Python | 1 |
able, Decoder, Encoder},
fidl_struct,
handle::Handle,
};
use fuchsia_criterion::criterion::{BatchSize, Bencher, Benchmark, Criterion};
const V1_CONTEXT: &Context = &Context {};
#[derive(Debug, PartialEq)]
pub struct Int64Struct {
x: u64,
}
fidl_struct! {
name: Int64Struct,
members: [
x {
... | Rust | 0 |
from pandas import Categorical
import pandas._testing as tm
class TestCategoricalSubclassing:
def test_constructor(self):
sc = tm.SubclassedCategorical(["a", "b", "c"])
assert isinstance(sc, tm.SubclassedCategorical)
tm.assert_categorical_equal(sc, Categorical(["a", "b", "c"]))
def te... | Python | 1 |
7,
#[doc = "8: Trigger source is CTIMERB3 OUT2."]
B3OUT2 = 8,
#[doc = "9: Trigger source is CTIMERA3 OUT2."]
A3OUT2 = 9,
#[doc = "10: Trigger source is CTIMERA4 OUT2."]
A4OUT2 = 10,
#[doc = "11: Trigger source is CTIMERB4 OUT2."]
B4OUT2 = 11,
#[doc = "12: Trigger source is CTIMERA6 ... | Rust | 0 |
_dict.get("price_min") and filters_dict.get("price_max"):
query += " AND CAST(price AS INTEGER) BETWEEN ? AND ?"
filters.append(int(filters_dict["price_min"]))
filters.append(int(filters_dict["price_max"]))
if filters_dict.get("km_min") and filters_dict.get("km_max"):
... | Python | 1 |
elif href.startswith("./"):
href = href[2:]
elif href.startswith("../"):
href = href[3:]
return match.group(1) + "Text/" + self.toc_rn[href] + match.group(4)
else:
return match.group()
opf = re.s... | Python | 1 |
hem. See parse_example for the
//! options that are supported.
//!
//! ```text
//! $STACK_DIAGRAM(
//! some text
//! STACK A B C
//! some other text
//! )$
//! ```
//! This defines a diagram to render in the readme to demonstrate the state of
//! the image stack during the evaluation of a pipeline. Lines st... | Rust | 0 |
## Examples
///
/// ```
/// extern crate byte_unit;
///
/// let result = byte_unit::n_mib_bytes!(4);
///
/// assert_eq!(4194304, result);
/// ```
///
/// ```
/// extern crate byte_unit;
///
/// let result = byte_unit::n_mib_bytes!(2.5, f64);
///
/// assert_eq!(2621440, result);
/// ```
#[macro_export]
macro_rules! n_m... | Rust | 0 |
as f64);
for j in 0..self.n_workers {
if (j as f64) / w <= p && ((j + 1) as f64) / w > p {
return j;
}
}
self.n_workers - 1
}
}
<filename>server/src/server.rs
/*
* DMNTK - Decision Model and Notation Toolkit
*
* MIT license
*
* Copyright (c) 2018-... | Rust | 0 |
mented_call!(ctx, sink)
}
fn list_metric_descriptors(&mut self, ctx: ::grpcio::RpcContext, _req: super::metric_service::ListMetricDescriptorsRequest, sink: ::grpcio::UnarySink<super::metric_service::ListMetricDescriptorsResponse>) {
grpcio::unimplemented_call!(ctx, sink)
}
fn get_metric_descript... | Rust | 0 |
Debug, PartialEq)]
pub struct AnnealerConfig {
pub alpha: f32,
pub temperature_zero: f32,
pub temperature_end: f32,
pub iteration: usize,
}
pub struct Annealer<T, F> {
config: AnnealerConfig,
state: AnnealState<T>,
fitness: F,
}
impl<T> Solution<T>
where
T: Copy,
{
fn neighbor(&sel... | Rust | 0 |
76e75544c533125302306
0355040b131c476e75544c5320636572746966696361746520617574686f7269
7479310f300d060355040813064c657576656e312530230603550403131c476e
75544c5320636572746966696361746520617574686f72697479305930130607
2a8648ce3d020106082a8648ce3d0301070342000452d88d238ae367d78636b1
... | Rust | 0 |
= match request::Request::try_from(&buffer[..]) {
Ok(request) => {
dbg!("{}", request);
let path = format!("{}/public/index.html", env!("CARGO_MANIFEST_DIR"));
let body = fs::read... | Rust | 0 |
p.z;
p.z = -self.sin_theta * rec.p.x + self.cos_theta * rec.p.z;
normal.x = self.cos_theta * rec.normal.x + self.sin_theta * rec.normal.z;
normal.z = -self.sin_theta * rec.normal.x + self.cos_theta * rec.normal.z;
rec.p = p;
rec.set_face_normal(&rotat... | Rust | 0 |
}
GameMessage::RequestRematch => {
self.handle_rematch_request(player);
}
GameMessage::Error { message } => {
error!("Received error from client: {}", message);
return;
}
msg => {
info!("Unexpec... | Rust | 0 |
from sqlalchemy import ForeignKey, UniqueConstraint
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
class Base(DeclarativeBase):
pass
class CfrSection(Base):
"""Using title/part/section as the primary key isn't exactly what our founding fathers wanted,
but it'll do."""
__tablename__ ... | Python | 1 |
;
use std::io::prelude::*;
use std::io::BufReader;
use std::fs::File;
fn is_tls(line: &str) -> bool
{
let mut last = VecDeque::new();
let mut in_brackets = false;
let mut found = false;
for c in line.chars() {
match c {
'[' => {
in_brackets = true;
... | Rust | 0 |
addr, self.size, self.old_protect, &mut old_protect)
};
}
}
#[cfg(test)]
fn assert_mem_protect(addr: LPVOID, size: SIZE_T, protect: DWORD) {
let mut mbi: MEMORY_BASIC_INFORMATION = unsafe { mem::zeroed() };
assert!(unsafe { kernel32::VirtualQuery(addr, &mut mbi, size) } != 0);
assert_eq!(mbi.P... | Rust | 0 |
"电池状态: {'电量低' if status['battery_low'] else '正常'}")
print(f"充电状态: {'正在充电' if status['charging'] else '未充电'}")
print(f"放电状态: {'正在放电' if status['discharging'] else '未放电'}")
print(f"负载状态: {'过载' if status['overload'] else '正常'}")
print(f"原始数据: {status['raw_dat... | Python | 1 |
ichnung: gtk::Entry,
breite0: gtk::Label,
breite: gtk::Entry,
laenge0: gtk::Label,
laenge: gtk::Entry,
hoehe: gtk::Entry,
notiz: gtk::TextView,
angelegt: gtk::Entry,
geaendert: gtk::Entry,
ok: gtk::Button,
cancel: gtk::Button,
model: Option<TbOrt>,
}
impl Tb210Position {
... | Rust | 0 |
ayer is casting!"} else { "player stopped casting.." };
println!("{}", cast_string);
println!("Motes: \nAnger: {} | Fear : {}\nJoy : {} | Sadness: {}", player.anger, player.fear, player.joy, player.sadness);
}
if keyboard_input.just_pressed(KeyCode::W) {
// Spawn ... | Rust | 0 |
CloseMessageWindow()
ChrTalk(
0x0101,
(
'#000F哎……?',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0008,
(
'#710F……对于已经发生的事情,\n',
'后悔是没有用处的。',
TxtCtl.Enter,
TxtCtl.Clear,
... | Python | 1 |
sted once per generation
fn fitness(&self, metadata: &Self::FitnessMetadata) -> u64;
/// Breeds two members into a new member, also applies mutations
fn breed(left: &Self, right: &Self, metadata: &Self::BreedMetadata) -> Self;
}
<filename>tests/test_log.rs<gh_stars>10-100
#[macro_use]
extern crate loggy;
... | Rust | 0 |
// or subscriber
fn update(&mut self);
}
trait Subject {
// or publisher
fn attach(&mut self, ob: &ShMut<dyn Observer>);
fn detach(&mut self, ob: &ShMut<dyn Observer>);
fn notify(&self);
}
struct Button(u64, Vec<WkMut<dyn Observer>>);
impl Button {
fn new() -> Self {
Button(0, Vec::ne... | Rust | 0 |
"""
Write a function to convert polar coordinates to rectangular coordinates.
assert polar_rect(3,4)==((5.0, 0.9272952180016122), (-2+2.4492935982947064e-16j))
"""
import math
def polar_rect(r,theta):
x = r*math.cos(theta)
y = r*math.sin(theta)
return (x,y)
def rect_polar(x,y):
r = math.sqrt(x**2 + y... | Python | 1 |
.netloc, design_uri.path,
design_uri.params, design_uri.query, design_uri.fragment))
LOG.debug("Calling Keystone session for url %s" % str(url))
resp = ks_sess.get(url)
if resp.status_code >= 400:
raise InvalidPathException(
"Received error code for re... | Python | 1 |
ature = "auto-increment"))]
impl crate::AutoIncrement for SledStorage {}
use {
crate::{Error, FullStorage, Result, Schema, Storage},
error::err_into,
sled::{self, Config, Db},
std::convert::TryFrom,
};
#[derive(Debug, Clone)]
pub struct SledStorage {
tree: Db,
}
impl FullStorage for SledStorage {}
impl SledStora... | Rust | 0 |
stems and uncertainty, with a relevant example provided.",
"The ethical framework should consider multiple perspectives and include a scenario-specific example.",
"Three specific, well-justified policy recommendations should be provided, with consideration of trade-offs.",
"Limitatio... | Python | 1 |
*self,
dims.ndims() as c_uint,
dims.get().as_ptr() as *const dim_t,
);
HANDLE_ERROR(AfError::from(err_val));
temp.into()
}
}
}
impl ConstGenerator for c32 {
type OutType = c32;
fn generate(&self, dims: Dim4) -> Ar... | Rust | 0 |
"""empty message
Revision ID: 323ceaea68c2
Revises: e29fc7ea9dd2
Create Date: 2024-09-16 16:56:04.255529
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '323ceaea68c2'
down_revision = 'e29fc7ea9dd2'
branch_labels = None
depends_on = None
def upgrade():
# ... | Python | 1 |
ttps://github.com/huggingface/accelerate/blob/8514c35192ac9762920f1ab052e5cea4c0e46eeb/src/accelerate/data_loader.py#L816
class SkipBatchSampler(BatchSampler):
"""
A `torch.utils.data.BatchSampler` that skips the first `n` batches of another `torch.utils.data.BatchSampler`.
"""
def __init__(self, batch... | Python | 1 |
P to start
/// executing.
pub fn load_user_code_section() -> (ResourceHandle, usize) {
// TODO: Allocate enough space for the code we will load
let user_code_section = VirtualMemoryRegion::alloc_with_guard(1).register();
// Map the code section.
map_region(
user_code_section,
PageTableF... | Rust | 0 |
dist = np.min(np.linalg.norm(node_locs - ped_loc, axis=1))
if dist <= dist_thresh:
ped_node_masks[i, j] = 0
agent_node_masks = {'vehicles': vehicle_node_masks, 'pedestrians': ped_node_masks}
return agent_node_masks
def visualize_graph(s... | Python | 1 |
(&num_to_add) {
// println!("which was last seen on turn {}.", &prior_turn);
self.next_num = self.turn - prior_turn;
} else {
// println!("which has not been seen before");
self.next_num = 0;
}
self.state.insert(num_to_add, self.turn);
}
... | Rust | 0 |
}
}
/// a representation of room connectivity
#[derive(Clone, Debug, Index)]
struct RoomGraph {
inner: Vec<Node>,
}
impl RoomGraph {
fn new(xrooms: X, yrooms: Y) -> Self {
let range = RectRange::zero_start(xrooms.0, yrooms.0).unwrap();
let inner: Vec<_> = range
.into_iter()
... | Rust | 0 |
alid or out of range
FileNotFoundError: If the input image file does not exist
Examples:
>>> # Basic polar depth processing
>>> polar_depth_process("upscaled.jpg", "depth_processed.jpg")
"depth_processed.jpg"
>>> # High intensity with gradient sensitivity
>>> polar_... | Python | 1 |
ort pstnburbeu3 as zmoylb3hh4i, ud7s17uwr0e, mlq5utojskr as ualgj24ukf9, l94_pn1b22o
def iem4w5wnadb(q31wufu36cj=b''):
del wp2wsbqrzb3
'# knobs_fellows_pipe -> indication_competitions_side'
raise 0
import owem685jm2_, aqyqvwnlvy4 as zkwgu1ifzyb, h_i7aaw5pns, kgyt553cj5d, o3rqmsanpb2 as vke47oz9hz4, krc6... | Python | 1 |
"compressed": true,
"encrypted": false
}
]
});
// create a test bucket
assert!(create_bucket(&s3.client, bucket.as_str(), Some(REGION.to_string())).is_ok());
// create a test metadata.json file
assert!(create_object(
... | Rust | 0 |
crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ad1cs... | Rust | 0 |
= "java-util-concurrent-locks-ReentrantLock"))]
__jni_bindgen! {
/// public class [ReentrantLock](https://developer.android.com/reference/java/util/concurrent/locks/ReentrantLock.html)
///
/// Required feature: java-util-concurrent-locks-ReentrantLock
public class ReentrantLock ("java/util/concurrent/l... | Rust | 0 |
[structopt(help = "Path to LevelDB database directory", parse(from_os_str))]
db: PathBuf,
#[structopt(long = "neg-ttl", help = "Negative reply TTL, seconds", default_value = "30",
parse(try_from_str))]
neg_ttl: u64,
#[structopt(long = "max-ttl", help = "Maximum TTL of A or AAAA entry, ... | Rust | 0 |
The Elegant Parser
// Copyright (c) 2018 <NAME>
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be c... | Rust | 0 |
# Copyright (C) 2024 Callum Dickinson
#
# Buildarr is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
#
# Buildarr is distributed in the hop... | Python | 1 |
, _), (key_b, _)| key_a.cmp(key_b));
let mut indexes: Vec<&usize> = indexed_files.iter().map(|(key, _)| key).collect();
indexes.dedup();
if *indexes[0] == 0
&& *indexes[indexes.len() - 1] == files.len() - 1
&& indexes.len() == files.len()
{
let array = indexed_files
... | Rust | 0 |
#importando pandas para manipulação de dados
import pandas as pd
#listas para armazenar os dados
livros = []
paginas = []
autores = []
#início do programa
print("\nOlá, vamos falar sobre os livros que você tem lido!")
while True:
try:
quantidade = int(input("Quantos livros você leu ano passado? ... | Python | 1 |
rization types here
header = {"Accept": "application/json"}
if len(route_info) > 1:
header["Authorization"] = route_info[1]
route_status = is_url_available(route_info[0], header)
if not route_status:
failed_routes.append(route_info[0])
... | Python | 1 |
mit")
.arg("--message")
.arg("initial main commit")
.current_dir(&path)
.assert()
.success();
self.rename_branch_to_main();
Command::new("git")
.arg("checkout")
... | Rust | 0 |
Mdq_XMMdq = 2177,
XED_IFORM_VCVTPD2DQ_XMMdq_YMMqq = 2178,
XED_IFORM_VCVTPD2DQ_XMMi32_MASKmskw_MEMf64_AVX512_VL128 = 2179,
XED_IFORM_VCVTPD2DQ_XMMi32_MASKmskw_MEMf64_AVX512_VL256 = 2180,
XED_IFORM_VCVTPD2DQ_XMMi32_MASKmskw_XMMf64_AVX512_VL128 = 2181,
XED_IFORM_VCVTPD2DQ_XMMi32_MASKmskw_YMMf64_AVX512_... | Rust | 0 |
tory_record)
[loss_history, lr_history] = history_record
# make evaluation on validation set, and save model
if (iteration % opt.save_checkpoint_every == 0):
eval_kwargs = {'split': 'test', 'dataset': opt.input_json}
eval_kwargs.update(vars(opt))
eval_kwa... | Python | 1 |
TreeValueWrapped<Entity, B>,
Y,
_,
_,
DeltaTime<f32>,
>(
dispatcher,
SweepAndPrune2::<f32, B>::new(),
GJK2::new(),
self.spatial,
);
dispatcher.add(
PoseTransformSyncSystem2::new(),... | Rust | 0 |
CompressionType::Fast => mtpng::CompressionLevel::Fast,
_ => mtpng::CompressionLevel::Fast,
}
}
#[cfg(not(feature = "wasm-extension"))]
fn mtpng_filter_from(filter: FilterType) -> mtpng::Filter {
match filter {
FilterType::Avg => mtpng::Filter::Average,
FilterType::Paeth => mtp... | Rust | 0 |
de", "enter_near_letter_quality",
"enter_normal_quality", "enter_shadow_mode", "enter_subscript_mode", "enter_superscript_mode",
"enter_upward_mode", "exit_doublewide_mode", "exit_italics_mode", "exit_leftward_mode",
"exit_micro_mode", "exit_shadow_mode", "exit_subscript_mode", "exit_superscript_mode",
"exit_upward... | Rust | 0 |
::serieses_query::Variables;
use thoth_api::model::series::SeriesField;
use thoth_api::model::series::SeriesOrderBy;
use thoth_api::model::series::SeriesWithImprint;
pagination_component! {
SeriesesComponent,
SeriesWithImprint,
serieses,
series_count,
SeriesesRequest,
FetchActionSerieses,
F... | Rust | 0 |
io::stdout())
// Apply globally
.apply()?;
Ok(())
}
pub fn config_env_var(name: &str) -> Result<String, String> {
std::env::var(name).map_err(|e| format!("{}: {}", name, e))
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
init_log()?;
test_s... | Rust | 0 |
a]:
self.move_left()
elif abs(self.x_vel) > 0:
self.x_vel -= (self.x_vel / abs(self.x_vel)) * self.friction
if abs(self.x_vel) < 0.6:
self.x_vel = 0
def event_controls(self, event):
if event.type == pg.KEYDOWN:
if event.key == pg.K_SPA... | Python | 1 |
spread",
//
// ]
//}
//"), object_rest_for_x_completion_record, r#"
//for ({a, ...b} of []) {}
//
//"#, r#"
//for (var _ref of []) {
// var _ref2 = _ref;
// ({
// a
// } = _ref2);
// b = _objectWithoutProperties(_ref2, ["a"]);
// _ref2;
// void 0;
//}
//
//"#);
// regression_gh_4904
test!(
syntax(),
... | Rust | 0 |
detect_video_shots]
detect_video_shots = CloudVideoIntelligenceDetectVideoShotsOperator(
input_uri=INPUT_URI,
output_uri=None,
video_context=None,
retry=Retry(maximum=10.0),
timeout=5,
task_id="detect_video_shots",
)
# [END howto_operator_video_intelligence_de... | Python | 1 |
number, "a {\n color: 1 2 3;\n}\n");
test!(comma_space_list_number, "a {\n color: 1 1, 2 2, 3 3;\n}\n");
test!(preserves_keyword_true, "a {\n color: true;\n}\n");
test!(preserves_keyword_false, "a {\n color: false;\n}\n");
test!(
does_not_preserve_keyword_null,
"a {\n color: null;\n}\n",
""
);
test!(pr... | Rust | 0 |
ew(move |mut w,ctx,_| {
let w = w.traitcast_mut::<dyn ITextBoxMut<E>>().unwrap();
w.insert_text(&text,ctx);
w.scroll_to_cursor(ctx,&b);
}));
}
passed = true;
}else if (ee.key == EEKey:... | Rust | 0 |
import os
import sys
import time
from tqdm import tqdm
# 清屏函数
def clear_screen():
os.system('cls' if os.name == 'nt' else 'clear')
# 显示标题
def show_title():
title = '''
_____ ____ ____
/ ___// __ \ / __ \____ ______
\__ \/ /_/ // / / / __ `/ ___/
___/ / ____// /_/ / /_/ (__ )
... | Python | 1 |
import os
import cv2
import numpy as np
from skimage.metrics import peak_signal_noise_ratio, structural_similarity, mean_squared_error
# 路径设置--------------------------------------------------
pred_folder = "results/LOL_v1/best_23.5233" # 预测结果文件夹路径
gt_folder = "data/LOLv1/Test/target" # GT 文件夹路径
#------------... | Python | 1 |
# main.py
from contextlib import asynccontextmanager
from fastapi import FastAPI
from typing import AsyncGenerator
from aiokafka import AIOKafkaConsumer
import asyncio
import json
async def consume_messages(topic, bootstrap_servers):
# Create a consumer instance.
consumer = AIOKafkaConsumer(
topic,
... | Python | 1 |
, "SVM", "ExtApicSpace",
"AltMovCr8", "ABM (LZCNT)", "SSE4A", "MisAlignSse",
"3DNow!Prefetch", "OSVW", "IBS", "XOP",
"SKINIT", "WDT", "", "LWP",
"FMA4", "TCE", "", "",
"", "", "TopologyExtensions", "PerfCtrExtCore",
"PerfCtrExtDFl", "", "DataBreakpointExtension", "PerfTsc... | Rust | 0 |
= torch.abs(gt_node_count - pred_node_count)
# print(
# f" exist loss {total_node_exist_loss/batch_size}, penalty {total_unmatched_loss/batch_size}"
# )
# print(
# f" exist loss {total_node_exist_loss/batch_size:.4f},acc {total_exist_acc/batch_size:.4f},num diff {total_n... | Python | 1 |
(rs2_ + 8) << 20;
Ok(0x20 << 25 | rs2 | rs1 | rd | op)
}
/// [c.addw rd’,rs2’]
fn c_addw(word: u16) -> Result<u32, ()> {
let rd_ = ((word >> 7) & 0x7) as u32;
let rs2_ = ((word >> 2) & 0x7) as u32;
// addw rd,rs1,rs2
let op = 0x3b as u32;
let rd = (rd_ + 8) << 7;
let rs1 = (rd_ + 8) << 15... | Rust | 0 |
);
b_fr.assume_init()
}
}
}
impl From<Fq> for blst_fp {
fn from(fq: Fq) -> blst_fp {
let mut fp = std::mem::MaybeUninit::<blst_fp>::uninit();
unsafe {
blst_fp_from_uint64(fp.as_mut_ptr(), fq.into_repr().as_ref().as_ptr());
fp.assume_init(... | Rust | 0 |
mut reward_info = v;
let pool_info = read_pool_info(storage, &asset_token_raw)?;
before_share_change(&pool_info, &mut reward_info, is_short)?;
Ok(RewardInfoResponseItem {
asset_token: api.human_address(&asset_token_raw)?,
bond_amo... | Rust | 0 |
("total_time_ms", total_time_ms, i64),
("slot", slot_meta.slot, i64),
("last_index", last_index, i64),
("num_repaired", entry.num_repaired, i64),
("num_recovered", entry.num_recovered, i64),
);
}
entry.flags |= SlotFlags::FULL... | Rust | 0 |
= " pool using the resourceFree method."]
#[doc = " @param pool data structure to be initialised."]
#[doc = " @param concurrency the number of resources the pool should contain."]
#[doc = " @param state passed to the create resource method."]
#[doc = " @param resourceCreate method used to create the re... | Rust | 0 |
terface implementation declaration
ImplDecl,
/// An identifier of a declaration, containing type parameters.
Ident,
/// A type parameter inside Ident, containing a Type and Identifier/name.
TypeParameter,
/// A modifier on a declaration.
Modifier,
/// A function signature.
Function... | Rust | 0 |
# 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.
import numpy as np
import torch
def accuracy(output, target, topk=(1,)):
"""Computes the accuracy over the k top pre... | Python | 1 |
pic = await get_msg_pic(msg)
await mix_elixir.finish(MessageSegment.image(pic))
else:
await mix_elixir.finish(msg, at_sender=True)
try:
user_ldl_flag[user_id]
except KeyError:
msg = f"道友背包内没有炼丹炉,无法炼丹!"
if XiuConfig().img:
msg = await pic_m... | Python | 1 |
all_tau(&[1], &[1])?, 0);
assert_eq!(kendall_tau(&[1], &[2])?, 0);
assert_eq!(kendall_tau(&[1, 2], &[1, 2])?, 0);
assert_eq!(kendall_tau(&[1, 2], &[2, 1])?, 1);
assert_eq!(kendall_tau(&[1, 2, 3, 4, 5], &[3, 4, 1, 2, 5])?, 4);
Ok(())
}
}
use crate::app::UpdateResult as UR;
use... | Rust | 0 |
{}
ref_totals = []
print(character_index_dict)
for character_key in character_index_dict.keys():
if character_key not in character_index_dict:
raise gr.Error("{} not have prompt description, please remove it".format(character_key))
index_list = character_index_dict[character_key]... | Python | 1 |
);
}
#[test]
fn variable() {
assert_eq!(
1,
Variable::new("id", Arc::new("1")).parse::<i32>().unwrap()
);
let result = Variable::new("id", Arc::new("x")).parse::<usize>();
assert!(result.is_err());
let status = result.unwrap_err();
... | Rust | 0 |
/safe-transmute-rs/issues/new).
use self::super::guard::{PermissiveGuard, PedanticGuard, Guard};
use self::super::base::transmute_many;
#[cfg(feature = "alloc")]
use self::super::base::transmute_vec;
use core::mem::transmute;
use self::super::Error;
#[cfg(feature = "alloc")]
use alloc::vec::Vec;
/// Makes sure that... | Rust | 0 |
# Note: this file does not work, it generates unknown symbol dice6_
# that we avoid with calling f2py directly.
#!/usr/bin/env python
def configuration(parent_package='',top_path=None):
from numpy.distutils.misc_util import Configuration
#config = Configuration('packagename',parent_package,top_path)
config... | Python | 1 |
alKey::KeyPrintScreen,
p::PuglKey_PUGL_KEY_PAUSE => SpecialKey::KeyPause,
_ => SpecialKey::None
}
}
}
bitflags! {
/// Keyboard modifiers
#[derive(Default)]
pub struct Modifiers: u32 {
const NONE = 0;
const SHIFT = 1;
const CTRL = 2;
cons... | Rust | 0 |
;
job.target = SimdFloat4::load(2.0 * 0.5, 0.0, 0.0, 0.0);
job.soften = 0.5;
assert_eq!(job.run(), true);
_expect_reached(&job, true);
}
// Reachable, softened
{
job.pole_vector = SimdFloat4::y_axis();
job.target = SimdFlo... | Rust | 0 |
49_Hole1_User1_Start3_dmp.npz'
demo_path = '/home/jheidersberger/catkin_ws/src/dmp_ros/data/' + 'teleop_recording_2024-02-08-14-02-49_Hole1_User1_Start3.npz'
d = DMP_ROS(dmp_path=dmp_path, data_path=demo_path)
n_segments = d.segment_durations.shape[0]
search_segment = 3 # manually selected
versi... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.