text string | label_name string | labels int64 |
|---|---|---|
ul
'''
output = self.runIt('downloadImages', 'api_driver.sh')
self.assertIn('Download Images transaction is successful',
output)
def test_FAB3934_8_Post_Items(self):
'''
Network: 1 Ord, 2 Org, 4 Peers, 2 Chan, 1 CC
Description: This tes... | Python | 1 |
atList]
self["list"] = SelectionList(sat_list, enableWrapAround=True)
self["setupActions"] = ActionMap(["SetupActions", "ColorActions"],
{
"red": self.cancel,
"green": self.save,
"yellow": self.sortBy,
"blue": self["list"].toggleAllSelection,
"save": self.save,
"cancel": self.cancel,
"ok": se... | Python | 1 |
)))
} else {
panic!("unexpected SubstFormat");
}
}
unsafe fn otl_gsub_read_alternate<R: Read + Seek>(handle: &mut R) -> Option<SubTable> {
let mut altset_offsets: clt_number_list = clt_number_list { value: Vec::new() };
let offset = handle.seek(SeekFrom::Current(0)).unwrap();
let Sub... | Rust | 0 |
x_tide(api::binding::get_servant(r).await) })
.post(|r| async { fix_tide(api::binding::link_servant(r).await) })
.delete(|r| async { fix_tide(api::binding::unlink_servant(r).await) });
app.at("/pipeline")
.get(|r| async { fix_tide(api::pipeline::list_artefact(r).await) })
.post(|r| a... | Rust | 0 |
;
#[cfg(feature = "gstreamer-backend")]
extern crate gstreamer_app as gst_app;
#[cfg(feature = "gstreamer-backend")]
extern crate zerocopy;
#[cfg(feature = "sdl-backend")]
extern crate sdl2;
extern crate librespot_audio as audio;
extern crate librespot_core;
extern crate librespot_metadata as metadata;
pub mod audio... | Rust | 0 |
field("inner", &self.inner)
.field("type", &type_name::<T>())
.finish()
}
}
impl<T> Clone for EventDownlinkSubscriber<T> {
fn clone(&self) -> Self {
EventDownlinkSubscriber::new(self.inner.clone())
}
}
impl<T> EventDownlinkReceiver<T> {
fn new(inner: topic::Receiver<Eve... | Rust | 0 |
: (b x t_q x n) else: (t_q x b x n)
:param keys: if batch_first: (b x t_k x n) else (t_k x b x n)
:returns: (context, scores_normalized)
context: if batch_first: (b x t_q x n) else (t_q x b x n)
scores_normalized: if batch_first (b x t_q x t_k) else (t_q x b x t_k)
"""
... | Python | 1 |
_levels: 1,
});
// insert some blocks
let block0 = insert_header(&backend, 0, Default::default(), None, Default::default());
let block1 = insert_header_with_configuration_change(&backend, 1, block0, None, config_at_1.clone());
let block2 = insert_header(&backend, 2, block1, None, Default::default());
let b... | Rust | 0 |
Point) -> Self {
let mut triangle = *self;
triangle.translate_mut(by);
triangle
}
/// Translate the triangle from its current position to a new position by (x, y) pixels.
///
/// ```
/// # use embedded_graphics::primitives::Triangle;
/// # use embedded_graphics::prelude... | Rust | 0 |
_) => cmd.push("run"),
}
if mode == Release {
cmd.push("--release");
}
if let Some(target) = target {
cmd.extend(&["--", "-o", "/playground-result/compilation"]);
match target {
Assembly(flavor, _, _) => {
use self::AssemblyFlavor::*;
... | Rust | 0 |
self.last_crash.disasm, \
self.last_crash.violation_thread_id, \
direction, \
self.last_crash.violation_address \
)
synopsis += self.last_crash.context_dump
synopsis += "\ndisasm ... | Python | 1 |
x', hash=0, version=5, triplets=[], pool=3, set_pool=0),
".texturestream": Mime(name='FGDK:TextureStream:texturestream', hash=0, version=5, triplets=[], pool=3, set_pool=0),
".txt": Mime(name='FGDK:Text:txt', hash=0, version=1, triplets=[], pool=1, set_pool=0),
".userinterfaceicondata": Mime(name='Casino:UserInterfa... | Python | 1 |
.ev_code {
0 => afloat(&device.joyx, &|_| value),
1 => afloat(&device.joyy, &|_| value),
16 => {
if js.ev_value < 0 {
edit(true, device, Btn::Left);
edit(false, device, Btn::Right);
} ... | Rust | 0 |
false,
};
ui.add_listener(key_listener, move |event: &mut KeyEvent, mut ctx| {
if let Some(mut action) = action_for_key(event) {
ctx.poke_up(&mut action);
}
});
ui.add_listener(forwarder, move |action: &mut CalcAction, mut ctx| {
calc_state.action(action);
ct... | Rust | 0 |
035720.KS", # 카카오
"051900": "051900.KS", # LG생활건강
"373220": "373220.KS", # LG에너지솔루션
"005380": "005380.KS", # 현대차
"000270": "000270.KS", # 기아
"017670": "017670.KS", # SK텔레콤
"015760": "015760.KS", # 한국전력
"034020": "034020.KS", # 두... | Python | 1 |
legacy_wasm_path_2
else: raise FileNotFoundError(f"WASM file not found: {wasm_path}")
if not os.path.exists(zkey_path):
raise FileNotFoundError(f"Proving key not found: {zkey_path}")
if not os.path.exists(vkey_path):
raise FileNotFoundError(f"Verification key not found: {vkey_path... | Python | 1 |
ptr::null_mut(),
)
} > 0)
}
/// Attempts to retrieve the properties of the object. Returned inside a Zend Hashtable.
pub fn get_properties(&self) -> Result<ZendHashTable> {
unsafe {
ZendHashTable::from_ptr(
self.handlers()?.get_properties.ok_or(Error:... | Rust | 0 |
ap, Debug)]
pub struct BitCommitTreeCliOpts {
#[clap(short = 'm', long = "message")]
pub message: Option<String>,
#[clap(short = 'p', long = "parent")]
pub parents: Vec<Oid>,
pub tree: Oid,
}
<filename>wrflib/main/vector/src/path/mod.rs
// Copyright (c) 2021-present, Cruise LLC
//
// This source cod... | Rust | 0 |
# -*- coding: utf-8 -*-
"""랭체인의 두 가지 청킹 방법 wikidocs - 25-06-20.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1ONgctUjVzYs32V3n5mkfBghkB6PySheN
"""
pip install langchain_openai langchain_experimental
import urllib.request
from langchain.text_splitter ... | Python | 1 |
#!/usr/bin/python3
for a in range(97, 123):
print("{}".format(chr(a)), end="", flush=True)
| Python | 1 |
.help("Specifies the number of jobs to run simultaneously.\
Set to 1 to go monothread, by default is set to your number of CPUs.")
.validator(|str| {
str.parse()
.map(|_: usize| ())
.map_err(|err| format!(... | Rust | 0 |
Err(e) => {
println!("Error `{:?}` when getting clipboard access", e);
return;
}
};
match ctx.set_contents(format!("{}", notes)) {
Ok(_) => {
println!("Notedata copied to clipboard.");
}
Err(e) => {
... | Rust | 0 |
let mut index;
let mut changed = 0;
loop {
let mut ins = instructions.to_vec();
let p = changed
+ ins
.iter()
.skip(changed)
.position(|a| matches!(a, Op::Nop(_) | Op::Jmp(_)))
.unwrap();
match ins[p] {
... | Rust | 0 |
# %%
"""
<table class="ee-notebook-buttons" align="left">
<td><a target="_blank" href="https://github.com/giswqs/earthengine-py-notebooks/tree/master/GetStarted/08_masking.ipynb"><img width=32px src="https://www.tensorflow.org/images/GitHub-Mark-32px.png" /> View source on GitHub</a></td>
<td><a target="_blank... | Python | 1 |
print(" Scaling ratios | med: {:0.3f} | std: {:0.3f}".format(med, np.std(ratios / med)))
if opt.save_pred_disps:
# error_maps = np.concatenate(error_maps) # should not concatenate
error_map_path = os.path.join(
opt.load_weights_folder, "error_{}_split".format(opt.eval_split))
... | Python | 1 |
if exth.clipping_limit and exth.clipping_limit < 100:
self.log('Clipping limit of %d%% in: <b>%s</b>'%(exth.clipping_limit, get_title_authors_text(db, book_id)))
show_book = True
return show_book
except:
... | Python | 1 |
verbose (bool) -- if verbose: print the network architecture
"""
print('---------- Networks initialized -------------')
for name in self.model_names:
if isinstance(name, str):
net = getattr(self, 'net' + name)
num_params = 0
... | Python | 1 |
current_span,
"the first parameter of the tag type should have type TagPropagationSet"
);
self.block_visitor.bv.emit_diagnostic(warning);
}
return None;
}
... | Rust | 0 |
med out after creating {number_of_nodes} nodes\n")
return 0
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
#temp_state=random_6_puzzle()
temp_state=[1,4,2,5,3,0]
root = Node(temp_state,find_zero(temp_state))
print(f"start state: \n{root}\n")
# BFS... | Python | 1 |
MPTS = SpanAttributes.LLM_PROMPTS
MESSAGE_ROLE = MessageAttributes.MESSAGE_ROLE
MESSAGE_CONTENT = MessageAttributes.MESSAGE_CONTENT
MESSAGE_FUNCTION_CALL_NAME = MessageAttributes.MESSAGE_FUNCTION_CALL_NAME
MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON = MessageAttributes.MESSAGE_FUNCTION_CALL_ARGUMENTS_JSON
MESSAGE_TOOL_CALLS =... | Python | 1 |
X', b'Y', b'X', b'Z',
b'Y', b'0', b'Y', b'1', b'Y', b'2', b'Y', b'3', b'Y', b'4', b'Y', b'5', b'Y', b'6', b'Y', b'7',
b'Y', b'8', b'Y', b'9', b'Y', b'A', b'Y', b'B', b'Y', b'C', b'Y', b'D', b'Y', b'E', b'Y', b'F',
b'Y', b'G', b'Y', b'H', b'Y', b'I', b'Y', b'J', b'Y', b'K', b'Y', b'L', b'Y', b'M', b'Y', b'N'... | Rust | 0 |
import pandas as pd
url = "https://air-quality-api.open-meteo.com/v1/air-quality?latitude=52.52&longitude=13.41&hourly=pm10,pm2_5"
airData = pd.read_json(url)
print(airData)
| Python | 1 |
a> {
Variable(Ref<'a, Variable<'a>>),
Function(Ref<'a, Function<'a>>),
Struct(Ref<'a, Struct<'a>>),
}
#[derive(Debug, PartialEq, Clone)]
pub struct Variable<'a> {
linkage: Linkage,
name: String,
defined: Cell<bool>,
ty: QualType<'a>,
initial: RefCell<Option<Box<expr::Expression<'a>>>>,
... | Rust | 0 |
nt_position(joint[:7])
time.sleep(1)
gripper_width = gripper_widths[i]
if gripper_width > 0.04:
gripper_width = 0.08
else:
gripper_width = 0.0
if abs(gripper_width - global_gripper_width) > 0.01:
gripper.grasp(width=gripper_width, speed=0.1, force=40, epsilon_outer=0.08)
... | Python | 1 |
: u32, sec: u32) -> NaiveDateTime {
self.and_hms_opt(hour, min, sec).expect("invalid time")
}
/// Makes a new `NaiveDateTime` from the current date, hour, minute and second.
///
/// No [leap second](../time/index.html#leap-second-handling) is allowed here;
/// use `NaiveDate::and_hms_*_opt`... | Rust | 0 |
import streamlit as st
def build_confidence():
st.subheader("Building Confidence")
# Confidence Decision Balance
confidence = st.slider("On a scale from 0 to 10, how confident are you that, if you decided to make this change, you would be successful?", 0, 10, 5)
st.write(f"You said {confidenc... | Python | 1 |
l.generator", code)
if torch.cuda.is_available():
_, (code,) = run_and_get_code(
halide,
torch.randn(1024, 1024, device="cuda"),
torch.randn(1024, 1024, device="cuda"),
)
self.assertIn("@hl.generator", code)
if test_torchindu... | Python | 1 |
Map::new());
info!("{:?}", map);
let payload = map
.get("payload")
.map(|payload| serde_json::from_str::<BlockActionsPayload>(payload).unwrap());
let config = match envy::from_env::<SlackConfig>() {
Ok(val) => val,
Err(err) => {
error!("{:?}", err);
p... | Rust | 0 |
from typing import Optional, List
from uuid import UUID
from schemas.studentschemas import StudentBase,StudentOut,StudentUpdate
from models.studentmodel import Student
import pymongo
class StudentService:
@staticmethod
async def create_student(user:StudentBase):
student_in=Student(
student_id=user.studen... | Python | 1 |
from __future__ import annotations
import json
import functools
from typing import TypedDict
import requests
import semver
class CrateVersionDict(TypedDict):
"""
A returned row from the crates.io index API.
Note that the returned row also includes all of the fields from the jsonschema at
https://do... | Python | 1 |
Text Component.
#[no_mangle]
pub extern "C" fn TextComponent_new() -> OwnedTextComponent {
Box::new(TextComponent::new())
}
/// drop
#[no_mangle]
pub extern "C" fn TextComponent_drop(this: OwnedTextComponent) {
drop(this);
}
/// Converts the component into a generic component suitable for using with a
/// la... | Rust | 0 |
import heapq
class Graph:
def __init__(self):
self.lsdb = {} # Link-State Database
def add_vertex(self, vertex_id):
if vertex_id not in self.lsdb:
self.lsdb[vertex_id] = {}
print(f"LSA: Initialized LSDB for router {vertex_id}.")
def add_edge(self, node1_id, node2_... | Python | 1 |
[doc = " \\param[in] mapid \\ref texmapid for reference in a TEV stage"]
#[doc = ""]
#[doc = " \\return none"]
pub fn GX_LoadTexObjPreloaded(obj: *mut GXTexObj, region: *mut GXTexRegion, mapid: u8_);
}
extern "C" {
#[doc = " \\fn void GX_PreloadEntireTexture(GXTexObj *obj,GXTexRegion *region)"]
#[do... | Rust | 0 |
1, 1, 1, 1, 1, 1, 1, 1,
];
unsafe { *LOOKUP.get_unchecked(value.leading_zeros() as usize) }
*/
/*
// Performance: Tried this constant-time method and it was slower
(value.leading_zeros().saturating_sub(1) / 7).max(1) as usize
*/
if value < (1 << 7) {
1
} else if value... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Boxy Theme Links
"""
import sublime
import sublime_plugin
import webbrowser
class BoxyDonateCommand(sublime_plugin.WindowCommand):
def run(self):
webbrowser.open_new_tab('https://github.com/ihodev/sublime-boxy#share-the-love')
class BoxyForumCommand(sublime_plugin.WindowCom... | Python | 1 |
= 0;
let mut max_y = 0;
let mut min_x = MAX;
let mut min_y = MAX;
for ((x, y), (vx, vy)) in &points {
let new_x = x + vx * sec;
let new_y = y + vy * sec;
max_x = max(new_x, max_x);
max_y = max(new_y, max_y)... | Rust | 0 |
#!/usr/bin/python3
# -*- coding: utf-8 -*-
# This is a part of CMSeeK, check the LICENSE file for more information
# Copyright (c) 2018 Tuhinshubhra
# Umbraco version detection
# Rev 1
import cmseekdb.basic as cmseek
import re
def start(headers, url, ua, temp_src=''):
cmseek.statement('Detecting Umbraco using he... | Python | 1 |
<h4>Add a text page below:</h4>
<form action="/" method="post">
<div>Title: <input type="text" size="40" name="title"
"""
html += 'value="' + time_string + '" />'
html += """
<em>This data will be encoded in the key names of index entiti... | Python | 1 |
# firebase_populator/__init__.py
"""
firebase_populator: A package to populate Firebase Firestore with generated data.
"""
__version__ = '0.1.0' # Package version
from .firebase_populator import FirebasePopulator | Python | 1 |
namespaces(&self) -> Vec<String> {
self.namespaces.clone()
}
fn apply(&self, r: &TpProcessRequest, ctx: &mut dyn TransactionContext) -> Result<(), ApplyError> {
// Get the header, signer and address
let header = &r.header;
let signer = match &header.as_ref() {
Some(... | Rust | 0 |
},
expression_size,
);
}
}
}
self.try_to_constant_fold_and_distribute_binary_op(
other,
ConstantDomain::add,
Self::addition,
|l, r| AbstractValue::make_binary(l, r, |lef... | Rust | 0 |
let command = next_request(&mut stream, &mut exec);
assert!(command.avctp_header().is_type(&AvctpMessageType::Command));
assert!(command.avctp_header().is_single());
assert_eq!(PacketType::Command(CommandType::Notify), command.avc_header().packet_type()); // NOTIFY
assert_eq!(&OpCode::VendorDependent,... | Rust | 0 |
VETelevisionIE(InfoExtractor):
IE_NAME = 'rtve.es:television'
_VALID_URL = r'https?://(?:www\.)?rtve\.es/television/[^/]+/[^/]+/(?P<id>\d+).shtml'
_TEST = {
'url': 'http://www.rtve.es/television/20160628/revolucion-del-movil/1364141.shtml',
'info_dict': {
'id': '3069778',
... | Python | 1 |
// set divide value to 16 ( ... how does 3 => 16 )
// map X2APIC timer to an interrupt handler in the IDT, which we currently use IRQ 0x22 for
wrmsr(IA32_X2APIC_LVT_TIMER, 0x22 | APIC_TIMER_PERIODIC as u64);
wrmsr(IA32_X2APIC_INIT_COUNT, x2apic_period);
w... | Rust | 0 |
_ {
let res = func1();
print!("res: {:?}", res);
rocket::build().mount("/", routes![hello, hello2])
}
*/use crate::core::constants;
use log::*;
use screeps::{prelude::*, Part, ReturnCode};
struct BodyParts {
mode: u8,
}
impl BodyParts {
pub fn new() -> Self {
Self { mode: 0 }
}
}
impl Iter... | Rust | 0 |
, PartialEq, PartialOrd)]
struct RecordMetadata {
origin: AsId,
max_length: u8,
path: Arc<PathBuf>,
trust_anchor: Arc<TrustAnchor>,
}
impl RecordMetadata {
fn new(origin: AsId,
max_length: u8,
path: Arc<PathBuf>,
trust_anchor: Arc<TrustAnchor>)
-> Self
{... | Rust | 0 |
),
coder=beam.coders.ProtoCoder(tf.train.Example)))
_ = (
outputs
| f'{index}_{split_str}_CountTFRecords' >>
beam.combiners.Count.Globally()
| f'{index}_{split_str}_JsonDDumps' >>
beam.Map(lambda x: json.dumps(x, indent=2))
... | Python | 1 |
f.num_target // self.num_source) * self.s_dataset_size:
tp1 = torch.randperm(len(self.indices_target))
tarperm = torch.cat([tarperm, tp1], dim=0)
T = 0
t = 0
for i, s in enumerate(perm, 1):
yield self.indices_source[s]
if i % self.num_source == 0:
... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipaySecurityDataDatabusSendModel(object):
def __init__(self):
self._security_content = None
self._security_sign = None
@property
def security_content(self):
ret... | Python | 1 |
le
core = virtual core ID within the capsule
entry = pointer to where to begin execution
dtb = physical address of the device tree blob
describing the virtual CPU's hardware environment
priority = virtual core's priority
<= OK for success, or error code */
... | Rust | 0 |
= True
df.to_csv(csv_path, index=False)
continue
# 上传图片到OSS
# 处理包含'!'和不包含'!'的URL
if '!' in image_path:
object_name = os.path.basename(image_path.split('!')[0])
else:
object_name = os.path.basename(image_path... | Python | 1 |
import datetime
from schedule_calculator.calculus.workday_calculator import WorkDayCalculator
from schedule_calculator.presenter import Presenter
from schedule_calculator.time.assemblers.work_calendar_assembler import WorkCalendarAssembler
from schedule_calculator.time.assemblers.workday_assembler import WorkDayAssemb... | Python | 1 |
_info: &'static BootInfo) -> ! {
use rustkernelv2::interrupts::PICS;
use rustkernelv2::allocator;
use rustkernelv2::memory::{self, BootInfoFrameAllocator};
use x86_64::VirtAddr;
println!("Hello World{}", "!");
// Set up the IDT to prevent a boot loop
rustkernelv2::gdt::init();
rustkern... | Rust | 0 |
def get_vanilla_transforms(img_size, hflip=0.5, jitter=0.4, mean=
IMAGENET_DEFAULT_MEAN, std=IMAGENET_DEFAULT_STD, crop_pct=
DEFAULT_CROP_PCT, add_train_transforms=None, add_test_transforms=None,
cutout_args=None, use_prefetcher=False):
if isinstance(img_size, (tuple, list)):
img_size = img_size... | Python | 1 |
rogress_bar=tqdm):
device = self.device
# the lengths of all the crops + uncondionnal
lengths = infos["all_lengths"]
n_frames = infos["n_frames"]
n_seq = infos["n_seq"]
mask = length_to_mask(lengths, device=device)
y = {
"length": lengths,
... | Python | 1 |
model = cls(
vit_model=vit_model,
q_former_model=q_former_model,
img_size=img_size,
drop_path_rate=drop_path_rate,
use_grad_checkpoint=use_grad_checkpoint,
vit_precision=vit_precision,
freeze_vit=freeze_vit,
has_qformer... | Python | 1 |
ources="upload",
type="pil",
elem_id="content_image",
)
processed_image = gr.Image(label="Processed Image", interactive=False)
with gr.Row():
with gr.Group():
do_remove_background = gr.Checkbox(
... | Python | 1 |
As an example, `ModularArithmetic<T>` implements `Arithmetic<T>` if `T` is one of unsigned
/// built-in integer types (`u8`, `u16`, `u32`, `u64`; `u128` **is excluded** because it cannot be
/// extended to double width).
#[derive(Debug, Clone, Copy)]
pub struct ModularArithmetic<T> {
pub(super) modulus: T,
}
impl... | Rust | 0 |
import yt_dlp
def extract_m3u8_url(url):
"""Extract M3U8 URL for a YouTube live stream."""
try:
ydl_opts = {
'quiet': True,
'format': 'best',
'noplaylist': True,
'extractor_args': {
'youtube': {
'live': True
... | Python | 1 |
L
while RCC.cfgr().sws() != 0b11 {}
// Set AHB4 (shared) prescaler
RCC.with_extcfgr(|r| r.set_shdhpre(1));
// Set APB1 prescaler
RCC.with_cfgr(|r| r.set_ppre1(1));
// Set APB2 prescaler
RCC.with_cfgr(|r| r.set_ppre2(1));
// Enable backup domain access
... | Rust | 0 |
Foo = module.resolve_ref();
let data = latest_data.lock().unwrap();
println!(
"In thread {:?} > resolve ok > value should be {}",
&handle.name().unwrap(),
... | Rust | 0 |
)")));
assert_eq!(x2s + "2x", CalculatorFloat::Str(String::from("(3t + 2x)")));
// Test simple add function: x + y
let mut x3 = CalculatorFloat::from(3);
let x2 = CalculatorFloat::from(2.0);
if let CalculatorFloat::Float(y) = x3.clone() + x2 {
assert!((y - 5.0).abs()... | Rust | 0 |
unauthorized users")]
force_authentication: bool,
}
#[derive(Dialogue, Serialize)]
enum PrometheusIngestion {
#[dialogue(prompt = "Configure Telegraf ingestion")]
Telegraf(TelegrafConfig),
#[dialogue(prompt = "Configure Elasticsearch ingestion")]
Elasticsearch(ElasticsearchConfig),
}
#[derive(Dia... | Rust | 0 |
{header, HeaderValue, Response};
use pin_project_lite::pin_project;
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
pin_project! {
/// Response future for [`CookieManager`].
#[derive(Debug)]
pub struct ResponseFuture<F> {
#[pin]
pub(crate) future: F,
pub(c... | Rust | 0 |
otalpasses {
let mut pass_1: *mut opj_tcd_pass_t =
&mut *(*cblk).passes.offset(passno as isize) as *mut opj_tcd_pass_t;
/* Prevent generation of FF as last data byte of a pass*/
/* For terminating passes, the flushing procedure ensured this already */
assert!((*pass_1).rate > 0 as libc::c_int as l... | Rust | 0 |
input.
pub fn part_2(input: String) {
// Nodes are of the form (v, p, l, r).
let mut trees: Vec<Vec<(usize, usize, usize, usize)>> = vec![];
for line in input.lines() {
let chars = line.chars().collect();
let tree = parse_tree(&chars, 0, chars.len() - 1);
trees.push(tree);
}
... | Rust | 0 |
raise AtomicAPIError(f"Request failed for {url}: {e}") from e
def _get_service_and_identifier(self, site_id: Optional[int], domain: Optional[str]) -> Tuple[str, Union[int, str]]:
"""
Determines the correct service and identifier for site-based endpoints.
The API uses a flexible pattern l... | Python | 1 |
from itertools import permutations, product
def f(x, y, z, w):
return ((x<=z) <= w) or (not y)
for a1,a2,a3,a4,a5,a6,a7 in product([0, 1], repeat=7):
table = [
(a1, a2, 1, a3),
(a4, 0, a5, a6),
(a7, 1, 0, 0)
]
if len(set(table)) == len(table):
for p in permutations('xyz... | Python | 1 |
Option<Page>, Error> {
if let Some(page) = self.read_in_queue(pref)? {
return Ok(Some(page));
}
let file = self.inner.file.lock().expect("file lock poisoned");
file.read_page(pref)
}
fn len(&self) -> Result<u64, Error> {
self.inner.file.lock().unwrap().len()
... | Rust | 0 |
f"*Габариты (ДxШxВ):* `{pos.get('length_m', '?')} x {pos.get('width_m', '?')} x {pos.get('height_m', '?')}` м."
)
@admin_router.callback_query(F.data == "back-admin-main")
@admin_only
async def back_admin_main(call: CallbackQuery):
try:
await call.message.edit_text("Выберите действие:", reply_... | Python | 1 |
}
}
impl R {
#[doc = "Bit 0 - Write '1' to enable interrupt for event RAMACCERR"]
#[inline(always)]
pub fn ramaccerr(&self) -> RAMACCERR_R {
RAMACCERR_R::new((self.bits & 0x01) != 0)
}
#[doc = "Bit 1 - Write '1' to enable interrupt for event FLASHACCERR"]
#[inline(always)]
pub fn... | Rust | 0 |
# Remove "!" for missing residues
lines = [
line for line in lines[sse_start:] if len(line) != 0 and line[13] != "!"
]
self._sse = np.zeros(len(lines), dtype="U1")
# Parse file for SSE letters
for i, line in enumerate(lines):
self._sse[i] = line[16]
... | Python | 1 |
code,
value: rsp_value,
},
)
}
}
}
pub mod list_query_results_for_resource_group_level_policy_assignment {
use crate::{models, models::*};
#[derive(Debug, thiserror :: Error)]
pub enum Error {
#[e... | Rust | 0 |
frutas = ("morango", "melancia", "pera", "mamão", "cereja")
for f in frutas:
print(f)
for i in range (1, 100):
if i %2 == 0:
print(f"{i} é par")
for i in range (1, 100):
if (i % 2 != 0):
print(i)
| Python | 1 |
1 C2 /r ib`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vcmppd_k_k1_ymm_ymmm256b64_imm8,
/// `VCMPPD k1 {k2}, zmm2, zmm3/m512/m64bcst{sae}, imm8`
///
/// `EVEX.512.66.0F.W1 C2 /r ib`
///
/// `AVX512F`
///
/// `16/32/64-bit`
EVEX_Vcmppd_k_k1_zmm_zmmm512b64_imm8_sae,
/// `CMPSS xmm1, xmm2/m32... | Rust | 0 |
t_object);
print("Frame: {} Removing: because overlap:{} with det_ignore area".format(frame_index, det_object.det_id))
track_det_list = tk_overlap.push_detection(det_object_list, frame);
status_str = '{} {}/{} Time: {}'.format(image_name, frame_index, total_frame_index, round((... | Python | 1 |
)?;
assert_eq!(int.duration()?, (5,12,0,0,0));
# Ok::<(),oracle::Error>(())
```
*/
pub fn from_number(num: &'a Number) -> Result<Self> {
num.to_interval()
}
/**
Copies one interval to another.
# Example
```
use sibyl::{ self as oracle, I... | Rust | 0 |
D) {
// collect multiaddress of validators
let mut failed_to_resolve: usize = 0;
let mut newly_requested = HashSet::new();
let requested = validator_ids.len();
for authority in validator_ids.into_iter() {
let result = authority_discovery_service
.get_addresses_by_authority_id(authority.clone())
.aw... | Rust | 0 |
output_strides,
),
2 => unsafe_pack_specialised::<U2>(
patch,
in_n,
input_channels,
output_ind,
filter_spatial,
input_spatial,
output_spatial,
filter_strides,
input_strides,
output_strides,
),
3 => ... | Rust | 0 |
github_pages(repo_name, token)
# Setup branch protection
setup_branch_protection(repo_name, token)
print("\nDeployment completed successfully!")
print(f"Repository URL: https://github.com/{repo_name}")
print(f"GitHub Pages URL: https:... | Python | 1 |
from machine import I2C
import time
class AHT20:
AHT20_ADDRESS = 0x38
CMD_INITIALIZE = b'\xBE\x08\x00'
CMD_TRIGGER_MEASUREMENT = b'\xAC\x33\x00'
CMD_SOFT_RESET = b'\xBA'
def __init__(self, i2c: I2C) -> None:
self.i2c: I2C = i2c
self.initialize_sensor()
def initialize_sensor(se... | Python | 1 |
import speech_recognition as sr
from googletrans import Translator
import pyttsx3
# Initialize translator and TTS engine
translator = Translator()
engine = pyttsx3.init()
# Function: Convert speech to text
def speech_to_text():
recognizer = sr.Recognizer()
with sr.Microphone() as source:
print("Adjust... | Python | 1 |
_str("\n"),
Self::End => serializer.serialize_str("done"),
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_serializes_evaluation() {
pretty_assertions::assert_eq!(
r#""ev""#,
serde_json::to_string(&Entry::Evaluation).expect("Unable to seri... | Rust | 0 |
if keyboard.is_pressed('esc'):
break
if detected == -1: #避障或丢失
detectmode = 0
tello.send_rc_control(0, 0, 0, 0)
pidx.reset_integral()
pidy.reset_integral()
start_time = time.time()
time.sleep(0.5)
elif detected != nu... | Python | 1 |
lines = ["india\n","australia\n","england\n","america\n","brazil\n"]
file=open("D:/python/01upload on github/17_File Handlings/2. Write Files/all_files_basis.txt",'w')
file.writelines(lines)
file.close() | Python | 1 |
#!/usr/bin/env python3
#
# This file is part of LiteX-Boards.
#
# Copyright (c) 2021 Jakub Cabal <jakubcabal@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
from migen import *
from litex.gen import *
from litex_boards.platforms import trenz_cyc1000
from litex.soc.cores.clock import Cyclone10LPPLL
from litex.so... | Python | 1 |
'@' + str(key)] = (elide(v1), elide(v2))
return diffs
def diff_simout(simout_dir1, simout_dir2):
'''Diff two simOut dirs by diffing their tables. Each table is in a subdir.
Ignore files like 'shell.log' and 'Daughter1_inherited_state.cPickle'.
Return a dict describing the differences.
TODO(jerry): One could cal... | Python | 1 |
")]
pub value: ::prost::alloc::string::String,
#[prost(bool, tag="13")]
pub source_enabled: bool,
#[prost(message, optional, tag="14")]
pub source: ::core::option::Option<Source>,
#[prost(message, repeated, tag="15")]
pub traces: ::prost::alloc::vec::Vec<Trace>,
}
#[derive(Clone, PartialEq, ... | Rust | 0 |
/// Inline resources are intended for Flow API clients (only), and are used
/// to bundle multiple resources into a single POSTed catalog document.
/// Each key must be an absolute URL which is referenced from elsewhere in
/// the Catalog, which is also the URL from which this resource was fetched.
... | Rust | 0 |
, :].cpu().numpy()
preds.append(pred)
trues.append(true)
prevs.append(prev)
preds = np.array(preds)
trues = np.array(trues)
prevs = np.array(prevs)
# base_path = '/p/selfdrivingpj/projects_time/NeurIPS2023-One-Fits-All/Long-term_Forecasting/'
# ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.