text string | label_name string | labels int64 |
|---|---|---|
ill="#880000")
current_simplex = -1 # determining in which simplex p lies
for s in xrange(len(s2)):
if coords_in_simplex(s, p, 0, xy, s2):
current_simplex = s
the_fill = colors(current_simplex)
... | Python | 1 |
Stdout
};
atty::is(stream)
}
pub fn is_term_dumb() -> bool {
env::var("TERM").ok() == Some(String::from("dumb"))
}
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum OutputFormat {
Yaml,
Json,
}
impl fmt::Display for OutputFormat {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error... | Rust | 0 |
"#
};
schema.to_owned()
}
/// Composites and relations mixed.
pub fn mixed_composites() -> String {
let schema = indoc! {
r#"model TestModel {
#id(id, Int, @id)
field String?
to_one_com CompositeA? @map("to_one_composite")
to_many_... | Rust | 0 |
dle it.
"""
def __init__(self):
"""
For unpickling old pickles.
TESTS::
sage: from sage.modular.modsym.g1list import _G1list_old_pickle
sage: L = _G1list_old_pickle()
sage: type(L) == G1list
True
"""
self.__class__ = G1lis... | Python | 1 |
m_db(&consensus_manager);
let schemas = vec![txn_schema!(
from: vec![outputs[0][0].clone()],
to: vec![2 * T, 2 * T, 2 * T, 2 * T, 2 * T]
)];
generate_new_block(
&mut miner,
&mut blocks,
&mut outputs,
schemas.clone(),
&consensus_manager.consensus_consta... | Rust | 0 |
import nose
import functools
_either_or_map = dict()
def either_or(key='default', expected_failures=1):
def either_or_decorator(test):
global _either_or_map
if not key in _either_or_map:
_either_or_map[key] = {
'failed': 0,
'total': 0,
... | Python | 1 |
t) is mapped to 1/10 CENT:
let p = super::currency::UNITS / 1000;
let q = Balance::from(ExtrinsicBaseWeight::get());
smallvec![WeightToFeeCoefficient {
degree: 1,
negative: false,
coeff_frac: Perbill::from_rational(p % q, q),
... | Rust | 0 |
# cook your dish here
c=input()
if(c=='A' or c=='a' or c=='E' or c=='e' or c=='I' or c=='i' or c=='O' or c=='o' or c=='U' or c=='u'):
print("Vowel")
else:
print("Consonant")
| Python | 1 |
import os
import argparse
import subprocess
import atexit
from fastapi import FastAPI, Request, HTTPException
from fastapi.middleware.cors import CORSMiddleware
from fastapi.responses import JSONResponse, RedirectResponse
from utils.daily_helpers import create_room as _create_room, get_token, get_name_from_url
MAX_B... | Python | 1 |
c = "Bit 6 - Permission to set the BusFault handler to the pending state when the floating-point stack frame was allocated."]
#[inline(always)]
pub fn bfrdy(&self) -> BFRDY_R {
BFRDY_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 8 - Permission to set the MON_PEND when the floating-point ... | Rust | 0 |
import pennylane as qml
from pennylane import numpy as np
import matplotlib.pyplot as plt
# Set random seed for reproducibility
np.random.seed(42)
# Create a quantum device with 2 qubits
dev = qml.device("default.qubit", wires=2)
@qml.qnode(dev)
def quantum_circuit(x, weights):
# Encode classical data into quant... | Python | 1 |
import json
from pathlib import Path
from azure.ai.inference.models import UserMessage
from nonebot import get_driver, logger, require
from nonebot_plugin_localstore import get_plugin_data_file
require("nonebot_plugin_apscheduler")
require("nonebot_plugin_marshoai")
from nonebot_plugin_apscheduler import scheduler
f... | Python | 1 |
source_maps: None,
input_source_map: InputSourceMap::default(),
..Default::default()
},
Config {
env: None,
test: Some(FileMatcher::Regex("\\.ts$".into())),
exclude: None,
jsc: JscConf... | Rust | 0 |
.
//!
//! Both versions are leaner than the `std::borrow::Cow`:
//!
//! ```rust
//! use std::mem::size_of;
//!
//! const WORD: usize = size_of::<usize>();
//!
//! assert_eq!(size_of::<std::borrow::Cow<str>>(), 4 * WORD);
//! assert_eq!(size_of::<beef::Cow<str>>(), 3 * WORD);
//! assert_eq!(size_of::<beef::lean::Cow<str... | Rust | 0 |
"""RootSIFT descriptor implementation.
This descriptor was proposed in 'Three things everyone should know to improve object retrieval' and is build upon
OpenCV's API.
Note: this is a standalone descriptor.
References:
- https://www.robots.ox.ac.uk/~vgg/publications/2012/Arandjelovic12/arandjelovic12.pdf
- https://do... | Python | 1 |
")]
if token_ids_1 is None:
return len(cls + token_ids_0 + sep) * [0]
if self.padding_side == "right":
# Input is question-then-context
return len(cls + token_ids_0 + question_suffix + sep) * [0] + len(token_ids_1 + sep) * [1]
else:
# Input is con... | Python | 1 |
or set the Maximum displacement relative to element size to use as a criterion for avoiding the full calculation of the motion of the DUALCESE part on a given time step. If the full calculation can be avoided, the elements touching an FSI interface are still morphed, but it is assumed that this approximation will not l... | Python | 1 |
f._results.add(result)
# Add the new information from this event.
if result._update(adv_type, rssi, adv_data):
# It's new information, so re-yield this result.
return result
if self._done:
# _IRQ_SCAN_DONE event was fi... | Python | 1 |
_bind)
}
}
#[inline]
pub unsafe fn ibv_advise_mr(
pd: *mut ibv_pd,
advice: ibv_advise_mr_advice,
flags: u32,
sg_list: *mut ibv_sge,
num_sge: u32,
) -> c_int {
let vcr = verbs_get_ctx_op!((*pd).context, advise_mr);
if let Some(vctx) = vcr {
(*vctx).advise_mr.unwrap()(pd, advice,... | Rust | 0 |
# -*- coding: utf-8 -*-
import os
import sys
from pprint import pprint
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
sys.path.append(root + '/python')
import ccxt # noqa: E402
exchange = ccxt.binance()
symbol = 'ETH/BTC'
timeframe = '1h'
candles = exchange.fetch_ohlcv(symbol... | Python | 1 |
lib::prelude::*;
const MAX_FRAME_SPEED: i32 = 15;
const MIN_FRAME_SPEED: i32 = 1;
pub fn run(rl: &mut RaylibHandle, thread: &RaylibThread) -> crate::SampleOut {
// Initialization
//--------------------------------------------------------------------------------------
let screen_width = 800;
let screen... | Rust | 0 |
l'.
Returns:
set: A set of extracted URLs.
"""
try:
if content_type.lower().startswith('text/html'):
soup = BeautifulSoup(content, 'html.parser')
return {urljoin(base_url, a['href']) for a in soup.find_all('a', href=True)}
elif content_type.lower() == 'applic... | Python | 1 |
# https://leetcode.com/problems/lexicographical-numbers/
'''
Input: n = 13
Output: [1,10,11,12,13,2,3,4,5,6,7,8,9]
Basice idea: think about Trie. we append digits to the specific suffix until we reach the target number.
'''
class Solution:
def lexicalOrder(self, n: int) -> List[int]:
# recursively use Tri... | Python | 1 |
nvo.invoke(self, None, [ae.pos], my_state.view.anim_list)
if my_state.view.anim_list:
my_state.view.handle_anim_sequence()
for ae in area_enchantments:
if ae.update(self.scene):
self.scene.contents.remove(ae)
def invoke_area_effects(self, pos=(0,0)):
... | Python | 1 |
def anagram(s: str, t: str) -> bool:
return sorted(s.lower())==sorted(t.lower()) | Python | 1 |
from django.db import models
from django.contrib.auth.models import User
class DetalleUsuario(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='detalle_usuario')
imagen_perfil_base64 = models.TextField(null=True, blank=True)
fecha_nacimiento = models.DateField(null=T... | Python | 1 |
i, val in enumerate(individual) if val == 0]
# Select a sensor to move
to_move = random.choice(ones_indices)
# Select a new position
new_pos = random.choice(zeros_indices)
# Move the sensor
individual[to_move]... | Python | 1 |
} else {
panic!("counts did not match")
}
}
};
// Feature: [01D59X5KJ7Q72C2F2FP2VYVGS1] ReqRep related metric descriptors can be easily retrieved
// Scenario: [01D5AKRF2JQJTQZQAHZFTV5CEG] Get ReqRep related metric descriptors
then regex "01D5AKRF2JQJTQZQA... | Rust | 0 |
curityType {
#[serde(rename = "unknownFutureValue")]
UnknownFutureValue,
#[serde(rename = "administrator")]
Administrator,
#[serde(rename = "power")]
Power,
#[serde(rename = "standard")]
Standard,
#[serde(rename = "unknown")]
Unknown,
}
#[derive(Clone, Debug, Eq, PartialEq, Ord,... | Rust | 0 |
"""Function Message."""
from typing import Any, Literal
from typing_extensions import override
from langchain_core.messages.base import (
BaseMessage,
BaseMessageChunk,
merge_content,
)
from langchain_core.utils._merge import merge_dicts
class FunctionMessage(BaseMessage):
"""Message for passing th... | Python | 1 |
").node;
let mac = match parsed_expr {
ExprKind::Mac(mac) => mac,
_ => panic!("Expected ExprKind::Mac(mac), found {:#?}", parsed_expr),
};
let mut driver = Driver::new();
driver.view_macro = Some(mac);
driver.view_validation_before_impl();
}
}
use {
... | Rust | 0 |
64) -> f64 {
let yy = y.abs() - 0.5 * h;
if yy >= 0.0 {
0.0
} else if yy <= -r {
0.5 * w
} else {
0.5 * w + (r * r - (yy + r).powi(2)).sqrt() - r
}
}
use std::collections::HashMap;
use crate::util;
pub fn run_part_1(args: &[String]) {
util::run_part_n("2", args, calcula... | Rust | 0 |
# Copyright (c) 2015 Marc Brinkmann
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distr... | Python | 1 |
# -*- coding: utf-8 -*-
"""
注意,经过测试,pandas版本0.21.0会报错。0.20.0以及以下正常使用,
这个错误的原因是pandas团队在新的版本(0.21.0)中对idxmax函数的设计没有考虑周全。
所以,建议使用pandas的版本为0.20.0。
"""
import numpy as np
import pandas as pd
#zwQuant
import zwSys as zw
import zwTools as zwt
import zwQTBox as zwx
import zwQTDraw as zwdr
import zwBacktest as zwbt
import ... | Python | 1 |
ey.split('_')
id = key_parts[0]
field = '_'.join(key_parts[1:])
form = FormState(**json.loads(state.forms[id]))
form.data[field] = e.value
state.forms[id] = form_state_to_string(form)
async def cancel_form(e: me.ClickEvent):
message_id = str(uuid.uuid4())
app_state = me.state(AppState)
... | Python | 1 |
action", "record");
Ok(result)
}
#[entry_point]
pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> StdResult<Binary> {
match msg {
QueryMsg::GetCharge { id } => to_binary(&get_charge(deps, id)?),
}
}
pub fn get_charge(deps: Deps, id: ChargeId) -> StdResult<Transaction> {
let state = TRANS.l... | Rust | 0 |
h.end()
type = match.lastgroup
text = match.group(0)
yield Atom(
start, stop,
type, text
)
def __call__(self, text):
atoms = list(self.atoms(text))
for index in range(len(atoms)):
atom = atoms[index]
... | Python | 1 |
, Clone, PartialEq, Debug)]
#[storage(HashMapStorage)]
pub struct Move {
pub behavior: MoveBehavior,
pub target: MoveTarget,
}
impl Move {
pub fn attack(target: Entity) -> Self {
Move {
behavior: MoveBehavior::Straight,
target: MoveTarget::AttackUnit(target),
}
}... | Rust | 0 |
&& (self_bech32_hrp == &other.bech32_hrp)
&& (self_network_id == &other.network_id)
&& (self_logger == &other.logger)
&& (self_network == &other.network)
&& (self_autopeering == &other.autopeering)
&& (self_protocol == &other.protocol)
&& (self_res... | Rust | 0 |
ate_siblings_end(
self.boundary_count,
self.count,
self.page,
self.sibling_count,
&end_pages,
);
let mut pages: Vec<i32> = Vec::new();
if self.show_first {
pages.push(FIRST);
}
if self.show_previous {
pages.push(PREVIOUS);
}
for x in start_pages ... | Rust | 0 |
re isn't an obvious mapping
from SPIR-V's descriptor sets, we require a separate mapping provided in the options.
This mapping may have one or more resource end points for each descriptor set + index
pair.
## Entry points
Even though MSL and our IR appear to be similar in that the entry points in both can
accept argu... | Rust | 0 |
s().code_range() } else { start..end };
if pefile.scanner().finds(&pattern, range, &mut save) {
set_json(&save);
}
else {
set_null();
}
}
#[no_mangle]
pub unsafe fn pefileScannerFindsCode(pefile: *mut PeFile, pat: *mut str) {
pefileScannerFinds(pefile, pat, !0, 0)
}
#[no_mangle]
pub unsafe fn pefileScannerMatc... | Rust | 0 |
}
#[doc = "IO error."]
IoError(s: String) {
description("input/output error")
display("IO error: \"{}\"", s)
}
#[doc = "The solver reported an error."]
SolverError(s: String) {
description("solver error... | Rust | 0 |
["llama3-70b-8192", "llama3-8b-8192", "llama-3.1-8b-instant", "llama-3.3-70b-versatile",
"llama-4-scout-instruct"],
"Safety & Moderation": ["llama-guard-3-8b", "meta-llama/llama-guard-4-12b"],
"Vision Models": ["llama-3.1-70b-vision", "groq-rewind-llama-4-mvr-17b-128e-instruct", "meta-lla... | Python | 1 |
er(formatter)
logger.addHandler(file_handler)
if syslog:
# create syslog logger handler
stream_handler = logging.handlers.SysLogHandler(address='/dev/log')
stream_handler.setLevel(log_level)
stream_file = logging.Formatter('%(name)s: %(message)s')
stream_handler.setF... | Python | 1 |
}
PduTooLarge {
description("the incoming pdu was too large")
display(self_) -> ("{}", self_.description())
}
InvalidPduVariable {
description("the pdu contained an invalid value")
display(self_) -> ("{}", self_.description())
}
... | Rust | 0 |
instance(?)
let window_handle = user32::CreateWindowExW(
0, // TODO: what is?
window_class.name_win32_ptr(), // Name of the class
title.as_ptr(), // Title of the window
dw_style,
winapi... | Rust | 0 |
from __future__ import annotations
from typing import Any, Dict, List, Type
from langchain_core.chat_history import BaseChatMessageHistory
from langchain_core.language_models import BaseLanguageModel
from langchain_core.messages import BaseMessage, SystemMessage, get_buffer_string
from langchain_core.prompts import B... | Python | 1 |
s = src_views
ixts, exts, imgs = [], [], []
for idx in src_ids:
img, orig_size = self.read_image(scene, idx)
imgs.append(((img/255.)*2-1).astype(np.float32))
ixt, ext, _ = self.read_cam(scene, idx, orig_size)
ixts.append(ixt)
exts.append(ext)
... | Python | 1 |
# Copyright 2016 Google Inc. 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 applicable law or ... | Python | 1 |
read_tmpl_token(&mut self, start_of_tpl: BytePos) -> LexResult<Token> {
let start = self.cur_pos();
// TODO: Optimize
let mut has_escape = false;
let mut cooked = String::new();
let mut raw = String::new();
while let Some(c) = self.cur() {
if c == '`' || (c... | Rust | 0 |
rrorReason> {
let wantedby = section.remove("WANTEDBY");
let requiredby = section.remove("REQUIREDBY");
if !section.is_empty() {
return Err(ParsingErrorReason::UnusedSetting(
section.keys().next().unwrap().to_owned(),
));
}
Ok(ParsedInstallSection {
wanted_by: m... | Rust | 0 |
2, 5, 6, 9, 10, 13, 14, 17, 18, 21,
22, 25, 26, 29, 30, 33, 34, 37, 38, 41, 42, 45, 46, 49, 50, 53, 54, 57, 58,
61, 2, 2, 3, 6, 7, 10, 11, 14, 15, 18, 19, 22, 23, 26, 27, 30, 31, 34,
35, 38, 39, 42, 43, 46, 47, 50, 51, 54, 55, 58, 59, 62, 0, 0
];
#[rustfmt::skip]
static mcol_scan_16x4_neighbors : [u1... | Rust | 0 |
# model settings
norm_cfg = dict(type='SyncBN', requires_grad=True)
data_preprocessor = dict(
type='DualInputSegDataPreProcessor',
mean=[123.675, 116.28, 103.53] * 2,
std=[58.395, 57.12, 57.375] * 2,
bgr_to_rgb=True,
size_divisor=32,
pad_val=0,
seg_pad_val=255,
test_cfg=dict(size_divisor... | Python | 1 |
Whether DAO-header verifier is disabled
pub fn disable_daoheader(&self) -> bool {
self.contains(Switch::DISABLE_DAOHEADER)
}
/// Whether reward verifier is disabled
pub fn disable_reward(&self) -> bool {
self.contains(Switch::DISABLE_REWARD)
}
/// Whether script verifier is di... | Rust | 0 |
value type do not match.
#[derive(Debug, PartialEq)]
pub struct TypeError {
pub storage_type: &'static str,
pub expected_type: &'static str,
}
impl ToString for Value {
fn to_string(&self) -> String {
match self {
Self::String(s) => s.to_owned(),
Self::Number(n) => n.to_str... | Rust | 0 |
")]
pub id: Option<String>,
#[doc = "Name of the partner"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[doc = "this is the management partner properties"]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<PartnerProper... | Rust | 0 |
SpecialPickup_BoostMod_TA_PickupEnd(self.addr());
}
}
fn pickup_start(&self) {
unsafe {
SpecialPickup_BoostMod_TA_PickupStart(self.addr());
}
}
}
extern "C" {
fn SpecialPickup_BoostMod_TA_Get_bUnlimitedBoost(obj: usize) -> bool;
fn BoostModPickup_Set... | Rust | 0 |
end([msg, None])
else:
msg = img_str + msg.replace('<image>', '').strip()
ret.append([msg, None])
elif speech is not None:
base64_string = wav_to_base64(speech)
aud_str = f... | Python | 1 |
#[pymethods]
impl Files {
#[new]
#[args(cumulative_runner_tv = "true", mutable = "false")]
fn __new__(paths: &PySequence, cumulative_runner_tv: bool, mutable: bool) -> PyResult<Self> {
let config = Config {
cumulative_runner_tv,
};
let paths = FilesSource::get_paths(path... | Rust | 0 |
, register_int_gauge, Encoder, __register_gauge, labels, opts};
use std::io;
use std::io::{BufRead, BufReader, Write};
use std::net;
use std::thread;
use slog::error;
#[derive(Clone, Debug)]
pub struct MetricsConfig {
pub port: u16,
pub addr: String,
}
const VERSION: &'static str = env!("CARGO_PKG_VERSION");... | Rust | 0 |
_eq!(to_long_sat(ushort4(10, 3, 9, 400)), long4(10, 3, 9, 400));
assert_eq!(to_long_sat(int2(10, -3)), long2(10, -3));
assert_eq!(to_long_sat(int3(10, -3, -9)), long3(10, -3, -9));
assert_eq!(to_long_sat(int4(10, -3, -9, 400)), long4(10, -3, -9, 400));
assert_eq!(to_long_sat(uint2(10, 3)), long2(10, 3));
as... | Rust | 0 |
("/")).await
}
pub async fn put_tx(&self, hex: String) -> Result<Txid, reqwest::Error> {
self.put("tx/broadcast", hex).await
}
pub async fn block_summary(&self, offset: u32, limit: u32) -> Result<Vec<BlockSummary>, reqwest::Error> {
self.get(&["block_summary", &offset.to_string(), &limit... | Rust | 0 |
uestMemory`].
///
/// Like `read`, `write` can fail due to any manner of pointer checks, but
/// any failure is returned as a [`GuestError`].
pub fn write(&self, val: T) -> Result<(), GuestError>
where
T: GuestType<'a>,
{
T::write(self, val)
}
/// Performs pointer arithm... | Rust | 0 |
(segments.as_slice(), options)
};
Ok(OwnedSpaceMessageReader {
segment_slices : segment_slices,
owned_space : owned_space,
arena : arena,
options : options,
})
}
pub fn write_message<T : std::io::Writer, U : MessageBuilder>(
output_stream : &mut T,
message : &U) ->... | Rust | 0 |
d: propagate_binary_group_id(&data_property_x, &data_property_y)?,
naturally_ordered: false,
sample_proportion: None
};
Ok(ValueProperties::Dataframe(DataframeProperties {
children: indexmap![
IndexKey::from("slope") => output_properties.clone().into(... | Rust | 0 |
from typing import List, Tuple
from nuplan.common.maps.abstract_map_objects import AbstractMapObject
from shapely.geometry import LineString
from waymo_open_dataset.protos.map_pb2 import MapFeature
class WodRoadLine(AbstractMapObject):
def __init__(self, map_feature: MapFeature) -> None:
super().__init__... | Python | 1 |
les": list(missing_files.values())
}
report["templates"][template_name] = template_entry
# Save to file dialog
from PyQt6.QtWidgets import QFileDialog
file_path, _ = QFileDialog.getSaveFileName(
self,
"Export Missing Originals Rep... | Python | 1 |
result["reasons"] = ";".join(self.alerts_df[has_alert]["description"].dropna().unique().tolist())
# NOTE(hadim): we could eventually backpropagate the full alert definition of the matching alerts +
# match atom indices and also the molecule object with the highlighted atoms.
... | Python | 1 |
self, wasmer_used_gas: u64) -> u64 {
self.gas_limit
.saturating_sub(self.externally_used_gas)
.saturating_sub(wasmer_used_gas)
}
/// Get the amount of gas units used so far inside wasmer.
///
/// We need the amount of gas left in wasmer since it is not tracked inside thi... | Rust | 0 |
import gc
import lvgl as lv
from imagetools import get_png_info, open_png
# Register PNG image decoder
decoder = lv.img.decoder_create()
decoder.info_cb = get_png_info
decoder.open_cb = open_png
# Measure memory usage
gc.enable()
gc.collect()
mem_free = gc.mem_free()
label = lv.label(lv.scr_act())
label.align(lv.ALI... | Python | 1 |
#!/usr/bin/env python3
# encoding: utf-8
import sys
import time
sys.path.append("..")
from sdk import hiwonder_servo_controller
servo_control = hiwonder_servo_controller.HiwonderServoController('/dev/ttyTHS1', 115200)
print('get serial servo status')
while True:
try:
servo_id = servo_control.get_servo_id... | Python | 1 |
# make up a random branch name
if self.event.issue is None:
return self.settings.target_branch_name_template.format(issue_number=uuid.uuid4())
# uniqueify over issue number
branch_name = self.settings.target_branch_name_template.format(
issue_number=self.event.issue.n... | Python | 1 |
from pytezos import pytezos
from pytezos import Contract
from pytezos import ContractInterface
code = """
parameter bytes;
storage (pair :storage (big_map bytes timestamp) nat);
code { DUP ;
DIP { CDR @storage_slash_1 } ;
CAR @hash_slash_2 ;
PUSH nat 1 ;
{ DIP { { DIP { DUP @storage } ; SWA... | Python | 1 |
, if available.
///
/// Note that this function must be called from one of nbdkit's own threads.
/// That is, it can only be called in the same thread as one of the `Server`
/// callbacks.
#[cfg(any(feature = "nix", all(feature = "nightly-docs", rustdoc)))]
#[cfg_attr(feature = "nightly-docs", doc(cfg(feature = "nix"))... | Rust | 0 |
_response_media_type(
response_media_type
)
class ScienceBeamParserSession(ScienceBeamParserBaseSession):
def __enter__(self) -> 'ScienceBeamParserSession':
super().__enter__()
return self
def get_source(
self,
source_path: str,
source_media_type: s... | Python | 1 |
}
15 => return Err(ErrorKind::CorruptedData),
_ => {
let value_size = crate::tags::standard::implicit::implicit_tag_size(id);
(0, value_size, value_size)
}
}
} else {
let value_size = ... | Rust | 0 |
variable to be passed to executors."""
if (key is not None and pairs is not None) or (key is None and pairs is None):
raise Exception("Either pass one key-value pair or a list of pairs")
elif key is not None:
self._jconf.setExecutorEnv(key, value)
elif pairs is not None:... | Python | 1 |
impl ::core::marker::Copy for POINTER_DEVICE_PROPERTY {}
impl ::core::clone::Clone for POINTER_DEVICE_PROPERTY {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub type POINTER_DEVICE_TYPE = i32;
#[doc = "*Required features: `\"Win32_UI_Controls\"`*"]
pub co... | Rust | 0 |
self.safety_rules_backend = safety_rules_backend;
self
}
pub fn safety_rules_host(&mut self, safety_rules_host: Option<String>) -> &mut Self {
self.safety_rules_host = safety_rules_host;
self
}
pub fn safety_rules_namespace(&mut self, safety_rules_namespace: Option<Stri... | Rust | 0 |
# AUTO GENERATED FILE - DO NOT EDIT
from dash.development.base_component import Component, _explicitize_args
class Mesh(Component):
"""A Mesh component.
Mesh is exposing a vtkPolyData to a downstream filter
It takes the following set of properties:
- state: { mesh: { ...polydata-props }, field: { ...dataArray ... | Python | 1 |
on_ids),
"labels": torch.tensor(labels),
"concept_ids": torch.tensor(concept_ids),
"concept_label": torch.tensor(concept_label),
"distance": torch.tensor(distance),
"head_ids_trunc": torch.tensor(head_ids_trunc),
"tail_ids_trunc": torch.tensor(tail... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Define homotopy levels, perturbations, and simulated stability data for each component of the proof
homotopy_levels = np.arange(20, 101)
perturbations = np.linspace(-2.0, 2.0, 40)
X, Y = np.meshgrid(perturbations, homotopy_lev... | Python | 1 |
#[doc = " buffers that must be pending in the transmit ring to trigger their"]
#[doc = " [implicit] freeing by the driver transmit function."]
#[doc = " - The *tx_rs_thresh* value indicates the [minimum] number of transmit"]
#[doc = " descriptors that must be pending in the transmit ring befor... | Rust | 0 |
to_lua(lua),
None => Ok(Nil.push_into_no_err(lua)),
}
}
}
impl<L, T> PushOneInto<L> for Option<T>
where
T: PushOneInto<L>,
L: AsLua,
{
}
impl<L, T> LuaRead<L> for Option<T>
where
L: AsLua,
T: LuaRead<L>,
{
fn lua_read_at_maybe_zero_position(lua: L, index: i32) -> Result<Opt... | Rust | 0 |
data.chars() {
match v.last() {
None => v.push(c),
Some(l) => {
if c != *l && c.eq_ignore_ascii_case(l) {
v.pop();
} else {
v.push(c);
}
}
}
}
Ok(v.len())
}
fn part2(data... | Rust | 0 |
: syncookie_val,
PeerIP: peerip_val,
})
));
pub fn startup() -> u16 {
return 0;
}
pub fn cleanup() -> u16 {
return 0;
}
pub fn parse_control_packet_header(data: &[u8]) -> UDTControlPacketHeader {
let parsed_header: UDTControlPacketHeader = parse_control_packet_header_a(data... | Rust | 0 |
OT << 12);
type PT = [PageEntry<*mut u8>; 512];
type PD = [PageEntry<PT>; 512];
type PDPT = [PageEntry<PD>; 512];
type PML4 = [PageEntry<PDPT>; 512];
fn pml4() -> &'static mut PML4 {
unsafe { usize2ref(KADDR_MMU_PML4) }
}
fn pdpt<T>(ptr: *const T) -> &'static mut PDPT {
unsafe { usize2ref(KADDR_MMU_PDPT + ((p... | Rust | 0 |
max_distance=max_distance,
layout=layout,
use_einsum=use_einsum)
score_cell.initialize()
if hybridize:
score_cell.hybridize()
score_cell.load_dict({name... | Python | 1 |
te",
service="sqlite",
tag=f"sqlite" if runtime == "async-std" else f"sqlite_{runtime}",
)
#
# postgres
#
for version in ["14", "13", "12", "11", "10"]:
run(
f"cargo test --no-default-features --features macros,offline,any,all... | Python | 1 |
are set here
let config = GroupConfig::new(
network,
group_name,
client,
fee_denom,
path,
propose_on_multisig,
)
.await?;
let sender = Rc::new(Sender::new(&config, secp)?);
Ok((sender, config))
}
use analyze;
use analyze::definition::{Method, Param};... | Rust | 0 |
kernel parameters.
ret_matrix: bool
If set, the call with also return a second variable.
This variable can be then used to compute a p-value using
:py:meth:`~.MMDStatistic.pval`.
Returns
-------
:class:`float`
The test statistic.
:... | Python | 1 |
input_packed[9], input_packed[21]),
extract_lo_hi_f32(input_packed[10], input_packed[21]),
extract_hi_lo_f32(input_packed[10], input_packed[22]),
extract_lo_hi_f32(input_packed[11], input_packed[22]),
];
let out = self.perform_parallel_fft_direct(values);
le... | Rust | 0 |
from cpp_template import *
gen_types = [
cpp("mt19937", "", "random_device()()"),
cpp("knuth_b", "", "random_device()()"),
cpp("bernoulli_distribution", "double p"),
]
int_dist = [
cpp("uniform_int_distribution", "# a,# b"),
cpp("binomial_distribution", "# t, double p"),
cpp("negative_binomial_distribution... | Python | 1 |
r de citas",
"3": "Tomador de pedidos", "4": "Consulta de documentos", "5": "Otro tipo"
}
if mensaje in opciones:
user["estado_anterior"] = estado
user["tipo_bot"] = opciones[mensaje]
user["estado"] = "esperando_sector"
... | Python | 1 |
CLEAN_TOKEN_STEP1 = '[\=;\\"\<\>,)(]'
CLEAN_TOKEN_STEP2 = "[']"
def initTokensMap():
tokensList = []
tokensCombo = []
tokensList.append(Token('APR1 MD5', '\\$apr1\\$[a-zA-Z0-9_/\\.]{8}\\$[a-zA-Z0-9_/\\.]{22}', []))
tokensList.append(Token('APACHE SHA', '\\{SHA\\}[0-9a-zA-Z/_=]{10,}', []))
tokensLis... | Python | 1 |
from rxn_splits import split_utils
def test_create_is_of_set_function():
namerxns = ["3.1", "3.1.2", "6.3.4.2", "2.1", "2.1.3"]
is_of_set = split_utils.create_is_of_set_function(namerxns)
assert is_of_set("3.1")
assert is_of_set("3.1.2")
assert is_of_set("6.3.4.2")
assert is_of_set("2.1")
... | Python | 1 |
ors_of_divisor[1] as u32 - 1);
self.index += 1;
}
4 => {
// when # divisors is a prime * non-prime
result = 2_u64.pow(divisors_of_divisor[2] as u32 - 1)
* 3_u64.pow(divisors_of_divisor[1] as u32 - 1);
self.index ... | Rust | 0 |
from pathlib import Path
from shutil import copyfile
import click
from autoalbument.cli.lib.config_builder import SearchConfigBuilder
from autoalbument.utils.click import should_write_file
@click.command()
@click.option(
"--config-dir",
type=click.Path(),
required=True,
help="Path to a directory whe... | Python | 1 |
Gaussian {
pub fn new(w: f32, h: f32, alpha: f32) -> Gaussian {
Gaussian {
w: w,
h: h,
inv_w: 1.0 / w,
inv_h: 1.0 / h,
alpha: alpha,
exp_x: f32::exp(-alpha * w * w),
exp_y: f32::exp(-alpha * h * h),
}
}
fn w... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.