text string | label_name string | labels int64 |
|---|---|---|
core::ffi::c_void;
pub type IWMPSyncDevice3 = *mut ::core::ffi::c_void;
pub type IWMPSyncServices = *mut ::core::ffi::c_void;
pub type IWMPTranscodePolicy = *mut ::core::ffi::c_void;
pub type IWMPUserEventSink = *mut ::core::ffi::c_void;
pub type IWMPVideoRenderConfig = *mut ::core::ffi::c_void;
pub type IWMPWindowMess... | Rust | 0 |
#!/usr/bin/env python
#
# -*- coding: iso-8859-15 -*-
#
# Copyright 2003-2015 CORE Security Technologies
#
# 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/L... | Python | 1 |
, Reply, ReplyOn, Response, StdError, StdResult, SubMsg, Uint128};
use valkyrie::common::{ContractResult, Execution, ExecutionMsg};
use valkyrie::errors::ContractError;
use valkyrie::governance::enumerations::{PollStatus, VoteOption};
use valkyrie::governance::execute_msgs::{ExecuteMsg, PollConfigInitMsg};
use valkyri... | Rust | 0 |
from abc import abstractmethod
from typing import Optional, List, Literal
from pydantic import ConfigDict, model_validator, Field
from swarmauri_core.image_gens.IGenImage import IGenImage
from swarmauri_base.ComponentBase import ComponentBase, ResourceTypes
@ComponentBase.register_model()
class ImageGenBase(IGenImag... | Python | 1 |
xt):
path = context.fetch_resource("source.xlsx", context.data_url)
context.export_resource(path, XLSX, title=context.SOURCE_TITLE)
workbook: Workbook = openpyxl.load_workbook(path, read_only=True)
has_listing = False
for sheet in workbook.worksheets:
headers: Optional[List[Optional[str]]] =... | Python | 1 |
Pattern::new(applier),
)
.unwrap()
}
// If the condition of a ternary operator is `false` then we can just inline the false clause.
//
// false ? yeh : nah
// 👉 nah
//
fn rewrite_ternary_with_static_false_condition() -> Rewrite {
let true_clause_var = Var::from_str("?true").unwrap();
let fal... | Rust | 0 |
b).")
except Exception as e:
print(f"ERROR: Failed to load sentiment model from {model_name_or_path}: {e}")
self.tokenizer = None
self.model = None
if not model_loaded:
print("CRITICAL: SentimentAnalyzer could not load any model. Check pat... | Python | 1 |
Tensor is transparent, which makes this impl safe for T: bytemuck::Zeroable types.
unsafe impl<T: bytemuck::Zeroable> bytemuck::Zeroable for Tensor<T> {}
// The following type aliases are useful for disambiguating between the `new` constructors without
// having to spell out the entire type.
pub type UTensor<S, N> = ... | Rust | 0 |
pass
return values, mask
@_datetimelike_compat
def _backfill_2d(values, limit=None, mask: npt.NDArray[np.bool_] | None = None):
mask = _fillna_prep(values, mask)
if np.all(values.shape):
algos.backfill_2d_inplace(values, mask, limit=limit)
else:
# for test coverage
pass
... | Python | 1 |
from typing import Any, Dict
import pytest
from fastapi import Depends, FastAPI
from pydantic import SecretStr
from starlette.status import HTTP_200_OK, HTTP_401_UNAUTHORIZED
from starlette.testclient import TestClient
from labtasker.api_models import QueueCreateRequest
from labtasker.security import get_auth_headers... | Python | 1 |
"""empty message
Revision ID: d6fd509d2552
Revises: fff1ed89a635
Create Date: 2025-01-27 23:46:46.371886
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd6fd509d2552'
down_revision = 'fff1ed89a635'
branch_labels = None
depends_on = None
def upgrade() -> None... | Python | 1 |
# Copyright 2016-2023 Blue Marble Analytics LLC.
#
# 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 ag... | Python | 1 |
ron::modifiers::Header;
use time::{precise_time_ns, precise_time_s, now_utc};
use maud::{DOCTYPE, PreEscaped};
use rand::Rng;
use hyper::client::Client;
use hyper::header::ContentType;
struct Router {
routes: HashMap<String, Box<Handler>>
}
struct ResponseTime;
impl typemap::Key for ResponseTime { type Value = u... | Rust | 0 |
e", "usage", "protection"]
props_to_integer = ["offset", "size"]
class SvdWriteConstraint(SvdElement):
props = ["writeAsRead", "useEnumeratedValues"]
props_to_boolean = ["writeAsRead", "useEnumeratedValues"]
def from_element(self, element, defaults={}):
SvdElement.from_element(self, element, ... | Python | 1 |
field_len: Option<u16>,
pub extra_field: Vec<ExtraField>,
pub file_name: Option<Vec<u8>>,
pub comment: Option<Vec<u8>>,
pub crc16: Option<u16>,
}
pub const DEFLATE: u8 = 8;
pub const FLAG_FTEXT: u8 = 1;
pub const FLAG_FHCRC: u8 = 2;
pub const FLAG_FEXTRA: u8 = 4;
pub const FLAG_FNAME: u8 = 8;
pub const... | Rust | 0 |
rcConfig {
nickname: Some(self.nickname.clone()),
nick_password: Some(self.password.clone()),
server: Some("chat.freenode.net".to_owned()),
port: Some(6697),
use_ssl: Some(true),
should_ghost: Some(true),
user_info: Some("a bot by Grah... | Rust | 0 |
}B(2)",
"{Normal}B(3)",
"{TRAILING}",
"{Normal}T(1)",
"{Normal}T(2)",
]);
}
#[test]
fn with_just_enough_height_for_all_lines_with_title() {
let mut view_data = create_view_data(2, 3, 2);
view_data.update_view_data(|updater| updater.set_show_title(true));
let render_slice = create_render_slice(100, 8, &view... | Rust | 0 |
rc: SaiSrc::Pll1Q,
sai23_src: SaiSrc::Pll1Q,
dfsdm1_src: DfsdmSrc::Pclk2,
}
}
}
#[cfg(not(feature = "h7b3"))]
impl Clocks {
/// Full speed of 480Mhz, with VC0 range 0. Note that special consideration needs to be taken
/// when using low power modes (ie anything with wfe or w... | Rust | 0 |
x82\x01YR U\xd1a\x8c\xbeO?$\x035b\
\xce\x0f\xdb0C&\x9c\x00\x02u%\xcc\xe4c0\x8e\
\x03\xa1\xa0.\xde9\x10$\xd5\x85\x90\xe0hW'y\
MIE\xca#+\xa2\xa3\x8e\xab\x1aj&\x9d\x9c8\
\x10\xc1\x93\xc7\x9a\x80\x0c\x07\xe0\x9e\xf4\x85\xb3s\xa3\x16\
\xfd\x9b9z\xe9\x9fL\x16\x00n\x5c\xfa\xbf\xd6\x98\xe5\
\x7f\xab\x8f\x9a{\xffYAK\xba\xa9\xe8... | Python | 1 |
-> &Self::Target {
&self.0
}
}
#[doc = "Field `rcdc` writer - Read Command Dummy Cycles"]
pub struct RCDC_W<'a> {
w: &'a mut W,
}
impl<'a> RCDC_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w... | Rust | 0 |
result = checker.check(layer, [input_blob, target_blob], [],
check_indices = [0])
print(result)
self.assertTrue(result[0])
# also, check if weight works.
self._testWeight(layer, [input_blob, target_blob])
# check full input
target... | Python | 1 |
block_num: 1234,
data: DataBytes(BYTE_DATA),
len: 512,
}
);
packet!(
err,
Packet::ERROR {
code: ErrorCode::NoUser,
msg: "This is a message".to_string(),
}
);
use gdnative::prelude::*;
extern crate rand;
mod ball;
mod paddle;
mod utils;
use self::{ball::Ball, pa... | Rust | 0 |
: Option<String>,
}
impl Me {
pub fn find_from_token(token: &str) -> FieldResult<Self> {
let client = get_client!();
let response = client
.get(api_path!("/users/@me"))
.header(make_auth!(token))
.send()?
.json::<MeInfo>()?;
Ok(Me {
... | Rust | 0 |
Ext::token(None, TargetWindowToken::Start);
/// ```
///
/// [`TargetWindowExt`]: enum.TargetWindowExt.html
/// [`TargetWindowToken`]: enum.TargetWindowToken.html
pub fn token(session: Option<&'a TargetSession<'a>>, token: TargetWindowToken) -> Self {
TargetWindowExt {
session,
... | Rust | 0 |
#!/usr/bin/env python
"""
================================================
AB Electronics UK IO Pi Tests | set_pin_pullup
Requires python smbus to be installed
For Python 2 install with: sudo apt-get install python-smbus
For Python 3 install with: sudo apt-get install python3-smbus
run with: python3 set_pin_pullup.p... | Python | 1 |
eldBytes::from_slice(&compact_bytes[33..65]));
let sig = SecpSignature::from_scalars(r, s)?;
Ok(Signature { sig, recovery_i: i })
}
}
#[wasm_bindgen]
impl Signature {
#[wasm_bindgen(js_name = toHex)]
pub fn to_hex(&self) -> String {
let bytes = self.sig.to_der();
hex::enc... | Rust | 0 |
###);
let stdout = test_env.jj_cmd_success(&repo_path, &["log", "-T", template]);
insta::assert_snapshot!(stdout, @r###"
@ e7a40106bee6 c
o 05d951646873 b
o 0c5ddc685260 a
o 000000000000
"###);
let stdout = test_env.jj_cmd_success(&repo_path, &["print", "file1", "-r", "a"]);
insta::... | Rust | 0 |
t RTC_MR_SPEC;
impl crate::RegisterSpec for RTC_MR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [rtc_mr::R](R) reader structure"]
impl crate::Readable for RTC_MR_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [rtc_mr::W](W) writer structure"]
impl crate::Writable for RTC_MR_SPEC {
... | Rust | 0 |
m=tile_um,
stride_div=stride_div,
verbose=False,
use_edge_tiles=True,
roi_method='ignore',
roi_filter_method=wsi.roi_filter_method
)
return qc_wsi, mpp
def __call__(
self,
wsi: "sf.WSI",
mask: Optional[np.ndarray] =... | Python | 1 |
T>, DynStack<'a>) {
self.make_aligned_with(size, core::mem::align_of::<T>(), f)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn empty() {
let mut buf = uninit_mem_in_global(StackReq::new::<i32>(0));
let stack = DynStack::new(&mut buf);
let (_arr0, _stack) = stack... | Rust | 0 |
) -> Color {
self.color
}
}
pub struct CheckerTexture {
pub odd: Box<Texture>,
pub even: Box<Texture>
}
impl Texture for CheckerTexture {
fn value(&self, p: &V3) -> Color {
let sines = f32::sin(10.0*p.x)
* f32::sin(10.0*p.y)
* f32::sin(10.0*p.z);
if sine... | Rust | 0 |
f raw_terminal() -> t.Iterator[int]:
f: t.Optional[t.TextIO]
fd: int
if not isatty(sys.stdin):
f = open("/dev/tty")
fd = f.fileno()
else:
fd = sys.stdin.fileno()
f = None
try:
old_settings = termios.tcgetattr(fd)
... | Python | 1 |
x = block(x)
>>> x.shape
torch.Size([10, 100, 64])
"""
def __init__(
self,
num_layers,
d_model,
nhead,
d_ffn=2048,
input_shape=None,
kdim=None,
vdim=None,
dropout=0.1,
activation="swish",
kernel_size=31,
bi... | Python | 1 |
2img, reference_points).squeeze(-1)
eps = 1e-5
mask = reference_points_cam[..., 2:3] > eps
reference_points_cam = reference_points_cam[..., 0:2] / torch.clamp_min(reference_points_cam[..., 2:3], eps)
reference_points_cam[..., 0] /= img_shape[1]
reference_points_cam[..., 1] /= img_shape[0]
refer... | Python | 1 |
# ==============================================================================
# Copyright 2019 - Philip Paquette
#
# NOTICE: Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the "Software"),
# to deal in the Software without rest... | Python | 1 |
encode_node()?);
}
Ok(base)
}
}
<gh_stars>0
use std::fmt;
use super::{error::PolarError, sources::Context, warning::PolarWarning};
#[derive(Debug)]
pub enum Diagnostic {
Error(PolarError),
Warning(PolarWarning),
}
impl From<PolarError> for Diagnostic {
fn from(err: PolarError) -> Sel... | Rust | 0 |
print("=" * 60)
print("\n📋 TASK COMPLETION STATUS:")
print("✓ 3.3.1 - Implement encryption/decryption utilities (crypto_utils.py)")
print("✓ 3.3.2 - Create secure key generation and management (key_manager.py)")
print("✓ 3.3.3 - Implement secure API key storage (secure_storage.py)")
print(... | Python | 1 |
usize = 1;
const PART_BAR_DONE: usize = 2;
const PART_BAR_UNDONE: usize = 3;
const PART_DONE: usize = 4;
const PART_TOTAL: usize = 5;
const PART_PERCENT: usize = 6;
const PART_DOING: usize = 7;
/// # Misc Variables.
const MIN_BARS_WIDTH: u8 = 10;
const MIN_DRAW_WIDTH: u8 = 40;
// This translates to: • • ... | Rust | 0 |
.z },
))
}
}
#[cfg(test)]
mod tests {
use crate::unit_test_data::{test_point_in, test_point_out};
#[test]
fn test_point_to_string() {
assert_eq!(test_point_out().to_string(), test_point_in())
}
}
<reponame>hugefiver/orbtk
// Layout specific properties.
pub use self::block::*;
pub ... | Rust | 0 |
blocking": 0,
"forwarding": 2,
"learning": 0,
"listening": 0,
"stp_active": 2,
},
"VLAN1125": {
"blocking": 0,
"forwarding": 1,
"learning": 0,
"listening": 0,
... | Python | 1 |
.object(object_number) {
None => UNIX_EPOCH,
Some(obj) => match OffsetDateTime::from_unix_timestamp(obj.acquisition_end() as i64) {
Ok(time) => time.into(),
Err(_) => UNIX_EPOCH,
}
};
let file_attr = FileAttr... | Rust | 0 |
Img2ImgOutpaintingResponse. # noqa: E501
:rtype: int
"""
return self._status
@status.setter
def status(self, status):
"""Sets the status of this Img2ImgOutpaintingResponse.
:param status: The status of this Img2ImgOutpaintingResponse. # noqa: E501
:type: int... | Python | 1 |
, channel, protocol);
let peer_id = device_id.parse().expect("peer ids from profile should parse");
// The remote peer connected to us, `initiate_streaming` = false.
handle_connection(
&peer_id,
channel,
false,
&mut peer... | Rust | 0 |
: 0.0,
minx: 0.0,
maxx: 0.0
}, ..3];
let mut glyphs: [NVGglyphPosition, ..100] = [NVGglyphPosition{
_str: ptr::null(),
x: 0.0,
minx: 0.0,
maxx: 0.0
}, ..100];
let text = "This is longer chunk of text.\n \n Would have used lorem ipsum but she was busy jumping over the laz... | Rust | 0 |
unsafe { &(*(::std::ptr::null::<snd_seq_event>())).data as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(snd_seq_event),
"::",
stringify!(data)
)
);
}
pub type snd_seq_event_t = snd_seq_event;
#[repr(C)]
#[derive(D... | Rust | 0 |
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.routers import webhook
app = FastAPI()
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(webhook.router)
@app.get(... | Python | 1 |
self.write_msg(Request::new_with_data(
OpCode::KeymapDataEnd,
[OpCode::KeymapDataEnd as u8; 61],
))?;
Ok(())
}
}
#[derive(PackedStruct)]
#[packed_struct(endian = "msb")]
pub struct Request {
_id: u8,
op: u16,
data: [u8; 61],
}
impl Request {
pub fn new(op: ... | Rust | 0 |
: std::path::PathBuf,
}
fn main() {
eprintln!("This is an error! :(");
let args = Cli::from_args();
println!("======= args =======");
println!("{:#?}", args);
// Option 1.
let result = read_line(&args.path);
match result {
Ok(content) => {
// println!("file content: {:?}... | Rust | 0 |
.mqttSlot_Send) # 信号连接槽函数
ui.setupUi(MainWindow) # 绘制界面
exQthread = ExQThread() # 线程实例
exQthread.weatherSignal.connect(ui.updateWeather) # 信号连接槽函数
exQthread.historySignal.connect(ui.upd... | Python | 1 |
let code = "
extern int f();
static int f();
";
assert_errs_decls(code, 1, 0, 2);
}
#[test]
fn enum_declaration() {
assert!(parse("enum;").unwrap().is_err());
assert!(parse("enum e;").unwrap().is_err());
assert!(parse("enum e {};").unwrap().i... | Rust | 0 |
= $fx.bcx.ins().fcmp(FloatCC::$cc, $lhs, $rhs);
CValue::ByVal($fx.bcx.ins().bint(types::I8, b), ret_layout)
}};
(@single $fx:expr, $bug_fmt:expr, $var:expr, $signed:expr, $lhs:expr, $rhs:expr, $ret_ty:expr, custom(|| $body:expr)) => {{
$body
}};
(@single $fx:expr, $bug_fmt:expr, $var:ex... | Rust | 0 |
::Fdflags,
) -> Result<(), Error> {
self.table()
.get_file_mut(u32::from(fd))?
.get_cap_mut(FileCaps::FDSTAT_SET_FLAGS)?
.set_fdflags(FdFlags::from(flags))
.await
}
async fn fd_fdstat_set_rights(
&mut self,
fd: types::Fd,
fs_ri... | Rust | 0 |
# Title : Numerical inversion of the Laplace transform for pricing Asian options
# The Geman and Yor model
#
# Numerical inversion is done by Talbot's method.
#
################################################################################
## Created by Fernando Damian Nieuwveldt ... | Python | 1 |
FromStr};
use tokio::sync::Mutex;
lazy_static! {
pub static ref SPOTIFY: Mutex<Result<ClientCredsSpotify, ParrotError>> =
Mutex::new(Err(ParrotError::Other("no auth attempts")));
pub static ref SPOTIFY_QUERY_REGEX: Regex =
Regex::new(r"spotify.com/(?P<media_type>.+)/(?P<media_id>.*?)(?:\?|$)").... | Rust | 0 |
import argparse
import fileinput
import sys
# Maximum value of a signed 32 bit integer (2**31 - 1).
MAX_CHROM_LEN = 2147483647
def stop_err(msg):
sys.exit(msg)
parser = argparse.ArgumentParser()
parser.add_argument('--input', dest='input', help="Input dataset")
parser.add_argument('--start_coordinate', dest=... | Python | 1 |
(end_x, end_y);
build_data.map.tiles[end_idx] = TileType::DownStairs;
build_data.map.populate_blocked();
if let Some(result) = a_star_search(
Point::new(starting_pos.x, starting_pos.y),
Point::new(end_x, end_y),
0.0,
&build_data.map,
) {
... | Rust | 0 |
.LinearDim9:
return "linear_dim_9"
raise ValueError("Unknown MappingId enum entry.")
@register_attribute_builder("MappingIdEnum")
def _mappingidenum(x, context):
return _ods_ir.IntegerAttr.get(_ods_ir.IntegerType.get_signless(64, context=context), int(x))
class Processor(IntEnum):
"""pro... | Python | 1 |
# Floats with 4 or fewer decimal places print normally
# Floats with 5 or more decimal places may switch to scientific notation
# Using print(f"{float}:f") uses default formatter which is 6 decimal points
# You can force decimal formatting with :f and precision
# / returns a float result & type
# // is same as math.flo... | Python | 1 |