text string | label_name string | labels int64 |
|---|---|---|
mut cmd = Command::cargo_bin("bump")?;
cmd.args(&["major"]);
cmd.write_stdin("0.1.0")
.assert()
.success()
.code(exitcode::OK)
.stdout("1.0.0\n");
Ok(())
}
#[test]
fn hyphen_ok() -> Result<()> {
let mut cmd = Command::cargo_bin("bump")?;
cmd.args(&["patch", "-"]);
... | Rust | 0 |
r: [super::super::Foundation::CHAR; 129],
pub dwAlternateOffset: u32,
pub ipaddr: RASIPADDR,
pub ipaddrDns: RASIPADDR,
pub ipaddrDnsAlt: RASIPADDR,
pub ipaddrWins: RASIPADDR,
pub ipaddrWinsAlt: RASIPADDR,
pub dwFrameSize: u32,
pub dwfNetProtocols: u32,
pub dwFramingProtocol: u32,
... | Rust | 0 |
u8>) -> Result<(), Error> {
let topic = topic.to_owned();
let msg = ControlMessage::Publish { topic, data };
self.control_tx.unbounded_send(msg)?;
Ok(())
}
// Subscribe to unicast messages
fn subscribe_unicast(
&self,
protocol_id: &str,
) -> Result<mpsc::... | Rust | 0 |
_IRRED_POLYMS: u32 = 1;
pub const VSL_USER_DIRECTION_NUMBERS: u32 = 4;
pub const VSL_QRNG_OVERRIDE_1ST_DIM_INIT: u32 = 8;
pub const VSL_INIT_METHOD_STANDARD: u32 = 0;
pub const VSL_INIT_METHOD_LEAPFROG: u32 = 1;
pub const VSL_INIT_METHOD_SKIPAHEAD: u32 = 2;
pub const VSL_RNG_METHOD_ACCURACY_FLAG: u32 = 1073741824;
pub ... | Rust | 0 |
file.read_to_end(&mut buffer)
.await
.with_context(|| format!("Unable to read content of {}", path))?;
let npm: serde_json::Map<String, serde_json::Value> = serde_json::from_slice(&buffer)
.with_context(|| format!("Unable to JSON decode {}", path))?;
let version = npm
.get("v... | Rust | 0 |
# Copyright 2012, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the f... | Python | 1 |
with_capacity(max_elem as usize);
for ymin in (0u32..image.height()).step_by(height as usize) {
for xmin in (0u32..image.width()).step_by(width as usize) {
let crop_spec = Crop {
left: xmin,
top: ymin,
width,
height,
};... | Rust | 0 |
ng this and write tests
p = cancel(fa.as_expr()/fd.as_expr() - residue_reduce_derivation(H, DE, z))
p = p.as_poly(DE.t)
if p is None:
# f - Dg will be in k[t] if f is the logarithmic derivative of a k(t)-radical
return None
if p.degree(DE.t) >= max(1, DE.d.degree(DE.t)):
retur... | Python | 1 |
final_weight = float(final_weight)
if final_weight > 0:
final_weights.append(final_weight)
else:
print("Invalid final weight, it is not a number.")
final_... | Python | 1 |
t_token: &Option<String>,
is_short: bool,
) -> StdResult<Vec<RewardInfoResponseItem>> {
let rewards_bucket = rewards_read(storage, staker_addr, is_short);
let reward_infos: Vec<RewardInfoResponseItem>;
if let Some(asset_token) = asset_token {
let asset_token_raw = api.addr_canonicalize(asset_tok... | Rust | 0 |
rmspe_list"] and avg_metric[idx] <= target_value:
return idx
# For other types of metrics, look for values equal to or greater than the target value
elif metric not in ["_mape_list", "_rmspe_list"] and avg_metric[idx] >= target_value:
return idx
# Return None if ... | Python | 1 |
egers in `a` to packed 64-bit integers
///
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_cvtepu8_epi64)
#[inline]
#[target_feature(enable = "sse4.1")]
#[cfg_attr(test, assert_instr(pmovzxbq))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm_cvtepu... | Rust | 0 |
import pytest
from domains.__common__.base_errors import FieldError
from domains.category.errors import CategoryNameMinError, CategoryNameMaxError
from domains.category.value_objects import CategoryName
@pytest.mark.value_objects
@pytest.mark.parametrize(
("value", "exc_class"),
[
("", CategoryNameMi... | Python | 1 |
;;").collect();
if v.len() != 3 {
Ok(NetworkMessage::None)
} else {
let cname = v[0].to_owned();
let cgid = GroupId::from_hex(v[1])?;
let caddr = PeerAddr::from_hex(v[2])?;
let avatar_byte... | Rust | 0 |
: num.parse::<u16>().unwrap() - 1,
score: 0,
}
});
let p1 = players.next().unwrap();
let p2 = players.next().unwrap();
println!("{}", part1(p1.clone(), p2.clone()));
let wins = part2(p1, p2, true);
println!("{:?}", wins.0.max(wins.1));
}
<reponame>SET001/amethyst
use amethyst... | Rust | 0 |
ring or by offset from a given alias.
#[derive(Debug, Clone, Copy)]
pub enum SlaveAddr {
ByPos(u16),
ByAlias(u16, u16),
}
impl SlaveAddr {
pub(crate) fn as_pair(self) -> (u16, u16) {
match self {
SlaveAddr::ByPos(x) => (0, x),
SlaveAddr::ByAlias(x, y) => (x, y),
}
... | Rust | 0 |
rs.Dropout(rate=1 - self.dropout_keep_prob)(tf.tanh(j))
else:
g = tf.tanh(j)
new_c = c * tf.sigmoid(f + self.forget_bias) + tf.sigmoid(i) * g
new_h = tf.tanh(layer_norm(new_c, self.num_units, 'ln_c')) * tf.sigmoid(o)
hyper_h, hyper_c = tf.split(hyper_new... | Python | 1 |
pported geocode: {:?}",
album.get_geocode()))),
};
let status = match album.get_index() {
Some(_) => protobuf::AlbumStatus::Open,
None => protobuf::AlbumStatus::Closed,
};
// add Album p... | Rust | 0 |
been erased, it is enough to test if all its bits are equal
//! to 1.
//! - When power is lost while writing a slice or erasing a page, that operation does not count
//! towards the limits. However, completing that write or erase operation would count towards
//! the limits, as if the number of writes per... | Rust | 0 |
::NLEN;
use crate::arch::Chunk;
use crate::types::{CurvePairingType, CurveType, ModType, SexticTwist, SignOfX};
// Base Bits= 28
// bls461 Modulus
pub const MODULUS: [Chunk; NLEN] = [
0xAAAAAAB, 0xAC0000A, 0x54AAAAA, 0x5555, 0x400020, 0x91557F0, 0xF26AA, 0xFA5C1CC, 0xB42A8DF,
0x7B14848, 0x8BACCA4, 0x6F1E32D, ... | Rust | 0 |
### Assignments
#%% Assignment 1: Create a conditional statement that indicates if your name starts with an "A or not
name = "Arie"
if name[0].lower() == "a":
print("Your name starts with an 'A'")
else:
print("Your name does not start with an 'A'")
#%% Assignment 2:
'''
Create a conditional statemen... | Python | 1 |
g = 0
MAX_MOVES = 1000
def print_board(elements, move_name=""):
print(f"\nDirection: {move_name}")
for i in range(9):
if i % 3 == 0:
print()
if elements[i] == -1:
print("_", end=" ")
else:
print(elements[i], end=" ")
print()
def heuristic(start, go... | Python | 1 |
"web-flickr".to_owned(),
'\u{E621}' => "web-picassa".to_owned(),
'\u{E622}' => "web-deviantart".to_owned(),
'\u{E623}' => "web-steam".to_owned(),
'\u{E624}' => "web-github".to_owned(),
'\u{E625}' => "web-git".to_owned(),
'\... | Rust | 0 |
trees_as_set(&cps, &mut bufs2).unwrap()
);
assert_eq!(
NameConstraintsSet::default(),
get_initial_excluded_subtrees_with_default_as_set(&cps, &mut bufs2).unwrap()
);
assert_eq!(
NameConstraintsSettings::default(),
get_initial_excluded_subtrees_with_default(&cps)
);
... | Rust | 0 |
dal2::Operator;
use common_exception::ErrorCode;
use common_exception::Result;
use crate::sessions::QueryContext;
use crate::storages::fuse::io::snapshot_location;
use crate::storages::fuse::io::MetaReaders;
use crate::storages::fuse::FuseTable;
use crate::storages::fuse::TBL_OPT_KEY_SNAPSHOT_LOC;
use crate::storages:... | Rust | 0 |
#ISHIKA KHANDELWAL
#ROAD LANE LINE DETECTION
import cv2
import numpy as np
import matplotlib.pyplot as plt
def make_coordinates(image,line_parameters):
slope, intercept = line_parameters
y1 = image.shape[0] # Height
y2 = int(y1 * (3/5))
x1 = int((y1 - intercept)/slope)
x2 = int((y2 - intercept)/s... | Python | 1 |
ab_id: E_RAB_ID,
pub transport_layer_address: TransportLayerAddress,
pub gtp_teid: GTP_TEID,
#[asn(optional_idx = 0)]
pub ie_extensions: Option<E_RABSetupItemCtxtSUResIE_Extensions>,
}
#[derive(Debug, AperCodec)]
#[asn(
type = "SEQUENCE-OF",
sz_extensible = false,
sz_lb = "1",
sz_ub = "... | Rust | 0 |
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright (c) 2021, Cisco Systems
# GNU General Public License v3.0+ (see LICENSE or https://www.gnu.org/licenses/gpl-3.0.txt)
DOCUMENTATION = r"""
---
module: networks_appliance_vlans_settings_info
short_description: Information module for networks _appliance _vlans _setti... | Python | 1 |
SipURI; // this is start of URI, display name isn't present
}
return NameAddrValueType::TokenDisplayName;
}
fn take_display_name(
source_input: &[u8],
display_name_type: NameAddrValueType,
) -> nom::IResult<&[u8], &[u8], SipParseError> {
if display_name_type == NameAddrValueType::QuotedDisplayName... | Rust | 0 |
from rest_framework.fields import SerializerMethodField
from .models import RequirementsModel,FAQModel
from rest_framework import serializers
"""http://127.0.0.1:8000/journal/?lang=en queryparam orqali tilni ajratib
olish mumkin default holatda 2 ta tilda ham uzatadi"""
class RequirementSerializer(serializers.Mode... | Python | 1 |
"\ ")
}
}
}
fn fmt_assertion(&mut self, ast: &ast::Assertion) -> fmt::Result {
use ast::AssertionKind::*;
match ast.kind {
StartLine => self.wtr.write_str("^"),
EndLine => self.wtr.write_str("$"),
StartText => self.wtr.write_str(r"\A"),
... | Rust | 0 |
from src.day5.container_with_most_water import most_water
def test_most_water():
assert most_water([1,8,6,2,5,4,8,3,7]) == 49 | Python | 1 |
00,
(
(TxtCtl.Voice, 0x94C),
'#4S這裡就交給我們──!',
TxtCtl.Enter,
),
)
WaitForMsg()
OP_63(0x0335, 0x01)
OP_BC(0x05, 0x0000, (0xFF, 0xFFFF, 0x0), 0x00FA, 0x0003)
OP_BC(0x06, 0x0000, (0xFF, 0xFFFF, 0x0))
Fade(0x6A, 300)
OP_AC(0x09, 0x0000)
Cl... | Python | 1 |
import matplotlib.pyplot as plt
# x=["day1","day2","day3","day4","day5"]
# y=[300,450,250,230,400]
# y1=[500,450,300,250,320]
# plt.plot(x,y,marker="o",ls=":",color="red",label="week1")
# plt.plot(x,y1,marker="o",ls="--",color="blue",label="week2",alpha=0.5)
# plt.legend()
# plt.show()
import pandas as pd
data=pd.read... | Python | 1 |
"{}"),
("whl.*", "<-inf, inf>"),
("m.m", "<-2, 2>"),
("m.z", "<-1, 1>"),
("m.p", "<0, 3>"),
("m.n", "<-3, 0>"),
("m.s", "<-3, 3>"),
("z.z", "0"),
("z.p", "<1, 2>"),
("z.n", "<-2, -1>"),
("z.s", "{<-2, -1>; <1, 2>}"),
("p.p", "<2, 4>... | Rust | 0 |
unwrap!(spawner.spawn(main_task()));
})
}
<filename>src/artin/tests.rs
use super::*;
use crate::{int_inj, tests::Frac};
#[test]
fn taylor_exp() {
let p = Polynomial(vec![Frac::one(), -int_inj::<Frac, _>(2), Frac::one()]);
let d = Polynomial(vec![-Frac::one(), Frac::one()]);
assert_eq!(
... | Rust | 0 |
missing_points_sensor_frame.append(points)
# transform points from sensor space to world space
points = torch.cat([points, torch.ones_like(points[:, -1:])], dim=-1)
# find closest pose idx
closest_pose_idx = torch.searchsorted(curr_azimuth, missing_azimuth.squ... | Python | 1 |
_be_bytes(len_buf);
trace!("Reading new message with len {} bytes", msg.msg_len);
workmsg_opt = Some(msg);
}
let workmsg = workmsg_opt.as_mut().unwrap();
let mut buf = vec![0u8;... | Rust | 0 |
: Vec<u8> = Vec::new();
let len = pl.len() as u32 + 9;
data.append(len.to_le_bytes().to_vec().as_mut());
data.append(len.to_le_bytes().to_vec().as_mut());
data.append(b"\xb1\x02\x00\x00".to_vec().as_mut());
data.append(pl.as_mut());
data.append(b"\x00".to_vec().as_mut());... | Rust | 0 |
ting decoder...")
print("***********************")
for SNR in SNRs:
# simulate this SNR
sigma = np.sqrt(1. / (2 * (np.float(k)/np.float(n)) * 10**(SNR/10)))
frame_count = 0
bit_errors = 0
frame_errors = 0
frame_errors_with_HDD = 0
symbol_errors = 0
FE = 0
# simulate frames
while ((FE < min_frame_... | Python | 1 |
def get_context_emb(self, prompt, img_list):
prompt_segs = prompt.split('<ImageHere>')
assert len(prompt_segs) == len(img_list
) + 1, 'Unmatched numbers of image placeholders and images.'
seg_tokens = [self.model.llama_tokenizer(seg, return_tensors='pt',
add_special_tokens=i == 0).to(self.de... | Python | 1 |
import pytest
from rotkehlchen.exchanges.bitmex import Bitmex
from rotkehlchen.tests.utils.exchanges import create_test_bitmex
from rotkehlchen.user_messages import MessagesAggregator
TEST_BITMEX_API_KEY = 'XY98JYVL15Zn-iU9f7OsJeVf'
TEST_BITMEX_API_SECRET = b'671tM6f64bt6KhteDakj2uCCNBt7HhZVEE7H5x16Oy4zb1ag'
@pytes... | Python | 1 |
abases", databases)
.finalize()?;
Ok((app_config, rocket_config))
}
fn develop_config() -> Result<(AppConfig, Config), ConfigError> {
let app_config = AppConfig {
cors_allow_origin: String::from("https://develop.example.com"),
environment_name: String::from(... | Rust | 0 |
}
#[test]
fn test_valid_123_451_int() {
assert_eq!(Money::from(123451), Money(123451))
}
#[test]
fn test_valid_123_454_int() {
assert_eq!(Money::from(123454), Money(123454))
}
#[test]
fn test_valid_1234567890_int() {
assert_eq!(Money::from(1234567890), Money... | Rust | 0 |
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('shop', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='CategoryTranslation',
fields=... | Python | 1 |
utput.0.into_iter().try_for_each(|output| {
match output {
Output::AnalysisOutput(output) => {
self.buffers.analysis.add(output)?;
}
Output::JsonStateOutput(output) => {
self.buffers.json_state.append_step(output.inner)?... | Rust | 0 |
et base = base.to_montgomery(&field);
if base == 0 {
return Result::MaybePrime;
}
let one = 1u128.to_montgomery_unchecked(&field);
let mut base_power = base.mod_pow(d, &field);
let neg_one_mod = n_minus_one.to_montgomery_unchecked(&field);
if base_power == one... | Rust | 0 |
f41c270477921aa2336693db refs/tags/git-protocol-v0.0.0",
"14615143dc170217ca4acc80191f4e6725dc460a refs/tags/git-protocol-v0.0.0^{}",
"7e168eef62b8ad6ddd49e4e50d500761b84cfb4f refs/tags/git-ref-v0.1.0",
"e66c9ed041c7ebede869e899ecd4398fee47028b refs/tags/git-ref-v0.1.0^{}",
... | Rust | 0 |
SimpleExtLink(link_id=i, ext_node=c, int_node=self.routers[i])
for i, c in enumerate(controllers)
]
# Make an "internal" link (internal to the network) between every pair
# of routers.
link_count = 0
int_links = []
for ri in self.routers:
for ... | Python | 1 |
let mut circle = Circle { marbles };
circle.play_game(input.players, input.last_marble * 100)
}
#[derive(Default, PartialEq)]
pub struct Circle {
marbles: VecDeque<usize>, // The list of marbles in the circle (front of queue being the first marble)
}
impl Circle {
pub fn clockwise(&mut self, turns: ... | Rust | 0 |
from pinlv.chinese import load_routledge_chinese_word_frequency_data, load_radical_meanings, load_radical_mapping, load_routledge_chinese_character_frequency_data
#df = load_routledge_chinese_word_frequency_data()
#print(df.head(10))
"""
total = 0
threshold = 0.5
for i, row in df.iterrows():
total += row.normali... | Python | 1 |
"hello world\00", align 1
; Function Attrs: noinline nounwind optnone uwtable
define dso_local i32 @main() #0 {
%1 = alloca i32, align 4
%2 = alloca i8*, align 8
store i32 0, i32* %1, align 4
store i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8** %2, align 8
%3 = load i8*, i8** %2... | Rust | 0 |
92\xad\x02\xd4@\xdb\xdb\xa1[7\xc3\xdb\xf0\x22\xf2\
/\xbc\x00\xcd\xe7lG\xa58)+\x87L8\x0dr\
\xf2)\x90c\x8f\x07\xb2Y\x00\x02tw\x03\xfb\xf6B\
7\xb7\xc1lX\x07\xec|\xd9vR\x8a\xa7\xeaL\xce\
|\x08\xc0\xf7\x8b\xb9\xd1\xa2\x0ej\xadG\xea\xef\xf9\x89\
\x9d\x9ej\xba\x98\xdb\xa5\x04\x13A\xd9\xb95H]\xf6\
6\x98\xd3\xcf\x84\xef\xf6\xff... | Python | 1 |
# coding: utf-8
# -------------------------------------------------------------------
# 宝塔Linux面板
# -------------------------------------------------------------------
# Copyright (c) 2015-2099 宝塔软件(http://bt.cn) All rights reserved.
# -------------------------------------------------------------------
# Author: zouhw ... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# || ____ _ __
# +------+ / __ )(_) /_______________ _____ ___
# | 0xBC | / __ / / __/ ___/ ___/ __ `/_ / / _ \
# +------+ / /_/ / / /_/ /__/ / / /_/ / / /_/ __/
# || || /_____/_/\__/\___/_/ \__,_/ /___/\___/
#
# Copyright (C) 20... | Python | 1 |
ut pew, pew_entity)) = pew_pos
.iter_mut()
.find(|(pos, _, _)| (*pos - *translation).length() < ZAP_DIST)
{
commands.entity(entity).insert(BeingZapped);
// pew.1 -= time.delta_seconds() * 120.0;
pew.1 -= 5.0; // time invariant!
if pew.1 <= ... | Rust | 0 |
utput_html, pagination_label, user_state, log_output])
demo.load(
fn=set_engine,
inputs=[method_selector, user_state],
outputs=[user_state, graph_image]
)
# 自动滚动加载 JS
demo.load(
js="""
() => {
const container = document.querySelector('.gr-html');
... | Python | 1 |
# from PyPDF2 import PdfReader
from pdf2image import convert_from_bytes
from PIL import Image
import pytesseract
import io
# Manual path setup (Poppler + Tesseract)
POPPLER_PATH = r"C:\Users\mudas\Downloads\Release-24.08.0-0\poppler-24.08.0\Library\bin"
pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesser... | Python | 1 |
import pandas as pd
# Load the dataset
url = r'C:\Users\BezylMophatOtieno\source\repos\household_power_consumption_predictive_analysis\datasets\household_power_consumption.txt'
data = pd.read_csv(url, sep=';', parse_dates={'datetime': ['Date', 'Time']}, infer_datetime_format=True, low_memory=False)
# Function to calc... | Python | 1 |
// Verify each preprocessed compile param entry -- this will short circuit the build script if
// there are any errors
compile_params
.iter()
.map(verify_compile_params)
.collect::<Result<Vec<_>, CompileParamError>>()?;
// Any of the compilation steps failing will short circuit t... | Rust | 0 |
f64 {
match digits {
Some(digits) => {
let factor = 10_f64.powi(digits);
(number * factor).round() / factor
}
None => number.round(),
}
}
#[test]
fn pooled_variance() {
let x = vec![
134.0, 146.0, 104.0... | Rust | 0 |
# cook your dish here
n=int(input())
for i in range(n):
c=int(input())
l=[int(x) for x in input().split(' ')]
a1=max(l)
a2=min(l)
l.remove(max(l))
a3=max(l)
o=(a1-a2)*a3
print(o) | Python | 1 |
ger.merge_sources_into(vec![&mut c1, &mut c2, &mut c3], &mut buf)?;
/// assert_eq!(
/// std::str::from_utf8(&buf).unwrap(),
/// "header record 1 padding record 2 padding record 3 date created: 2000/01/01"
/// );
///
/// Ok(())
/// }
/// ```
pub fn pad_with... | Rust | 0 |
from django.shortcuts import render
from django.http import HttpResponse
def home(request):
return render(request, 'index.html') | Python | 1 |
,
body_indent: next_line_indent,
};
doctree = match doctree.push_data_and_focus(list_item_node) {
Ok(tree) => tree,
Err(tree) => {
return TransitionResult::Failure {
message: format!(
"Node insertion error o... | Rust | 0 |
'''“Given a string, find the length of the longest substring
that doesn’t contain any repeating characters.”
Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
'''
def longest_length_sub_string(chars: str):
n = len(chars)
start = 0
max_len = 0
check_chars = set()
f... | Python | 1 |
println!("routing 1");
for map_range in wad.iter_maps() {
println!("map: {:?}", map_range.name);
if let idchoppers::MapName::MAPxx(n) = map_range.name {
if n < 15 {
continue;
}
}
let bare_map = idchoppers::parse_doom_map(&wad, &map_range)?... | Rust | 0 |
5F, 0x6E, 3}
DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_IsConnected,
0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 5}
DEFINE_PROPERTYKEY!{PKEY_Devices_WiFiDirect_IsLegacyDevice,
0x1506935D, 0xE3E7, 0x450F, 0x86, 0x37, 0x82, 0x23, 0x3E, 0xBE, 0x5F, 0x6E, 7}
DEFINE_PROPERTYKEY!{PKEY... | Rust | 0 |
import cv2
import typer
from motion_planning.geometry_and_transforms import GeometryAndTransforms
from robot_inteface.robot_interface import RobotInterfaceWithGripper
from robot_inteface.robots_metadata import ur5e_1
from camera.realsense_camera import RealsenseCamera
from vision.image_block_position_estimator import I... | Python | 1 |
self.sendline('show mac-addr-table interface %s' % port_name)
tmp = self.expect(['--More--', prompt])
if tmp == 0:
self.sendline()
result = self.before.split('\n')
for line in result:
if ':' in line:
mac, vlan, _ = line... | Python | 1 |
from flask import Flask, request, jsonify
from app.scheduler import TaskScheduler, cpu_bound_task, io_bound_task
app = Flask(__name__)
scheduler = TaskScheduler()
@app.route("/")
def home():
return jsonify({"message": "Task Scheduler API is running!"})
@app.route("/execute", methods=["POST"])
def execute_task(... | Python | 1 |
return_codes.push(SubscribeReturnCodes::Failure)
} else {
return_codes.push(SubscribeReturnCodes::Success(qos(return_code & 0x3)?));
}
payload_bytes -= 1
}
Ok(Suback {
pkid: PacketIdentifier(pkid),
return_codes,
... | Rust | 0 |
U32(u) => &u.span,
U64(u) => &u.span,
},
}
}
// Copyright (c) 2014-2015 <NAME> <texitoi(a)texitoi.eu>
//
// This work is free. You can redistribute it and/or modify it under
// the terms of the Do What The Fuck You Want To Public License,
// Version 2, as published by Sam Hocevar. See the... | Rust | 0 |
class Stack:
def __init__(self):
self.items = []
def is_empty(self):
return len(self.items) == 0
def push(self, item):
self.items.append(item)
def pop(self):
if not self.is_empty():
return self.items.pop()
else:
raise IndexError("La pila... | Python | 1 |
# Generated by Django 5.0.3 on 2024-03-20 00:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0003_cart_code_cartproduct_code_category_code_and_more'),
]
operations = [
migrations.RemoveField(
model_name='enterprod... | Python | 1 |
x94, 0x86, 0xEF, 0x4C, 0xB3, 0x84, 0x2C, 0x85, 0x72, 0x02, 0xBF, 0xE4, 0x36, 0x22,
0xFE, 0xC9,
];
// TODO(kaczmarczyck) implement test for the min PIN length extension
// https://github.com/google/OpenSK/issues/129
let response = pin_protocol_v1.process_set_min_pin_length(
... | Rust | 0 |
# -*- coding: utf-8 -*-
from pymongo import MongoClient
from bson.objectid import ObjectId
#conn = MongoClient('192.168.1.9',27017)
conn = MongoClient('mongodb://192.168.1.9:27017/')
db = conn.mydb
# 插入一条文档
#rs =db.users.insert({"name":'xinping','province':'北京','age':25})
#print('user insert:{0}'.format(rs))
#插入多条文档... | Python | 1 |
roup!(benches, rsa,);
criterion_main!(benches);
<filename>src/lib/src/core/settings.rs
#[derive(Clone, Default)]
pub struct Settings {
pub debug: bool,
}
impl Settings {
pub fn set_debug(&mut self, debug: bool) {
self.debug = debug;
}
}
<reponame>simoneromano96/federation-graphql-rust
use paperclip... | Rust | 0 |
b aev: Index<Record, AEVT>,
pub vae: Index<Record, VAET>,
}
/// A structure designed to be stored in the backing store that enables
/// a process to locate the indexes, tx log, etc.
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct DbMetadata {
pub next_id: i64,
pub last_indexed_tx:... | Rust | 0 |
worker_starts: HashMap::default(),
worker_stops: HashMap::default(),
worker_names: HashMap::default(),
resource_registers: Vec::default(),
})
}
/// Adds a worker (without config) to the full node.
fn with_worker<W: Worker<FullNode<S>> + 'static>(self) -> Self
... | Rust | 0 |
import os
os.system("cls||clear")
#Criando uma lista
lista = []
#Adicionando elementos a lista
for i in range(3):
nota = float(input(f"Digite sua nota: "))
lista.append(nota)
#exibindo a lista
print()
for nota in lista:
print(nota) | Python | 1 |
bool = False, progress: bool = True, **kwargs: Any) -> ResNet:
r"""Wide ResNet-50-2 model from
`"Wide Residual Networks" <https://arxiv.org/pdf/1605.07146.pdf>`_.
The model is the same as ResNet except for the bottleneck number of channels
which is twice larger in every block. The number of channels in ... | Python | 1 |
2020_07: 2020, 7, 2020, 7, "0",
factor_employee_reduce_test_period_2020_08: 2020, 8, 2020, 8, "0",
factor_employee_reduce_test_period_2020_09: 2020, 9, 2020, 9, "0",
factor_employee_reduce_test_period_2020_10: 2020, 10, 2020, 10, "0",
factor_employee_reduce_test_period_20... | Rust | 0 |
nectAck {
session_present: true,
return_code: ConnectAckReason::BadUserNameOrPassword,
}
);
assert_decode_packet!(b"\xe0\x00", Packet::Disconnect);
}
#[test]
fn test_decode_publish_packets() {
//assert_eq!(
// decode_publish_pa... | Rust | 0 |
[inline(always)]
pub fn dbg_atten_monitor(&mut self) -> DBG_ATTEN_MONITOR_W {
DBG_ATTEN_MONITOR_W { w: self }
}
#[doc = "Bit 26 - ENB_SCK_XTAL"]
#[inline(always)]
pub fn enb_sck_xtal(&mut self) -> ENB_SCK_XTAL_W {
ENB_SCK_XTAL_W { w: self }
}
#[doc = "Bit 27 - INC_HEARTBEAT_R... | Rust | 0 |
",
"use",
"where",
"while",
"const",
"box",
];
#[derive(Serialize, Deserialize, Debug, Clone)]
enum Void {}
#[derive(Serialize, Deserialize, Debug, Clone, Default)]
pub struct TerraformSchemaExport {
provider_schemas: BTreeMap<String, Schema>,
format_version: String,
}
#[derive(Serialize,... | Rust | 0 |
y._parseXML(element)
parseXML = staticmethod(parseXML)
def _parsePKCS8(bytes):
p = ASN1Parser(bytes)
version = p.getChild(0).value[0]
if version != 0:
raise SyntaxError("Unrecognized PKCS8 version")
rsaOID = p.getChild(1).value
if list(rsaOID) != [6, 9, 42,... | Python | 1 |
};
assert_eq!(b.win_amount(*roll), Ok(win));
}
}
BetType::Lay => {
for point in [4, 5, 6, 8, 9, 10].iter() {
// vig is determined with vig_amount() and should be removed by ca... | Rust | 0 |
import math
def craftablePies(area, pieAreaList):
count = 0
for pie in pieAreaList:
count += pie//area
return count
def pinarySearch(high, friends, pieAreaList):
low = 0
mid = 0
topresult = 0
while low <= high:
if abs(mid - ((low + high) / 2)) <= 0.0001:
retur... | Python | 1 |
ccc c3",
"pick ddd c4"
);
assert_some_eq!(history.redo(&mut lines), (3, 2));
assert_todo_lines!(
lines,
"pick aaa c1",
"pick bbb c2",
"pick ccc c3",
"pick ddd c4",
"pick eee c5"
);
}
#[test]
fn undo_redo_swap_down_range_down_index_start() {
let mut history = History::new(10);
history.record(Histor... | Rust | 0 |
qK+sOkDUzyYkKkwG1QV152ELIUQS8iOJC
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// <KEY>
/// R8fgfCIegwB5PP81mtNBCDgHB9gUIV4dm/QfKc0A/4z00q3Cbwnhcq0bkU7ceIBqY1J5Y0rgKKmB
/// V0Jad+/ZPnO7XIOAU9SOct2F7qYL5CuDot25K/enn... | Rust | 0 |
import pandas as pd
import cv2
'''
This main is used for data manipulation to not enter data manually"
'''
data = [
{"banana_id": 1, "day": 0, "death_day": 11},
{"banana_id": 1, "day": 1, "death_day": 11},
{"banana_id": 1, "day": 2, "death_day": 11},
{"banana_id": 1, "day": 3, "death_day": 11},
... | Python | 1 |
from igraph import Graph
import numpy as np
graph = np.loadtxt('data/I210/graph.csv', delimiter=',')
od = np.loadtxt('data/I210/od.csv', delimiter=',')
# vertices = [i for i in range(7)]
# edges = [(0, 2), (0, 1), (0, 3), (1, 0), (1, 2), (1, 3), (2, 0), (2, 1),
# (2, 3), (3, 0), (3, 1), (3, 2), (2, 4), (4, 5)... | Python | 1 |
::new();
let _test_spec = new_test();
let genesis_gas = genesis_header().gas_limit().clone();
block_header.set_gas_limit(genesis_gas);
block_header.set_difficulty(U256::from(0x20000u64));
block_header.set_timestamp(40);
block_header.set_number(1);
block_header.set_parent_hash(genesis_header().hash());
block_he... | Rust | 0 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from .chat_completion_message import ChatCompletionMessage
__all__ = ["ChatCompletionStoreMessage"]
class ChatCompletionStoreMessage(ChatCompletionMessage):
id: str
"""The identifier of the chat message."""
| Python | 1 |
tart()].count('\n') + 1
name = m.group(2) if pat == 'objc_msg' else m.group(1)
call_node = self.create_node(
NodeType.CALL,
name=name,
code=m.group(0),
file_path=file_path,
start_line=start_li... | Python | 1 |
FlusterRenderer},
};
use fluster_graphics::FlusterRendererImpl;
use gl::{ReadPixels, BGRA, UNSIGNED_BYTE};
use iced::image::Handle as ImageHandle;
use palette::LinSrgb;
use pathfinder_canvas::CanvasFontContext;
use pathfinder_color::ColorF;
use pathfinder_geometry::vector::Vector2I;
use pathfinder_gl::{GLDevice, GLVer... | Rust | 0 |
rse_tensor::<f32>(line)?);
}
if logits.is_some() {
let mut outputs = state.run(inputs.clone())?.into_iter();
let logits_ = outputs.next().unwrap();
logits.take().unwrap().close_enough(&logits_, true).unwrap();
println!("chunk ok");
}
}
Ok(... | Rust | 0 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from sklearn.ensemble import RandomForestClassifier
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import log_loss
# ================== 数据读取 ==================
# 注意:请确保以下文件路径正确
medal_counts = pd.read_csv('summerOly_medal_coun... | Python | 1 |
#Viết chương trình sắp xếp một list gồm các số dương trước, tiếp theo là các số âm
def sapXepDuongAm(list):
listDuong = []
listAm = []
for i in list:
if i > 0:
listDuong.append(i)
else:
listAm.append(i)
return listDuong + listAm
list = [-2,-5,-6,1,3,2,5,6,-2,-10,-... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.