text string | label_name string | labels int64 |
|---|---|---|
ge():
if not os.path.exists(base_dir):
repo = git.Repo.clone_from(storage_url, base_dir)
print("Data from internal storage has been cloned.")
else:
repo = git.Repo(base_dir)
if repo.remotes.origin:
repo.remotes.origin.fetch(prune=True)
print("Data from int... | Python | 1 |
index] # (num_graph, k, 2)
is_padding = reactant_id == -1
num_synthon = (~is_padding).sum(dim=-1)
num_synthon = num_synthon[~is_duplicate]
logps = logps[~is_duplicate]
offset = torch.arange(self.max_prediction, device=self.device) * len(reactant)
reactant_id = reactant_i... | Python | 1 |
from test_integration import Engine
from playwright.sync_api import expect
from pytest import fixture
from os import getenv
import nest_asyncio
nest_asyncio.apply()
@fixture
def my_website():
return Engine(
rewrite=getenv("STORYMODE", "") == "rewrite",
vnc=getenv("STORYMODE", "") == "vnc",
... | Python | 1 |
typedef union type_identifier;
typedef class type_identifier;
typedef interface class type_identifier;
typedef type_identifier;"##,
Ok((_, _))
);
test!(
many1(module_item),
r##"typedef C;
... | Rust | 0 |
objects,
opts,
rays
);
let filt: Vec<(Intersect, usize)> = isects.iter()
.filter(|&&(ref x, _)| x.is_some())
.map(|&(ref x, y)| {
match x {
&Some(ref x) => (x.clone(), y),
&None => unreachable!()
}
})
.collect();
let colours: Vec<Colour> = base_colour(
filt.iter().map(|&(ref x, _)| x))... | Rust | 0 |
| DataType::Int16
| DataType::Int32
| DataType::Date32
| DataType::Time32(_)
| DataType::Interval(_)
| DataType::Int64
| DataType::Timestamp(_, None)
| DataType::Date64
| DataType::Time64(_)
| DataType::Duration... | Rust | 0 |
ys)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3);
self.w
}
}
#[doc = "Enable pro... | Rust | 0 |
(|error| panic!("Failed to deserialize the proof: {}", error));
// Recreate the message from the investor DID and the scope DID.
let message = make_message(&proof.investor_did, &proof.scope_did);
if args.verbose {
println!("Proof: {:?}", proof_str);
println!("Message: {:?}", message);
}... | Rust | 0 |
ffi::rtc_rd_time(self.clk.as_raw_fd(), &mut time as *mut RtcTime)
}?);
Ok(time)
}
/// Set hardware clocks time
pub fn set_time(&self, time: &RtcTime) -> Result<(), nix::Error> {
assert_eq!(0, unsafe {
ffi::rtc_set_time(self.clk.as_raw_fd(), time as *const RtcTime)... | Rust | 0 |
ge.get_cell(), pbc=image.get_pbc())
for idx in elements:
tmp_image.append(image[idx])
# list of strings
elif all(isinstance(x, str) for x in elements):
tmp_image = Atoms(cell=image.get_cell(),
... | Python | 1 |
= x[-self.network.batch_size :] # real_uncond
# logger.info(f"to_out_forward {self.lora_name} {self.network.sub_prompt_index} {self.network.num_sub_prompts}")
# if num_sub_prompts > num of LoRAs, fill with zero
for i in range(len(masks)):
if masks[i] is None:
masks... | Python | 1 |
.verify());
assert!(pong.sanitize().is_ok());
assert_eq!(hash::hash(&ping.token), pong.hash);
}
#[test]
fn test_ping_cache() {
let now = Instant::now();
let mut rng = rand::thread_rng();
let ttl = Duration::from_millis(256);
let mut cache = PingCache::new(ttl... | Rust | 0 |
let tail: Index = aligned_record_length * 2;
test.ab.put::<i64>(HEAD_COUNTER_INDEX, head as i64);
test.ab.put::<i64>(TAIL_COUNTER_INDEX, tail as i64);
test.ab.put::<i32>(record_descriptor::type_offset(0), MSG_TYPE_ID);
test.ab.put::<i32>(record_descriptor::length_offset(0), record_... | Rust | 0 |
tolist()
hist_list = []
for i in range(len(name_clean)):
hist_list.append(np.zeros((num_classes, num_classes)))
hist_groupby_individual = dict(zip(name_clean, hist_list))
gt_imgs = [os.path.join(label_dir, x + ".png") for x in name_list]
pred_imgs = [os.path.join(pred... | Python | 1 |
&'a mut W {
self.variant(FLEXIO1_CLK_PRED_A::DIVIDE_6)
}
#[doc = "Divide by 7"]
#[inline(always)]
pub fn divide_7(self) -> &'a mut W {
self.variant(FLEXIO1_CLK_PRED_A::DIVIDE_7)
}
#[doc = "Divide by 8"]
#[inline(always)]
pub fn divide_8(self) -> &'a mut W {
self.... | Rust | 0 |
eleaseHistoryEntity, ID,
};
pub async fn publication_item(
r_id: u64,
name: String,
namespace_id: u64,
remark: String,
config: Vec<ItemDesc>,
change: Vec<ItemDesc>,
user_id: u32,
) -> Result<bool, DbErr> {
// 序列化
let config_data = serde_json::to_string(&config).unwrap();
let cha... | Rust | 0 |
import logging
import re
from asammdf import Signal
from asammdf.blocks.utils import MdfException
from asammdf.blocks.v4_blocks import Channel
from PySide6.QtWidgets import QMessageBox
def evaluateFormula(curveName, curveFormula, signals, log):
curveFormulaNames = re.findall(r"[a-zA-Z0-9_]+", curveFormula)
c... | Python | 1 |
from collections import defaultdict
def checking_aggregation(graph):
ent_lst = set()
rel_lst = set()
ts_lst = set()
head_2_facts = defaultdict(lambda: set())
tail_2_facts = defaultdict(lambda: set())
# rel_2_facts = defaultdict(lambda: set())
# ts_2_facts = defaultdict(lambda: set())
... | Python | 1 |
#[test]
fn gpos_chaining3_successive_001() {
assert_eq!(
shape(
"tests/fonts/aots/gpos_chaining3_successive_f1.otf",
"\u{0000}\u{0019}\u{0014}\u{0015}\u{0016}\u{0017}\u{0018}\u{0000}",
"--features=\"test\" --no-clusters --no-glyph-names --ned",
),
"0|\
... | Rust | 0 |
"""
Interactive Toroid
PDE by Ira Greenberg, rewritten in Python by Jonathan Feinberg
Illustrates the geometric relationship between Toroid, Sphere, and Helix
3D primitives, as well as lathing principal.
Instructions:
UP arrow key pts++
DOWN arrow key pts--
LEFT arrow key segments--
RIGHT arrow key segments... | Python | 1 |
#[serde(rename="LDAPTrustStoreCertifcate")]
pub ldap_trust_store_certifcate: Option<String>,
#[serde(rename="LDAPTrustStorePassword")]
pub ldap_trust_store_password: Option<String>,
#[serde(rename="ADGatewayPurgeTime")]
pub ad_gateway_purge_time: u64,
#[serde(rename="RDLower... | Rust | 0 |
from .read_article import read_article
from .student_articles import student_articles | Python | 1 |
IR(99, rdi)), rdx),
"483B5763",
"cmpq 99(%rdi), %rdx",
));
insns.push((
i_Cmp_RMI_R(8, ip_RMI_M(ip_Addr_IR(99, rdi)), r8),
"4C3B4763",
"cmpq 99(%rdi), %r8",
));
insns.push((
i_Cmp_RMI_R(8, ip_RMI_M(ip_Addr_IR(99, rdi)), rsi),
"483B7763",
... | Rust | 0 |
, [`Argue`] will return [`ArgyleError::WantsHelp`] if help args are
/// present.
pub const FLAG_HELP: u8 = 0b0000_1000;
/// # Flag: Check For Version Flag.
///
/// When set, [`Argue`] will return [`ArgyleError::WantsVersion`] if version
/// args are present.
pub const FLAG_VERSION: u8 = 0b0001_0000;
/// ... | Rust | 0 |
that the stream is not yet done and more
/// data has yet to be processed.
Finish = ffi::MZ_FINISH as isize,
#[doc(hidden)]
_Nonexhaustive,
}
/// The inner state for an error when decompressing
#[derive(Debug)]
pub(crate) enum DecompressErrorInner {
General { msg: ErrorMessage },
NeedsDiction... | Rust | 0 |
nLayer::new(HCaptchaConfig {
site_key: String::from(HCAPTCHA_SITE_KEY),
secret: String::from(HCAPTCHA_SECRET_KEY),
}));
axum::Server::bind(&"127.0.0.1:9527".parse().unwrap())
.serve(app.into_make_service())
.await
.unwrap();
}
<reponame>fabio-d/fuchsia-stardo... | Rust | 0 |
InnerSpace<Scalar = f64> + Tolerance,
{
#[cfg(all(test, debug_assertions))]
let mut log = Vec::new();
for _ in 0..=trials {
#[cfg(all(test, debug_assertions))]
log.push(hint);
let pt = curve.subs(hint);
let der = curve.der(hint);
let der2 = curve.der2(hint);
... | Rust | 0 |
# coding=utf-8
# Copyright 2025 The Google Research Authors.
#
# 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 applicab... | Python | 1 |
"""Tests for database management."""
import tempfile
from pathlib import Path
import pytest
from src.storage.database import DatabaseManager
@pytest.fixture
async def db_manager():
"""Create test database manager."""
with tempfile.TemporaryDirectory() as temp_dir:
db_path = Path(temp_dir) / "test.d... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import os
def calculate_physical_radius(mu_chain, rh_arcmin_chain):
"""
计算物理半径 r_h(pc) 的概率分布
参数:
mu_chain: 距离模数 μ 的MCMC链
rh_arcmin_chain: 角半径 r_h(arcmin) 的MCMC链
返回:
rh_pc_chain: 物理半径 r_h(pc) 的链
"""
# 1.... | Python | 1 |
time at once
//!
//! ```no_run
//! use linux_embedded_hal as hal;
//! use ds1307::{Ds1307, NaiveDate, Rtcc};
//!
//! let dev = hal::I2cdev::new("/dev/i2c-1").unwrap();
//! let mut rtc = Ds1307::new(dev);
//! let datetime = NaiveDate::from_ymd(2020, 5, 2).and_hms(19, 59, 58);
//! rtc.set_datetime(&datetime).unwrap();
/... | Rust | 0 |
let __body = vec![];
match __request.body(__body) {
Ok(request) => Ok((request, k8s_openapi::ResponseBody::new)),
Err(err) => Err(k8s_openapi::RequestError::Http(err)),
}
}
}
// Generated from operation watchBuildOpenshiftIoV1NamespacedBuildConfig
impl BuildConfig {
//... | Rust | 0 |
: &'a mut gst::BufferRef,
matrix: Option<&[[f32; 4]; 4]>,
) -> gst::MetaRefMut<'a, Self, gst::meta::Standalone> {
skip_assert_initialized!();
unsafe {
let meta = gst::ffi::gst_buffer_add_meta(
buffer.as_mut_ptr(),
ffi::gst_video_affine_transformati... | Rust | 0 |
from .poly import gen_poly
from .constraint import is_satisfied
from .copy_constraint import copy_constraint_simple
import pdb
def verify_naieve(Ql, Qr, Qm, Qo, Qc, a, b, c, witness_y, perm_a, perm_b, perm_c):
# make sure constarints + witness is statisfied
assert is_satisfied(Ql, Qr, Qm, Qo, Qc, a, b, c) ==... | Python | 1 |
kwargs["http_mocker"] = self
try:
result = f(*args, **kwargs)
except requests_mock.NoMockAddress as no_mock_exception:
matchers_as_string = "\n\t".join(map(lambda matcher: str(matcher.request), self._matchers))
raise V... | Python | 1 |
"""
Problem Link: https://practice.geeksforgeeks.org/problems/uncommon-characters/0
Find and print the uncommon characters of the two given strings S1 and S2. Here uncommon character means that either the character
is present in one string or it is present in other string but not in both. The strings contains only lo... | Python | 1 |
self.insertions = insertions
self.deletions = deletions
self.lines = lines
self.files = files
self.files_json = None
return self
class CommitDataFrame(pd.DataFrame):
_metadata = ['name']
@property
def _constructor(self):
return CommitDataFrame
@pr... | Python | 1 |
func.locations[sp_threshold] = ir::ValueLoc::Reg(RU::rax as RegUnit);
// If the stack pointer currently reaches the SP threshold or below it then after opening
// the current stack frame, the current stack pointer will reach the limit.
let cflags = pos.ins().ifcmp_sp(sp_threshold);
pos.func.locations[c... | Rust | 0 |
return len(rest)
while(count_rest() != 0):
df = pd.read_csv("~/Downloads/RLHF-Reward-Modeling/similar/Benchmark_test_gpt4o_3.csv")
rest = []
for index, row in df.iterrows():
if not (row["choose"] == 1.0 or row["choose"] == 2.0):
rest.append(row["compare_id"])
# print("rest = ", r... | Python | 1 |
4 229 x 324 mm.
ENV_C4 30
/// Envelope C6 114 x 162 mm.
ENV_C6 31
/// Envelope C65 114 x 229 mm.
ENV_C65 32
/// Envelope B4 250 x 353 mm.
ENV_B4 33
/// Envelope B5 176 x 250 mm.
ENV_B5 34
/// Envelope B6 176 x 125 mm.
ENV_B6 35
/// Envelope 110 x 230 mm.
ENV_ITALY 36
/// Envelope Monarch 3.8... | Rust | 0 |
probe.owsgetcaps.WmtsGetCaps'
},
'OSGeo:TMS': {
'probe_class': 'GeoHealthCheck.plugins.probe.tms.TmsCaps'
},
'OGC:WFS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WfsGetCaps'
},
'OGC:WCS': {
'probe_class': 'GeoHealthCheck.plugins.probe.owsgetcaps.WcsGetCaps... | Python | 1 |
end_logits = tf.squeeze(input=end_logits, axis=-1)
loss = None
if start_positions is not None and end_positions is not None:
labels = {"start_position": start_positions}
labels["end_position"] = end_positions
loss = self.hf_compute_loss(labels=labels, logits=(start... | Python | 1 |
collapsed into one validator.
pub fn merge_quorum_set(&self, quorum_set: QuorumSet) -> QuorumSet {
let mut threshold = quorum_set.threshold;
let mut validators: Vec<NodeId> = quorum_set
.validators
.iter()
.map(|&x| self.merge_node(x))
.collect();
... | Rust | 0 |
e IExtendTaskPad = *mut ::core::ffi::c_void;
pub type IExtendView = *mut ::core::ffi::c_void;
pub type IHeaderCtrl = *mut ::core::ffi::c_void;
pub type IHeaderCtrl2 = *mut ::core::ffi::c_void;
pub type IImageList = *mut ::core::ffi::c_void;
#[doc = "*Required features: `\"Win32_System_Mmc\"`*"]
pub const ILSIF_LEAVE_LA... | Rust | 0 |
call_target_return_type_spec: mdTypeSpec,
module_metadata: &ModuleMetadata,
) -> Result<Instruction, HRESULT> {
self.ensure_base_calltarget_tokens(module_metadata)?;
let signature = vec![
(CorCallingConvention::IMAGE_CEE_CS_CALLCONV_DEFAULT
| CorCallingConventi... | Rust | 0 |
import getpass
import os
import subprocess
from dotenv import load_dotenv
from sqlmesh.core.config import (
Config,
DuckDBConnectionConfig,
ModelDefaultsConfig,
GatewayConfig,
DuckDBConnectionConfig,
NameInferenceConfig,
CategorizerConfig,
PlanConfig,
AutoCategorizationMode
)
from s... | Python | 1 |
ity_id).expect("Unable to load community");
let comm_data: CommunityData = serde_json::from_value(community.data).unwrap();
let mut comm_data = comm_data.to_owned();
comm_data.experiences += 1;
comm_data.inclusivity_map.insert(new_experience.id, inclusivity.to_f32().unwrap());
let total: f32 = c... | Rust | 0 |
from ctypes import *
import time,sys,traceback
import ctypes
import NuPython
import time
import nuconst
cid_1 = 0
bid_1 = 4
pid_1 = 1
cid_2 = 0
bid_2 = 4
pid_2 = 2
# packet size
pkt_len = 128
# packet count
pkt_count = 1000
# transmit rate
utilization = 10
# connect to server
nscmd = NuPython.Nu... | Python | 1 |
# utils/auth_utils.py
from functools import wraps
from flask import session, jsonify
def is_user_in_group(group_name):
"""Check if the logged-in user belongs to a given group."""
if 'user_info' in session:
user_groups = session['user_info'].get('groups', [])
return group_name in user_groups
... | Python | 1 |
nt_color = WHITE;
let mut index = 0;
let mut proposition = vec![Some(Pixel::Cross); game_line.board_line.len()];
let mut changes = false;
for clue in game_line.clues {
if clue.color.eq(¤t_color) {
// 2 consecutive colors, allow a space between them
... | Rust | 0 |
ate) packed_as: ArrayD<Arc<Tensor>>,
pub(crate) fused_ops: Option<ArrayD<Vec<FusedSpec<TI>>>>,
pub(crate) mmm: MMMWrapper<TA, TB, TC, TI>,
}
impl<TA, TB, TC, TI> DynHash for MatMatMulUnaryFinite<TA, TB, TC, TI>
where
TA: Datum + Copy + Zero,
TB: Datum + Copy + Zero,
TC: Datum + Copy,
TI: Datum ... | Rust | 0 |
ing packet to the server. It should be just
/// Drop::drop, but it wouldn't work for the anticipated async
/// version.
#[instrument]
fn shutdown(mut self) -> Result<(), RpcError> {
let mut hh = RpcRequestHeaderProto::default();
hh.set_rpcKind(RpcKindProto::RPC_PROTOCOL_BUFFER);
... | Rust | 0 |
ce<T>);
seq_impl!(BTreeSet<T>);
seq_impl!(HashSet<T, H: Sized>);
seq_impl!(LinkedList<T>);
seq_impl!(Slice<T>);
seq_impl!(Vec<T>);
seq_impl!(VecDeque<T>);
macro_rules! map_impl {
($ty:ident < K $(: $kbound1:ident $(+ $kbound2:ident)*)*, V $(, $typaram:ident : $bound:ident)* >) => {
impl<K, KU, V, VU $(, $t... | Rust | 0 |
},
mode2: match data.1 {
'1' => GsaMode2::NoFix,
'2' => GsaMode2::Fix2D,
'3' => GsaMode2::Fix3D,
_ => unreachable!(),
},
fix_sats_prn: (data.2).0.drain(..).filter_map(|v| v).collect(),
pdop: (data.2).1,... | Rust | 0 |
#Write a function to return a list of all pairs of consecutive items in a given list.
def pair_wise(l1):
temp = []
for i in range(len(l1) - 1):
current_element, next_element = l1[i], l1[i + 1]
x = (current_element, next_element)
temp.append(x)
return temp | Python | 1 |
}
out_arr[out_arr_len] = footer;
out_arr_len += 1;
let size = write_vectored_offset(dest, &out_arr[..out_arr_len], chunkv.sent)?;
chunkv.sent += size;
if chunkv.sent < total {
return Ok(0);
}
*chunk = None;
Ok(data_size)
}
// writes src to dest as chunks. current chunk st... | Rust | 0 |
ep mode, or busy due to a sleep or wake up procedure."]
VALUE2,
}
impl From<SLEEP_A> for bool {
#[inline(always)]
fn from(variant: SLEEP_A) -> Self {
match variant {
SLEEP_A::VALUE1 => false,
SLEEP_A::VALUE2 => true,
}
}
}
#[doc = "Reader of field `SLEEP`"]
pub ty... | Rust | 0 |
port")
logger.info(
f"Server configuration: host={config.host}, port={config.mcp_port}, log_level={config.courtlistener_log_level}"
)
try:
await mcp.run_async(
transport="streamable-http",
host=config.host,
port=config.mcp_port,
path="/mcp/",
... | Python | 1 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: protos/perfetto/trace/track_event/chrome_application_state_info.proto
# Protobuf Python Version: 5.27.3
'''Generated protocol buffer code.'''
from google.protobuf import descriptor as _descripto... | Python | 1 |
Foo<'a> { }
trait Bar where forall<'a> Self: Foo<'a> { }
}
goal {
forall<T> {
if (T: Bar) {
forall<'a> {
T: Foo<'a>
}
}
}
} yields {
"Unique"
}... | Rust | 0 |
to handle your throughput and storage requirements, while maintaining
//! consistent and fast performance. All of your data is stored on solid state disks (SSDs) and
//! automatically replicated across multiple Availability Zones in an AWS region, providing
//! built-in high availability and data durability. </p>
// C... | Rust | 0 |
),
checksum: u32::from_le_bytes(
b.get(12..16)
.ok_or(TbfParseError::InternalError)?
.try_into()?,
),
})
}
}
impl core::convert::TryFrom<u16> for TbfHeaderTypes {
type Error = TbfParseError;
fn try_from(h: u16) -> Resu... | Rust | 0 |
[bold red]命令执行失败,但没有详细的错误信息[/bold red]")
if suggested_commands and not auto_mode:
console.print("\n[bold yellow]建议的修复命令:[/bold yellow]")
for i, cmd in enumerate(suggested_commands):
console.print(f"{i+1}. {cmd}")
choice = input("请选择修复命令(输入命令序号或'quit'退出):")
i... | Python | 1 |
h_boost = weakest_state['technology_level'] * 0.1
weakest_state['technology_level'] += tech_boost
# 添加平衡事件
world_state.add_event({
'type': 'balance',
'subtype': 'technology_breakthrough',
'target... | Python | 1 |
from capitalize import capitalize
assert capitalize('hello') == 'Hello'
if capitalize('') != '':
raise Exception('Функция работает неверно!')
print('Все тесты пройдены!') | Python | 1 |
n超时后,这个用户才会无法认证
若email不存在,抛出EmailNotFoundError异常
若inbound_tag不存在,抛出InboundNotFoundError异常
"""
stub = command_pb2_grpc.HandlerServiceStub(self._channel)
try:
stub.AlterInbound(command_pb2.AlterInboundRequest(
tag=inbound_tag,
operation=t... | Python | 1 |
mma: Vec<E> =
Vec::with_capacity(get_merkle_proof_lemma_len(self.row_count, branches));
let mut path: Vec<usize> = Vec::with_capacity(self.row_count - 1); // path - 1
ensure!(
SubTreeArity::to_usize() == 0,
"Data slice must not have sub-tree layers"
);
... | Rust | 0 |
: cl_device_id, param_name: DeviceInfo) -> Result<InfoType, cl_int> {
api_info_size!(get_size, clGetDeviceInfo);
let param_id = param_name as cl_device_info;
match param_name {
DeviceInfo::CL_DEVICE_NAME
| DeviceInfo::CL_DEVICE_VENDOR
| DeviceInfo::CL_DRIVER_VERSION
| Device... | Rust | 0 |
from cryptography.fernet import Fernet
import base64
def generate_keys():
"""Генерирует ключи шифрования и шифрует приватный ключ"""
# Генерируем ключ шифрования
encryption_key = Fernet.generate_key()
print(f"\nGenerated ENCRYPTION_KEY: {encryption_key.decode('ascii')}")
# Создаем шифровальщик... | Python | 1 |
import torch
from torch import nn
import numpy as np
from utils.graphics_utils import getWorld2View2, getProjectionMatrix
from debug_utils import debug_print
class Camera(nn.Module):
def __init__(self, colmap_id, R, T, FoVx, FoVy, image, gt_alpha_mask,
image_name, uid,
trans=np.... | Python | 1 |
.map(|index| index * E::byte_len() * base_tree_leaves)
.collect();
let configs = (0..sub_tree_arity)
.map(|index| {
// prepare replica file content
let config = StoreConfig::new(
temp_dir_path,
format!("{}{}", String::from("config_id"), index... | Rust | 0 |
bove for signed types, assuming the same benchmark results hold
specialize!(i8, 32, 2, i8_32);
specialize!(i8, 24, 2, i8_24);
specialize!(i8, 16, 2, i8_16);
specialize!(i16, 16, 2, i16_16);
specialize!(i16, 8, 2, i16_8);
specialize!(i16, 4, 1, i16_4);
specialize!(i32, 8, 2, i32_8);
specialize!(i32, 4, 1, i32_4);
macro... | Rust | 0 |
import json
import os
current_translation = {}
localization_root = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'language')
def localization_js(filename):
global current_translation
if isinstance(filename, str):
full_name = os.path.abspath(os.path.join(localization_root, filename + '.js... | Python | 1 |
pes specified in `new_map` are valid.
verbose : boolean
A flag used to provide information about the types mapped
Returns
-------
tuple of (dict, list)
The updated Fortran-to-C type mapping dictionary and a list of
successfully mapped C types.
c S s ... | Python | 1 |
] fn butterfly32_03(b: &mut Bencher) { bench_butterfly32(b, 3); }
#[bench] fn butterfly32_04(b: &mut Bencher) { bench_butterfly32(b, 4); }
#[bench] fn butterfly32_05(b: &mut Bencher) { bench_butterfly32(b, 5); }
#[bench] fn butterfly32_06(b: &mut Bencher) { bench_butterfly32(b, 6); }
#[bench] fn butterfly32_07(b: &mut ... | Rust | 0 |
ssor: an alias for `Reg<READMODE_DC_SYS_TIME_SPEC>`"]
pub type READMODE_DC_SYS_TIME = crate::Reg<readmode_dc_sys_time::READMODE_DC_SYS_TIME_SPEC>;
#[doc = "System Time read access"]
pub mod readmode_dc_sys_time;
#[doc = "WRITEMode_DC_SYS_TIME register accessor: an alias for `Reg<WRITEMODE_DC_SYS_TIME_SPEC>`"]
pub type ... | Rust | 0 |
{
//~^ NOTE: consider using an explicit lifetime parameter as shown: fn bar2<'a, 'c>(x: &'a Bar<'a, 'a, 'c>) -> (&'a int, &'a int, &'a int)
(x.bar, &x.baz, &x.baz) //~ ERROR: cannot infer
//~^ ERROR: cannot infer
//~^^ ERROR: cannot infer
}
struct Cat<'x, T> { cat: &'x int, t: T }
struct Dog<'y> { dog: &'... | Rust | 0 |
{
let sq = Square::new_nocheck(file, rank);
if let Some(piece) = game.board.get(sq) {
if piece.color == game.player {
match piece.typ {
PieceType::King => {
has_king = true;
enume... | Rust | 0 |
import pickle
def save_data(data, filename):
with open(filename, 'wb') as file:
pickle.dump(data, file)
def load_data(filename):
try:
with open(filename, 'rb') as file:
data = pickle.load(file)
return data
except FileNotFoundError:
print("Not found!")
... | Python | 1 |
Instantiate the contract.
///
/// `deps` contains Storage, API and Querier
/// `env` contains block, message and contract info
/// `msg` is the contract initialization message, sort of like a constructor call.
#[entry_point]
pub fn instantiate(
deps: DepsMut,
_env: Env,
info: MessageInfo,
_msg: Instant... | Rust | 0 |
measurement_types(&client).await?;
let mut response: HashMap<&str, Vec<MeasurementType>> = HashMap::new();
response.insert("measurement-types", measurement_types);
Ok(HttpResponse::Ok().json(response))
}
#[get("/measurement-type/{measurement_type_id}")]
pub async fn get_measurement_type_by_id(
db_poo... | Rust | 0 |
Debug)]
pub struct Bra {
op2: Op2,
link: bool,
cond: Cond,
}
impl Display for Bra {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let label = format!(
"b{}{:?}",
match self.link {
true => "l",
false => "",
},
... | Rust | 0 |
# -*- coding: utf-8 -*-
import sys
import re
from PyQt5.QtWidgets import (QWidget , QHBoxLayout , QVBoxLayout , QApplication, QPushButton, QLineEdit ,QLabel , QSplitter , QTableView , QHeaderView , QMessageBox )
from PyQt5.QtCore import Qt
from PyQt5.QtSql import QSqlDatabase , QSqlQueryModel , QSqlQuery
def creat... | Python | 1 |
import datetime
import stix2
from base_connector.connector import BaseConnector
from email_intel_microsoft.client import ConnectorClient
from email_intel_microsoft.config import ConnectorSettings
from email_intel_microsoft.converter import ConnectorConverter
class Connector(BaseConnector):
config: ConnectorSetti... | Python | 1 |
'a,
V: AsRef<str> + 'a,
{
let target = env::var("TARGET").unwrap();
let bindings_file = out_dir.as_ref().join("bindings.rs");
fs::write(
&bindings_file,
format!(
r#"macro_rules! bindings_env {{
("TARGET") => {{ "{}" }};
}}"#,
target
... | Rust | 0 |
_01 SW PAD Control Register
pub SW_PAD_CTL_PAD_GPIO_SD_B0_01: RWRegister<u32>,
/// SW_PAD_CTL_PAD_GPIO_SD_B0_02 SW PAD Control Register
pub SW_PAD_CTL_PAD_GPIO_SD_B0_02: RWRegister<u32>,
/// SW_PAD_CTL_PAD_GPIO_SD_B0_03 SW PAD Control Register
pub SW_PAD_CTL_PAD_GPIO_SD_B0_03: RWRegister<u32>,
... | Rust | 0 |
dyn_call_viji,
dyn_call_vijiii,
dyn_call_vijj,
dyn_call_viid,
dyn_call_vidd,
dyn_call_viidii,
dyn_call_viidddddddd,
temp_ret_0: 0,
stack_save,
stack_restore,
set_threw,
mapped_dirs,
... | Rust | 0 |
one, key: str = "", timeout: int = 15
) -> Any:
"""Get remote config flag value from remote_config API endpoint"""
return get(
personal_api_key,
f"/api/projects/@current/feature_flags/{key}/remote_config/",
host,
timeout,
)
def batch_post(
api_key: str,
host: Option... | Python | 1 |
"""
-------------------------------------------------------
[program description]
-------------------------------------------------------
Author: Cagri Isilak
ID: 210764050
Email: isil4050@mylaurier.ca
__updated__ = "2022-09-18"
-------------------------------------------------------
"""
# Imports
from function... | Python | 1 |
`Reg<FLASH_ACE1_ATTR_SPEC>`"]
pub type FLASH_ACE1_ATTR = crate::Reg<flash_ace1_attr::FLASH_ACE1_ATTR_SPEC>;
#[doc = "APB_CTRL_FLASH_ACE1_ATTR_REG"]
pub mod flash_ace1_attr;
#[doc = "FLASH_ACE2_ATTR register accessor: an alias for `Reg<FLASH_ACE2_ATTR_SPEC>`"]
pub type FLASH_ACE2_ATTR = crate::Reg<flash_ace2_attr::FLAS... | Rust | 0 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from MultipleLinearRegressionModel import LRWithMulVarModel
train = pd.read_csv(r"C:\Users\HP\OneDrive\Desktop\Python\SuperVised_Learning\MultipleLinearRegression\train.csv")
test = pd.read_csv(r"C:\Users\HP\OneDrive\Desktop\Python\SuperVised_Learn... | Python | 1 |
)
.at_rc(3, 5),
Statement::ForLoop(ForLoopNode {
variable_name: "J".as_name(4, 9),
lower_bound: 1.as_lit_expr(4, 13),
upper_bound: 10.as_lit_expr(4, 18),
... | Rust | 0 |
from abc import ABC, abstractmethod
class ResultBackend(ABC):
"""Abstract base class for result backends."""
@abstractmethod
def store_result(self, task_id, result):
pass
@abstractmethod
def get_result(self, task_id):
pass | Python | 1 |
an colored center, this center can be taken as a reference point after running the given cursor command.
fn draw_cursor_box<W, F, T>(w: &mut W, description: &str, cursor_command: F) -> Result<()>
where
W: Write,
F: Fn(u16, u16) -> T,
T: Command,
{
execute!(
w,
cursor::Hide,
curs... | Rust | 0 |
from odoo import models, _
class MailComposer(models.TransientModel):
_inherit = 'mail.compose.message'
def action_send_mail(self):
res = super().action_send_mail()
if self.filtered(lambda l: l.model == 'pos.order'):
return {
'type': 'ir.actions.client',
... | Python | 1 |
"lladdr"
)
if res is None:
raise AssertionError(
"Can't find host link-local address on interface {}"
.format(tap)
)
else:
return res
def testfunc(child):
tap = get_bridge(os.environ["TAP"])
lladdr = get_host_lladdr(tap)
time.s... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import json
from odoo.tests import tagged
from odoo.addons.bus.tests.common import WebsocketCase
@tagged("post_install", "-at_install")
class TestGuestFeature(WebsocketCase):
def test_channel_seen_as_guest(self):
guest = self.env[... | Python | 1 |
k, nf, increase_dim=True, n=n - 1)
self.stage_3 = self._make_layer(Block, 2 * nf, increase_dim=True, n=n - 2)
self.stage_4 = Block(
4 * nf, increase_dim=False, last=True, downsampling=self._downsampling_type
)
if pooling_config["type"] == "avg":
self.pool = nn.Av... | Python | 1 |
sel_pulse_period(&mut self, ty: VcselPeriodType) -> Result<u8, E> {
match ty {
VcselPeriodType::VcselPeriodPreRange => Ok(decode_vcsel_period(
self.read_register(Register::PRE_RANGE_CONFIG_VCSEL_PERIOD)?,
)),
VcselPeriodType::VcselPeriodFinalRange => Ok(decode... | Rust | 0 |
should get back a different amount of tokens.
let alice_usdc = Tokens::balance(USDC, &ALICE);
let alice_usdt = Tokens::balance(USDT, &ALICE);
assert_ok!(default_acceptable_computation_error(alice_usdc.into(), initial_usdc.into()));
assert_ok!(default_acceptable_computation_error(alice_usdt.into(), initial_usdt... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.