text string | label_name string | labels int64 |
|---|---|---|
() < min_stable_ticks {
task::sleep(tick_duration).await;
print_state(n, l.c(), l.q(), l.stable_ticks());
}
tx1.send(true).await
});
task::spawn(async move {
let n = 2u8;
let mut l = l2;
... | Rust | 0 |
from builtins import range
from miasm.expression.expression import *
from miasm.core.cpu import gen_reg, gen_regs
exception_flags = ExprId('exception_flags', 32)
spr_access = ExprId('spr_access', 32)
reserve = ExprId('reserve', 1)
reserve_address = ExprId('reserve_address', 32)
SPR_ACCESS_IS_WRITE = 0x80000000
SPR_... | Python | 1 |
self.assertEqual(faces(), p.faces())
self.assertEqual(wires(), p.wires())
self.assertEqual(edges(), p.edges())
self.assertEqual(vertices(), p.vertices())
with BuildLine() as p:
Line((0, 0), (1, 0))
self.assertEqual(edges(), p.edges())
... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
import re
from odoo import api, fields, models, _
from odoo.exceptions import ValidationError
# Regular expression used to parse the creditor identifiers in SDD scheme.
SDD_CREDITOR_IDENTIFIER_REGEX_PATTERN = r"(?P<country_code>[A-Z]{2})(?P... | Python | 1 |
use super::RequestParser;
use std::fmt::Write;
pub trait PrettyPrint {
fn prettify(&self) -> Result<String, Box<dyn std::error::Error>>;
}
impl PrettyPrint for RequestParser {
fn prettify(&self) -> Result<String, Box<dyn std::error::Error>> {
let mut f = String::new();
writeln!(f, "{}: {}", "M... | Rust | 0 |
from flask import Flask
from .models import FeedBack
from ...dao import db
from flaskr.api.doc.feishu import send_notify
from flaskr.service.user.models import User
def submit_feedback(app: Flask, user_id: str, feedback: str, mail: str):
with app.app_context():
feedback_item = FeedBack(user_id=user_id, fe... | Python | 1 |
d in wordlist]
except:
_4LETTER_WORDLIST = []
if all(x in wordlist for x in s.strip().split(" ")):
# checks if all words in list are in BIP-39 word list
return QRType.SEED__MNEMONIC
elif all(x in _4LETTER_WORDLIST for x in s.strip().s... | Python | 1 |
=> {
let item = self.ls_env.remove(idx);
self.update_item(item.name.as_str(), "");
},
EditMsg(edit_msg) => match edit_msg {
BtnCancelClicked => self.is_adding = false,
BtnOkClicked(new_name, new_val) => {
if let Some(selected_idx) = self.s... | Rust | 0 |
start of a frame and after the update of HccaFrameNumber."]
#[inline(always)]
pub fn sf(&mut self) -> SF_W {
SF_W { w: self }
}
#[doc = "Bit 3 - ResumeDetected This bit is set when HC detects that a device on the USB is asserting resume signaling."]
#[inline(always)]
pub fn rd(&mut self... | Rust | 0 |
# DATABASES = {{
# 'default': dj_database_url.config(
# default=config('DATABASE_URL', default=''),
# conn_max_age=600,
# conn_health_checks=True,
# )
# }}'''
print("📝 Adicione ao seu settings.py:")
print("=" * 60)
print(settings_code)
print("=" * 60)
... | Python | 1 |
set_literal(5.0);
let response = request.send().pipeline.get_value().read_request()
.send().wait();
assert!(response.get_value() == 512.0);
println!("PASS");
}
}
<reponame>dholroyd/third-party-api-clients<filename>sendgrid/src/contacts_api_segments.rs
use any... | Rust | 0 |
ot,
_ => false,
}
}
pub fn indices(&self) -> &[u32] {
&self.indices
}
pub fn lemmas(&self) -> &[T] {
&self.lemmas
}
}
#[derive(Default)]
pub struct CBMT<T, M> {
data_type: PhantomData<T>,
merge: PhantomData<M>,
}
impl<T, M> CBMT<T, M>
where
T: Ord ... | Rust | 0 |
'🎁 Ежедневный бонус')
back = types.KeyboardButton(text='🔙 Назад')
if cursor.execute('SELECT start_pack FROM user WHERE user_id = ?', (message.from_user.id,)).fetchone()[0] == 0:
markup.add(change_mine_crime, yoomoney, yoomoney_2, history_button, start_pack, ref, conversion, daily_bonus, back)
else... | Python | 1 |
ion += 0.05
def varyContinuity (aSplineX, aSplineY, aSplineZ):
defaults(aSplineX, aSplineY, aSplineZ)
Continuity = -1
while Continuity <= 1:
aSplineX.SetDefaultContinuity(Continuity)
aSplineY.SetDefaultContinuity(Continuity)
aSplineZ.SetDefaultContinuity(Continuity)
fit()
... | Python | 1 |
opqrstuvwxyz0123456789+/";
let hexed = "72bca9b68fc16ac7beeb8f849dca1d8a783e8acf9679bf9269f7bf";
let s = hexed
.as_bytes()
.iter()
.step_by(2)
.enumerate()
.map(|(i, _)| {
let u = u8::from_str_radix(&hexed[2 * i..(2 * i + 2)], 16).expect("overflow");
... | Rust | 0 |
gured default '2' parity
// for RRS is assumed
// -- if input is STANDARD but STANDARD is not configured '0' parity
// is returned, the caller is expected to choose the right parity
// at that point.
pub fn get_parity_for_sc(&self, sc: &str) -> u8 {
if sc.trim() == RRS {
... | Rust | 0 |
flag, msg = logserver_mgr.add_logserver(
server_type=server_type,
data=server_data,
)
# if not flag:
# return public.returnMsg(False, msg)
# if source_type and source_list:
# flag, msg = logserver_mgr.add_source(
# source_type=sour... | Python | 1 |
from sly import Lexer
class MyLexer(Lexer):
# Define your own token names
tokens = { IDENTIFIER, NUMBER, PLUS, MINUS, TIMES, DIVIDE,
ASSIGN, PRINT, LPAREN, RPAREN, STRING, COMMENT }
ignore = ' \t' # Ignore spaces and tabs
# Regular expression rules for tokens
IDENTIFIER = r'[a-zA-Z]... | Python | 1 |
LoanHealth::Well
}
}
impl<T: Trait> rio_assets::traits::OnAssetTransfer<T::AssetId, T::AccountId, T::Balance>
for Module<T>
{
fn on_asset_transfer(
_asset_id: &T::AssetId,
_from: &T::AccountId,
_to: &T::AccountId,
_balance: &T::Balance,
) -> DispatchResult {
O... | Rust | 0 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
User defined Error code.
"""
class RET:
OK = "2000"
NODATA = "2001"
DATAEXIST = "2002"
DATAERR = "2003"
PARAMERR = "4000"
SESSIONERR = "4001"
LOGINERR = "4002"
USERERR = "4003"
ROLEERR = "4004"
PWDERR = "4005"
REQERR = "40... | Python | 1 |
494318),
"yellow".into() => xyz(56.049678312643010258398135, 59.420045497203417994569463, 9.259158982980897789616392),
"magenta".into() => xyz(29.443853393777558835608943, 19.261353401754348624308477, 31.073900904962080460336438),
"cyan".into() => xyz(14.637434350390281068143850, 19.962492706402... | Rust | 0 |
max_u16);
} else if #[cfg(all(target_arch = "aarch64", target_feature = "neon"))] {
aarch64_128_neon_impl!(m16x8, vminvq_u16, vmaxvq_u16);
} else {
default_impl!(m16x8);
}
}
};
(m32x4) => {
cfg_if! {
if #[cfg(any(tar... | Rust | 0 |
def create_state(self, common: Optional[CommonSchedulerState]=None
) ->PNDMSchedulerState:
if common is None:
common = CommonSchedulerState.create(self)
final_alpha_cumprod = jnp.array(1.0, dtype=self.dtype
) if self.config.set_alpha_to_one else common.alphas_cumprod[0]
init_noise_sigma ... | Python | 1 |
import argparse
from build_graph import build_graph
# class CommonArgParser(argparse.ArgumentParser):
# def __init__(self):
# super(CommonArgParser, self).__init__()
# self.add_argument('--exer_n', type=int, default=835,
# help='The number for exercise.')
# self.ad... | Python | 1 |
import os
import unittest
import numpy as np
import hnswlib
class RandomSelfTestCase(unittest.TestCase):
def testRandomSelf(self):
dim = 16
num_elements = 10000
# Generating sample data
data = np.float32(np.random.random((num_elements, dim)))
# Declaring index
... | Python | 1 |
esult, evaluations);
// incorrect transition (stack value added to sponge), add, step = 0
let state1 = vec![1, 3, 5, 7, 9, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 9];
let mut state2 = vec![2, 3, 5, 7, 9, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 0, 0];
apply_hacc_round(&mut state2[1..5], UserOps::Add as u... | Rust | 0 |
VE,
)
;
pub type PFN_vkGetDescriptorSetHostMappingVALVE =
unsafe extern "C" fn(
device: VkDevice,
descriptorSet: VkDescriptorSet,
ppData: *mut *mut ::std::os::raw::c_void,
)
;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VkPhysicalDeviceFragmentDensityMapOffsetFeaturesQCOM {
... | Rust | 0 |
simplificado
analise_final = f"""
<b>PONTOS POSITIVOS:</b><br/>
• {analises.get('total_escolas', 0)} escolas avaliadas<br/>
• {analises.get('total_alunos', 0)} alunos analisados<br/>
• {analises.get('media_leitura_alto', 0):.1f}% com alto nível de leitura<br/>... | Python | 1 |
command uses default when_finished value."""
with patch("caption_flow.workers.caption.CaptionWorker") as mock_worker:
mock_worker_instance = Mock()
mock_worker.return_value = mock_worker_instance
mock_worker_instance.start = AsyncMock()
result = runner.invoke(
... | Python | 1 |
scover_udfs to return non-empty result to avoid early return
mock_discover.return_value = {"dummy": lambda: None}
# Use plain text output for easier testing
result = runner.invoke(app, ["info", "test_module.sample_double", "--plain"])
assert result.exit_code == 0
# Check output... | Python | 1 |
::U32([0x05, 0x89, 0x00, 0x00]),
PropertyValue::U32([0x07, 0x7f, 0x08, 0x4a]),
];
let res = make_node_with_props::<200>(node_name, &prop_val_list, &offset_list);
let (patch_bytes_1_len, patch_bytes_1) = match res {
Ok((patch_bytes_1_len, patch_bytes_1)) => {
println!("patch_bytes... | Rust | 0 |
class sort:
def interchangeSort(self,arr):
n=len(arr)
for i in range(n):
for j in range(i+1,n,1):
if arr[i]>arr[j]:
arr[i],arr[j]=arr[j],arr[i]
return arr
def bubbleSort(self,arr):
n=len(arr)
for i in range(n):
... | Python | 1 |
INVALIDPARAMETERERROR = 'InvalidParameter.InvalidParameterError'
# Json反序列化错误。
INVALIDPARAMETER_JSONUNMARSHALERROR = 'InvalidParameter.JsonUnmarshalError'
# 超出置放群组资源数量配额。
INVALIDPARAMETER_OVERDEPLOYGROUPQUOTA = 'InvalidParameter.OverDeployGroupQuota'
# 资源已存在。
INVALIDPARAMETER_RESOURCEEXISTS = 'InvalidParameter.Resou... | Python | 1 |
_info_bytes = [0u8; 32];
nft_info_bytes.copy_from_slice(&nft_info_vec);
owned_nft_values.push(owned_nft_value.clone());
let value = H256::from(nft_info_bytes);
// Add old owned smt leaves
smt.update(key, value).expect("SMT update leave error");
smt.update(key, H25... | Rust | 0 |
not open folder: {}", e))?;
for entry in dir {
let entry = entry
.map_err(|e| format!("Can not use folder entry: {}", e))?;
let path = entry.path();
if path.is_file() {
let block = std::fs::read(&path)
.map_err(|e| format!(... | Rust | 0 |
tents::Scalar(scalar) => marked_string_to_string(scalar),
HoverContents::Array(contents) => contents
.into_iter()
.map(marked_string_to_string)
.collect::<Vec<_>>()
.join("\r\n\r\n"),
HoverContents::Markup(markup) => markup.value,
... | Rust | 0 |
,
);
ptr::copy(
bytes.as_ptr(),
self.inner.as_mut_ptr().add(idx),
amt,
);
self.inner.set_len(len + amt);
}
/// Retains only the characters that satisfy the `pred` predicate
///
/// This means that a character will be removed if `pred(t... | Rust | 0 |
ar_queue(alg_msg_queue=alg_msg_queue)
task_id = str(uuid.uuid4())
process = Process(target=handle_message_wrapper, args=(task_id, message, alg_msg_queue, proxy, llm_api_key, serpapi_key))
process.daemon = True
process.name = task_id
process.start()
... | Python | 1 |
"""
## Question
### 1331. [Rank Transform of an Array](https://leetcode.com/problems/rank-transform-of-an-array/)
Given an array of integers arr, replace each element with its rank.
The rank represents how large the element is. The rank has the following rules:
Rank is an integer starting from 1.
The larger the eleme... | Python | 1 |
"""Generic matplotlib plot class."""
# =============================================================================
# File : core.py -- Plots with matplotlib backend
# Author : Jürgen Hackl <hackl@princeton.edu>
# Time-stamp: <Tue 2023-10-24 18:17 juergen>
#
# Copyright (c) 2016-2023 Pathpy Developers
# =====... | Python | 1 |
et commands = parse("IFEQ 0x00 0x05\nIINC 0x00 0x01\nIADD");
let mut mic1 = create_processor(&commands, vec![1, 2, 3, 4], [0; 10]);
mic1.run(commands.len() + 1, PROGRAM_START);
assert_stack(vec![2, 5], &mic1)
}
#[test]
fn ifeq1() {
let commands = parse("IFEQ 0x00 0x05\nIINC... | Rust | 0 |
}
e => error!("e = {:?}", e),
};
debug!("unlocked TX");
strokes.clear();
}
fn on_tch(_app: &mut ApplicationContext, _input: multitouch::MultitouchEvent) {
debug!("[on_tch]");
}
fn on_btn(app: &mut ApplicationContext, input: gpio::GPIOEvent) {
let (btn, pressed) = match input {
gpio... | Rust | 0 |
"
);
#[test]
fn display() {
let sig = Signature::from_bytes(&TEST_1_SIGNATURE).unwrap();
assert_eq!(sig.to_string(), "E5564300C360AC729086E2CC806E828A84877F1EB8E5D974D873E065224901555FB8821590A33BACC61E39701CF9B46BD25BF5F0595BBE24655141438E7A100B")
}
#[test]
fn lower_hex() {
let sig = Signature::from_byte... | Rust | 0 |
ound {len(lines)} rows including header in {expected_path}")
f.close()
# make sure duplicate entries are not created
_create_reidentification_spreadsheet(
patient_two_identifier, patient_two_anonymised_id, csv_filename
)
f = open(expected_path,... | Python | 1 |
"""Make slot_decay_per_second not nullable
Revision ID: 8167af8df781
Revises: ef674d598dd3
Create Date: 2023-09-21 12:18:06.722322
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "8167af8df781"
down_revision = "ef674d598dd3"
branch_labels = None
depends_on = Non... | Python | 1 |
Var(StrucVarType.DUP, GenomeRelease.GRCh37, "X", 1000, 1500),
),
],
)
def test_resolve_strucvar_success(strucvar_resolver, input_str, expected_output):
"""Test the resolve_strucvar method."""
result = strucvar_resolver.resolve_strucvar(input_str, GenomeRelease.GRCh38)
assert result.sv_type == ex... | Python | 1 |
gamma = data
.into_iter()
.fold([0; 12], |mut acc, row| {
row.chars().fold(0, |i, c| {
if c == '0' {
acc[i] += 1;
}
i + 1
});
acc
})
.iter()
.fold(String::new(), |mut a, b| {
... | Rust | 0 |
use num_traits::cast::AsPrimitive;
/// # Test Flooring.
macro_rules! test_impl {
($type:ty, ($($val:expr),+)) => (
$( assert_eq!(<$type>::saturating_from($val), <$type>::MIN); )+
);
($type:ty) => {
// SaturatingFrom is implemented for all signed types.
test_impl!($type, (-1_i8, -1_i16, -1_i32, -1_i... | Rust | 0 |
// TODO: define an implicit mechanism for deriving a kitty's power from its DNA
// TODO: store variable kitty metadata (name, etc) in this pallet
// TODO: allow senders to supply extra funds to lock, which will serve as a power boost
}
// TODO: BOOST
// power up a kitty by locking more funds
// incre... | Rust | 0 |
from .era5 import DatasetERA5SR
from .kol import DatasetKolSR
from .channel import DatasetChannelSR
from .sst import DatasetSSTSR
from .rd_gs import DatasetRDGSSR
from .cylinder2d import DatasetCy2d
import torch
import numpy as np
def get_dataset(opt, log, data, train=True):
kwags = dict(opt=opt, log=log, data=da... | Python | 1 |
its: bool) -> Self {
SLV_ACTIVITY_R(crate::FieldReader::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SLV_ACTIVITY_A {
match self.bits {
false => SLV_ACTIVITY_A::IDLE,
true => SLV_ACTIVITY_A::ACTIVE,
}
... | Rust | 0 |
taffRoles.DRIVER1):
team_hire_driver(model, team, StaffRoles.DRIVER1, top_available_drivers)
# redefine top available drivers
free_agents = get_free_agents(model)
top_available_drivers = [driver for driver in drivers_by_rating if driver in free_agents]
elif team in model.staff_market.compile_teams_... | Python | 1 |
# Generated by Django 3.2.12 on 2022-08-06 12:00
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('modelmanager', '0001_initial'),
('images', '0001_initial'),
]
operations = [
m... | Python | 1 |
"));
assert_eq!(m.params().find("bar"), Some("d's'd"));
}
}
<gh_stars>0
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
/... | Rust | 0 |
last_event: Utc::now(),
reporter: "foo-controller".into(),
}
}
}
/// Data owned by the Manager
#[derive(Clone)]
pub struct Manager {
/// In memory state
state: Arc<RwLock<State>>,
}
/// Example Manager that owns a Controller for Foo
impl Manager {
/// Lifecycle initiali... | Rust | 0 |
api_key_inputs["api_key_main"] = ("STRING", {
"multiline": False,
"default": "",
"tooltip": "主API Key(必填)"
})
# 动态添加额外的API Key字段(最多支持10个)
max_keys = min(10, max(1, key_count + 2)) # 至少1个,最多10个,当前数量+2个备用
for i in range(2, max_key... | Python | 1 |
::TryFrom;
use at_commands::parser::{CommandParser, ParseError};
use crate::settings::parameter::channel::Channel;
impl TryFrom<&[u8]> for Channel {
type Error = ParseError;
fn try_from(value: &[u8]) -> Result<Self, Self::Error> {
let result = CommandParser::parse(value)
.expect_identifi... | Rust | 0 |
"""Test handling circular plugin dependencies."""
# Create two plugins that depend on each other
# This is a conceptual test - actual implementation would need dependency handling
config = Config()
manager = PluginManager(config)
# Create mock plugins with circular dep... | Python | 1 |
<Type>),* }
Named(Vec<EnumNamedVariantNode>),
}
/// <Ident>: <Type>
#[derive(Debug, PartialEq, Clone)]
pub struct EnumNamedVariantNode {
pub ident: IdentNode,
pub ty: TypeNode,
}
#[derive(Debug, PartialEq, Clone)]
pub struct FunctionNode {
pub id: NodeId,
pub ident: IdentNode,
pub generics: V... | Rust | 0 |
#!/usr/bin/env python
"""
Provides python regular expressions and utility functions for SSVC-related patterns.
"""
# Copyright (c) 2025 Carnegie Mellon University.
# NO WARRANTY. THIS CARNEGIE MELLON UNIVERSITY AND SOFTWARE
# ENGINEERING INSTITUTE MATERIAL IS FURNISHED ON AN "AS-IS" BASIS.
# CARNEGIE MELLON UNIVER... | Python | 1 |
hidden)]
impl FromGlib<ffi::GtkPropagationLimit> for PropagationLimit {
unsafe fn from_glib(value: ffi::GtkPropagationLimit) -> Self {
skip_assert_initialized!();
match value {
0 => PropagationLimit::None,
1 => PropagationLimit::SameNative,
value => PropagationLim... | Rust | 0 |
try:
fields_to_exclude.remove(key)
except ValueError:
pass # do nothing!
except FieldDoesNotExist:
pass
exclude = list(set(fields_to_exclude))
print_d... | Python | 1 |
#!/usr/bin/env python
#
# Copyright 2011-2015 Jeff Bush
#
# 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 la... | Python | 1 |
email,
username,
active: true,
sign_in_count: 1,
}
}
<reponame>knokko/Tank-Attack
pub struct StartState {}
impl StartState {
pub fn new() -> StartState {
StartState {}
}
}
//
// Copyright 2019 The Project Oak Authors
//
// Licensed under the Apache License, Version 2.0 ... | Rust | 0 |
from django.urls import path
from helloworld_app import views
app_name = "helloworld_app"
urlpatterns = [
path("", views.home, name="home"),
]
| Python | 1 |
&mut fmt::Formatter) -> fmt::Result {
let contents = self
.0
.iter()
.enumerate()
.map(|(i, s)| {
format!(
" {:>8} | {}",
fuzz_type::get_fuzz_type_name(i).to_uppercase(),
s
... | Rust | 0 |
path.display());
let client = &self.client;
let resp = client
.get(format!("{}/{}", self.server, path.display()).as_str())
.send()
.await?
.json::<Vec<RemoteEntry>>()
.await?;
debug!("Found {} entries into '{}'", resp.len(), path.displ... | Rust | 0 |
SerialDigital: PhysicalConnectorType = 6i32;
#[doc = "*Required features: 'Win32_Media_DirectShow'*"]
pub const PhysConn_Video_ParallelDigital: PhysicalConnectorType = 7i32;
#[doc = "*Required features: 'Win32_Media_DirectShow'*"]
pub const PhysConn_Video_SCSI: PhysicalConnectorType = 8i32;
#[doc = "*Required features:... | Rust | 0 |
nn.try_into()?;
let statement = self.query.as_statement(&mut *conn)?;
for params in self.params {
let params = params.into();
let meta = conn._execute(&*statement, params)?;
let mut query_result = QueryResult::<Binary>::new((&mut *conn).into(), meta);
whi... | Rust | 0 |
// Transmit sequence started
///
/// addr = base + 0x150
pub events_txstarted: VolatileCell<u32>,
_reserved_6: [u32; 2],
/// Byte boundary, starting to receive the last byte
///
/// addr = base + 0x15C
pub events_lastrx: VolatileCell<u32>,
/// Byte... | Rust | 0 |
4", b"server3").unwrap();
db
}
Err(e) => panic!("failed to open database: {:?}", e),
};
let master = Master::new(db, vec!["server1".to_owned(), "server4".to_owned()]);
assert_eq!(master.volumes.read().unwrap()["server1"], 2);
assert_eq!(master.vol... | Rust | 0 |
vec());
let ttl = keyspace.ttl();
let _ = buf.write_all(b"set ");
let _ = buf.write_all(&key);
let _ = buf.write_all(format!(" 0 {} {}\r\n", ttl, value.len()).as_bytes());
let _ = buf.write_all(&value);
let _ = buf.write_all(b"\r\n");
}
fn delete(rng: &mut SmallR... | Rust | 0 |
tring("🃎")
]
};
static ref CLUBS: Vec<Value> = {
vec![
Value::string("🃑"),
Value::string("🃒"),
Value::string("🃓"),
Value::string("🃔"),
Value::string("🃕"),
Value::string("🃖"),
Value::string("🃗"),
... | Rust | 0 |
t proxyHandler.proxies:
for _ in ("http", "https"):
if hasattr(proxyHandler, "%s_open" % _):
delattr(proxyHandler, "%s_open" % _)
debugMsg = "创建 HTTP 请求打开器对象"
logger.debug(debugMsg)
handlers = filterNone([multipartPostHandler, proxyHandler if pro... | Python | 1 |
xytext=(t_points[-1]-0.1, mean_path[-1]+2),
fontsize=8)
plt.tight_layout()
# Save plot to SVG file
current_t = round(time())
#filename = f'src/static/images/graphs/QMC_{current_t}.svg'
filename = f'QMC_{current_t}.svg'
plt.savefig(filename, format='svg', b... | Python | 1 |
ne(),
demanded_4,
];
let filtered = AsServer::filter_valid_addrs(peer_id, demanded, &observed_addr);
let expected_1 = demanded_1
.replace(0, |_| Some(observed_ip.clone()))
.unwrap();
let expected_2 = demanded_3
.replace(0, |_| Some(observed... | Rust | 0 |
c.add("ym1", ym1, "gdp_calibrate", "year::macro")
checks.append("ym1")
# Also check config
c.add("check config", partial(validate_transform, "config"), "data", "_s")
checks.append("check config")
# "Clean" data from some MESSAGE variables for use in MACRO calibration functions
cleaned = {} # ... | Python | 1 |
import click
from frag.utils import console
from pathlib import Path
from typing import List, Tuple
from frag.settings import Settings
from frag.embeddings.store import EmbeddingStore
def init_store(items: Tuple[str]) -> None:
# Load settings
settings: Settings = Settings.from_path()
console.log(f"Setting... | Python | 1 |
}
#[inline]
pub fn data(&self) -> &[u8] {
self.contents.as_slice()
}
/// Stores the mapping "key -> value" in the database
pub fn put(&mut self, key: &[u8], value: &[u8]) {
self.set_count(self.get_count() + 1);
self.contents.push(ValueType::Value as u8);
VarintU32::... | Rust | 0 |
import sympy as sym
import faultdiagnosistoolbox as fdt
import matplotlib.pyplot as plt
model_def = {
'type': 'Symbolic',
'x': ['pump_flow', 'valve0_flow', 'valve1_flow', 'der_tank1_level', 'valve0_dp', 'valve1_dp', 'tank1_ports_1__p', 'tank1_ports_2__p', 'tank1_level', 'pump_dp_pump'],
'f': ['f_tank1leak'... | Python | 1 |
names : str or sequence of str
Name(s) of BLAS functions without type prefix.
arrays : sequence of ndarrays, optional
Arrays can be given to determine optimal prefix of BLAS
routines. If not given, double-precision routines will be
used, otherwise the most generic type in arrays... | Python | 1 |
import pandas as pd
from stocktrends import indicators
def test_get_state():
"""
Test case where the get_state method of the PnF class is tested. It checks if the method returns the correct state based on the given parameters.
"""
df = pd.read_csv('unit_samples/HOOLI.csv')
df.columns = [i.lower() f... | Python | 1 |
om >/dev/mtd2 &' , 'root\S+# ' ,
'cat /dev/urandom >/dev/mtdblock1 &' , 'root\S+# ' ,
'cat /dev/urandom >/dev/mtd1 &' , 'root\S+# ' ,
'cat /dev/urandom >/dev/mtdblock0 &' , 'root\S+# ' ,
'cat /dev/urandom >/dev/mtd0 &' , 'root\S+# ' ,
'cat /dev/urandom >/dev/mtdblock4 &' , 'root\S+# ' ,
'cat /dev/urandom >/dev/mt... | Python | 1 |
et codes: Vec<i64> = input
.trim()
.split(',')
.map(|x| x.trim().parse::<i64>().unwrap())
.collect();
println!("** Part 2 Final: {:?}", find_max_thrust_feedback(&codes));
}
fn find_max_thrust(codes: &[i64]) -> i64 {
let phases = vec![0, 1, 2, 3, 4];
let mut max = 0;
let... | Rust | 0 |
import time
from django.core.management import BaseCommand
from django.db.models import QuerySet
from django_q.tasks import async_task
from config.utils.sms import BaseSMS
from employee.models import Employee
class Command(BaseCommand):
argument = 'employees'
msg = 'message'
def add_arguments(self, par... | Python | 1 |
ze, bands=num_out_bands,
eType=eType, options=options)
# Copy over georeference information
if (projection):
# georeference through affine geotransform
rgb_image.SetProjection(projection)
rgb_image.SetGeoTransform(transform)
else:
# georeference... | Python | 1 |
0x02, 0x3c, 0xba, 0x1f, 0x4d, 0x12, 0xd1, 0xce, 0x0b, 0xce, 0xd7, 0x25, 0x37, 0x37, 0x69,
0xb2, 0x26, 0x2c, 0x6d, 0xaa, 0x97, 0xbe, 0x6a, 0x05, 0x88, 0xcf, 0xec, 0x8c, 0xe1, 0xa5,
0xf0, 0xbd, 0x09
];
/// Bytes of compressed public key generated with all bytes '0x69'.
const PUB_C_L: ... | Rust | 0 |
{
while !self.set.contains(self.index as u8) && self.index <= 255 {
self.index += 1;
}
if self.index > 255 {
None
} else {
self.index += 1;
Some((self.index - 1) as u8)
}
}
}
impl IntoIterator for BitSet {
type Item = u8;
... | Rust | 0 |
, to_output_val);
ctx
},
2 => {
let to_output_val = ctx.r1;
uart_putu8(uart, to_output_val as u8);
ctx
},
3 => {
let to_output_val = ctx.r1;
uart_putc!(uart, to_output_val as u8);
ctx
},
_... | Rust | 0 |
# uncompyle6 version 2.11.5
# Python bytecode 2.7 (62211)
# Decompiled from: Python 2.7.18 (default, Apr 20 2020, 20:30:41)
# [GCC 9.3.0]
# Embedded file name: Exploits\CVE_2015_5151_revsliderCSS.py
import requests
from Exploits import printModule
r = '\x1b[31m'
g = '\x1b[32m'
y = '\x1b[33m'
b = '\x1b[34m'
m = '\x1b[3... | Python | 1 |
jected to the desired orientation
Zb[:, k] = F[:, k] / norm_fb3 ;
Xb[:, k] = (np.cross(Yc[:, k], Zb[:, k]))/(np.linalg.norm(np.cross(Yc[:, k], Zb[:, k])))
Yb[:, k] = np.cross(Zb[:, k], Xb[:, k])
R_d = np.array([[Xb[0, k], Yb[0, k], Zb[0, k]], [Xb[1, k], Yb[1, k], Zb[1, k]], [Xb[2, k], ... | Python | 1 |