text string | label_name string | labels int64 |
|---|---|---|
buffer)?;
let mut credentials: Credentials = serde_json::from_slice(buffer.as_slice())?;
credentials.compute_secret()?;
credentials.download_google_jwks()?;
Ok(credentials)
}
/// Find the secret in the jwt set that matches the given key id, if any.
/// Used for jws validati... | Rust | 0 |
# This file is part of Hypothesis, which may be found at
# https://github.com/HypothesisWorks/hypothesis/
#
# Copyright the Hypothesis Authors.
# Individual contributors are listed in AUTHORS.rst and the git log.
#
# This Source Code Form is subject to the terms of the Mozilla Public License,
# v. 2.0. If a copy of the... | Python | 1 |
\x97\x13\xecU\x821\xfe\xadx\x08r3\xd3\xd2\xa7\
\xd0|9\xf1/\xc3\x9a\xa5\xe2\xdf\xcb\xe1\xcb\xad\x0d\x97\
\xf7mg\xbd.\xa2<`\xe0\xf1\xcfz\xcbX\xc7W\
r\xfd\x8c^\xb7=.]-e\x97v\xd5f_\xe2\
\xff\x00\xeb\xd6\xa7\xd8.<\xaf\xf4\x8d\xbeW\xde\xf9\xd8\
/os\xe9^G\xaa|*\xf1\xbf\x88\xe5]GA\
\xf1\x04V\xf1n\xdb5\xbe\xa2\xa5\xf6\xfa\x94+\... | Python | 1 |
RangeInRange::Begin(haystack.start - needle.start)
} else {
RangeInRange::Contain(haystack.start - needle.start)
}
} else if needle.start >= haystack.end {
RangeInRange::After(needle.start - haystack.end)
} else if needle.end > haystack.end {
RangeInRange:... | Rust | 0 |
0, 3000, 4000],
None,
));
let batch = RecordBatch::try_from_iter_with_nullable(vec![
("state", tag_array, true),
("int_field", int_array, true),
("float_field", float_array, true),
("time", timestamp_array, false),
])
.expect("... | Rust | 0 |
essage = 'The recorded data/log/garage.csv is ' \
'invalid.<br/>Please fix, or simply try ' \
'recording again by clicking "New".'
elif tool_status.playing_status == ToolStatus.PLAYING_CHECKING:
if tool_status.planning_ready:
... | Python | 1 |
# -*- coding:utf-8 -*-
from typing import List
from sqlalchemy.ext.asyncio import AsyncSession
from utils.common_util import CamelCaseUtil, export_list2excel
from utils.page_util import PageResponseModel
from module_admin.dao.sys_form_dao import SysFormDao
from module_admin.entity.do.sys_form_do import SysForm
from mo... | Python | 1 |
ap"
newdocid_qrels_fn = "/tmp/new.docid.qrels"
qrel_url = "https://ir.nist.gov/covidSubmit/data/qrels-covid_d3_j0.5-3.txt"
docid_map_url = "https://ir.nist.gov/covidSubmit/data/changedIds-May19.csv"
download_file(docid_map_url, docid_map_tmp)
download_file(qrel_url, newdocid_qrels_fn)
with open... | Python | 1 |
tchedGroupNode,
"LatentKeyframeTiming": LatentKeyframeInterpolationNode,
# Conditioning
"ACN_AdvancedControlNetApply": AdvancedControlNetApply,
# Loaders
"ControlNetLoaderAdvanced": ControlNetLoaderAdvanced,
"DiffControlNetLoaderAdvanced": DiffControlNetLoaderAdvanced,
# Weights
"ScaledS... | Python | 1 |
&id,
context.metadata,
context.description,
);
for image in images {
let image_id = Id::new(
format!(
"{}{}{}",
item_id.value, &self.config.urls.path_sep, image.name
)
... | Rust | 0 |
deo_duration), '-y', output_path ])
return run_ffmpeg(commands).returncode == 0
def replace_audio(target_path : str, audio_path : str, output_path : str) -> bool:
output_audio_encoder = state_manager.get_item('output_audio_encoder')
temp_file_path = get_temp_file_path(target_path)
temp_video_duration = detect_vid... | Python | 1 |
return (
f"ChimeraX :: InitAfter :: {self.type_} :: {separator.join(self.bundles)}"
)
def quote_if_necessary(s, additional_special_map={}):
"""quote a string
So :py:class:`StringArg` treats it like a single value"""
_internal_single_quote = re.compile(r"'\s")
_internal_double_quot... | Python | 1 |
.await;
}
#[actix_rt::test]
async fn show_other_user_ticket_org_admin() {
base::tickets::show_other_user_ticket(Roles::OrgAdmin, true).await;
}
#[actix_rt::test]
async fn show_other_user_ticket_box_office() {
base::tickets::show_other_user_ticket(Roles::OrgBoxOffice, true).await;... | Rust | 0 |
allback_t,
) -> ::std::os::raw::c_int,
}
<reponame>CAD97/compact_str
//! Macros used to statically assert the size different components (e.g. structs).
//!
//! These macros were directly copied from the [`static-assertions`](https://github.com/nvzqz/static-assertions-rs)
//! crate with the following license:
//!
//... | Rust | 0 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.construct import init
class OrgRole(object):
_types = {
"api_name": str,
"security_group_id": str,
"employment_ids": List[str],
"inherit_employment_id... | Python | 1 |
a = input()
b = input()
a = int(a)
b = int(b)
add = a + b
sub = a - b
mul = a * b
print(add)
print(sub)
print(mul)
| Python | 1 |
self.tree.grid(column=0, row=0, sticky='nsew', in_=container)
vsb.grid(column=1, row=0, sticky='ns', in_=container)
hsb.grid(column=0, row=1, sticky='ew', in_=container)
container.grid_columnconfigure(0, weight=1)
container.grid_rowconfigure(0, weight=1)
#self.tree.bi... | Python | 1 |
::new(1), Relaxed).unwrap().retire();
string.swap(Owned::new(String::from("string")), Relaxed).unwrap().retire();
arr.swap(Owned::new([0usize; 16]), Relaxed).unwrap().retire();
}
});
}
#[bench]
fn parallel_retire(b: &mut Bencher) {
const THREADS: u32 = 8;
const STEPS: u32 = ... | Rust | 0 |
/// Ignore deserialization errors and revert to default.
pub fn ignore_errors<'d, T: Deserialize<'d> + Default, D: Deserializer<'d>>(d: D) -> Result<T, D::Error> {
Ok(T::deserialize(d).ok().unwrap_or_default())
}
/// Deserialize a maybe-string ID into a u64.
pub fn deserialize_id<'d, D: Deserializer<'d>>(d: D) -> Res... | Rust | 0 |
self.bits >> OFFSET) & MASK as u32) as u8
})
}
#[doc = "Bits 8:9 - Set/clear operation on output 4. Value 0x3 is reserved. Do not program this value."]
#[inline]
pub fn setclr4(&self) -> SETCLR4R {
SETCLR4R::_from({
const MASK: u8 = 3;
const OFFSET: u8 = 8;
... | Rust | 0 |
s: Vec<Vec<PublicKey>> = vec![];
let mut skss: Vec<Vec<SigningKey>> = vec![];
let mut total: Vec<PublicKey> = vec![];
for _ in 0..num_extend {
let sks: Vec<SigningKey> = (0..num_keys).map(|_| SigningKey::new()).collect();
let pks: Vec<PublicKey> = sks.iter().map(|sk| sk.pk()).collect();
... | Rust | 0 |
from matterflow import Workflow, WorkflowException
from django.http import JsonResponse
class WorkflowMiddleware:
""" Custom middleware
https://docs.djangoproject.com/en/3.0/topics/http/middleware/
"""
def __init__(self, get_response):
self.get_response = get_response
# One-time conf... | Python | 1 |
ct_bbox.
"""
transform = TT.Compose([
T.Resize(target_scale, target_max_size),
TT.RandomHorizontalFlip(1.0),
TT.ToTensor(),
T.Normalize(
mean=cfg.INPUT.PIXEL_MEAN, std=cfg.INPUT.PIXEL_STD, to_bgr255=cfg.INPUT.TO_BGR255
)
])
images = [transform(image) f... | Python | 1 |
nce_table.into_raw()); }
unsafe { qlist.append_unsafe(&reference_field.into_raw()); }
unsafe { qlist.append_unsafe(&decoded_data.into_raw()); }
unsafe { qlist.append_unsafe(&field_description.into_raw()); }
// Just append a new row.
unsafe { stuff.table_model... | Rust | 0 |
import re
class JsonResponseHandler:
@staticmethod
def sanitize_response(response_str: str) -> str:
response_str = re.sub(r'^```json\s*', '', response_str, flags=re.MULTILINE)
response_str = re.sub(r'```$', '', response_str, flags=re.MULTILINE)
response_str = re.sub(
... | Python | 1 |
Win32_Foundation'*"]
#[cfg(feature = "Win32_Foundation")]
pub struct DELTA_HEADER_INFO {
pub FileTypeSet: i64,
pub FileType: i64,
pub Flags: i64,
pub TargetSize: usize,
pub TargetFileTime: super::super::Foundation::FILETIME,
pub TargetHashAlgId: u32,
pub TargetHash: DELTA_HASH,
}
#[cfg(featu... | Rust | 0 |
config {
Ok(config) => return Some(config),
Err(_) => return None,
}
}
pub fn write_config(config: Config) {
let op_config = yamls::to_vec(&config);
match op_config {
Ok(_) => (),
Err(why) => panic!("couldn't encode config: {}", why),
}
let xdg_dirs = xdg::BaseDire... | Rust | 0 |
import tkinter as tk
def click(event):
global operator
operator += str(event)
text_input.set(operator)
def clear():
global operator
operator = ""
text_input.set("")
def evaluate():
global operator
try:
total = str(eval(operator))
text_input.set(total)
operator ... | Python | 1 |
len;
/// ```
/// [`ErrorKind`]: crate::ErrorKind
pub fn values_of_t<R>(&self, name: &str) -> Result<Vec<R>, Error>
where
R: FromStr,
<R as FromStr>::Err: Display,
{
let v = self
.values_of(name)
.ok_or_else(|| Error::argument_not_found_auto(name.to_str... | Rust | 0 |
'''
This file is part of PM4Py (More Info: https://pm4py.fit.fraunhofer.de).
PM4Py 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 late... | Python | 1 |
on_mask"
if mask_key not in model_kwargs:
return model_kwargs
mask = model_kwargs[mask_key]
mask_length_diff = new_length - mask.shape[1]
if mask_length_diff < 0:
model_kwargs[mask_key] = mask[:, :mask_length_diff]
elif mask_length_diff > 0:
model_kwargs[mask_key] = torch.c... | Python | 1 |
, H, I, J);
// impl_build_storage!(A, B, C, D, E, F, G, H, I, J, k);
impl<S> EmptyStorage<S>
where
S: Storage + RegisterComponent,
{
pub fn register_component<C: Component>(&mut self) {
self.storage.register_component::<C>();
}
pub fn access(self) -> S {
self.storage
}
}
pub trait ... | Rust | 0 |
newtype_test!(Struct = Struct { field1: 42, field2: 42.0 });
}
/// Тестирует запись структуры с более чем одним полем - в структурах должны быть байтовые
/// смещения на списке полей, а не индексы (хотя размер элементов известен и индексы были бы
/// логичнее)
#[test]
fn test_struct() {
... | Rust | 0 |
0x09, 0x2b, 0x06, 0x01, 0x02, 0x01, 0x04, 0x16, 0x01, 0x04, // NULL
0x05, 0x00,
]
);
}
}
<gh_stars>10-100
use std::future::Future;
use std::pin::Pin;
use tokio::sync::mpsc::{UnboundedReceiver, UnboundedSender};
use tokio::sync::mpsc::error::SendError;
use tracing::trace;
pub... | Rust | 0 |
/// use nines::*;
///
/// let layout = Layout {
/// src: Dimensions {
/// outer: Rect::xywh(0, 0, 3, 3),
/// inner: Rect::xywh(1, 1, 1, 1),
/// },
/// dst: Dimensions {
/// outer: Rect::xywh(0, 0, 5, 4),
/// inner: Rect::xywh(1, 1, 3, 2),
/// },
/// style: Style::def... | Rust | 0 |
static MASA_CRT_F2_00_02: &[u8] = core::include_bytes!(
concat!(env!("CARGO_MANIFEST_DIR"), "/../../data/00-D0-E5-F2-00-02/masa.crt"));
static DEVICE_CRT_F2_00_02: &[u8] = core::include_bytes!(
concat!(env!("CARGO_MANIFEST_DIR"), "/../../data/00-D0-E5-F2-00-02/device.crt"));
static KEY_PEM_F2_00... | Rust | 0 |
#
# GDB debugging support
#
# Copyright 2012 Red Hat, Inc. and/or its affiliates
#
# Authors:
# Avi Kivity <avi@redhat.com>
#
# This work is licensed under the terms of the GNU GPL, version 2 or
# later. See the COPYING file in the top-level directory.
# 'qemu mtree' -- display the memory hierarchy
import gdb
def ... | Python | 1 |
e, Debug, Default)]
pub struct Contact {
pub world_point_a: Vec3,
pub world_point_b: Vec3,
pub local_point_a: Vec3,
pub local_point_b: Vec3,
pub normal: Vec3,
pub separation_dist: f32,
pub time_of_impact: f32,
pub handle_a: BodyHandle,
pub handle_b: BodyHandle,
}
#[derive(Clone, D... | Rust | 0 |
")
);
let path = EPath::parse_tag("ProGram:MainProgram.test").unwrap();
assert_eq!(
path,
EPath::from_symbol("ProGram:MainProgram").with_symbol("test")
);
let path = EPath::parse_tag("struct_a[1]._abc.efg[2,3]").unwrap();
assert_eq!(
... | Rust | 0 |
.
pub fn swap_buffers(&self, display: Display, surface: Surface) -> Result<(), Error> {
unsafe {
if self.api.eglSwapBuffers(display.as_ptr(), surface.as_ptr()) == TRUE {
Ok(())
} else {
Err(self.get_error().unwrap())
}
}
}
/// Terminate an EGL display connection.
pub fn terminate(&self, displa... | Rust | 0 |
t)
id_list = os.listdir(root_path)
count_id = 0
for id_ in id_list:
if id_ not in clusters:
continue
sub_path = os.path.join(root_path,id_)
count_id +=1
file_list = os.listdir(sub_path)
tag_add_one = False
for file_ in file_list:
if (i... | Python | 1 |
val_loss += loss_fn(outputs, val_labels).item()
#Store prediction
val_logger.add_prediction(outputs.detach().to("cpu").numpy(), val_labels.detach().to("cpu").numpy())
#Log validation metrics
val_logs = val_lo... | Python | 1 |
plt.subplot(813)
plt.title('5日均成交量(单位:10万)')
guoren_content = guoren_api.submit_req_volume()
print(guoren_content)
try:
GuorenApi.parse_json_to_series_filter_dirty(guoren_content, lambda x: (x[0], int(x[1] / 100000))).plot()
except TypeError:
print("erro... | Python | 1 |
/engine/base/BaseCommonReturnValue.rs
net.sf.jasperreports.engine.base.BaseCommonReturnValue
<reponame>edmiester777/bakkesmod-rust<gh_stars>10-100
use crate::wrappers::{*, structs::*, unreal::*};
use super::*;
pub struct TimeBombPickupWrapper(pub usize);
impl_object!(TimeBombPickupWrapper);
impl TimeBombPickup for Ti... | Rust | 0 |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2010 Doug Hellmann. All rights reserved.
#
"""Positive look-ahead assertion
"""
#end_pymotw_header
import re
address = re.compile(
'''
# A name is made up of letters, and may include "."
# for title abbreviations and middle initials.
((?P<nam... | Python | 1 |
::UiCell, ressources: &WindowRessources) {
use conrod::{widget, Widget, Positionable};
if let Some(ref ids) = self.ids {
let frame = self.element.get_frame();
let c = frame.center() - self.global_center;
let mut rect = widget::Rectangle::fill_with(
[fr... | Rust | 0 |
loop {
let p = Vec3::from([random_double!(-1.0, 1.0), random_double!(-1.0, 1.0), 0.0]);
if p.length_squared() >= 1.0 {
continue;
}
return p;
}
}
pub fn reflect(v: Vec3, n: Vec3) -> Vec3 {
v - 2.0 * dot(&v, &n) * n
}
pub fn refract(uv: Vec3, n: Vec3, etai_over_et... | Rust | 0 |
call_time = get_sim_time("ns")
await self.finish_item(op)
DataHolder().finish_item_return_time = get_sim_time("ns")
DataHolder().datum = op.result == (op.data + 1)
class SeqTest(uvm_test):
def build_phase(self):
self.seqr = uvm_sequenc... | Python | 1 |
ster timer configuration register"]
pub struct AMTCR {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "AHB master timer configuration register"]
pub mod amtcr;
#[doc = "FGCLUT"]
pub struct FGCLUT {
register: ::vcell::VolatileCell<u32>,
}
#[doc = "FGCLUT"]
pub mod fgclut;
#[doc = "BGCLUT"]
pub struct BGCLUT {
... | Rust | 0 |
connection.execute(
text("UPDATE producto SET Unidades_Totales_Prod = :nueva_cantidad WHERE Id_Producto = :id"),
{"nueva_cantidad": nueva_cantidad, "id": target.FK_Id_Producto}
)
# Crear historial de salida
... | Python | 1 |
)
window_indices_start += len(indices)
# Extend as we'll be slicing window like [start, end)
window_indices = np.append(window_indices, [window_indices[-1] + 1]).astype(
np.int64, copy=False
)
start_arrays.append(window_indices.tak... | Python | 1 |
rea(windows_list, x, y, w, h, dws):
"""Tile 3 Windows in Triangle Down Scheme on the Given Area"""
if len(windows_list) > 3: windows_list = windows_list[0:3]
for index,checked_window in enumerate(windows_list):
if index == 1: xo = w/2
else: xo = 0
if index == 2: yo = h/2
else... | Python | 1 |
values(&self) -> Vec<Box<dyn Any>> { Vec::new() }
fn run(&self, _value: &Box<dyn Any>) -> Result<(), String> {
for i in TEST_VALUES_32 {
run_test_result_only_32(
i,
rsq(i),
&|assembler: &mut RSPAssembler, reg| {
assembler.write... | Rust | 0 |
.protos.Service"));
assert!(!match_name(".m", ".my.protos"));
assert!(!match_name(".p", ".protos"));
assert!(!match_name(".my", ".myy"));
assert!(!match_name(".protos", ".my.protos"));
assert!(!match_name(".Service", ".my.protos.Service"));
assert!(!match_name("service... | Rust | 0 |
_0();
}"#,
"main",
);
}
#[test]
fn multiple_lambdas() {
common::verify_both(
r#"int intfn();
int fnTemplate(intfn cb1, intfn cb2) { return cb1() + cb2(); }
void main() {
fnTemplate(1, 2);
}"#,
r#"int _glslt_fnTemplate_0() { return 1 + 2; }
void main() {
_glslt_fnTemplate_0();... | Rust | 0 |
dex is None:
self.ip = tk.StringVar(value="172.18.0.1")
self.domain = tk.StringVar(value="lab.local")
else:
item = app.cfg.extra_hosts[index]
self.ip = tk.StringVar(value=item['ip'])
self.domain = tk.StringVar(value=item['domain'])
frm = ttk.Fr... | Python | 1 |
275) = &input.excess_capacity_termination_policy {
scope_4274.string(var_4275.as_str());
}
#[allow(unused_mut)]
let mut scope_4276 = writer.prefix("LaunchTemplateConfig");
if let Some(var_4277) = &input.launch_template_configs {
let mut list_4279 = scope_4276.start_list(true, Some("item"... | Rust | 0 |
specified node. For this
/// we need to provide the old and the new node value.
/// 3. Replace the node value with the computed root.
/// 4. Pop the depth value off the stack.
///
/// The Merkle path for the node is expected to be provided by the prover non-deterministically
/// (via advice ... | Rust | 0 |
import sys
from typing import Callable, Any
from .loading import Loading
def operation_termination(func: Callable) -> Callable:
"""
Decorator to handle KeyboardInterrupt exceptions and terminate the program gracefully.
Args:
func (Callable): The function to be wrapped.
Returns:
Calla... | Python | 1 |
x38, 0x53, 0x5c, 0xa8, 0xaf, 0xce, 0xaf, 0x0b,
0xf1, 0x2b, 0x88, 0x1d, 0xc2, 0x00, 0xc9, 0x83, 0x3d, 0xa7, 0x26, 0xe9, 0x37, 0x6c,
0x2e, 0x32, 0xcf, 0xf7,
],
);
}
#[test]
fn it_should_compute_digest_for_vec1() {
check(
b"Jefe",
... | Rust | 0 |
Behaviour::Exclusive,
};
delete_district_plugin.startup(&mut app).unwrap();
assert!(app.has_shortkey(vec![Key::Ctrl, Key::F]))
}
#[test]
fn integration_startup_adds_toolbar_button() {
let mut app = App::<Map>::default();
let mut delete_district_plugin = DeleteDist... | Rust | 0 |
s:
tool_config: The current tool configuration dictionary.
new_tool: The new tool to add/update.
Raises:
ValueError: If the new tool spec is invalid.
"""
if not new_tool.get("spec"):
raise ValueError("Invalid tool format - missing spec")
... | Python | 1 |
gv, 2, 3, "varName ?increment?")?;
let increment: MoltInt = if argv.len() == 3 {
argv[2].as_int()?
} else {
1
};
let var_name = argv[1].as_str();
let new_value = increment
+ interp
.var(var_name)
.and_then(|val| Ok(val.as_int()?))
.unwra... | Rust | 0 |
1, MI1, D1, CompressedColumnStorage>
where
T1: Scalar + Into<<T2 as Add<T1>>::Output>,
T2: Scalar + Into<<T2 as Add<T1>>::Output> + Add<T1>,
<T2 as Add<T1>>::Output: Scalar,
MO1: Borrow<[usize]>,
MO2: Borrow<[usize]>,
MI1: Borrow<[usize]>,
MI2: Borrow<[usize]>,
D1: Borrow<[T1]>,
D2: ... | Rust | 0 |
from typing import List
# Time: O(n)
# Space: O(1)
class Solution:
def minTimeToVisitAllPoints(self, points: List[List[int]]) -> int:
res = 0 # Initialize the total time counter
# Start from the last point in the list (pop removes and returns the last element)
x1, y1 = points.pop()
... | Python | 1 |
import plotly.express as px
import plotly.graph_objects as go
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
from sklearn.ensemble import RandomForestRegressor
base_saude2= pd.read_csv(r'C:\Users\joaov\Desktop\OneDrive\CSV\plano_saude2.csv')
x=base_saude2.iloc[:, 0:1].v... | Python | 1 |
class Solution:
def largestTriangleArea(self, points: List[List[int]]) -> float:
# yma,ymi = max([p[1] for p in points if p[0]==0]),min([p[1] for p in points if p[0]==0])
# xma,xmi = max([p[0] for p in points if p[1]==0]),min([p[0] for p in points if p[1]==0])
# return max((yma-ymi)*xma/2,(x... | Python | 1 |
skVo"]) != 0:
for task in repair_data['updateTaskVo']:
gameData.taskInfo[task['taskCid']]['condition'] = task['condition']
log.info('Finish Repair')
time.sleep(3)
# 进行换船处理
if len(change_ship) != 0:
for s... | Python | 1 |
66.58 * hy1d[FX]
ezy[nn, LX] += 266.58 * hy1d[LX]
ezx[nn, FX] -= 266.58 * hy1d[FX]
ezx[nn, LX] += 266.58 * hy1d[LX]
for qTime in range(maxTime):
"""#TFSF PECS
PEC1 = PECs(1,20,20)
PEC1.PEC_Line(20,20,20,60)
PEC1.PEC_Line(30,20,30,60... | Python | 1 |
sort(&mut vec);
for i in 0..vec.len() {
assert_eq!(vec[i], test_vec[i]);
}
}
<reponame>grafeia/ReX<filename>src/functions.rs
use crate::dimensions::Unit;
use crate::font::{Weight, Family, AtomType, Style, style_symbol};
use crate::layout::Style as LayoutStyle;
use crate::lexer::{Lexer, Token};
use c... | Rust | 0 |
building_error += self.error[bi][geon_id]
building_error = building_error/len(self.error[bi].keys())
error_file.write('Building error: ' + str(building_error))
error_file.close()
area_error += building_error
area_error = area_error / self.building_n... | Python | 1 |
"mean": "number",
"median": "number",
"min": "number",
"max": "number",
"range": "number",
"std_dev": "number",
"variance": "number"
},
example_input={"numbers": [1, 2, 3, 4, 5]},
... | Python | 1 |
self.full,
}
}
fn full(&self) -> bool {
self.full.load(Ordering::Relaxed)
}
}
impl<'r, R, T> UnindexedConsumer<T> for TryReduceWithConsumer<'r, R>
where
R: Fn(T::Ok, T::Ok) -> T + Sync,
T: Try + Send,
{
fn split_off_left(&self) -> Self {
*self
}
fn to_reducer(... | Rust | 0 |
odel":chunk.model,
"usage":usage,
'is_final': False,
'batch_progress': {
'current': batch_index + 1,
'total': total_batches
... | Python | 1 |
ality::<Nullable<Integer>, Option<i32>>(
"NULL", None
));
assert!(query_to_sql_equality::<Nullable<VarChar>, Option<String>>(
"'Hello!'",
Some("Hello!".to_string())
));
assert!(query_to_sql_equality::<Nullable<VarChar>, Option<String>>(
"''",
Some("".to_string())
... | Rust | 0 |
"fuska mai murmushi tare da baki a buɗe & idanu masu murmushi",
"ido",
"murmushi",
],
},
#[cfg(feature = "he")]
crate::Annotation {
lang: "he",
tts: Some("פרצוף מחייך עם פה פתוח ועיניים מחייכות"),
keyword... | Rust | 0 |
for () {
fn offer() -> Weight {
10_000 as Weight
}
fn bond() -> Weight {
10_000 as Weight
}
fn cancel() -> Weight {
10_000 as Weight
}
}
<reponame>YangZhou1997/NetBricks-GEM5<gh_stars>1-10
extern crate getopts;
extern crate netbricks;
use getopts::Options;
use netbricks::common::Result;
use netbricks... | Rust | 0 |
#!/usr/bin/env python3
"""
Verify the multi-camera edit and show information about the final video.
"""
import subprocess
import json
from pathlib import Path
def get_detailed_video_info(video_path):
"""Get detailed information about a video file."""
cmd = [
'ffprobe',
'-v', 'quiet',
'... | Python | 1 |
pub fn AlignTextToFramePadding() -> c_void;
#[link_name = "?GetTextLineHeight@ImGui@@YAMXZ"]
pub fn GetTextLineHeight() -> f32;
#[link_name = "?GetTextLineHeightWithSpacing@ImGui@@YAMXZ"]
pub fn GetTextLineHeightWithSpacing() -> f32;
#[link_name = "?GetFrameHeight@ImGui@@YAMXZ"]
pub fn GetFra... | Rust | 0 |
# User configuration file typically located at `~/.config/nerd-dictation/nerd-dictation.py`
# This examples shows how explicit start/end commands can be implemented.
#
# This assumes dictation is always running in the background,
# special commands are spoken to start/end dictation which are excluded
# Global, track ... | Python | 1 |
gUrl": "https://emoji.cdn.bcebos.com/yige-aigc/aigc-info/pic_rep/bgImgUrl_local_replacement.png",
"bannerText": "对图片进行局部修改",
"staticImgUrl": "https://emoji.bj.bcebos.com/yige-aigc/aigc-info/%E5%B1%80%E9%83%A8%E6%9B%BF%E6%8D%A2%E9%9D%99%E6%80%81%E5%9B%BE.png",
... | Python | 1 |
let (resouce_recv, count_recv) = port.get(PortID::B).get().unwrap_or((resource, 0));
if resouce_recv == resource && count_recv != u16::MAX {
port.get_mut(PortID::A).set(resource, count_send-1);
port.get_mut(PortID::B).set(resource, count_recv+1);
}
}... | Rust | 0 |
Handler {
require_unique_server!();
require_min_arguments!(1);
delete_command_message!();
fn run(&self, command: Command) -> ActionGroup {
match command.arguments[0].as_str() {
"add" => if command.arguments.len() < 3 {
self.usage(command)
} else {
... | Rust | 0 |
Eq, Ord, PartialEq, PartialOrd};
#[derive(Deserialize, Serialize, Debug)]
pub struct LogLine {
pub line: String,
pub ts: u64,
pub indexes: Vec<String>,
}
#[derive(Deserialize, Serialize, Debug)]
/// QueryRequest is used for sending query request.
pub struct QueryRequest {
pub query: String,
pub sta... | Rust | 0 |
class Latte:
pass | Python | 1 |
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
print("Start Script")
CONTAINER_SELENIUM = "selenium"
PORT_SELENIUM = "4444"
CONTAINER_WEB_APPLICATION = "django-application-dev"
PORT_WEB_APPLICATION = "8000"
# Options
options = webdriver.ChromeOptions()
o... | Python | 1 |
,
fgd_gmm: &GMM,
comp_idxs: &mut Vec<Vec<usize>>,
) {
for (x, y, pixel) in img.pixels() {
let color: Color = {
[
pixel.data[0] as f64,
pixel.data[1] as f64,
pixel.data[2] as f64,
]
};
comp_idxs[x as usize][y as u... | Rust | 0 |
].view(*rs_set["m_rst"].shape[:-1], 6,
25).permute(0, 3, 2, 1)[:, :-1],
rs_set["m_ref"].view(*rs_set["m_ref"].shape[:-1], 6,
25).permute(0, 3, 2, 1)[:, :-1],
rs_set["m_lens"])
... | Python | 1 |
#builder (pub(crate) Vec<#inner>);
);
write!(writer, "{}", code)
}
fn impl_trait_builder<W>(
writer: &mut W,
origin_name: &str,
funcs: m4::TokenStream,
) -> io::Result<()>
where
W: io::Write,
{
let builder = builder_name(origin_name);
let entity = entity_name(origin_name);
let code... | Rust | 0 |
5, 0x130D)),
Expr.Ez,
Expr.Return,
),
'loc_531',
)
PlaySE(43, 0x00, 0x64)
OP_70(0x0000, 60)
Sleep(500)
If(
(
(Expr.Eval, "AddItem(ItemTable['复苏药'], 1)"),
Expr.Return,
),
'loc_4C8',
)
FadeOut(300, 0, 1... | Python | 1 |
model.wire_node(prefix, reduced, &inputs)
}
}
#[cfg(test)]
mod test {
use super::*;
use crate::setup_test_logger;
#[test]
fn test_infer_with_known_kshape() {
let mut op = expand(Conv::default().strides(tvec![2, 2]).kernel_shape(tvec![3, 3]));
let ifact = InferenceFact::dt_shape(Dat... | Rust | 0 |
import tkinter as tk
from tkinter import messagebox, scrolledtext, font
from googletrans import Translator
def translate_text():
translator = Translator()
text = input_text.get("1.0", tk.END).strip()
dest_language = lang_code_entry.get().strip()
if text and dest_language:
try:
dete... | Python | 1 |
(mut csprng, sk, pk, b1, _) = common();
b.iter(|| {
let _ = sk.evaluate_simple(&mut csprng, &b1[..]);
})
}
#[bench]
fn verify_success(b: &mut test::Bencher) {
let (mut csprng, sk, pk, b1, _) = common();
let po = sk.evaluate_simple(&mut csprng, &b1[..]);
... | Rust | 0 |
"""
Example sentences to test spaCy and its language models.
>>> from spacy.lang.ro import Romanian
>>> from spacy.lang.ro.examples import sentences
>>> nlp = Romanian()
>>> docs = nlp.pipe(sentences)
"""
sentences = [
"Apple plănuiește să cumpere o companie britanică pentru un miliard de dolari",
"Municipal... | Python | 1 |
o use when authenticating.
#[cfg(feature = "sentinel-auth")]
#[cfg_attr(docsrs, doc(cfg(feature = "sentinel-auth")))]
password: Option<String>,
},
}
impl Default for ServerConfig {
fn default() -> Self {
ServerConfig::default_centralized()
}
}
impl ServerConfig {
/// Create a new centralized c... | Rust | 0 |
print("pop".center(60, "-"))
emp1 = {'empid': 1234, 'ename': 'Jack', 'age': 35, 'desig': 'MGR','dept': 'finance', 'loc': 'del', 'sal': 125000}
print(f"emp1 :{emp1}")
res = emp1.pop('desig')
print(res)
res = emp1.pop('loc')
print(res)
# res = emp1.pop()
# print(res)
print(f"emp1 :{emp1}")
print("popitem".center(6... | Python | 1 |
t output_ind = i * ind_stride;
let ox = output_ind/output_strides[axis];
pool_recurse_forward(input, output,
input_shape, &output_shape, &factors,
&input_strides, &output_strides,
ox,
axis, output_ind, scale)
}
assert!(output.iter().all(|e| (e-2.64).abs() < 0.001), "{:?}",... | Rust | 0 |
import collections
from typing import Optional, Union, List
class Tokenizer():
"""
BPE와 WordTokenizer의 공통적인 부분을 뽑아서 만든 class입니다.
init 함수, add_corpus 함수, tokenize 함수를 구현합니다.
"""
# corpus에는 문자열 리스트(List[str]) 또는 문자열(str)을 전달할 수 있습니다.
def __init__(self, corpus: Optional[Union[List[str], str]] = N... | Python | 1 |
<C: Coord> {
prev: Vec<usize>,
next: Vec<usize>,
tri: Vec<usize>,
hash: Vec<usize>,
start: usize,
center: C,
}
impl<C: Coord + Vector<C>> Hull<C> {
fn new(n: usize, center: &C, i0: usize, i1: usize, i2: usize, points: &[C]) -> Self {
// initialize a hash table for storing edges of t... | Rust | 0 |
args.save_strategy != "no":
trainer.save_metrics("eval", metrics)
if training_args.do_predict:
result = trainer.predict(datasets["test"])
logger.info(f"test metrics: {result.metrics}")
trainer.log_metrics("predict", result.metrics)
if training_args.save_strategy != "no":... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.