text string | label_name string | labels int64 |
|---|---|---|
36
pub mod issue92_2 {
use async_trait::async_trait;
macro_rules! mac {
($($tt:tt)*) => {
$($tt)*
};
}
pub trait Trait1 {
fn func1();
}
#[async_trait]
pub trait Trait2: Trait1 {
async fn func2() {
mac!(Self::func1());
ma... | Rust | 0 |
digits: Vec<u32> = s.many(|t| parse_digit_pair(t)).collect();
///
/// assert_eq!(digits, vec![3, 7]);
/// assert_eq!(s.remaining(), "5abcde");
/// ```
fn many<F, Output>(&mut self, parser: F) -> Many<Self, F>
where
F: FnMut(&mut Self) -> Option<Output>
{
Many::new(self, pars... | Rust | 0 |
_count: usize,
output_path: &Path,
) -> bool {
let mut tasks = Vec::new();
let original_path = Path::new(&config.config.path);
for p in packages.iter() {
tasks.push(backup_package(
&count,
total_count,
&p.filename,
output_path,
original... | Rust | 0 |
}
}
#[allow(unused_variables)]
fn __action121<
'input,
>(
input: &'input str,
(_, l, _): (usize, usize, usize),
(_, a, _): (usize, Vec<(Loc, Option<Parameter>)>, usize),
(_, r, _): (usize, usize, usize),
) -> Expression
{
{
if a.len() == 1 {
if let Some(Parameter{ ty, st... | Rust | 0 |
uint8, "unknown_0xe5", default=0,
tooltip="TOOLTIP-TODO",
)
Unknown0xe6: int = ParamField(
uint8, "unknown_0xe6", default=0,
tooltip="TOOLTIP-TODO",
)
Unknown0xe7: int = ParamField(
uint8, "unknown_0xe7", default=0,
tooltip="TOOLTIP-TODO",
)
Unknown0xe8: i... | Python | 1 |
FIX};
use utils::{sep_by_tok, ParserExt, IdentExt};
use syntax::codemap::Span;
use syntax::tokenstream::TokenTree;
use syntax::ast::{Path, Expr};
use syntax::ext::base::{DummyResult, ExtCtxt, MacResult, MacEager};
use syntax::parse::token::Token;
use syntax::ptr::P;
pub use self::uri::{uri, uri_internal};
#[inline]
... | Rust | 0 |
name="UV Unwrap", default='Smart UV Project',
items=[
('Lightmap Pack', 'Lightmap Pack', 'Lightmap Pack'),
('Smart UV Project', 'Smart UV Project', 'Smart UV Project')
]
)
# Register lightmapper
bpy.types.Scene.arm_bakemode = EnumProperty(
name="Bake ... | Python | 1 |
=================================================
/// Number of selector columns in the trace.
const NUM_SELECTORS: usize = 2;
/// Number of columns needed to record an execution trace of the bitwise helper.
const TRACE_WIDTH: usize = NUM_SELECTORS + 11;
/// Initial capacity of each column.
const INIT_TRACE_CAPACITY... | Rust | 0 |
import numpy as np
from metaworld.policies.action import Action
from metaworld.policies.policy import Policy, assert_fully_parsed, move
class SawyerSweepV1Policy(Policy):
@staticmethod
@assert_fully_parsed
def _parse_obs(obs):
return {
'hand_pos': obs[:3],
'cube_pos': obs... | Python | 1 |
} else {
unreachable!()
}
} else {
Ok((this, None))
}
}
fn new(
conn_like: T,
columns: Option<Arc<Vec<Column>>>,
cached: Option<StmtCacheResult>,
) -> QueryResult<T, P> {
match columns {
Some(col... | Rust | 0 |
", false),
("No", false),
("off", false),
("OFF", false),
("Off", false),
("f", false),
("F", false),
];
for (s, expected) in examples {
let parsed = bool::from_csv_cell(s).unwrap();
assert_eq!(parsed, *expected);
}
assert!(bool::from_csv_c... | Rust | 0 |
value = "127.0.0.1:9443")]
address: SocketAddr,
/// When creating message/bhttp, use the indefinite-length form.
#[structopt(long, short = "n")]
indefinite: bool,
/// Certificate to use for serving.
#[structopt(long, short = "c", default_value = concat!(env!("CARGO_MANIFEST_DIR"), "/server.crt... | Rust | 0 |
t = 159.7
high_contrast_distance = 0.6
hu_values = {"Poly": -63, "Acrylic": 111, "Air": -1000, "Teflon": 970}
unif_values = {"Center": 112, "Left": 104, "Right": 104, "Top": 97, "Bottom": 124}
class TestHypersightPhantomDepracated(TestCase):
# This phantom is replaced by the auto-detect of the water v... | Python | 1 |
import numpy as np
def angle_between(u, v, eps=1e-6):
un = u / (np.linalg.norm(u)+eps)
vn = v / (np.linalg.norm(v)+eps)
dot = np.clip(np.dot(un, vn), -1.0, 1.0)
return float(np.arccos(dot))
def keypoint_features(kp):
"""
kp: np.array shape (17,3) with (x,y,score) in pixel coords.
Returns:... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_holidays_overtime
from . import test_accrual_allocations
| Python | 1 |
import pandas as pd
import pingouin as pg
from pathlib import Path
import warnings
warnings.filterwarnings("ignore", category=FutureWarning, module="pingouin")
# Load the CSV
df = pd.read_csv("group_analysis/df_motion_param_stats.csv")
# Where to save results
output_dir = Path("group_analysis")
output_dir.mkdir(exis... | Python | 1 |
element (1 byte)
/// element_power (2 bytes)
/// target_restrict (1 byte)
/// target_type (1 byte)
/// unknown (1 byte)
/// unknown (1 byte)
/// unknown (2 bytes)
/// min_damage (2 bytes)
/// max_damage (2 bytes)
/// accuracy (2 bytes)
/// unknown (2 bytes)
/// unknown (2 byt... | Rust | 0 |
async_bytes_from_file(path).await?,
initial_offset,
endidness,
))
}
#[cfg(all(feature = "async", not(feature = "with_bytes")))]
async fn from_file_with_offset_async<P>(
path: P,
initial_offset: usize,
endidness: Endidness,
) -> Result<Self>
... | Rust | 0 |
# Copyright 2018 ICON Foundation
#
# 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 agreed to in writi... | Python | 1 |
er_info.get('instagram', 'Не указан')}```", inline=False)
else:
embed = disnake.Embed(title="Ошибка", description=f"Пользователь с ID {айди_пользователя} не найден.")
await inter.send(embed=embed, ephemeral=True)
def format_seconds(seconds):
hours = se... | Python | 1 |
pub struct QEI_CTL_FILTCNTR {
bits: u8,
}
impl QEI_CTL_FILTCNTR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
self.bits
}
}
#[doc = r"Proxy"]
pub struct _QEI_CTL_FILTCNTW<'a> {
w: &'a mut W,
}
impl<'a> _QEI_CTL_FILTCNTW<'a> {
#[doc = r"Wri... | Rust | 0 |
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<MSTR_CFG_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<MSTR_CFG_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `slave_sel` reader - SP... | Rust | 0 |
from os import getenv
from dotenv import load_dotenv
load_dotenv()
def load_or_throw(env_name: str) -> str:
value = getenv(env_name)
if value is None:
raise Exception(f"Environment variable {env_name} is missing")
return value
JBL_DEVICE_TARGET: str = load_or_throw("JBL_DEVICE_TARGET")
| Python | 1 |
def _test_client(print_logprobs: bool = False):
import requests
import time
from pprint import pprint
from swift.llm import get_model_list_client, XRequestConfig, inference_client
query = '123*234=?'
while True:
try:
model_list = get_model_list_client()
except reques... | Python | 1 |
(&single_result_bech32.descriptor, expected_single_wpkh);
assert_eq!(
&single_watchonly_result_bech32.descriptor,
expected_single_watchonly_wpkh
);
// let raft_result_p2sh = compile(&raft_policy, "sh").unwrap();
// let single_result_p2sh = compile(&single_policy, "sh").unwrap();
// let ... | Rust | 0 |
inline field mapping: `var_name = XXXXX`
/// 2. A nested verbose field mapping: `[var_name]`
/// 3. A sequence or map entry: `[[var_name]]`
///
/// The only way a verbose container is ended is via indenting recognisation.
/// A simple rooted container will just end with the end of input. A nested container
/// ends if... | Rust | 0 |
# Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | Python | 1 |
p, (x_train, y_train) in enumerate(test_db):
h1 = tf.matmul(x_train, w1) + b1 # x_train [32,4] * w1 [4,32] = h1 [32,32]
# 同向传播 relu发射
h11=tf.nn.relu(h1)
h2 = tf.matmul(h11, w2) + b2
y = tf.nn.leaky_relu(h2)
pred = tf.argmax(y, axis=1)
... | Python | 1 |
= inode.write();
match guard.deref_mut() {
Kind::Socket { socket } => actor(socket)?,
_ => {
return Err(__WASI_ENOTSOCK);
}
}
};
Ok(ret)
}
fn __sock_upgrade<F>(
env: &WasiEnv,
sock: __wasi_fd_t,
rights: __wasi_rights_t,
actor... | Rust | 0 |
t]
fn stack_integrate() {
let s1 = Stack::new(1, vec![2, 3], vec![4, 5, 6]);
assert!(s1.integrate() == vec!(3, 2, 1, 4, 5, 6));
}
#[test]
fn stack_filter() {
let s1 = Stack::new(1, vec![2, 3], vec![4, 5, 6]);
let s2 = s1.filter(|&x| x != 3);
assert!(s2.is_some());
assert!(s2.unwrap() == Stack:... | Rust | 0 |
Ok(None)
}
}
fn load_language_at_path(
&mut self,
name: &str,
language_path: &Path,
) -> io::Result<Option<(Language, Arc<PropertySheet>)>> {
let parser_c_path = language_path.join(PARSER_C_PATH);
let mut library_path = self.parser_lib_path.join(name);
... | Rust | 0 |
> =
BubFrameReader::new(data, (metadata, crc), speakers_absolute_coord, None);
let expects = vec![
(Head, [0.1, 0.0]),
(Body, [0.2, 0.0]),
(Head, [0.3, 0.0]),
(Stopped, [0.0, 0.0]),
(Head, [0.4, 0.4]),
(Head, [0.0, 1.0]),
... | Rust | 0 |
[X], row[Y], row[Z]))
.collect();
let data_cube = Array3::new_from_file(&in_dir.join(data_path))?;
let grid = grid.load(in_dir)?;
Self::Inst::Sample(points, data_cube, grid)
}
})
}
}
impl Display for OperationBuilderLoader {... | Rust | 0 |
ive(Clone, PartialEq, Debug, Serialize, Deserialize)]
pub struct CycloneDxDateTime {
pub(crate) date: DateTime<Utc>,
}
impl YaDeserialize for CycloneDxDateTime {
fn deserialize<R: Read>(reader: &mut Deserializer<R>) -> Result<Self, String> {
use std::str::FromStr;
loop {
match read... | Rust | 0 |
})
});
lsp_types::TextDocumentContentChangeEvent {
range,
range_length: change.range_length.and_then(|v| Some(v as u32)),
text: change.text,
}
})
... | Rust | 0 |
odel and produces a `GraphDef` proto that can be logged to TensorBoard.
Args:
model (PyTorch module): The model to be parsed.
args (tuple): input tensor[s] for the model.
verbose (bool): Whether to print out verbose information while
processing.
use_strict_trace (bool): Whether to pass keyword argument `st... | Python | 1 |
x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5,
0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD,
0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3,
0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9... | Rust | 0 |
01010)
}
#[doc = "Bus clock filter count is 12"]
#[inline(always)]
pub fn _01011(self) -> &'a mut W {
self.variant(RSTFLTSEL_A::_01011)
}
#[doc = "Bus clock filter count is 13"]
#[inline(always)]
pub fn _01100(self) -> &'a mut W {
self.variant(RSTFLTSEL_A::_01100)
}
... | Rust | 0 |
(non_snake_case)]
pub fn C(x: f64, y: f64, z: f64, u_z: f64, Q: f64, H: f64, s_y: f64, s_z: f64) -> f64 {
// Early return if coordinate upwind, as concentration always zero
if x <= 0.0 {
return 0.0;
}
let c1 = Q / (2.0 * std::f64::consts::PI * u_z * s_y * s_z);
let c2 = std::f64::consts::E.... | Rust | 0 |
"{_answers_file: two.yml, q2: a2}",
(tpl2 / "{{ _copier_conf.answers_file }}.jinja"): (
"{{ _copier_answers|to_nice_yaml }}"
),
}
)
# Make them git-tracked
for tpl in (tpl1, tpl2):
with local.cwd(tpl):
git("init")
git("add", "-A... | Python | 1 |
let fd = open(EXEC_PATH, OFlag::O_RDWR, Mode::empty())?;
defer!(close(fd).unwrap());
write(fd, label.as_bytes())?;
Ok(())
}
const XATTR_NAME: &'static str = "security.selinux";
pub fn setfilecon(file: &str, label: &str) -> Result<()> {
let path = CString::new(file)?;
let name = CString::new(XATTR... | Rust | 0 |
Ok(())
}).unwrap_or(Err(IOError::ChannelNotFound(ch)))?;
ready.push(notify);
} else {
self.notifications.push_back(notify);
}
}
... | Rust | 0 |
import os
from glob import glob
import logging
import time
from flask import Blueprint, render_template
from config import config
from zimpy import ZimFile
from iso639 import iso6392
from kiwix import Library
import timepro
import babel.numbers
blueprint = Blueprint('wikipedia_views', __name__,
... | Python | 1 |
'''
Name: Last, First
Class Block: #suffix Block (*example* 3rd Block)
Date of Creation: ##/##/####
Date of Submission: ##/##/####
Assignment: Einstein
'''
"""
Assignment Directions:
Even if you haven’t studied physics (recently or ever!), you might have heard that
E = mc^2, where E in represents energy (meas... | Python | 1 |
IntlYen,
0x0085 => Code::MetaLeft,
0x0086 => Code::MetaRight,
0x0087 => Code::ContextMenu,
0x0088 => Code::BrowserStop,
0x0089 => Code::Again,
0x008A => Code::Props,
0x008B => Code::Undo,
0x008C => Code::Select,
0x008D => Code::Copy,
0x008E... | Rust | 0 |
mut v) = tlv_map.remove(&0x146) {
v.advance(4);
_title = v.read_string_short();
message = v.read_string_short();
}
LoginResponse::UnknownStatus(LoginUnknownStatus {
status,
tlv_map,
... | Rust | 0 |
cate_end
pub struct name(member);
//item_end<filename>src/discord_datatypes/mod.rs
// Data types that represent things related to discord
// Example: User, Guild (server), channel, message, Role, etc
use crate::connection::CallbackContext;
use core::borrow::Borrow;
/// The command and args from a users message starti... | Rust | 0 |
.connect(&hidden);
assert!(output[0].value() >= 0.0);
}
}
<reponame>ForesightMiningSoftwareCorporation/cmaes<gh_stars>0
//! An implementation of the CMA-ES optimization algorithm. It is used to minimize the value of an
//! objective function and performs well on high-dimension, non-linear, non-convex, ill-... | Rust | 0 |
return Err(prefix)
}
// cancel out the final item on the prefix interior for one of the suffix's parents.
while self.parents > 0 && prefix.take_last().is_some() {
self.dec_parent();
}
// now we have either removed all suffix's parents or prefix interior.
// this means we can combine the prefix's an... | Rust | 0 |
import pandas as pd
answer_path = './answer_list.csv'
answer_values = pd.read_csv(answer_path).values.tolist()
prob_path = './work/result/result.csv'
prob_values = pd.read_csv(prob_path).values.tolist()
def list_to_dict(a):
b = dict()
for k in a:
b[k[0]] = k[1]
return b
def cal_acc(prob_list, answer_di... | Python | 1 |
pub async fn get_top_n(&self, n: i64) -> Vec<Row> {
self.client.query(r#"SELECT *, rank() OVER (ORDER BY leaderboard.rankings DESC) rank
FROM leaderboard
ORDER BY leaderboard.rankings[array_upper(leaderboard.rankings, 1)] DESC
LIMIT $1::BIGINT;"#, &[&n]).await.unwrap()
}
}
impl TypeMapKey for DatabaseWr... | Rust | 0 |
from models.models import Sheep
from typing import Dict
class FakeDB:
def __init__(self):
self.data: Dict[int, Sheep] = {}
def get_sheep(self, id: int) -> Sheep:
return self.data.get(id)
db = FakeDB()
db.data = {
1: Sheep(id=1, name="Spice", breed="Gotland", sex="ewe"),
2: Sheep(id=2... | Python | 1 |
#[cfg(test)]
mod tests {
use super::*;
// ============================================================
// HELPERS
fn test(input: &str, expected: &str) {
assert_eq!(
rustdocify(input, "foo", None, Some("foo")),
Ok(expected.to_owned())
);
}
// ==========... | Rust | 0 |
spec.params().clone(),
Default::default(),
ethparams,
);
let mut parent = Header::new();
let mut header = Header::new();
header.set_number(1);
// this test will work for this constant only
assert_eq!(PARITY_GAS_LIMIT_DETERMINANT, U256::from(37));
// when parent.gas_limit < gas_floor_target:
pa... | Rust | 0 |
.expression
.as_any()
.downcast_ref::<HashExpr>()
.unwrap();
let values_len = hash_expr.pairs.keys().len();
assert_eq!(4, values_len, "wrong number os values value");
}
fn make_parser(source: String) -> Parser {
let lexer = Lexer::new(source, Rc::new("foo.bzr".to_string()))... | Rust | 0 |
#!.venv/bin/python
# The shebang may point towards a venv, but GitHub CI executes python -m runtest
import os
import subprocess
import sys
import textwrap
import traceback
import unittest
from test.runtime import ResultAdapter, StyledStream
if __name__ == "__main__":
stream = sys.stdout
styled = StyledStre... | Python | 1 |
def main():
print("UCAB Programa elaborado por Stephanie Vielma")
res = float
def validar(num):
if (num >= 100) and (num <= 999):
bool = True
else:
bool = False
return bool
def transform(x, y):
res = (x/y)
return res
... | Python | 1 |
namic": "strict",
"properties": {
"uuid": {"type": "keyword"},
"name": {"type": "text", "analyzer": "ru_en"},
},
},
"title": {
"type": "text",
"analyzer": "ru_en",
"fields": {"raw": {"type": "keyword"}},
... | Python | 1 |
-N::one() / center_element,
&bottom_left_corner,
&new_rowj_adjoint,
N::one() / center_element,
);
chol.slice_range_mut(j + 1.., j).copy_from(&new_colj);
// update the bottom right corner
let mut bottom_right_corner = chol.slice_range_mut(... | Rust | 0 |
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from abc import ABC, abstractmethod
from Circuit import Circuit
from Components import Resistor, Capacitor, OpAmp, VoltageSource
# =============================================================================
# Main Execution Block
# ===============... | Python | 1 |
num1 = input('Digite um número: ')
num2 = input('Digite outro número: ')
# isnumeric isdigit isdecimal
#print(num1.isnumeric())
#print(num2.isnumeric())
if num1.isdigit() and num2.isdigit():
num1 = int(num1)
num2 = int(num2)
print(num1 + num2)
else:
print('Não pude converter os número para realizar c... | Python | 1 |
.loc)
|| handled_carts.iter().any(|other| other.loc == cart.loc)
{
if return_on_first_collision {
return cart.loc;
} else if let Some(pos) = carts.iter().position(|other| other.loc == cart.loc) {
carts.remove(pos);
... | Rust | 0 |
:PSTR);
#[doc = "*Required features: 'Win32_System_SqlLite'*"]
pub fn sqlite3_free_table(result: *mut *mut i8);
#[doc = "*Required features: 'Win32_System_SqlLite'*"]
pub fn sqlite3_get_autocommit(param0: *mut sqlite3) -> i32;
#[doc = "*Required features: 'Win32_System_SqlLite'*"]
pub fn sqlite3... | Rust | 0 |
let rhs = operator_enum!(; MAX_PRECEDENCE $($rest)*);
// a hack to get the maximum value of integers
[$lhs, rhs][($lhs < rhs) as usize]
}};
(; ASSOC ) => { operator_enum!(; ASSOC LeftToRight ); };
(; ASSOC $which:ident ) => { Associativity::$which };
(; TRY_PARSE $_repr:literal ()) => { None };
(; TRY_PARSE ... | Rust | 0 |
return ""
if os.name == 'nt':
deadlineCommand = "%s\\deadlinecommand.exe" % deadlineBin
else:
deadlineCommand = "%s/deadlinecommand" % deadlineBin
# insert deadlineCommand as the first argument
args.insert(0, deadlineCommand)
# Specifying PIPE for all h... | Python | 1 |
-> fmt::Result {
write!(f, "{}", self.as_str())
}
}
impl FromStr for Fields {
type Err = ParseFieldsError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
match s {
FIELD_ERROR_KIND => Ok(Fields::ErrorKind),
FIELD_ERROR_OBJECT => Ok(Fields::ErrorObject),
... | Rust | 0 |
def test_using_testing_db(settings):
assert settings.db.uri == "sqlite:///testing.db"
def test_index(api_client):
response = api_client.get("/")
assert response.status_code == 200
result = response.json()
assert result["message"] == "Hello World!"
def test_cors_header(api_client):
valid_orig... | Python | 1 |
)
self.emb_dropout = nn.Dropout(emb_dropout)
self.project_in = nn.Linear(dim_in, dim) if exists(dim_in) else nn.Identity()
self.attn_layers = attn_layers
self.norm = nn.LayerNorm(dim)
self.project_out = nn.Linear(dim, dim_out) if exists(dim_out) else nn.Identity()
... | Python | 1 |
, help="The table's width in pixels")
height = fields.Float('Height', default=50, help="The table's height in pixels")
seats = fields.Integer('Seats', default=1, help="The default number of customer served at this table.")
color = fields.Char('Color', help="The table's color, expressed as a valid 'backgroun... | Python | 1 |
#some example code for running scripts within a folder inside your project
import os, sys
ROOT_DIR = os.path.abspath("../")
sys.path.append(ROOT_DIR)
from vision import object_class as obj
#‘Create an obstacle with id 1, 0.56 m away at a bearing of 11 degrees'
Obs1 = obj.Obstacle(1, 0.56, 11) #‘Create an obstacle wit... | Python | 1 |
}t | \ }} | r| d dk7 r$t j dj | |j | |j t
dd | dd } | r*| d dk( r"|j t
dd || dd fS t ... | Python | 1 |
import numpy as np
import numpy.random as npr
from scipy.integrate import odeint
import matplotlib.pyplot as plt
import pandas as pd
def run_SEIR_SDE_model(
N: 'population size',
E0: 'init. exposed population',
I0: 'init. infected population',
R0: 'init. removed population',
bet... | Python | 1 |
{
preceded::<_, _, _, (), _, _>(
tag(s),
terminated(
ignore_inline_whitespace(valid_name),
ignore_inline_whitespace(tag(e)),
),
)(i)
.is_ok()
};
let is = i.starts_with(':');
let is = is || i.starts_with("[[");
... | Rust | 0 |
# Decompiled At : Fri Apr 10 21:02:24 WIB 2020
# File : temp.pyc (Python 2.7)
exec 'import os, sys, requests, json, random, time'
os.system('clear')
b = '\x1b[94;1m'
m = '\x1b[91;1m'
k = '\x1b[93;1m'
h = '\x1b[92;1m'
p = '\x1b[97;1m'
pu = '\x1b[96;1m'
c = '\x1b[95;1m'
bl = '\x1b[90;1m'
bg = '\x1b[7m'
nr = '\x1b[0m'
wa... | Python | 1 |
ize,
msg: &str,
font_names: &[&str],
) -> Result<(), BadgeError> {
if msg_num >= N_MESSAGES {
Err(BadgeError::MessageNumberOutOfRange(msg_num))
} else if msg.len() == 0 {
Ok(()) // Do nothing
} else {
let pixel_height = BADGE_MSG_FONT_HEIGH... | Rust | 0 |
s.keys())
for name, value in vars(self).items():
property_name = name[1:]
if property_name in memeber_set:
memeber_set.remove(property_name)
if len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
class RuleT... | Python | 1 |
doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
... | Rust | 0 |
>(rid);
assert_eq!(resource.unwrap().not_empty, 7);
}
#[test]
fn test_remove_from_resource_table() {
let mut table = ResourceTable::default();
let rid1 = table.add("fake1", Box::new(FakeResource::new(1)));
let rid2 = table.add("fake2", Box::new(FakeResource::new(2)));
assert_eq!(table.map.len... | Rust | 0 |
path_arg", expression.subnode_path),),
may_raise=expression.mayRaiseException(BaseException),
conversion_check=decideConversionCheckNeeded(to_name, expression),
source_ref=expression.getCompatibleSourceReference(),
emit=emit,
context=context,
)
def generateOsPathIsabsCallCo... | Python | 1 |
HEADER: &str = "x-datadog-parent-id";
const DATADOG_SAMPLING_PRIORITY_HEADER: &str = "x-datadog-sampling-priority";
const TRACE_FLAG_DEFERRED: TraceFlags = TraceFlags::new(0x02);
lazy_static::lazy_static! {
static ref DATADOG_HEADER_FIELDS: [String; 3] = [
DATADOG_TRACE_ID_HEADER.to_st... | Rust | 0 |
,
storage_limit: u32,
estimate: bool,
) -> Result<CallInfo, sp_runtime::DispatchError> {
let mut config = <Runtime as module_evm::Config>::config().clone();
if estimate {
config.estimate = true;
}
module_evm::Runner::<Runtime>::call(
from,
from,
to,
data,
value,
gas_limit... | Rust | 0 |
_OFFSET: u8 = 50;
fn convert_between_math_coordinate(i: int, length: int) -> int {
length - i - 1
}
fn convert_into_relative_coordinate(i: int, c: int) -> int {
let mut res = NEG_OFFSET + i - c;
if i >= c {
res += 1
}
res
}
fn convert_from_relative_coordinate(i: int, c: int) -> int {
... | Rust | 0 |
+ kernel_ctr + 1)
if expected_rew_amount_linreg is not None:
plt.plot(
expected_rew_amount_linreg,
code_expected_neuron_linreg,
"--",
color=params["color_list"][kernel_ctr],
label="Expected",
lw=lw,
... | Python | 1 |
().split('\t')
ref = seq[3]
alt = seq[4]
for i in range(7):
output.write(seq[i] + '\t')
if len(ref) > len(alt): # DEL
output.write('SVTYPE=DEL;SVLEN=%d'%(len(alt) - len(ref)))
else: # INS
... | Python | 1 |
ror
logging.error(f"Could not create default configuration file. Please check permissions or path.")
sys.exit(1)
try:
logging.debug(f"Loading configuration from: {config_path}")
config = load_config(config_path)
except Exception as e:
logging.error(f"Error loadin... | Python | 1 |
"""
Write a python function to reverse an array upto a given position.
assert reverse_Array_Upto_K([1, 2, 3, 4, 5, 6],4) == [4, 3, 2, 1, 5, 6]
"""
def reverse_Array_Upto_K(arr,k):
arr = arr[::-1]
arr = arr[:k]
return arr
print(reverse_Array_Upto_K([1, 2, 3, 4, 5, 6],4))
/Python/Array/Array_Rotation.py
"""... | Python | 1 |
});
}
fn parse_value_ident() -> ast::ident {
self.check_restricted_keywords();
return self.parse_ident();
}
fn eat(tok: token::token) -> bool {
return if self.token == tok { self.bump(); true } else { false };
}
// Storing keywords as interned idents instead of strings... | Rust | 0 |
},
And(dst, a, b) => {
let val = self.data.val(a) & self.data.val(b);
self.data[dst] = val;
},
Or(dst, a, b) => {
let val = self.data.val(a) | self.data.val(b);
self.data[dst] = val;
},
... | Rust | 0 |
st_scan": "2025-10-01T21:30:00Z",
"posts_today": 0,
"responses_today": 0
}
}
@router.get("/trends")
def get_trends(
days: int = Query(30, ge=1, le=365),
db: Session = Depends(get_db),
user = Depends(get_current_user)
):
if not user.client_id:
... | Python | 1 |
| Resp::Bulk(BulkStr::Str(s)))
.collect();
let resp = Resp::Arr(Array::Arr(arr));
resp_to_buf(buf, &resp)
}
pub fn resp_to_buf(buf: &mut Vec<u8>, resp: &RespVec) -> io::Result<usize> {
encode_resp(buf, resp)
}
pub fn encode_resp<W, T: AsRef<[u8]>>(writer: &mut W, resp: &Resp<T>) -> io::Result<usiz... | Rust | 0 |
--------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'php-json-schema-model-generator', u'php-json-schema-model-generator Documentation',
... | Python | 1 |
k_length]
else:
current_patch_values[:len(row_data[start:end])]=row_data[start:end]
patch_values.append(current_patch_values)
row_gene_tokens.append(peak_id)
tokenized_data["target_values"].... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Created on Fri Jul 19 16:06:20 2024
@author: Harry MullineauxSanders
"""
from functions_file import *
plt.close("all")
kf=0.65
km=1
Delta=0.1
B=0*Delta
Cm=Delta**(1/2)
theta=np.pi/2
if __name__ == "__main__":
cbar=[plt.cm.inferno(x) for x in np.linspace(0,1,6)]
Cm_values=np.lins... | Python | 1 |
xml_str).unwrap();
let xml = doc.root();
let want_id = "element:foo:union:18365985102726890478".to_owned();
let want_doc = "";
let union = Union::from_xml(&xml, lineage, &Xsd::new("xs")).unwrap();
let got_doc = union.documentation();
assert_eq!(got_doc.as_str(), want_doc);
let got_id = forma... | Rust | 0 |
_name("src_dir")
.long("src_dir")
.takes_value(true)
.required(true)
.help("Source dir"))
.arg(Arg::with_name("dest_dir")
.long("dest_dir")
.takes_value(true)
.required(true)
.help("De... | Rust | 0 |
def city_suffix(self) -> str:
"""
:example: 'ş.'
"""
return self.random_element(self.city_suffixes)
def street(self) -> str:
"""
:example: 'A.AĞAYEV'
"""
return self.random_element(self.streets)
def street_suffix(self) -> str:
"""
... | Python | 1 |
== DinoState::Duck && !data.duck_held {
data.dino = DinoState::Ground;
}
//dino
{
let (dino_y, dino_width, dino_height, mut target_rot) = match data.dino {
DinoState::Air(y, y_vel) => (
y - DINO_HEIGHT,
DINO_WIDTH,
DINO_HEIGHT,
... | Rust | 0 |
ub fn text_add_line_in_str(s: &str, add_line_num: usize, added_line: &str) -> String {
let mut line_num = 1;
let mut content = String::from("");
let mut added = false;
for line in s.lines() {
if line_num == add_line_num {
content += format!("{}\n", added_line).as_str();
... | Rust | 0 |
self.__json_codec.loads(value)
def mutable_json_field( # pylint: disable=keyword-arg-before-vararg, redefined-outer-name
enforce_string: bool = False,
enforce_unicode: bool = False,
json: types.ModuleType | typing.Any = json,
*args: typing.Any,
**kwargs: typing.Any,
) -> JSONField:
"""Mutabl... | Python | 1 |
# -------------------------------------------------------------------------
# Copyright (c) 2021-2022, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# NVIDIA CORPORATION & AFFILIATES and its licensors retain all intellectual
# property and proprietary rights in and to this software, related
# documentation an... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.