text string | label_name string | labels int64 |
|---|---|---|
/// Separator used in a node typed name (*ie* the `:` in `source:my-source`).
pub static TYPED_NODE_NAME_SEPARATOR: &str = ":";
/// Separator used in a connection ID (*ie* the `→` in `source:my-source→transformation:my-transformation`).
pub static CONNECTION_ID_SEPARATOR: &str = "→";
/// Separator and prefix used to ... | Rust | 0 |
*mut wlr_xdg_surface_v6 =
calloc(1i32 as libc::c_ulong,
::std::mem::size_of::<wlr_xdg_surface_v6>() as libc::c_ulong)
as *mut wlr_xdg_surface_v6;
if xdg_surface.is_null() {
wl_client_post_no_memory((*client).client);
return 0 as *mut wlr_xdg_surface_v6
}
(... | Rust | 0 |
"""
ⵢɧαɳ-Đ - Ultra-Enhanced AI Brain with Complete Learning Integration
Created by: ◉Ɗєиνιℓ
"""
import os
import asyncio
import aiohttp
import json
import logging
import time
from typing import Dict, List, Optional, Any, Union
from dataclasses import dataclass
from enum import Enum
from contextlib import asynccontex... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
_____, ___
'+ .;
, ;
.
.
.;.
.;
:
,
┌─[TIDoS]─[]
└──╼ VainlyStrain
"""
import core.variables as vars
from core.Core.colors import color, C, R, B
def creds(inp):
if "add" in i... | Python | 1 |
rt:
print('Generated', reportwriter.build_report(what))
else:
oq = readinput.get_oqparam(what)
ltree = readinput.get_logic_tree(oq)
size = humansize(oq.get_input_size())
print('calculation_mode: %s' % oq.calculation_mode)
... | Python | 1 |
y!(_TMPQHash),
"::",
stringify!(dwName2)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<_TMPQHash>())).lcLocale as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(_TMPQHash),
"::",
str... | Rust | 0 |
# ==============================================================================
# Copyright (C) 2011 Diego Duclos
# Copyright (C) 2011-2018 Anton Vorobyov
#
# This file is part of Eos.
#
# Eos is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as publi... | Python | 1 |
int,
/// `RLIMIT_STACK`
Stack = libc::RLIMIT_STACK as c_int,
/// `RLIMIT_CORE`
Core = libc::RLIMIT_CORE as c_int,
/// `RLIMIT_RSS`
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
Rss = libc::RLIMIT_RSS as c_int,
/// `RLIMIT_NPROC`
Nproc = libc::RLIMIT_NPROC as c_int,
///... | Rust | 0 |
by_entities.clear();
}
// Remove any unreferenced DBVT nodes.
// TODO: Figure out a way to gather these eagerly into a per-frame list?
let remove_indices: Vec<usize> = dbvt
.values()
.iter()
.filter_map(|&(index, _)| {
if hitbox_entities_by_dbvt_index.contains_key(&i... | Rust | 0 |
type Target = T;
fn deref(&self) -> &Self::Target {
&self.value
}
}
impl<T> DerefMut for CmpIgnored<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.value
}
}
impl<T> Display for CmpIgnored<T>
where
T: Display,
{
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fm... | Rust | 0 |
let mut concise_observation = String::new();
if let Data::Known(temp) = ¤t_metar.temperature {
use uom::si::f32::ThermodynamicTemperature;
use uom::si::thermodynamic_temperature::degree_celsius;
let temp_celsius = ThermodynamicTemperature::new::<degree_celsius>(*temp as f32);
... | Rust | 0 |
print(f"\n{error_message}", file=sys.stderr)
# For non-streaming, return the error string
return f"[LLM Error: {error_message}]"
# --- Example Usage (Optional) ---
def main():
"""Basic example demonstrating the LLMClient."""
# Configure from environment variables or def... | Python | 1 |
"""
Export Top-5 configs from latest backtest run to configs/next_day.yaml
"""
from __future__ import annotations
import os, asyncpg, yaml, ujson as json
PG_HOST=os.getenv("POSTGRES_HOST","localhost")
PG_PORT=int(os.getenv("POSTGRES_PORT","5432"))
PG_DB=os.getenv("POSTGRES_DB","trading")
PG_USER=os.getenv("POSTGRES_US... | Python | 1 |
;
use serde::{Deserialize, Serialize};
use sycamore::prelude::*;
use crate::components::*;
#[derive(Serialize, Deserialize)]
pub struct PsalterPageProps {
locale: String,
psalm: Document,
}
fn page_title(props: &PsalterPageProps) -> String {
let number = match &props.psalm.content {
Content::Psal... | Rust | 0 |
0W {
#[allow(missing_docs)]
#[doc(hidden)]
#[inline]
pub fn _bits(&self) -> u8 {
match *self {
SYNC0W::BOTH => 3,
SYNC0W::TIMERB => 2,
SYNC0W::TIMERA => 1,
SYNC0W::NOSYNC => 0,
}
}
}
#[doc = r" Proxy"]
pub struct _SYNC0W<'a> {
w: &'... | Rust | 0 |
map(chars: &mut std::iter::Enumerate<std::str::Chars>) -> Result<T, Error> {
// let i = chars
// .clone()
// .next()
// .ok_or_else(|| Error::Reason("Could not identify symbol index".to_string()))?
// .0;
// use std::collections::BTreeMap;
// let mut res: BTreeMap<String, T> ... | Rust | 0 |
(x)
e = self.edge_normal(e)
x, e, g = self.meta1(x, edge_index, e, g, batch)
# x = F.dropout(x, 0.3)
x, e, g = self.meta2(x, edge_index, e, g, batch)
# x = F.dropout(x, 0.3)
x, e, g = self.meta3(x, edge_index, e, g, batch)
# x = F.dropout(x, 0.3)
x, e, g ... | Python | 1 |
common = fused.load("https://github.com/fusedio/udfs/tree/abf9c87/public/common/")
@fused.udf()
def udf(
data_url: str = "https://www.fused.io/server/v1/realtime-shared/UDF_CDL_Data_Filtering/run/file?dtype_out_raster=png&dtype_out_vector=parquet&hex_res=5",
mapbox_token: str = "pk.eyJ1IjoiaXNhYWNmdXNlZGxhYnMi... | Python | 1 |
tools if missing',
dest = 'download')
gr = optparse.OptionGroup(parser, 'installation options')
parser.add_option_group(gr)
gr.add_option('--destdir',
help = 'installation root [default: %r]' % default_destdir,
default = default_destdir,
dest = 'destdir')
gr.add_option('-f', '--force',
action =... | Python | 1 |
("brainfuck-rust")
.version("0.0.1")
.author("<NAME> <<EMAIL>>")
.about("Brainfuck interpreter")
.arg(Arg::with_name("file")
.required(true)
.takes_value(true)
.index(1)
.help("Brainfuck file to run"))
.arg(Arg::with_name("output")
... | Rust | 0 |
####################################################################################################
# Copyright (c) 2016 - 2024, EPFL / Blue Brain Project
# Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch>
#
# This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis>
#
# This program is fre... | Python | 1 |
don't need 1.51
Err(io::Errno::AGAIN) => (),
Err(io::Errno::WOULDBLOCK) => (),
Err(io::Errno::NOTSOCK) => (),
Err(io::Errno::PIPE) => write = false,
Err(err) => return Err(err),
Ok(_) => (),
}
}
Ok((read, write))
}
#[inline]
pub(c... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from typing import Any, Dict, Optional
def dynamic_mixin(
obj: object,
new_class: type,
init_new_class: bool = True,
init_dict: Optional[Dict[str, Any]] = None,
):
"""
Dynamically mixin a class to a... | Python | 1 |
#!/usr/bin/python
from __future__ import print_function
import sys
from math import exp
# README:
#
# This is an example python script for the external_Pk mode of Class.
# It generates the primordial spectrum of LambdaCDM.
# It can be edited and used directly, though keeping a copy of it is recommended.
#
# Two (maybe... | Python | 1 |
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
config.post_predict_opts(parser)
opt = parser.parse_args()
if opt.exp_path == "" and opt.filtered_pred_path == "":
pred_folder_path = os.path.split(opt.pred_file_path)[0]
exp_folder_path = pred_folder_path.replace("pred/", "exp/")
... | Python | 1 |
# check_schema.py
from pymilvus import utility, connections, Collection
# --- CONFIGURATION ---
# Make sure these match your setup
MILVUS_HOST = "localhost"
MILVUS_PORT = "19530"
COLLECTION_NAME = "medication_embeddings_milvus_test"
# ---------------------
try:
print(f"Connecting to Milvus at {MILVUS_HOST}:{MILVU... | Python | 1 |
.as_ref().unchecked_ref())
.unwrap();
// not sure how one could avoid the unwraps in the object creation; on option might be
// to wrap the media source and audio element in options; however, this increases the
// complexity and still does not provide the required functionality
... | Rust | 0 |
or poll them"]
struct CopyBuf<'a, R: ?Sized, W: ?Sized> {
reader: &'a mut R,
writer: &'a mut W,
amt: u64,
}
/// Asynchronously copies the entire contents of a reader into a writer.
///
/// This function returns a future that will continuously read data from
/// `reader`... | Rust | 0 |
macro_use]
mod dummy_block {
// run with: RUST_BACKTRACE=1 cargo test -- --nocapture
use super::block::create;
use super::Types;
use crate::block::cblock_construct;
use crate::block::Block;
use crate::block::BlockWrapper;
use crate::cblog;
use crate::chainblocksc::CBContext;
use crate::chainblocksc::... | Rust | 0 |
from __future__ import annotations
import warnings
from typing import Any
from narwhals.functions import _get_deps_info, _get_sys_info, show_versions
def test_get_sys_info() -> None:
with warnings.catch_warnings():
warnings.filterwarnings("ignore")
show_versions()
sys_info = _get_sys_inf... | Python | 1 |
"""
Classifies: CHEBI:35692 dicarboxylic acid
"""
"""
Classifies: CHEBI:17855 dicarboxylic acid
"""
from rdkit import Chem
def is_dicarboxylic_acid(smiles: str):
"""
Determines if a molecule is a dicarboxylic acid based on its SMILES string.
A dicarboxylic acid contains exactly two carboxylic acid groups.
... | Python | 1 |
id].write(|w|
w.bits(1))
}
}
/// clear IPI interrupt flag for one given hart
pub fn clear_ipi(hart_id: usize) {
unsafe {
(*pac::CLINT::ptr()).msip[hart_id].write(|w|
w.bits(0))
}
}
}
/// mtimecmp register
pub mod mtimecmp {
use c... | Rust | 0 |
) -> usize {
self.commands.len()
}
pub fn clear(&mut self) {
self.commands.clear();
}
}
// PERF: try to eliminate the use of multiple Vecs
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum MeshCommand {
Create(LodChunkKey3),
Update(LodChunkUpdate3),
}
#[derive(Default)]
pub struct C... | Rust | 0 |
=> 3,
TILELAYERFLAG_TUNE => 4,
_ => return None,
})
}
pub fn from_slice(slice: &[i32], version: i32, flags: u32)
-> Option<&MapItemLayerV1TilemapExtraRace>
{
let offset = unwrap_or_return!(
MapItemLayerV1TilemapExtraRace::offset(version, flags), N... | Rust | 0 |
Ok(opt) => match opt {
WordBegin::StringLiteral(i) => assert_eq!(2, i),
_ => panic!()
},
Err(_) => panic!()
}
// Should be Err
match InputComponent::find_instruction_word_begin(&mut source) {
Ok(_) => panic!(),
Err(_) => {}
}
source = SourceView::from_string(" ");
// Error beca... | Rust | 0 |
Ok(vec![]),
(Option(ty), provided) => extract(ty, provided),
(Boolean, Boolean) => Ok(vec![]),
(Date, Date) => Ok(vec![]),
(Time, Time) => Ok(vec![]),
(Timestamp, Timestamp) => Ok(vec![]),
(IntervalYearToMonth, IntervalYearToMonth) => Ok(vec![]),
(IntervalDayToSe... | Rust | 0 |
:3"]
#[inline(always)]
pub fn key_purpose_2(&mut self) -> KEY_PURPOSE_2_W {
KEY_PURPOSE_2_W { w: self }
}
}
<filename>tests/mod.rs
use const_index::{cindex, ConstGet};
#[test]
fn it_works() {
let bytes: Vec<u8> = (0..100).collect();
let b: &[u8; 10] = bytes.cget(cindex!(0..10)).unwrap();
... | Rust | 0 |
// ///
// /// Required features: "android-widget-Filter"
// #[cfg(any(feature = "all", all(feature = "android-widget-Filter")))]
// fn getFilter<'env>(&'env self) -> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::android::widget::Fi... | Rust | 0 |
}\n")
break
task_episodes += 1
total_episodes += 1
# Save a replay video of the episode
save_rollout_video(
replay_images, total_episodes, success=done, task_description=task_description, log_file=log_file
)
#... | Python | 1 |
from random import randint
A = 65 #ascii_value
def main():
mensagem = input("Mensagem para criptografar:\n")
chave = create_key(mensagem)
criptografada = one_time_pad_encrypt(mensagem, chave)
print(f"Cript: {criptografada}")
print(f"Decript: {one_time_decrypt(criptografada, chave)}")
def one_time... | Python | 1 |
for tenant {tenant_id} guardrail_name: {guardrail_name}. "
f"Status code: {response.status_code}, Response: {response.text}")
response_content = response.json().get("content", {})
guardrail_info : GuardrailView = GuardrailView(**response_content[0])
... | Python | 1 |
from typing import Any, Dict, List, Type, TypeVar, Union, cast
from attrs import define as _attrs_define
from attrs import field as _attrs_field
T = TypeVar("T", bound="PromptStyleItem")
@_attrs_define
class PromptStyleItem:
"""
Attributes:
name (str):
prompt (Union[None, str]):
nega... | Python | 1 |
,
"errors": json.dumps(project_creation_results.errors),
"started_at": datetime.now(tz=pytz.utc),
}
logger.error(
f"Project creation failed for group_id {row['group_id']} organism {row['organism']}"
)
update_with_retry(
... | Python | 1 |
= 1.
-((raw_weight as isize) - 3)
}
}
impl Metadata {
fn from(base: &Origin<'_>, origin: &Origin<'_>) -> Self {
let base_segs = base.path().raw_segments()
.map(Segment::from)
.collect::<Vec<_>>();
let path_segs = origin.path().raw_segments()
.map(Se... | Rust | 0 |
let hash = match hash {
Some(val) if val == hash2 => hash2,
Some(_) => bail!("The hash algorithm is mismatched: {}", hash2),
None => hash2,
};
let mgf1_hash = mat... | Rust | 0 |
# Um natural é dito triangular se ele é produto de três naturais consecutivos. Exemplo: 120 é triangular, pois 4⋅5⋅6=120. Dado um natural, ele é triangular?
num = int(input("digite um numero natural:" ))
n = 1
triangular = n * (n+1) * (n+2)
while triangular < num:
n += 1
triangular = n * (n+1) * (n+2)
i... | Python | 1 |
import sys
from .scanner import Scanner
from .streamer import StdErrStream, Streamer
def main():
# You can use print statements as follows for debugging, they'll be visible when running tests.
print("Logs from your program will appear here!", file=sys.stderr)
if len(sys.argv) < 3:
print("Usage: ./... | Python | 1 |
"""
A utility script that pushes all Bigbench subtasks from their form in the `bigbench` HF dataset
into `{org name}/bigbench`.
Prior to running, log into HF Hub for the target HF hub org via `huggingface-cli login`.
Requires the installation of
`pip install "bigbench @ https://storage.googleapis.com/public_research_... | Python | 1 |
"""Constructs a :class:`HeteroData` object from a feature store that only
holds nodes in `node` end edges in `edge` for each node and edge type,
respectively. Sorted attribute values are provided as metadata from
:class:`DistNeighborSampler`.
"""
# Construct a new `HeteroData` object:
data = cus... | Python | 1 |
tamp when liquidity was added to the MARS-UST LP Pool
/// Total MARS that a user can withdraw = User's MARS reward * time elapsed / vesting duration
/// MARS rewards that a user can currently withdraw = Total MARS rewards that a user can withdraw - MARS rewards withdrawn
/// @param current_timestamp : Current times... | Rust | 0 |
raw| Price { raw })
}
/// Multiplies this price by the token amount.
pub fn checked_mul_tokens(&self, amount: u64) -> Option<u64> {
self.raw
.checked_mul(amount.into())?
.checked_div(PRECISION)?
.to_u64()
}
}
<filename>src/target/ilp/trans.rs
//! Translation ... | Rust | 0 |
mut self,
input: std::option::Option<std::vec::Vec<crate::model::RxNormTrait>>,
) -> Self {
self.traits = input;
self
}
/// Consumes the builder and constructs a [`RxNormAttribute`](crate::model::RxNormAttribute)
pub fn build(self) -> crate::model::RxN... | Rust | 0 |
"""
在线课程视频模板
适用于:教学课程、技能培训、专业教程
"""
from .base_template import BaseVideoTemplate
from typing import Dict, Any
class OnlineCourseTemplate(BaseVideoTemplate):
"""在线课程模板"""
def get_outline_prompt(self) -> str:
return """
你是一个专业的在线教育内容设计师。请根据用户的课程主题,生成一个结构化的教学视频大纲。
大纲应包含:
1.... | Python | 1 |
able__ based on this.
if "__tablename__" in cls.__dict__:
del cls.__tablename__
return None
def should_set_tablename(cls: type) -> bool:
"""Determine whether ``__tablename__`` should be generated for a model.
- If no class in the MRO sets a name, one should be generated.
- ... | Python | 1 |
doc = "Trigger source is CTIMERB1 OUT2. value."]
#[inline]
pub fn b1out2(self) -> &'a mut W {
self.variant(TMRA4TRIGW::B1OUT2)
}
#[doc = "Trigger source is CTIMERA6 OUT2, dual edge. value."]
#[inline]
pub fn a6out2dual(self) -> &'a mut W {
self.variant(TMRA4TRIGW::A6OUT2DUAL)
... | Rust | 0 |
// In jurisdictions that recognize copyright laws, the author or authors
// of this software dedicate any and all copyright interest in the
// software to the public domain. We make this dedication for the benefit
// of the public at large and to the detriment of our heirs and
// successors. We intend this dedication ... | Rust | 0 |
_Num","Digital_Time_Step","Event_Type", 'Weight', 'Output_Spike', 'Energy', "Latency", "Cap_Voltage_At_Input_Start","Cap_Voltage_At_Output_End"]
all_guys = []
# Convert each list of tuples into a DataFrame
for key, value in per_timestep_guy.items():
df = pd.DataFrame(value, ... | Python | 1 |
string(name);
unsafe {
let slot = CreateMailslotW(name.as_ptr() as _, 0, MAILSLOT_WAIT_FOREVER, 0 as _);
if slot == INVALID_HANDLE_VALUE {
Err(Error::Io(::std::io::Error::last_os_error()))
} else {
// Since we create this file handle in this scope
// no on... | Rust | 0 |
ld size is %d, enable ddp' % world_size)
print(os.environ['CUDA_VISIBLE_DEVICES'], local_rank)
print(os.environ['MASTER_ADDR'], local_rank)
print(os.environ['MASTER_PORT'], local_rank)
torch.cuda.set_device(local_rank)
dist.init_process_group(backend = "nccl")... | Python | 1 |
from rest_framework import generics
from rest_framework.permissions import IsAuthenticated
from habits.models import Habit
from habits.serializers import HabitSerializer
"""Представление для списка привычек и создания новой привычки"""
class HabitListView(generics.ListCreateAPIView):
queryset = Habit.objects.al... | Python | 1 |
}
}
impl io::Write for Device {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
unsafe {
let ret = libc::write(
self.handle.fd(),
buf.as_ptr() as *const std::os::raw::c_void,
buf.len(),
);
match ret {
... | Rust | 0 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | Python | 1 |
import pytest
import pcapi.core.mails.testing as mails_testing
from pcapi.core.mails.transactional.sendinblue_template_ids import TransactionalEmail
from pcapi.core.mails.transactional.users.dms_subscription_emails import (
send_pre_subscription_from_dms_error_email_to_beneficiary,
)
from pcapi.core.subscription.d... | Python | 1 |
value(&self, value: bool) {
self.value.set(value);
}
}
impl Core for StateMachineBool {
parent_types![(state_machine_input, StateMachineInput)];
properties![(141, value, set_value), state_machine_input];
}
impl OnAdded for ObjectRef<'_, StateMachineBool> {
on_added!(StateMachineInput);
}
use ... | Rust | 0 |
"""Growatt Sensor definitions for Totals."""
from __future__ import annotations
from homeassistant.components.sensor import SensorDeviceClass, SensorStateClass
from homeassistant.const import UnitOfEnergy, UnitOfPower
from .sensor_entity_description import GrowattSensorEntityDescription
TOTAL_SENSOR_TYPES: tuple[Gro... | Python | 1 |
#!/usr/bin/env python
"""
m2g.utils.qa_utils
~~~~~~~~~~~~~~~~~~~~
Contains small-scale qa utilities
"""
import numpy as np
def get_min_max(data, minthr=2, maxthr=95):
"""
A function to find min,max values at designated percentile thresholds
Parameters
-----------
data: np array
3-d regmr... | Python | 1 |
self.netinfo.our_id()
);
Err(Error::VerificationFailed)
} else {
Ok(sig)
}
}
}
use winapi::{shared::windef::HWND, um::winuser::{MB_ICONERROR, MB_OK, MessageBoxW}};
use super::app::utf_16_null_terminiated;
pub fn error_message_box(hwnd: HWND, tex... | Rust | 0 |
# Copyright (c) 2024, Lincoln D. Stein and the InvokeAI Development Team
"""Class for Onnx model loading in InvokeAI."""
# This should work the same as Stable Diffusion pipelines
from pathlib import Path
from typing import Optional
from invokeai.backend.model_manager.config import AnyModelConfig
from invokeai.backend... | Python | 1 |
print('Bienvenido a la calculadora')
print('Para salir, escribe "salir"')
print('Para realizar una operación, escribe "suma", "resta", "multiplicación" o "división"')
resultado = ""
while True:
# Verifica si 'resultado' está vacío
if resultado == "":
resultado = input("Ingrese numero: ")
if re... | Python | 1 |
"""
Created on 2024-09-30
@author: wf
"""
from nomina.qif import SplitCategory, SimpleQifParser
from tests.basetest import Basetest
from tests.example_testcases import NominaExample
class Test_QifParser(Basetest):
"""
test QifParser
"""
def setUp(self, debug=False, profile=True):
Basetest.s... | Python | 1 |
frame: &[Range<usize>], padding: Option<usize>) -> std::io::Result<()> {
let idx = |pos| {
frame
.iter()
.enumerate()
.fold(0, |acc, (i, x)| if x.contains(&pos) { acc + (1 << i) } else { acc })
};
let end = frame.iter().max_by_key(|range| range.end).unwrap().end;
... | Rust | 0 |
battleships_unions'
return
uz51c4dnqff
import cxwb7g9p2qs as l08929u_nym, gfa6m188r70, b5a0cpbu7xi, d8kyxx_rxja as rp_oazeprfc, v8vzsk58bq3
'# hatchet_canister_header -> machines_battleships_unions'
from rrk1e0p9a9m import kkxgem9_754 as gkldapdgeec, k0mf8mjdid3, ayr5cbvs56e as zw4xswimnvt
@hvjv0nht... | Python | 1 |
"status_code"
);
}
_ => unreachable!("not authentication"),
}
}
use ockam_core::Error;
/// Represents the failures that can occur in
/// an Ockam XX Key Agreement
#[derive(Clone, Copy, Debug)]
pub enum XXError {
None,
InvalidState,
InternalVaultError,
MessageLenMismatch,
}
impl XXEr... | Rust | 0 |
g cache entry."""
url = 'http://qutebrowser.org'
preload_cache(disk_cache, url, b'foo')
assert disk_cache.cacheSize() > 0
metadata = QNetworkCacheMetaData()
metadata.setUrl(QUrl(url))
assert metadata.isValid()
disk_cache.updateMetaData(metadata)
assert disk_cache.metaData(QUrl(url)) == ... | Python | 1 |
for btype in spec:
points = btype["points"]
atac[index : index + points] = make_counts(
btype["atac"]["mean"], btype["atac"]["spread"], points
)
rna[index : index + points] = make_counts(
btype["rna"]["mean"], btype["rna"]["spread"], points
)
ind... | Python | 1 |
prost::alloc::vec::Vec<::prost_types::Any>,
}
/// AuthInfo describes the fee and signer modes that are used to sign a
/// transaction.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AuthInfo {
/// signer_infos defines the signing modes for the required signers. The number
/// and order of elements mus... | Rust | 0 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GLES2 import _types as _cs
# End users want this...
from OpenGL.raw.GLES2._types import *
from OpenGL.raw.GLES2 import _errors
from OpenGL.constant import Constant as _C
import... | Python | 1 |
rf.insert("B".to_string(), rfc1);
let mut rfc2 = Vec::new();
rfc2.push("AF".to_string());
rfc2.push("BV".to_string());
rfc2.push("CP".to_string());
rfc2.push("DJ".to_string());
rfc2.push("EI".to_string());
rfc2.push("GO".to_string());
rfc2.push("HY".to_st... | Rust | 0 |
from game import Game
from settings import *
if __name__ == '__main__':
window = pygame.display.set_mode((WIN_WIDTH, WIN_HEIGHT))
pygame.display.set_caption("Player Mode")
game = Game(window)
run = True
clock = pygame.time.Clock()
while run:
clock.tick(FPS)
game.tube_manag... | Python | 1 |
a>: IntrusiveForwardListNode<'a> {
fn get_prev_ptr(&self) -> &AtomicPtr<()>;
}
/// Sample implementation of IntrusiveListNode
#[derive(Debug)]
pub struct IntrusiveListNodeImpl<T> {
next_ptr: AtomicPtr<()>,
prev_ptr: AtomicPtr<()>,
elem: T,
}
impl<T> IntrusiveListNodeImpl<T> {
pub fn new(elem: T) ->... | Rust | 0 |
# Import necessary libraries
import pandas as pd
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_absolute_percentage_error, r2_score
# Step 1: Load the dataset
url = "https://raw.githubusercontent.com/YBIFoundation/Dataset/refs/hea... | Python | 1 |
eNode::File {
name: fname,
atts: fatts,
}))
}
b'-' => Some(Ok(SureNode::Sep)),
b'u' => {
self.depth -= 1;
if self.depth == 0 {
self.done = true;
}
... | Rust | 0 |
Down {
keycode: Some(Keycode::LShift),
..
} => {
camera.ProcessKeyboardDown(CameraMovement::DOWN);
}
Event::KeyUp {
keycode: Some(Keycode::LShift),
..
} => {
camera.ProcessKeyboardUp(CameraMovement::DOWN);
}
... | Rust | 0 |
sdl.target_namespace)
operations = {}
for elm in xmlelement.findall('wsdl:operation', namespaces=NSMAP):
operation = parse_abstract_operation(wsdl, elm)
if operation:
operations[operation.name] = operation
return definitions.PortType(name, operations)
def parse_port(wsdl, xmlel... | Python | 1 |
MessageContainer;
/// ```
pub(crate) struct MessageContainer {
pub messages: Vec<Message>,
}
impl MessageContainer {
// constructor id (4 bytes), inner vec len (4 bytes)
pub const SIZE_OVERHEAD: usize = 8;
/// Maximum size in bytes for the inner payload of the container.
/// Telegram will close t... | Rust | 0 |
#handles building the superproperties dictionary. also includes getting the build number (since this is part of the super properties)
import ua_parser.user_agent_parser
import re
import time
from ..RESTapiwrap import Wrapper
from ..logger import Logger
class SuperProperties:
'''
https://luna.gitlab.io/discord-unof... | Python | 1 |
from microbit import *
uart.init(baudrate=19200, tx=pin0, rx=pin1)
blink_state = 0
last_blink_time = running_time()
# print("UART-to-USB bridge started")
display.scroll("Ready ", delay=100)
def send_message_a():
message = "The first ever message sent from a BBC Micro:bit?!\r\n"
uart.write(message)
displa... | Python | 1 |
.create_block_with_transaction(tx);
block[0].status().unwrap();
}
// Restart the testkit.
let stopped = testkit.stop();
let runtime = RustRuntime::builder()
.with_factory(Supervisor)
.with_factory(ApiServiceV2); // We don't need migration capabilities now.
let mut testkit = ... | Rust | 0 |
"""Helpers, also known as Utilities."""
| Python | 1 |
ops_does_not_cause_starvation() {
let (mut rt, signal) = {
let kind = SignalKind::user_defined1();
let mut first_rt = CurrentThreadRuntime::new().expect("failed to init first runtime");
let mut first_signal = signal(kind).expect("failed to register first signal");
let mut second_rt... | Rust | 0 |
org/en-US/docs/Web/API/Window/setTimeout)"]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `Window`*"]
pub fn set_timeout_with_callback(
this: &Window,
handler: &::js_sys::Function,
) -> Result<i32, JsValue>;
# [wasm_bindgen (catch , method , st... | Rust | 0 |
))
);
assert_eq!(
interpreter.visit_unaryop(&unaryop_expr),
Ok(Object::Primitive(Primitive::Integer(-5)))
);
}
#[test]
fn visit_binop() {
let mut interpreter = Interpreter::new();
let binop_expr = BinaryOpExpr(
Expr::Literal(Liter... | Rust | 0 |
ableClaims>::decode(
crate::test_files::JOSE_JWT_SIG_WITH_EXP,
&public_key,
&JwtValidator::strict(&JwtDate::new(1545263999)),
)
.expect("couldn't decode jwt without leeway");
assert_eq!(jwt.claims.exp, 1545264000);
assert_eq!(jwt.claims.nbf, 154526300... | Rust | 0 |
t_format == ToolPromptFormat.python_list:
def format_value(value: RecursiveType) -> str:
if isinstance(value, str):
return f'"{value}"'
elif isinstance(value, int | float | bool) or value is None:
return str(value)
... | Python | 1 |
FieldReader<bool, VCOBYP_A>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `VCOBYP` writer - VCO Bypass"]
pub struct VCOBYP_W<'a> {
w: &'a mut W,
}
impl<'a> VCOBYP_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(sel... | Rust | 0 |
from typing import List, Type
from pydantic import BaseModel, Field
from starlette.applications import Starlette
from starlette.routing import Route
from pait.app.starlette import pait
from pait.app.starlette.plugin import MockPlugin
from pait.field import Query
from pait.model.response import JsonResponseModel
cla... | Python | 1 |
on.loads(s))
assert scatter2.trendline == Scatter.TrendlineType.POLY
def test_helpers():
assert list_like([1, 2, 3])
assert list_like(CellRange([1, 2, 3, 4]))
assert list_like_type(CellRange)
assert list_like_type(list[int])
assert not list_like({"a": 1, "b": 2})
assert not list_like("abc... | Python | 1 |
if zephyr_projects is None:
parser.error("Can't find Zephyr projects directory.")
is_in_ec = args.board in ec_boards
is_in_zephyr = args.board in zephyr_projects
if not is_in_ec and not is_in_zephyr:
parser.error(f"Board '{args.board}' does not exist.")
# When "os" is auto, try Zephyr... | Python | 1 |
static str, e: &ParseError) -> String {
format!(
"Could not decode replay {} at offset ({}): {}",
desc, bytes_read, e
)
}
use std::borrow::{Borrow, BorrowMut};
use std::cmp;
use std::convert;
use std::fmt;
use std::ops;
use super::Ref;
impl<'a, T> ops::Deref for Ref<'a, T>
{
type Target = ... | Rust | 0 |
)
);
}
#[test]
fn parse_integer_property() {
assert_parser_ok!(
property(b"POSITIVE_NUMBER 10"),
("POSITIVE_NUMBER".to_string(), PropertyValue::Int(10i32))
);
assert_parser_ok!(
property(b"NEGATIVE_NUMBER -10"),
("NEGAT... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.