text string | label_name string | labels int64 |
|---|---|---|
zure_event_hubs_ingestion_tenant_id=azure_event_hubs_ingestion_tenant_id,
azure_event_hubs_ingestion_subscription_id=azure_event_hubs_ingestion_subscription_id,
azure_event_hubs_ingestion_service_account=azure_event_hubs_ingestion_service_account,
aws_msk_ingestion_cluster_arn=aws_msk_inge... | Python | 1 |
(rating_match.group(1)), reason_match.group(1).strip()
def remove_ground_truth_metadata(src):
src = re.sub(r'\{\-.*?\-\}', '', src, flags=re.DOTALL)
src = re.sub(r'--.*', '', src)
return src
def main():
api_key = os.getenv(GOOGLE_API_KEY_ENV_VAR)
if not api_key:
raise ValueError(f"Umgebung... | Python | 1 |
# 创建一个假的last_hidden_state
device = input_ids.device if input_ids is not None else self._device
last_hidden_state = torch.randn(
(batch_size, seq_len, self.config.hidden_size),
device=device,
dtyp... | Python | 1 |
through the
# body, we can just take them from body_model. Otherwise, we merge the
# two after "teleporting" model to the loop match address.
assert body_model.pc == end_addr + 4
if num_iters == 1:
model = body_model
else:
model.update_for_insn(hd_insn)
... | Python | 1 |
n disk_area_light_luminance_to_lumen(luminance: f32, radius: f32) -> f32 {
luminance * (radius * radius * std::f32::consts::PI * std::f32::consts::PI)
}
// Calculate tube area light's luminance (cd.m–2) from luminance power
// (luminance flux)
// L = φ / (2π * radius * width * 4π * radius^2) * π
pub fn tube_area_l... | Rust | 0 |
xa9\
XKn\xb0\xb3/\xd9\xae\xec\xf5\x1b9\x10\xa13\xc8\
\x8f$7\x90L\x98IHi\xe3\xb8RL\x8b0\x90\
\x8a\xf1M+\xe1O\x89~\x0e\xde\xeas\xfc*k\x0f\
\x12xC\xc4\xf2\xc9\xa9[|?k}7\xc2\xfaG\
\x85<J\xf7\xb3\xdd\xea\x13Z\xea\x16\xd70-\xbf\x86\
\xb5\xa4\xbd}\x96\xd0X\xdc\xde\xf8oP\xb4Y!\x87\
Y\xd3o\xe7\xb4\xb5\x1dF\x95\xb5\x8c\xee\xafy4... | Python | 1 |
"""
Unit to decode Morsecode
This unit will attempt to read data from Morsecode, both in the International
sound mapping as well as the text representation with dots and dashes.
"""
#!/usr/bin/env python3
import string
from typing import Any
import regex as re
from katana.unit import RegexUnit
class Unit(RegexU... | Python | 1 |
"""
pygments.styles.algol_nu
~~~~~~~~~~~~~~~~~~~~~~~~
Algol publication style without underlining of keywords.
This style renders source code for publication of algorithms in
scientific papers and academic texts, where its format is frequently used.
It is based on the style of the revised Alg... | Python | 1 |
import os
import sys
import argparse
import struct
def read_labels(filename):
""" read labels from given file. """
contents = bytes()
with open(filename, "rb") as f:
f.seek(0, 2) # move the cursor to the end of the file
num_points = int(f.tell() / 4)
f.seek(0, 0)
contents = f.read()
arr = [s... | Python | 1 |
anced_modern_article(analysis_result)
def test_apis() -> bool:
"""测试API连接"""
print("🧪 测试API连接...")
config = APIConfig()
validation = config.validate_config()
if not validation['valid']:
print("❌ 配置验证失败:")
for issue in validation['issues']:
print(f" - {issue}... | Python | 1 |
bases.skip(1)?;
}
} else {
// Place multiplication into the bucket: Separate s * P as
// (s/2^c) * P + (s mod 2^c) P
// First multiplication is c bits less, so one can do it,
... | Rust | 0 |
then used in all the mods if I have there use crate::*;
use crate::rootrenderingcomponentmod::RootRenderingComponent;
use crate::gamedatamod::*;
use dodrio_templating::*;
use dodrio_templating::routermod::Routing;
// use unwrap::unwrap;
use wasm_bindgen::prelude::*;
#[wasm_bindgen(start)]
#[allow(clippy::shadow_sam... | Rust | 0 |
r::FileError),
};
// Parse the TOML into our configuration structures
let config: Configuration = match toml::from_slice(&config) {
Ok(config) => config,
Err(_) => return Err(ConfigurationError::ParsingError),
};
// Verify that if using a yubikey the slots are provisioned or if fil... | Rust | 0 |
ommand = [executable]
log.info("executing %s" % command)
result = subprocess.run(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
result.check_returncode()
if result.stdout:
log.info("Output on stdout:\n%s\n-----" % result.stdout)
else:
log.info("N... | Python | 1 |
TouchSrcOpExt<V, Init>>::build(init)
}
pub trait RandomBitsSrcOpExt<V, Init> {
fn build(init: Init) -> Val<V>;
}
pub fn random_bits<V, Init>(init: Init) -> Val<V> where RandomBitsSrcOp: RandomBitsSrcOpExt<V, Init> {
<RandomBitsSrcOp as RandomBitsSrcOpExt<V, Init>>::build(init)
}
pub trait ZerosSrcOpExt<V, Init>... | Rust | 0 |
ground surface at N (x,y) query locations.
Raises:
ValueError: If `self.raster_ground_height_layer` is `None` or input is not a set of 2d coordinates.
"""
if self.raster_ground_height_layer is None:
raise ValueError("Raster ground height is not loaded!")
if poi... | Python | 1 |
_bitmap(&*bm));
let mut planes = map::PlanesSep::new();
planes.create_planes(&*bm);
let num_planes = planes.num_planes();
let (render_to_rad_send, render_to_rad_recv) = mpsc::channel();
let plane_scene = map::PlaneScene::new(planes, bm);
let (front_buf, rad_to_render_recv) =
rad::worke... | Rust | 0 |
start_time)
#save celf_solution_dict:
#save celf_solution_dict_test
celf_solution_dict[0] = [torch.zeros(testA.shape[0], dtype=torch.float32),zero_predicted,zero_actual]
path_celf = my_path + extra +"celf_solution_dict_test.pkl"
with open(path_celf, 'wb') as f:
pkl.du... | Python | 1 |
/// Size of the log store (in lines/entries)
pub log_store_capacity: u8,
/// Number of log lines used
pub log_store_used: u8,
/// Supported algorithms
pub algorithms: Vec<Algorithm>,
}
<reponame>MengJiangProject/redproxy-rs<filename>src/main.rs
use context::{ContextRef, ContextState, GlobalSta... | Rust | 0 |
et available_mode_count: NSUInteger = msg_send![available_modes, count];
for i in 0..available_mode_count {
let mode: id = msg_send![available_modes, objectAtIndex: i];
modes.insert(RootVideoMode {
video_mode: VideoMode::retained_new(self.uiscreen, mode)
});
}
}
return modes.into_iter();
}... | Rust | 0 |
_resume=True):
"""真正的IDM风格分块下载 - 8个线程下载不同部分然后合并"""
global total_downloaded, upload_interrupted, active_connections, download_lock
total_downloaded = 0
active_connections = {}
# 先发起一个GET请求获取文件信息
try:
response = session.get(url, stream=True, timeout=10)
response.raise_for... | Python | 1 |
Tree::root))
}
}
impl<D: Display> Extend<Tree<D>> for Tree<D> {
fn extend<T: IntoIterator<Item = Tree<D>>>(&mut self, iter: T) {
self.leaves.extend(iter)
}
}
impl<D: Display> Display for Tree<D> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
writeln!(f, "{}", self.root)?;
... | Rust | 0 |
import re
import numpy as np
def Calculate_IoU(ground_truth, predict):
ground_truth_width = ground_truth[1] - ground_truth[0]
ground_truth_height = ground_truth[3] - ground_truth[2]
predict_width = predict[1] - predict[0]
predict_height = predict[3] - predict[2]
pesudo_xmin = min(ground_truth[0],ground_truth[1... | Python | 1 |
'form-control'}),
'valor_fixo': forms.TextInput(attrs={'class': 'form-control decimal-mask'}),
'ipi_incluido_preco': forms.CheckboxInput(attrs={'class': 'form-control'}),
'incluir_bc_icms': forms.CheckboxInput(attrs={'class': 'form-control'}),
'incluir_bc_icmsst': forms.... | Python | 1 |
build and its sources
///
/// All URLs stored in these fields should be publicly accessible on the web
/// (ie: not behind a paywall or requiring subscription to a free service).
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Context {
/// URL of the build job on the CI platfo... | Rust | 0 |
import pytest
from pytestskipmarkers.utils import platform
@pytest.mark.skip_unless_on_linux(reason="Linux test only")
def test_services(install_salt, salt_call_cli):
"""
Check if Services are enabled/disabled
"""
services_disabled = []
services_enabled = []
if install_salt.distro_id in ("ubun... | Python | 1 |
tidb_query_datatype::expr::EvalContext;
/// Metadata of an RPN function.
#[derive(Clone, Copy)]
pub struct RpnFnMeta {
/// The display name of the RPN function. Mainly used in tests.
pub name: &'static str,
/// Validator against input expression tree.
pub validator_ptr: fn(expr: &Expr) -> Result<()>,... | Rust | 0 |
r"), 500
)
conn = sqlite3.connect('books.db')
cur = conn.cursor()
# Search books
cur.execute('''
-- GROUP_CONCAT to combine multiple genres for each book
-- into one value, separated by comma and space
SELECT books.id, books.name, books.photo, books.year_p... | Python | 1 |
import dlt
from dlt.sources.helpers import requests
BASE_URL = "https://api.github.com/repos/dlt-hub/dlt/issues"
def pagination(url):
while True:
response = requests.get(url)
response.raise_for_status()
yield response.json()
# Get next page
if "next" not in response.links... | Python | 1 |
DDL) statements.
///
/// For complete documentation on SQLGetTypeInfoA, see [API reference](https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlgettypeinfo-function).
///
/// # Returns
/// SQL_SUCCESS, SQL_SUCCESS_WITH_INFO, SQL_STILL_EXECUTING, SQL_ERROR, or SQL_INVALID_HANDLE.
#[inli... | Rust | 0 |
assed to this method.
extra_headers: Headers | None = None,
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> str:
"""
Sends AXFR zone transfer request to primary nameserver(s).
... | Python | 1 |
ut:
from llm_utils import chat_with_gemini_with_context
medical_records = st.session_state.get('medical_records', "")
response = chat_with_gemini_with_context(user_chat_input, medical_records)
st.session_state['chat_history'].append((user_chat_input, response))
# ... | Python | 1 |
updated node IDs are the fingerprint IDs.
"""
nodes_ = []
for i, j_edge in i_jedge_dict.items():
neighbors = [(nodes[j], edge) for j, edge in j_edge]
fingerprint = (nodes[i], tuple(sorted(neighbors)))
nodes_.append(fingerprint_dict[fing... | Python | 1 |
utton(Keyboard::A));
manager.add_button_binding(Buttons::Block, Input::Button(Keyboard::B));
let binding = &manager
.get_binding(Input::Button(Keyboard::A))
.unwrap()
.clone();
manager.apply_change(binding, ButtonChange(true));
assert_eq!(manager.get_c... | Rust | 0 |
.on_get(move |i, _| {
i.append(&characteristic);
Ok(())
})
})
.add_p(
factory
.property::<&[&str], _>("Flags", ())
.access(Access::Read)
... | Rust | 0 |
let mut additional_env = IndexMap::new();
additional_env.insert(
"set_env_for_config_profile_override".to_string(),
EnvValue::Value("ADDITIONAL".to_string()),
);
let mut profile_env = IndexMap::new();
profile_env.insert(
"set_env_for_config_profile_override".to_string(),
... | Rust | 0 |
import os
import pandas as pd
from sqlalchemy import create_engine, text
from sklearn.preprocessing import LabelEncoder
from data.database import engine
def get_customer_category_spend():
"""Müşteri-kategori bazında harcama verilerini getirir"""
# SQL sorgusu
query = text("""
SELECT
o... | Python | 1 |
import re, sys, os
file = open("output", "r")
lines = file.readlines()
file.close()
variable = []
eta1 = []
eta2 = []
mean = []
error= []
effS = []
for line in lines:
elements = re.split("\t", line)
variable += [elements[1],]
eta1 += [re.split(">", re.split("&&", elements[2])[0])[1],]
eta2 += [... | Python | 1 |
AstNode {
location: Location {
start: found_type.location.start,
end: peeked.into(),
},
body: Type::Group(found_type.boxed()),
},
)
}
if let Some(found... | Rust | 0 |
prefix("Value");
if let Some(var_1449) = &input.value {
scope_1448.number(
#[allow(clippy::useless_conversion)]
aws_smithy_types::Number::NegInt((*var_1449).into()),
);
}
Ok(())
}
#[allow(unused_mut)]
pub fn serialize_structure_crate_model_phase2_dh_group_numbers_req... | Rust | 0 |
histograms = [[[0.2, 0.8], [0.4, 0.6]]]
dist = tf.contrib.distributions.Categorical(tf.log(histograms) - 50.)
samples = dist.sample((100, 100), seed=123)
prob = dist.prob(samples)
prob_val = prob.eval()
self.assertAllClose([0.2**2 + 0.8**2], [prob_val[:, :, :, 0].mean()],
... | Python | 1 |
0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84,
0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,
0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8,
0x51, 0xa3, 0x40,... | Rust | 0 |
uct SourceMap {
files: Vec<FileMap>
}
impl SourceMap {
pub fn new() -> Self {
Default::default()
}
/// Fetch a Reader for
pub fn read_from_file<'a, P: Display + AsRef<Path>>(&'a mut self, path: P) -> std::io::Result<io::Reader<'a, impl Read>> {
let path = path.as_ref();
let... | Rust | 0 |
self.title_secondary.color);
theme.palette.set_color("highlight", self.highlight.color);
theme
.palette
.set_color("highlight_inactive", self.highlight_inactive.color);
theme
.palette
.set_color("highlight_text", self.highlight_text.color);
}
... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
import os
import pickle
from typing import List, Tuple
import faiss
import numpy as np
from tqdm import tqdm
class Index... | Python | 1 |
elf.num_radial
out = (rbf[idx_kj].view(-1, n, k) * cbf.view(-1, n, 1)).view(-1, n * k)
return out
class torsion_emb(torch.nn.Module):
def __init__(self, num_spherical, num_radial, cutoff=5.0, envelope_exponent=5):
super(torsion_emb, self).__init__()
assert num_radial <= 64
... | Python | 1 |
s(self):
"""Test configuration with all parameters."""
config = WhatsAppConfig(
phone_number_id="123456789",
access_token="test_token",
app_secret="secret",
webhook_verify_token="verify",
base_url="https://custom.api.com",
api_versi... | Python | 1 |
)]
pub struct TimeToSampleBox;
impl Mp4Box for TimeToSampleBox {
const BOX_TYPE: [u8; 4] = *b"stts";
fn box_version(&self) -> Option<u8> {
Some(0)
}
fn box_payload_size(&self) -> Result<u32> {
Ok(4)
}
fn write_box_payload<W: Write>(&self, mut writer: W) -> Result<()> {
w... | Rust | 0 |
Vec<u8>) -> StoreResult<Option<Vec<u8>>> {
self.set_custom_value(key, value).await.map_err(Into::into)
}
async fn add_media_content(&self, request: &MediaRequest, data: Vec<u8>) -> StoreResult<()> {
self.add_media_content(request, data).await.map_err(Into::into)
}
async fn get_media_c... | Rust | 0 |
import torch.nn as nn
class ConvBlock(nn.Module):
def __init__(self, in_channels, out_channels, stride=1):
super(ConvBlock, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_channels, out_channels, 3, stride, 1, bias=False),
nn.BatchNorm2d(out_channels),
... | Python | 1 |
bool_other_path = check(numbers, increase)[0] # Validate the alternate path
increase_other_path = increase # Keep the same direction for the alternate path
else: # If no more alternate paths, stop processing
bool_numbers = Fa... | Python | 1 |
*const ::std::os::raw::c_char,
options: ::std::os::raw::c_int,
) -> xmlSaveCtxtPtr;
}
extern "C" {
pub fn xmlSaveDoc(ctxt: xmlSaveCtxtPtr, doc: xmlDocPtr) -> ::std::os::raw::c_long;
}
extern "C" {
pub fn xmlSaveTree(ctxt: xmlSaveCtxtPtr, node: xmlNodePtr) -> ::std::os::raw::c_long;
}
extern "C" {
pub fn xm... | Rust | 0 |
8] = b"\x0c\x06\x00\x0d\x07\x01\x0e\x08\x02\x0f\x09\x03\x05\x0a\x04\x0b";
fn do_md5_crypt(pass: &[u8], salt: &str) -> Result<String> {
let mut dummy_buf = [0u8; 6];
bcrypt_hash64_decode(salt, &mut dummy_buf)?;
let mut dgst_b = Md5::new();
dgst_b.update(pass);
dgst_b.update(salt.as_bytes());
dg... | Rust | 0 |
: Vec<FFindexEntry>,
ffdata : memmap::Mmap,
}
/// load the index, assumed to be sorted
pub fn load_index(ffindex_index_path:String) -> Vec<FFindexEntry>
{
let mut rdr = ReaderBuilder::new()
.has_headers(false)
.delimiter(b'\t')
.from_path(ffindex_in... | Rust | 0 |
import re
import tkinter as tk
from threading import Thread
from txt_analysis import picturing
from txt_analysis.spider_xiecheng import crawl as xiecheng_crawl
from txt_analysis import spider_xiecheng
from txt_analysis.spider_zhenguo import crawl as zhenguo_crawl
from txt_analysis import spider_zhenguo
from snownlp imp... | Python | 1 |
# pygame.Surface object
# https://www.pygame.org/docs/ref/surface.html
#
# SVG rendering in a PyGame application. Prior to Pygame 2.0, Pygame did not support SVG. Then how did you load it?
# https://stackoverflow.com/questions/120584/svg-rendering-in-a-pygame-application-prior-to-pygame-2-0-pygame-did-not-suppo/6459802... | Python | 1 |
"-m", "-t", &stat.mtime,
file_path
])
.output()
.expect("failed to execute child process");
}
/// Returns if a file path exists or not
#[inline]
pub fn file_exists(file_path: &str) -> bool {
Path::new(file_path).exists()
}
//... | Rust | 0 |
rrupt enable"]
#[inline]
pub fn errie(&mut self) -> _ERRIEW {
_ERRIEW { w: self }
}
#[doc = "Bit 26 - PCROP read error interrupt enable"]
#[inline]
pub fn rderrie(&mut self) -> _RDERRIEW {
_RDERRIEW { w: self }
}
#[doc = "Bit 27 - Force the option byte loading"]
#[inl... | Rust | 0 |
{
if self.starts_with('-') {
-(self[1..].to_num_radix(radix) as isize)
} else {
self.to_num_radix(radix) as isize
}
}
/// Parse it as a unsigned integer in base 10
fn to_num(&self) -> usize {
self.to_num_radix(10)
}
/// Parse it as a signed ... | Rust | 0 |
lse:
denomc = exp_avg_sq.clone()
if grad_transformer == 'square':
# pdb.set_trace()
denomc.sqrt_()
state['step'] += 1
if group['weight_decay'] != 0:
p_data_fp32.add_(-group['weight_decay'] ... | Python | 1 |
context: &mut RenderJobWriteContext,
_view: &RenderView,
render_phase_index: RenderPhaseIndex,
) -> RafxResult<()> {
profiling::scope!(super::APPLY_SETUP_SCOPE_NAME);
let command_buffer = &write_context.command_buffer;
let pipeline = write_context
.resource_cont... | Rust | 0 |
import re
txt="twinkle twinkle little star"
x = re.search("t.*e", txt)
print(x)
| Python | 1 |
)
result = getattr(groups, function)()
tm.assert_frame_equal(result, expected)
result = groups.agg(function)
tm.assert_frame_equal(result, expected)
result = groups.agg([function])
expected.columns = MultiIndex.from_tuples([("b", function)])
tm.assert_frame_equal(result, expected)
@pyte... | Python | 1 |
doc = "Checks if the value of the field is `_2V1`"]
#[inline(always)]
pub fn is_2v1(&self) -> bool {
*self == VOUT_A::_2V1
}
#[doc = "Checks if the value of the field is `_2V4`"]
#[inline(always)]
pub fn is_2v4(&self) -> bool {
*self == VOUT_A::_2V4
}
#[doc = "Checks if t... | Rust | 0 |
<()> {
if root.join("mos.toml").exists() {
return Err(Diagnostics::from(
Diagnostic::error().with_message("`mos init` cannot be run in existing MOS projects"),
)
.into());
}
fs::write("mos.toml", get_init_toml()).map_err(map_io_error)?;
Ok(())
}
fn get_init_toml() ... | Rust | 0 |
= fs::read_dir("./examples")?
.filter_map(|f| f.ok())
.map(|f| f.path())
.filter(|path|
path.is_file() &&
path.file_name()
.and_then(|x| x.to_str())
.map(|x| x.starts_with("decoder"))
.unwrap_or(false) &&
path.m... | Rust | 0 |
pported by this driver.",
(*args).command.unwrap().display(),
);
(*args).curptr = (*args).endptr;
0i32
}
const XTX_HANDLERS: [SpcHandler; 21] = [
SpcHandler {
key: b"textcolor",
exec: Some(spc_handler_xtx_unsupportedcolor),
},
SpcHandler {
key: b"textcolorpush",
... | Rust | 0 |
)
if idiv is None:
idiv = select_one(pdiv, "div.rs-image")
idiv = select_one(idiv, "source")
img = get_attr(idiv, "srcset")
else:
img = get_attr(idiv, "data-ip-src")
sdiv = select_one(l, "div.secondary")
title = get_text(select_one(sdiv, "... | Python | 1 |
}
fn main() {
let x = 42;
let mut r = &x;
{
let x = 89;
r = &x;
}; // x vit moins longtemps que r
let a = *r;
}
<reponame>Matt343/building-blocks
use building_blocks::core::{
prelude::*,
sdfu::{self, SDF},
};
use building_blocks::mesh::*;
use building_blocks::s... | Rust | 0 |
()
}
}
#[test]
fn async_futures() {
let runtime = Runtime::init(3);
let mut n = Future::Lazy(None);
let _ = spawn!(&mut n, sum(10));
assert_eq!(n.wait(), 55);
let stats = runtime.join();
assert_eq!(stats.num_tasks_executed.get(), 10);
}
}
<filen... | Rust | 0 |
low(dead_code)]
// Code
mod camera;
mod intersection;
mod intersection_stats;
mod material;
mod point_light;
mod ray;
mod shape;
mod world;
// Exports
pub use camera::Camera;
pub use intersection::Intersection;
pub use intersection_stats::IntersectionStats;
pub use material::Material;
pub use point_light::PointLight;... | Rust | 0 |
1;
use bytes::BufMut;
/// Digest trait
pub trait Digest: Send {
/// Update data
fn update(&mut self, data: &[u8]);
/// Generates digest
fn digest_reset<B: BufMut>(&mut self, buf: &mut B);
/// Length of digest
fn digest_len(&self) -> usize;
}
/// Type of defined digests
#[derive(Clone, Copy)... | Rust | 0 |
CTURE
mask_fn = functools.partial(mask_utils.all_mask)
# Currently the cond video is computed directly in token_dumper because the
# cond_fns only receive the input rgb, but we also need flow. Therefore return
# None here.
cond_fn = None
return Task(task_id, task_token, mask_fn, cond_fn, task_config)
def ... | Python | 1 |
> {
let this = self.project();
let mut res = ready!(this.fut.poll(cx))?;
// set response headers
for (key, value) in this.inner.headers.iter() {
if !res.headers().contains_key(key) {
res.headers_mut().insert(key.clone(), value.clone());
}
... | Rust | 0 |
import base64
from Crypto.Cipher import AES
from Crypto.Util.Padding import pad
# 配置输入
key_str = "f1f30f81dcdf1b546fc9394f50a9d371"
iv_hex = "00000000000000000000000000000000" # IV 全为 0
plain_text = """id=1477340&n=2&ispic=0&tid=2&time=2025-06-18 20:37:07.168&isdanben=0&key=F57AE331F3BE83707362943858A15869&isvip4node... | Python | 1 |
bits >> OFFSET) & MASK as u32) != 0
};
MCFHPR { bits }
}
}
impl W {
#[doc = r" Reset value of the register"]
#[inline]
pub fn reset_value() -> W {
W { bits: 0 }
}
#[doc = r" Writes raw bits to the register"]
#[inline]
pub unsafe fn bits(&mut self, bits: u32) -> &m... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: protos/perfetto/config/power/android_power_config.proto
# Protobuf Python Version: 5.27.3
'''Generated protocol buffer code.'''
from google.protobuf import descriptor as _descriptor
from google.... | Python | 1 |
ntinue,
};
todor
.remove_todo(filepath, todo_ind)
.unwrap_or_else(|err| warn!("{}", err));
println!("Comment removed");
}
}
fn select_file(todor: &TodoR) -> Option<String> {
let option_quit = format!("{}", Red.paint("QUIT"));
let mut tracked_files = todor.ge... | Rust | 0 |
encil_op_SG_STENCILOP_DECR_CLAMP: sg_stencil_op = 5;
pub const sg_stencil_op_SG_STENCILOP_INVERT: sg_stencil_op = 6;
pub const sg_stencil_op_SG_STENCILOP_INCR_WRAP: sg_stencil_op = 7;
pub const sg_stencil_op_SG_STENCILOP_DECR_WRAP: sg_stencil_op = 8;
pub const sg_stencil_op__SG_STENCILOP_NUM: sg_stencil_op = 9;
pub con... | Rust | 0 |
import json
import re
from enum import Enum
from typing import Any, Generator, List, Optional, TypeVar
from mypy_boto3_athena.type_defs import DataCatalogTypeDef
from dbt.adapters.athena.constants import LOGGER
def clean_sql_comment(comment: str) -> str:
split_and_strip = [line.strip() for line in comment.split... | Python | 1 |
.79-1.8-1.41-1.41-1.79 1.79 1.41 1.42z"/></svg>
</svg>
}
}
}
use crate::db_manager::DbManager;
use crate::error::Error;
use crate::models::User;
use crate::models::{ChangePassword, Credential};
use crate::utils::*;
use futures::TryFutureExt;
use std::sync::Arc;
use tokio::sync::RwLock;
use war... | Rust | 0 |
2 = l5;
if lb1 == 0 && lb2 == 0 {
return;
}
let op = infer_eq_sign(op, lb1, lb2);
infer_shape(lb1, size);
infer_shape(lb2, size);
log_cmp_callsite(cmpid, context, last_callsite, condition, op, size, lb1, lb2, arg1, arg2);
}
#[no_mangle]
pub extern "C" fn __angora_trace_switch_tt(
... | Rust | 0 |
chunk_size = min(len(remaining_words), random.randint(3, 12))
chunk = " ".join(remaining_words[:chunk_size])
yield chunk + " "
remaining_words = remaining_words[chunk_size:]
delay = random.uniform(0.05, 0.15)
... | Python | 1 |
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 or implied.
See the License for the specific language governing permissions... | Rust | 0 |
to identify this particular command within a list of commands.
///
/// Can be configured via the [`crate::command`] macro (though it's probably not needed for most
/// bots). If not explicitly configured, it falls back to prefix command name, slash command
/// name, or context menu command name (in tha... | Rust | 0 |
from embit import script
from embit import ec
from embit.networks import NETWORKS
from binascii import unhexlify, hexlify
from embit.transaction import Transaction, TransactionInput, TransactionOutput
from embit import compact
def main():
# all from the same private key
prv = ec.PrivateKey.from_wif("L2e5y14ZD... | Python | 1 |
* (Pa + Pd)
if len(Pa) == 0 or len(Pd) == 0 or len(P) == 0:
raise ValueError("No instance of common facet found, dataset may be too small")
return 0.5 * (np.sum(Pa * np.log(Pa / P)) + np.sum(Pd * np.log(Pd / P)))
@registry.pretraining
def LP(label: pd.Series, sensitive_facet_index: pd.Series) -> floa... | Python | 1 |
import torch
from PIL import Image
from diffsynth import save_video, VideoData
from diffsynth.pipelines.wan_video_new import WanVideoPipeline, ModelConfig
from modelscope import dataset_snapshot_download
pipe = WanVideoPipeline.from_pretrained(
torch_dtype=torch.bfloat16,
device="cuda",
model_configs=[
... | Python | 1 |
els(200.))
});
plot.build(state, window.entity(), |builder| {
builder.set_width(Stretch(4.)).set_height(Stretch(1.))
});
window.set_title("Correlation track demo").set_inner_size(800, 600);
});
app.run();
Ok(())
}
fn err_fn(err: cpal::StreamError) {
eprintln!(... | Rust | 0 |
ize: ::protobuf::CachedSize,
}
impl CountArgumentProto {
pub fn new() -> CountArgumentProto {
::std::default::Default::default()
}
// bool limit_flag = 1;
pub fn clear_limit_flag(&mut self) {
self.limit_flag = false;
}
// Param is passed by value, moved
pub fn set_limit_f... | Rust | 0 |
T")
.takes_value(true)
.default_value("1")
.help("How many consecutive failures must occur to trigger a notification")
)
.arg(
Arg::with_name("validator_identities")
.long("validator-identity")
.value_name("VALID... | Rust | 0 |
import heapq
def a_star():
# Define the list of coins and their tax values
coins = [9, 18, 7, 20, 4, 12, 5, 5, 18, 5, 2, 11, 5, 16, 19, 8, 10, 9, 12, 14, 17, 6, 14, 16, 20, 10, 10, 13, 4, 13, 7, 14, 14, 10, 2, 7, 14, 11, 16, 10, 10, 5, 14, 20, 4, 17]
tax_values = {17: 16, 8: 8, 6: 6, 16: 12, 5: 4, 14: 12... | Python | 1 |
ert_eq!(
unsafe { &(*(::std::ptr::null::<_GMemVTable>())).malloc as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(_GMemVTable),
"::",
stringify!(malloc)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null:... | Rust | 0 |
suite, ignoring the specified errors."),
)
.arg(
Arg::new("skip")
.takes_value(true)
.short('s')
.long("skip")
.about("Skip validation of the specified files."),
)
.get_matches();
let runner = Runner::new(
... | Rust | 0 |
tion is missing, but only on nightly.
//
// This means that missing docs will still fail CI, but means we can use
// README.md as the crate documentation.
#![no_std]
#![cfg_attr(feature = "bench", feature(test))]
#![cfg_attr(feature = "nightly", deny(missing_docs))]
#![doc(html_logo_url = "https://doc.dalek.rs/assets/... | Rust | 0 |
32 bit code selector
pub const USER_DS: u64 = 0x2b; // guest ring 3 data selector
pub const FS_TLS_SEL: u64 = 0x63; // Linux FS thread-local storage selector
pub const GS_TLS_SEL: u64 = 0x6b; // Linux GS thread-local storage selector
pub fn initX86FPState(data: u64, useXsave: bool) {
unsafe {
llvm_asm!("... | Rust | 0 |
lf.expanded_leaves.load(Ordering::Relaxed)
}
#[cfg(feature = "smt")]
pub(crate) fn increment_smt_assertions(&self) {
self.smt_assertions.fetch_add(1, Ordering::Relaxed);
}
#[cfg(feature = "smt")]
pub(crate) fn load_smt_assertions(&self) -> u32 {
self.smt_assertions.load(Orderin... | Rust | 0 |
pStyle()
return
pStyle = self.get_or_add_pStyle()
pStyle.val = style
@property
def widowControl_val(self):
"""The value of `widowControl/@val` or |None| if not present."""
widowControl = self.widowControl
if widowControl is None:
return None
... | Python | 1 |
from unet3d.utils.utils import pickle_dump, pickle_load
def generate_cross_val_fold():
# generate 5-fold cross validation list, 1st one is list_validation_ids.pkl
trained_list = pickle_load('../data/list_training_ids.pkl')
val_list = pickle_load('../data/list_validation_ids.pkl')
num_trained_list = len... | Python | 1 |
ath()
}
pub fn load_program(&self) -> WholeProgram {
match load_program(self.get_main_path()) {
Ok(whole_program) => whole_program,
Err(e) => panic!("Error loading program in {}: {}", e.0, e.2.get_message()),
}
}
}
fn split_to_files(s: &str) -> HashMap<String, Strin... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.