text string | label_name string | labels int64 |
|---|---|---|
::ControlRead => {
let entry = match self.archive.next_entry() {
Some(entry) => entry?,
None => return Err(Error::MissingDataArchive),
};
self.state = ReadState::DataRead;
get_tar_from_entry(entry)
}
... | Rust | 0 |
s};
use hhbc_by_ref_runtime::TypedValue;
use hhbc_by_ref_scope::scope;
use hhbc_by_ref_symbol_refs_state::IncludePath;
use itertools::Either;
use lazy_static::lazy_static;
use naming_special_names_rust::{
emitter_special_functions, fb, pseudo_consts, pseudo_functions, special_functions,
special_idents, superglo... | Rust | 0 |
Capability::SinkOffload` enum variant.
///
/// This is a variant of [`xcb_randr_provider_capability_t`].
pub const XCB_RANDR_PROVIDER_CAPABILITY_SINK_OFFLOAD: xcb_randr_provider_capability_t = 8;
/// The cookie for the reply to a `RandR::GetProviderInfo` request.
///
/// Pass this cookie to [`xcb_randr_get_provider_in... | Rust | 0 |
"""
MiniMax Speech API 异常类
"""
class MiniMaxError(Exception):
"""MiniMax API 基础异常类"""
pass
class MiniMaxAPIError(MiniMaxError):
"""API调用异常"""
def __init__(
self,
message: str,
status_code: int | None = None,
response_data: dict | None = None,
):
super().... | Python | 1 |
"progress", "0%"),
"current_step": result.get("current_step", ""),
"submitted_at": result.get("submitted_at"),
"started_at": result.get("started_at"),
"completed_at": result.get("completed_at"),
"failed_at": result.get("failed_at"),
"processing_time": result.get("processi... | Python | 1 |
field is `CPFLTDLY_1`"]
#[inline(always)]
pub fn is_cpfltdly_1(&self) -> bool {
*self == CPFLTDLY_A::CPFLTDLY_1
}
#[doc = "Checks if the value of the field is `CPFLTDLY_2`"]
#[inline(always)]
pub fn is_cpfltdly_2(&self) -> bool {
*self == CPFLTDLY_A::CPFLTDLY_2
}
#[doc =... | Rust | 0 |
iptEnum::MsigAny(x) => x.serialize(serializer),
MultisigScriptEnum::MsigNOfK(x) => x.serialize(serializer),
}
}
}
impl Deserialize for MultisigScriptEnum {
fn deserialize<R: BufRead + Seek>(raw: &mut Deserializer<R>) -> Result<Self, DeserializeError> {
(|| -> Result<_, DeserializeEr... | Rust | 0 |
# Copyright Materialize, Inc. and contributors. All rights reserved.
#
# Use of this software is governed by the Business Source License
# included in the LICENSE file at the root of this repository.
#
# As of the Change Date specified in that file, in accordance with
# the Business Source License, use of this software... | Python | 1 |
from django.conf import settings
from rest_framework_csv.renderers import CSVRenderer
def remove_newlines(x):
return x.replace('\n', ' ').replace('\r', '') if isinstance(x, str) else x
class CSVExcelRenderer(CSVRenderer):
format = 'excel.csv'
writer_opts = { 'delimiter': settings.EXCEL_CSV_DEFAULT_DELIMIT... | Python | 1 |
_reserve_percent(
Origin::root(),
Percent::from_percent(50)
));
assert_eq!(
last_event(),
MetaEvent::Stake(Event::ParachainBondReservePercentSet(
Percent::from_percent(30),
Percent::from_percent(50)
))
);... | Rust | 0 |
HRESULT = 0x80110402;
pub const COMADMIN_E_KEYMISSING: HRESULT = 0x80110403;
pub const COMADMIN_E_ALREADYINSTALLED: HRESULT = 0x80110404;
pub const COMADMIN_E_APP_FILE_WRITEFAIL: HRESULT = 0x80110407;
pub const COMADMIN_E_APP_FILE_READFAIL: HRESULT = 0x80110408;
pub const COMADMIN_E_APP_FILE_VERSION: HRESULT = 0x801104... | Rust | 0 |
4.0 * x.powi(2) + 2.0 * y + z)
};
let u_h = flatten_vertically(&mesh.vertices().iter().map(g).collect::<Vec<_>>()).unwrap();
let computed_L2_error = estimate_L2_error(&mesh, u_vector, &u_h, &quadrature_table).unwrap();
// Compute the error "manually" element-by-element for comparison
let expected_... | Rust | 0 |
ub_message['changed']))
elif 'deleted' in sub_message:
sub_message['deleted']['name'] = gettext(sub_message['deleted']['name'])
messages.append(gettext('Deleted {name} "{object}".').format(**sub_message['deleted']))
change_message = ' '.join(msg[0].u... | Python | 1 |
usize {
std::cmp::max(BLS12381PublicKey::length(), Ed25519PublicKey::length())
}
}
impl TryFrom<&[u8]> for GenericPublicKey {
type Error = CryptoMaterialError;
fn try_from(bytes: &[u8]) -> std::result::Result<GenericPublicKey, CryptoMaterialError> {
Ed25519PublicKey::try_from(bytes)
... | Rust | 0 |
;
s.end()
}
}
impl<'de> Deserialize<'de> for Field {
fn deserialize<D: Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> de::Visitor<'de> for Visitor {
type Value = Field;
fn expecting<'a>(&self, f: &mut Formatter<'a>) -> fmt::Resul... | Rust | 0 |
input(self) -> Matrix4<f64> {
let rotation: Rotation3<f64> = self.into();
let matrix: Matrix3<f64> = rotation.into();
matrix.to_homogeneous()
}
/// The jacobian of the output of a rotation in respect to the
/// rotation itself.
///
/// `y = R * x`
///
/// `dy/dR = -h... | Rust | 0 |
Returns:
str: The cleaned and validated bio.
"""
# Remove the prompt from the generated text
bio = generated_text.replace(prompt, "").strip()
# Ensure the bio ends with a period. If not, truncate to the last complete sentence.
if not bio.endswith('.'):
las... | Python | 1 |
family_size_distribution = analyze_family_sizes(solution_counts)
print(f"Family size distribution: {family_size_distribution}")
total_time = time.time() - start_time
print(f"Total analysis complete in {total_time:.2f} seconds.")
def analyze_family_sizes(solution_counts, min_family_size=MIN_FAMILY_SIZE):
... | Python | 1 |
write_u8(color.r)?;
}
Self::BgrA32 => {
buffer.write_u8(color.b)?;
buffer.write_u8(color.g)?;
buffer.write_u8(color.r)?;
buffer.write_u8(color.a)?;
}
Self::BgrX32 => {
buffer.write_u8(color.b)... | Rust | 0 |
# -*- coding: utf-8 -*-
tinynumbers = [
[0b11111, 0b11111],
[0b11111],
[0b10111, 0b11101],
[0b10101, 0b11111],
[0b11110, 0b00011],
[0b11101, 0b10111],
[0b11111, 0b00111],
[0b10000, 0b11111],
[0b10101, 0b10101],
[0b11100, 0b11111]
]
# add japanese
# Each hex number is a column,... | Python | 1 |
, 0x29_u8, 0x1a_u8, 0x96_u8, 0x4c_u8,
0xf2_u8, 0xf0_u8, 0x70_u8, 0x38_u8
)
);
assert_eq!(
super::pbkdf2_hmac_sha1(
"<PASSWORD>",
"sa\x00lt".as_bytes(),
4096u,
16u
),
vec!(
... | Rust | 0 |
cp(
os.path.join(self.data_dir, 'wav.scp'))
self.reco2dur = load_reco2dur(
os.path.join(self.data_dir, 'reco2dur'))
self.spk2idx = load_spk2idx(
os.path.join(self.data_dir, 'spk2idx'))
def load_wav(self, recid, start=0, end=None):
data, rate =... | Python | 1 |
from .main import CRUDManager | Python | 1 |
feature = "v2_50", feature = "dox"))]
use libc;
use soup_sys;
#[cfg(any(feature = "v2_50", feature = "dox"))]
use std::boxed::Box as Box_;
use std::fmt;
#[cfg(any(feature = "v2_50", feature = "dox"))]
use std::mem::transmute;
#[cfg(any(feature = "v2_50", feature = "dox"))]
use URI;
#[cfg(any(feature = "v2_50", feature ... | Rust | 0 |
import numpy as np
from precision_recall_distributions import prd_score as prd
import os
# labels = ['WAE', 'WAE-GMM', 'RAE-SN']
# paths = ['/ps/scratch/pghosh/frozenModelsICCV_full/high_res_vae/logs/16/WAE_1/prd_data.npz',
# '/ps/scratch/pghosh/frozenModelsICCV_full/high_res_vae/logs/21/FAE-SN_1/prd_data.np... | Python | 1 |
,
kind: None,
read_only: None,
}
}
}
// Not all tests use all fixtures, prevent spurious warnings.
#![allow(dead_code)]
use ic_config::state_manager::Config;
use ic_interfaces::{
certification::Verifier, certified_stream_store::CertifiedStreamStore, state_manager::*,
};
use ic... | Rust | 0 |
`, `try_zip`, `race`, `race_ok`.
//!
//! This code is difficult to read due to its use of macros to support tuples of arbitrary length.
//! The `all` variants implement the same algorithms, but are simpler to understand.
macro_rules! apply_on_tuples {
($macro:ident!) => {
#[allow(non_snake_case)]
c... | Rust | 0 |
building process back to the parent process
output_dict = manager.dict()
# Launches process for loading serialized TFRecords from disk into memory, partitioning the data across machines, and storing data inside a GLT dataset class
mp.spawn(
fn=_build_dataset_process,
args=(
out... | Python | 1 |
protobuf::Clear for LogEntry {
fn clear(&mut self) {
self.clear_name();
self.clear_timestamp();
self.clear_severity();
self.clear_insert_id();
self.clear_labels();
self.clear_proto_payload();
self.clear_text_payload();
self.clear_struct_payload();
... | Rust | 0 |
_0000;
/// FIFO full flag on INT_DRDY pin
pub const F_FSS5: u8 = 0b0010_0000;
/// FIFO watermark status on INT_DRDY pin
pub const F_FTH: u8 = 0b0001_0000;
/// FIFO watermark status on INT_DRDY pin
pub const F_OVR: u8 = 0b0000_1000;
/// Data-ready signal on INT_DRDY pin
pub const DRDY: u8... | Rust | 0 |
Event::FrequencyUpdated { track, monotonic, rate_adjust_ppm, window_count } => {
self.update_track(track, |tn| {
tn.update_frequency(monotonic, rate_adjust_ppm, window_count)
});
}
Event::ClockCorrection { track, correction, strategy } =>... | Rust | 0 |
("Found Android SDK (cala)!");
}
sdk
}
};
let asat = format!("{}/.cargo-cala/android-ndk", home);
let andk = match var("ANDROID_NDK_HOME")
.or(var("NDK_HOME"))
.or(var("ANROID_NDK"))
{
Ok(s) => {
println!("Found Android NDK (env)!");
... | Rust | 0 |
terable of the same nodes with a custom ordering.
For example, `sorted` will sort the nodes in increasing order.
Returns
-------
nodes: generator
A generator of nodes in a depth-first-search post-ordering.
Examples
--------
>>> G = nx.path_graph(5)
>>> list(nx.dfs_postorder_nodes(G, source=0))
[4, 3, 2, 1, 0]
... | Python | 1 |
"""
📊 WORKSPACE HANDLER - Gestionnaire Google Workspace
Gère les fonctionnalités Google Sheets, Drive, etc.
"""
import structlog
from typing import Dict, Any
from datetime import datetime
class WorkspaceHandler:
"""Gestionnaire des fonctionnalités Google Workspace"""
def __init__(self):
self.log... | Python | 1 |
msg => warn!("Unknown message from listener: {msg:?}"),
}
}
info!("Listener disconnected");
}
"dude" => {
info!("Dude connected");
let mut rx = state.tx_to_dudes.subscribe();
// On ne peut pas utiliser le tx_to_client dans ... | Rust | 0 |
.read().unstable;
return Ok(u)
}
fn SetPermissions(&self, task: &Task, _dir: &mut Inode, p: FilePermissions) -> bool {
self.write().unstable.SetPermissions(task, &p);
return true;
}
fn SetOwner(&self, task: &Task, _dir: &mut Inode, owner: &FileOwner) -> Result<()> {
sel... | Rust | 0 |
import pytest
import torch
from torch.testing import assert_allclose
from zeta.nn.quant.qlora import QloraLinear
# Sample instantiation values
in_features = 20
out_features = 30
weight = torch.randn(out_features, in_features)
r = 5
lora_alpha = 2
lora_dropout = 0.5
@pytest.fixture
def qlora_layer():
return Qlor... | Python | 1 |
l::<v4l2_output>())).reserved as *const _ as usize },
60usize,
concat!(
"Offset of field: ",
stringify!(v4l2_output),
"::",
stringify!(reserved)
)
);
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct v4l2_control {
pub id: __u32,
pu... | Rust | 0 |
lowParameter(&self) -> *const c_void { self.inner_as_raw() }
}
impl crate::optflow::RLOFOpticalFlowParameterTrait for PtrOfRLOFOpticalFlowParameter {
#[inline] fn as_raw_mut_RLOFOpticalFlowParameter(&mut self) -> *mut c_void { self.inner_as_raw_mut() }
}
pub type PtrOfSparseRLOFOpticalFlow = core::Ptr<dyn cra... | Rust | 0 |
age_info["height"], image_info["width"], 1))
else:
if type(ann["segmentation"][0]) == list: # polygon
rle = mask.frPyObjects(
ann["segmentation"],
image_info["height"],
image_... | Python | 1 |
e64Cursor>,
before: Option<Base64Cursor>,
first: Option<usize>,
last: Option<usize>,
count: usize,
) -> (usize, usize) {
let start_offset = after.map(|cursor| cursor.offset + 1).unwrap_or(0);
let end_offset = before.map(|cursor| cursor.offset).unwrap_or(count);
match (first, last) {
... | Rust | 0 |
task.data["first_arrival"] = min(first_arrival, step)
elif self.game_map.obstacle_map[tuple(task.target_pos)] == Landscape.ASTEROID.value:
task.clear()
else:
actions[uid] = [self.__find_path_for(uid, task.target_pos), 0, 0]
... | Python | 1 |
_, l, r) => {l.names(buf); r.names(buf);},
Expr::GreaterThanEqual(_, l, r) => {l.names(buf); r.names(buf);},
Expr::Nand(_, l, r) => {l.names(buf); r.names(buf);},
}
}
}
impl Into<i64> for Expr {
fn into(self) -> i64 {
self.id()
}
}
impl Statement {
pub fn from_d... | Rust | 0 |
nd_equivalents_to_interest_liability": []}
for year_data in balancesheet_data.get("data", []):
year = year_data.get("year")
try:
# Get cash and equivalents
cash_and_equivalents = safe_float(year_data.get(CashFlowIdx.六_期末现金及现金等价物余额.name, 0))
# Calculate interest be... | Python | 1 |
ownership();
println!("gives_ownership: {}", s1);
let s2 = String::from("hello");
let s3 = takes_and_gives_back(s2);
println!("takes and gives back: {}", s3);
}
fn gives_ownership() -> String {
let some_string = String::from("hello");
some_string
}
fn takes_and_gives_back(a_string: Strin... | Rust | 0 |
Protocol::Ping => &mut self.ping_rl,
Protocol::Status => &mut self.status_rl,
Protocol::MetaData => &mut self.metadata_rl,
Protocol::Goodbye => &mut self.goodbye_rl,
Protocol::BlocksByRange => &mut self.bbrange_rl,
Protocol::BlocksByRoot => &mut s... | Rust | 0 |
{
font_catalog::TypefaceInAssetIndex, font_db::FontDb, FontCatalog, FontPackageListing,
FontSets,
},
anyhow::Error,
font_info::FontInfoLoader,
manifest::{v2, FontManifestWrapper},
std::path::Path,
};
/// Builds a `FontDb` and then generates a manifest from all of the font metadata t... | Rust | 0 |
"""
Problem: Move all negative elements to end
GFG Link: https://www.geeksforgeeks.org/problems/move-all-negative-elements-to-end1813/1
Description:
------------
Given an array `arr` of integers, the goal is to rearrange its elements such that
all **positive** numbers appear **before** all **negative** numbers,
while ... | Python | 1 |
from typing import Any
from .parse import TLDBaseKeys
from .errors import NotFoundError
from . import tldparsers
class DomainParser:
_no_match_checks = [
"no match",
"not found",
"no entries found",
"invalid query",
"domain name not known",
"no object found",
... | Python | 1 |
_id(inp);
self
}
pub fn set_check_id(mut self, input: std::option::Option<std::string::String>) -> Self {
self.inner = self.inner.set_check_id(input);
self
}
}
#[derive(std::fmt::Debug)]
pub struct ResolveCase<
C = smithy_client::erase::Dyn... | Rust | 0 |
the reward payment should be made. Keyed by controller.
#[pallet::storage]
#[pallet::getter(fn payee)]
pub type Payee<T: Config> =
StorageMap<_, Twox64Concat, T::AccountId, RewardDestination<T::AccountId>, ValueQuery>;
/// The map from (wannabe) validator stash key to the preferences of that validator.
///
//... | Rust | 0 |
def is_numeric(string):
if not isinstance(string, str):
return False
index = 0
result, index = scan_integer(string, index)
if index < len(string) and string[index] == '.':
index += 1
has_float, index = scan_unsigned_integer(string, index)
result = result or has_float
... | Python | 1 |
d1 << endl;
genericfactor = m / QQ(sqrt(f*d)) \
* ((u/2) ** (m-1)) * (f ** m) \
/ abs(QuadraticBernoulliNumber(m, d1)) \
* (2 ** m) # This last factor compensates for using the matrix of 2*Q
# return genericfactor
# Om... | Python | 1 |
file.')
parser.add_argument('-r', '--radius', metavar='RADIUS', required=True, type=int,
help='radius of environment. If table for this radius value exists in output DB '
'it will be dropped.')
parser.add_argument('-c', '--counts', action='store_true', defaul... | Python | 1 |
from lxml import etree
from zeep import ns
def xsi_ns(localname):
return etree.QName(ns.XSI, localname)
def xsd_ns(localname):
return etree.QName(ns.XSD, localname)
class _StaticIdentity(object):
def __init__(self, val):
self.__value__ = val
def __repr__(self):
return self.__valu... | Python | 1 |
, plugin_id.as_ptr())
.as_ref()
.unwrap(); // TODO
if !(instance.init)(instance) {
panic!("Instanciation failed!"); // TODO
}
instance
}
#[inline]
pub fn instance(&self) -> &clap_sys::plugin::clap_plugin {
// SAFETY: the instance pointer... | Rust | 0 |
import pandas as pd
import numpy as np
from data_fetch import download_historical_data
def calculate_macd(df, short_window=12, long_window=26, signal_window=9):
df['EMA_12'] = df['Close'].ewm(span=short_window, adjust=False).mean()
df['EMA_26'] = df['Close'].ewm(span=long_window, adjust=False).mean()
df['M... | Python | 1 |
/* tan(Inf or NaN) is NaN */
if ix >= 0x_7ff0_0000 {
return f64::NAN;
}
/* argument reduction */
let (n, y0, y1) = rem_pio2(x);
k_tan(y0, y1, n & 1)
}
use enum_primitive::cast::FromPrimitive;
use enum_primitive::enum_from_primitive;
enum_from_primitive! {
#[derive(Debug, PartialEq)]
pu... | Rust | 0 |
{
conn.handle(i, tx);
});
}
let out = std::io::stdout();
let mut guard = out.lock();
for r in rx {
let (i, num_unseen) = if let Some(r) = r {
r
} else {
break;
};
unseen[i] = num_unseen;
let msg = {
let per... | Rust | 0 |
import numpy as np
from smstools.models import stft as STFT
from smstools.models import utilFunctions as UF
import matplotlib.pyplot as plt
(fs, x) = UF.wavread('../../../sounds/piano.wav')
plt.figure(1, figsize=(9.5, 6))
w = np.hamming(256)
N = 256
H = 128
mX1, pX1 = STFT.stftAnal(2*x, w, N, H)
plt.subplot(211)
num... | Python | 1 |
import os.path as osp
import mmcv
import mmengine
def convert_balloon_to_coco(ann_file, out_file, image_prefix):
data_infos = mmengine.load(ann_file)
annotations = []
images = []
obj_count = 0
for idx, v in enumerate(mmengine.track_iter_progress(data_infos.values())):
filename = v['file... | Python | 1 |
) {
(Ins {
origin_right: or1,
content_known: ck1,
..
}, Ins {
origin_left: ol2,
origin_right: or2,
content_known: ck2,
..
}) => {
or1 == or2
... | Rust | 0 |
(x=rfecv.n_features_, color='red', linestyle='--',
label=f'最优特征数: {rfecv.n_features_}')
plt.xlabel('特征数量')
plt.ylabel('交叉验证分数')
plt.title('RFECV特征选择结果')
plt.legend()
plt.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig(os.path.join(PLOTS_DIR, 'RFECV结果.png'), dpi=300, bbox_inches='tight')
plt.close()
# ... | Python | 1 |
= 0.144
data = None
class Program_weight_tensor_meta_L_self_modules_model_modules_decoder_modules_layers_modules_5_modules_final_layer_norm_parameters_bias_:
name = "L_self_modules_model_modules_decoder_modules_layers_modules_5_modules_final_layer_norm_parameters_bias_"
shape = [1024]
dtype = "torch.f... | Python | 1 |
xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x02, 0x21, 0x00, 0xBB, 0xBB,
0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xB... | Rust | 0 |
y, Debug, PartialEq)]
pub enum CLK_DET_INT_STATUS_A {
#[doc = "0: Clock detector interrupt not triggered"]
CLK_DET_INT_FALSE = 0,
#[doc = "1: Clock detector interrupt triggered"]
CLK_DET_INT_TRUE = 1,
}
impl From<CLK_DET_INT_STATUS_A> for bool {
#[inline(always)]
fn from(variant: CLK_DET_INT_STA... | Rust | 0 |
rning permissions and
// limitations under the License.
use bldr_core::logger::Logger;
use config::Config;
use error::Result;
use hab_core::package::archive::PackageArchive;
use super::publisher::Publisher;
use super::workspace::Workspace;
pub fn post_process(
archive: &mut PackageArchive,
workspace: &Worksp... | Rust | 0 |
().len());
/// ```
pub fn leaves(&self) -> &[Hash] {
&self.nodes[self.count_internal_nodes..]
}
/// Verify value by comparing its hash against the one in the tree. `position` must not
/// exceed count of leaves and starts at 0.
///
/// # Examples
///
/// ```
/// use merk... | Rust | 0 |
ub mod generated;
<filename>src/lib.rs<gh_stars>1-10
extern crate chrono;
pub mod probe;
<filename>apps/plus-task/src/tasks/shared/commands/copy_as_artifact/mod.rs
mod params;
pub use params::{Params, ParamsBuilder};
use shellwork::core::command;
use shellwork::core::command::{Runner, Unprepared};
pub fn create_r... | Rust | 0 |
)
.and_then(|internal| {
Some(Self {
handle: internal.handle,
function: internal.path?,
lifetime: PhantomData,
})
})
}
}
impl<'a> MakePath<'a> {
fn relative_to_absolute_path(&mut self, relative_p... | Rust | 0 |
data, chain data, and mempool transactions
//! * spawns download and verify tasks for each gossiped block
//! * sends gossiped transactions to the mempool service
//!
//! Blocks:
//! * Sync Task
//! * runs in the background and continuously queries the network for
//! new blocks to be verified and added... | Rust | 0 |
#Equipe: Alexandre Bezerra de Lima, Ryann Carlos de Arruda Quintino, Victor Henrique Felix Brasil
import socket
from bitarray import bitarray
from request_generator import create_request
from text_formatter import format_received_message
if __name__ == '__main__':
client_socket = socket.socket(socket.AF_INET, so... | Python | 1 |
onrod_core::{widget, widget_ids, Colorable, Positionable, Sizeable, Widget, WidgetCommon};
use conrod_floatwin::{WinId, WindowBuilder, WindowingArea, WindowingContext, WindowingState};
#[derive(WidgetCommon)]
pub struct ExampleWidget<'a> {
#[conrod(common_builder)]
common: widget::CommonBuilder,
conrod_exa... | Rust | 0 |
status.end {
self.next_runnable
.as_mut()
.unwrap()
.run(Element::new_watermark(
self.task_number,
self.num_tasks,
MAX_WATERMARK.timestamp,
stream_s... | Rust | 0 |
import argparse
import sys
import os
import signal
import atexit
import faulthandler
from .server import mcp, cleanup_ui_process
from speech_mcp.utils.logger import get_logger
# Get a logger for this module
logger = get_logger(__name__)
# Enable faulthandler to help debug segfaults and deadlocks
faulthandler.enable()... | Python | 1 |
: ProofPath,
/// Key containing the prefix.
path: ProofPath,
},
/// One path is mentioned several times in the proof.
#[fail(display = "duplicate path in proof")]
DuplicatePath(ProofPath),
/// Entries in the proof are not ordered by increasing path.
#[fail(display = "invalid pa... | Rust | 0 |
tulo": 2},
{"pergunta": "A tag <main> deve aparecer quantas vezes por documento?",
"opcoes": ["A) Várias vezes", "B) Duas vezes", "C) Uma vez", "D) Nenhuma"],
"resposta": "C", "capitulo": 2},
{"pergunta": "Qual tag é usada para conteúdo complementar?",
"... | Python | 1 |
m)
def _extract_features(
self,
inputs: dict[str, cx.Field],
prefix: str = '',
) -> dict[str, cx.Field]:
"""Returns a nodal velocity and prognostic features."""
# Note: all intermediate features have an explicit cos-lat factors in key.
# These factors are removed in the `__call__` met... | Python | 1 |
string buffer after decryption on the stack.
#[derive(Copy, Clone)]
#[repr(transparent)]
pub struct WObfBuffer<A>(A);
impl<A: FixedSizeArray<u16>> WObfBuffer<A> {
unsafe fn uninit() -> Self {
mem::uninitialized()
}
#[inline]
pub fn as_wide(&self) -> &[u16] {
self.0.as_slice()
}
}
impl<A: FixedSizeArray<u16>> ... | Rust | 0 |
is because
/// we need to obtain immutable and mutable access to the counters while a
/// (possibly mutable) reference to the value exists and `UnsafeCell` requires
/// that any created mutable references are unique (this is Rust's underlying
/// model, after all), so we can't just put `Inner` into a single `UnsafeCel... | Rust | 0 |
{e}[/red]\n")
# Summary table
if results:
console.print("\n[bold cyan]Summary Comparison:[/bold cyan]")
summary_table = Table(title="All Models Comparison")
summary_table.add_column("Model", style="cyan")
summary_table.add_column("Verdict", style="bold")
sum... | Python | 1 |
GraphEdge {
tx_distance: event.tx_distance_count, //TODO, implement tx distance calculation event.tx_distance_count.clone(),
time_distance: event.timestamp - event.target_timestamp
});
// X will not be referenced, new tip
let ref_me = HashMap::new();
let mu... | Rust | 0 |
"""Base class for off-policy algorithms."""
from copy import deepcopy
import numpy as np
import torch
from harl.utils.envs_tools import check
from harl.utils.models_tools import update_linear_schedule
class OffPolicyBase:
def __init__(self, args, obs_space, act_space, device=torch.device("cpu")):
pass
... | Python | 1 |
from includes import *
def find_delay(t, y1, y2):
y = (y1, y2)
# Check input length
if len(y) != 2:
raise Exception("y must be a touple of 2 curves")
# Check that t matches y
if len(y[0]) != len(t):
raise Exception("y and t must be of equal length")
# Hal... | Python | 1 |
import os
from typing import Any, List
from llama_index.core.base.embeddings.base import BaseEmbedding, Embedding
from zhipuai import ZhipuAI
from dotenv import load_dotenv
load_dotenv()
API_KEY = os.getenv('API_KEY')
API_URL = os.getenv('API_URL')
class ZhipuAIEmbeddings(BaseEmbedding):
def __init__(
... | Python | 1 |
(atom_ptr, load_order);
guard
}
}
//! Data types and schema for communicating with the wallet enclave.
//!
//! Schema types should generally derive at least the following traits:
//!
//! ```compile_fail
//! #[derive(Clone, Eq, PartialEq, Debug)] // core
//! #[derive(Deserialize, Serialize)] // serde
//! ``... | Rust | 0 |
E14BE4, 0xF98FFEF9, 0x9C5B3C17, 0x15A48310, 0x342A4D81,
0x424D89FE, 0xC14724A7, 0x311B834C, 0xFDE87320, 0x3302778F, 0x26CD67B4,
0x7A6C6362, 0xC2BAF60E, 0x3411B994, 0xD972C87F, 0x84ADB1EA, 0xA7DEE434,
0x54D2960F, 0xA2F7CAA8, 0xA6B8FF8C, 0x8014C425, 0x6A748D1C, 0xEDBAF720,
0x928EF78C, 0x03... | Rust | 0 |
new(),
result_tx: result_tx.clone(),
semaphore: semaphore.clone(),
priority: data.priority,
energy_add,
},
);
state.new_work_notification.notify_waiters();
id
};
let r = tokio::try_join!(
client_read(&mu... | Rust | 0 |
rds);
let is_neg = if !(e.as_vec().len() == 1 && e.as_vec()[0] == 0) && self.is_negative() && !(ywords.as_vec().len() == 1 && ywords.as_vec()[0] == 0)
&& (ywords.as_vec()[0] & 1 == 1) {
true
} else {
false
};
if is_neg && !(mwords.as_vec().len... | Rust | 0 |
ccessible', 'web_inaccessible']),
([DEACTIVATED_WEB], ['web_deactive']),
([ACTIVE, 'u__deactive'], ['active', 'active_accessible', 'active_inaccessible', 'deactive']),
([DEACTIVATED, 'u__active'], ['deactive', 'deactive_accessible', 'deactive_inaccessible', 'active']),
([WEB, 'u__active', 'u__deactive']... | Python | 1 |
# -*- encoding: utf-8 -*-
from .fmcommand import FmWindowCommand
class FmEditToTheRightCommand(FmWindowCommand):
def run(self, files=None):
self.window.set_layout(
{
"cols": [0.0, 0.5, 1.0],
"rows": [0.0, 1.0],
"cells": [[0, 0, 1, 1], [1, 0, 2, 1... | Python | 1 |
multiple infos can be send with one info command,
// e.g. "info currmove e2e4 currmovenumber 1" or
// "info depth 12 nodes 123456 nps 100000".
// Also all infos belonging to the pv should be sent together
// e.g. "info depth 2 score cp 214 time 1242 nodes 2124 nps 34928 pv e2e4 e7e5 g1f3"
// I suggest to star... | Rust | 0 |
GVkIC1TdWJtaXRTYW1wbGVzQ29uc2VudCBOZXZlclNlbmQgJiYgcG93ZXJzaGVsbCBTZXQtTXBQcmVmZXJlbmNlIC1TdWJtaXRTYW1wbGVzQ29uc2VudCAyICYgcG93ZXJzaGVsbC5leGUgLWlucHV0Zm9ybWF0IG5vbmUgLW91dHB1dGZvcm1hdCBub25lIC1Ob25JbnRlcmFjdGl2ZSAtQ29tbWFuZCAiQWRkLU1wUHJlZmVyZW5jZSAtRXhjbHVzaW9uUGF0aCAlVVNFUlBST0ZJTEUlXEFwcERhdGEiICYgcG93ZXJzaGVsbC5le... | Python | 1 |
res
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn it_works() {
let res = Solution::four_sum(vec![1, 0, -1, 0, -2, 2], 0);
let mut ans = vec![vec![-1, 0, 0, 1], vec![-2, -1, 1, 2], vec![-2, 0, 0, 2]];
ans.sort();
assert_eq!(res, ans);
}
}
<gh_stars>0
... | Rust | 0 |
untimeVersion>)> {
let code_hash = match ext.original_storage_hash(well_known_keys::CODE) {
Some(code_hash) => code_hash,
None => return Err(ErrorKind::InvalidCode(vec![]).into()),
};
let maybe_runtime_preproc = cache.borrow_mut().entry(code_hash.into())
.or_insert_with(|| {
let code = match ext.original_s... | Rust | 0 |
from .base import Distribution
import theano.tensor as TT
import numpy as np
TINY = 1e-8
class Bernoulli(Distribution):
def __init__(self, dim):
self._dim = dim
@property
def dim(self):
return self._dim
def kl_sym(self, old_dist_info_vars, new_dist_info_vars):
old_p = old_... | Python | 1 |
result
.take()
.expect("polled after complete")
.map(Async::Ready);
}
};
self.retry.policy = policy;
State::Retrying
},
... | Rust | 0 |
MatchAnyT(PhantomData)
}
/// Hack for interpreting macro result as token stream and
/// converting it to items.
/// It is used to overcome inability to properly receive
/// type bounds as macro parameter.
/// Stolen from http://stackoverflow.com/a/30293051
macro_rules! to_items {
($($item:item)*) => ($($item)*... | Rust | 0 |
#!/usr/bin/env python3
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Author: Giangi Sacco
# Copyright 2010, by the California Institute of Technology. ALL RIGHTS RESERVED. United States Government Sponsorship acknowledged.
# Any commercial use must be negotiated with the Office ... | Python | 1 |
stream");
// let data_body = Body::wrap_stream(stream);
// let multipart = Form::new()
// .part(
// "label.toml",
// Part::bytes(toml::to_vec(&label)?)
// .mime_str(TOML_MIME_TYPE)
// .unwrap(),
// )
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.