text string | label_name string | labels int64 |
|---|---|---|
Mut, ViewMut<Parent<MyTree>>, ViewMut<Child<MyTree>>), ViewMut<usize>)>().unwrap();
let mut hierarchy = (&mut hierarchy.0, &mut hierarchy.1, &mut hierarchy.2);
let root = {
let entities = &mut hierarchy.0;
entities.add_entity((), ())
};
let e0 = hierarchy.attach_new(root);
let e1 ... | Rust | 0 |
n timed out')
def wrap_socket(sock, keyfile=None, certfile=None,
server_side=False, cert_reqs=CERT_NONE,
ssl_version=PROTOCOL_SSLv23, ca_certs=None,
do_handshake_on_connect=True,
suppress_ragged_eofs=True,
ciphers=None):
return SSLSoc... | Python | 1 |
l\x95\xd0 6\x9b6i\x9aU\xabV\xab\x09\x0d\x0e\
\x10\xe7\xc0\xdc8\xac\x87\x1aP\xd5\x18\xac8\xb8\x15\x1b\
\x16g`\xd9;\x05\xc8\x15\x8c@\xa4\x01c\x0c\x02c\
\x10\x06\x11\x02\x09a\x8c\x22\x82\x04\xcc\xd7\x0e\xf8\xc33\
\xe0\x19\xf0\x0cx\x06<\x03\x9e\x81c\x94\x01\xdfm\xcf\
\xc0\x9ca \x9bS[\x07\x95{6\x9a\xf3[\xb4\xa0\
\xb1\x9c\x1... | Python | 1 |
;
Currency::new("GBP", settlement)
}
fn sample_settlement(step: u32) -> RcDateRule {
let calendar = RcCalendar::new(Arc::new(WeekdayCalendar::new()));
RcDateRule::new(Arc::new(BusinessDays::new_step(calendar, step)))
}
fn sample_equity(currency: RcCurrency, step: u32) -> Equity {
let settlement = samp... | Rust | 0 |
::sync::Arc;
use crossbeam_queue::SegQueue;
use futures::future::BoxFuture;
use log::warn;
use crate::{
access::WriteStorage,
component::Component,
entity::{Builder, Entity},
system::SystemData,
};
use super::World;
/// Lazy updates can be used for world updates that need to borrow a lot of resource... | Rust | 0 |
msg)))
def recv(self):
byte = self.sock.recv(1)
if len(byte) == 0:
raise EOFError
byte = ord(byte)
#if byte in Telnetd.cmds:
# dbg("RECV " + str(Telnetd.cmds[byte]))
#else:
# dbg("RECV " + str(byte))
return byte
def recv_line(self):
line = ""
while True:
byte = self.recv()
if byte == Te... | Python | 1 |
-> T {
a.wrapping_shl(b)
}
fn wrapping_shr<T: WrappingShr>(a: T, b: u32) -> T {
a.wrapping_shr(b)
}
assert_eq!(wrapping_add(255, 1), 0u8);
assert_eq!(wrapping_sub(0, 1), 255u8);
assert_eq!(wrapping_mul(255, 2), 254u8);
assert_eq!(wrapping_shl(255, 8), 255u8);
assert_eq!(... | Rust | 0 |
tor!("path", "to", "file"), s);
```
*/
#[macro_export]
macro_rules! file_separator {
($($t:tt)*) => {
$crate::backslash!($($t)*)
};
}
#[cfg(unix)]
/**
Concatenate multiple strings with `FILE_SEPARATOR`. It can also be used to get the literal `FILE_SEPARATOR`.
```
#[macro_use] extern crate slash_format... | Rust | 0 |
address: super::super::Foundation::PWSTR, prelationship: *const DHCP_FAILOVER_RELATIONSHIP) -> u32;
#[doc = "*Required features: 'Win32_NetworkManagement_Dhcp', 'Win32_Foundation'*"]
#[cfg(feature = "Win32_Foundation")]
pub fn DhcpV4FailoverDeleteRelationship(serveripaddress: super::super::Foundation::PWSTR... | Rust | 0 |
sizes(&self, os: &mut ::protobuf::CodedOutputStream) -> ::protobuf::ProtobufResult<()> {
if let Some(v) = self.error.as_ref() {
try!(os.write_string(1, v.as_slice()));
};
for v in self.file.iter() {
try!(os.write_tag(15, ::protobuf::wire_format::WireTypeLengthDelimited));... | Rust | 0 |
t_eq!(
signers,
Signers::Implicit(vec![
Signer::Placeholder,
Signer::Root,
Signer::Treasury,
Signer::Placeholder,
])
);
assert_eq!(args, vec![ScriptArg::U8(1)]);
let (signers, args) = prepare_fun... | Rust | 0 |
#Embedded file name: /Users/versonator/Jenkins/live/output/mac_64_static/Release/python-bundle/MIDI Remote Scripts/Tranzport/consts.py
NOTE_OFF_STATUS = 128
NOTE_ON_STATUS = 144
CC_STATUS = 176
NUM_NOTES = 127
NUM_CC_NO = 127
NUM_CHANNELS = 15
NUM_PAGES = 4
PAGES_NAMES = (('P', 'o', 's', 'i', 't', 'i', 'o', 'n', ' ', '... | Python | 1 |
tus, body)),
})
}
///////////// Rreq codec functions
pub fn encode_rreq<W: Write + ?Sized>(writer: &mut W, frame: &Rmsg) -> io::Result<()> {
let (status, body) = rmsg_status_body(frame);
try!(writer.write_u8(status));
writer.write_all(body)
}
pub fn decode_rreq<R: Read>(mut reader: R) -> io::Result<R... | Rust | 0 |
# Copyright 2023 chengli
#
# 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 agreed to in writing, soft... | Python | 1 |
"""
if config is None:
config = self.config
credentials = config['GOOGLE_APPLICATION_CREDENTIALS']
os.environ['GOOGLE_APPLICATION_CREDENTIALS'] = credentials
self.database = initialize_firebase()
self.storage = config.get('FIREBASE_STORAGE_BUCKET')
# TODO: ... | Python | 1 |
= "0x74 - Fault Mode Status"]
pub fms: FMS,
#[doc = "0x78 - Input Capture Filter Control"]
pub filter: FILTER,
#[doc = "0x7c - Fault Control"]
pub fltctrl: FLTCTRL,
#[doc = "0x80 - Quadrature Decoder Control And Status"]
pub qdctrl: QDCTRL,
#[doc = "0x84 - Configuration"]
pub conf: ... | Rust | 0 |
///
/// Returns `None` if the window doesn't use wayland (if it uses xlib for example).
fn get_wayland_client_surface(&self) -> Option<&WlSurface>;
/// Returns a pointer to the `WlDisplay` object of wayland that is used by this window.
///
/// For use with the `wayland-client` crate.
///
//... | Rust | 0 |
self.available_vertical_space();
let max_pinned_cnt = (max_entry_cnt + 1) / 2;
// Acquire read lock
let group = self.group.read(true);
// Set group name
let counter = group.counter();
let content;
if counter > 1 {
content = format!("- [{}] {}", coun... | Rust | 0 |
import telebot
from logik import Text2ImageAPI
import time
from config import TOKEN, API_KEY, SECRET_KEY
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(func=lambda message: True)
def hendle_message(message):
prompt = message.text
api = Text2ImageAPI('https://api-key.fusionbrain.ai/', API_KEY, SECRET_KEY)
... | Python | 1 |
ed by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
use super::... | Rust | 0 |
} {
value.push_str(", world!");
}
Ok::<String, io::Error>(value)
}));
let value = SHARED.get()?;
assert_eq!("Hello, world!", &*value);
# Ok(())
# }
```
*/
#[track_caller]
pub fn try_new_catch_unwind<E>(f: impl FnOnce() -> Result<T, E>) -> Self
... | Rust | 0 |
"""RF-DETR Large (Roboflow Inference) — minimal example with visualization."""
from PIL import Image
import matplotlib.pyplot as plt
import matplotlib.patches as patches
from inference import get_model
# Load RF-DETR Large model
model = get_model("rfdetr-large/1")
# Input image
image_path = "test_image.jpg"
image = ... | Python | 1 |
));
py_list
.iter(py)
.for_each(|pyobj| res.push(Box::new(PyChainObserver::new(pyobj))));
res
} else {
return ErrorCode::InvalidPythonObject;
};
let block_manager = (*(block_manager as *const BlockManager)).clone();
let state_database = (*(state_database ... | Rust | 0 |
#!/usr/bin/python3
my_array = [64, 34, 25, 12, 22, 11, 90, 5]
print(my_array)
n = len(my_array)
for i in range(n):
min_index = i
for j in range(i+1, n):
if my_array[j] < my_array[min_index]:
min_index = j
my_array[i], my_array[min_index] = my_array[min_index], my_array[i]
print("Sor... | Python | 1 |
if k in expand_rule_cache:
return 0
if k in rules:
dprint("len(rules[\""+str(k)+"\"])="+str(len(rules[k])), 3)
else:
dprint("rules[\""+str(k)+"\"] is not defined", 3)
expanded_keys, ct=expand_rule_keys(k)
dprint("Key \""+k+"\" has been expanded into "+str(len(expanded_keys))+" new unique keys, wi... | Python | 1 |
import urllib.request
import csv
import os
import shutil
import gzip
import hashlib
md5_hash = hashlib.md5()
a_file = open('oldchecksum.md5', "rb")
content = a_file.read()
md5_hash.update(content)
old_check = md5_hash.hexdigest()
url ='https://ftp.ncbi.nlm.nih.gov/pub/clinvar/vcf_GRCh38/clinvar.vcf.gz.md5'
urllib.req... | Python | 1 |
return var_exp - kl
def log_marginal_likelihood(self):
# maximize the lower bound
return self.elbo()
def _predict_f(self, X, full=False):
Kuu = self.kernel(self.Z())
Kus = self.kernel(self.Z(),X) # NxS
Luu = self._cholesky(Kuu, add_jitter=True) # NxN
a = to... | Python | 1 |
speed=30,
),
mock_instrument_core.move_to(
location=Location(Point(12, 24, 36), labware=None),
well_core=dest_well,
force_direct=True,
minimum_z_height=None,
speed=None,
),
mock_instrument_core.air_gap_in_place(
... | Python | 1 |
from datetime import datetime
from .. import Provider as CompanyProvider
def calculate_checksum(value: str) -> str:
factors = [3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8][-len(value) :]
check_sum = 0
for number, factor in zip(value, factors):
check_sum += int(number) * factor
return str((check_sum % 1... | Python | 1 |
from presidio_analyzer import AnalyzerEngine
from presidio_anonymizer import AnonymizerEngine
analyzer = AnalyzerEngine()
anonymizer = AnonymizerEngine()
def presidio_pii_check(text, project_id=None, session_id=None, user_id=None):
"""
Uses Microsoft Presidio to detect and optionally redact PII in a string.
... | Python | 1 |
return
super().update(other, **kwds)
def copy(self) -> PassData:
"""Returns a deep copy of the data."""
return copy.deepcopy(self)
def become(self, other: PassData, deepcopy: bool = False) -> None:
"""Become a copy of `other`."""
if deepcopy:
self._t... | Python | 1 |
ment to the definition for '%s'." % (f.name, rel_opts.object_name, r.get_accessor_name(), f.name))
# Check ordering attribute.
if opts.ordering:
for field_name in opts.ordering:
if field_name == '?': continue
if field_name.startswith('-'):
... | Python | 1 |
rpret(OperandCategory::SrcDestRegOrDeref)),
0b0111_0010 => (Opcode::MOV(size), Reinterpret(OperandCategory::SrcDestRegOrDeref)),
0b0111_0011 => (Opcode::MOV(size), Reinterpret(OperandCategory::SrcDestRegOrDeref)),
0b0111_0100 => (Opcode::NOP, Reinterpret(OperandCategory::Op74)),
0b0111_0... | Rust | 0 |
local_test == LocalTests.CREATE_ETH:
# btc_price = qis.load_df_from_csv(file_name=BTC_PRICES_FROM_2010, local_path=LOCAL_PATH).iloc[:, 0]
# eth_price = create_eth_price(btc_price=btc_price)
# print(eth_price)
from bbg_fetch import fetch_field_timeseries_per_tickers
bbg_price = fe... | Python | 1 |
from typing import Any, Tuple, Dict
from nonebot import on_regex, require, on_command
from nonebot.params import RegexGroup, CommandArg
from nonebot.adapters.onebot.v11 import (
Bot,
MessageEvent,
PRIVATE_FRIEND,
GROUP,
GroupMessageEvent,
MessageSegment,
Message
)
from ..xiuxian2_handle imp... | Python | 1 |
base).init();
// Update base address of logger
set_logger_base(self.base);
set_logger(&LOGGER).unwrap();
set_max_level(self.filter);
}
}
/// Create a builder for fine-tuning logger.
///
/// Call [`Builder::setup`][] to apply the configuration and actually setup the logger.
///
///... | Rust | 0 |
= value.as_str() {
if s == "red" {
map.clear();
return;
}
}
}
for (_, value) in map.iter_mut() {
prune_red(value);
}
... | Rust | 0 |
self.manager.send(cmd_ctx);
}
fn handle_umforward(
&self,
cmd_ctx: CmdCtx,
reply_receiver: CmdReplyReceiver,
) -> CmdReplyFuture {
let (mut cmd_ctx, redirection_times) = match Self::get_sub_command(cmd_ctx, 1) {
Some((cmd_ctx, sub_cmd)) => (cmd_ctx, sub_cmd.to_up... | Rust | 0 |
# Copyright (c) 2024 Allied Vision Technologies GmbH. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | Python | 1 |
# It will input the employee's years of service rendered in each category.
IT_yrs = float(input("Years serviced in IT Dept.: "))
ACCT_yrs = float(input("Years serviced in ACCT Dept.: "))
HR_yrs = float(input("Years servicedin HR Dept.: "))
# Amount of bonuses to be given.
if IT_yrs >= 10:
IT_bns = 10000
print ... | Python | 1 |
default();
let sent_report = Arc::new(Mutex::new(false));
let sent_report_clone = sent_report.clone();
test_harness(
|job| job.seconded_candidate = Some(collator_id.clone()),
|mut to_job, mut from_job| async move {
to_job
.send(CandidateSelectionMessage::Invalid(relay_parent, candidate_receipt))
... | Rust | 0 |
]
)
cb = fig.colorbar(c1, cax=cax)
# cb.ax.set_ylabel("Temperature", rotation=0, fontdict=fontdict)
cb.ax.tick_params(labelsize=11, direction="out")
# plt.suptitle(title)
# plt.tight_layout()
plt.savefig(save_path, bbox_inches="tight", dpi=600, pad_inches=0.05)
print(f"Save figure to {... | Python | 1 |
, gist_id, comment_id);
let req = GitHubRequest {
uri: request_uri,
body: None,
method: "DELETE",
headers: vec![]
};
let request = GitHubRequestBuilder::build(req, self.auth)?;
// --
let github_response = crate::adapters::fetch... | Rust | 0 |
file, packed};
///
pub mod mutable;
///
pub mod name;
///
pub mod transaction;
/// A validated and potentially partial reference name - it can safely be used for common operations.
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone, Copy)]
pub struct FullName<'a>(&'a BStr);
/// A validated complete and fully ... | Rust | 0 |
q6zequb-gYTdF2_ZEUtr8ywTXzLYtknzWU4nV8uVoo=".to_string(),
);
let rpc = Client::new(RPCBASE.to_string(), auth.clone()).unwrap();
let offer_rpc = get_new_wallet_rpc(&rpc, LOCALPARTY, auth.clone());
let accept_rpc = get_new_wallet_rpc(&rpc, REMOTEPARTY, auth.clone());
let sink_rpc = get_new_wallet_rpc... | Rust | 0 |
ecode::Lt,
Opcodes::GT => Bytecode::Gt,
Opcodes::LE => Bytecode::Le,
Opcodes::GE => Bytecode::Ge,
Opcodes::ABORT => Bytecode::Abort,
Opcodes::NOP => Bytecode::Nop,
Opcodes::EXISTS => Bytecode::Exists(load_struct_def_index(cursor)?),
Opc... | Rust | 0 |
import torch
def native_safe_softmax(x):
x_max, _ = x.max(axis=1)
x = x - x_max[:, None]
x = x.exp()
den = x.sum(axis=1)
return x / den[:, None]
if __name__ == "__main__":
# x = torch.randn(3, 4)
x = torch.tensor([range(64)]).reshape(1, 64)
out = native_safe_softmax(x)
print(x, o... | Python | 1 |
import json
import os
import time
import gradio as gr
from pydantic import ValidationError
from blueprints.architect import generate_blueprint, process_blueprint
from blueprints.schema import OpenAIResponse
NOTION_PAGE_ID = os.environ["NOTION_PAGE_ID"]
MODEL_NAME = os.environ["NOTION_GPT_MODEL_NAME"]
def gradio_bl... | Python | 1 |
ntiguous(
&self,
input: RawSlice<Complex<f32>>,
output: RawSliceMut<Complex<f32>>,
) {
let values = read_partial1_complex_to_array!(input, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16});
let out = self.perform_parallel_fft_direct(values);
write_partial_... | Rust | 0 |
self.config.gap_open_penalty,
self.config.gap_extend_penalty,
calc_bandwidth(query, target, bandwidth),
ptr::null_mut(),
ptr::null_mut(),
ptr::null_mut(),
)
}
}
pub fn extension_align(&self, query: &[u8... | Rust | 0 |
table))
}
}
impl<'lua> FromLua<'lua> for ModuleBuilder<'lua> {
fn from_lua(lua_value: LuaValue<'lua>, lua: &'lua Lua) -> LuaResult<Self> {
let table = LuaTable::from_lua(lua_value, lua)?;
Ok(Self { lua, table })
}
}
impl<'lua> ModuleBuilder<'lua> {
pub fn new(lua: &'lua Lua) -> Result<... | Rust | 0 |
e backup was successful.
Successful = 5,
/// The backup was skipped (without problems) for a given backup
/// window. Example: Instance was idle.
Skipped = 6,
/// The backup is about to be deleted.
DeletionPending = 7,
/// The backup deletion failed.
DeletionFailed = 8,
/// The backu... | Rust | 0 |
parametrize("poly", ["triangle", "dodecagon",
"tetrahedron", "cube", "octahedron",
"dodecahedron", "icosahedron"])
def test_equal_area_reconstitution(self, poly):
points = _generate_polytope(poly)
n, dim = points.shape
... | Python | 1 |
建 {} 个提醒和任务
{}
注:时间格式为 HH:MM 或 HHMM,如 8:05 或 0805
指令任务自定义标识说明:
- 使用 ---- 分隔符可以自定义指令任务的标识文字
- 格式:指令----位置--自定义文字
- 位置可选:before(开头)、after(末尾)、start(开头)、end(末尾)
- 示例:/rmd--ls----before--每日提醒 或 /rmd--ls----after--执行完成
- 如果不使用 ---- 分隔符,默认显示 [指令任务]
法定节假日数据来源:http://timor.tech/api/holiday""".format(
self.sta... | Python | 1 |
l,
liquid_tips=test_tips_liquid[:NUM_TRIALS],
probing_tips=test_tips_probe[:NUM_TRIALS],
src_well=reservoir["A1"],
wells=test_wells[:NUM_TRIALS],
dispense_from_bottom=dispense_from_bottom,
probe_yes_or_no=probe_yes_or_no,
... | Python | 1 |
"""author: J Morris (UKAEA)
This module contains the PROCESS CCFE HCPB blanket model
based on CCFE HCPB model from the PROCESS engineering paper
PROCESS Engineering paper (M. Kovari et al.)
### References
- Kovari et al., Fusion Engineering and Design 104 (2016) 9-20
"""
# Smeared densities of build sections
armour_d... | Python | 1 |
let _lc6 = gpioa.pa8.into_push_pull_output();
unsafe {
let dma1 = &*stm32::DMA1::ptr();
let gpioa_odr = (*stm32::GPIOA::ptr()).odr.as_ptr();
let gpiob_idr = (*stm32::GPIOB::ptr()).idr.as_ptr();
let gpiob_odr = (*stm32::GPIOB::ptr()).odr.as_ptr();
... | Rust | 0 |
reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum TX_MAC_TIMER_TX_MAC_TIMER_A {
#[doc = "0: `0`"]
TX_MAC_TIMER_TX_MAC_TIMER_DEFAULT = 0,
}
impl From<TX_MAC_TIMER_TX_MAC_TIMER_A> for u8 {
#[inline(always)]
fn from(variant: TX_MAC_TIMER_TX_MAC_TIMER_A) -> Self {
variant as ... | Rust | 0 |
def print_board(board):
for row in board:
print(" | ".join(row))
print("-" * 9)
def check_winner(board, player):
for i in range(3):
# Check rows and columns
if all(board[i][j] == player for j in range(3)) or all(board[j][i] == player for j in range(3)):
return True
... | Python | 1 |
p = self.w_p(x_p)
g_d = self.pool(g_d, d_mask)
p_scores = torch.bmm(g_p, g_d.transpose(1, 2)) / math.sqrt(self.dim_model)
p_scores = p_scores.masked_fill(p_mask.unsqueeze(-1), -1e9)
attention_p = F.softmax(p_scores, dim=1)
g_p = g_p * attention_p
c = g_p.sum(dim=1)
... | Python | 1 |
# Two options to reference the original document
# Option 1 (choose one of the options)
'referencia_manual': 'FR BILL/3', # put the name of the original document
# Option 2 (choose one of the options)
'lancamento_pai_id': 399, # put the ID of the parent transaction
... | Python | 1 |
pulation.fill_diagonal_tensor
self.set_npu()
self.init_kernel_type()
x = np.random.random((2, 20, 20, 3)).astype(self.dtype)
y = np.random.random((2, 3, 18)).astype(self.dtype)
dim1 = 1
dim2 = 2
offset = 2
out = fill_gt(x, y, offset, dim1, dim2)
s... | Python | 1 |
= ch1 * ch2;
let num_blocks = input.len() / (block_size);
debug_assert_eq!(input.len(), output.len());
debug_assert!(input.len() % (block_size) == 0);
for b in 0..num_blocks {
let input_offset = (num_blocks - b - 1) * block_size;
let output_offset = b * block_size;
for c2 in 0..ch2 {
for c1 in 0..ch1 {
... | Rust | 0 |
"""
==========================================================================
MulRTL.py
==========================================================================
Muliplier for CGRA tile.
Author : Cheng Tan
Date : November 28, 2019
"""
from pymtl3 import *
from pymtl3.stdlib.ifcs import SendIfcRTL, Rec... | Python | 1 |
#!/usr/bin/env python
# coding=utf-8
# Copyright 2023 The HuggingFace Inc. team. 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/L... | Python | 1 |
class Auto:
def __init__(self,rekisteritunnus,huippunopeus):
self.rekisteritunnus = rekisteritunnus
self.huippunopeus = huippunopeus
self.nopeus = 0
self.matka = 0
auto = Auto("ABC-123", 142)
print(f"Uuden auton rekisteritunnus: {auto.rekisteritunnus},huippunopeus {auto.huippunop... | Python | 1 |
--gpu-ids` is deprecated, please use `--gpu-id`. '
'Because we only support single GPU mode in '
'non-distributed training. Use the first GPU '
'in `gpu_ids` now.')
if args.gpus is None and args.gpu_ids is None:
cfg.gpu_ids = [args.gpu_id]
... | Python | 1 |
#!/usr/bin/env python
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "L... | Python | 1 |
","api":""}}
"#, dl_url()))
.build();
}
pub fn mock_archive(name: &str, version: &str, deps: &[(&str, &str, &str)]) {
let mut manifest = format!(r#"
[package]
name = "{}"
version = "{}"
authors = []
"#, name, version);
for &(dep, req, kind) in deps.iter() {
... | Rust | 0 |
'process') >= 0:
appPid = findall(r'Using .* image of child process (\d+)',gdb_line)
elif gdb_line.find('Thread') >= 0: # solaris
appPid = findall(r'Using .* image of child .* \(LWP (\d+)\).',gdb_line)
... | Python | 1 |
`*"]
pub const ER_PACKET_TOO_LARGE: QStatus = 37037i32;
#[doc = "*Required features: `\"Win32_Devices_AllJoyn\"`*"]
pub const ER_PACKET_BAD_PARAMETER: QStatus = 37038i32;
#[doc = "*Required features: `\"Win32_Devices_AllJoyn\"`*"]
pub const ER_PACKET_BAD_CRC: QStatus = 37039i32;
#[doc = "*Required features: `\"Win32_De... | Rust | 0 |
Renderer};
use nalgebra::{base::allocator::Allocator, DefaultAllocator, DimName, Point, Point3, U2, U3};
use slam_cv::Number;
pub struct PointsModel<N, D>
where
N: 'static + Number,
D: DimName,
DefaultAllocator: Allocator<N, D>,
{
points: Vec<Point<N, D>>,
}
impl<N, D> PointsModel<N, D>
where
N: ... | Rust | 0 |
import os
import sys
import argparse
import importlib
import multiprocessing
import cv2 as cv
import torch.backends.cudnn
env_path = os.path.join(os.path.dirname(__file__), '..')
if env_path not in sys.path:
sys.path.append(env_path)
import ltr.admin.settings as ws_settings
def run_training(train_module, train_... | Python | 1 |
44";
let signer = Pair::from_string("//Alice", None).map_err(|_| BotError::NoSigner)?;
let signer = PairSigner::<DefaultNodeRuntime, Pair>::new(signer);
let client: Client<DefaultNodeRuntime> = subxt::ClientBuilder::new()
.set_url(url)
.skip_type_siz... | Rust | 0 |
# 10.11.54.69
# as degrees.
# I can't find this definition in documentation anywhere, though.
unit = u.deg
if len(string_rep.split('.')) >= 3:
string_rep = string_rep.replace('.', ':', 2)
elif string_rep.count(':') == 2:
unit = u.hour
return An... | Python | 1 |
) -> Result<MsgQueueMergerIterator> {
MsgQueueMergerIterator::from_manager(self, shard)
}
/// find enquque message and return it with neighbor id
pub fn find_message(&self, key: &OutMsgQueueKey, prefix: &AccountIdPrefixFull) -> Result<(Option<BlockIdExt>, Option<MsgEnqueueStuff>)> {
for nb ... | Rust | 0 |
# PROVA AULA 05 Desenvolva um programa em Python para calcular a média de notas de alunos em uma disciplina. O programa deve solicitar ao usuário o número de alunos e, em seguida, para cada aluno, pedir o nome e três notas. Utilize um loop 'for' para iterar sobre os alunos e suas notas.
# Além disso, implemente uma es... | Python | 1 |
rder-radius: 5px;
padding-left: 10px;
padding-right: 10px;
padding-top: 10px;
padding-bottom: 10px;
}
QCheckBox {
background-color: transparent; /* Transparent background for checkboxes */
}
... | Python | 1 |
is {mode}, Current pop size: {pop_size}\033[0m")
print(f"\033[91mTotal cost: {end - start}\033[0m")
torch.cuda.empty_cache()
if __name__ == "__main__":
from gapa.utils.init_device import init_device
device, world_size = init_device(world_size=2)
# device, _ = mutil_init_device(world_size=2)
im... | Python | 1 |
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 |
("|| |-||| ");
table.set_header(vec![
"".to_string(),
"M=10".to_string(),
"M=100".to_string(),
"M=1000".to_string(),
]);
for &l in &[10, 100, 1000] {
let mut row = vec![format!("L={}", l)];
for &m in &[10, 100, 1000] {
if l == 1000 && m ... | Rust | 0 |
r = 0x0D
Escape = 0x1B
Space = 0x20
Tab = 0x09
Backspace = 0x08
Delete = 0x2E
Insert = 0x2D
Home = 0x24
End = 0x23
PageUp = 0x21
PageDown = 0x22
# Arrow keys
LeftArrow = 0x25
UpArrow = 0x26
RightArrow = 0x27
DownArrow = 0x28
# Numpad keys
Numpad0 = 0... | Python | 1 |
/// let client = NacosClient::new(
/// &nacos,
/// ServerConfig::new("127.0.0.1", 8080, "test"),
/// );
///
/// // register current instance to nacos
/// // and new thread in background send and ack hart beat
/// client.register(&None).await;
/// ```
pub async fn register... | Rust | 0 |
ct(),
disabled: false,
}
}
}
#[derive(Debug, Serialize)]
pub struct WireConfig {
#[serde(rename = "core.themes")]
themes: Vec<String>,
}
impl Themeable for Atom {
fn config_state(&self, config: &ThconConfig) -> ConfigState {
ConfigState::with_default_config(config.atom.as_r... | Rust | 0 |
log.info("changing mode of %s from %o to %o", file, oldmode, newmode)
os.chmod(file, newmode)
@staticmethod
def _validate_shebang(shebang, encoding):
# Python parser starts to read a script using UTF-8 until
# it gets a #coding:xxx cookie. The shebang has to be the
# f... | Python | 1 |
metadata = dict(llm.metadata)
metadata["llm_classname"] = llm.class_name()
metadata["duration"] = duration
result = IdentifyWBSTaskDependencies(
query=query,
response=json_response,
metadata=metadata
)
return result
def raw_resp... | Python | 1 |
:c_void;
}
extern "C" {
pub fn malloc_usable_size(__ptr: *const ::std::os::raw::c_void) -> size_t;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct mallinfo {
pub arena: size_t,
pub ordblks: size_t,
pub smblks: size_t,
pub hblks: size_t,
pub hblkhd: size_t,
pub usmblks: size_t,
pub ... | Rust | 0 |
import unittest
import pytest
from typing import NamedTuple, Optional
from .template import (
sd_version,
StableDiffusionVersion,
is_full_coverage,
APITestTemplate,
living_room_img,
general_negative_prompt,
)
base_prompt = "A modern living room"
general_depth_modules = [
"depth",
"dep... | Python | 1 |
#python program that prints a pyramid pattern with a given height
def print_pyramid(height):
for i in range(1, height + 1):
print(" " * (height - i) + "*" * (2* i - 1))
pyramid_height = int(input("Enter the height of the pyramid: "))
print_pyramid(pyramid_height)
| Python | 1 |
import numpy as np
import minari
import cv2
# 1) load the expert AdroitHandDoor dataset
dataset = minari.load_dataset("D4RL/door/expert-v2")
# grab the first full episode
episode = next(dataset.iterate_episodes())
obs = episode.observations # shape (T+1, 39), float64
acts = episode.actions # shape (T, ... | Python | 1 |
#!/usr/bin/env python3
"""
🚀 GHOST KITTY AUDIO CONVERTER - MEGA ENHANCEMENT INSTALLER 🚀
This script will install all the cool new features and dependencies!
"""
import subprocess
import sys
import os
import platform
from pathlib import Path
def print_banner():
"""Print cool installation banner"""
banner = "... | Python | 1 |
rackEnded<Self> {
OnStreamTrackEnded::new(self.inner.as_ref())
}
pub fn on_track_mute(&self) -> OnStreamTrackMute<Self> {
OnStreamTrackMute::new(self.inner.as_ref())
}
pub fn on_track_unmute(&self) -> OnStreamTrackUnmute<Self> {
OnStreamTrackUnmute::new(self.inner.as_ref())
... | Rust | 0 |
to_unzip.files);
Self { files }
}
pub fn is_empty(&self) -> bool {
self.files.is_empty()
}
pub async fn unzip(self) -> Result<()> {
let multibar = MultiProgress::new();
let all_zips_pb = multibar.add(ProgressBar::new(self.files.len() as u64));
all_zips_pb.set_s... | Rust | 0 |
: f64,
b: f64,
}
dyon_obj! {Args {a, b}}
#[derive(Debug)]
struct RustArgs {
a: f64,
b: f64,
}
dyon_fn! {fn a_of(obj: RustObject) -> f64 {
let obj_guard = obj.lock().unwrap();
obj_guard.downcast_ref::<RustArgs>().unwrap().a
}}
dyon_fn! {fn b_of(obj: RustObject) -> f64 {
let obj_guard = obj.lo... | Rust | 0 |
# demo_client.py
"""
Demo client to test the multi-agent system
Shows how Agent2 calls Agent1 to create reports
"""
import requests
import json
import time
AGENT1_URL = "http://localhost:8001"
AGENT2_URL = "http://localhost:8002"
def test_agent1_direct():
"""Test Agent1 directly"""
print("=== Testing Agent1 ... | Python | 1 |
# 7 - Algoritmo de Conversão de Tempo:
# Desenvolva um algoritmo que converta uma quantidade de
# segundos fornecida pelo usuário em horas, minutos e segundos.
# h = 3.600 m = 60 s = 1
h = 3 | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2022 Google LLC. 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 requir... | Python | 1 |
,
)
)
await user_super_obj.by_user_roles.add(super_role_obj)
admin_role_obj: Role | None = await role_controller.get_by_code("R_ADMIN")
user_admin_obj = await user_controller.create(
UserCreate(
userName="Admin", # type: ignore
us... | Python | 1 |
(e > 0) * 2 - 1)
self._freq = freq
q_unnormed = np.einsum("AtQ, A -> AtQ", (proj_inv @ q).reshape(natm, 3, (proj_inv @ q).shape[-1]), 1 / np.sqrt(mol_weight))
q_unnormed = q_unnormed.reshape(-1, q_unnormed.shape[-1])
q_normed = q_unnormed / np.linalg.norm(q_unnormed, axis=0)
self... | Python | 1 |
f4.rgb;
} else {
float t = 1.0f - a;
f3.r = gBlindColor.r * a + f4.r * t;
f3.g = gBlindColor.g * a + f4.g * t;
f3.b = gBlindColor.b * a + f4.b * t;
f3 = FClamp01Float3(f3);
}
}
}
*v_out = rsPackColorTo8888(f3);
}use crate::fs::Dev;
u... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.