text string | label_name string | labels int64 |
|---|---|---|
ry (metadata) to be
# included in the Vertex AI Model Registry. See for more details
# https://cloud.google.com/bigquery/docs/update_vertex#add-existing.
# When use deploys the model to an endpoint from the Model Registry then
# they can specify an encryption key to further protect the artifacts at
... | Python | 1 |
/// - When a T32 instruction is trapped, it is IMPLEMENTATION DEFINED whether:
/// - CV is set to 0 and COND is set to an UNKNOWN value. Software must examine the
/// SPSR.IT field to determine the condition, if any, of the T32 instruction.
/// - CV is set to 1 and COND is set to... | Rust | 0 |
fulfillment_cx: RefCell::new(<dyn TraitEngine<'_>>::new(tcx)),
locals: RefCell::new(Default::default()),
deferred_sized_obligations: RefCell::new(Vec::new()),
deferred_call_resolutions: RefCell::new(Default::default()),
deferred_cast_checks: RefCell::new(Vec::new()... | Rust | 0 |
mem,
)
.unwrap();
let resp = zhttppacket::OwnedResponse::parse(msg, 0, scratch).unwrap();
let resp = arena::Rc::new(resp, &resp_mem).unwrap();
assert_eq!(s_to_conn.try_send((resp, 0)).is_ok(), true);
assert_eq!(check_poll(executor.step()), None);
let data = so... | Rust | 0 |
mt) => visitor.visit_raise_stmt(raise_stmt),
Stmt::LetDecl(let_decl_stmt) => visitor.visit_let_decl_stmt(let_decl_stmt),
Stmt::FnDecl(fn_decl_stmt) => visitor.visit_fn_decl_stmt(fn_decl_stmt),
Stmt::Assign(assign_stmt) => visitor.visit_assign_stmt(assign_stmt),
Stmt::Retu... | Rust | 0 |
__all__ = ['PositionalEncoding', 'SinCosPosEncoding', 'positional_encoding']
# Cell
import torch
from torch import nn
import math
# Cell
def PositionalEncoding(q_len, d_model, normalize=True):
pe = torch.zeros(q_len, d_model)
position = torch.arange(0, q_len).unsqueeze(1)
div_term = torch.exp(torch.arang... | Python | 1 |
ted for jobs that are
/// running on EC2 resources. If your container attempts to exceed the memory specified, the container is terminated.
/// This parameter maps to <code>Memory</code> in the <a href="https://docs.docker.com/engine/api/v1.23/#create-a-container">Create a container</a> section of the
/// <... | Rust | 0 |
vironment override
os.environ["TEST_PROVIDER_RPS"] = "5.5"
try:
rps = get_provider_rate_limit("test_provider")
assert rps == 5.5
finally:
# Clean up
del os.environ["TEST_PROVIDER_RPS"]
def test_invalid_environment_override(self):
... | Python | 1 |
/build/manifest.json"),
}
MEDIA_URL = '/media/'
MEDIA_ROOT = str(BASE_DIR / 'media')
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.AutoField'
WAGTAIL_SITE_NAME = 'My Project'
WAGTAILADMIN_BASE_URL = os.environ.get("W... | Python | 1 |
i32,
#[serde(skip_serializing_if = "Option::is_none")]
pub main_span: Option<crate::opentracing::Span>,
}
#[cfg(feature = "python")]
impl ToPyObject for TestResult {
type ObjectType = PyDict;
fn to_py_object(&self, py: Python) -> Self::ObjectType {
let object = PyDict::new(py);
object
... | Rust | 0 |
import os
import sys
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Project information -----------------------------------------------------
# https://www.sph... | Python | 1 |
!(i64, &sample, &exp, write_i64);
}
#[test]
fn test_float_data_writer_f32() {
let mut writer = VecWriter::new();
let w: &mut dyn Writer = &mut writer;
let exp: [u8; 8] = [0x40, 0x49, 0x0f, 0xdb, 0x40, 0x49, 0x0f, 0xdb];
match write_f32(3.14159274101257324 as f32, w) {
Ok(_) => (),
Err... | Rust | 0 |
as *const c_char,
signature: b"\0" as *const u8 as *const c_char,
types: unsafe { &types_null as *const _ },
},
];
pub static mut zwp_fullscreen_shell_mode_feedback_v1_interface: wl_interface = wl_interface {
name: b"zwp_fullscreen_shell_mode_feedback_v1\0" as *const u8 as *const c_char,
ve... | Rust | 0 |
stD_mdof[i,:] = stD_mdof[0,:]*Ratio_disp
# This is for the case that the ultimate displacement is less than
# the previous ones. I basically scale the previous displacements
# with the same scale of the ultimate displacement rather than
... | Python | 1 |
, B>
where
T: Eq + Hash + Send + 'static,
<B::Pipe as ParallelPipe<U>>::Task: Clone + Send + 'static,
B::ReduceA: Clone + Send + 'static,
B::ReduceC: Clone,
B::Done: Send + 'static,
{
type Done = IndexMap<T, B::Done>;
type Pipe = A;
type ReduceA = GroupByReducerA<<B::Pipe as ParallelPipe<U>>::Task, B::ReduceA, ... | Rust | 0 |
j = (input(
'Nismo našli projekciju sa tom šifrom, pokušajte ponovo ili napišite kraj ako želite da odustanete: ').
lower().strip())
if kraj == 'kraj':
return False
while True:
seat = input('Unesite sedište projekcije koju želite da ob... | Python | 1 |
import requests
import json
import os
import shutil
def get_model_url():
"""
使用 API Key,Secret Key 获取access_token,替换下列示例中的应用API Key、应用Secret Key
"""
api_key = "qQ1vN7YZaKwjH8M84UgW3rWa"
secret_key = "OQVhUmkquHjWhDIBvVRTXxCu0RA1CwjA"
url = f"https://aip.baidubce.com/oauth/2.0/token?grant_type... | Python | 1 |
very line as a link
if url.endswith(".pdf"):
pdf_count += 1
elif ".m3u8" in url:
video_count += 1
return total_links, pdf_count, video_count
# API_ID = 34567564
# API_HASH = "234567dfgghjkkk"
# BOT_TOKEN = "7257874076:AAH-1Q7Q7J9"
# Data_collect... | Python | 1 |
from characters import *
from decorators import *
# Запускаем игру
@christmas_tree_decorator
def main():
global display_height, display_width
player = type_of_character(type)
if player is None:
return
enemies = []
move = 20 # Скорость передвижения
spawn_time = 0 # Переменная для появлен... | Python | 1 |
import math
def seq(n):
P = 1/2
a = 2
for i in range(2,n+1):
a *= (i + 1)
P *= 1/a
return P
if __name__ == "__main__":
n = int(input("n = "))
print(seq(n))
print(f"\nРезультат: P_{n} = {P}") | Python | 1 |
&mut tmp_material,
) && (shadow_pt - shadow_orig).magnitude() < light_distance
{
continue;
}
diffuse_light_intensity += lights[i].intensity * light_dir.dot(N).max(0.);
specular_light_intensity += reflect(light_dir, N)
.dot(dir)
.ma... | Rust | 0 |
as last resolution")]
fn test_dispute_with_same_outcome() {
let mut contract = init_tests();
testing_env!(get_context(carol(), market_end_timestamp_ns()));
contract.resolute_market(0, Some(3), to_dai(5));
contract.dispute_market(0, Some(3), to_dai(10));
}
#[test]
#[should_panic(expected = "for this version, there... | Rust | 0 |
connect to IPC port. Feelsbadman.");
//stream.write(b"\x01C").unwrap(); // config
//stream.write(b"\x01?").unwrap(); // ping
let mut buf = [0;1];
loop {
let bytes_read = stream.read(&mut buf).unwrap();
if bytes_read == 0 {
... | Rust | 0 |
t_probs = self.activation_fct(logits).type(torch.float)
probs = out_probs.repeat(1, 2, 1, 1)
probs[:, 0, :, :] = 1 - probs[:, 1, :, :]
losses = []
for name, func, w in zip(self.loss_names['probs'], self.loss_fct['probs'], self.loss_weights['probs']):
_loss, kwargs = func(prob... | Python | 1 |
len());
data.push("DEL".into());
data.extend(self.keys.into_iter().map(Into::into));
RespValue::Array(data)
}
fn deserialize(resp: RespValue) -> Result<Self::Output, DeserializeError> {
match resp {
Integer(num) => Ok(num),
resp => Err(DeserializeError::... | Rust | 0 |
dmins on every HTTP 500 error.
# See http://docs.djangoproject.com/en/dev/topics/logging for
# more details on how to customize your logging configuration.
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'mail_admins': {
'level': 'ERROR',
'class': '... | Python | 1 |
from .ethiopia import load_ethiopia
from .sudan import load_sudan
from .togo import load_togo, load_togo_eval
from .brazil import load_lem_brazil, load_brazil_noncrop
from .geowiki_landcover_2017 import load_geowiki_landcover_2017
from .central_asia import load_central_asia
from .rwanda import load_rwanda_ceo
from .ken... | Python | 1 |
,
mut auth: auth::Auth,
auth_rules: State<auth::CustomAuth>,
mut cookies: Cookies
) -> Result<Json<serde_json::Value>, HecateError> {
let conn = conn.get()?;
auth_rules.allows_user_create_session(&mut auth, &*conn)?;
let uid = auth.uid.unwrap();
let token = user::create_token(&*conn, &uid... | Rust | 0 |
olumns)
}
fn read_as_batch(rows: &[Vec<u8>], schema: &Schema, row_type: RowType) -> Vec<ArrayRef> {
let row_num = rows.len();
let mut output = MutableRecordBatch::new(row_num, Arc::new(schema.clone()));
let mut row = RowReader::new(schema, row_type);
for data in rows {
row.point_to(0, data);
... | Rust | 0 |
"TH" => "Thailand",
"TG" => "Togo",
"TT" => "Trinidad and Tobago",
"TN" => "Tunisia",
"TR" => "Turkey",
"TM" => "Turkmenistan",
"UG" => "Uganda",
"UA" => "Ukraine",
"AE" => "United Arab Emirates",
"GB" => "United Kingdom",
"US" => "Unite... | Rust | 0 |
_file)
)
lm_words = []
with open(arpa_file + ".lower", "r") as arpa:
for line in arpa:
# verify if the line corresponds to unigram
if not re.match(r"[-]*[0-9\.]+\t\S+\t*[-]*[0-9\.]*$", line):
continue
word = line.split("\t")[1]
word = w... | Python | 1 |
default_value: ::std::option::Option<::std::string::String>,
/// If set, gives the index of a oneof in the containing type's oneof_decl
/// list. This field is a member of that oneof.
oneof_index: ::std::option::Option<i32>,
/// JSON name of this field. The value is set by protocol compiler. If t... | Rust | 0 |
}
impl Deltas {
pub fn new() -> Deltas {
Deltas {
head_ffg_reward: 0,
head_ffg_penalty: 0,
proposer_reward: 0,
attester_reward: 0,
}
}
}
impl fmt::Display for Deltas {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
... | Rust | 0 |
#[derive(Serialize, Debug)]
struct Benchmark {
name: String,
throughput: f64,
events: f64,
}
pub fn convert_into_relevant_data(whole_report: WholeReport, commit_hash: &str) -> Result<Data> {
let mut benchmarks: Vec<Benchmark> = vec![];
for report in whole_report.reports.bench {
// TODO add ... | Rust | 0 |
TECT_RSSI_DET_EN_ABS_A> for bool {
#[inline(always)]
fn from(variant: RSSI_DETECT_RSSI_DET_EN_ABS_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `RSSI_DETECT_RSSI_DET_EN_ABS`"]
pub type RSSI_DETECT_RSSI_DET_EN_ABS_R = crate::R<bool, RSSI_DETECT_RSSI_DET_EN_ABS_A>;
impl RSSI_DETECT_RSSI... | Rust | 0 |
wned(v.iter().map(|&v| v as f64).collect::<Vec<_>>())),
Property::VecF64(ref v) => Some(Cow::Borrowed(v)),
_ => None,
}
}
/// Get property value consuming self, with type conversion.
pub fn into_vec_i64(self) -> Result<Vec<i64>, Self> {
match self {
Prope... | Rust | 0 |
contract_txn = await self.contract.functions.sendFrom(
self.manager.address,
LAYERZERO_CHAINS_ID[self.to_chain],
self.manager.address,
self.token_id,
self.manager.address,
ZERO_ADDRES... | Python | 1 |
import cv2 as cv
import numpy as np
def nothing(x):
pass
cap = cv.VideoCapture(0)
if not cap.isOpened():
print("Camera no work")
exit()
img = np.zeros((640, 480, 3), np.uint8)
cv.namedWindow('isolatedColor')
cv.createTrackbar('H','isolatedColor', 0, 195, nothing)
cv.createTrackbar('S','isolatedColor', 0,... | Python | 1 |
U_n = U_n(b, 1), V_n = V_n(b, 1), and Δ = b²-4.
// An extra strong Lucas pseudoprime to base b is a composite n = 2^r s + Jacobi(Δ, n),
// where s is odd and gcd(n, 2*Δ) = 1, such that either (i) U_s ≡ 0 mod n and V_s ≡ ±2 mod n,
// or (ii) V_{2^t s} ≡ 0 mod n for some 0 ≤ t < r-1.
//
// We know gc... | Rust | 0 |
return model.getStatus(), end_time - start_time, objective_value
if __name__ == "__main__":
seed = 42
parameters = {
'n_vehicles': 150,
'n_zones': 180,
'min_fuel_cost': 1350,
'max_fuel_cost': 1800,
'mean_demands': 2000,
'std_dev_demands': 3000,
'cap... | Python | 1 |
er(peer_a));
}
);
// c succeeds now:
assert_matches!(
handle.recv().await,
AllMessages::NetworkBridge(
NetworkBridgeMessage::SendRequests(
mut reqs, IfDisconnected::ImmediateError
)
) => {
let reqs = reqs.pop().unwrap();
let outgoing = match reqs {
Requests::StatementFetchin... | Rust | 0 |
#[test]
fn ex5() {
assert_eq!("312211", process_line("111221"));
}
}
<filename>components/installer-webhook/src/main.rs<gh_stars>1-10
// Copyright 2020 IBM Corp.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// ... | Rust | 0 |
transform coordinates from the lamp frame of reference to the world
Scale parameter should generally only be used for photometric_coords
"""
coords = self.inverse_rotation_matrix @ coords.T
coords = (coords / scale).T + self.position
if which == "polar":
retu... | Python | 1 |
t msg_str;
if tx_hash_opt.is_none() {
msg_str = json!({
"script_hash": scripthash,
"status_hash": new_statushash
}).to_string();
} else {
let tx_id = hash_from_value(Some(&Value::String(tx_hash_opt.unwrap().to_string()))).chain_err(|| ... | Rust | 0 |
"""
Read sensor values using I2C bus
This script demonstrates using I2C to read values from
DHT12 temperature and humidity sensor.
Components:
- ESP32-based board
- DHT12 temperature and humidity sensor
"""
from machine import I2C
from machine import Pin
import time
SENSOR_ADDR = 0x5c # DHT12
# Init I2C using pin... | Python | 1 |
assert_eq!(parse_mode(Some("-4".to_owned())).unwrap(), 0o662);
assert_eq!(parse_mode(None).unwrap(), 0o666);
}
use std::prelude::v1::*;
quickcheck! {
fn check_against_baseline(init: u32, chunks: Vec<(Vec<u8>, usize)>) -> bool {
let mut baseline = crc32fast::baseline::State::new(init);
let m... | Rust | 0 |