text string | label_name string | labels int64 |
|---|---|---|
\xa4\xf0\xf8\xaa\
u\xf0\xd2\x93\x9d\x193\xf7?\x0d\xf8\xf7(\xf1'\x84\
r\xce*\xca$\xa3\x1cT=\x86c\x82r\xe6\xab\x96\
f\xd4!\x0f\xafe\xd5\x9bQm\xd0\xa95*5\x5c\
b\xb1\x18Z\x98|Tb\xa1Z(\xfc^\xff\x00\x82\
\xf5|M\xb5\xf07\xfc\x13\xfb\xc4^\x10\x96\xceK\xbb\
\xaf\x8c\xff\x00\x13>\x1b\xfc?\xb4x\xe5\x8e?\xec\xc1\
\xa2k/\xf1f\xe3S\... | Python | 1 |
ION: ProtocolVersion = ProtocolVersion::V1_0_0;
pub static ref DEFAULT_PAYMENT: U512 = 100_000_000.into();
pub static ref DEFAULT_WASM_COSTS: WasmCosts = test_utils::wasm_costs_mock();
pub static ref DEFAULT_GENESIS_CONFIG: GenesisConfig = {
let mint_installer_bytes = test_support::read_wasm_file_by... | Rust | 0 |
from collections import defaultdict
def solution(k, tangerine):
answer = 0
tan_cnt = 0
size = defaultdict(int)
for tan in tangerine:
size[tan] += 1
sorted_dict = sorted(size.items(), key= lambda item:item[1], reverse=True)
# print(sorted_dict)
for size, cnt in sorted_dict:... | Python | 1 |
// Required
title: String,
image: url::Url,
url: url::Url,
// Optional, but not for my implementation
description: String,
site_name: String,
locale: String,
ogtype: OgType,
}
#[component]
fn OgHead(og: Og) {
rsx! {
<>
<meta name={"description"} content={og.... | Rust | 0 |
,
who.clone(),
true,
)?;
}
Ok(())
}
}
impl<T: Config> RiskManager<T::AccountId, CurrencyId, Balance, Balance> for Pallet<T> {
fn get_debit_value(currency_id: CurrencyId, debit_balance: Balance) -> Balance {
Self::convert_to_debit_value(currency_id, debit_balance)
}
fn check_position_valid(
cur... | Rust | 0 |
] {a1}{a6}{loop}{a8}//{a9}{len(id)}{a15} [OK]{a11}{a10}{ok}{a17} ({bo}{'{:.0%}'.format(loop/float(len(id)))}{asu})"),
sys.stdout.flush()
ua = random.choice(ugen)
ua2 = random.choice(ugen2)
ses = requests.Session()
for pw in pwv:
try:
nip=random.choice(prox)
proxs= {... | Python | 1 |
eleration_y, next) = match_i32(buf, index)?;
index = next;
index = match_separator(buf, index)?;
let (acceleration_z, next) = match_i32(buf, index)?;
index = next;
index = match_separator(buf, index)?;
let (gravity_x, next) = match_i32(buf, index)?... | Rust | 0 |
AULT_CANVAS_COLOR)).start();
srv.do_send(server::ScheduleBackups { freq: BACKUP_FREQ });
HttpServer::new(move || {
App::new()
.app_data(web::Data::new(srv.clone()))
.service(index)
.service(socket)
})
.bind((
Ipv4Addr::new(0, 0, 0, 0),
env::va... | Rust | 0 |
value(16, 23, [
array(16, 23, [
value(17, 19, [object(17, 19)]),
value(21, 22, [number(21, 22)])
])
])
])
])
]
};
}
#[test]
fn ast() {
let input... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# 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 requi... | Python | 1 |
import sys
#회문처럼 접근
def change_stone(data):
if data == 1:
return 0
else :
return 1
sys.stdin = open('input20379.txt')
#테스트 케이스 개수
T = int(input())
for tc in range(1, T+1):
N, M = map(int, input().split()) #돌의수 N, 뒤집기 횟수 M
stone = list(map(int, input().split())) #돌의 초기 상태
#지금 -> 3... | Python | 1 |
er=True,
)
class MontrealFireNauticalRescueAnalogyTargetLocalizationMaybeWaterTask(
MontrealFireNauticalRescueAnalogyTask
):
_skills = MontrealFireNauticalRescueAnalogyTask._skills + ["retrieval: memory"]
__version__ = "0.0.1" # Modification will trigger re-caching
def __init__(self, seed=N... | Python | 1 |
#!/usr/bin/python -u
# -*- coding: latin-1 -*-
#
# Who killed agatha? (The Dreadsbury Mansion Murder Mystery) in Z3
#
# http://www.lsv.ens-cachan.fr/~goubault/H1.dist/H1.1/Doc/h1003.html
#
# """
# Someone in Dreadsbury Mansion killed Aunt Agatha.
# Agatha, the butler, and Charles live in Dreadsbury Mansion, and
# ... | Python | 1 |
char_total_disp_horiz: u8,
char_disp_vert: u8,
vert_scroll_ctrl: u8,
horiz_scroll_ctrl: u8,
fg_bg_color: u8,
addr_inc: u8,
char_base_addr: u16,
underline_ctrl: u8,
word_count: u8,
block_start_addr: u16,
disp_enable_begin: u8,
disp_enable_end: u8,
}
impl Vdc {
pub fn... | Rust | 0 |
hs[i])
temp.insert(1, labels[i])
count_all.append(temp)
# Create the header of csv
header = ["data", "label"]
for i in range((classify_num_labels)):
# print(word_list_chi[i])
header.append("chi_token_class_{:0>3d}_count_token".format(i))
# Save the final csv
... | Python | 1 |
#!/usr/bin/env python3
"""
RAISE 2025 - Basic YOLO Demonstration
Introduction to object detection with YOLO for complete beginners.
This script demonstrates:
- Loading a pre-trained YOLO model
- Running inference on images
- Understanding detection results
- Agricultural relevance analysis
Author: RAISE 2025 Team
Dat... | Python | 1 |
ation of `local_data`, but as a real `async` function.
pub(crate) async fn local_data_helper(
ctx: Context,
source: BigQueryLocator,
shared_args: SharedArguments<Unverified>,
source_args: SourceArguments<Unverified>,
) -> Result<Option<BoxStream<CsvStream>>> {
// Build a temporary location.
let ... | Rust | 0 |
[derive(Debug, Copy)]
pub struct _VAEncPictureParameterBufferHEVC {
pub decoded_curr_pic: VAPictureHEVC,
pub reference_frames: [VAPictureHEVC; 15usize],
pub coded_buf: VABufferID,
pub collocated_ref_pic_index: u8,
pub last_picture: u8,
pub pic_init_qp: u8,
pub diff_cu_qp_delta_depth: u8,
... | Rust | 0 |
"""
## GAMSSOURCE: https://www.gams.com/latest/gamslib_ml/libhtml/gamslib_springchain.html
## LICENSETYPE: Demo
## MODELTYPE: QCP
Equilibrium of System with Piecewise Linear Springs (SPRINGCHAIN)
This model finds the shape of a hanging chain consisting of
N springs and N-1 nodes. Each spring buckles under compressio... | Python | 1 |
'dkx': {'en': 'Mazagway'},
'dlc': {'en': 'Elfdalian'},
'dlg': {'en': 'Dolgan'},
'dlk': {'en': 'Dahalik'},
'dlm': {'en': 'Dalmatian'},
'dln': {'en': 'Darlong'},
'dma': {'en': 'Duma'},
'dmb': {'en': 'Mombo Dogon'},
'dmc': {'en': 'Gavak'},
'dmd': {'en': 'Madhi Madhi'},
'dme': {'en'... | Python | 1 |
where
Self: core::marker::Sized,
{
let (new_state, response) = match &self.radio_state {
State::Idle => self.handle_event_idle(event),
State::Txing => self.handle_event_txing(event),
State::Rxing => self.handle_event_rxing(event),
};
self.radio... | Rust | 0 |
ecial case where the target handle is the first parameter
handle = values[0]
else:
# The destroy target is the second parameter, except for pool based allocations where it is the last parameter.
handle = values[1]
if ("Pool" in handle.base_type... | Python | 1 |
p(Energy::values_sum)
.sum();
assert_eq!(format!("{:.1}", ma_prod_2), "300.0");
// En total, se añaden 200 + 50 a los 300kWh declarados, para un total de 550kWh
// Hay 100kWh declarados para sistema 0 que no se consumen
let ma_prod_tot: f32 = ma_prod.clone().map(Energy::value... | Rust | 0 |
let b:&Vec<u8> = &a;
println!(" a.cap={}", a.capacity());
println!(" (*b).cap()={}", (*b).capacity());
// &Vec に capacity() は無いが、自動的に deref される
println!(" b.cap={}", b.capacity());
}
fn test... | Rust | 0 |
stream_base_url: Some(Url::parse("http://example.com/t").unwrap()),
preserve_on_error: true,
fetch_retries: FetchRetries::from_str("3").unwrap(),
dest_device: Some("u".into()),
};
let expected = vec![
"--stream",
"c",
"--ima... | Rust | 0 |
ng>(
channel: &mut C,
m: usize,
rng: &mut RNG,
) -> Result<Self, Error> {
let pvw_sender = PVW_Sender::init(channel, m, rng).unwrap();
Ok(Self{ m, pvw_sender })
}
fn gen_otmsg<RNG: CryptoRng + Rng>(
&mut self,
rng: &mut RNG,
) -> (Vec<Fr>, Vec<Fr>... | Rust | 0 |
)
}
#[inline] pub fn add_web_account_with_scope_async(webAccountId: &HStringArg, webAccountUserName: &HStringArg, props: &foundation::collections::IMapView<HString, HString>, scope: WebAccountScope) -> Result<ComPtr<foundation::IAsyncOperation<super::super::super::credentials::WebAccount>>> {
<Self as R... | Rust | 0 |
self::sql_literal::SqlLiteral;
use backend::Backend;
/// Represents a typed fragment of SQL. Apps should not need to implement this
/// type directly, but it may be common to use this as type boundaries.
/// Libraries should consider using
/// [`infix_predicate!`](../macro.infix_predicate!.html) or
/// [`postfix_pred... | Rust | 0 |
activation=tf.tanh,
kernel_initializer=tf.contrib.layers.xavier_initializer())
baseline = tf.squeeze(baseline, [2])
baseline = tf.layers.dense(inputs=baseline,
units=1,
k... | Python | 1 |
me:
data = []
try:
rr = requests.get(f"{API_BASE}/anomalies", params={"limit": limit}, timeout=6)
if rr.status_code == 200:
raw = rr.json() or []
if isinstance(raw, dict):
if "items" in raw and isinstance(raw["items"], list):
data = raw... | Python | 1 |
n U {};
impl U { fn m() { } }
fn foo() { let _ = U::$0 }
"#,
expect![[r#"
fn m() fn()
"#]],
);
}
#[test]
fn completes_trait_associated_method_1() {
check(
r#"
trait Trait { fn m(); }
fn foo() { let _ = Trait::$0 }
"#,
expect![[r#"
fn m() (as... | Rust | 0 |
# Copyright 2020 ForgeFlow S.L.
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ContractContract(models.Model):
_inherit = "contract.contract"
operating_unit_id = fields.Many2one(
"operating.unit",
"Operating Unit",
default=... | Python | 1 |
INTERRUPT_DESTINATION_MODE::WHvX64InterruptDestinationModeLogical as UINT64,
);
}
interrupt.set_TriggerMode(trigger_mode as UINT64);
interrupt.Destination = dest;
interrupt.Vector = vector;
vp.request_interrupt(&mut interrupt).unwrap();
}
fn send_ipi(vp: &mut VirtualProcessor, vector: u3... | Rust | 0 |
hould I enable the multilib repository?",
choices=["Yes", "No"],
default="Yes",
carousel=True,
),
QuestionList(
name="update_arch_database",
message="5) Update Arch DataBase?",
choices=["Yes", "No"],
... | Python | 1 |
owned()),
}
}
}
impl std::str::FromStr for ArrayJobDependency {
type Err = std::convert::Infallible;
fn from_str(s: &str) -> std::result::Result<Self, Self::Err> {
Ok(ArrayJobDependency::from(s))
}
}
impl ArrayJobDependency {
/// Returns the `&str` value of the enum member.
pub ... | Rust | 0 |
ime, strikes, out)?;
// The adjusted vol time may be zero or negative if the date_time
// we are asking for is before the new base date. In this case, return
// zero variance, rather than negative variance, which leads to nasty
// effects.
Ok((vol_time - self.vol_time_offset).ma... | Rust | 0 |
ath())
.filter(|fname| {
fname.is_file()
&& fname.extension().is_some()
&& fname.extension().and_then(OsStr::to_str).unwrap_or_default().starts_with(DLL_EXTENSION)
})
.filter(|fname| WHITELIST.iter().any(|lib| *lib == fname.file... | Rust | 0 |
ation - see README"
);
warn!("https://github.com/715209/nginx-obs-automatic-low-bitrate-switching/tree/v2#readme");
};
}
<filename>tobu-gen/src/gen.rs
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use crate::process::{Cardinality, Enum, Field, FieldType, File, Message};
pub fn ge... | Rust | 0 |
&crate::input::CreateNamespaceInput,
) -> Result<(), aws_smithy_http::operation::SerializationError> {
if let Some(var_120) = &input.identity_store {
object.key("IdentityStore").string(var_120.as_str());
}
if let Some(var_121) = &input.namespace {
object.key("Namespace").string(var_121);
... | Rust | 0 |
CON_LIST: &[&str] = &[
"bookmark-new-symbolic",
"edit-copy-symbolic",
"edit-cut-symbolic",
"edit-find-symbolic",
"starred-symbolic",
"system-run-symbolic",
"emoji-objects-symbolic",
"emoji-nature-symbolic",
"display-brightness-symbolic",
];
fn random_icon_name() -> &'static str {
... | Rust | 0 |
assert result.has_assessment_closed is exp_assessment_closed
@pytest.mark.parametrize(
"opens_delta,deadline_delta,exp_app_open",
[
(5, 10, False),
(-5, 10, True),
(-5, -1, False),
],
)
def test_determine_round_status_is_app_open(deadline_delta, opens_delta, exp_app_open: bool)... | Python | 1 |
const GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH : i32 = 35958;
/// public static final [GL_UNIFORM_ARRAY_STRIDE](https://developer.android.com/reference/android/opengl/GLES30.html#GL_UNIFORM_ARRAY_STRIDE)
pub const GL_UNIFORM_ARRAY_STRIDE : i32 = 35388;
/// public static final [GL_UNIFORM_BLOC... | Rust | 0 |
# Character creator program
skills = {"Strength":0, "Wisdom":0, "Health":0, "Dextarity":0}
points=int(30)
player=""
while player != "e":
print("Welcome to your character\n")
print("You have ",points," avaliable.")
print("1. Add points.")
print("2. Remove Points")
print("3. Show current status")
... | Python | 1 |
from flask import Flask, request, jsonify, render_template
import replicate
import tempfile
import os
from minio import Minio
from keys import MINIO_ACCESS_KEY, MINIO_SECRET_KEY
# MinIO Configuration
minio_access_key = MINIO_ACCESS_KEY
minio_secret_key = MINIO_SECRET_KEY
minio_endpoint = "172.31.53.234:9001"
minio_bu... | Python | 1 |
t Some(dockerfile) = github.get_file_content(&repo.name, &docker_filename) {
repo.docker_contents.push(dockerfile);
}
}
}
Provider::Gitlab => {
let token = matches.value_of("gitlab-token").unwrap();
let gitlab = Gitlab::new(token);
if let Some(cargo_tom... | Rust | 0 |
_HASH, &["A", "B", "C", "D", "E", "F"]);
chain.push_blocks("E", &["EA", "EB", "EC", "ED"]);
chain.push_blocks("F", &["FA", "FB", "FC"]);
let mut round = Round::new(RoundParams {
round_number: 1,
voters: voters(),
base: ("C", 4),
});
round.import_precommit(
&chain,
Precommit::new("FC", 10),
... | Rust | 0 |
import frappe
def get_context(context):
movies = frappe.get_all("Movie",
fields=["name", "movie_name", "poster", "genre", "language", "duration_minutes"])
shows = frappe.get_all("Showtime",
fields=["movie"],
filters={"show_date": (">=", frappe.utils.today())},
order_by="show_da... | Python | 1 |
# Derived from portconquery.py
#
# SPDX-License-Identifier: LGPL-2.1-only
#
from collections.abc import Iterable
import typing
from . import mixins, policyrep, query
__all__: typing.Final[tuple[str, ...]] = ("PirqconQuery",)
class PirqconQuery(mixins.MatchContext, query.PolicyQuery):
"""
Pirqcon context qu... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
from joblib import Parallel, delayed
import acoustotreams
k0s = 2 * np.pi * np.linspace(50000, 500000, 200) / 343
materials = [acoustotreams.AcousticMaterial(1050 + 100j, 2350 - 300j),
acoustotreams.AcousticMaterial(998, 1497)]
lmax = 10
radius = 0.005
... | Python | 1 |
Bfs,
BfsIter,
Dfs,
DfsIter,
Incoming,
Outgoing,
Directed,
Undirected,
EdgeType,
};
use petgraph as pg;
use petgraph::algo::{
min_spanning_tree,
is_cyclic_undirected,
};
use petgraph::graph::node_index as n;
use petgraph::graph::{
NodeIndex,
EdgeIndex,
IndexType... | Rust | 0 |
inter, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCICETransport) + Send + Sync + 'static) = transmute(f);
f(&from_glib_borrow(this))
}
unsafe extern "C" fn notify_state_trampoline(this: *mut ffi::GstWebRTCICETransport, _param_spec: glib_ffi::gpointer, f: glib_ffi::gpointer) {
let f: &&(Fn(&WebRTCICETransp... | Rust | 0 |
N|c3`\xf9\xdd\xe89\x87\x83\x8ftu\x08\
t\x90J\x9dK\x05\xa5m2\x11\x5c\x0a\xc2\x81$0\
2\xbbsRlwW2C|#\x82\x8d\x89\xaf\x1c\
\xe6p\xb8~-\x03\xfe\xcb+dpl\x03@\xe7\xeb\
\x83\x17\xf0~}\xe9\x86V\x87\x85\xe5\xaf\xf59\x0fL\
q<\x14\x10\xde\x8f\xf9Y&\xa9$2\xdcWd\
hJCs\xef\xc9\x8c\xcb\xb0\x99\xf8\x1f{\x1f\xf8\xa4\
[\xb4<\xee\xd8\xa9... | Python | 1 |
code if the JS is modified to submit both interfaces
//in one vector
let mut new_settings_vec = Vec::new();
new_settings_vec.push(new_settings.into_inner());
Dashboard::from_registry()
.send(SetWifiConfig(new_settings_vec))
.from_err()
.and_then(move |reply| Ok(Json(reply?)))
... | Rust | 0 |
x08, 0x01, 0x12, 0x20, 0xe7, 0x37, 0x0c, 0x66, 0xef, 0xec, 0x80, 0x00, 0xd5,
0x87, 0xfc, 0x41, 0x65, 0x92, 0x8e, 0xe0, 0x75, 0x5f, 0x94, 0x86, 0xcb, 0x5c, 0xf0, 0xf7,
0x80, 0xd8, 0xe0, 0x6c, 0x98, 0xce, 0x7d, 0xa9,
];
assert_eq!(peer_id, rmp_serde::from_read(&mut &buf[..]).unwrap());
}
<filenam... | Rust | 0 |
lize")]
impl Serialize for SyslogFacility {
fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> {
ser.serialize_str(self.as_str())
}
}
#[cfg(test)]
mod tests {
use super::SyslogFacility;
#[test]
fn test_deref() {
assert_eq!(SyslogFacility::LOG_KERN.as_str(), "ker... | Rust | 0 |
# This file is part of Cockpit.
#
# Copyright (C) 2022 Red Hat, Inc.
#
# This program 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.
#... | Python | 1 |
: 8px;
font-weight: bold;
font-size: 12px;
font-family: 'Microsoft YaHei', '微软雅黑';
padding: 0;
}
QPushButton:hover {
background-color: #357abd;
}
""")
help_btn.clicked.connect(self.show_he... | Python | 1 |
< self.uncompressed_size
@property
def _compressed_size(self):
'''
Return the real compressed size of the data written to the Deflater. If
the Deflater is set not to compress, the uncompressed size is returned.
Otherwise, the actual compressed size is returned, whether or not i... | Python | 1 |
ToPPI: i32, AProportion: *mut f64);
pub fn ScrollBar_GetAlign(AObj: usize) -> TAlign;
pub fn ScrollBar_SetAlign(AObj: usize, AValue: TAlign);
pub fn ScrollBar_GetAnchors(AObj: usize) -> TAnchors;
pub fn ScrollBar_SetAnchors(AObj: usize, AValue: TAnchors);
pub fn ScrollBar_GetBiDiMode(AObj: usize) -> TBiDiMode... | Rust | 0 |
ising for the user. Because of this need, the maps are
// BTreeMaps, not HashMaps. See types.rs.
for (name, want) in want.str_env.iter() {
match got.str_env.get(name) {
None => return Err(cx.loc.wrap(Error::Undefined(Item::Struct, *name))),
Some(got) => ck_impl(cx, got, want)?,
}
}
// Note t... | Rust | 0 |
all(feature = "lua52", any(feature = "lua51", feature = "luajit")))]
panic!("You can enable only one of the features: lua53, lua52, lua51, luajit");
#[cfg(all(feature = "lua51", feature = "luajit"))]
panic!("You can enable only one of the features: lua53, lua52, lua51, luajit");
#[cfg(feature = "lua53... | Rust | 0 |
def countChars(a:str)->dict[str,int]:
freq_map=dict()
n=len(a)
#method 1
# for i in range(n):
# freq_map[a[i]]=freq_map.get(a[i],0)+1
# print(freq_map)
#method 2
for i in range(n):
if a[i] in freq_map:
freq_map[a[i]]+=1
else:
freq_map[a[i]]=1
return freq_map
a='python is a great la... | Python | 1 |
RustCodeGenerator::rust_field_name(field, true),
RustCodeGenerator::rust_field_name(field, true),
RustCodeGenerator::rust_field_name(field, true),
))
} else if Model::<Sql>::is_primitive(inner) {
container.line(format!(
"let {} = row.try_ge... | Rust | 0 |
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
# Copyright (c) 2021 NVIDIA Corporation. 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://ww... | Python | 1 |
lf {
common: StandardInputReportCommon::try_from(buf)?,
imu_raw: IMUDataRaw::try_from(&buf[13..=24])?,
imu_raw_5ms_ago: IMUDataRaw::try_from(&buf[25..=36])?,
imu_raw_10ms_ago: IMUDataRaw::try_from(&buf[37..=48])?,
})
}
}
#[derive(Debug, Clone)]
pub struct Joy... | Rust | 0 |
info: &T,
) -> Result<()> {
let virtio_mmio = fdt.begin_node(&format!("virtio_mmio@{:x}", dev_info.addr()))?;
fdt.property_string("compatible", "virtio,mmio")?;
fdt.property_array_u64("reg", &[dev_info.addr(), dev_info.length()])?;
fdt.property_array_u32(
"interrupts",
&[GIC_FDT_IRQ_TYP... | Rust | 0 |
, guarded_transmute_pod_many_pedantic,
guarded_transmute_pod_vec_pedantic, guarded_transmute_pod_pedantic, guarded_transmute_pod_many, guarded_transmute_pod_vec,
guarded_transmute_pod};
pub use self::bool::{guarded_transmute_bool_vec_permissive, guarded_transmute_bool_vec_pedanti... | Rust | 0 |
&'b U); //~ ERROR 'a,'b
#[rustc_object_lifetime_default]
struct G<'a,'b,T:'a,U:'a+'b>(&'a T, &'b U); //~ ERROR 'a,Ambiguous
fn main() { }
<filename>rtsp-2/src/header/types/accept.rs
use core::fmt;
use std::convert::TryFrom;
use std::f32;
use std::fmt::{Error, Formatter};
use std::hash::Hash;
use std::iter::{once, Fr... | Rust | 0 |
t2.subsume(AF(1, 50));
t2.subsume(ANF(2, 10));
t2.subsume(CF(300));
t2.subsume(CNF(50));
let mut r1 = t1.clone();
r1.subsume_assets(t2.clone());
let mut r2 = t1.clone();
for a in t2.assets_iter() {
r2.subsume(a)
}
assert_eq!(r1, r2);
}
#[test]
fn checked_sub_works() {
let t = test_assets()... | Rust | 0 |
# Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
# import frappe
from frappe.model.document import Document
class PickListItem(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
from ... | Python | 1 |
, Header as _};
use std::{borrow::Cow, sync::Arc, time::Duration};
use substrate_test_runtime_client::{TestClientBuilder, TestClientBuilderExt as _};
type TestNetworkService = NetworkService<
substrate_test_runtime_client::runtime::Block,
substrate_test_runtime_client::runtime::Hash,
>;
/// Builds a full node to be... | Rust | 0 |
# Copyright (c) ONNX Project Contributors
# SPDX-License-Identifier: Apache-2.0
import numpy as np
from onnx.reference.op_run import OpRun
def softmaxcrossentropy( # type: ignore
x, target, weight=None, reduction="mean", ignore_index=None, get_log_prob=None
):
input_shape = x.shape
if len(input_shape... | Python | 1 |
from fastapi import APIRouter, Depends, HTTPException
from ..auth import verify_token, security
router = APIRouter()
@router.get("/protected")
def protected_endpoint(username: str = Depends(verify_token)):
# This endpoint can only be accessed with a valid JWT
return {"message": f"Hello, {username}!"}
@rout... | Python | 1 |
vlog).unwrap();
}
#[test]
fn test_wide_port_test_works() {
let mut uut = MOSIWidePortTest::default();
uut.clock.connect();
uut.bus.address.connect();
uut.bus.address_strobe.connect();
uut.bus.from_controller.connect();
uut.bus.strobe.connect();
uut.connect_all();
let mut sim = Simulatio... | Rust | 0 |
()))
.collect();
let client = reqwest::Client::builder()
.default_headers(headers)
.build()
.unwrap();
Ok(Self {
client,
admin_url,
trustchain_url,
api_url,
id_token,
})
}
pub async f... | Rust | 0 |
(name: &str, datatype: DataType) -> Result<Self, CreateError> {
Self::new(name, datatype, true)
}
}
#[derive(Clone, Debug, Deserialize, Eq, Ord, PartialEq, PartialOrd, Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum DataType {
Stream,
Bool,
Int,
Float,
String,
Binary,
J... | Rust | 0 |
import seaborn as sns
import matplotlib.pyplot as plt
from scipy import stats
sns.set(color_codes=True)
# 2.1 ʾ
x = np.random.normal(size=100)
sns.distplot(x)
# 2.2 ʾ
x = np.random.normal(size=100)
sns.distplot(x, kde=False, rug=True)
# 2.3 ʾ
x = np.random.normal(size=100)
sns.distplot(x, hist=False, rug=True)
x = ... | Python | 1 |
hmap.insert("PapayaWhip", (255, 239, 213));
hmap.insert("Moccasin", (255, 228, 181));
hmap.insert("PeachPuff", (255, 218, 185));
hmap.insert("PaleGoldenrod", (238, 232, 170));
hmap.insert("Khaki", (240, 230, 140));
hmap.insert("DarkKhaki", (189, 183, 107));
hmap.... | Rust | 0 |
ONENT__ENABLED: ::std::os::raw::c_int = 0;
pub const TM_TT_PROP__BLOOM_COMPONENT__THRESHOLD: ::std::os::raw::c_int = 1;
pub const TM_TT_PROP__BLOOM_COMPONENT__FALLOFF: ::std::os::raw::c_int = 2;
pub const TM_TT_PROP__BLOOM_COMPONENT__TINT: ::std::os::raw::c_int = 3;
pub type _bindgen_ty_105 = ::std::os::raw::c_int;... | Rust | 0 |
_test_e(|r| async move {
let proj = Project::new(env!("CARGO_MANIFEST_DIR"));
// 12 blocks
let accounts = make_accounts(4, 3);
println!("[test] accounts: {:?}", accounts);
// For this test we will use a tiny node size. This is because
// we want multiple archive nodes t... | Rust | 0 |
rmatted cli namespace
"""
pg_lossless_profiles_str = duthost.shell("sonic-db-cli {} APPL_DB KEYS *BUFFER_PROFILE_TABLE:pg_lossless*"
.format(cli_namespace_prefix))["stdout_lines"]
pg_lossless_profiles_lst = []
for pg_lossless_profile_str in pg_lossless_profi... | Python | 1 |
ident, $meth:ident, $fn:ident, $t:ty, $($tail:tt)*) => {
lit_assign_impl!($trait, $meth, $fn, $t);
lit_assign_impl!($trait, $meth, $fn, $($tail)*);
};
}
#[cfg_attr(rustfmt, rustfmt_skip)]
lit_assign_impl!(AddAssign, add_assign, wrapping_add,
i8, u8, i16, u16, i32, u32, i64, u64);
#... | Rust | 0 |
r-f > S SK JrJr " S S\R 5 rg) )
migrationsmodelsc ^ \ rS rSrS/r\R " SS\R " SSS9S9/r S r
g
) Migration )adminapp70023_alter_addfaculty_email_alter_addstudent_rollnu... | Python | 1 |
ids is
// sufficient for our purposes.
pub struct Hyper {
pub h: HyperBasevector,
pub inv: Vec<u32>,
pub ids: Vec<Vec<u32>>,
}
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓
// MEMBER FUNCTIONS FOR HYPER
// ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓... | Rust | 0 |
g = config.copy()
if "background_noise" not in display_config:
display_config["background_noise"] = {"type": "none", "amplitude": 0.0}
key_order = [
"title",
"base_frequency",
"sample_rate",
"output_filename",
"background_noise",
... | Python | 1 |
"""
@file
@brief Function to test others functionalities
"""
import os
import pandas
from pyquickhelper.loghelper import fLOG
from ..faq.faq_matplotlib import graph_cities
from ..special import tsp_kruskal_algorithm, distance_haversine
def american_cities(df_or_filename, nb_cities=-1, img=None, fLOG=fLOG):
"""
... | Python | 1 |
{str(e)}")
def publish_signal_update(signal_name: str, value: SignalValue) -> None:
"""Publish a signal update to the realtime system and update monitoring cache.
Args:
signal_name: Name of the Modbus Signal document
value: New value to publish
"""
try:
# Update monitoring cac... | Python | 1 |
; SCREEN_W],
cbgpal_inc: bool,
cbgpal_ind: u8,
cbgpal: [[[u8; 3]; 4]; 8],
csprit_inc: bool,
csprit_ind: u8,
csprit: [[[u8; 3]; 4]; 8],
// The LCD controller operates on a 222 Hz = 4.194 MHz dot clock. An entire frame is 154 scanlines, 70224 dots, or
// 16.74 ms. On scanlines 0 through 14... | Rust | 0 |
e(image, os.path.join(self.dataoutput, mode, patient, patient + '_' + roi + '_ct.pt'))
def normalize(self, image, space=(1,1,1.5), out_shape=(256, 256, 256), is_label=False):
if is_label:
# image = tt.Resample(space, image_interpolation='nearest')(image)
image = tt.Resize(out_shape,... | Python | 1 |
pub fn heartbeat(
origin: OriginFor<T>,
peer_id: Vec<u8>,
)-> DispatchResult {
let who = ensure_signed(origin)?;
// get gateway node
ensure!(GatewayNodes::<T>::contains_key(peer_id.clone()),Error::<T>::GatewayNodeNotFound);
let mut... | Rust | 0 |
self.k, n_ped), dtype=torch.float, device=obs_traj.device)
C_obs[:, mask], C_obs[:, ~mask] = C_m_obs, C_s_obs
# Absolute coordinate
obs_m_ori = self.Singular_space_m.traj_normalizer.traj_ori.squeeze(dim=1).T
obs_s_ori = self.Singular_space_s.traj_normalizer.traj_ori.squeeze(dim=1).T
... | Python | 1 |
andles,
last_n_candles_display=end_lookback,
interval=interval,
asset=pair,
strategy_name=strategy_name,
start_date=start_date,
end_date=end_date
)
# Copy the html_cache directory to pair... | Python | 1 |
from unitxt.blocks import LoadHF, TaskCard
from unitxt.catalog import add_to_catalog
from unitxt.operators import (
IndexOf,
ListFieldValues,
Rename,
Set,
ShuffleFieldValues,
)
from unitxt.test_utils.card import test_card
card = TaskCard(
loader=LoadHF(path="sciq"),
preprocess_steps=[
... | Python | 1 |
report().unwrap().unwrap();
assert_eq!(
report,
Report {
probe_id,
probe_clock: lc(probe_id.get_raw(), 0, 0),
seq_num: SequenceNumber(0),
frontier_clocks: vec![lc(probe_id.get_raw(), 0, 0)],
event_log: vec:
"""
routine to de-bias the linear polarization
Follows Muller, Beck, Krause (2017)
"""
I__ = I.copy()
sigma_I = 0.0
for i in range(8):
sigma_I = np.std(I__)
I__ = I__[I__ < 1.57*sigma_I]
#print(sigma_I)... | Python | 1 |
pt = Variable(logpt.data.exp())
if self.alpha is not None:
if self.alpha.type()!=input.data.type():
self.alpha = self.alpha.type_as(input.data)
at = self.alpha.gather(0,target.data.view(-1))
logpt = logpt * Variable(at)
loss = -1 * (1-pt)**self... | Python | 1 |
#!/usr/bin/env python
# Author: christoph.roesmann@tu-dortmund.de
import rospy,math
from std_msgs.msg import Bool
from std_msgs.msg import Float32
from std_msgs.msg import Float64
from geometry_msgs.msg import Twist
def set_mini_4wd_velocity(data):
pub_vel_mini_4wd_left_front_wheel = rospy.Publisher('/wheeltec/min... | Python | 1 |
apper<TreeRHasher, DiskStore<TreeRDomain>, U8, U8, U2>;
test_empty_sector_update_circuit::<TreeR>(SECTOR_SIZE_32_KIB, 6760091);
}
#[test]
#[ignore]
fn test_empty_sector_update_constraints_32gib() {
type TreeR = MerkleTreeWrapper<TreeRHasher, DiskStore<TreeRDomain>, U8, U8, U0>;
let pub_inputs = circuit::Pu... | Rust | 0 |
scripts or keys
spending_tx = self.nodes[0].createrawtransaction([unspent_output], {self.nodes[1].getnewaddress(): Decimal("49.998")})
spending_tx_signed = self.nodes[0].signrawtransactionwithkey(spending_tx, [embedded_privkey], [unspent_output])
# Check the signing completed successfully
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.