text string | label_name string | labels int64 |
|---|---|---|
_prefix: &str,
_delimiter: Option<String>,
) -> Result<ListEntryStream> {
todo!()
}
fn file_reader(&self, file: SizedFile) -> Result<Arc<dyn ObjectReader>> {
Ok(Arc::new(HadoopFileReader::new(
Arc::new(self.clone()),
file,
)?))
}
}
async f... | Rust | 0 |
Ok(())
}
pub fn delete(&mut self, id: i32) -> Result<()> {
let conn = self.db.connect()?;
conn.execute("DELETE from repos where id = ?1", &[&id]).map_err(|e| {
format_err!("Error deleting repo {}: {}", id, e)
})?;
Ok(())
}
pub fn lookup_channel(&s... | Rust | 0 |
inverse(self) -> SO3:
# Negate complex terms.
wxyz = self.wxyz.copy()
wxyz[..., 1:] *= -1
return SO3(wxyz)
@override
def normalize(self) -> SO3:
return SO3(wxyz=self.wxyz / onp.linalg.norm(self.wxyz, axis=-1, keepdims=True))
@classmethod
@override
def sampl... | Python | 1 |
import logging
from typing import Awaitable, Callable
from fastapi import status
from httpx import AsyncClient
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.sql.functions import count
from examples.api_for_sqlalchemy.models import Computer
from fastapi_jsonapi.atomic.sc... | Python | 1 |
class Solution:
def depthSum(self, nestedList: List[NestedInteger]) -> int:
ans = 0
def dfs(nestedList: List[NestedInteger], depth: int) -> None:
nonlocal ans
for ni in nestedList:
if ni.isInteger():
ans += ni.getInteger() * depth
else:
dfs(ni.getList(), depth ... | Python | 1 |
monic_num = harmonic_num
self.dim = self.harmonic_num + 1
self.sampling_rate = samp_rate
self.voiced_threshold = voiced_threshold
def _f02uv(self, f0):
# generate uv signal
uv = torch.ones_like(f0)
uv = uv * (f0 > self.voiced_threshold)
return uv
@torch.... | Python | 1 |
ident, args) {
self.check_regex(regex.as_str(), new_expr.span);
}
}
}
}
fn visit_call_expr(&mut self, call_expr: &CallExpr, _: &dyn Node) {
if let ExprOrSuper::Expr(expr) = &call_expr.callee {
if let Expr::Ident(ident) = expr.as_ref() {
if let Some(regex) =
... | Rust | 0 |
::UInt64 => UInt64,
ArrowDataType::Float32 => Float32,
ArrowDataType::Float64 => Float64,
ArrowDataType::Boolean => Bool,
ArrowDataType::Utf8 => Utf8,
ArrowDataType::List(_) => List,
ArrowDataType::Date32(_) => Date32,
ArrowDataType::Da... | Rust | 0 |
omplished by preventing any [`Value`] from escaping the [`Vm`].
/// As long as this is maintained, it is safe to send the execution across,
/// threads, and therefore schedule the future associated with the execution on
/// a thread pool like Tokio's through [tokio::spawn].
///
/// [tokio::spawn]: https://docs.rs/tokio... | Rust | 0 |
# This file is part of libigl, a simple c++ geometry processing library.
#
# Copyright (C) 2017 Sebastian Koch <s.koch@tu-berlin.de> and Daniele Panozzo <daniele.panozzo@gmail.com>
#
# This Source Code Form is subject to the terms of the Mozilla Public License
# v. 2.0. If a copy of the MPL was not distributed with thi... | Python | 1 |
pty"
)
return True
return elem.value in empty_values
def test_empty_tags_are_emptied(orig_anon_dataset):
orig_ds, anon_ds = orig_anon_dataset
for tt in empty_tags: # sourcery skip: no-loop-in-tests
if (
tt in orig_ds and len(orig_ds[tt].value) > 0
... | Python | 1 |
,
)
}
fn get_uppercase_category(weight: usize) -> WeightedCategory {
(
(
(b'A'..b'Z').map(char::from).collect::<Vec<_>>(),
StdRng::from_entropy(),
),
weight,
)
}
fn get_digit_category(weight: usize) -> WeightedCategory {
(
(
(b'0'..b'... | Rust | 0 |
cfg_alloc {
($($item:item)*) => {
$(
#[cfg(feature = "alloc")]
$item
)*
}
}
/// Declares default items.
#[allow(unused_macros)]
#[doc(hidden)]
macro_rules! cfg_default {
($($item:item)*) => {
$(
#[cfg(feature = "default")]
$item
... | Rust | 0 |
ck: SocketAddr) -> ClientVideoThreadHandler {
let (instr_tx, instr_rx) = channel();
let (tx, rx) = channel::<NetworkPacket>();
let send_video_handle = thread::Builder::new().name("send_video_thread".to_string()).spawn(move || {
println!("Send Video Completion Status: {:?}", send_vide... | Rust | 0 |
AXBS_P. This bit can override master M0 M1 high priority configuration.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum AXBS_P_FORCE_ROUND_ROBIN_A {
#[doc = "0: AXBS_P masters are not arbitored in round robin, depending on M0/M1 master priority settings."]
AXBS_P_FORCE_ROUND_ROBIN_0 = 0... | Rust | 0 |
(&self, collision: &Collision) -> Option<Self> {
let space_vec_opt = match collision {
&Collision::Wall { t, ref prev, ref next } => {
let new_vec: Vec<_> = self.particles().map( |p: &Particle|
if p.id == prev.id { next.clone() }
else { p.evolve(t) }
).collect();
S... | Rust | 0 |
import moondream as md
from PIL import Image
# model = md.vl(model='./moondream-2b-int4.mf.gz') # Initialize model
model = md.vl(model='./moondream-0_5b-int8.mf.gz') # Initialize model
picture = './img2.jpeg'
image = Image.open(picture)
encoded_image = model.encode_image(image)
query = "face"
detect_result = model... | Python | 1 |
;
std::fs::write("lexbin/all-NWL20.kwi", v_nwl20_bits)?;
std::fs::write("lexbin/all-TWL14.kwi", v_twl14_bits)?;
let english_alphabet = alphabet::make_english_alphabet();
let mut word_prob = prob::WordProbability::new(&english_alphabet);
let mut max_len = 0;
let mut tmp_v... | Rust | 0 |
Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn,
Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn,
Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn,
Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn,
Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::Mn, Gc::... | Rust | 0 |
v {
In(v) => {
ans += fwk.ask_prefix(v) as u64;
fwk.add(v, 1_u32);
},
Out(v) => fwk.sub(v, 1),
});
io.println(ans);
}
<reponame>jeremiah-corrado/fem_2d
use super::super::basis::{HierBasisFn, HierCurlBasisFn, HierCurlBasisFnSpace};
use super::{dof::basis_spec::Bas... | Rust | 0 |
(&web_root_dir)
.join("jbrowse")))
.register("/", catchers![not_found])
.manage(query_exec)
.manage(searcher)
.manage(static_file_state)
.manage(config)
}
<reponame>novoru/GBR<filename>src/core/pad.rs
use bitflags::*;
use crate::core::io::Io;
bi... | Rust | 0 |
n_id
)
# Decode the generated text
answer = tokenizer.decode(outputs[0], skip_special_tokens=True)
# Extract and return only the answer part
print(f"AI Tutor: {answer.split('Answer:')[-1].strip()}")
# Main program loop
def main():
while True:
print("\n1. Add a note")
print... | Python | 1 |
();
}
async fn unmeshed_hello_world(
server_settings: hyper::server::conn::Http,
mut client_settings: ClientBuilder,
) {
let _trace = support::trace_init();
let ep1 = SocketAddr::new([10, 0, 0, 41].into(), 5550);
let cfg = default_config();
// Build a mock "connector" that returns the upstream... | Rust | 0 |
'''
2 3 5 7 7 7
6 6 7 7 6 7
0 5 4 0 6 0
1 0 1 1 2 3
'''
arr = []
used = [False for _ in range(6)]
path = []
is_found_baby_gin = False
def is_baby_gin():
cnt = 0
# 앞에 세 자리가 triplet 또는 run 이라면 cnt += 1을 수행
a, b, c = path[0], path[1], path[2]
if a == b == c:
cnt += 1
elif a == (b - 1) == (c... | Python | 1 |
#[derive(Clone, shrinkwraprs::Shrinkwrap, derive_more::From)]
pub struct TestConductorHandle(pub(crate) ConductorHandle);
impl TestConductorHandle {
/// Opinionated app setup. Creates one app per agent, using the given DnaFiles.
///
/// All InstalledAppIds and AppRoleIds are auto-generated. In tests driven... | Rust | 0 |
let mut core = Core::new().unwrap();
let reactor = core.handle();
let h2 = Server::new(NewSvc, Default::default(), reactor.clone());
let addr = "[::1]:8888".parse().unwrap();
let bind = TcpListener::bind(&addr, &reactor).expect("bind");
let serve = bind.incoming()
.fold((h2, reactor),... | Rust | 0 |
for f in reinforce_files)
elapsed = now - mini_file_time
progress = 50.0 # Halfway point - completed REINFORCE, starting DQN
print(f"⏳ Estimated overall progress: {progress:.1f}% (Completed REINFORCE training, waiting for DQN)")
return
# If we have both, check most recent
... | Python | 1 |
"""Routers for the Raspberry Pi Camera plugin."""
import json
from fastapi import HTTPException, Query
from httpx import QueryParams
from pydantic import UUID4, ValidationError
from relab_rpi_cam_models.camera import CameraMode
from app.api.auth.dependencies import CurrentActiveUserDep
from app.api.common.routers.de... | Python | 1 |
import os
from celery import Celery
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'svcs.settings.prod')
celery = Celery('svcs')
celery.config_from_object('django.conf:settings', namespace='CELERY')
celery.autodiscover_tasks() | Python | 1 |
# Importing Important Libraies
import cv2
import numpy as np
import face_recognition
# Capturing video
live_capture = cv2.VideoCapture(0)
live_capture.set(cv2.CAP_PROP_FPS, 1080)
# Face encoding
img = cv2.imread("test-images/Einstein.jpg")
rgb_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
einstein_encoding = face_recog... | Python | 1 |
"balance_servers")]
pub balance_servers: Option<bool>,
/// Specifies the root of the tree in which to search identities.
#[serde(rename = "base_dn")]
pub base_dn: Option<String>,
/// Specifies the distinguished name for binding to the LDAP server.
#[serde(rename = "bind_dn")]
pub bind_dn: O... | Rust | 0 |
m_lookup(RomIndex::XIP_SFlash_Read_With_Lock))
};
romdriver_func(pFlashCfg, addr, dst, len)
}
/****************************************************************************/
/**
* Program flash one region with lock
*
* `pFlashCfg` - Flash config pointer
*
* `addr` - Start address to be programed
*
* `src... | Rust | 0 |
"required": ["points"]
}
}]
})
elif method == "tools/call":
tool_name = params.get("name")
tool_args = params.get("arguments", {})
if tool_name == "rhino_create_curve":
# Call the Rhino client to create a curve
try:
... | Python | 1 |
enerate_frame / 10 * pi)))
halo_number = int(3000 + 4000 * abs(self.curve(generate_frame / 10 * pi) ** 2))
all_points = []
# 生成光晕点
heart_halo_point = set()
for _ in range(halo_number):
t = random.uniform(0, 2 * pi)
x, y = self.heart_function(t, shrink_ra... | Python | 1 |
![
Widget::draw_svg(ctx, "system/assets/tools/layers.svg"),
"Delay".draw_text(ctx),
Btn::plaintext("X")
.build(ctx, "close", hotkey(Key::Escape))
.align_right(),
]),
Checkbox::switch(ctx, "Compare before edit... | Rust | 0 |
maphore"]
#[doc = ""]
#[doc = " Imports an externally allocated synchronization object and returns"]
#[doc = " a handle to that in \\p extSem_out."]
#[doc = ""]
#[doc = " The properties of the handle being imported must be described in"]
#[doc = " \\p semHandleDesc. The ::cudaExternalSemaphoreHa... | Rust | 0 |
erialize))]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
#[derive(BinRead, Debug, SsbhWrite, Clone, Copy, Default)]
pub struct BoundingVolume {
pub min: Vector3,
pub max: Vector3,
}
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[cfg_attr(feature = "arbitrary", derive(arbit... | Rust | 0 |
from typing import List
class Solution:
def rob(self, nums: List[int]) -> int:
"""
- Idea: i번째 집까지의 최대 금액은 두 가지 중 더 큰 값으로 결정된다.
1. (i-2번째 집까지의 최대 금액) + i번째 집의 금액
2. (i-1번째 집까지의 최대 금액)
이를 이용해 동적 프로그래밍으로 각 집까지의 최대 금액을 계산한다.
다만, 맨 마지막 집과 첫번째 집이 이어진 사이클... | Python | 1 |
"""
1. Listas -> Es una colección de datos ordenadas y modificable, permite miembros duplicados.
2. Tuplas -> Es una colección de datos ordenadas e inmutables o inmodificables, permite miembros duplicados.
3. Conjuntos -> Es una colección de datos desordenada, no inexada y no modificable. Pero permite agregar nuevos el... | Python | 1 |
erate().filter(|&(i, e)| !e.is_unused());
for (i, e) in entries {
write!(f, " {:3X}: {:?}\n", i, e)?;
}
Ok(())
}
}<gh_stars>1-10
use border_tch_agent::{model::SubModel, util::OutDim};
use serde::{Deserialize, Serialize};
use tch::{nn, nn::Module, Device, Tensor};
#[allow(cl... | Rust | 0 |
_error_location.foo");
cmd.assert().failure().code(1).stdout(predicates::str::contains(
"ERROR: Undefined type: 'UndefinedType'
045 direct method oops: x
046 x::UndefinedType!
^^^^^^^^^^^^^ Undefined type: 'UndefinedType'
047 end",
));
Ok(())
}
#[test]
fn test_undefined_v... | Rust | 0 |
}
} else {
println!("(toolchain not installed)");
}
println!("");
Ok(())
}
fn show_default(cfg: &Cfg) -> Result<()> {
if let Some(toolchain) = try!(cfg.find_default()) {
println!("default toolchain: {}", toolchain.name());
println!("default location: {}", toolchain.... | Rust | 0 |
{
fs::remove_dir_all(&tmp_data)
.with_context(|| format!("removing {:?}", &tmp_data))?;
}
fs::create_dir_all(&tmp_data)
.with_context(|| format!("creating {:?}", &tmp_data))?;
let password = <PASSWORD>();
let script = bootstrap_script(database, user, &password);
ec... | Rust | 0 |
are viewed.
When a wxDynamicSashWindow is first shown, it will contain one child
view, a viewport for that child, and a pair of scrollbars to allow the
user to navigate the child view area. Next to each scrollbar is a small
tab. By clicking on either tab and dragging to the appropriate spot, a
user can split the vie... | Python | 1 |
# Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import frappe
from frappe.model.document import Document
class WorkflowState(Document):
# begin: auto-generated types
# This code is auto-generated. Do not modify anything in this block.
from typing import TYPE_CHECK... | Python | 1 |
et are equals.
// Unmap.
while size != 0 {
let mapping_address;
let mapping_length;
{
let meminfo = dstmem.query_memory(dst_addr);
mapping_address = meminfo.mapping().address();
mapping_length = meminfo.mapping().length();
}
let mapp... | Rust | 0 |
cred_offer = cred_offer.to_unqualified();
return serde_json::to_string(&cred_offer)
.map_err(|err| IndyError::from_msg(IndyErrorKind::InvalidState, format!("Cannot serialize Credential Offer: {:?}", err)));
}
if let Ok(proof_request) = ::serde_json::from_str::<ProofRequest>(&entity) {
... | Rust | 0 |
from solution import *
python
def test_is_prime():
assert is_prime(2) == True
assert is_prime(3) == True
assert is_prime(4) == False
assert is_prime(5) == True
assert is_prime(17) == True
assert is_prime(18) == False
assert is_prime(19) == True
assert is_prime(20) == False
assert is... | Python | 1 |
res:ty, $method:ident) => {
impl $imp<$res> for $res {
#[inline]
fn $method(&mut self, other: $res) {
// forward to mutref-ref
$imp::$method(self, &other)
}
}
}
}
/// A big decimal type.
///
#[derive(Clone, Debug, Eq)]
pub struct B... | Rust | 0 |
<a href="https://github.com/richardanaya/lit-html-rs/blob/master/examples/todo_list/src/lib.rs">here</a></p>
</footer>
"##,
&data
)
}
// this component renders a todo list item
fn todo_item(pos: usize, todo: &Todo) -> Template {
// again, its just rendering a template
let mut data = Te... | Rust | 0 |
#!/usr/bin/env python
# encoding: utf-8
import argparse
import torch
from torch.autograd import Variable
import numpy as np
import time, math, glob
import cv2
import os
from PIL import Image
import torchvision
from sewar.full_ref import psnr
from sewar.full_ref import ssim
from utils.log import Log
from torchvision im... | Python | 1 |
def solve(n, a):
stk = [[], []]
left = [[-1, -1] for _ in range(n)]
right = [[n, n] for _ in range(n)]
for i in range(n):
for j in range(1, -1, -1):
tmp = []
while stk[j] and a[i] < a[stk[j][-1]]:
if j == 0:
tmp.append(stk[j][-1])
... | Python | 1 |
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
# SPDX-License-Identifier: MIT
""" Calibrate the magnetometer and print out the hard-iron calibrations """
import time
import board
import busio
import adafruit_lis2mdl
i2c = busio.I2C(board.SCL, board.SDA)
magnetometer = adafruit_lis2mdl.LIS2MDL(i2c)
#... | Python | 1 |
re
OverseerFactory: FnOnce(TestSubsystemContextHandle<M>) -> Overseer,
Overseer: Future<Output = ()>,
TestFactory: FnOnce(TestSubsystemContext<M, TaskExecutor>) -> Test,
Test: Future<Output = ()>,
{
let pool = TaskExecutor::new();
let (context, handle) = make_subsystem_context(pool);
let overseer = overseer_fact... | Rust | 0 |
g<u32, _GMAC_ORHI>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _GMAC_ORHI;
#[doc = "`read()` method returns [gmac_orhi::R](gmac_orhi::R) reader structure"]
impl crate::Readable for GMAC_ORHI {}
#[doc = "Octets Received High Received Register"]
pub mod gmac_orhi;
#[doc = "Frames Received Register\n\nThis register ... | Rust | 0 |
return ir.IntegerAttr.get(ir.IntegerType.get_signless(64), i)
def ui64_attr(i):
return ir.IntegerAttr.get(ir.IntegerType.get_unsigned(64), i)
def f32_attr(i):
return ir.FloatAttr.get(ir.F32Type.get(), i)
def bool_attr(i):
return ir.BoolAttr.get(i)
def precision_attr(lhs_prec, rhs_prec) -> ir.Array... | Python | 1 |
lone(),
task_nr,
failed: true,
}).unwrap();
return;
}
Some(image) => image,
};
eprintln!("TRACE: guppybot: worker: load manifest...");
let mut image_manifest = match ImageManifest::load(&shared.sysroot, &shared.root_manifest) {
Err(_) => {
loopback_s.send(LoopbackMs... | Rust | 0 |
[macro_export]
macro_rules! embed_info_plist_bytes {
($bytes:expr) => {
// The wildcard `_` prevents polluting the call site with identifiers.
const _: () = {
// Because `len` is a `const fn`, we can use it to turn `SLICE` into
// an array that gets directly embedded. This is... | Rust | 0 |
_use_local_cache: bool,
) -> RawResult {
let root_type_ids = root_type_ids.to_vec();
let ignore_patterns = ignore_patterns_buf
.to_strings()
.unwrap_or_else(|e| panic!("Failed to decode ignore patterns as UTF8: {:?}", e));
let types = Types {
construct_directory_digest: construct_directory_digest,
... | Rust | 0 |
labels": {"prometheus": "true"},
"taints": [
{
"key": "prometheus",
"value": "true",
"effect": "NoSchedule",
},
],
}
prometheus_nodegroup = merge_override(prometheus_nodegroup, prometheus_settings)
worker_nodegroups = g... | Python | 1 |
map_err(Error::FdtIoError)?;
property(fdt, "rng-seed", &rng_seed_bytes)?;
if let Some((initrd_addr, initrd_size)) = initrd {
let initrd_start = initrd_addr.offset() as u32;
let initrd_end = initrd_start + initrd_size as u32;
property_u32(fdt, "linux,initrd-start", initrd_start)?;
... | Rust | 0 |
from fastapi import APIRouter, Depends, HTTPException
from sqlalchemy.orm import Session
from typing import List
from app.schemas.orderhistorydetails import OrderHistoryDetailsCreate, OrderHistoryDetailsUpdate, OrderHistoryDetailsInDB
from app.crud.orderhistorydetails import (
get_orderhistorydetailss, get_orderhi... | Python | 1 |
wasm32"))]
mod desktop;
#[cfg(target_arch="wasm32")]
mod wasm;
#[cfg(not(target_arch="wasm32"))]
pub use self::desktop::*;
#[cfg(target_arch="wasm32")]
pub use self::wasm::*;
<reponame>microwavedcola1/mango_risk_check<gh_stars>0
mod errors;
use std::{cmp};
use anchor_lang::{prelude::*};
use mango::state::{MangoAccou... | Rust | 0 |
{
jsnp.mask = (jsnp.mask & !FREQ_ALLELE_FLAGS) | ( IN_OBSERVATION | FREQ_ALLELES_OK);
j += 1 + handle_json_tokens(jtxt, &jtok[j + 2..], jsnp, level + 1);
if (jsnp.mask & (FREQ_ALLELE_FLAGS | FREQ_ALLELES_OK)) != (FREQ_ALLELE_FLAGS | FREQ_ALLELES_OK) {
jsnp.mask &= !(FREQ_ALLELE_... | Rust | 0 |
path_suffix=args.target_suffix,
sync=args.sync,
)
elif command == "set-ttl":
_set_ttl(
configs.iterate_configs(source=args.source),
path_suffix=args.target_suffix,
ttl_str=args.ttl,
)
elif command == "batch-delete":
_batch_delet... | Python | 1 |
from ...symbols import ORTH
from ...util import update_exc
from ..tokenizer_exceptions import BASE_EXCEPTIONS
_exc = {
"all'art.": [{ORTH: "all'"}, {ORTH: "art."}],
"dall'art.": [{ORTH: "dall'"}, {ORTH: "art."}],
"dell'art.": [{ORTH: "dell'"}, {ORTH: "art."}],
"L'art.": [{ORTH: "L'"}, {ORTH: "art."}],
... | Python | 1 |
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: three*three
0
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: four = Z9(4)
sage: four.is_unit()
True
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: g = four^-1; g
7
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: four*g
1
~~~~~~~~~~~~~~~~~~~~~~ ::
sage: I1 = ZZ.ideal(4)
sage: I2 = ... | Python | 1 |
████╗ ██║██╔════╝
// █████╗ ███████║██║██║ ██║██╔██╗ ██║██║ ███╗
// ██╔══╝ ██╔══██║██║██║ ██║██║╚██╗██║██║ ██║
// ██║ ██║ ██║██║███████╗██║██║ ╚████║╚██████╔╝
// ╚═╝ ╚═╝ ╚═╝╚═╝╚══════╝╚═╝╚═╝ ╚═══╝ ╚═════╝
#[cfg(test)]
mod failing {
use crate::url;
#[test]
fn just_word_data() {... | Rust | 0 |
_PANSCAN: AVFrameSideDataType = 0;
pub const AVFrameSideDataType_AV_FRAME_DATA_A53_CC: AVFrameSideDataType = 1;
pub const AVFrameSideDataType_AV_FRAME_DATA_STEREO3D: AVFrameSideDataType = 2;
pub const AVFrameSideDataType_AV_FRAME_DATA_MATRIXENCODING: AVFrameSideDataType = 3;
pub const AVFrameSideDataType_AV_FRAME_DATA_... | Rust | 0 |
"]
_1,
}
impl PENDSTSETR {
#[doc = r" Returns `true` if the bit is clear (0)"]
#[inline]
pub fn bit_is_clear(&self) -> bool {
!self.bit()
}
#[doc = r" Returns `true` if the bit is set (1)"]
#[inline]
pub fn bit_is_set(&self) -> bool {
self.bit()
}
#[doc = r" Value... | Rust | 0 |
tream {
// this macro is exported from the context module
let path = parse_macro_input!(items as ContextItems);
context::generate_context(path).into()
}
/// Adds the default type for the last parameter (assumed to be runtime) for a specific feature.
///
/// e.g. To default the runtime generic to type `crate::Wry... | Rust | 0 |
string(),
disk_number: None,
title: "".to_string(),
track_number: 2
})
),
Ordering::Less
);
assert_eq!(
MusicMetadata::sort_func(
&Some(MusicMetadata {
albu... | Rust | 0 |
0xa8,
0x01, 0x0f, 0xc0, 0xb8, 0x09, 0x6a,
],
&[
0x45, 0x20, 0x00, 0x74, 0x5b, 0x6e, 0x40, 0x00, 0x37, 0x06, 0x5c, 0x1c, 0xc0, 0xb8,
0x09, 0x6a, 0xc0, 0xa8, 0x01, 0x0f,
],
&[
0x45, 0x20, 0x02, 0x8f, 0x00, 0x00, 0x40, 0x00, 0x3b, 0x11, 0xc9,... | Rust | 0 |
T8xu32, u32, u32, u32, u32, u32, u32, u32, u32
}
named_struct! {
N2<T>, x: T, y: T
N3<T>, x: T, y: T, z: T
N4<T>, x: T, y: T, z: T, w: T
N8<T>, x: T, y: T, z: T, w: T, a: T, b: T, c: T, d: T
}
named_struct! {
N2xf32, x: f32, y: f32
N3xf32, x: f32, y: f32, z: f32
N4xf32, x: f32, y: f32,... | Rust | 0 |
# Copyright (c) 2019-2022, NVIDIA CORPORATION.
#
# 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 required by applicable law or agre... | Python | 1 |
<u8>>,
) -> AsyncResult<Result<ReqwestResponse, u32>> {
let url = url.to_string();
let method = method.to_string();
let (tx, rx) = mpsc::channel(1);
self.pool.spawn_shared(Box::new(move || {
Box::pin(async move {
let resp = match crate::common::fetch(url.... | Rust | 0 |
ufp.ws_msg(mock_msg)
await hass.async_block_till_done()
state = hass.states.get("lock.test_lock_lock")
assert state
assert state.state == STATE_JAMMED
async def test_lock_unavailable(
hass: HomeAssistant,
ufp: MockUFPFixture,
doorlock: Doorlock,
unadopted_doorlock: Doorlock,
) -> N... | Python | 1 |
__version__ = '2.1.0' | Python | 1 |
OOL, DWORD, LPDWORD, UINT, ULONG};
use winapi::um::winnt::{
EXCEPTION_POINTERS, LONG, LPCSTR, LPCWSTR, PCONTEXT, PEXCEPTION_RECORD,
PVECTORED_EXCEPTION_HANDLER, PVOID,
};
use winapi::um::errhandlingapi::LPTOP_LEVEL_EXCEPTION_FILTER;
use crate::get_k32_fn;
pub fn RaiseException() -> Option<unsafe fn(
dwExc... | Rust | 0 |
bmesh """
# note: neither are linked to the scene, yet, so they won't show in the 3d view
m = bpy.data.meshes.new(name + "_mesh")
obj = bpy.data.objects.new(name, m)
link_object(obj) # link new object to scene
select(obj, active=True) # select new object and make active (does not deselect... | Python | 1 |
original: attr,
system: lit_system.expect("system should not be None"),
code: lit_code.expect("code should not be None"),
message: lit_message.expect("message should not be None"),
status_code: lit_status_code.expect("status_code should not be None"),
pvlost: ... | Rust | 0 |
;
value |= ((b as u64) & 0x7f) << offset;
if (b as u64) & 0x80 == 0 {
break;
}
offset += 7;
}
quantities.push(value);
}
let payload = Payload {
quantities,
metadata: Decod... | Rust | 0 |
("1927409816240961209460912649124", 10);
// let curve = Curve::new(&secret.unwrap(), poly.order());
// // Act
// let commitment = poly.commit(&curve.g1_points);
// // Assert
// let expected = "1 247780065747839628049691073771231187677611938202347902348182416625181886130102660070443863586625364010467... | Rust | 0 |
monitor that calls 'callback' when QEMU prints a line
matching 'regexp'."""
def setup_call_on_line(runner):
buf = bytearray()
def handle_output(output):
buf.extend(output)
while b"\n" in buf:
line, buf[:] = buf.split(b"\n", 1)
line = line.... | Python | 1 |
on(check_multiple_streams(receiver, server_address));
exit.store(true, Ordering::Relaxed);
t.join().unwrap();
}
#[test]
fn test_quic_server_multiple_writes() {
solana_logger::setup();
let (t, exit, receiver, server_address) = setup_quic_server();
let runtime = rt();... | Rust | 0 |
query = st.text_input("Ask News?") | Python | 1 |
T: Message,
F: FnMut(T) + Sized + 'static,
{
let subscription = Arc::new(Subscription::<T>::new(self, topic, qos, callback)?);
self.subscriptions
.push(Arc::downgrade(&subscription) as Weak<dyn SubscriptionBase>);
Ok(subscription)
}
/// Returns the subscrip... | Rust | 0 |
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. 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://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | Python | 1 |
"< \\internal Force type int32_t."]
pub const ovrTextureFormat__OVR_FORMAT_ENUMSIZE: ovrTextureFormat_ = 2147483647;
#[doc = " The format of a texture."]
#[doc = ""]
#[doc = " \\see ovrTextureSwapChainDesc"]
#[doc = ""]
pub type ovrTextureFormat_ = i32;
pub use self::ovrTextureFormat_ as ovrTextureFormat;
pub const ov... | Rust | 0 |
text file to be included
* services.include = array of services to include in the dmfs image from the services directory
* service.<name>.path = location of the service's source code directory (required)
* service.<name>.description = description of what this service does (required)
* service.<name>.properties = ar... | Rust | 0 |
),
),
],
);
must_have_same_count_msg(5, &t.msg_rx);
}
#[test]
fn test_basic_flow() {
let path = Builder::new().prefix("async-io-basic").tempdir().unwrap();
let engines = new_temp_engine(&path);
let mut cfg = Config::default();
cfg.store_io_pool_size = 2;
let mut t = Tes... | Rust | 0 |
use std::error::Error;
mod colors;
mod config;
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let res = reqwest::get(config::url)
.await?
.text()
.await?;
println!("{green}[RESPONSE]:{reset} {:#?}",
res,
green = colors::green,
rese... | Rust | 0 |
ct RegisterBlock {
#[doc = "0x00 - Interrupt Enable Clear"]
pub intenclr: INTENCLR,
#[doc = "0x04 - Interrupt Enable Set"]
pub intenset: INTENSET,
#[doc = "0x08 - Interrupt Flag Status and Clear"]
pub intflag: INTFLAG,
#[doc = "0x0c - Power and Clocks Status"]
pub status: STATUS,
#[d... | Rust | 0 |
import numpy as np
class ImagePreproc(object):
'''Class to handle common image preprocessing (center crops or
random crops with random flips).
'''
def __init__(self):
self.buf = None
def get_buffer(self, shape, dtype):
if self.buf is None or self.buf.shape != shape or self.b... | Python | 1 |
R: AsRef<str>,
{
match reference.next() {
Some(next) if next.as_ref() == "content" => self.content.project_mut(reference),
Some(next) if next.as_ref() == "length" => self.length.project_mut(reference),
otherwise => Err(failed!(
target: Release,
... | Rust | 0 |
n_owner(_token_id: &[u8; 32], _owner: &Address) {}
#[cfg(target_arch = "wasm32")]
pub fn set_token_owner(token_id: &[u8; 32], owner: &Address) {
let storage_key = copy_into_storage_value(&calculate_token_hash(token_id));
let value: StorageValue = Raw::from(owner).to_bytes32().into();
ewasm_api::storage_stor... | Rust | 0 |
"/" => |a, b| a / b,
"%" => |a, b| a % b,
"&" => |a, b| a & b,
"|" => |a, b| a | b,
"^" => |a, b| a ^ b,
"<<" => |a, b| a << b,
">>" => |a, b| a >> b,
"<" => |a, b| Value::from(a < b),
">" => |a, b| Value::from(a > b),
">=" => |a, b| Value::from(a >= b),
"<=" => |a, b| Value::from(a <= b),
"==... | Rust | 0 |
chart.add_data(data, titles_from_data=True)
chart.set_categories(cats)
# Add chart to worksheet
ws.add_chart(chart, "G3")
def save_workbook(self, filename="Enron_Financial_Model.xlsx"):
"""Save the workbook to file"""
wb = self.create_workbook()
fi... | Python | 1 |
def sda_to_rgb(im_sda, I_0):
"""Transform input SDA image or matrix `im_sda` into RGB space. This
is the inverse of `rgb_to_sda` with respect to the first parameter
Parameters
----------
im_sda : array_like
Image (MxNx3) or matrix (3xN) of pixels
I_0 : float or array_like
Back... | Python | 1 |
import pandas as pd
from kbmod.work_unit import WorkUnit
from astropy.table import Table
from kbmod.run_search import SearchRunner
import numpy as np
import torch
import os
# os.environ['CUDA_VISIBLE_DEVICES'] = '1'
wu = WorkUnit.from_fits("/epyc/projects/kbmod/data/20210908_B1h_047_test_data/20210908_B1h_047.wu")
t... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.