text string | label_name string | labels int64 |
|---|---|---|
zero), as defined in
/// `RTOS_PLUGIN_BUF_SIZE_THREAD_DISPLAY`.
#[no_mangle]
pub extern "C" fn RTOS_GetThreadDisplay(p_display: *mut c_char, thread_id: c_uint) -> c_int {
trace!("RTOS_GetThreadDisplay, thread_id: {:#010X}", thread_id);
let thread = ensure!(find_thread_by_id(thread_id));
let thread_name = ... | Rust | 0 |
self.toolsets.clear()
self.agent = None
# Small delay to ensure cleanup completes
await asyncio.sleep(0.5)
logger.info("Agent shutdown complete")
def get_server_status(self) -> Dict[str, str]:
"""Get the current connection status of all configured servers.""... | Python | 1 |
// slot was a tail
if next == slot {
// uphold tail's invariant of pointing to itself
table[next_free_slot].assume_init_mut().next = next_free_slot;
// slot was in the midd... | Rust | 0 |
use std::str::FromStr;
#[derive(Deserialize, Serialize)]
struct OsrmWaypoint {
distance: f32,
location: Vec<f32>,
}
impl OsrmWaypoint {
pub fn from(p: &Position) -> Self {
OsrmWaypoint {
distance: 0.0,
location: vec![p.x, p.y],
}
}
}
#[derive(Deserialize, Serialize)]
struct OsrmLeg {
we... | Rust | 0 |
etails
])
self.operations_file.flush()
def log_message(self, message):
timestamp = datetime.now().strftime('%H:%M:%S')
log_entry = f"[{timestamp}] {message}"
self.log_display.append(log_entry)
# スクロールを最下部に
scrollbar = self.log_display.verticalScr... | Python | 1 |
set: SimpleSet(set![1]),
};
let leaf_c = SimpleLeaf {
idx: NodeIndex::default(),
set: SimpleSet(set![2, 3]),
};
let leaf_d = SimpleLeaf {
idx: NodeIndex::default(),
set: SimpleSet(set![4, 5]),
};
let mut expr = RecExpr::def... | Rust | 0 |
les` feature makes [`Sender`] and [`Receiver`] non-`Copy`, so we must use `Clone`
// with the feature turned on. But doing so with the feature off will make clippy complain, so we
// have this simple function that always uses the appropriate impl for copying these types.
// TODO(#1854): Remove this once linear-handles ... | Rust | 0 |
SerializeStruct::serialize_field(&mut state, "name", &self.name)?;
serde::ser::SerializeStruct::end(state)
}
}
use std::slice;
use cardano::bip::bip39;
use types::CardanoBIP39ErrorCode;
use types::CardanoResult;
use std::{
os::raw::{c_char, c_uchar, c_uint},
ptr,
};
use std::ffi::CStr;
/// encod... | Rust | 0 |
_data_generation;
///
/// use test_data_generation::engine::PatternDefinition;
///
/// fn main() {
/// let mut pttrn_def = PatternDefinition::new();
/// //async {
/// let rslt = pttrn_def.analyze("Hello World");
/// assert_eq!(rslt.0, "CvccvSCvccc");
/// //}
... | Rust | 0 |
(theme::grid(3.0));
col = col
.with_child(Label::new("Size").with_font(theme::UI_FONT_MEDIUM))
.with_spacer(theme::grid(2.0))
.with_child(Label::dynamic(
|preferences: &Preferences, _| match preferences.cache_size {
Promise::Empty | Promise::Rejected(_) => {
... | Rust | 0 |
sword)
}
/// Create a lettre mailer for sending emails. Gets the SMTP credentials from the environment.
pub fn make_mailer() -> SmtpTransport {
dotenv().ok();
let server = std::env::var("SMTP_SERVER").expect("SMTP_SERVER is required to send emails");
let creds = get_creds();
SmtpTransport::relay(&server)
.unwrap... | Rust | 0 |
executor_job(os.unlink, aid_storage_path)
async def test_handle_unique_id_change(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
) -> None:
"""Test handling unique id changes."""
light = entity_registry.async_get_or_create("light", "demo", "old_unique")
config_entry = MockConfigEntry(dom... | Python | 1 |
#question 10
# write a program that converts a given string into uppercase.
str=input("enter the string:")
print("the updated string is: ",str.upper()) | Python | 1 |
_strides[res_scale],
mode=mode,
**conv_params)
tf.logging.info('Decoder at res_scale {} tensor shape: {}'.format(
res_scale, x.get_shape()))
# Last convolution
with tf.variable_scope('last'):
ta... | Python | 1 |
import numpy as np
from facexlib.tracking.data_association import associate_detections_to_trackers
from facexlib.tracking.kalman_tracker import KalmanBoxTracker
class SORT(object):
"""SORT: A Simple, Online and Realtime Tracker.
Ref: https://github.com/abewley/sort
"""
def __init__(self, max_age=1,... | Python | 1 |
資料夾(例如整個磁碟機根目錄)。
# 在這些路徑內,首次偵測到變更會先記錄資訊並建立 baseline,之後才進入正常比較流程。
MONITOR_ONLY_FOLDERS = []
# 監控資料夾中的排除清單(子資料夾)。位於此清單的路徑不做即時比較。
# =========== Heartbeat / Observer 健康檢查 ==========
ENABLE_HEARTBEAT = True
HEARTBEAT_INTERVAL_SEC = 30
ENABLE_OBSERVER_HEALTHCHECK = True
OBSERVER_HEALTHCHECK_INTERVAL_SEC = 5
OBSERVER_STALL_T... | Python | 1 |
base,
primitive: Value::Undefined,
},
))
.into())
}
fn derive(
&self,
activation: &mut Activation<'_, 'gc, '_>,
class: GcCell<'gc, Class<'gc>>,
scope: Option<GcCell<'gc, Scope<'gc>>>,
) -> Result<Object<'gc>, Error> ... | Rust | 0 |
path::Path,
ptr::NonNull,
slice, thread_local,
};
/// Get the version of the linked `nvtt` library.
#[inline(always)]
pub const fn version() -> u32 {
NVTT_VERSION
}
macro_rules! decl_enum {
(
$(#[$($attr:meta)*])*
$v:vis enum $enum_name:ident: $raw:ident {
$(
... | Rust | 0 |
# -*- coding: UTF8 -*-
from pupylib.PupyModule import *
from pupylib.PupyCompleter import *
from rpyc.utils.classic import download
import os
import os.path
__class_name__="DownloaderScript"
class DownloaderScript(PupyModule):
""" download a file/directory from a remote system """
def init_argparse(self):
self.ar... | Python | 1 |
# =============================================================================
# Copyright 2016 The TensorFlow Authors. 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
#... | Python | 1 |
n \n Текст задания: \n \n {text}",
reply_markup=types.ReplyKeyboardRemove()) # текст
usersLocalDb[message.from_user.id]["getTaskNumber"] = False
usersLocalDb[message.from_user.id]["getTaskAnswer"]["status"] = True
usersLocalDb... | Python | 1 |
11;
match z {
ref r => println!("Got reference to {}", r)
}
// Here, the r inside the match has the type &i32.
// In other words, the ref keyword creates a reference,
// for use in the pattern.
// If you need a mutable reference,
// ref mut will work in the same way:
let mut u = ... | Rust | 0 |
iveProtocolServer::new(log.clone(), c_peer_listen, chans).into_future().map_err(move |e| {
warn!(c_serv_log, "shot server gone with error: {:?}", e);
panic!("shot server");
});
runtime.spawn(peer_server);
(runtime, rx, address)
}
#[test]
fn test_peer_protoco... | Rust | 0 |
"""
@Fire
https://github.com/fire717
"""
import os
import time
import torch
import torch.optim as optim
import numpy as np
import cv2
from lib.utils.utils import maxPoint,extract_keypoints
_range_weight_x = np.array([[x for x in range(48)] for _ in range(48)])
_range_weight_y = _range_weight_x.T
# _reg_weight = np... | Python | 1 |
s
2. Reset the graph to an empty state
3. Update flags to notify other processes
4. Changes is persisted to disk immediately
Returns:
dict[str, str]: Operation status and message
- On success: {"status": "success", "message": "data dropped"}
- On fail... | Python | 1 |
import json
from channels.generic.websocket import AsyncWebsocketConsumer
class ChatConsumer(AsyncWebsocketConsumer):
async def connect(self):
self.room_group_name = 'Test-Room'
await self.channel_layer.group_add(
self.room_group_name,
self.channel_name
)
a... | Python | 1 |
00\xf3\xca)\xa5\
\x91O\x9f\xa8\x8b\xfbZI\xa3\x0e\xfa\x83\x88\x97\xeb\xa4\
M\x80P\xab\x94\x00\xa1\xee\x07\x05,\x81A\xc1\xa4@\
\x912Z\xf1\xc4\x16\xa8\xa5<\xdb\x94\xd1[\x0aH\x93\
\xbd \x15[\x94C*u\x95EYAhn\xabv\
$\xc0\x94\x9f\xc1\x95\xf8\x11\x08\x1e\xf2\xe3\xdd\xa9\x12\x80\
\xca;T\xa7,\xf2}\xf0/y<<5~>\xbf\
\xeb\x7f\xb1Mi\... | Python | 1 |
256)
x_swap = self.can_swapper.transform_keypoint(x_swap_info)
# 使用source图像和driving表情计算最终关键点位置
R_swap = get_rotation_matrix(x_s_info['pitch'], x_s_info['yaw'], x_s_info['roll'])
t_swap = x_s_info['t']
t_swap[..., 2].fill_(0)
... | Python | 1 |
"""
Write a python function to count the upper case characters in a given string.
assert upper_ctr('PYthon') == 1
"""
def upper_ctr(string):
"""
:param string: string
:return: int
"""
return sum(1 for char in string if char.isupper())
if __name__ == '__main__':
print(upper_ctr('PYthon'))
... | Python | 1 |
},
)
def total_capacity_ev_chargers():
"""
Total capacity in MW of EVchargers installed
"""
return sum(
capacity_ev_chargers().rename({"EV CHARGERS I": "EV CHARGERS I!"}),
dim=["EV CHARGERS I!"],
)
@component.add(
name="total length grid to EV chargers",
units="km",
sub... | Python | 1 |
lit()
if len(parts) >= 4:
connections.append({
'protocol': parts[0],
'local_address': parts[3],
'foreign_address': parts[4] if len(parts) > 4 else '',
'state': part... | Python | 1 |
skip_serializing_if = "Option::is_none")]
pub host_entity_id: Option<String>,
#[doc = "The IP entity if of this device"]
#[serde(rename = "ipAddressEntityId", default, skip_serializing_if = "Option::is_none")]
pub ip_address_entity_id: Option<String>,
#[doc = "A list of TI contexts attached to the I... | Rust | 0 |
en path
//#[structopt(name = "pack", long, parse(from_os_str))]
//pub pack: Option<PathBuf>,
// Host the daemon for other processes to pull from
//#[structopt(name = "pack", long)]
//pub host_daemon: bool,
// Assume the daemon is running externally
#[structopt(name = "external-daemon", lon... | Rust | 0 |
_gb' | 'eng_us' | 'other':
assert sentence_segs == ['English is a West Germanic language in the Indo-European language family,', 'whose speakers,', 'called Anglophones,', 'originated in early medieval England on the island of Great Britain.', '[4][5][6] The namesake of the language is the Angles,', 'one of ... | Python | 1 |
r, ws::Error> where
M: jsonrpc_core::Metadata,
S: jsonrpc_core::Middleware<M>,
H: Into<jsonrpc_core::MetaIoHandler<M, S>>,
T: ws::MetaExtractor<M>,
U: ws::SessionStats,
V: ws::RequestMiddleware,
{
ws::ServerBuilder::with_meta_extractor(handler, extractor)
.request_middleware(middleware)
.allowed_origins(allo... | Rust | 0 |
String) {
Response {
helix,
code,
body,
}
}
def body(&self) -> String {
self.body.clone()
}
}
}
<gh_stars>0
#![cfg_attr(not(feature = "std"), no_std)]
#![allow(clippy::too_many_arguments)]
#![allow(clippy::... | Rust | 0 |
Prepares the tensor for Inverse Short-Time Fourier Transform (ISTFT) by reshaping
and creating a complex tensor from the real and imaginary parts.
"""
# Reshape the tensor to separate real and imaginary parts and prepare for ISTFT.
reshaped_tensor = padded_tensor.reshape(
[*... | Python | 1 |
let a = BitPtr::<_, Lsb0, _>::from_ref(&x);
let b = a.cast::<Cell<u32>>();
let c = unsafe { b.add(1) };
assert!(super::eq(a, b));
assert!(!super::eq(b, c));
let d = a.cast::<u8>();
let step = unsafe { d.add(1) }.align_offset(2);
assert_eq!(step, 15);
let step = unsafe { d.add(9) }.align_offset(4);
assert_e... | Rust | 0 |
de, "upgrade", cache_list)
settings = get_settings()
if settings['currency_usdt'] == "on":
price = str("{:.2f}".format(float(int(price) / Toman_USD()))) + " USDT تتر"
else:
price = trx_price(price)
text = f"""
مبلغ:
{price}
به آدرس ولت :
<code>{wallet}</code>
وار... | Python | 1 |
from math import cos, log10, pi, sin, tau
from modules.helpers import forward_function
from modules.sound_generator import (
Note,
evolving_frequency,
multi_sine,
multi_wave,
note_str_to_freqs,
sine_with_harmonics,
)
from modules.sound_generator import (
SAWTOOTH_WAVE,
SQUARE_WAVE,
... | Python | 1 |
ident_continue(c)
};
if valid {
c
} else {
'_'
}
}).collect::<String>();
let name = if rust::is_rust_keyword(&name) {
format!("{}_pb", name)
} else {
name
};
name
}
pub struct RootSc... | Rust | 0 |
ginal KDE distribution
Parameters
----------
dimensions : int or 1-d array_like
The dimensions of the multivariate distribution corresponding
with the marginal variables, that is, the indices of the dimensions
that are being retained. The other dimensions are... | Python | 1 |
#!/usr/bin/env python3
# Copyright 2025 The Lynx Authors. All rights reserved.
# Licensed under the Apache License Version 2.0 that can be found in the
# LICENSE file in the root directory of this source tree.
import sys
import os
import subprocess
import platform
system = platform.system()
ndk_version = '21.1.635246... | Python | 1 |
import numpy as np
def split_str2indexes(string: str, max_check: int, length_limit=5):
if not isinstance(string, str):
raise ValueError("Invalid scheme for {:}".format(string))
srangestr = "".join(string.split())
indexes = set()
for srange in srangestr.split(","):
srange = srange.split... | Python | 1 |
#python 3.7.1
print ("Hello, Dcoder!")
# operasi logika
# NOT
a = False
c = not a
print('data a =',a)
print('data c =',c)
# OR
a = False
b = False
c = a or b
print(a,'OR',b,'=',c)
a = True
b = True
c = a or b
print(a,'OR',b,'=',c)
# AND
a = False
b = False
c = a and b
print(a,'AND',b,'=',c)
a = True
b = False
c... | Python | 1 |
import cudf
import pytest
import clx.features
df = cudf.DataFrame(
{
"time": [1, 2, 3, 4, 5, 6, 7],
"user": ["u1", "u2", "u3", "u1", "u1", "u2", "u1"],
"computer": ["c1", "c2", "c3", "c1", "c2", "c3", "c1"],
}
)
def test_binary_features():
actual = clx.features.binary(df, "user",... | Python | 1 |
close(&mut self) {
match *self {
R2Pipe::Pipe(ref mut x) => x.close(),
R2Pipe::Lang(ref mut x) => x.close(),
R2Pipe::Tcp(ref mut x) => x.close(),
R2Pipe::Http(ref mut x) => x.close(),
}
}
pub fn in_session() -> Option<(i32, i32)> {
let f_... | Rust | 0 |
Visitor)
}
}
#[cfg(test)]
mod tests {
use serde_test::{assert_tokens, Token};
#[test]
fn tokenize_leaves() {
{
let node = node!(Always);
assert_tokens(&node, &[
Token::NewtypeStruct { name: "Node" },
Token::Str("(A)"),
]);
... | Rust | 0 |
rt teams[1]["division"]["name"] == "Central"
assert teams[1]["franchise_id"] == 27
# Check third team - special case for Canadiens (partial match)
assert teams[2]["name"] == "Montreal Canadiens"
assert teams[2]["common_name"] == "Canadiens"
assert teams[2]["abbr"] == "MTL"
assert teams[2]["conf... | Python | 1 |
URPOSE_5_ERR_R {
KEY_PURPOSE_5_ERR_R::new(((self.bits >> 12) & 0x0f) as u8)
}
#[doc = "Bits 8:11"]
#[inline(always)]
pub fn key_purpose_4_err(&self) -> KEY_PURPOSE_4_ERR_R {
KEY_PURPOSE_4_ERR_R::new(((self.bits >> 8) & 0x0f) as u8)
}
#[doc = "Bits 4:7"]
#[inline(always)]
... | Rust | 0 |
ontinue
except IndexError as exc:
logger.error(
f"\ncsv_path:\t{csv_path}\ntags:\t{tags}\n"
f"error_tag_index:\t{containers[csv_path][ConfStr.REMOVED_INDEX.value]}"
)
raise IndexError from exc
... | Python | 1 |
import mplfinance as mpf
import pandas as pd
from import_ohlc import get_ohlc_from_yf
def draw_5_days_avg(ticker: str, interval: str = "15m"):
"""
Create and save plot 5_d_avg_{ticker}.png
containing OHLC candles and 5 days simple moving average (SMA).
Usage: avoid buying the dip until the price cons... | Python | 1 |
name)
# 复制文件
shutil.copy2(source_path, destination_path)
print(f"已复制: {filename}")
# print("复制完毕")
def left_button_press_callback(self, Modeling, Rendering, obj, event):
# 获取鼠标位置
print("点击!")
x, y = obj.GetEventPosition()
if Re... | Python | 1 |
import openai
# Replace with your actual OpenAI API key
openai.api_key = "YOUR-API_KEY_HERE"
# Conversation history
conversation_history = []
def custom_gpt(prompt):
# Add user message to history
conversation_history.append({"role": "user", "content": prompt})
try:
response = openai.ChatComp... | Python | 1 |
runSingle"),
debug_single: get("rust-analyzer.debugSingle"),
show_reference: get("rust-analyzer.showReferences"),
goto_location: get("rust-analyzer.gotoLocation"),
trigger_parameter_hints: get("editor.action.triggerParameterHints"),
}
}
pub fn highlight_r... | Rust | 0 |
c::new();
for (index, _tube) in tubes {
// 9 == Wall
if *lava_tubes.get(index).unwrap() != 9 {
let basin_size = fill(&mut lava_tubes, index, width);
basin_sizes.push(basin_size);
}
}
basin_sizes.sort_unstable();
let mut result = 1;
basin_sizes.iter().... | Rust | 0 |
d("android/system/OsConstants\0", "ST_SYNCHRONOUS\0", "I\0");
env.get_static_int_field(class, field)
}
}
/// **get** public static final [S_IFBLK](https://developer.android.com/reference/android/system/OsConstants.html#S_IFBLK)
pub fn S_IFBLK<'env>(env: &'env __jni_b... | Rust | 0 |
bits(*byte) });
}
// automatic STOP
Ok(())
}
}
impl<SDA, SCL> Read for I2c<$I2CX, SDA, SCL> {
type Error = Error;
fn read(&mut self, addr: u8, bytes: &mut [u8]) -> Result<(), Self::Error> {
// TODO su... | Rust | 0 |
from django.urls import path
from .views import RegisterView, LoginView
urlpatterns = [
path('register/', RegisterView.as_view(), name='register'),
path('login/', LoginView.as_view(), name='login'),
path('follow/<int:user_id>/', FollowViewSet.as_view({'post': 'follow_user'}), name='follow_user'),
path... | Python | 1 |
((create_tab(current_level) + "reply(Ok(NativeObjectValue::Array(array)));\n").as_bytes());
} else if return_type.is_only_read() {
return Err(Error::new(ErrorKind::Other, format!("Generate function call result failed, function: {}, reason: not allowed take onlyread borrow of Vec<{}... | Rust | 0 |
let (__jni_class, __jni_method) = __jni_env.require_class_method("java/util/concurrent/atomic/AtomicLongFieldUpdater\0", "accumulateAndGet\0", "(Ljava/lang/Object;JLjava/util/function/LongBinaryOperator;)J\0");
__jni_env.call_long_method_a(self.0.object, __jni_method, __jni_args.as_ptr()... | Rust | 0 |
::jetstream::{AckPolicy, ConsumerConfig};
//!
//! let nc = nats::connect("my_server::4222")?;
//! let js = nats::jetstream::new(nc);
//!
//! js.add_stream("my_stream")?;
//!
//! let consumer: nats::jetstream::Consumer = js.add_consumer("my_stream", ConsumerConfig {
//! durable_name: Some("my_consumer".to_string()),... | Rust | 0 |
=ListType::Inline>
<a href="https://blog.drogue.io" target="_blank">{"Learn more"}</a>
</List>
</>}
};
let header = Children::new(vec![header]);
let footer = Children::new(vec![footer]);
let onclick = self.link.callback(|_| Msg::Login);
... | Rust | 0 |
char::from).collect::<String>());
// Milestone index
let mut buf = [0u8; std::mem::size_of::<u32>()];
let index = match reader.read_exact(&mut buf) {
Ok(_) => u32::from_le_bytes(buf),
Err(e) => return Err(Error::IOError(e)),
};
debug!("Index: {}.", inde... | Rust | 0 |
new_edge_index.view(-1),
new_edge_index.unique(),
max_index=num_users+num_items,
inclusive=True,)
train_edge_index = edge_index.view(2, -1)
num_users = train_edge_index[0].unique().size(0)
num_items = train_edge_index[1].unique().s... | Python | 1 |
.len() == 1 {
found = Some((name.clone(), positions[0]));
final_positions.insert(name.clone(), positions[0]);
}
}
if let Some((name, position)) = found {
rule_positions.remove(&name);
for (_, positions) in rule_positions.iter_mut() {
... | Rust | 0 |
= datetime.now().strftime("%Y%m%d_%H%M%S")
# 清理查询字符串,移除所有特殊字符和换行符
clean_query = re.sub(r'[^\w]', '_', query.replace('\n', ' ').replace('\r', ' ').strip())[:20]
# 确保文件名不包含连续的下划线
clean_query = re.sub(r'_+', '_', clean_query).strip('_')
# 如果清理后为空,使用默认名称
if not clean_query:
... | Python | 1 |
im_patch = im_patch[np.newaxis, :, :, :]#shape: (1,3,H,W)
im_patch = im_patch.astype(np.float32)
im_patch = torch.from_numpy(im_patch)
if cfg.CUDA:
im_patch = im_patch.cuda()
return im_patch
def multi_cropx(img, center_pos, size, channel_average, type='tensor'):
'''crop s... | Python | 1 |
Vpaddusw_ymm_k1z_ymm_ymmm256",
"EVEX_Vpaddusw_zmm_k1z_zmm_zmmm512",
"Pmaxub_mm_mmm64",
"Pmaxub_xmm_xmmm128",
"VEX_Vpmaxub_xmm_xmm_xmmm128",
"VEX_Vpmaxub_ymm_ymm_ymmm256",
"EVEX_Vpmaxub_xmm_k1z_xmm_xmmm128",
"EVEX_Vpmaxub_ymm_k1z_ymm_ymmm256",
"EVEX_Vpmaxub_zmm_k1z_zmm_zmmm512",
"Pandn_mm_mmm64",
"Pandn_xmm_xm... | Rust | 0 |
PassportElementErrorSourceTranslationFilesBuilder
{
fn as_ref(&self) -> &InputPassportElementErrorSourceTranslationFiles {
&self.inner
}
}
/// The element contains an error in an unspecified place. The error will be considered resolved when new data is added
#[derive(Debug, Clone, Default, Serialize, D... | Rust | 0 |
"""Fix tos and cos field types
Revision ID: 4c573e7135bd
Revises: 28887f25a46f
Create Date: 2014-03-05 12:16:56.618630
"""
# revision identifiers, used by Alembic.
revision = '4c573e7135bd'
down_revision = '28887f25a46f'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects.postgresql import ENUM
... | Python | 1 |
mStore {
animations: wrap_vec(&lib_ent.animations, |x| { wrap_animation(x) }),
anim_groups: lib_ent.anim_groups.clone(),
copied_on_previous: lib_ent.copied_on_previous.clone()
}
}
fn wrap_animation(lib_ent: &lib::Animation) -> Animation {
Animation {
frames: wrap_vec(&lib_ent.fr... | Rust | 0 |
cb_input_ungrab_device_key_request_t {
pub major_opcode: u8,
pub minor_opcode: u8,
pub length: u16,
pub grab_window: xcb_window_t,
pub modifiers: u16,
pub modifier_device: u8,
pub key: u8,
pub grabbed_device: u8,
}
impl Default for xcb_input_ungrab_device_key_request_t {
fn default(... | Rust | 0 |
print_chr(match_chr);
if c <= 0x9 {
print_chr(char::from((c as u8) + b'0'));
} else {
print_chr('!');
return;
}
}
... | Rust | 0 |
&str) -> Result<Self, Self::Err> {
parse_array(s)
}
}
impl fmt::Display for IntArray {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let mut str = String::new();
for x in &self.ranges {
if x.count == 1 {
str.push_str(&*format!("{}, ", x.start));... | Rust | 0 |
let bindings = bindgen::Builder::default()
.generate_comments(true)
.header("src/wrapper.cpp")
.rust_target(bindgen::RustTarget::Nightly)
.clang_arg("-x")
.clang_arg("c++")
.clang_arg("--std=c++14")
.clang_arg(format!("-I{}", v8_dir.join("include").to_str().un... | Rust | 0 |
# GUI for vision close-loop replay
# This is no need to be a multi-process GUI
import os, time
from math import cos, pi, sin
from typing import Dict, List, Tuple
import dearpygui.dearpygui as dpg
import numpy as np
from matplotlib import pyplot as plt
from simModel.DataQueue import (
ERD, JLRD, LRD, RGRD, VRD, C... | Python | 1 |
import ctypes
import struct
def _decipher(v, k):
"""
TEA decipher algorithm. Decodes a length-2 vector using a length-4 vector as a length-2 vector.
Compliment of _encipher.
:param v:
A vector representing the information to be deciphered. *Must* have a length of 2.
:param k:
A ... | Python | 1 |
t ("en train processing finished")
df_en_test, qid_dict_en_test, result_dict_en_test = \
get_data(os.path.join(DATA_DIR, "test", "test_en.tsv"), NUM_PAGES_RESULT)
print ("en test processing finished")
en_train_result, en_train_predict_dict, en_train_score_dict = \
get_top_pages(en_bm25_model... | Python | 1 |
# Virtual pin that propagates its changes to multiple output pins
#
# Copyright (C) 2017-2021 Kevin O'Connor <kevin@koconnor.net>
#
# This file may be distributed under the terms of the GNU GPLv3 license.
class PrinterMultiPin:
def __init__(self, config):
self.printer = config.get_printer()
ppins ... | Python | 1 |
into!(source, destination);
async_spawn(self, |inner| async move {
commands::lists::brpoplpush(&inner, source, destination, timeout)
.await?
.convert()
})
}
/// The blocking equivalent of [Self::lmove].
///
/// <https://redis.io/commands/blmove>
fn blmove<R, S, D>(
&self,
... | Rust | 0 |
c) 2017 <NAME>
// Copyright (c) 2021 <NAME> <<EMAIL>>
//
// 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 restriction, including without limitation the rights
// to use, copy, modif... | Rust | 0 |
class qmcsystem:
lattice = [[0.0, 0.0, 0.0],\
[0.0, 0.0, 0.0],\
[0.0, 0.0, 0.0]]\
def get_parameter (self, par_elem):
name = par_elem.attributes["name"]
print "name = " + name.value
val = ""
for elem in par_elem.childNodes:
print elem
... | Python | 1 |
manager = AssetManager(None, None)
result = manager.get_entity_from_database("AAPL")
assert result is None
# ============================================================================
# SET ENTITY TO DATABASE TESTS
# =================================================================... | Python | 1 |
from .common_utils import *
def put_in_center(img_np, target_size):
img_out = np.zeros([3, target_size[0], target_size[1]])
bbox = [
int((target_size[0] - img_np.shape[1]) / 2),
int((target_size[1] - img_np.shape[2]) / 2),
int((target_size[0] + img_np.shape[1]) / 2),
... | Python | 1 |
postfix ) = ( "prefix", 1, 2, 3, "postfix" );
/// braces_unwrap!
/// (
/// dbg where
/// @Prefix{ prefix, }
/// @Postfix{ postfix }
/// @SRC{ { a, b, c, } }
/// );
/// // generates :
/// // dbg!( prefix, a, b, c, psotfix );
/// braces_unwrap!
/// (
/// dbg where
/// @Prefix{ prefi... | Rust | 0 |
: "group_attributes",
"conditions": [
["project_id", "IN", [groups[0].project_id]],
],
"orderby": ["group_id"],
"consistent": True,
"tenant_ids": {
"referrer": "group_attributes",
... | Python | 1 |
RegionRegistry::new();
let mut manager = DummyChunkManager::new();
let mut source = CachedMMSource::new(Some(SharedPtrBox::new_ref(®istry)),MMSRC_MAX_SIZE,MMSRC_THREASHOLD,MMSRC_KEEP_RESIDUT);
//allocate
let (seg,zeroed) = source.map(4*1024*1024,true,Some(SharedPtrBox::new_ptr_mut(&... | Rust | 0 |
# Copyright (C) 2020-2025 Fraunhofer ITWM and Sebastian Blauth
#
# This file is part of cashocs.
#
# cashocs is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your optio... | Python | 1 |
p = 0.0
if g > 0:
p = float(g) / n
acc_entropy += entropy([p, 1.0 - p])
return acc_entropy / len(grid_counters), grid_counters
def jensen_shannon_divergence(P, Q):
if np.any(P < 0) or np.any(Q < 0):
raise ValueError('Negative values.')
if len(P) != len(Q):
... | Python | 1 |
: Decimal,
}
/// All this to get a unique secondary index on the pubkey, so we can ensure uniqueness.
/// (It also allows reverse lookup from the pubkey to operator address if needed)
pub fn operators<'a>() -> IndexedMap<'a, &'a Addr, OperatorInfo, OperatorIndexes<'a>> {
let indexes = OperatorIndexes {
pub... | Rust | 0 |
86_64"),
not(aes_force_soft)
))] {
mod autodetect;
mod ni;
pub use autodetect::*;
} else {
pub use soft::*;
}
}
pub use cipher;
use cipher::{
consts::{U16, U8},
generic_array::GenericArray,
};
pub type Block = GenericArray<u8, U16>;
pub type Block8 = Generic... | Rust | 0 |
coin::util::key::Error),
}
impl From<bip32::Error> for Error {
fn from(error: bip32::Error) -> Self {
Error::Bip32(error)
}
}
impl From<secp256k1::Error> for Error {
fn from(error: secp256k1::Error) -> Self {
Error::Ecdsa(error)
}
}
impl From<bitcoin::util::key::Error> for Error {
... | Rust | 0 |
# Copyright 2025 © BeeAI a Series of LF Projects, LLC
# SPDX-License-Identifier: Apache-2.0
from collections.abc import AsyncIterator
from a2a.types import Artifact, Message
from beeai_sdk.a2a.extensions.services.platform import (
PlatformApiExtensionServer,
PlatformApiExtensionSpec,
)
from beeai_sdk.platfor... | Python | 1 |
# Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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 a... | Python | 1 |
$code, c)),
};
$value = match $value.$op(as_cast(digit)) {
Some(v) => v,
None => return Err((ErrorCode::$code, c)),
};
}
);
}
// Parse the digits for the atoi processor.
perftools_inline!{
pub(crate) fn parse_digits<T>(digits: &[u8], ra... | Rust | 0 |
e_to_handle(RPC_METHOD_NAME);
let (ws_handler, connection_registry) =
create_ws_handler(io_handler, Some(connection_hash.clone()));
let handle_result = ws_handler.handle_message(connection_token, message);
assert!(handle_result.is_ok());
assert!(connection_registry.withdraw(&connection_hash).is_some());
... | Rust | 0 |
e mining problem
#[prost(bytes="vec", tag="3")]
pub nonce: ::prost::alloc::vec::Vec<u8>,
/// `indep_hash` of the previous block in the weave
#[prost(bytes="vec", tag="4")]
pub previous_block: ::prost::alloc::vec::Vec<u8>,
/// POSIX time of block discovery
#[prost(uint64, tag="5")]
pub ti... | Rust | 0 |
.14 (id: 4580, stack: 0)
RedSandstoneWall, // 1.14 (id: 4753, stack: 0)
SandstoneWall, // 1.14 (id: 18470, stack: 0)
Scaffolding, // 1.14 (id: 15757, stack: 0)
SkullBannerPattern, // 1.14 (id: 7680, stack: 1)
SmithingTable, // 1.14 (id: 9082)
Smoker, // 1.14 (id: 24781, stack: 0)
SmoothQuart... | Rust | 0 |
_str(&date_string, &format_string) {
return Ok(Moment {
time_zone: date_time.timezone(),
date_time,
locale: LOCALE_EN_US.clone(),
});
}
Err(format!(
"Date, \"{}\", could not be parsed with format string \"{}\"",
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.