text string | label_name string | labels int64 |
|---|---|---|
ɪɴᴋꜱ
❏ ɢᴇᴛ ᴅɪʀᴇᴄᴛ ғɪʟᴇs
❏ ᴀᴅ-ғʀᴇᴇ ᴇxᴘᴇʀɪᴇɴᴄᴇ
❏ ʜɪɢʜ-sᴘᴇᴇᴅ ᴅᴏᴡɴʟᴏᴀᴅ ʟɪɴᴋ
❏ ᴍᴜʟᴛɪ-ᴘʟᴀʏᴇʀ sᴛʀᴇᴀᴍɪɴɢ ʟɪɴᴋs
❏ ᴜɴʟɪᴍɪᴛᴇᴅ ᴍᴏᴠɪᴇs ᴀɴᴅ sᴇʀɪᴇs
❏ ꜰᴜʟʟ ᴀᴅᴍɪɴ sᴜᴘᴘᴏʀᴛ
❏ ʀᴇǫᴜᴇs... | Python | 1 |
= StringField()
flowname = StringField()
template_name = StringField(default=None)
language_code = StringField(default=None)
retry_count = IntField(default=0)
bot = StringField(required=True)
user = StringField(required=True)
status = BooleanField(default=True)
timestamp = DateTimeField(... | Python | 1 |
{:?}.", magic).unwrap();
return;
}
let template_offset: u64 = unsafe { mem::transmute::<[u8; 8], u64>(template_offset).to_be()};
writeln!(out, "template_offset: {}", template_offset).unwrap();
if template_offset == 0 {
writeln!(out, "Incomplete file, skipping").unwrap();
retur... | Rust | 0 |
relateive addressing to read the current value of RIP (also gets RBP and RSP)
// llvm_asm!("lea $0, [rip]" : "=r"(rip), "={rbp}"(rbp), "={rsp}"(rsp) : : "memory" : "intel", "volatile");
// }
// debug!("register values: RIP: {:#X}, RSP: {:#X}, RBP: {:#X}", rip, rsp, rbp);
// let _curr_instruction_pointer = VirtualAd... | Rust | 0 |
from __future__ import annotations
import ctypes
import os
import platform
from ctypes import POINTER, byref, c_char_p, c_void_p
from .config import Config
from .jvm import JVM
from .logger import logger
class JVMLoader:
"""JVMローダー"""
def __init__(self, cfg: Config) -> None:
self.cfg = cfg
def... | Python | 1 |
),
flush=True,
)
# self.update(iter_num=i)
else:
print(
log_msg.format(
i,
len(iterable),
eta=e... | Python | 1 |
127, 255, cv2.THRESH_BINARY)
num_labels, labels = cv2.connectedComponents(thresh)
# Check the number of distinct buildings (subtract 1 because the background is also considered a label)
num_buildings = num_labels - 1
if num_buildings < 2:
print("Less than 2 distinct buildings found in the image... | Python | 1 |
from pydantic import BaseModel
from Alimentos import Alimento, alimento1
class BancoDados:
def __init__(self, objetoDados={}):
self.dados = objetoDados
#adicionar um novo alimento
def adicionarAlimento(self, alimento: Alimento):
self.dados[alimento.id] = alimento
def getAlimentos(self... | Python | 1 |
://en.wikipedia.org/wiki/Block_matrix#Direct_sum)
/// of two matrices.
fn direct_sum<T: Float>(mat1: &Matrix<T>, mat2: &Matrix<T>) -> Matrix<T> {
let dim1 = mat1.nrows();
let dim = dim1 + mat2.nrows();
Matrix::from_fn(dim, dim, |i, j| {
if i < dim1 {
if j < dim1 {
mat1[(... | Rust | 0 |
)
if filename:
content = self.chat_display.get("1.0", tk.END)
with open(filename, 'w', encoding='utf-8') as f:
f.write(content)
messagebox.showinfo("成功", "对话已保存")
except Exception as e:
messagebox.showerror("错误", f"保存失败:... | Python | 1 |
TomlTestConfig,
user_container: Arc<dyn CommandRunner>,
judger_container: Option<Arc<dyn CommandRunner>>,
mut raw_result_sink: Pin<Box<dyn Sink<RawTestCaseResult, Error = ()> + Send>>,
test_suite_base_dir: &'a Path,
cancel: CancellationTokenHandle,
) -> anyhow::Result<()> {
tracing::info!(%job.i... | Rust | 0 |
"), derive(Serialize))]
pub struct UpdateLedgerResponse {
/// <p>The Amazon Resource Name (ARN) for the ledger.</p>
#[serde(rename = "Arn")]
#[serde(skip_serializing_if = "Option::is_none")]
pub arn: Option<String>,
/// <p>The date and time, in epoch time format, when the ledger was created. (Epoch ... | Rust | 0 |
let proof = create_random_proof(
MySillyCircuit {
a: Some(a),
b: Some(b),
},
¶ms_deserialized,
rng,
)
.unwrap();
let proof_deserialized =
Proof::<E>::read_checked(to_bytes!(proof).unwrap().as_sli... | Rust | 0 |
ithout writing back modified cache blocks to memory.<br>"]
#[doc = " Cache access is blocked during this time.Bus accesses to the cache are signaled as a miss during invalidate-all operations."]
#[doc = ""]
#[doc = " \\return none"]
pub fn DCFlashInvalidate();
}
extern "C" {
#[doc = " \\fn vo... | Rust | 0 |
self.vdisks.get(&id).expect("vdisk not found").nodes()
}
pub fn get_support_nodes(&self, key: BobKey, count: usize) -> Vec<&Node> {
trace!("get target nodes for given key");
let target_nodes = self.get_target_nodes_for_key(key);
trace!("extract indexes of target nodes");
... | Rust | 0 |
ds):
grads_and_vars = list(zip(normalized_grads, var_list))
self._assert_valid_dtypes(
[v for g, v in grads_and_vars if g is not None])
apply_san_grads = self.apply_gradients(grads_and_vars,
global_step=global_step,
... | Python | 1 |
# -*- coding: utf-8 -*-
from unittest.case import TestCase
from 臺灣言語工具.解析整理.解析錯誤 import 解析錯誤
from 臺灣言語工具.語音合成.閩南語音韻.變調 import 規則變調
class 規則變調單元試驗(TestCase):
def test_規則變調(self):
原本 = ('s', 'ui', '2')
變調了 = ('s', 'ui', '1')
self.assertEqual(規則變調.變調(原本), 變調了)
def test_喉入聲(self):
... | Python | 1 |
import sqlite3
class LivreDatabase:
def __init__(self, db_name):
self.conn = sqlite3.connect(db_name)
self.conn.execute('''CREATE TABLE IF NOT EXISTS livres
(id INTEGER PRIMARY KEY, titre TEXT, auteur TEXT, annee INT)''')
def ajouter_livre(self, titre, auteur, anne... | Python | 1 |
n should
be modified, but the reason for a new documentation build does not justify
a new release of NEST. Example situations are the discovery of broken links
spelling errors, or styling issues. Moreover, this mechanism can be used to
customize to the look and feel of the NEST documentation in individu... | Python | 1 |
import os
import click
# 디렉토리 구조와 각 디렉토리에서 생성할 파일명 설정
DIRECTORY_STRUCTURE = {
"domain": ["{module}_entity.py"],
"endpoint": ["{module}.py"],
"facades": ["{module}_facade.py"],
"model/request": ["{module}_request.py"],
"model/response": ["{module}_response.py"],
"repository": ["{module}_reposito... | Python | 1 |
nsmute(i16x8::new(0, 1, 2, 3, 4, 5, 6, 7));
let b: vector_signed_int = transmute(i32x4::new(0, 1, 2, 3));
let d = i32x4::new(0 + 1 + 0, 2 + 3 + 1, 4 + 5 + 2, 6 + 7 + 3);
assert_eq!(d, transmute(vec_sum4s(a, b)));
}
#[simd_test(enable = "altivec")]
unsafe fn test_vec_mule_unsigned_c... | Rust | 0 |
ES}-shot/{examples_pref}/{MODEL}'
if not os.path.exists(path_to_results):
os.makedirs(path_to_results)
with open(f'{path_to_results}/{datetime.now().strftime("%Y-%m-%d_%H-%M-%S")}.txt', 'w', encoding="utf-8") as f:
f.write(f"Solution accuracy: {sol_acc}%\n")
f.write(f"Solution 2 accuracy... | Python | 1 |
tor(connector))
}
pub fn with_connector(connector: TlsConnector) -> NativeTls {
NativeTls { connector }
}
}
impl TlsHandshake for NativeTls {
fn tls_handshake(
&self,
domain: &str,
stream: Stream,
) -> Result<Box<TlsStream>, Box<Error + Sync + Send>> {
let s... | Rust | 0 |
self.shadow_evaluator.load_or_generate_sample_data(
self.config.eval_shadow_n,
self.config.seed
)
# 扩展到目标数量
training_samples = []
target_count = self.config.train_samples
samples_per_base = target_count // len(base_samples) + 1
f... | Python | 1 |
ck cycle"]
#[inline(always)]
pub fn deepsldur(&self) -> DEEPSLDUR_R {
DEEPSLDUR_R::new((self.bits & 0xffff_ffff) as u32)
}
}
<filename>impl-rustls/src/connector.rs
use std::convert::TryFrom;
use std::sync::Arc;
use rustls::StreamOwned;
use tls_api::async_as_sync::AsyncIoAsSyncIo;
use tls_api::spi_... | Rust | 0 |
# Generated by Django 5.0.4 on 2024-04-16 13:43
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shofy_api', '0002_alter_product_price_alter_product_store'),
]
operations = [
migrations.AlterField(
... | Python | 1 |
def __init__(self):
super().__init__()
# Test pooler with implemented precoarsening method but no trainable parameters
test_pooler = TestPrecoarsenablePooler()
assert test_pooler.is_precoarsenable, (
"Pooler with implemented precoarsening should be precoarsenable"
)
# Test poo... | Python | 1 |
, scroll_x, scroll_y):
'''Handler for the `pyglet.window.Window.on_mouse_scroll` event.
Mouse handlers do not check the bounds of the coordinates: GUI
toolkits should filter events that do not intersect the layout
before invoking this handler.
The layout viewport is scrolled by... | Python | 1 |
import numpy as np
import pickle
def load_obj(filename):
with open(filename + '.pkl', 'rb') as f:
return pickle.load(f)
# p(x, y)
def cal_p_xy_joint(x_class, y_class, key2ind_pair, joint_prob):
p_xy = joint_probability[key2ind_pair[x_class], key2ind_pair[y_class]] / np.sum(joint_probability)
ret... | Python | 1 |
let mut s_filename = String::with_capacity(
config.file_basename.len() + o_infix.map_or(0, str::len) + 1 + config.suffix.len(),
) + &config.file_basename;
if let Some(infix) = o_infix {
s_filename += infix;
};
s_filename += ".";
s_filename += &config.suffix;
let mut p_path = c... | Rust | 0 |
10_0000_00000000)
.setup(&|cpu| cpu.reg.r[0] = 0b1100_0011)
.assert_r(0, 0b1100_0011)
.assert_zero()
.run();
// AL R14,R0,#0
InstrTest::new_arm(0b1110_00_1_0000_0_0000_1110_0000_00000000)
.setup(&|cpu| cpu.reg.r[0] = 0b1100_0011)
.... | Rust | 0 |
fn password(
product_key: &str,
device_name: &str,
device_secret: &str,
assigned_client_id: bool,
) -> String {
let uuid = if assigned_client_id {
"".to_string()
} else {
format!("{}.{}", product_key, device_name)
};
super::sig... | Rust | 0 |
ntent.replace(keyword, "")
try:
if REQST_CHANNEL is not None and len(content) >= 3:
btn = [[
InlineKeyboardButton('ᴠɪᴇᴡ ʀᴇǫᴜᴇꜱᴛ', url=f"{message.link}"),
InlineKeyboardButton('ꜱʜᴏᴡ ᴏᴘᴛɪᴏɴꜱ', callback_data=f'show_option#{reporter}')
... | Python | 1 |
= rpc_endpoint.rpc_id().value();
if !context.rpc_map.contains(session_id, rpc_id) {
let full_url = rpc_endpoint.endpoint().full_url();
log::warn!(
"rpc to {} from {} not found, maybe timeout",
full_url,
... | Rust | 0 |
measure(1, 1);
}).unwrap();
assert_eq!(circuit.execute(nr_shots), Ok(()));
let hist = circuit.histogram_vec().unwrap();
assert_eq!(hist.iter().sum::<usize>(), nr_shots);
assert!(hist.iter().all(
|&count| crate::stats::measurement_ok(count, nr_shots, 0.25, t... | Rust | 0 |
_raw::R) reader structure"]
impl crate::Readable for SYS_TIMER_SYSTIMER_INT_RAW {}
#[doc = "`write(|w| ..)` method takes [sys_timer_systimer_int_raw::W](sys_timer_systimer_int_raw::W) writer structure"]
impl crate::Writable for SYS_TIMER_SYSTIMER_INT_RAW {}
#[doc = "SYS_TIMER_SYSTIMER_INT_RAW"]
pub mod sys_timer_systim... | Rust | 0 |
ord_is_greater_than_kick() {
let left = OrderedArsenalItem(ArsenalItem::Move(Move::NinjaSword));
let right = OrderedArsenalItem(ArsenalItem::Move(Move::Kick));
assert_eq!(Ordering::Greater, left.cmp(&right));
}
}
<filename>src/game/goal_wrong_reach_animation.rs
use crate::context::Context;
u... | Rust | 0 |
def finetune_HMDB_bs128(args):
args['batch_size'] = 128
args['test_batch_size'] = 64
args['test_no_frames'] = 5
args['fre_filter'] = 10000
args['fre_cache_filter'] = 5000
args['fre_valid'] = 1000
return args
def finetune_basics(args):
# args['port'] = 27006
args['port'] = 27007
... | Python | 1 |
ude::*;
use wasm_bindgen::JsCast;
use futures_signals::{
map_ref,
signal::{Mutable, ReadOnlyMutable, SignalExt, Signal},
signal_vec::{MutableVec, SignalVecExt, SignalVec},
CancelableFutureHandle,
};
use web_sys::{HtmlElement, Element, HtmlInputElement, HtmlIFrameElement, HtmlTextAreaElement};
use domi... | Rust | 0 |
_lower_short(b: &mut Bencher) {
let name1 = Name::from_ascii("com").unwrap();
b.iter(|| {
let lower = name1.to_lowercase();
assert_eq!(lower.num_labels(), 1);
});
}
#[bench]
fn name_no_lower_medium(b: &mut Bencher) {
let name1 = Name::from_ascii("example.com").unwrap();
b.iter(|| ... | Rust | 0 |
pub tdbah: Volatile<u32>, // 0x6004
/// Transmit Descriptor Length
pub tdlen: Volatile<u32>, // 0x6008
/// Tx DCA Control Register
pub dca_txctrl: Volatile<u32>, // 0x600C
/// Transmit Descri... | Rust | 0 |
# ----------------------------------------
# CLASE 36: PROGRAMACIÓN ASÍNCRONA (ASYNC, AWAIT, ASYNCIO)
# ----------------------------------------
# 📌 Recordatorio:
# - La programación asíncrona permite ejecutar múltiples tareas concurrentemente
# sin bloquear el programa.
# - Se usa principalmente para operaciones d... | Python | 1 |
_add(1);
(*stcb).asoc.total_flight = (*stcb)
.asoc
.total_flight
.wrapping_add((*tp1).book_size as libc::c_uint)
} else if (*tp1).sent == 4i32 {
... | Rust | 0 |
me = self.project();
let handle = me.handle;
let inner = me.inner;
let unfilled = buf.initialize_unfilled();
let poll = handle.enter(|| inner.poll_read(cx, unfilled));
if let Poll::Ready(Ok(num)) = &poll {
buf.advance(*num);
}
poll.map_ok(|_| ())
... | Rust | 0 |
licon': ['LIAN.001.C02_10'],
'complete': [1],
'In0': [0],
'CALIN': [5],
}, columns=['ID_replicon', 'CALIN', 'complete', 'In0'])
exp = exp.astype(dtype=dtype)
exp = exp.set_index('ID_replicon')... | Python | 1 |
_empty() {
print_usage(&mut io::stderr(), &program, opts);
return;
}
let limit_store = match LimitStore::from_config_file(&config_filename) {
Ok(ls) => ls,
Err(e) => {
eprint!("Unable to open {}: {}\n", config_filename, e);
return;
}
};
}#[cf... | Rust | 0 |
B'),
# ARABIC LETTER GUEH
'\u06B3': ('\u06B3', '\uFB98', '\uFB99', '\uFB97'),
# ARABIC LETTER NOON GHUNNA
'\u06BA': ('\u06BA', '', '', '\uFB9F'),
# ARABIC LETTER RNOON
'\u06BB': ('\u06BB', '\uFBA2', '\uFBA3', '\uFBA1'),
# ARABIC LETTER HEH DOACHASHMEE
'\u06BE': ('\u06BE', '\uFBAC', '\uFB... | Python | 1 |
CONFIG[%s]"]
pub type W = crate::W<u32, super::CONFIG>;
#[doc = "Register CONFIG[%s]
`reset()`'s with value 0"]
impl crate::ResetValue for super::CONFIG {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[doc = "Input Sense Configuration 0\n\nValue on reset: 0"]
#[deri... | Rust | 0 |
import tqdm
class LearnScheduleIterator:
def __init__(self, learn_rate, max_steps, cur_step=0):
"""
specify learn_rate as "0.001:100, 0.00001:1000, 1e-5:10000" to have lr of 0.001 until step 100, 0.00001 until 1000, and 1e-5 until 10000
"""
pairs = learn_rate.split(',')
se... | Python | 1 |
nd_env(step: &Step) -> Step {
//clone data before modify
let mut config = step.config.clone();
//update command by replacing any env vars
match config.command {
Some(value) => {
config.command = Some(expand_value(&value));
}
None => {}
};
//update args by re... | Rust | 0 |
{website}")
# Create a reference entry with all information
entry = {
'website': website,
'title': title,
'url': ref,
'domain': domain,
'score': score
}
logger.info(f"Created reference entry: {entry}")
reference... | Python | 1 |
assert_eq!(a_type, Some(&Value::String("bool".to_string())));
assert_eq!(a_prompt, Some(&Value::String("foo".to_string())));
assert_eq!(a_default, Some(&Value::Boolean(false)));
assert_eq!(b_type, Some(&Value::String("string".to_string())));
assert_eq!(b_prompt, Some(&Value::String("... | Rust | 0 |
ess_dependency_links:
finder.process_dependency_links = True
if opts.trusted_hosts:
finder.secure_origins.extend(
("*", host, "*") for host in opts.trusted_hosts)
def break_args_options(line):
"""Break up the line into an args and options string. We only want to sh... | Python | 1 |
2947, 9, 1177, 45, 668, 3097, 13768, 23, 103, 28, 441, 148, 48, 20522, 19, 12943, 4354, 153, 12860, 34, 18, 326, 27, 17492, 684, 21, 6709, 9, 8585, 123, 266, 19, 12943, 4354, 153, 6872, 24, 3004, 20, 18, 9225, 2198, 19, 12717, 103, 22, 401, 24, 6348, 9, 12943, 4354, 153, 1068, 2768, 2286, 19, 33, 104, 19, 176, 24, 9313... | Python | 1 |
"""
Copyright 2013 Steven Diamond and Xinyue Shen.
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 ... | Python | 1 |
拽
ClickFilter()
Split = re.split('/', NowRowValue[local])
mylog('鼠标拖拽', Split)
pyautogui.dragTo(x=int(Split[0]), y=int(Split[1]), duration=3, button='left')
elif NowRowKey[local] == '相对拖拽':
Split = re.split('/', NowRowValue[local])
mylog('相... | Python | 1 |
)
for style in suggestions:
st.markdown(f"- {style}")
else:
st.error("No face detected. Please upload a clearer image.")
# Define a function to simulate the chatbot's responses
def get_chatbot_response(user_message):
# Simple logic for haircuts-related questions
responses = {... | Python | 1 |
let scoring = sample_scoring_rule();
let items = scoring.get_header_items_for_batter();
assert_eq!(9, items.len());
assert_eq!(
"Player,Team,FanPts,Pos,B.R,B.H,B.HR,B.RBI,B.SB",
items.join(",")
);
}
#[test]
fn get_header_items_for_pitcher_should_... | Rust | 0 |
status_flag(registers::CARRY_MASK, res & 0x80 != 0);
}
fn and_impl(cpu: &mut Cpu, operand: &Operand) {
cpu.r.a &= operand.val;
let res = cpu.r.a;
cpu.r.update_nz_flags(res);
}
fn and(cpu: &mut Cpu, addressing_mode: usize) {
let operand = cpu.get_operand(addressing_mode);
if operand.page_crossing {... | Rust | 0 |
LongDouble => "D",
FloatComplex => "jf",
DoubleComplex => "jd",
LongDoubleComplex => "jD",
Bool => "B",
Void => "v",
String => "*",
Object => "@",
Block => "@?",
Class => "#",
Sel => ":",
Unknown => "?",
BitField(b) => {
... | Rust | 0 |
fied EDA Summary"):
next(lit)
for line_2 in lit:
if line_2.strip().startswith("-----"):
break
info = line_2.split()
if info[0] in ["PREPARATION", "FROZEN", "DISPERSION", "POLARIZATION", "TOTAL"]:
eda2[info[0]... | Python | 1 |
ouldn't parse address: {}", err))?;
let value = right
.parse::<u64>()
.map_err(|err| format!("Couldn't parse value: {}", err))?
.into();
Ok(Assignment::Mem { address, value })
} else {
Err(format!("Unrecognized operation {}", s)... | Rust | 0 |
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, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o... | Rust | 0 |
by(&mut self, trans: &Matrix) {
*self
.stack
.last_mut()
.expect("Error trying to get the last stack") = trans * self.get_top_matrix();
}
}
// 2d shapes
impl<T: Canvas> Drawer<T> {
pub fn add_box(
&mut self,
(x, y, z): (f64, f64, f64),
dx: f64... | Rust | 0 |
import socket
def start_server(host='0.0.0.0', port=4444):
server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((host, port))
server.listen(5)
print(f"Listening on {host}:{port}")
while True:
client_socket, addr = server.accept()
print(f"Connection from {addr}")
... | Python | 1 |
st_engine_3d::vulkan_context::render_pass::{ RenderPassData, PipelineData };
use rust_engine_3d::utilities::system::RcRefCell;
use crate::renderer::project_renderer::ProjectRenderer;
use crate::renderer::shader_buffer_datas::ShaderBufferDataType;
// gpu_particle_constant_flags
const GPU_PARTICLE_CONSTANT_FLAG_NONE: u... | Rust | 0 |
},
}
}
pub fn from_iter<I>(&mut self, iter: I)
where
I: Iterator<Item = (Square, BoardSquare)>,
{
self.board = HashMap::from_iter(iter);
}
pub fn empty_square(&self, sq: &Square) -> bool
{
match self.get(sq)
{
Some(bs) => bs.pieces.is_emp... | Rust | 0 |
ля генерации CSRF токенов
def generate_csrf_token():
return secrets.token_urlsafe(32)
# Lifespan контекст для правильного управления жизненным циклом приложения
@asynccontextmanager
async def lifespan(app: FastAPI):
"""Управление жизненным циклом приложения с graceful shutdown"""
# Startup
logger.... | Python | 1 |
ency::Hz16000,
9 => SamplingFrequency::Hz12000,
10 => SamplingFrequency::Hz11025,
11 => SamplingFrequency::Hz8000,
12 => SamplingFrequency::Hz7350,
13 | 14 => track_panic!(ErrorKind::InvalidInput, "Reserved"),
15 => track_panic!(ErrorKind::InvalidI... | Rust | 0 |
_SCRIPTS"),
"nogvars": ("GVARS", "NO", "YES"),
"faimode": ("FAI", "YES", None),
"faichoice": ("FAI", "CHOICE", None),
"nooverridech": ("OVERRIDE_CHANNEL_FUNCTION", "NO", "YES"),
"flexr9m": ("MODULE_PROTOCOL_FLEX", "YES", None),
"internalmulti": ("INTERNAL_MODULE_MULTI", "YES", "NO"),
"blueto... | Python | 1 |
"""Fit a 3D polynomial surface to a set of noisy data using iminuit.
You can rotate the scene by dragging with the left mouse button."""
from iminuit import Minuit
from vedo import Points, Arrows2D, show, dataurl, printc, settings
def func(x, y, *pars):
# the actual surface model to fit
a, b, c, u, v = pars
... | Python | 1 |
r='white', hatch='xx', edgecolor='black', label='Unsafe region'),
Patch(facecolor=reset_color, alpha=0.5, label='Reset region')
]
ax.legend(handles=legend_elements, loc='upper left', fontsize=14, bbox_to_anchor=(0.1, 0.9))
plt.savefig(save_path, dpi=300, bbox_inches="tight")
plt.close(fig)
def... | Python | 1 |
in(&self) -> Option<f64> {
match self {
GainResult::ApproxGainResult(result) => result.max_gain,
GainResult::FullGainResult(result) => result.max_gain,
}
}
pub fn best_split(&self) -> Option<usize> {
match self {
GainResult::ApproxGainResult(result) =... | Rust | 0 |
pleted();
t
}
/// 1: EVENT_TYPE_WORKFLOW_EXECUTION_STARTED
/// 2: EVENT_TYPE_WORKFLOW_TASK_SCHEDULED
/// 3: EVENT_TYPE_WORKFLOW_TASK_STARTED
/// 4: EVENT_TYPE_WORKFLOW_TASK_COMPLETED
/// 5: EVENT_TYPE_MARKER_RECORDED (la result)
/// 6: EVENT_TYPE_TIMER_STARTED
/// 7: EVENT_TYPE_TIMER_FIRED
/// 8: EVENT_TYP... | Rust | 0 |
t<(), Error>
{
let direction = self.direction();
let up = compute_up_direction(direction);
self.shadow_camera = Some(Camera::new_orthographic(&self.context, target - direction.normalize()*0.5*frustrum_depth, *target, up,
frustrum_wi... | Rust | 0 |
io_postgres::{CancelToken, Row};
use tokio_postgres::error::Error as TokioPostgresError;
use tokio::time::timeout;
use std::time::{Duration, Instant};
use serde::Deserialize;
use dogstatsd::{Client as StatsdClient, Options as StatsdOptions};
// use config;
use std::env;
#[allow(unused_imports)]
use crate::{function, l... | Rust | 0 |
Vec<u8> {
if status == 0 {
self.build(CLOSE, Vec::new())
} else {
self.build(CLOSE, status.to_be_bytes().to_vec())
}
}
fn binary(&self, payload: Vec<u8>) -> Vec<u8> {
self.build(BINARY, payload)
}
fn text(&self, payload: String) -> Vec<u8> {
... | Rust | 0 |
class Solution:
def findTheDistanceValue(self, arr1: List[int], arr2: List[int], d: int) -> int:
count=0
for i in arr1:
for j in arr2:
if abs(i-j)<=d:
count+=1
break
return len(arr1)-count
| Python | 1 |
&'static (dyn Op + Sync)]>,
pub(super) op_code: u32,
pub(super) group_index: i32,
pub(super) rm_group_index: i32,
pub(super) enc_flags3: u32, // EncFlags3
pub(super) op_size: CodeSize,
pub(super) addr_size: CodeSize,
pub(super) is_2byte_opcode: bool,
pub(super) is_declare_data: bool,
}
#[repr(C)]
pub(super) st... | Rust | 0 |
'5 (cons '10 (cons '11 (cons '5 (cons '15 '())))))))";
test_helper(s, "c16.s", "5");
}<gh_stars>1-10
use axum::prelude::*;
use axum::ws::{ws, Message, WebSocket};
use eyre::Result;
use futures::future::{join_all, ready, select_all};
use futures::prelude::*;
use protocol::{Channel, Command};
use serde::Deserializ... | Rust | 0 |
",
vec![2240, 2105],
vec![Effect::RestoreArmor(10)],
0,
);
test_icon_id_effect(
&parser,
"<icon=3017>Sanguine Fangs deals +14% Crushing damage and doesn't cause the target to yell for help",
vec![3017],
vec![Effect::DamageMod(0.14)],
1,
);
... | Rust | 0 |
import os
from altair import themes
import openai
import streamlit as st
st.set_page_config(
page_title="Summarizer",
page_icon="📚",
)
from PyPDF2 import PdfReader
from dotenv import load_dotenv
load_dotenv()
openai.api_key = os.getenv("OPEN_API_KEY")
def load_files():
text= ""
data_dir= os.pa... | Python | 1 |
valSet::empty();
for i in 0..right {
res.push(self.intervals[i].clone());
}
if self.intervals[right].lower() <= ub {
res.push(Interval::new(self.intervals[right].lower(), ub));
}
res
}
else {
if self.is_empty() || ub < self.front().lower() {
IntervalSe... | Rust | 0 |
::new(
V3::new(0.0, -100.5, -1.0),
100.0,
materials.add(Lambertian::new(Box::new(ConstantTexture {
color: V3::new(0.8, 0.8, 0.0),
}))),
));
//center
hittable.add(Sphere::new(
V3::new(0.0, 0.0, -1.0),
0.5,
materials.add(Lambertian::new(Box:... | Rust | 0 |
import numpy as np
class KeystatePredictor:
def __init__(self,name,downsample_interval):
self.name = name
self.downsample_interval = downsample_interval
self.keystates = None
self.keystate_reasons = None
self.keystate_reasons_nl = None
... | Python | 1 |
nclude = r'^https?://'
exclude = r'^file://'
monitor = ClipboardMonitor(Args())
self.assertTrue(monitor.should_process_content("https://example.com"))
self.assertTrue(monitor.should_process_content("http://example.com"))
self.assertFalse(monitor.should_process_content("ftp:/... | Python | 1 |
import cairo
from PIL import Image
# Change these file names to the relevant files.
ORIGINAL_IMAGE = "example-output/smileyface-inverted.png"
IMAGE_TSP = "example-output/smileyface-inverted-1024-stipple.tsp"
IMAGE_CYC = "example-output/smileyface-inverted-1024-stipple.cyc"
def obtain_list_of_nodes():
list_of_nodes ... | Python | 1 |
"""
Wikisearch module
"""
import logging
import urllib.parse
from txtai.pipeline import Pipeline
# Logging configuration
logger = logging.getLogger(__name__)
class Wikisearch(Pipeline):
"""
Pipeline for multi-step RAG with Wikipedia. This pipeline queries a Wikipedia embeddings index and passes the results... | Python | 1 |
A512_224: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = 0x00000007;
pub const CKP_PKCS5_PBKD2_HMAC_SHA512_256: CK_PKCS5_PBKD2_PSEUDO_RANDOM_FUNCTION_TYPE = 0x00000008;
/// CK_PKCS5_PBKDF2_SALT_SOURCE_TYPE is used to indicate the
/// source of the salt value when deriving a key using PKCS #5
/// PBKDF2.
pub type CK_PKCS... | Rust | 0 |
Ok(_) => Ok(true),
Err(err) => {
if let Error::RowNotFound = err {
Ok(false)
} else {
Err(err)
}
}
},
))
}
... | Rust | 0 |
from starter import AOC, CURRENT_YEAR
from pathlib import Path
from re import findall
import re
CURRENT_DAY = int(Path(__file__).stem.replace('day_',''))
aoc = AOC(CURRENT_YEAR)
def solve_1(test_string = None) -> int:
inputs_1 = aoc.get_input(CURRENT_DAY, 1) if not test_string else test_string
regex = r'mul\(... | Python | 1 |
enerated Pattern:", font=("Poppins", 16, "bold"), bg="#f1f1f1"
)
pattern_label.pack()
pattern_text = tk.Text(
root, height=20, width=80, font=("Courier New", 12), relief="solid", bd=1
)
pattern_text.pack(pady=10)
code_label = tk.Label(
root, text="Python Code:", font=("Poppins", 16, "bold"), bg="#f1f1f1"
)
co... | Python | 1 |
!({"ok": false}))
}
}
<reponame>diggyk/sshcerts
/*
Copyright (c) 2017 <NAME> <<EMAIL>>
All rights reserved.
*/
//! This module is a heavily modified version of the `sshkeys` crate
//! that adds certificate verification, and many other things to
//! support that. The original licence for the code is in the source
/... | Rust | 0 |
#!/usr/bin/env python3
#
# Cyrius: CYP2D6 genotyper
# Copyright (c) 2019-2020 Illumina, Inc.
#
# Author: Xiao Chen <xchen2@illumina.com>
#
# This program 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 ... | Python | 1 |
Test querying waveforms from the database"""
signal_names = ["GMES", "PMES"]
process_names = ["raw", "power_spectrum"]
query = Query(db=TestQuery.db, signal_names=signal_names, array_names=process_names)
query.stage()
query.run()
meta = query.wf_meta
# Define s... | Python | 1 |
let offset = reader.read_u32::<LittleEndian>()?;
let _size_on_disk = reader.read_u32::<LittleEndian>()?;
let size = reader.read_u32::<LittleEndian>()?;
let _type = reader.read_u8()?;
let _compression = reader.read_u8()?;
let _pad = reader.read_u16::<LittleE... | Rust | 0 |
losses_decode = [self.loss_decode]
else:
losses_decode = self.loss_decode
for loss_decode in losses_decode:
l = self.weight_factors[0] * loss_decode(
seg_logits[0],
seg_labels[0],
weight=seg_weight,
ignore_index=self... | Python | 1 |
# 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
# "License"); you may not u... | Python | 1 |
from settings import PG_DSN
from sqlalchemy.ext.asyncio import create_async_engine, async_sessionmaker, AsyncAttrs
from sqlalchemy.orm import DeclarativeBase, mapped_column, Mapped
from sqlalchemy import Integer, String
engine_async = create_async_engine(PG_DSN)
Session_async = async_sessionmaker(engine_async, expire_... | Python | 1 |
from zrok.environment.root import Root
from zrok_api.models.access_request import AccessRequest
from zrok_api.models.unaccess_request import UnaccessRequest
from zrok_api.api import ShareApi
from zrok import model
class Access():
root: Root
request: model.AccessRequest
access: model.Access
def __init... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.