text string | label_name string | labels int64 |
|---|---|---|
import base64
from cryptography import x509
from odoo import fields, models
class Certificate(models.Model):
_inherit = 'certificate.certificate'
scope = fields.Selection(
selection_add=[
('facturae', 'Facturae')
],
)
def _l10n_es_edi_facturae_get_issuer(self):
... | Python | 1 |
x + "test_vk"):
return
proof_path = "{}_epoch_{}_{}_proof".format(self._get_proofs_dir(id), epoch_number, file_prefix)
args = self._get_args("create", circ_type, constant, prev_cert_hash, self.ps_type, params_dir, num_constraints, segment_size, proof_path)
if prev_cert_hash is None... | Python | 1 |
# This is your first Python program
# It prints the classic "Hello, World!" message to the screen
# This program demonstrates:
# 1. How to write a simple Python statement
# 2. How to use the print() function
# 3. How to add comments using the # symbol
# The print() function displays text to the screen
print("Hello, W... | Python | 1 |
str',
fallback=(env_fallback, ['IC_REGION']),
default='us-south'),
ibmcloud_api_key=dict(
type='str',
no_log=True,
fallback=(env_fallback, ['IC_API_KEY']),
required=True)
)
def run_module():
from ansible.module_utils.basic import AnsibleModule
module = Ansi... | Python | 1 |
import datetime
import unittest.mock
import test_core
from .heartbeat_handler import _HeartbeatHandler
from .models import ConnectionState, _State
from .value_watcher import _ValueWatcher
class TestHeartbeatHandle(unittest.IsolatedAsyncioTestCase):
async def test_send_error(self) -> None:
# Count the nu... | Python | 1 |
MemoNone(()) => Ok(Memo::new_none()),
xdr::Memo::MemoText(text) => Memo::new_text(text),
xdr::Memo::MemoId(id) => Ok(Memo::new_id(id.value)),
xdr::Memo::MemoHash(hash) => Memo::new_hash(&hash.value),
xdr::Memo::MemoReturn(ret) => Memo::new_return(&ret.value),
}
... | Rust | 0 |
# Boolean => Kiểu True False, kiểu so sánh == nghĩa là bằng, != nghĩa là khác
# Khi so sánh số thì bình thường còn so sánh chữ sẽ dùng hàm ord để chuyển về số trong bảng ASCII
print(ord('a'))
print(ord('A'))
# Toán tử Is => là
a = [1,2,3]
b = [1,2,3]
print(a==b) #=> True
print(a is b) #=> False => vì a là a, b là b mặ... | Python | 1 |
# Copyright (c) 2024 PaddlePaddle 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | Python | 1 |
b"xliff" => Some(TagCtx::Xliff),
b"file" => Some(TagCtx::File),
b"header" => Some(TagCtx::Header),
b"tool" => Some(TagCtx::Tool),
b"body" => Some(TagCtx::Body),
b"source" => Some(TagCtx::Source),
b"target" => Some(TagCtx::Target),
... | Rust | 0 |
marks=int(input("enter your marks"))
if(marks<=100 and marks>=90):
grade = "ex"
elif(marks<90 and marks>=80):
grade = "A"
elif(marks<80 and marks>=700):
grade = "B"
elif(marks<70 and marks>=60):
grade = "C"
elif(marks<60 and marks>=50):
grade = "D"
elif(marks<50):
grade = "F"
print("Your ... | Python | 1 |
transactions message,
// while the reconstructed the block has a different transactions_root,
// 1. If the BlockTransactions includes all the transactions matched short_ids in the compact block,
// In this situation, the peer sends all the transactions by either prefilled or block-transactions,
// no one transaction fr... | Rust | 0 |
deps.querier,
Coin {
amount: lido_bluna_fee_amount,
denom: bluna_rewards.denom.clone(),
},
)?;
if !bluna_fee.amount.is_zero() {
lido_fees.push(bluna_fee.clone());
fees_attrs.push(attr("lido_bluna_fee", bluna_fee.to_string())... | Rust | 0 |
xCachesize: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut sqlite3_pcache, nCachesize: ::std::os::raw::c_int),
>,
pub xPagecount: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut sqlite3_pcache) -> ::std::os::raw::c_int,
>,
pub xFetch: ::std::option::Option<
unsafe ... | Rust | 0 |
#!/usr/bin/env python3
import logging
from nano_llm import Agent
from nano_llm.plugins import VideoSource, VideoOutput
from nano_llm.utils import ArgParser
class VideoStream(Agent):
"""
Relay, view, or test a video stream. Use the ``--video-input`` and ``--video-output`` arguments
to set the video sour... | Python | 1 |
pport;
use build_support::{cargo, skia};
/// Environment variables used by this build script.
mod env {
use crate::build_support::cargo;
use std::path::PathBuf;
/// A boolean specifying whether to build Skia's dependencies or not. If not, the system's
/// provided libraries are used.
pub fn use_sy... | Rust | 0 |
"),
};
assert_eq!(variants.len(), 2);
assert_eq!(variants.get(&0).unwrap().name, "Empty");
assert_eq!(variants.get(&1).unwrap().name, "Cons");
}
#[test]
fn test_tracing_deserialization_for_lists() {
#[derive(Serialize, Deserialize, PartialEq, Eq, Debug, Clone)]
struct Node {
data: u64,
... | Rust | 0 |
= Result<RawHtml<String>, Status>;
#[derive(Database)]
#[database("main_connection")]
struct DBConnection(PgPool);
#[get("/users/<_uuid>", format = "text/html")]
async fn get_user(mut _db: Connection<DBConnection>, _uuid: &str) -> HtmlResponse {
todo!("will implement later")
}
#[get("/users?<_pagination>", forma... | Rust | 0 |
ed_percentage == "-" {
assert_eq!(0.0, reported_inodes);
assert_eq!(0.0, reported_iused);
} else {
let reported_percentage = reported_percentage[..reported_percentage.len() - 1]
.parse::<u8>()
.unwrap();
let computed_percentage = (1... | Rust | 0 |
nLineStyle::Double,
MultiColumnLineStyle::Groove => ElvisMultiColumnLineStyle::Groove,
MultiColumnLineStyle::Ridge => ElvisMultiColumnLineStyle::Ridge,
MultiColumnLineStyle::Inset => ElvisMultiColumnLineStyle::Inset,
MultiColumnLineStyle::OutSet => ElvisMultiColumnLineSty... | Rust | 0 |
etheus-types.proto");
let mut prost_build = prost_build::Config::new();
prost_build.btree_map(&["."]);
// It would be nice to just add these derives to all the types, but
// prost automatically adds them already to enums, which causes the
// extra derives to conflict with itself.
prost_build.t... | Rust | 0 |
from qiskit import QuantumCircuit, Aer, execute
from qiskit.visualization import plot_histogram
import numpy as np
def quantum_key_distribution(num_bits=10):
# Step 1: Alice prepares a random bit string and random bases
alice_bits = np.random.randint(2, size=num_bits) # Random bits (0 or 1)
alice_bases = ... | Python | 1 |
{
ip: [u64; BPF_MAX_STACK_DEPTH],
}
impl StackTrace {
pub const fn with_max_entries(cap: u32) -> Self {
StackTrace {
def: bpf_map_def {
type_: bpf_map_type_BPF_MAP_TYPE_STACK_TRACE,
key_size: mem::size_of::<u32>() as u32,
value_size: mem::siz... | Rust | 0 |
ssert_eq!(board.get(square2), &empty_square);
let last_piece = board.set(square1, king1);
assert_eq!(last_piece, empty_square);
assert_eq!(board.get(square1), &king1);
//Start with a black king in our "hand" then swap it with the white king on E4
let mut hand_piece = king2;
... | Rust | 0 |
let p = hw.as_mut_ptr() as *mut u8;
let (hw0, hw1, hw2, hw3, hw4, hw5) = scan_fmt!(hwaddr, "{x}:{x}:{x}:{x}:{x}:{x}",
[hex u8], [hex u8], [hex u8], [hex u8], [hex u8],
[hex u8])?;
hw[0] = hw0;
hw[1] = hw1;
hw[2] = hw2;
hw[3] = hw3;
... | Rust | 0 |
) = self.data {
if data.0.load(Ordering::SeqCst) {
Liveness::Alive
} else {
Liveness::Dead
}
} else {
Liveness::Unmanaged
}
}
fn equals(&self, other: &ZwpTabletPadRingV2) -> b... | Rust | 0 |
pub mod cmp;
pub mod node;
pub mod ops;
#[macro_use]
pub mod fold;
pub mod validate;
#[cfg(test)]
mod tests {
use crate::node::{Cherries, Leaf};
use uom::si::area::{square_meter, square_millimeter};
use uom::si::f32::*;
use uom::si::length::{meter, millimeter};
#[test]
fn basic_tests() {
... | Rust | 0 |
-v01@openssh.com AAAAKGVjZHNhLXNoYTItbmlzdHAyNTYtY2VydC12MDFAb3BlbnNzaC5jb20AAAAgjeWGZiKdnaEOd/VZpzt",
"ODa61rBFInlJyaiD1Wrey/p0AAAAIbmlzdHAyNTYAAABBBNrlezujx3k21+cb8kDo86oH220fnNFQmkR4mfN9pIq3t5J6AmPXqn2SWeO60hgc9fjZHL4wzFNARcU",
"i719zbqr+/v7+/v7+/gAAAAEAAAAPb2JlbGlza0BleGNsYXZlAAAACwAAAAdvYmVsaXNrAAA... | Rust | 0 |
"bus_config_directory",
default_value="config/cia402_system",
description="Path to bus configuration.",
)
)
declared_arguments.append(
DeclareLaunchArgument(
"bus_config_file",
default_value="bus.yml",
description="Path to bus con... | Python | 1 |
ecated.modular.environment'
simulation = importlib.import_module(
f'{IMPORT_ENV_BASE_DIR}.{args.environment_name}')
# Language Model setup
model = utils.language_model_setup(
api_type=args.api_type,
model_name=args.model_name,
api_key=args.api_key,
device=args.device,
disable_language_model=arg... | Python | 1 |
1:
feature_selection = st.checkbox("啟用特徵選擇", value=True)
feature_scaling = st.selectbox("特徵縮放", ["StandardScaler", "MinMaxScaler", "RobustScaler"])
handle_missing = st.selectbox("缺失值處理", ["填充均值", "填充中位數", "刪除", "前向填充"])
with col2:
outlier_detection = st.c... | Python | 1 |
"""
Author: Collin Nunnally
File: checkpoint.py
Appending a list of names
"""
# Ask for the name of a friend. Keep asking unless they type "end."
print("""
.!!!!.
.&@@@@^
... ^&@@@@@^
... | Python | 1 |
DEPS[1:]:
if not d.found:
if auto_config:
logging.info(
"Some pygame dependencies were not found.")
else:
logging.warning(
"Some pygame dependencies were not found. "
"Pygame can still compile an... | Python | 1 |
.is_some() {
// Ideally, the JDK would be brought along as part of the input directory, but we don't
// currently have support for that. Scoot supports this property, and will symlink .jdk to a
// system-installed JDK https://github.com/twitter/scoot/pull/391 - we should probably come to
// some kind of... | Rust | 0 |
ormat(e.msg))
# 提取商品价格
try:
price = self.chrome.find_element_by_xpath("//*[@class='p-price']").text
if price:
price_xpath = re.findall(r'-?\d+\.?\d*e?-?\d*?', price)
if price_xpath: # 若能提取到值
item_info_dict['price'] = price_xpa... | Python | 1 |
) -> Result<ApiClient, Error>
where
T: AsRef<str>,
D: DispatchHttpRequest + Send + Sync + 'static,
{
self.fill_from_env_prefixed_internal(prefix.as_ref())?;
let access_token_provider = AccessTokenProvider::from_env_prefixed(prefix.as_ref())?;
self.build_with(dispatc... | Rust | 0 |
j = MagicDictionary::new();
obj.build_dict(vec!["hello".to_string(), "leetcode".to_string()]);
assert_eq!(obj.search("hello".to_string()), false);
assert_eq!(obj.search("hhllo".to_string()), true);
assert_eq!(obj.search("hell".to_string()), false);
assert_eq!(obj.search("leetcoded".to_string()), fal... | Rust | 0 |
clone_slice(dst: &mut [u8], src: &[u8]) {
for (d, s) in dst.iter_mut().zip(src.iter()) {
*d = *s;
}
}
fn validate_checksum(data: &[u8], len: usize) -> io::Result<usize> {
// - 3 to skip $xx in the end
let data_len = len;
let checksum = calc_checksum(&data[1.... | Rust | 0 |
L1Cost', weight=70.0),
oks_cost=dict(type='opera.OksCost', weight=7.0))),
test_cfg=dict(max_per_img=100)) # set 'max_per_img=20' for time counting
# optimizer
optimizer = dict(
type='AdamW',
lr=2e-5,
weight_decay=0.0001,
paramwise_cfg=dict(
custom_keys={
'backbone': ... | Python | 1 |
lines_link = generate_line_set(contour_point_hull, bottom_height, height)
colors = [[0, 0, 0] for i in range(len(lines_link))]
lines_pcd.lines = open3d.utility.Vector2iVector(lines_link)
lines_pcd.points = open3d.utility.Vector3dVector(lines_vertices)
lines_pcd.colors = open3d.utility.V... | Python | 1 |
0x0C,
INTFA = 0x0E,
INTCAPA = 0x10,
GPIOA = 0x12,
OLATA = 0x14,
IODIRB = 0x01,
IPOLB = 0x03,
GPINTENB = 0x05,
DEFVALB = 0x07,
INTCONB = 0x09,
IOCONB = 0x0B,
GPPUB = 0x0D,
INTFB = 0x0F,
INTCAPB = 0x11,
GPIOB = 0x13,
OLATB = 0x15,
}
#![allow(dead_code)]
use io:... | Rust | 0 |
(1, 1, self.nny),
)
# build refined psi
# get indexes to build psi for bilinear interp
RRidxs, ZZidxs = self.get_indexes_for_refinement(self.mask_to_refine)
# this is psi on the vertices as needed for each grid point to be refined
psi_where_needed = psi[RRid... | Python | 1 |
an
dHdy[mask3d] = np.nan
print("converting dH/dt_div (rate) -> H_div (anom) ...")
# dH/dt_div(t) -> H_div(t)
dt = t - REF_TIME
H_div = divHv[:, :, :] * dt[None, None, :]
H_adv = advHv[:, :, :] * dt[None, None, :]
H_str = strHv[:, :, :] * dt[None, None, :]
# TODO: Change name of saved ... | Python | 1 |
not valid utf-8: '{:?}'", bytes));
return HttpResponse::BadRequest().body(format!(
"Payload is not a valid view: {}. Posted payload: '{:?}'",
e.to_string(),
content_ref
));
}
};
let mut conn: redis::aio::Connection = CLIENT.get_asyn... | Rust | 0 |
al_congruence(10*x**2 + 14*x + 20, 2) == [0, 1]
assert polynomial_congruence(x**3 + 3, 16) == [5]
assert polynomial_congruence(65*x**2 + 121*x + 72, 277) == [249, 252]
assert polynomial_congruence(x**4 - 4, 27) == [5, 22]
assert polynomial_congruence(35*x**3 - 6*x**2 - 567*x + 2308, 148225) == [86957,
... | Python | 1 |
permutation must belong to the {:?}", b, KECCAK_PERMUTATION_WIDTHS)))
}
}
impl_keccak_width!(25, keccak_25, nr);
impl_keccak_width!(50, keccak_50, nr);
impl_keccak_width!(100, keccak_100, nr);
impl_keccak_width!(200, keccak_200, nr);
impl_keccak_width!(400, keccak_400, nr);
impl_kec... | Rust | 0 |
from dataclasses import dataclass
from typing import List, Union
import xyzservices
import uuid
@dataclass
class BaseLayerComponent:
def __init__(
self,
provider: Union[str, xyzservices.TileProvider] = '',
name: str = '',
visible: bool = True,
url: str = '',
attribu... | Python | 1 |
.25")
except Exception:
payload["semantic_score_threshold"] = 0.25
try:
payload["allow_kb_fallback"] = (
(_env("ALLOW_KB_FALLBACK", "1") or "1") not in ("0", "false", "False")
)
except Exception:
payload["allow_kb_fallback"] = True
# ─────────────────────────... | Python | 1 |
>(Some(
pdf_release_obj as unsafe extern "C" fn(_: *mut pdf_obj) -> (),
)),
);
}
#[no_mangle]
pub unsafe extern "C" fn pdf_doc_add_names(
mut category: *const i8,
mut key: *const libc::c_void,
mut keylen: i32,
mut value: *mut pdf_obj,
) -> i32 {
let mut p: *mut pdf_doc = &mut... | Rust | 0 |
Ok(nsec_vec) => {
assert_eq!(nsec_vec.as_slice(), &bin_arr[..]);
}
_ => assert!(false, "encode nsec fail"),
}
assert_eq!(nsec_str, nsec_struct.to_string());
}
}
//! HTTP Client
//!
//! The HTTP `Client` uses asynchronous IO, and utilizes the `Handler` trait
//... | Rust | 0 |
# Update trajectory line
trajectory.set_data(states[:frame, 0], states[:frame, 1])
# Update spacecraft circle position
body.center = (x, y)
# Orientation direction line
length = r_spacecraft * 0.5
x_end = x + length * np.cos(yaw)
y_end = y + length * np.sin(y... | Python | 1 |
, PartialEq, ::prost::Message)]
pub struct KeyAttributes {
#[prost(message, optional, tag="1")]
pub key_type: ::core::option::Option<KeyType>,
#[prost(uint32, tag="2")]
pub key_bits: u32,
#[prost(message, optional, tag="3")]
pub key_policy: ::core::option::Option<KeyPolicy>,
}
#[derive(Clone, Pa... | Rust | 0 |
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 std::fmt::Debug;
use std::fmt::Display;
use std::fmt::Formatter;
use std::future::Futu... | Rust | 0 |
=> {
let github =
Github::new(
format!("hubcaps/{}", env!("CARGO_PKG_VERSION")),
Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap())),
Credentials::Token(token),
);
for issue in g... | Rust | 0 |
# app/agents/critique_agent.py
from __future__ import annotations
from typing import Dict, Any, List, Optional
import os
import json
try:
from langchain_openai import ChatOpenAI
except Exception:
ChatOpenAI = None # type: ignore
# optional LLM
_llm: Optional[Any] = None
if ChatOpenAI and os.getenv("OPENAI_AP... | Python | 1 |
or ""
return JSONResponse(ChatResponse(
improved_prompt=improved,
final_answer=final,
optimization_mode=mode.value
).model_dump())
except Exception as e:
# Fallback to regular chat completions if Responses API fails
print(f"Responses API ... | Python | 1 |
plete_no_clip' in line: complete_no_clip = 1
# else: complete_no_clip = 0
# # ! 250426 adds:
# if 'multi' in line: multivariate = 1
# else: multivariate = 0
# # ! 250429 adds:
# if 'color' in line: color = 1
# else: color = 0
# # ! 250505 adds: 临时加的用于解决univariate忘加color的问题... | Python | 1 |
ng();
world.add_resource(rng);
world.add_resource(Episode(0));
world.add_resource(Terminal(false));
world.add_resource(Step(0));
world.add_resource(MaxStep(None));
world.add_resource(DeltaT(SIXTY_FPS));
world.add_resource(Render::default());
world.add_resource(NeedsKeyInfo(true));
wo... | Rust | 0 |
eting block from LlamaIndex (ID: {block_id}).")
try:
# Delete the node from the index
self.index.delete_nodes([block_id])
# Persist changes to disk to ensure they are saved
if not self._is_in_memory:
self.index.storage_context.persist(persist_dir... | Python | 1 |
WHEN atom_v3 <= 0.10 THEN '0.05-0.10'
WHEN atom_v3 <= 0.20 THEN '0.10-0.20'
WHEN atom_v3 <= 0.30 THEN '0.20-0.30'
WHEN atom_v3 <= 0.40 THEN '0.30-0.40'
WHEN atom_v3 <= 0.50 THEN '0.40-0.50'
WHEN atom_v3 <= 0.60 THEN '0.50-0.60'
... | Python | 1 |
import unittest
from automata.backend.grammar.dist import NonTerminal, Terminal
from automata.backend.grammar.transducers.scfg_parser import SCFG
class TestSCFG(unittest.TestCase):
def test_scfg_to_cnf_and_parse(self):
"""
Test a non-CNF grammar, convert it, and then parse.
"""
gram... | Python | 1 |
num1=10
num2=10.5
print(type(num1))
print(type(num2))
#find maximum number of some numbers
print(max(10,3,45,67,24,34))
#find minimum number of some numbers
print(min(10,3,45,67,24,34)) | Python | 1 |
}
}
impl DistributionND for MVN {
fn get_dim(&self) -> usize {
self.mean.len()
}
}
impl<'a> Continuous for &'a MVN {
type PDFType = &'a [f64];
fn pdf(&self, x: Self::PDFType) -> f64 {
assert!(self.covariance_matrix.is_positive_definite());
assert_eq!(x.len(), self.mean.len());... | Rust | 0 |
price = int(input("Price of the shirt: "))
quan = int(input("Quantity of the Shirt: "))
total = price * quan
print("Total Price: ", total)
discount = total * .20
print("Discount: ", discount)
dp = total - discount
print("Discounted Price: ", dp)
cash = int(input("Cash: "))
change = cash - dp
print("Change: ", cha... | Python | 1 |
ait {
Ok(response) => response,
Err(error) => {
eprintln!("Unable to apply object due to API error");
return Err(error);
}
};
if let Some(message) = response.get("message") {
println!("[remote] {}", message);
}
println!("Object applied successfully... | Rust | 0 |
# This is fast filtering not perfect
# Apply all on demand
lowpassfilter = denoise = trim = loudness = True
if lowpassfilter:
lowpass_highpass = "lowpass=8000,highpass=75,"
else:
lowpass_highpass = ""
if trim:
# better to remove silence in beginning and end for microphone... | Python | 1 |
prefix_hashes: Default::default(),
mutable_names: Default::default(),
label_names: Default::default(),
ssa_names: Default::default(),
}
}
pub fn nested(&'a self) -> Ir<'a> {
Self {
minified_name_counter: self.minified_name_counter,
see... | Rust | 0 |
, 9, 10, 11, 12, 13, 14, 15,
0, 0, 0, 0, 0, 0, 0, 0, 8, 9, 10, 11, 12, 13, 14, 15);
assert_eq_m512i(r, e);
}
#[simd_test(enable = "avx512f,avx512vl")]
unsafe fn test_mm256_mask_max_epu16() {
let a = _mm256_set_epi16(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, ... | Rust | 0 |
5\xe5\x17\
\xe5\xd8\xc84\x7f}>\x84\xc0\xb0\xbd\x0eD\x9f\x81\xfa\
7\x89rc$ \x111\xef\xfe\xcf\xef\xf7?\xd7\xc5\
\xb2\xf2\x1e\xef\x94\x943\x06\xf5\xb2q\xf3\xd9\xb5\xe0>\
8\x94o\xec\xb6\xed\xdf\xfb\xf7\x1f\xb5G :\x7f`\
\xabS\x04e\x16+v\x04\x10\xb7\x8c\xbb\xd8\xf9\xbb\x8f\
\x01\x80r\xca>CS\xf8\xd3)u\xc8\xe6>C\x14\
FN&\x09e\... | Python | 1 |
# for wire in face1.boundaries() {
/// # assert!(wire.is_closed());
/// # assert!(wire.is_simple());
/// # }
///
/// assert_eq!(
/// face0.get_surface() + 100000,
/// face1.get_surface(),
/// );
/// let biters0 = face0.boundary_iters();
/// let biters1 = face1.bound... | Rust | 0 |
e_avg_y:
direction = "up"
elif y_nose - eye_avg_y > down_threshold:
direction = "down"
elif abs(left_nose - right_nose) < 20:
direction = "stop"
else:
direction = "... | Python | 1 |
: T,
) -> Result<serde_json::Value, Self::Error>
where
T: AsRef<[&'a str]> + Send + 'a,
{
let inner_field = inner_field.as_ref();
let value = match inner_field {
#variants
field => return Err(iroha_config::derive::Error::Unknown... | Rust | 0 |
Vec<u8> {
panic!(
"serialization not implemented for {:?}",
Self::type_identifier()
)
}
/// Deserialize a value form an array of bytes.
///
/// The default implementation panics.
fn deserialize(_data: &[u8]) -> Self {
panic!(
"deserializa... | Rust | 0 |
# scala_kubernetes for k8s
@classmethod
def setUpClass(cls):
super().setUpClass()
print(f"\nStarting Scala kernel using {cls.KERNELSPEC} kernelspec")
# initialize environment
cls.gatewayClient = GatewayClient()
cls.kernel = cls.gatewayClient.start_kernel(cls.KERNELSPEC)... | Python | 1 |
as_code_fetch().unwrap();
let cmd_id = base.cmd_id();
let module_specifier = msg.module_specifier().unwrap();
let containing_file = msg.containing_file().unwrap();
assert_eq!(state.dir.root.join("gen"), state.dir.gen, "Sanity check");
Box::new(futures::future::result(|| -> OpResult {
let builder = &mut ... | Rust | 0 |
!("Problem with product matrix by vector : {:?}", error),
};
let tmpqm = product(&inva, &_a12);
let tmpqm =match tmpqm {
Ok(matrx) => matrx,
Err(error) => panic!("Problem with matrix multiplication : {:?}", error),
};
let tmpq... | Rust | 0 |
pub fn variant(self, variant: DRAM1_RETENTION_A) -> &'a mut W {
{
self.bit(variant.into())
}
}
#[doc = "DRAM1 normal mode"]
#[inline(always)]
pub fn dram1_normal_mode(self) -> &'a mut W {
self.variant(DRAM1_RETENTION_A::DRAM1_NORMAL_MODE)
}
#[doc = "DRAM1 ... | Rust | 0 |
Анализатор социальных сетей - Поиск по 10+ платформам
4. Продвинутый поиск - 5-уровневый анализ с AI
5. Стеганография - Текстовое скрытие + криптоанализ
6. Сетевая форензика - Сканирование + анализ трафика
{Colors.PURPLE}🔬 Возможности фреймворка:{Colors.END}
• Многопоточные операции для быстродействия
• AI... | Python | 1 |
support for now
assert output.shape == torch.Size([2, 16 * model.cell.num_nodes])
def test_memo_sharing():
class TestModelSpace(ModelSpace):
def __init__(self):
super().__init__()
self.linear1 = Cell(
[nn.Linear(16, 16), nn.Linear(16, 16, bias=False)],
... | Python | 1 |
CT * FROM {full_table_name} OFFSET {offset} LIMIT {remaining}"
tail_rows = await conn.fetch(tail_query)
samples.extend([dict(row) for row in tail_rows])
self.logger.info(f"智能采样完成,获取了 {len(samples)} 条数据")
return samples[:limit] # 确保不超过限制
def get_sampling... | Python | 1 |
::Error::invalid_length(2, &self))?;
let loss = seq.next_element()?
.ok_or_else(|| de::Error::invalid_length(3, &self))?;
Ok(MatrixNetwork::new(latency_file, n, jitter, loss))
}
}
fn visit_map<V>(self, mut map: V) -... | Rust | 0 |
IPNT")]
Ipnt,
/// Day
#[serde(rename = "day")]
Day,
/// Hundredweight (US)
#[serde(rename = "cwt")]
Cwt,
/// Grams
#[serde(rename = "g")]
_G,
/// Dry metric tons
#[serde(rename = "dt")]
Dt,
/// Kilowatt hours
#[serde(rename = "kWh")]
KWh,
/// Environmental Offset
#[serde(rename = "EnvOfst")]
EnvOfst,... | Rust | 0 |
pen(os.path.join(DATA_DIR, dataset_name, dataset_name + "_papers.json")) as f:
papers_dict = json.load(f)
titles_dict = {
dataset_name
+ "_"
+ str(anddata.signatures[i].paper_id): papers_dict[str(anddata.signatures[i].paper_id)]["title"]
for i in train_sigs.union(val_sigs).un... | Python | 1 |
t ID3D11VideoProcessorInputView,
) -> HRESULT,
fn CreateVideoProcessorOutputView(
pResource: *mut ID3D11Resource,
pEnum: *mut ID3D11VideoProcessorEnumerator,
pDesc: *const D3D11_VIDEO_PROCESSOR_OUTPUT_VIEW_DESC,
ppVPOView: *mut *mut ID3D11VideoProcessorOutputView,
) -> HRESUL... | Rust | 0 |
]
pub enum Day08Error {
#[error("Could not read file contents of \"{0:?}\" ({1})")]
ReadFileContents(Option<String>, #[source] ReadFileContentsError),
#[error("Could not decode mixed up signals ({0})")]
DecodeMixedUpSignals(#[from] DecodeMixedUpSignalsError),
}
pub fn decode_mixed_up_signals(
signa... | Rust | 0 |
#[no_mangle]
pub extern "C" fn shmffi_get_and_deserialize(hash: u64) -> usize {
catch_unwind(|| {
with(|cmap| {
cmap.read_map(&hash, |map| {
let heap_value = map.get(&hash).unwrap();
// Safety: we are not holding on to unrooted OCaml values.
uns... | Rust | 0 |
}
fn branch_suite_and_version_from_elasticsearch(
url: &str,
) -> Result<(String, TestSuite, semver::Version), failure::Error> {
let client = reqwest::ClientBuilder::new()
.danger_accept_invalid_certs(true)
.build()?;
let mut response = client.get(url).send()?;
let json: Value = respo... | Rust | 0 |
ror: {}", e);
},
Ok(_) => {
//println!("{:?}", ast);
}
}
match ast.into_runner().evaluate(&WashArgs::Empty, &mut env) {
... | Rust | 0 |
{
let mut buf: DateTimeBuffer = smallvec::SmallVec::with_capacity(32);
val.write_buf(&mut buf);
let key_as_str = str_from_slice!(buf.as_ptr(), buf.len());
Ok(Key::String(InlinableString::from(key_as_str)))
}
... | Rust | 0 |
D3D10_SB_OPCODE_DCL_GS_INPUT_PRIMITIVE = 93,
D3D10_SB_OPCODE_DCL_MAX_OUTPUT_VERTEX_COUNT = 94,
D3D10_SB_OPCODE_DCL_INPUT = 95,
D3D10_SB_OPCODE_DCL_INPUT_SGV = 96,
D3D10_SB_OPCODE_DCL_INPUT_SIV = 97,
D3D10_SB_OPCODE_DCL_INPUT_PS = 98,
D3D10_SB_OPCODE_DCL_INPUT_PS_SGV = 99,
D3D10_SB_OPCODE_... | Rust | 0 |
, "PROJECT_DB", ProjectDb);
let pj_builder = match db::Builder::from_str(&pj_key[..]) {
Ok(pj_builder) => pj_builder,
Err(e) => return Err(GithubBuilderError::PjConnect(e)),
};
let pipelines: Box<github_git::PipelinesConfig> = match pj_builder {
db::Builder::Sqlite(d) =>
... | Rust | 0 |
",
rounded_tr_xl: "rounded-tr-xl",
rounded_xl: "rounded-xl",
};
#[derive(Clone, Copy)]
pub(crate) struct Effects {
pub(crate) bg_blend_color: &'static str,
pub(crate) bg_blend_color_burn: &'static str,
pub(crate) bg_blend_color_dodge: &'static str,
pub(crate) bg_blend_darken: &'static str,
... | Rust | 0 |
nto its task queue.
///
/// [`WebView`]: struct.WebView.html
pub struct Handle<T> {
internal: *mut WebViewFFI,
live: Weak<RwLock<()>>,
_phantom: PhantomData<T>,
}
impl<T> Handle<T> {
pub fn new(internal: *mut WebViewFFI, live: Arc<RwLock<()>>) -> Self {
Self {
internal,
... | Rust | 0 |
import torch
from util import util
import models
from models import dist_model as dm
from IPython import embed
use_gpu = False # Whether to use GPU
spatial = True # Return a spatial map of perceptual distance.
# Linearly calibrated models (LPIPS)
model = models.PerceptualLoss(model='net-lin', net='ale... | Python | 1 |
_SchnorrSignature_nativeGetSignatureSize(
_env: JNIEnv,
_class: JClass,
) -> jint {
SCHNORR_SIG_SIZE as jint
}
);
ffi_export!(
fn Java_com_horizen_schnorrnative_SchnorrSignature_nativeSerializeSignature(
_env: JNIEnv,
_schnorr_sig: JObject,
) -> jbyteArray {
... | Rust | 0 |
..
// fn foo(&self) {
// ...
// }
// }
struct CriaturaMarinha {
barulho: String,
}
impl CriaturaMarinha {
fn paga_barulho(&self) -> &str {
&self.barulho
}
}
fn main() {
let criatura = CriaturaMarinha {
barulho: String::from("glub"),
};
println!("{}", criatura.... | Rust | 0 |
}
}
_ => issues.push(ValidationIssue::MissingGlue(nsdname)),
}
}
/// Ensures that, if an MX record specifies a mail exchanger whose name
/// is in the zone, an address record for it is present (check 9).
fn check_mx_address(zone: &Zone, name: Box<Name>, issues: &mut Vec<ValidationIssue... | Rust | 0 |
n parsed
/// from the dataset this will be `None`. According to the DICOM standard this should always be
/// the value `DICM`.
pub fn get_dicom_prefix(&self) -> &Option<[u8; DICOM_PREFIX_LENGTH]> {
&self.dicom_prefix
}
/// Checks if the stream should stop being parsed based on `self.stop`. ... | Rust | 0 |
tead" %
(TARGET_MAJOR, TARGET_MINOR, config_version, config_major,
config_minor, config_revision))
if not self.DowngradeAll():
raise Error("Downgrade failed:\n%s" % "\n".join(self.errors))
def _TestLoadingConfigFile(self):
# test loading the config file
all_ok =... | Python | 1 |
)
);
}
#[test]
fn should_be_connection_error() {
setup();
let jenkins = JenkinsBuilder::new("http://localhost:1234")
.build()
.unwrap();
let response = jenkins.get_home();
assert!(response.is_err());
}
#[test]
fn can_get_view() {
setup();
let jenkins = JenkinsBuilder::ne... | Rust | 0 |
}
pub fn new(
generator: rindex::AddressGenerator<hdwallet::XPrv>,
network_magic: NetworkMagic,
) -> Self {
RandomIndexLookup {
generator,
network_magic,
}
}
pub fn get_private_key(&self, addr: &rindex::Addressing) -> XPrv {
self.genera... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.