text string | label_name string | labels int64 |
|---|---|---|
&self.last_access_time)
}
pub fn created_u64(&self) -> u64 {
to_u64(&self.creation_time)
}
pub fn volume_serial_number(&self) -> Option<u32> {
self.volume_serial_number
}
pub fn number_of_links(&self) -> Option<u32> {
self.number_of_links
}
pub fn file_index(&... | Rust | 0 |
um_jobs], check=True)
elif target == "py":
# Build vtk python binaries
subprocess.run(
[
"cmake",
"-S",
".",
"-B",
build_dir,
"-GNinja",
"-DCMAKE_BUILD_TYPE:STRING=" + cmake_c... | Python | 1 |
]
fn bench_add_two(b: &mut Bencher) {
b.iter(|| add_two(2));
}
}
/*
C:
float InvSqrt (float x)
{
float xhalf = 0.5f*x;
int i = *(int*)&x;
i = 0x5f375a86 - (i>>1);
x = *(float*)&i;
x = x*(1.5f-xhalf*x*x);
return x;
}
*/
use rbasic::lexer::*;
use rbasic::token::*;
#[test]
fn ... | Rust | 0 |
def mergesort(arr):
""" perform mergesort on a list of numbers
>>> mergesort([5, 4, 1, 6, 2, 3, 9, 7])
[1, 2, 3, 4, 5, 6, 7, 9]
>>> mergesort([3, 2, 4, 2, 1])
[1, 2, 2, 3, 4]
"""
n = len(arr)
if n <= 1: return arr
a1 = mergesort(arr[:n/2])
a2 = mergesort(arr[n/2:])
return ... | Python | 1 |
tions.shape[0] == _relation_predicates.shape[0]) # sanity check
# Get everything by image.
boxes = []
gt_classes = []
#gt_attributes = []
relationships = []
for i in range(len(image_index)):
i_obj_start = im_to_first_box[i]
i_obj_end = im_to_last_box[i]
i_rel_start = im... | Python | 1 |
import tkinter as Tkinter
from datetime import datetime
counter = 0
running = False
def counter_label(label):
def count():
if running:
global counter
# To manage the intial delay.
if counter == 0:
display = 'Ready!'
else:
tt = datetim... | Python | 1 |
ary_info(refresh_from_node, 1)?;
Ok(serde_json::to_string(&wallet_info).unwrap())
}
#[no_mangle]
pub unsafe extern "C" fn c_balance(
path: *mut StringPtr,
account: *mut StringPtr,
password: *mut StringPtr,
check_node_api_http_addr: *mut StringPtr,
refresh_from_node: bool,
error: *mut u8,
) ... | Rust | 0 |
atic_type());
assert_eq!(
from_str("Baz.X Bar.A")
.with_builtin_types(substs.clone())
.with_builtin_type("Bar".to_string(), Bar::static_type())
.static_type_annotation()
.parse::<Baz>()
.unwrap(),
Baz::X(Bar... | Rust | 0 |
't write to wc stdin: {}", why.description()),
Ok(_) => println!("sent pangram to wc"),
}
// 因为 `stdin` 在上面调用后就不再存活,所以它被销毁了,且管道被关闭。
//
// 这点非常重要,否则 `wc` 不会开始处理我们刚刚发送的输入。
// `stdout` 域也拥有 `Option<ChildStdout>` 类型,所以必需解包。
let mut s = String::new();
mat... | Rust | 0 |
import torch
from torch import nn
from torch_geometric.nn import Linear, HeteroConv, HeteroDictLinear, GraphConv
class GRF_HGNN(torch.nn.Module):
"""
The Ground Reaction Force Heterogeneous Graph Neural Network model.
"""
def __init__(self, hidden_channels: int, num_layers: int, data_metadata,
... | Python | 1 |
'''
Copyright (C) 2021 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This progra... | Python | 1 |
#!/opt/bin/lv_micropython -i
import lvgl as lv
import display_driver
def event_handler(e):
code = e.get_code()
obj = e.get_target()
if code == lv.EVENT.CLICKED:
print("Clicked: list1." + list1.get_btn_text(obj))
# Create a list
list1 = lv.list(lv.scr_act())
list1.set_size(180, 220)
list1.center... | Python | 1 |
self.acceptedChan.is_some()
}
}
#[derive(Clone)]
pub struct ConnectionedEndPointWeak(Weak<(QMutex<ConnectionedEndPointInternal>, QMutex<()>)>);
impl ConnectionedEndPointWeak {
pub fn Upgrade(&self) -> Option<ConnectionedEndPoint> {
let c = match self.0.upgrade() {
None => return None,
... | Rust | 0 |
else:
if len(to) == len(exc.recipients):
# We don't know which recipients were rejected, so the error message
# can't identify them
message = _("These email addresses are not valid")
else:
message = _("These email addresses... | Python | 1 |
import os
import signal
import sys
from django.conf import settings as main_settings
from django.core.management.base import BaseCommand
from django.core.management import call_command
#from opds_catalog.settings import SERVER_LOG, SERVER_PID
#from opds_cgit branchtalog import settings
from constance import config
c... | Python | 1 |
from fastmcp import FastMCP
import requests
# 初始化 FastMCP 服务器,指定名称和依赖库
mcp = FastMCP("weatherMcp", dependencies=["requests"])
@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
"""
获取个性化问候语
:param name: 用户名
:return: 问候字符串
"""
return f"Hello, {name}!"
@mcp.prompt()
def as... | Python | 1 |
a digested dictionary, ready to start decompression operation without startup delay."]
#[doc = " dictBuffer can be released after DDict creation, as its content is copied inside DDict."]
pub fn ZSTD_createDDict(
dictBuffer: *const ::core::ffi::c_void,
dictSize: usize,
) -> *mut ZSTD_DDict;... | Rust | 0 |
use crate::MkvId;
pub const kOpusCodecId: &'static str = "A_OPUS";
pub const kVorbisCodecId: &'static str = "A_VORBIS";
pub const kAv1CodecId: &'static str = "V_AV1";
pub const kVp8CodecId: &'static str = "V_VP8";
pub const kVp9CodecId: &'static str = "V_VP9";
pub const kWebVttCaptionsId: &'static str = "D_WEBVTT/CAPT... | Rust | 0 |
"""
RSS Feed 처리 모듈
이 패키지는 RSS 피드에서 정보를 수집하고 처리하는 기능을 제공합니다.
"""
from .rss_fetch import (
fetch_rss,
extract_article_data,
save_to_json,
process_rss_feed
)
__all__ = ['fetch_rss', 'extract_article_data', 'save_to_json', 'process_rss_feed'] | Python | 1 |
#Suppose you are located at the center of a cube. If you could look all around
#you in every direction, each wall of the cube would occupy 1/6 of your field of
#vision. Suppose you move toward one of the walls so that you are now half-way
#between it and the center of the cube.
#What fraction of your field of vision is... | Python | 1 |
arge Time", tot_time, "hrs")
print("Total Capacity", np.around(tot_cap, 3), "mAh")
specific_cap = np.around(tot_cap, 3) / vol_cm3
print("Total Capacity", specific_cap, "mAh.cm-3")
capacities.append(tot_cap)
specific_capacities.append(specific_cap)
fig, (ax1, ax2) = plt.subplots(2, 1, sharex=True)
a... | Python | 1 |
print("The source of the error is", source)
print("The error message is", text)
print("More info can be found in %s (id=%d)" % (helpFile, helpId))
def OnDisconnection(self, mode, custom):
print("OnDisconnection")
self.appHostApp.CommandBars("PythonBar").De... | Python | 1 |
# SPDX-License-Identifier: GPL-2.0-or-later
"""
Stderr built-in backend.
"""
__author__ = "Lluís Vilanova <vilanova@ac.upc.edu>"
__copyright__ = "Copyright 2012-2017, Lluís Vilanova <vilanova@ac.upc.edu>"
__license__ = "GPL version 2 or (at your option) any later version"
__maintainer__ = "Stefan Hajnoczi"
_... | Python | 1 |
ewer format with `unknown_2`?
let unknown_2 = cursor.read_u32::<LE>()?;
// rest of entry info
let item = ListItem { name, id, entry };
list.items.push(item);
}
Ok(list)
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_lst_bul() {
let d... | Rust | 0 |
s du locus
print(P4f3)
if bool2D:
fig=plt.figure()
plt.plot(f2v[:, 0], f2c[:, 0], 'b.')
plt.plot(f3v[:, 0], f3c[:, 0], 'b.')
plt.plot(f2v[:, 1], f2c[:, 1], 'g.')
plt.plot(f3v[:, 1], f3c[:, 1], 'g.')
plt.plot(f2v[:, 2], f2c[:, 2], 'r.')
plt.plot(f3v[:, 2],... | Python | 1 |
import ctypes
import errno
import os
import pytest
from pr2test.marks import require_root
from pyroute2 import NetNS
pytestmark = [require_root()]
def test_flags(context):
nsname = context.new_nsname
with pytest.raises(FileNotFoundError) as e:
NetNS(nsname, flags=0)
assert e.value.args[0] == er... | Python | 1 |
.field("offset", &self.offset)
.field("can_activate_pull", &self.can_activate_pull)
.field("can_activate_push", &self.can_activate_push)
.field("preroll_lock", &self.preroll_lock)
.field("preroll_cond", &self.preroll_cond)
.field("eos", &self.eos)
.field("n... | Rust | 0 |
lineno", "function", "env", "tag"];
let mut fields: Vec<String> = vec![];
for key in first_fields.iter() {
let k = key.to_string();
if m.contains_key(&k) {
fields.push(k);
}
}
for key in m.keys() {
if blacklisted_fields.contains(&key.as_str()) ||
... | Rust | 0 |
tobufValue)> {
match self.iter.next() {
Some((k, v)) => Some((k as &dyn ProtobufValue, v as &dyn ProtobufValue)),
None => None,
}
}
}
pub struct ReflectMapIter<'a> {
imp: Box<dyn ReflectMapIterTrait<'a> + 'a>,
}
impl<'a> Iterator for ReflectMapIter<'a> {
type Item =... | Rust | 0 |
.ssrc_context
.get_mut(&TEST_2_SRTP_SSRC)
.unwrap()
.protocol_specific
.highest_seq_num = 65534;
let mut rtp_reader = SrtpPacketReader::new(context, rfc3550::RtpPacketReader);
rtp_reader
.read_packet(&mut TEST_2_SRTP_PACKET_BEFORE_... | Rust | 0 |
"""
Configuration module for CV RAG Chatbot.
Contains all configuration constants and settings.
"""
import os
from dataclasses import dataclass, field
from typing import List, Dict, Optional
from dotenv import load_dotenv
# Load environment variables from .env file
load_dotenv()
@dataclass
class ModelConfig:
"""... | Python | 1 |
models.UniqueConstraint(
fields=["field_with_db_default"], name="unique_field_with_db_default"
).validate(ModelWithDatabaseDefault, ModelWithDatabaseDefault())
models.UniqueConstraint(
Upper("field_with_db_default"),
name="unique_field_with_db_default_express... | Python | 1 |
__syscall_ulong_t = ::libc::c_ulong;
pub type __loff_t = __off64_t;
pub type __caddr_t = *mut ::libc::c_char;
pub type __intptr_t = ::libc::c_long;
pub type __socklen_t = ::libc::c_uint;
pub type __sig_atomic_t = ::libc::c_int;
pub type int_least8_t = ::libc::c_schar;
pub type int_least16_t = ::libc::c_short;
pub type... | Rust | 0 |
lute():
ns.build = (Path.cwd() / ns.build).resolve()
if not ns.temp.is_absolute():
ns.temp = (Path.cwd() / ns.temp).resolve()
if not ns.doc_build.is_absolute():
ns.doc_build = (Path.cwd() / ns.doc_build).resolve()
if ns.include_cat and not ns.include_cat.is_absolute():
ns.inc... | Python | 1 |
slice of random length";
macro_rules! internal_mk_test {
($cstr:expr, $Type:ty, $SLICE:ident) => {{
let tag = View::<$Type>::try_from_slice($SLICE).unwrap();
let value: $Type = tag.unpack();
assert_eq!(value, $cstr);
let mut slice = [0; <$Type as Packed>::SIZE];
($cstr).un... | Rust | 0 |
)
# Create a mask of valid vocab ids (1 means it needs to be masked).
input_ids_mask = (x < vocab_start_index) | (x >= vocab_end_index)
x = x - vocab_start_index
x[input_ids_mask] = 0
embeddings = self.forward(x)
embeddings[input_ids_mask] = ... | Python | 1 |
VisibilityObjectId;
mod object_id;
pub use object_id::ObjectId;
mod visibility_resource;
pub use visibility_resource::VisibilityObjectInfo;
pub use visibility_resource::VisibilityResource;
mod visibility_config;
pub use visibility_config::VisibilityConfig;
use core;
#[repr(C)]
#[derive(Debug,Clone,Copy, PartialEq)]... | Rust | 0 |
: wlan_policy::SecurityType::Wpa2,
}),
credential: Some(wlan_policy::Credential::Psk([17; 32].to_vec())),
..wlan_policy::NetworkConfig::EMPTY
};
let result_cfg = wlan_policy::NetworkConfig::from(wpa_config);
assert_eq!(expected_cfg, result_cfg);
}
///... | Rust | 0 |
do work
for i in 0..cardinality {
let _ = input.row_ids_eq_roaring(Some(i.to_string()));
}
});
},
);
}
}
group.finish();
}
criterion_group!(
benches,
encoding_drle_row_ids... | Rust | 0 |
else:
failed_demos.append(use_case)
print(f"\n❌ Demo {i}/{len(DEMOS)} failed!")
print("=" * 80)
# Summary
print(f"\n🎯 ALL DEMOS SUMMARY")
print("=" * 50)
print(f"✅ Successful: {successful_demos}/{len(DEMOS)}")
print(f"❌ Failed: {len(failed_demos)}/{le... | Python | 1 |
cies[event.finding_id].update(
event.added_projects
)
elif t == SlackVulnerabilityEventType.DEP_REMOVED:
if event.finding_id not in scan_result_by_channel[event.channel_id].removed_dependencies:
scan_result_by_channel[event.channel_id].... | Python | 1 |
def _graceful(*_: int) -> None:
log.info("⏻ Shutdown requested — stopping …")
stop_event.set()
loop = asyncio.get_running_loop()
for sig in (signal.SIGINT, signal.SIGTERM):
with suppress(NotImplementedError):
loop.add_signal_handler(sig, _graceful)
await stop_eve... | Python | 1 |
finish();
}
}
array_1367.finish();
}
Ok(())
}
pub fn serialize_structure_crate_input_update_experiment_input(
object: &mut aws_smithy_json::serialize::JsonObjectWriter,
input: &crate::input::UpdateExperimentInput,
) -> Result<(), aws_smithy_http::operation::SerializationErro... | Rust | 0 |
ata_items*size, all padding is at
# the end). Padding is ignored, other than for encryption purposes.
# Implementations using encryption might want to include a time stamp
# or other data in the request packet padding. The key used for requests
# is implementation defined, but key 15 is suggested as a... | Python | 1 |
CoreOp {
assert!(zero_copy_buf.is_none()); // zero_copy_buf unused in compiler.
let mut s = ts_state.lock().unwrap();
dispatcher(&mut s, control)
}
}
pub struct TSIsolate {
isolate: Isolate,
state: Arc<Mutex<TSState>>,
}
impl TSIsolate {
fn new(bundle: bool) -> TSIsolate {
let mut isolate = I... | Rust | 0 |
# =============================================================================
# Minet Telegram Channel-Infos CLI Action
# =============================================================================
#
# Action retrieving the information of a Telegram channel.
#
from minet.cli.utils import with_enricher_and_loading_b... | Python | 1 |
from trading.writer.kafka_writer import KafkaWriter
from trading.writer.writer import Writer
from trading.model.kafka_key import KafkaKey
from trading.model.quote import Quote
class AlpacaQuoteKafka(Writer):
def __init__(self, producer_config: dict, topic: str) -> None:
self.producer = KafkaWriter(produce... | Python | 1 |
'TEST_VAR1': 'value1',
'TEST_VAR2': 'value2'
}
with patch.dict(os.environ, {}, clear=True):
tm = TaskManager(mock_settings)
assert os.environ.get('TEST_VAR1') == 'value1'
assert os.environ.get('TEST_VAR2') == 'value2'
c... | Python | 1 |
], (u8, HtpUnwanted, u64, bool)> + '_ {
move |remaining_input| {
let mut output = remaining_input;
let mut byte = b'%';
let mut flags = 0;
let mut expected_status_code = HtpUnwanted::IGNORE;
let (left, _) = tag_no_case("u")(remaining_input)?;
if cfg.u_encoding_decode ... | Rust | 0 |
# Ejercicio 3 (Puntaje: 30%)
# Codifica un programa que nos permita guardar los nombres de los
# alumnos de una clase y la nota final que han obtenido.
# El programa pedirá el número de alumnos que vamos a introducir.
# Al final el programa nos mostrará la lista de alumnos,
# la nota obtenida por cada uno de ellos y... | Python | 1 |
import pytest
import json
import pathlib
def load_descriptors():
return pathlib.Path("descriptors").glob("**/*.json")
def has_optional_with_default(obj):
"""Check if object contains optional inputs with default-value."""
if isinstance(obj, dict):
inputs = obj.get("inputs", [])
for input_... | Python | 1 |
if not trades:
return PeriodStats(
period=period_name,
start_date=start_date,
end_date=end_date,
total_trades=0,
winning_trades=0,
losing_trades=0,
winrate=0.0,
total_pnl=0.0,
... | Python | 1 |
ber>;
#[derive(Clone)]
pub struct BlockListReduce<FD, FS, D, T, B> {
source: B,
rebase: transform::Reduce,
reductor: Reductor,
reduce_all: ReduceAll<FD, FS, D, T>,
}
impl<FD, FS, D, T, B> BlockListReduce<FD, FS, D, T, B>
where
FD: File<Array>,
FS: File<Node>,
D: Dir,
D::File: AsType<FD... | Rust | 0 |
SOFF,
#[doc = "0x12c6 - TCD Transfer Attributes"]
pub tcd22_attr: TCD_ATTR,
#[doc = "0x12c8 - TCD Minor Byte Count (Minor Loop Mapping Disabled)"]
pub tcd22_nbytes_mlno: TCD_NBYTES_MLNO,
#[doc = "0x12cc - TCD Last Source Address Adjustment"]
pub tcd22_slast: TCD_SLAST,
#[doc = "0x12d0 - TCD ... | Rust | 0 |
LICENSE.md>
//! Procedure declarations, constant definitions, and macros for the NLS component.
pub const CP_ACP: ::DWORD = 0;
pub const CP_OEMCP: ::DWORD = 1;
pub const CP_MACCP: ::DWORD = 2;
pub const CP_THREAD_ACP: ::DWORD = 3;
pub const CP_SYMBOL: ::DWORD = 42;
pub const CP_UTF7: ::DWORD = 65000;
pub const CP_UTF8:... | Rust | 0 |
impl<C: bytemuck::Pod> Drop for UniformVecRefMut<'_, C>{
fn drop(&mut self){
self.uniform_vec.update_int(self.queue);
}
}
///
/// A Buffer with a vector that can be used as a Unform directly.
/// It keeps a copy of the content in memory for easier updates.
/// TODO: Remove content.
///
pub struct Uni... | Rust | 0 |
::std::mem::size_of::<_GVariantBuilder>(),
128usize,
concat!("Size of: ", stringify!(_GVariantBuilder))
);
assert_eq!(
::std::mem::align_of::<_GVariantBuilder>(),
8usize,
concat!("Alignment of ", stringify!(_GVariantBuilder))
);
assert_eq!(
unsafe { &(*(::... | Rust | 0 |
) {
let idx = map.point2d_to_index(want_place.destination);
let mut item_query = <(Entity, &Item, &Carried)>::query();
if map.tiles[idx] == TileType::Shelve {
if let Some(produce) = item_query.iter(ecs).find_map(|(entity, _, _)| Some(entity)) {
commands.remove_component::<Carried>(*... | Rust | 0 |
ds, 0) == (0,)
assert dependent_axes(d.coords, 1) == (1, 2)
assert dependent_axes(d.coords, 2) == (1, 2)
def test_wcs_alma(self):
header = self.header4()
d = Data(label='D1')
d.coords = coordinates_from_header(header)
d.add_component(np.zeros((3, 2, 1, 1)), label='t... | Python | 1 |
face that fall on the new face
let (start, end) = {
let start = v_idx;
let mut end = (w_idx - 1).rem_euclid(face_halfedges.len() as i32);
if end < start {
end += face_halfedges.len() as i32
}
(start, end)
};
for i in start..=end {
let h = face_hal... | Rust | 0 |
l<T> Drop for RwLockWriteGuard<T> {
fn drop(&mut self) {
let mut state = self.lock.lock_inner("RwLockWriteGuard::drop");
state.writer = false;
state.wake();
}
}
struct LockState<T> {
readers: usize,
writer: bool,
next_id: usize,
wakers: HashMap<usize, Waker>,
value: ... | Rust | 0 |
ndex, Box<String>),
PtyDectest(PtyIndex),
PtyReverseIndex(PtyIndex),
PtyTerminalAttribute(PtyIndex, Attr),
PtySetMode(PtyIndex, Mode),
PtyUnsetMode(PtyIndex, Mode),
// PtySetScrollingRegion(PtyIndex, Range<Line>),
Noop,
Startup,
ModeChange,
}
pub struct Context<'a, T>
where
... | Rust | 0 |
neric values
pub type GenericMap = BTreeMap<String, value::Value>;
pub trait FromMap: Default {
/// Converts a `GenericMap` back into a structure.
/// __Constraints__: assumes that value types conform to the original types of the struct.
fn from_genericmap(map: GenericMap) -> Self;
}
pub trait ToMap: Defa... | Rust | 0 |
nfo_data
.read_at::<object::U32Bytes<Elf::Endian>>(info_offset)
.unwrap()
.get(endian);
// ld
assert_eq!(instruction & 0x707f, 0... | Rust | 0 |
tem.kb_id != 1:
if item.checklist_type_id != None:
name = ChecklistType.query.filter(ChecklistType.id == item.checklist_type_id).first()
checklistName = name.name
else:
checklistName = "Removed"
checklist = Check... | Python | 1 |
ilities::types::ids::{node_test_id, subnet_test_id};
use ic_types::crypto::dkg::{EncryptionPublicKey, EncryptionPublicKeyPop};
#[test]
#[should_panic(expected = "subnet must not be empty")]
fn should_panic_on_empty_nodes_in_subnet() {
let nodes = [];
let nodes_set: BTreeSet<NodeId> = nodes.iter().cloned().coll... | Rust | 0 |
import random
import hashlib
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
from Crypto.Util.number import getPrime
sz = 1024
FLAG = b'BUETCTF{...}'
p = getPrime(sz)
g = 7
while True:
key = random.getrandbits(sz)
if key < p:
break
def encrypt(m, key):
return AES.new(hashlib.sha256(str(k... | Python | 1 |
.loads(content)
if not isinstance(tasks, list):
tasks = [tasks]
# 查找匹配的任务
for task in tasks:
if task.get('file_name') == file_name:
thread_id = task.get('thread_id')
... | Python | 1 |
error::Error;
use crate::rules::Rule;
use crate::utils::GenericError;
#[path = "../utils/mod.rs"]
mod utils;
fn main() -> Result<(), Box<dyn Error>> {
let rules = utils::parse_input_lines::<Rule>()?;
let shiny_gold = String::from("shiny gold");
let bags_which_contain = rules::count_bags_which_contain(&rules, &s... | Rust | 0 |
accessor::make_simple_field_accessor::<_, ::protobuf::types::ProtobufTypeInt64>(
"chan_capacity",
|m: &Hop| { &m.chan_capacity },
|m: &mut Hop| { &mut m.chan_capacity },
));
fields.push(::protobuf::reflect::accessor::make_simple... | Rust | 0 |
返回: 统计信息字典
"""
stats = {
"total": 0,
"processed": 0,
"skipped": 0,
"failed": 0
}
print(f"扫描目录:{root_dir}")
if SKIP_KEYWORDS:
print(f"排除关键词:{', '.join(SKIP_KEYWORDS)}")
# 收集所有PDF文件
pdf_files = []
for root, _, files in os.walk(root_dir):
... | Python | 1 |
_operator_user();
let other = test::model::new_general_user();
let (file_other, object) = test::model::new_file(other.id().clone());
let app = test::build_mock_app()
.users(vec![user.clone(), other.clone()])
.files(vec![file_other.clone()])
.objects(vec![obje... | Rust | 0 |
= (*storage.u).hGlobal();
let txt = CString::from_raw((*data).cast::<i8>());
let str = txt.to_str().unwrap().to_string();
Some(str)
} else {
None
}
}
use crate::AsyncRuntime;
use crate::Error;
use crate::Stream;
use hreq_h1 as h1;
use tokio_util::compat::FuturesAsyncReadCompatEx... | Rust | 0 |
from common import *
from libcom import ControlComModel
import os
import cv2
import shutil
import torch
task_name = 'controllable_composition'
def inference_on_single_pair(net, pair, task):
bg_img, bbox = pair['background'], pair['bbox']
fg_img, fg_mask = pair['foreground'], pair['foreground_mask']
comp_i... | Python | 1 |
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
}
fn new() -> CAccountHardware_QueryAccountsRegisteredToSerial_Request {
CAcc... | Rust | 0 |
{
dvi_put(get_buffered_unsigned_num(opcode - PUT1));
}
PUT4 => {
panic!("Multibyte (>24 bits) character not supported!");
}
PUT_RULE => {
do_putrule();
}
NOP => {}
BOP => {
... | Rust | 0 |
self.assertTrue(cfg.getboolean('one', 'two'))
self.assertTrue(cfg.getboolean('two', 'one'))
cfg.converters['boolean'] = cfg._convert_to_boolean
self.assertFalse(cfg.getboolean('one', 'one'))
self.assertFalse(cfg.getboolean('two', 'two'))
self.assertFalse(cfg.getboolean('one', '... | Python | 1 |
Ohm50 = 0x00,
Ohm200 = 0x80,
}
pub enum LnaGain {
AgcLoop = 0b000,
G1 = 0b001,
G2 = 0b010,
G3 = 0b011,
G4 = 0b100,
G5 = 0b101,
G6 = 0b110,
}
pub enum SensitivityBoost {
Normal = 0x1B,
HighSensitivity = 0x2D,
}
pub enum Pa13dBm1 {
Normal = 0x55,
High20dBm = 0x5D,
}
... | Rust | 0 |
import sys
import os
# Add the backend path to sys.path to import the engine
sys.path.append(os.path.abspath(os.path.join(
os.path.dirname(__file__), '..', 'backend')))
from ml.engine import calculate_earth_score
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.impute import Si... | Python | 1 |
# flake8: noqa: F401, F403
from uuid import UUID
from vellum_ee.workflows.display.editor import NodeDisplayData, NodeDisplayPosition
from vellum_ee.workflows.display.nodes import BaseInlineSubworkflowNodeDisplay
from vellum_ee.workflows.display.nodes.types import NodeOutputDisplay, PortDisplayOverrides
from ....node... | Python | 1 |
ory.register
class THD7GRadio(KenwoodD7Family):
"""Kenwood TH-D7G"""
MODEL = "TH-D7G"
_BANDS = [(118000000, 174000000), (400000000, 470000000)]
_APRS_EXTRA = (('WEATHER Station (blue)', '1,/#'),
('House QTH (VHF)', '1,/-'),
('Boy Scouts', '1,/,'),
... | Python | 1 |
"""
Tests for model management.
"""
# Model manager tests
| Python | 1 |
hortcut, g, k=((1, 1), (3, 3)), e=1.0) for _ in range(n)))
def forward(self, x):
"""Forward pass through the CSP bottleneck with 2 convolutions."""
return self.cv3(torch.cat((self.m(self.cv1(x)), self.cv2(x)), 1))
class C3k(C3):
"""C3k is a CSP bottleneck module with customizable kernel sizes ... | Python | 1 |
"""
Event action's base class.
"""
from muddery.server.settings import SETTINGS
from muddery.server.database.worlddata.worlddata import WorldData
from muddery.server.database.worlddata_db import WorldDataDB
class BaseEventAction(object):
"""
Event action's base class.
"""
# action's key
key = ""
... | Python | 1 |
<SliceElementWriter> {
IonCSliceElementWriter::new(slice, self)
}
// TODO into files, cursors, or other such things
}
#[cfg(test)]
mod writer_tests {
use super::*;
use crate::result::IonResult;
use crate::types::decimal::Decimal;
use crate::types::timestamp::Timestamp;
use crate::v... | Rust | 0 |
axVariant::ShapeExpression {..} => SyntaxKind::ShapeExpression,
SyntaxVariant::TupleExpression {..} => SyntaxKind::TupleExpression,
SyntaxVariant::GenericTypeSpecifier {..} => SyntaxKind::GenericTypeSpecifier,
SyntaxVariant::NullableTypeSpecifier {..} => SyntaxKind::NullableTypeSpeci... | Rust | 0 |
C/Df d dl mZ ddlmZ ddlmZmZmZ ddlm Z ddl
mZ ddlm
Z
mZmZmZmZmZmZmZ ddlmZ dd lmZmZ dd
lmZmZ dZy)
)annotations )is_connection_dropped)SKIP_HEADERSKIPPABLE_HEADERSmake_headers)is_fp_closed)Retry)ALPN_P... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import os
import sys
from datetime import datetime
from pathlib import Path
def ensure_dir_exists(path):
"""Aseg... | Python | 1 |
#!/usr/bin/env python
#
# Copyright 2015 Google Inc.
#
# 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 o... | Python | 1 |
import os
from uuid import uuid1
from pyxnat import Interface
import os.path as op
from pyxnat.tests import skip_if_no_network
fp = op.abspath('.devxnat.cfg')
central = Interface(config=fp)
project = central.select.project('pyxnat_tests')
variables = {'Subjects': {'newgroup': {'foo': 'string', 'bar': 'int'}}}
sid =... | Python | 1 |
from collections import deque
from copy import deepcopy
def sort_it(tubes):
start = tubes
goal = sorted(tubes, key=lambda x: (-len(x), x[0] if x else ''))
visited = set()
queue = deque([([], start)])
while queue:
path, tubes = queue.popleft()
if tubes == goal:
return p... | Python | 1 |
(&mut self) -> &mut Ref<[T], Cpu> {
unsafe { &mut *(self.as_mut_slice() as *mut [T] as *mut Ref<[T], Cpu>) }
}
}
impl<T, A: Allocator> AsRef<Ref<[T], Cpu>> for std::vec::Vec<T, A> {
fn as_ref(&self) -> &Ref<[T], Cpu> {
unsafe { &*(self.as_slice() as *const [T] as *const Ref<[T], Cpu>) }
}
}... | Rust | 0 |
event_sender.start_send(
Event::NotificationStreamOpened {
remote: remote_peer.clone(),
engine_id: engine_id.clone(),
role: ObservedRole::Authority,
}
).expect("Event stream is unbounded; qed.");
// Send messages into the network event stream.
for (i_notification, messages) in notif... | Rust | 0 |
Output the slice
if first {
first = false;
print!("\x1BP\x1B]52;c;{}", slice);
io::stdout().flush().unwrap();
} else {
print!("\x1B\x5C\x1BP{}", slice);
io::stdout().flush().unwrap();
}
pos ... | Rust | 0 |
ending: {:?}", p);
stream
.write_all(&p.packet)
.expect("Error: unable to send packet.");
stream.flush().expect("Error: unable to flush stream.");
}
use std::sync::Arc;
use abscissa_core::{Command, Options, Runnable};
use tokio::runtime::Runtime as TokioRuntime;
use ibc::events::IBCEvent;
use ibc::ics24_host::... | Rust | 0 |
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
# Укажите путь к вашему драйверу и браузеру
chrome_driver_p... | Python | 1 |
nsity = scenario['intensity_profile'](temporal_position)
if pattern in temp_detector.anomaly_patterns:
temp_anomaly = temp_detector.anomaly_patterns[pattern](
anomaly, intensity
)
anomaly[0, affected_features] = temp_ano... | Python | 1 |
docid in self.family.IF.intersection(docids,
stored_docids):
n += 1
yield docid
if limit and n >= limit:
return
else:
# If the res... | Python | 1 |
0.01,
10.0,
)?,
debug_type: DebugType::NONE,
lighting_model: LightingModel::Blinn,
geometry_pass_texture: Some(ColorTargetTexture2DArray::new(
context,
1,
1,
2,
Interpolation:... | Rust | 0 |
_t,
) -> xcb_set_modifier_mapping_cookie_t,
>,
xcb_set_modifier_mapping_unchecked: LazySymbol<
unsafe fn(
c: *mut xcb_connection_t,
keycodes_per_modifier: u8,
keycodes: *const xcb_keycode_t,
) -> xcb_set_modifier_mapping_cookie_t,
>,
xcb_set_mo... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.