text string | label_name string | labels int64 |
|---|---|---|
# Copyright 2018 The TensorFlow 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 applica... | Python | 1 |
eTimeParts {
year: 2020,
month: Some(11),
day: Some(17),
hour: Some(8),
min: Some(41),
sec: Some(11),
..Default::default()
}
);
test_parse!(
"eq2020-11-17T09:41:11.123+... | Rust | 0 |
.atlassian.com/cloud/jira/platform/jira-entity-properties/).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub struct EntityProperty {
/// The key of the property. Required on create and update.
#[serde(rename = "key", skip_serializing_if = "Option::is_none")]
pub key: Option<String>,
/// ... | Rust | 0 |
_completion().expect("")
};
ret_hdr
}
fn allocate_resource(self: &ArefBorrow<Self>, format: hw::virtio_gpu_formats, width: u32, height: u32) -> Resource2D<I>
{
let hdr = hw::CtrlHeader {
type_: hw::VIRTIO_GPU_CMD_RESOURCE_CREATE_2D as u32,
flags: 0,
fence_id: 0,
ctx_id: 0,
_padding: 0,
};
... | Rust | 0 |
: Config) -> Result<(), Box<dyn Error>> {
let duration_from_epoch = SystemTime::now().duration_since(UNIX_EPOCH)?;
let seconds_from_epoch = duration_from_epoch.as_secs();
let counter = totp::calculate_counter(seconds_from_epoch, 0,30);
let secret = totp::hex::base_32_to_hex(&config.secret)?;
let cod... | Rust | 0 |
import xml.etree.ElementTree as ET
#Tạo root element:
Thong_tin_sinh_vien = ET.Element("Thong_tin_sinh_vien")
#Thêm thông tin sinh viên:
def them_sinh_vien(ma_sv, ten, ngay_sinh, lop, gioi_tinh):
student = ET.SubElement(Thong_tin_sinh_vien, "Student")
ma_sv_elem = ET.SubElement(student, "Mã sinh viên")
... | Python | 1 |
let _ = buf.write_f32::<LittleEndian>(self.position.0);
let _ = buf.write_f32::<LittleEndian>(self.position.1);
let _ = buf.write_f32::<LittleEndian>(self.uv.0);
let _ = buf.write_f32::<LittleEndian>(self.uv.1);
}
}
impl QuadVertex {
fn model() -> Vec<QuadVertex> {
let mut model... | Rust | 0 |
import math
exec(open("Modified_data/realtime.py").read())
# Initialize the position (CG) of the vehicle 3 meters about the
# surface of the water so that it drops into the water.
crewModule.dyn.position[0] = 0.0;
crewModule.dyn.position[1] = 0.0;
crewModule.dyn.position[2] = 3.0;
# Rotate the vehicle 120 degrees abo... | Python | 1 |
mut out = String::new();
#[allow(unused_mut)]
let mut writer = smithy_query::QueryWriter::new(&mut out, "DescribeExportTasks", "2016-11-15");
#[allow(unused_mut)]
let mut scope_2006 = writer.prefix("ExportTaskId");
if let Some(var_2007) = &input.export_task_ids {
let mut list_2009 = scope_20... | Rust | 0 |
pub to_self_delay: u16,
pub max_accepted_htlcs: u16,
pub channel_flags: u8,
}
#[cfg(feature = "serde")]
impl ToYamlString for Params {}
impl Params {
pub fn with(open_channel: &OpenChannel) -> Result<Self, NegotiationError> {
// TODO: Validate parameters according to BOLT-2 open_channel validation... | Rust | 0 |
message.channel_id.say(
&context.http,
"Bulk-editing stats values must be whole numbers, i.e. 1, 49, 0",
)?;
return Ok(());
}
};
character.set_value(parts[0], stat_value);
... | Rust | 0 |
"South Africa",
mobile_begin_with: &["6", "7", "8"],
phone_number_lengths: &[9],
};
pub const ISO3166_ZM: ISO3166 = ISO3166 {
alpha2: "ZM",
alpha3: "ZMB",
country_code: "260",
country_name: "Zambia",
mobile_begin_with: &["9"],
phone_number_lengths: &[9],
};
pub const ISO3166_ZW: ISO316... | Rust | 0 |
ticalLayout_2.addWidget(self.stackedWidget)
self.retranslateUi(DonatePrompt)
self.stackedWidget.setCurrentIndex(1)
QMetaObject.connectSlotsByName(DonatePrompt)
def retranslateUi(self, DonatePrompt):
self.label.setText(_p("DonatePrompt", "Hi! I hope you’re enjoying {app}.\n"
"\n"
"I... | Python | 1 |
100, point_ids_100, point_id_to_coords_100, 2*self.distance_100,'yellow', 'yellow')
fig.set_size_inches(image_width / 100.0, image_height / 100.0)
plt.subplots_adjust(top=1, bottom=0, left=0, right=1, hspace=0, wspace=0)
plt.margins(0, 0)
plt.savefig(save_path, dpi=100)
... | Python | 1 |
self.tokens.last_position();
let source_node = SourceNode {
source: c,
location: self.tokens.get_location_from(pos),
};
self.insert_node(AstNode::Comment(source_node));
}
fn parse_interpolation(&mut self, src: &'a str) {
let pos = self.tokens.last_positio... | Rust | 0 |
ap_err(),
Error::VertexDoesNotExist
);
// Test passed.
Ok(())
}
#[test]
fn connections() -> Result<(), Error> {
// Add three nodes.
let mut network: BTreeNetwork<usize> = BTreeNetwork::new();
network.add_vertex(0);
network.add_vertex(1);
... | Rust | 0 |
.0);
BigEndian::write_u64(&mut new_region[8..], guest_memory_size);
prop.set(&new_region);
}
_ => {},
}
FdtVisit::Node { .. } => {}
});
}
// Mask out entries from FDT and return some information about the ma... | Rust | 0 |
)
login_res = resp.json()
# Get session
return self.get_session_for_pc(redirect_url=login_res['toUrl'])
def login_by_access_token(self, access_token):
"""Login using access token"""
return self.get_session_for_pc(access_token=access_token)
def login... | Python | 1 |
"DATASET_ID": "{{ var.json.world_bank_wdi.dataset_id }}",
"GCS_BUCKET": "{{ var.value.composer_bucket }}",
"PIPELINE_NAME": "{{ var.json.world_bank_wdi.series_time.pipeline_name }}",
"TABLE_ID": "{{ var.json.world_bank_wdi.series_time.table_id }}",
"SCHEMA_FILEPATH": "{{... | Python | 1 |
cfg(feature = "aleosig")]
pub mod aleo;
pub mod bbs;
pub mod blakesig;
pub mod caip10;
pub mod caip2;
pub mod der;
pub mod did;
pub mod did_resolve;
#[cfg(feature = "keccak-hash")]
pub mod eip712;
pub mod error;
pub mod hash;
pub mod jsonld;
pub mod jwk;
pub mod jws;
pub mod jwt;
#[cfg(feature = "keccak-hash")]
pub mo... | Rust | 0 |
the pass.Use header fields
/// sparingly; unlike all other fields, they remain visible when a stack of passes are
/// displayed.
#[serde(rename = "headerFields")]
#[serde(skip_serializing_if = "Option::is_none")]
pub header_fields: Option<Vec<Field>>,
/// Fields to be displayed prominently on t... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright (C) 2006-2007 Søren Roug, European Environment Agency
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at you... | Python | 1 |
", subtitle_style),
Span::styled(
&m.flux.username,
Style::default()
.fg(Color::White)
.add_modifier(Modifier::BOLD),
),
]),
Spans::from(vec![
Span::styled("流量... | Rust | 0 |
# Benjamin West
from dotenv import load_dotenv
import os
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait, Select
from selenium.webdriver.support import expected_conditions as ec
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
import ti... | Python | 1 |
{
eprintln!("hyp rate 1 : {}, hyp rate 2 : {}",hypothesized_rate_one ,hypothesized_rate_two );
eprintln!("obs 1 : {}, obs 2 : {}",obs_rate_one,obs_rate_two);
}
if obs_rate_one == 0.0
{
//specific case of probability 0 | non-group rate and only t_one trials
... | Rust | 0 |
conds."
f" Check network connection."
)
await self._sleep(CONSTANTS.REST_API_LIMIT_COOLDOWN)
this_hour: pd.Timestamp = pd.Timestamp.utcnow().replace(minute=0, second=0, microsecond=0)
next_hour: p... | Python | 1 |
from .uchebnayadeyatelnost_stu__enie_studentuslushatelyu import (
UchebnayaDeyatelnostStudentuSlushatelyuOrganizatsiyaObucheniyaAnglijskomuYazyku11UchebnoeUpravlenieStudentuSlushatelyuEduDomainParser,
)
__all__ = [
"UchebnayaDeyatelnostStudentuSlushatelyuOrganizatsiyaObucheniyaAnglijskomuYazyku11UchebnoeUpravl... | Python | 1 |
i_side_effect)
# Set up executor to run the functions directly
mock_executor.return_value.__enter__.return_value.map = lambda func, args: [func(arg) for arg in args]
# Call method
outdated_libraries = self.library_manager.check_library_versions("cluster123")
... | Python | 1 |
let password_file_arg = format!("--pwfile={}/pwfile", &self.pg_settings.executables_dir.to_str().unwrap());
// determine which authentication method to use
let auth_host =
match &self.pg_settings.auth_method {
PgAuthMethod::Plain => {
... | Rust | 0 |
n_ret(request, ret, callback_param_name=None, use_iframe=False):
if ret==False:
ret = {'success':False}
elif ret==None: # Sometimes there is no return.
ret = {}
# Add the 'ret'=True, since it was obviously no set yet and we got valid data, no exception.
func_name = None
if callback_p... | Python | 1 |
return True
return False
def _init_is_better(self, mode, min_delta, percentage):
if mode not in {'min', 'max'}:
raise ValueError('mode ' + mode + ' is unknown!')
if not percentage:
if mode == 'min':
self.is_better = lambda a, best: a < best -... | Python | 1 |
from proto import CmdID
# auto-generated <3
DUMMY_MAP = {
CmdID.GetLevelRewardTakenListCsReq: CmdID.GetLevelRewardTakenListScRsp,
CmdID.GetRogueScoreRewardInfoCsReq: CmdID.GetRogueScoreRewardInfoScRsp,
CmdID.QueryProductInfoCsReq: CmdID.QueryProductInfoScRsp,
CmdID.GetQuestDataCsReq: CmdID.GetQuestData... | Python | 1 |
sample_animation(&raw_animation, -0.1, &mut output), true);
expect_float3_eq!(output[0].translation, -1.0, 0.0, 0.0);
expect_quaternion_eq!(output[0].rotation, 0.0, 0.0, 0.0, 1.0);
expect_float3_eq!(output[0].scale, 1.0, 1.0, 1.0);
expect_float3_eq!(output[1].translation, 2.0, 0.0, 0.0);... | Rust | 0 |
oxts = []
for filename in oxts_files:
with open(filename, 'r') as f:
for line in f.readlines():
line = line.split()
# Last five entries are flags and counts
line[:-5] = [float(x) for x in line[:-5]]
line[-5:] = [int(float(x)) for x... | Python | 1 |
anyonecanpay,
)
}
}
impl SpendTransaction {
/// Get a signature hash for an input, previous_txout's type is statically checked to be
/// acceptable.
pub fn signature_hash(
&self,
input_index: usize,
previous_txout: &UnvaultTxOut,
script_code: &Script,
) -> Si... | Rust | 0 |
SimpleLogger::new(LevelFilter::Warn, Config::default()),
WriteLogger::new(
LevelFilter::Info,
Config::default(),
File::create("my_rust_binary.log").unwrap(),
),
])
.unwrap();
*/
let mut root = VisualRoot::new();
let mut tb1 = Label::new();
tb1.set_text... | Rust | 0 |
\n"
f"Humidity: {humidity}%\n"
f"Wind Speed: {wind_speed} m/s\n"
f"Pressure: {pressure} hPa\n"
f"UV Index: {uvi}\n"
f"Air Quality Index: {aqi}")
self.label.setWordWrap(... | Python | 1 |
gain based on the length of the list.
///
/// # Panics
///
/// Panics if the value cannot be represented in the target type. This
/// cannot happen with values of the struct received from the X11 server.
pub fn events_len(&self) -> u32 {
self.events.len()
.try_into().unwrap()... | Rust | 0 |
AF_IEEE802154 as u16;
pub const AF_CAIF: u16 = libc::AF_CAIF as u16;
pub const AF_ALG: u16 = libc::AF_ALG as u16;
pub const IFLA_UNSPEC: u16 = 0;
pub const IFLA_ADDRESS: u16 = 1;
pub const IFLA_BROADCAST: u16 = 2;
pub const IFLA_IFNAME: u16 = 3;
pub const IFLA_MTU: u16 = 4;
pub const IFLA_LINK: u16 = 5;
pub const IFLA... | Rust | 0 |
import os
from PIL import Image
def read_captcha(path):
image_array = []
image_label = []
file_list = os.listdir(path) # 获取captcha文件
for file in file_list:
image = Image.open(path + '/' + file) # 打开图片
file_name = file.split(".")[0] # 获取文件名,此为图片标签
image_array.append(image)
... | Python | 1 |
tln!("{}", serialise_output(&(url, content), output_fmt));
} else {
let jsonv = serde_json::json!([
url,
{
"data_type": "SafeKey",
"xorname": xorname_to_hex(xorname)
}
... | Rust | 0 |
ird results if the predicates
// aren't as expected (i.e. self types = $0, projection
// predicates for a certain trait come after the Implemented
// predicate for that trait).
let mut first = true;
let mut angle_open = false;
for p in predicates.iter() {
match p {
GenericPre... | Rust | 0 |
impl Geometry for Cuboid {
fn get_id(&self) -> usize {
self.id
}
fn bounding_box(&self, _: Range<FSize>) -> Option<AABB> {
Some(self.aabb.clone())
}
fn hit(&self, ray: &Ray, t_range: Range<FSize>) -> Option<HitRecord> {
self.sides.hit(ray, t_range)
}
fn pdf_value(... | Rust | 0 |
df['DiseaseType'] = 1
df['TimezoneOffset'] = 0
df['EntryCreatedDateTime'] = pd.to_datetime(df['ObservationDateTime'])
# df.head()
RawName_to_dfRaw[RawName] = df
# ---------- process glucose_level --> ElogBGEntry
df = final_dfs['glucose_level']
RawName = 'ElogBGEntry'
raw_columns = ['B... | Python | 1 |
print('x y z w')
for x in range(2):
for y in range(2):
for z in range(2):
for w in range(2):
if ( (x<=y) and (z == (w<=x)) and (not w) ) == 1:
print(x, y, z, w)
#Ответ yxzw
| Python | 1 |
x, point.y) ;
// 通过使用结构更新语法 用我们另一个结构的字段来构造一个新点
let bottom_right = Point{
x: 5.2,
..point // 不允许一成不变的复制另一个结构体实例,意思就是说至少重新设定一个字段的值才能引用其他实例的值。
};
// 右下角的y坐标同第一个点 因为我们就用的那个点的y来构造的
println!("second point: ({}, {})", bottom_right.x, bottom_right.y);
// 使用`let`绑定来解构点
let Point{x... | Rust | 0 |
\xec\xd9\xb0\x09\xdd6Q\x8a\x06\xc27L\xcc\
\x84n\x1b\x11\x8d\xd09\xa1\xdbFD#tN\xe8\xb6\
YX\xd1<|+\xac\xec\xec\xa4*\x0b\xc7\xfa-\xb0\
\xdb\xbe\xe5\x9f\x8bh\x06J\x9da>|.<\xf0\xad\
N\xaa\xb2p\x1cq\x09\x9c\xfd\xee\xf2\xcfE4\x03D\
\xb2g\xfdR\xb7\xffC\xb7M\x94\xa2\x81\xf0\x0d\x13:\
1\xef\xff\x85\x15M\xccF\x1d\x02\xe2i\x02$t\x... | Python | 1 |
t, imageWidth):
img_arr = utils.img_b64_to_arr(imageData)
if imageHeight is not None and img_arr.shape[0] != imageHeight:
logger.error(
"imageHeight does not match with imageData or imagePath, "
"so getting imageHeight from actual image."
)
... | Python | 1 |
"]
#[inline(always)]
pub fn dtien3(&mut self) -> DTIEN3_W {
DTIEN3_W { w: self }
}
#[doc = "Bits 16:23 - Dead-time Low Side Outputs Value"]
#[inline(always)]
pub fn dtls(&mut self) -> DTLS_W {
DTLS_W { w: self }
}
#[doc = "Bits 24:31 - Dead-time High Side Outputs Value"]
... | Rust | 0 |
return Sites.Spotify_Playlist
if "bandcamp.com/track/" in url:
return Sites.Bandcamp
if "https://twitter.com/" in url:
return Sites.Twitter
if url.lower().endswith(config.SUPPORTED_EXTENSIONS):
return Sites.Custom
if "soundcloud.com/" in url:
return Sites.SoundC... | Python | 1 |
utils::*,
sprites::*,
};
pub fn draw_leaf_border(window: &mut Window, sprites: &mut Sprites, area: &Rectangle, leaf_w: f32, leaf_h: f32) {
let lv = DirectedSprite::VerticalLeaves;
let top = sprites.index(SpriteIndex::Directed(lv, Direction::North)).clone();
let mid = sprites.index(SpriteIndex::Directe... | Rust | 0 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np # type: ignore
import onnx
from ..base import Base
from . import expect
class DepthToSpace(Base):
@staticmethod
def export(): # type: () ... | Python | 1 |
()> {
let start = record
.position()
.map(i32::from)
.map(|n| n as u64)
.expect("record cannot be unmapped");
let reference_len = record.cigar().reference_len()? as u64;
let end = start + reference_len - 1;
let record_strand = Strand::from(record.flags());
for entry... | Rust | 0 |
from typing import List
class Solution:
def maximalRectangle(self, matrix: List[List[str]]) -> int:
# Check if the matrix is empty
if not matrix or not matrix[0]:
return 0
# Initialize variables for dimensions and maximum area
rows, cols = len(matrix), len(matri... | Python | 1 |
start + 1]));
right = Some(Rc::clone(&src_objects[start]));
}
}
_ => {
let mut part = Vec::new();
for i in start..end {
part.push(Rc::clone(&src_objects[i]));
}
part.s... | Rust | 0 |
staclesRes {
map: HashMap<Point<i32>, Obstacle>,
}
#[derive(Debug)]
pub struct PlayerPositionsRes {
pub value: Vec<Transform>,
}
// COMPONENTS
#[derive(Component)]
struct GameStateEntity;
#[derive(Debug, PartialEq)]
pub enum PlayerDirection {
Left,
Right,
}
#[derive(Component)]
pub struct Player {
... | Rust | 0 |
x in i[1] if '<strong' in x.content]) for i in s if i[0]]
s = [(i[0], re.findall('<.+?>(\d+)</.+?> (.+?)$', i[1][0])) for i in s if len(i[1]) > 0]
s = [(i[0], i[1][0]) for i in s if len(i[1]) > 0]
s = [(i[0], int(i[1][0]), re.findall('Episode (\d+... | Python | 1 |
"""
CommandLine:
pytest tests/test_nms.py
"""
import numpy as np
import torch
from mmdet.ops.nms.nms_wrapper import nms
def test_nms_device_and_dtypes_cpu():
"""
CommandLine:
xdoctest -m tests/test_nms.py test_nms_device_and_dtypes_cpu
"""
iou_thr = 0.7
base_dets = np.array([[49.1, 32... | Python | 1 |
, partition_cfg),
RomSegment::from_vec(0x10000, fw_image),
// TODO: generate from dts
RomSegment::from_slice(0x1f8000, RO_PARAMS),
];
Ok(segments)
}
}
pub struct Solution {}
// Definition for singly-linked list.
#[derive(PartialEq, Eq, Clone, Debug)]
pub struct ... | Rust | 0 |
h1.neighbors(n)) for n in neighs]
neighs = [i for i in chain.from_iterable(neighs)]
bus_map[rem_bus] = bus_map[[neigh for neigh in neighs if neigh in bus_map][0]]
continue
neigh2 = set()
closest_neighbour = -1
for n1 in neigh1:
if ... | Python | 1 |
_7: c_int = 16778999;
pub const GDK_KEY_Farsi_8: c_int = 16779000;
pub const GDK_KEY_Farsi_9: c_int = 16779001;
pub const GDK_KEY_Farsi_yeh: c_int = 16778956;
pub const GDK_KEY_Favorites: c_int = 269025072;
pub const GDK_KEY_Finance: c_int = 269025084;
pub const GDK_KEY_Find: c_int = 65384;
pub const GDK_KEY_First_Virt... | Rust | 0 |
bined()-1;
self.hl.set_combined(new_hl);
}
0xcb => { // Special multibyte instructions
let special_op = self.read_u8_at_pc(memory);
debug!("Special opcode: {:#x}", special_op);
match special_op {
0x40 ... 0x7f =>... | Rust | 0 |
e(transform) = node.attribute(Attribute::GradientTransform.to_str()) {
gradient_transform = transform.to_string();
did_transform = true;
}
}
if spread_method.is_none() {
spread_method = SpreadMethod::from_str(
... | Rust | 0 |
fn reject_already_rejected_spend_proposal_fails() {
new_test_ext().execute_with(|| {
Balances::make_free_balance_be(&Treasury::account_id(), 101);
assert_ok!(Treasury::propose_spend(Origin::signed(0), 100, 3));
assert_ok!(Treasury::reject_proposal(Origin::root(), 0));
assert_noop!(Treasury::reject_proposal(Or... | Rust | 0 |
1 = |index: usize, matrix: &[Seat]| {
(!seat_not_occupied(index + &RIGHT, matrix)) as u8
+ (!seat_not_occupied(index + &DOWN, matrix)) as u8
+ (!seat_not_occupied(index + &LEFT, matrix)) as u8
+ (!seat_not_occupied(index + &UP, matrix)) as u8
+ (!seat_not_occupied... | Rust | 0 |
oo(x);
// }
// fn foo(mut x: Foobar) {
// x.0 = 2; // changes the 0th value inside the product
// println!("{:?}", x);
// }
// Copying & Cloning
// fn uses_foobar(foobar: Foobar) {
// println!("I consumed a Foobar: {:?}", foobar);
// }
// fn main() {
// let x = Foobar(1);
// uses_foobar(x.clone(... | Rust | 0 |
}
if fields_are_named {
format_string.push_str(" {{ ");
} else {
format_string.push('(');
}
let mut stmts = vec![];
let mut is_first = true;
for (index, field) in fields.iter().enumerate() {
if is_first {
is_first = false;
} else {
fo... | Rust | 0 |
}
}
sleep_times
});
}
sleep_times_by_guard
}
#[aoc(day4, part1)]
pub fn solve_part1(records: &[Record]) -> u32 {
let sleep_times_by_guard = get_sleep_times_by_guard(records);
let guard_with_max_minutes = sleep_times_by_guard
.iter()
.max_by_... | Rust | 0 |
"""
This module provides functions for gathering data.
"""
# Created by Wenjie Du <wenjay.du@gmail.com>
# License: BSD-3-Clause
import numpy as np
import torch
def gather_listed_dicts(dict_list: list) -> dict:
"""Gather batched dict output from model forward
Parameters
----------
dict_list:
... | Python | 1 |
!(p.volta("install node@12.12.0"), execs().with_status(0));
assert_that!(p.volta("install elm@elm0.19.0"), execs().with_status(0));
assert!(p.shim_exists("elm"));
assert_that!(
p.exec_shim("elm", "--version"),
execs().with_status(0).with_stdout_contains("0.19.0")
);
}
<filename>crates/... | Rust | 0 |
from dataclasses import dataclass
from typing import List
from nix_prefetch_github.interfaces import (
CommandLineView,
PrefetchFailure,
PrefetchResult,
RepositoryRenderer,
ViewModel,
)
from nix_prefetch_github.prefetch import PrefetchedRepository
@dataclass
class PresenterImpl:
view: Command... | Python | 1 |
PROTO`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum USB_TXTYPE7_PROTOR {
#[doc = "Control"]
USB_TXTYPE7_PROTO_CTRL,
#[doc = "Isochronous"]
USB_TXTYPE7_PROTO_ISOC,
#[doc = "Bulk"]
USB_TXTYPE7_PROTO_BULK,
#[doc = "Interrupt"]
USB_TXTYPE7_PROTO_INT,
}
impl USB_TXTYPE7_PROTOR {
#[... | Rust | 0 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | Python | 1 |
let mut net = Net::with_procs(3, 5, &mut rng);
let segregated_elder = net.procs.pop().unwrap();
// p0 is a bad node and the network is really bad for the segregated elder so he's not connected yet
// p0 makes 2 proposals:
// - 1 for the elders to see
// - 4 for the segregated elder
let p0 = net... | Rust | 0 |
trainable=self.conv_expand.weight.requires_grad)
cx["h"], cx["w"] = h, w
return cx
class MBConv(nn.Module):
def __init__(self,
kernel_size: int,
input_c: int,
out_c: int,
expand_ratio: int,
... | Python | 1 |
64;
pub const MASTERSERVER_PORT: u16 = 8300;
pub const MASTERSERVER_7_PORT: u16 = 8283;
const HEADER_LEN: usize = 14;
pub type Header = &'static [u8; HEADER_LEN];
pub const REQUEST_LIST_5: Header = b"\xff\xff\xff\xff\xff\xff\xff\xff\xff\xffreqt";
pub const REQUEST_LIST_6: Header = b"\xff\xff\xff\xff\xff\xff\xf... | Rust | 0 |
m] = features_t.cpu().numpy().flatten()
# Concatenate modalities for this time step t
if (
"s1" in embeddings_modalities_t
and "s2l1c" in embeddings_modalities_t
):
combined_embedding_t =... | Python | 1 |
id_boot_volume_size(
self
):
boot_volume_size = 100
mock_flavor = mock.MagicMock()
mock_flavor.name = 'test_flavor'
mock_flavor.id = 'test_flavor_id'
mock_flavor.disk = 0
mock_flavors = [mock_flavor]
mock_nova = mock.MagicMock()
mock_nova.flavo... | Python | 1 |
_atomic_caps)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ibv_device_attr_ex>())).xrc_odp_caps as *const _ as usize },
392usize,
concat!(
"Offset of field: ",
stringify!(ibv_device_attr_ex),
"::",
stringify!(xrc_odp_caps)
... | Rust | 0 |
import allure
import pytest
from src.constants.api_constants import APIConstants
from src.helpers.api_requests_wrapper import *
from src.helpers.common_verification import *
from src.helpers.payload_manager import *
from src.utils.utils import Utils
class TestE2E(object):
@allure.title("E2E - Create Booking -> U... | Python | 1 |
import requests
import pandas as pd
from bs4 import BeautifulSoup as bs
url = 'https://www.amazon.in/s?k=mobiles&crid=1SEDW4KDKBZ9Y&sprefix=mobiles%2Caps%2C226&ref=nb_sb_noss_1'
cookies = {
'session-id': '257-9365134-4691452',
'session-id-time': '2082787201l',
'i18n-prefs': 'INR',
'ubid-acbin': '262-0... | Python | 1 |
)
}
}
d.deserialize_seq(V)
}
fn de_opt_duration<'de, D>(d: D) -> Result<Option<Duration>, D::Error>
where
D: Deserializer<'de>,
{
serde_humantime::De::deserialize(d).map(|d| d.into_inner())
}
<reponame>emirayka/nia_server
use crate::error::{from_protobuf_error, NiaServerError, NiaServerResult}... | Rust | 0 |
MPI_INF_3DHP_KEYPOINTS = [
'spine_3',
'spine_4_3dhp',
'spine_2',
'spine_extra', # close to spine2
'pelvis_extra',
'neck_extra', # throat
'head_extra',
'headtop',
'left_clavicle_3dhp',
'left_shoulder',
'left_elbow',
'left_wrist',
'left_hand_3dhp',
'right_clavicle... | Python | 1 |
import pygame
from plane_sprites import *
class PlaneGame(object):
"""飞机大战主游戏"""
def __init__(self):
print("游戏初始化")
# 1. 创建游戏的窗口
self.screen = pygame.display.set_mode(SCREEN_RECT.size)
# 2. 创建游戏的时钟
self.clock = pygame.time.Clock()
# 3. 调用私有方法,精灵和精灵组的创建
... | Python | 1 |
DRAWFIXED, 0x0010
OWNERDRAWVARIABLE, 0x0020
AUTOHSCROLL, 0x0040
OEMCONVERT, 0x0080
SORT, 0x0100
HASSTRINGS, 0x0200
NOINTEGRALHEIGHT, 0x0400
DISABLENOSCROLL, 0x0800
UPPERCASE, 0x2000
LOWERCASE, 0x4000
}
pub_struct_const! { CC, u32,
/// [`CHOOSECOLOR`](crate::CHOOSECOLOR) `Flags` (`u32`).
=>
/... | Rust | 0 |
import sys
import sqlparse
# raw = ""
# while True:
# try:
# raw += f"{input()}\n"
# print(len(raw))
# except:
# break
raw = open(sys.argv[1], "r").read()
statements = raw.split(';')
num_characters = 0
num_tokens = 0
def count_nodes(parsed_stmt):
return sum([
1 if not tok... | Python | 1 |
(&board)) {
// println!(
// "{}",
// draw.parse::<usize>().unwrap() *
// board
// .into_iter()
// .flatten()
// .filter_map(|s| match s.parse::<usize>() {
// Ok(num) => Some(num),
// Err(_) => None,
// ... | Rust | 0 |
from iterators import define_iterator, classify_iterator, generate_iterator, edit_iterator
from potemkin_rates import print_potemkin_rate_by_task
from pprint import pprint
# Example usage of the four main iterators
if __name__ == '__main__':
# Example 1: Define task
iterator = define_iterator()
row, in... | Python | 1 |
og_constants.OPT_LR_DECAY_START_STEP,
value=args.lr_decay_start,
)
mllogger.event(
key=mllog_constants.OPT_LR_DECAY_STEPS,
value=args.lr_decay_steps,
)
dist.barrier()
if is_rank_zero:
mllogger.start(key=mllog_constants.INIT_STOP)
dist.barr... | Python | 1 |
namic_label()
}
fn get_offset(&self) -> AssemblyOffset {
self.offset()
}
fn get_jmp_instr_size(&self) -> u8 {
4
}
fn emit_u64(&mut self, x: u64) {
self.push_u64(x);
}
fn emit_label(&mut self, label: Self::Label) {
dynasm!(self ; => label);
}
f... | Rust | 0 |
ed {
message: format!("{} is missing", TEXT_MAP_TRACE_ID_FIELD),
});
}
if span_id.is_none() {
return Err(SpanContextCorrupted {
message: format!("{} is missing", TEXT_MAP_SPAN_ID_FIELD),
});
}
if sampled.is_none() {
... | Rust | 0 |
import cv2
from flask import Flask, Response
app = Flask(__name__)
vc = cv2.VideoCapture('rtmp://your_rtmp_stream')
def gen():
while True:
r, frame = vc.read()
if not r:
break
else:
ret, buffer = cv2.imencode('.jpg', frame)
frame = buffer.tobytes()
... | Python | 1 |
cute(self, func, *args, **kwargs):
"""
Run the given function on the main thread, wait for its results and return those.
"""
with self._main_loop_lock:
if self._main_loop_stopped:
raise RuntimeError(
"Cannot schedule executions on the main ... | Python | 1 |
get_delta_time();
// unwrap() is ok, since transition.is_some()
let transition = self.transition.as_mut().unwrap();
match transition.process(&delta_time) {
TransitionStateOut::Finished(s) => {
self.shared
.lock()
... | Rust | 0 |
0x2f),
Self::LightGreen => (0x67, 0xcb, 0x57),
Self::SunshineYellow => (0xfb, 0xfb, 0x76),
Self::Yellow => (0xfd, 0xd0, 0x00),
Self::Orange => (0xf4, 0x67, 0x2c),
Self::Brown => (0x8c, 0x3a, 0x0a),
Self::Violet => (0x69, 0x3d, 0xae),
S... | Rust | 0 |
_col))))
agg_data = np.concatenate(data_list, axis=1)
processed_data[jlabel] = {
'KPI_Label': jlabel,
'Pod_Name': plabel_list,
'KPI_Feature': jaeger_col,
'Sequence': agg_data,
'time': sorted(list(ct))
}
np.save(metric_file, process... | Python | 1 |
)
.unwrap(),
"a {\
\n b: 1px;\
\n}\
\n"
);
}
use rand::{Rng, SeedableRng, prelude::StdRng};
pub fn simulated_binary_crossover(parent1: f32, parent2: f32, operator: f32, seed: Option<u64>) -> (f32, f32) {
let mut prng = match seed {
Some(val) => StdRng::seed_from_... | Rust | 0 |
put)
self._additional_info["last_policy_output"] = self.initial_policy_output
self.cutoff_time = DEFAULT_SPOT_ROLLOUT_CUTOFF_TIME
@property
def nu(self) -> int:
"""Number of controls for this task."""
return 10
@property
def actuator_ctrlrange(self) -> np.ndarray:
... | Python | 1 |
encrypt(
&self,
recipients: &[(&str, PublicKey)],
data: &PrivateData,
mut header_builder: block::header::Builder,
) -> SecretStoreResult<PublicData> {
let mut rng = thread_rng();
let mut tag = [0u8; TAG_LENGTH];
let seal_key = SecretBytes::random(&mut rng, 32);
let mut nonce = [0u8; 1... | Rust | 0 |
| tr '[:lower:]' '[:upper:]'); \
// echo "pub const SYSCALL_$b: SyscallNR = SyscallNR::new($c);"; \
// echo ; \
// done < ./arch/x86/include/generated/uapi/asm/unistd_64.h
// ```
/// read()
pub const SYSCALL_READ: Num = Num(0);
/// write()
pub const SYSCALL_WRITE: Num = Num(1);
/// open()
pub const SYSCALL_O... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.