text string | label_name string | labels int64 |
|---|---|---|
={}&{}",
API_BASE,
self.api_key,
args.to_get_query_str()
);
let request = self.inner.get(&url);
Ok(request.send()?.json()?)
}
// get /words.json/randomWords
pub fn random_words(&self) -> Result<Vec<RandomWord>> {
let url = format!(
... | Rust | 0 |
ew_pip_deps):
"""
Overwrites the pip dependencies section in the given conda env dictionary.
{
"name": "env",
"channels": [...],
"dependencies": [
...,
"pip",
{"pip": [...]}, <- Overwrite this
],
}
"""
deps = conda_env.get("de... | Python | 1 |
e_update(betray_update_dictionary)
update_dictionary = {'W':[], 'M': [], 'T':[], 'P':[]}
for message in messages:
if message['target_country'] == None:
continue
agent1 = message['source_country'].replace("Country ", "").strip()
agent2 = message['targe... | Python | 1 |
veType = CurveType::Weierstrass;
pub const CURVE_PAIRING_TYPE: CurvePairingType = CurvePairingType::Bn;
pub const SEXTIC_TWIST: SexticTwist = SexticTwist::MType;
pub const ATE_BITS: usize = 130;
pub const SIGN_OF_X: SignOfX = SignOfX::PositiveX;
pub const HASH_TYPE: usize = 32;
pub const AESKEY: usize = 16;
<filename>s... | Rust | 0 |
ing {
String::from("FIXME")
}
fn _update_state(&mut self, guess: GuessOutcome) {
let mut info_by_letter: HashMap<char, Vec<(usize, LetterOutcome)>> =
HashMap::with_capacity(WORD_LENGTH.into());
for (i, (letter, letter_outcome)) in guess.letters.into_iter().enumerate() {
info_by_letter
... | Rust | 0 |
-specific broadcast address for the given `subnet`
/// - an IPv4 address whose host bits (those bits following the network
/// prefix) are all 0
/// - the unspecified address
/// - an IPv4 Class E address
///
/// Note two exceptions to these rules: If `subnet` is an IPv4 /32, then the
/// ... | Rust | 0 |
, b'B', b'J', b'C', b'J', b'D', b'J', b'E', b'J', b'F', b'J', b'G', b'J', b'H', b'J', b'I',
b'J', b'J', b'J', b'K', b'J', b'L', b'J', b'M', b'K', b'0', b'K', b'1', b'K', b'2', b'K', b'3',
b'K', b'4', b'K', b'5', b'K', b'6', b'K', b'7', b'K', b'8', b'K', b'9', b'K', b'A', b'K', b'B',
b'K', b'C', b'K', b'D', ... | Rust | 0 |
;
imboard::copy_image::to_clipboard(img).await?;
Ok(())
}
<gh_stars>0
//! Feature Proposal program
#![deny(missing_docs)]
#![forbid(unsafe_code)]
pub mod borsh_utils;
mod entrypoint;
pub mod instruction;
pub mod processor;
pub mod state;
// Export current SDK types for downstream users building with a differe... | Rust | 0 |
se(
extended_inv_proj_mat_4_x_4,
extended_inv_proj_mat_4_x_4_reference,
)
# Positions with invalid depth values contain nan
depth_map_reparam_with_skew = parse_depth_map(
depth_map_reparam_with_skew_ifp
)
depth_map_real_with_skew ... | Python | 1 |
best_match_score = score
best_match_app = apelido
best_match_type = "site"
if best_match_score > 75:
if any(palavra in comando_lower for palavra in palavras_fechar) and best_match_type == "app":
return {"funcao": "fechar_app", "parametros": {"nom... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import webapp2, json, utils
invalid_request = {"err": "invalid request."}
def convert_temperature(mode, qty):
if utils.is_none_or_empty(mode):
return None
mode_upper = mode.upper()
if mode_upper == 'C2F': # Celsius to Fahrenheit
v = qty * 9.... | Python | 1 |
AV_ROUND_NEAR_INF."]
#[doc = ""]
#[doc = " @see av_rescale(), av_rescale_rnd(), av_rescale_q_rnd()"]
pub fn av_rescale_q(a: i64, bq: AVRational, cq: AVRational) -> i64;
}
extern "C" {
#[doc = " Rescale a 64-bit integer by 2 rational numbers with specified rounding."]
#[doc = ""]
#[doc = " The op... | Rust | 0 |
::from_utf8(output).unwrap()
}
#[test]
fn local_vars_basic() {
let code = "
{
let a = 2;
print a + 2;
}
";
assert_eq!(run_stmt(code), "4\n");
}
#[test]
#[should_panic = "Couldn't find variable `a` in scope"]
fn let_a_eq_a() {
let code = "{let a = a;}";
run_stmt(code);
}
#[test]
fn duplica... | Rust | 0 |
g Set"]
pub pintenset5: self::host::PINTENSET,
_reserved63: [u8; 22usize],
#[doc = "0x1c0 - HOST End Point Configuration"]
pub pcfg6: self::host::PCFG,
_reserved64: [u8; 2usize],
#[doc = "0x1c3 - HOST Bus Access Period of Pipe"]
pub binterval6: self::host::BINTERVAL,
#[doc = "0x1c4 - HOS... | Rust | 0 |
pisode):
self.behaviour_net.train_process(stat, episode, self)
def logging(self, stat, use_wandb=False):
for k, v in stat.items():
self.logger.add_scalar('data/' + k, v, self.episodes)
if use_wandb:
wandb.log(stat, self.episodes)
def print_info(self, stat):
... | Python | 1 |
# -*- coding: utf-8 -*-
import numpy as np
from PIL import Image
from scipy.signal import convolve2d
from skimage.draw import circle
defocusKernelDims = [3,5,7,9]
def DefocusBlur_random(img):
kernelidx = np.random.randint(0, len(defocusKernelDims))
kerneldim = defocusKernelDims[kernelidx]
return Defoc... | Python | 1 |
import sys
from itertools import permutations
n = int(sys.stdin.readline())
arr_num = list(map(int, sys.stdin.readline().split()))
add, sub, multi, div = map(int, sys.stdin.readline().split())
operator = ['+']*add + ['-']*sub + ['*']*multi + ['//']*div
max_result = -1000000000
min_result = 1000000000
# operator = []
... | Python | 1 |
n(codelines)
for i, line in enumerate(codelines):
remove = False
if done:
new_code += line + "\n"
continue
if requires:
if "{" in line or "ensures" in line:
#not all { means the end of requires, but I don't handle more complicated cases n... | Python | 1 |
#--------------------------------------------------------------
# str 데이터 타입 전용 함수, 메서드 살펴보기
#--------------------------------------------------------------
msg='Hello 0705'
#[원소/요소 인덱스 찾기 메서드 - find(문자1개 or 문자열)]
# "H"의 인덱스
idx=msg.find('H')
print(f'H의 인덱스번호 : {idx}')
idx=msg.find('7')
print(f'7의 인덱스번호 : {idx}')
id... | Python | 1 |
t_module._forward_pre_hooks[idx] = fn
for idx, fn in enumerate(script_module._c._get_forward_hooks()):
script_module._forward_hooks[idx] = fn
return torch.jit.RecursiveScriptModule._construct(cpp_module, init_fn)
def compile_unbound_method(concrete_type, fn):
if _jit_internal.is_ignored_f... | Python | 1 |
sp:
print(f"Agent: {agent}")
row = 0
for frequency, frequency_results in agent_results.items():
if frequency_results.empty:
continue
if disp:
print(f"\nFrequency: {frequency}")
... | Python | 1 |
_base_ = [
'mmsegext::_base_/datasets/ade20k_512_tta_without_ratio.py',
'mmseg::_base_/default_runtime.py',
'mmseg::_base_/schedules/schedule_160k.py'
]
data_preprocessor = dict(
type='SegDataPreProcessor',
size=(512, 512),
mean=[123.675, 116.28, 103.53],
std=[58.395, 57.12, 57.375],
bgr... | Python | 1 |
ame("FILE_NUM")
.help("Sets the number of files")
.takes_value(true)
.validator(is_usize),
)
.arg(
Arg::with_name("file_size")
.required(true)
.long("file_size")
.value_name("FILE_SIZE")
... | Rust | 0 |
import re
import time
import pprint
import urllib2
import urllib
from BeautifulSoup import BeautifulSoup as soup
from random import choice
def append_links(thumb_div):
for thumb in thumb_div:
print '---', thumb
for a_href in thumb.findAll('a'):
link = a_href.get('href')
if ... | Python | 1 |
_reply_e8d4e804)]
pub struct BfdUdpAuthDeactivateReply {
pub context : u32,
pub retval : i32,
}
<reponame>VaultBlack/dispatch
use borsh::{BorshDeserialize, BorshSerialize};
use std::collections::BTreeMap;
use solana_program::{
account_info::{AccountInfo},
pubkey::Pubkey,
};
/// Represents all data messa... | Rust | 0 |
_list` is `NULL`.
#[no_mangle]
pub unsafe extern "C" fn aziot_keys_get_function_list(
version: AZIOT_KEYS_VERSION,
pfunction_list: *mut *const function_list::AZIOT_KEYS_FUNCTION_LIST,
) -> AZIOT_KEYS_RC {
implementation::get_function_list(version, pfunction_list)
}
/// Used as the parameter type with `get_... | Rust | 0 |
max2(&max2(a, b), c)
}
/// Component-wise maximum between four vectors.
///
/// # See also:
///
/// * [`comp_max`](fn.comp_max.html)
/// * [`comp_min`](fn.comp_min.html)
/// * [`max`](fn.max.html)
/// * [`max2`](fn.max2.html)
/// * [`max3`](fn.max3.html)
/// * [`min`](fn.min.html)
/// * [`min2`](fn.min2.html)
/// * [`... | Rust | 0 |
2 => Vector2::new(self.x, self.y),
_ => panic!("parameter i is out of range [{:?} > 2].", i)
}
}
}
impl<T: Primitive> Vector4<T> {
/// Truncates _self_ to a `Vector3` by remove the `i`<sub>th</sub> element.
///
/// Parameter `i` is `0` based index.
///
/// # Pani... | Rust | 0 |
okad(b"lok2"))]
tx2.vout = [
CTxOut(
0, CScript([OP_RETURN, OP_RESERVED, b"lok2__", b"lok0" + b"x" * 100])
)
]
tx2.rehash()
chronik.broadcast_tx(tx2.serialize()).ok()
# Only sent to ws1, not ws2
assert_equal(ws1.recv(), ws_msg(tx2.h... | Python | 1 |
})
}
#[test]
fn save_can_write_out_csv() {
Playground::setup("save_test_2", |dirs, _| {
let expected_file = dirs.test().join("cargo_sample.csv");
nu!(
cwd: dirs.root(),
"open {}/cargo_sample.toml | inc package.version --minor | get package | save save_test_2/cargo_samp... | Rust | 0 |
rt the monitoring loop"""
print(f"Started monitoring {self.product_url}")
print("Press Ctrl+C to stop monitoring")
while True:
try:
status = self.check_stock()
if status:
self.send_discord_message(status)
... | Python | 1 |
#
# Copyright (c) 2022-2024, ETH Zurich, Jonas Frey, Matias Mattamala.
# All rights reserved. Licensed under the MIT license.
# See LICENSE file in the project root for details.
#
paper_colors_rgb_u8 = {
"orange": (251, 151, 39),
"mangenta": (150, 36, 145),
"blue": (67, 110, 176),
"red": (210, 43, 38),
... | Python | 1 |
class Solution:
def jobScheduling(self, startTime: List[int], endTime: List[int], profit: List[int]) -> int:
intervals = []
for i in range(len(startTime)):
intervals.append((startTime[i], endTime[i], profit[i]))
intervals = sorted(intervals, key= lambda x: x[1])
p = []
... | Python | 1 |
`3.1.8.8 User NaT Collection Register (UNAT - AR 36)`
pub const UNAT: ApplicationRegister = ApplicationRegister(36);
/// `3.1.8.9 Floating-point Status Register (FPSR - AR 40)`
pub const FPSR: ApplicationRegister = ApplicationRegister(40);
/// `3.1.8.10 Interval Time Counter (ITC - AR 44)`
pub const... | Rust | 0 |
att_logits = self.attention_logits(x, z)
alpha = torch.softmax(att_logits, dim=2)
# Aggregate features
agg_feats = self.node_aggregation(alpha, x, z)
# Update features
feats = self.layer_norm_1(x + self.mlp_transition_1(agg_feats))
out_feats = self.mlp_transition_2(... | Python | 1 |
] = include_bytes!("./resources/DejaVuSansMono.ttf");
#[derive(PartialEq)]
pub(crate) enum ActiveTexture {
FontCache,
User(Texture),
}
#[derive(PartialEq)]
pub(crate) enum ActiveShader {
Default,
User(Shader),
}
#[derive(PartialEq)]
pub(crate) enum ActiveCanvas {
Window,
User(Canvas),
}
pub(... | Rust | 0 |
import pytest
from lambeq import SpacyTokeniser
@pytest.fixture
def sentence():
return 'This is a £100 sentence.'
@pytest.fixture
def sentence_with_extra_whitespace():
return 'This is a £100 sentence.'
@pytest.fixture
def sentence_pair():
return 'This is a £100 sentence. This is a dash-connected o... | Python | 1 |
return Occupied(OccupiedEntry{
elem: bucket,
});
}
}
let robin_ib = bucket.index() as isize - bucket.distance() as isize;
if (ib as isize) < robin_ib {
// Found a luckier bucket than me. Better steal his spot.
retu... | Rust | 0 |
class Solution:
def spellchecker(self, wordlist: List[str], queries: List[str]) -> List[str]:
exact_set = set()
lower_map = {}
lower_vowel_map = {}
for i in range(len(wordlist)):
word_lower = wordlist[i].lower()
word_lower_maskvowel = ''.join('*' if char in "a... | Python | 1 |
)]
#![register_attr(spirv)]
use spirv_std::glam::{Vec2, Vec4};
use spirv_std::{Input, Output};
#[allow(unused_attributes)]
#[spirv(vertex)]
pub fn main_vs(
in_pos: Input<Vec2>,
#[spirv(position)] mut out_pos : Output<Vec4>
) {
out_pos.store(in_pos.load().extend(0.0).extend(1.0));
}
#[cfg(all(not(test), targ... | Rust | 0 |
import numpy
from sklearn.metrics import r2_score
x = [1,2,3,5,6,7,8,9,10,12,13,14,15,16,18,19,21,22]
y = [100,90,80,60,60,55,60,65,70,70,75,76,78,79,90,99,99,100]
mymodel = numpy.poly1d(numpy.polyfit(x, y, 3))
print(r2_score(y, mymodel(x)))
| Python | 1 |
# 1 - Contagem regressiva: Escreva um programa que peça ao usuário um número inteiro positivo e, usando um laço while, imprima uma
# contagem regressiva de esse número até zero.
c = 0
n = 0
while c < n:
n = int(input('Digite um numero: ')) | Python | 1 |
else if prec2.abs()>prec1.abs() {changefsm=false;} // still shift
if TRACE>4 {println!("shift-reduce conflict resolved by operator precedence/associativity:"); printstate(&self.States[si],&self.Gmr);}
},
_ => {},
}//match to detect conflict
if changefsm { //... | Rust | 0 |
![WriteMem, Trap]),
}
}
pub fn op_rematerialize(op: &Operator) -> bool {
match op {
&Operator::I32Const { .. }
| &Operator::I64Const { .. }
| &Operator::F32Const { .. }
| &Operator::F64Const { .. } => true,
_ => false,
}
}
<reponame>dallasbrittany/glicol
use pest;
us... | Rust | 0 |
ID` for `ServiceRuntimeAdapter.initialize()`.
pub fn initialize_id() -> JMethodID<'static> {
check_cache_initialized();
unsafe { RUNTIME_ADAPTER_INITIALIZE.unwrap() }
}
/// Returns cached `JMethodID` for `ServiceRuntimeAdapter.deployArtifact()`.
pub fn deploy_artifact_id() -> JMethodID<... | Rust | 0 |
OWEREDON`"]
#[inline(always)]
pub fn is_poweredon(&self) -> bool {
*self == PDEN_USBFSPHY_A::POWEREDON
}
#[doc = "Checks if the value of the field is `POWEREDOFF`"]
#[inline(always)]
pub fn is_poweredoff(&self) -> bool {
*self == PDEN_USBFSPHY_A::POWEREDOFF
}
}
#[doc = "Write... | Rust | 0 |
"""WADM Core Domain Module"""
from .entities import (
Trade, OrderBook, OrderBookLevel, Kline,
VolumeProfile, OrderFlow, LiquidityLevel, MarketStructure
)
from .types import (
Symbol, Exchange, Side, OrderType, TrendDirection,
LiquidityType, DataType, TimeFrame, ExchangeName,
CollectorStatus, Co... | Python | 1 |
# -*- coding: utf-8 -*-
from importlib import import_module
from inspect import (
getmembers,
isclass,
)
from pkgutil import walk_packages
from typing import ( # NOQA
Dict,
List,
Tuple,
Union,
)
from django.conf import settings
from django.utils.module_loading import import_string
class Subc... | Python | 1 |
def hello() -> str:
return "Hello from brickorm!"
| Python | 1 |
= await self._generate_closing_remarks(project, customization)
closing_slide = SlideScriptData(
slide_index=len(scripts), # Special index for closing
slide_title="结束语",
script_content=closing_script,
estimated_duration=self._estimate_speaking_... | Python | 1 |
self.policy.check(self.passwd)
}
fn check_v2(&self) -> bool {
self.policy.check_v2(self.passwd)
}
}
impl<'a> TryFrom<&'a str> for PasswordEntry<'a> {
type Error = anyhow::Error;
fn try_from(s: &'a str) -> Result<PasswordEntry<'a>, Self::Error> {
let mut split = s.splitn(2,... | Rust | 0 |
let limb_base = 1 << U32AddManyGate::<F, D>::limb_bits();
let split_to_limbs = |mut val, num| {
unfold((), move |_| {
let ret = val % limb_base;
val /= limb_base;
Some(ret)
})
.take(num)
.map(F::from_canonical_u64)
... | Rust | 0 |
ZE,
pub Precision: D3D12_VIDEO_MOTION_ESTIMATOR_VECTOR_PRECISION,
pub SizeRange: D3D12_VIDEO_SIZE_RANGE,
}
#[cfg(feature = "Win32_Graphics_Dxgi_Common")]
impl ::core::marker::Copy for D3D12_VIDEO_MOTION_VECTOR_HEAP_DESC {}
#[cfg(feature = "Win32_Graphics_Dxgi_Common")]
impl ::core::clone::Clone for D3D12_VIDEO_... | Rust | 0 |
WEB_SOCKET_UNSUPPORTED_EXTENSIONS_CLOSE_STATUS: WINHTTP_WEB_SOCKET_CLOSE_STATUS = 1010i32;
#[doc = "*Required features: 'Win32_Networking_WinHttp'*"]
pub const WINHTTP_WEB_SOCKET_SERVER_ERROR_CLOSE_STATUS: WINHTTP_WEB_SOCKET_CLOSE_STATUS = 1011i32;
#[doc = "*Required features: 'Win32_Networking_WinHttp'*"]
pub const WI... | Rust | 0 |
test]
pub fn six_rule_mult() {
let program = m3_parser::read_program("examples/6-rule-mult.m3");
let x = 7;
let y = 11;
let machine = magnificent::Machine::new(0, vec![0, x, y, 0]);
let end_machine = magnificent::interpret(machine, &program, 1000);
assert!(end_machine.is_ok());
let (_, end_m... | Rust | 0 |
let mut content = String::new();
file.read_to_string(&mut content)?;
match rx.is_match(&content) {
true => Ok(()),
false => Err(CheckBpfLsmError::BpfLsmDisabledError),
}
}
#[derive(thiserror::Error, Debug)]
pub enum HashError {
#[error("could not convert the hash to a byte array")... | Rust | 0 |
from arango import ArangoClient
def reset_load(user, pw, dbname):
# Initialize the client for ArangoDB
client = ArangoClient(hosts='http://198.18.133.104:30852')
# Connect to the database
db = client.db(dbname, username=user, password=pw)
# Update all documents in the ipv6_graph collectio... | Python | 1 |
.boxed()
.or(story)
.boxed()
.or(explore::explore(backend.clone()))
.boxed()
.or(search::index(backend.clone()))
.boxed()
.or(item::item(backend.clone()))
.boxed()
.or(controllers::assets::assets())
.boxed()
.or(akibisuto_stylus::ro... | Rust | 0 |
(
FLAGS.gnmi_set,
'-ca=' + FLAGS.ca,
'-cert=' + FLAGS.cert,
'-key=' + FLAGS.key,
'-target_name=' + FLAGS.target_name,
'-target_addr=' + FLAGS.target_addr,
'-replace=' + '/:@' + ap_conf_file)
gnmi_set_cmd = ' '.join(gnmi_set_cmd... | Python | 1 |
_local_secondary_index(&mut object_1175, item_1174);
object_1175.finish();
}
}
array_1173.finish();
}
if let Some(var_1176) = &input.provisioned_throughput {
let mut object_1177 = object.key("ProvisionedThroughput").start_object();
crate::json_ser::ser... | Rust | 0 |
ementDataset(device, data_path=args.data_path, train=False)
test_loader = DataLoader(dataset_test, batch_size=args.batch_size, shuffle=False, drop_last=True)
refiner = TransformerRefinement(in_parameter_size = args.input_size, out_parameter_size = args.output_size, device=device).to(device)
for p in refine... | Python | 1 |
import matplotlib.pyplot as plt
import pandas as pd
from sklearn.datasets import make_classification
from imblearn.datasets import make_imbalance
# for reproducibility purposes
seed = 100
# create balanced dataset
X1, Y1 = make_classification(n_samples=700, n_features=2, n_redundant=0,
n... | Python | 1 |
import numpy as np
import pandas as pd
from sklearn.datasets import load_breast_cancer
from sklearn.model_selection import train_test_split
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score , confusion_matrix, classification_report
from sklearn.preprocessing import StandardScaler
def MarvellousCan... | Python | 1 |
def f(a):
for x in range(1, 1000):
u = ((x&52!=0) and (x&36==0)) <= (not(x&a==0))
if not u:
return 0
return 1
for a in range(1, 1000):
if f(a):
print(a)
break
| Python | 1 |
def main(): # pragma: no cover
from brian2 import start_scope, mvolt, ms, NeuronGroup, StateMonitor, run
import matplotlib.pyplot as plt
import neo
import quantities as pq
start_scope()
# Izhikevich neuron parameters.
a = 0.02 / ms
b = 0.2 / ms
c = -65 * mvolt
d = 6 * mvolt / ... | Python | 1 |
u32) -> *mut u32 {
(self.BL602_MemSet4_ptr)(dst, val, n)
}
#[allow(dead_code)]
#[inline(always)]
pub fn BL602_MemCmp(&self, s1: *const c_void, s2: *const c_void, n: u32) -> c_int {
(self.BL602_MemCmp_ptr)(s1, s2, n)
}
}
#[allow(dead_code)]
#[inline(always)]
pub fn BL602_MemCpy(dst:... | Rust | 0 |
for name, immediate_child_module in module.named_children():
removed, stride_removed = temporal_only_conv(
immediate_child_module, old_name + "." + name, removed, stride_removed
)
return removed, stride_removed
# class I3D8x8(nn.Module):
# def __init__(self, pretrained_path=None) -... | Python | 1 |
from django.db import models
from django.utils import timezone
from core.models import BaseModel
from ..constants import DiscountPriceMode
__all__ = ["Cupon"]
class Cupon(BaseModel):
cupon_code = models.CharField(max_length=255)
discount_mode = models.CharField(
max_length=255,
choices=Disc... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
# pylint: disable=invalid-name,redefined-builtin,wrong-import-position,import-error,unused-import
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configura... | Python | 1 |
# -*- coding: utf-8 -*-
################################################################################
#
# This Program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your optio... | Python | 1 |
"wrong message received, expected {:?}",
MESSAGES[*received_message_count]
);
*received_message_count += 1;
}
};
let mut message_transceiver = MessageTransceiver::new_with_closures(
SAMPLE_RATE,
B... | Rust | 0 |
import warnings
# ANSI escape code
ANSI_BASE = "\033["
COLORS = {
"default_bold": f"{ANSI_BASE}1m",
"red": f"{ANSI_BASE}31m",
"red_bold": f"{ANSI_BASE}1;31m",
"yellow": f"{ANSI_BASE}33m",
"yellow_bold": f"{ANSI_BASE}1;33m",
"blue": f"{ANSI_BASE}34m",
"blue_bold": f"{ANSI_BASE}1;34m",
}
RESE... | Python | 1 |
d\xea*\xa52vl\xdb\x8e\xef\
\xfa\xf6\xb7@\x0f\x01\x0b\xa5m1\xb6\x03c\xe3\x0c\xc8\
\xfe\xcaPs\x91m\x12\x0b\xf4\xd0=]\xf5\x17\xe1\xa0\
;\xd3\xbaq\xaeXL>\xd3\x80\xca\xa5\x91\x86\x8d\xb0\
'\xda\x9b\x0c\xa7/\xa5[_7\xaa\xfbq\xfa\xf5\xcf\
W\xc9n?\xcfWk\x17[;]]\x06r\xffb\
\xeb?\xfb+=\xd0\x03\xca\xe5\x0a}\x83\xc4:7;\
\xbf\xe0~\x... | Python | 1 |
from django.urls import path
from .import views
urlpatterns = [
path('',views.getNotes),
path('notes/',views.getNotes),
path('notes/create/',views.createNote),
path('notes/<str:pk>/update/',views.updateNote),
path('notes/<str:pk>/',views.getNote),
path('notes/<str:pk>/delete/',views.deleteNote)... | Python | 1 |
, usize) = <u8>::from_bytes(&bytes[index..])?;
index += sz;
index += 1;
let (length, sz): (u16, usize) = <u16>::from_bytes(&bytes[index..])?;
index += sz;
let (drawable, sz): (Drawable, usize) = <Drawable>::from_bytes(&bytes[index..])?;
index += sz;
let (target_sb... | Rust | 0 |
the run_results version and need to update this test!"
# If we need a newly generated run_results, uncomment the following line and commit the result
# self.generate_latest_run_results(project, current_run_results_schema_version)
self.compare_previous_results(project, current_run_results_schema_... | Python | 1 |
08_1B39, 0x291D_CEA0),
(r"meshes\x\ex_mh_building_01.nif", 0x4F08_1B39, 0x319B_9C83),
(r"meshes\x\ex_mh_building_03.nif", 0x4F08_1B39, 0x319B_9C8B),
(r"meshes\x\ex_mh_building_02.nif", 0x4F08_1B39, 0x319B_9C8F),
(r"meshes\x\ex_mh_building_05.nif", 0x4F08_1B39, 0x319B_9C93),
(r"meshes\x\ex_mh_bu... | Rust | 0 |
{ finish_repr(&mut self.r) }
fn destroy(&mut self) { destroy_repr(&mut self.r); }
}
let mut repr = ProgRepr {
pid: pid,
in_fd: pipe_input.out,
out_file: os::fdopen(pipe_output.in),
err_file: os::fdopen(pipe_err.in),
finished: false,
};
@ProgRes(repr) as @... | Rust | 0 |
rp_pct:.2f}% ({rp_vanilla.shape[0]} out of {rp_total.shape[0]} slots)")
print(f"Non-Rocketpool Vanilla Block %: {non_rp_pct:.2f}% ({non_rp_vanilla.shape[0]} out of {non_rp.shape[0]} slots)")
def top_vanilla_loss(df, vanilla_blocks):
node_summary = vanilla_blocks.groupby('node_address').agg(
vanilla_blo... | Python | 1 |
r::ProgramError::Custom(1)); // todo: error codes
}
}
}
pub fn generate_constraint_owner(f: &Field, c: &ConstraintOwner) -> proc_macro2::TokenStream {
let ident = &f.ident;
let info = match f.ty {
Ty::AccountInfo => quote! { #ident },
Ty::ProgramAccount(_) => quote! { #ident.to_acco... | Rust | 0 |
>(entity).ok();
let range = world.get_mut::<Range>(entity).ok();
let speed = world.get_mut::<Speed>(entity).ok();
let position = world.get_mut::<Position>(entity).ok();
let score = world.get_mut::<Score>(entity).ok();
Selection {
entity,
position: position.map(|p| p.clone()),
... | Rust | 0 |
#loop
print("restart python again")
i=1
while i <= 20:
if(i%2!=0):
i=i+1
continue
print(i)
i=i+1
# 2
# 4
# 6
# 8
# 10
# 12
# 14
# 16
# 18
# 20
#for loops= sequential traversal
list=[1,2,3,4]
for el in list:
print(el)
# 1
# 2
# 3
# 4
#for loop with else
list=[1,2,3,4]
for el in lis... | Python | 1 |
as_socket(ret_fd: *mut c_int) -> sgx_status_t {
let port = 443;
let hostname = "api.trustedservices.intel.com";
let addr = lookup_ipv4(hostname, port);
let sock = TcpStream::connect(&addr).expect("[-] Connect tls server failed!");
unsafe {
*ret_fd = sock.into_raw_fd();
}
sgx_status... | Rust | 0 |
tit_vid = tit_vid.replace("VER PROGRAMAS", "").replace("Ver online", "")
tit_vid = tit_vid.replace("VER SERIES", "").replace("Ver online", "").replace("|", "").strip()
try:
name = Utiles.formatearNombre(name + ".mp4")
except:
name = "Video_de_mitele.mp4"
... | Python | 1 |
connect_property_peer_certificate_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_peer_certificate_errors_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
fn connect_property_rehandshake_mode_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
... | Rust | 0 |
₄) + cos I ((p₂₂ rem 2π) - Ω)
// │ - (δIₛ + δIₗ) (p₂₂ mod 2π) sin I if AFSPC compatibility mode
// ω = │ p₂₃ + (pₛ₄ + pₗ₄) + cos I ((p₂₂ rem 2π) - Ω)
// │ - (δIₛ + δIₗ) (p₂₂ rem 2π) sin I otherwise
p23 + (ps4 + pl4)
... | Rust | 0 |
);
}
/// Gets a tuple containing the unix time (in ms) from the start of this year
/// to the current date
pub fn this_year(millis: bool) -> (i64, i64) {
let utc_time_now = Utc::now(); // 2022-03-04 03:24:29.457745 UTC
let ts_now = utc_time_now.timestamp();
let local_time_no... | Rust | 0 |
ent_span(false)
.init()
}
fn register_pretty_subscriber(filter: EnvFilter, span_events: FmtSpan) {
tracing_subscriber::fmt()
.with_env_filter(filter)
.with_span_events(span_events)
.pretty()
.init()
}
fn register_bunyan_subscriber(filter: EnvFilter) {
tracing_subscriber... | Rust | 0 |
"""
https://huggingface.co/bioptimus/H-optimus-0
"""
from huggingface_hub import login
import torch
import timm
from torchvision import transforms
def get_trans():
transform = transforms.Compose([
transforms.Resize(224, interpolation=transforms.InterpolationMode.BICUBIC),
transforms.ToTensor(),
... | Python | 1 |
u(bits = "3")]
sl: u8,
/// Spare
#[deku(bits = "2")]
unused1: u8,
/// RI: Reply Information
#[deku(bits = "4")]
ri: u8,
/// Spare
#[deku(bits = "2")]
unused2: u8,
/// AC: altitude code
altitude: AC13Field,
/// AP: ad... | Rust | 0 |
class Solution:
def uncommonFromSentences(self, s1:str, s2:str) -> list[str]:
count = defaultdict(int)
for w in s1.split(" ") + s2.split(" "):
count[w] += 1
res = []
for w, cnt in count.items():
if cnt == 1:
res.append(w)
return res
| Python | 1 |
Sleep(1000)
ChrTalk(
0x0101,
(
'#004F催、催眠药?',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTurnDirection(0x0102, 0x0101, 400)
ChrTalk(
0x0102,
(
'#0020061023V#012F嗯,还能闻到一点刺激性气味。',
TxtCtl.Enter,
Txt... | Python | 1 |
.values():
if item.via_device_id == device.id:
devices_to_remove.append(item.id)
# remove all devices in registry related to this node
# note: removal of entity registry is handled by core
for dev_id in devices_to_remove:
dev_registry.async_remove_device(d... | Python | 1 |
remove an account that is registered as a delegated administrator for a service integrated with your organization. To complete this operation, you must first deregister this account as a delegated administrator. </p> </li>
/// <li> <p>CLOSE_ACCOUNT_QUOTA_EXCEEDED: You have exceeded close account quota for the past... | Rust | 0 |
}
self.write()?;
Ok(resp)
}
#[cfg(feature = "html_parsing")]
fn add_star(&mut self) {
if let Some(ref stars) = self.stars {
self.stars = Some(stars + 1);
} else {
self.stars = Some(1);
};
}
/// get a JSON representation for t... | Rust | 0 |
st_cache[i] == 0:
communcation_cost = server.get_power * (env.task[i].get_cache_size / server.backhaul_rate)
swithc_cache_value += communcation_cost / (cache_fre * 20)
#print("swithc_cache_value", swithc_cache_value)
constraint_over_cache_c... | Python | 1 |
from django.db import models
from django.contrib.auth.models import User
class UserTeam(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name="user_teams")
splitFraction = models.FloatField()
team = models.ForeignKey(
"Team", on_delete=models.CASCADE, related_name="u... | Python | 1 |
nal/models/resources/shaders/glsl100/skybox.vs"),
Some("original/models/resources/shaders/glsl100/irradiance.fs"),
)
.unwrap()
.make_weak();
}
let mut shdr_pre_filter;
#[cfg(not(target_arch = "wasm32"))]
unsafe {
shdr_pre_filter = rl
... | Rust | 0 |
INT_PACKAGE_HASH);
let genesis_validators: BTreeMap<AccountHash, U512> =
runtime::get_named_arg(ARG_GENESIS_VALIDATORS);
let stakes = Stakes::new(genesis_validators);
// Add genesis validators to PoS contract object.
// For now, we are storing validators in `named_keys` map of the PoS contract... | Rust | 0 |
show_fee_schedule(Roles::User, false).await;
}
#[actix_rt::test]
async fn show_fee_schedule_org_owner() {
organizations::show_fee_schedule(Roles::OrgOwner, true).await;
}
#[actix_rt::test]
async fn show_fee_schedule_door_person() {
organizations::show_fee_schedule(Roles::DoorPers... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.