text
string
label_name
string
labels
int64
self._fixture['escape_out_raw'] = b'int_value\nascii\nbin\nprintable\n378\nutf8\n' self._fixture['escape_out_print'] = b'int_value\nascii\nbin\nprintable\n378\nutf8\n' self._fixture['escape_out_utf8'] = b'int_value\nascii\nbin\nprintable\n378\nutf8\n' self._fixture['escape_out_base64'] = b'int_...
Python
1
d] g = sorted([(prob, id) for prob,id in zip(p,i)], key=lambda x: x[0] if x[1] <= 0x10FFFF else 0, reverse=True) prob,idx = g[0] if idx <= 0x10FFFF: c = chr(idx) else: c = None print(prob, idx, c) print(feature[0,:,y,x].max(), feature[0,:,y,x].min(...
Python
1
t iter = IntoIter { first, last, size }; for _ in 0..(size + 1) / 2 { let _ = iter.next(); let _ = iter.next_back(); } assert!(iter.next().is_none()); } test_into_iter(9); test_into_iter(10); } #[test] fn miri_test...
Rust
0
of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF A...
Rust
0
import sys import os from PyQt5.QtWidgets import (QApplication, QMainWindow, QWidget, QVBoxLayout, QHBoxLayout, QTextEdit, QPushButton, QLabel, QFileDialog, QGroupBox, QSpinBox, QLineEdit, QMessageBox, QCheckBox) class GammaCipherApp(QMainWindow): def __in...
Python
1
et projects: {response.status_code}" ) result = response.json() for project in result.get("value", []): project_api_url = project.get("url") project_name = project.get("name") project_web_url = self._get_we...
Python
1
, foo test_type_name);", ); run_query( session, "INSERT INTO test_udt_keyspace.test_table (id, foo) VALUES (1, {foo: 'yes', bar: 1})", ); } fn test_drop_udt(session: &Session) { run_query( session, "CREATE TYPE test_udt_keyspace.test_type_drop_me (foo text, bar int)", ...
Rust
0
-8') df['entryid'] = df['entryid'].astype(str) df['Link_ID'] = df['entryid'].str[7:] df = df[df['Link_ID'] == TARGET_LINK_ID].copy() print(f"Rows after filtering: {len(df)}") df['start_d_ts'] = df['stopinfo'].apply(extract_start_ts_and_distance) df.to_csv(OUTPUT_FILE, index=False) print(f"P...
Python
1
amera, texture.0, source_rec, center.into(), size, tint.into()); } } /// Detects collision between two spheres. #[inline] pub fn check_collision_spheres(center_a: impl Into<Vector3>, radius_a: f32, center_b: impl Into<Vector3>, radius_b: f32) -> bool { unsafe { raylib::CheckCollisionSpheres(center_a.in...
Rust
0
Atividade 04: Contagem Regressiva de 10 a 1: Desenvolva um programa que use um laço for para fazer uma contagem regressiva de 10 até 1 e, em seguida, exiba "Feliz Ano Novo!".
Python
1
false, val: LibcConst::MS_NODEV as u32}), ("diratime", Mapping{set: false, val: LibcConst::MS_NODIRATIME as u32}), ("dirsync", Mapping{set: true, val: LibcConst::MS_DIRSYNC as u32}), ("exec", Mapping{set: false, val: LibcConst::MS_NOEXEC as u32}), ("noexec", Ma...
Rust
0
x0b, 0xd8, 0x76, 0x73, 0x72, 0xd1, 0x45, 0x40, 0x2c, 0xdc, 0x61, 0x4c, 0xec, 0xef, 0x0c, 0x30, 0x33, 0xe8, 0x04, 0xe5, 0xe5, 0xa0, 0x42, 0xd6, 0xdc, 0x0d, 0xd3, 0x1f, 0x93, 0x07, 0x8c, 0x88, 0x37, 0x27, 0xb7, 0x11, 0xd7, 0x48, 0xfd, 0x71, 0xb6, 0xd6, 0x00, 0x88, 0x19, 0x2...
Rust
0
() -> HittableList { let mut objects = HittableList::new(); let checker = CheckerTexture::from_colors((Color::new((0.2, 0.3, 0.1)), Color::new((0.9, 0.9, 0.9)))); objects.add(Arc::new(Sphere::new( Point3::new((0., -10., 0.)), 10., Arc::new(Lamberti...
Rust
0
: Allocator<T, D>, { assert_eq!(x.len(), x0.len()); assert_eq!(x0.len(), displacements.len()); for (v, v0, d) in izip!(x, x0, displacements) { *v = v0 + d; } } /// Takes an iterator of indices that yields unsorted, possibly duplicate indices /// and maps the indices to a new set of indices [0, ...
Rust
0
self.join_3 = LiftedLiftedJoin( self.lift_integrated_stream_a.output_handle(), self.delayed_integrated_stream_b.output_handle(), self.p, self.f, ) self.join_4 = LiftedLiftedJoin( self.input_stream_handle_a, self.lift_delayed_integr...
Python
1
* cm line5 = f"诊断:{self.data.get('诊断', '')}" c.drawString(2 * cm, self.y_position, line5) datestring = f"日期:{self.data.get('日期时间', '')}" datestring_width = c.stringWidth(datestring, self.font_name, 13) c.drawRightString(self.page_width - 2 * cm, self.y_position, datestring) ...
Python
1
&str = "float"; const SM_TYPE_DOUBLE: &str = "double"; const SM_TYPE_BIGINTEGER: &str = "bigInteger"; const SM_TYPE_BIGDECIMAL: &str = "bigDecimal"; // basic-shapes const SM_TYPE_BLOB: &str = "blob"; const SM_TYPE_STRING: &str = "string"; const SM_TYPE_TIMESTAMP: &str = "timestamp"; const SM_TYPE_DOCUMENT: &str = "doc...
Rust
0
ne, end_line) # Ensure end_line is not before start_line class JsonParser(LanguageParser): """JSON language parser factory""" def create_element_detector(self) -> JsonElementDetector: """Create a JSON-specific element detector""" return JsonElementDetector() def get_file_extensions(self) ...
Python
1
t( "--output_path_report", help="path for saving evaluation summary (.json)" ) args = parser.parse_args() input_path_target = args.input_path_target input_path_predicted = args.input_path_predicted output_path_report = args.output_path_report # Read the JSON file input # json_predi...
Python
1
t_data=json.dumps({ 'type': 'message', 'text': text })) else: logger.error(f"响应格式异常: {response_data}") await self.send(text_data=json.dumps({ 'type': 'error', ...
Python
1
}) } #[doc = "Bit 1 - Monitors the interrupt flag of TIMER1."] #[inline] pub fn gflag1(&self) -> GFLAG1R { GFLAG1R::_from({ const MASK: bool = true; const OFFSET: u8 = 1; ((self.bits >> OFFSET) & MASK as u32) != 0 }) } #[doc = "Bit 2 -...
Rust
0
HbFont((*engine).font)); if !grFace.is_null() && !grFont.is_null() { if !grSegment.is_null() { gr_seg_destroy(grSegment); grSegment = 0 as *mut gr_segment; grPrevSlot = 0 as *const gr_slot } let mut grFeatureValues: *mut gr_feature_val = gr_face_featureval...
Rust
0
t=input() inp=open(f"ios/{t}.in","r").read() inpl=inp.split('\n') inpl[1]=inpl[1].split(' ') inpl[2]=inpl[2].split(' ') print("====input============") print(inp) ou=open(f"ios/{t}.out","r").read() ou=ou.split(" ") print("====output===========") print(ou) ans=open(f"ios/{t}.ans","r").read() ans=ans.split(" ") print("...
Python
1
P2p/3P2p1/2PN4/PP2Q1PP/3R1R1K b - - 8 27", vec![ "e7c5", "f7f1", "a7a6", "a7a5", "b6a4", "b6a8", "b6c4", "b6d7", "c8b8", "c8c7", "c8d7", "c8d8", "e7d8", "e7d6", "e7f6", "e7g5", "e7h4", "f8d8", "f8e8", "f8g8", "f8h8", "f7f6", "f7f5", "f7f4", "f7f3", "f7f2", "f7...
Rust
0
suggested_indent, ); } } } <gh_stars>1-10 use vk::ValueKey; use nk::NodeKey; use rwinstructs::security::SecurityDescriptor; use rwinstructs::timestamp::{WinTimestamp}; #[derive(Serialize,Debug)] pub struct Record { pub fullpath: String, pub nk_last_written: WinTimestamp, pub ...
Rust
0
scaffolds = ', '.join([str(s.id) for s in scaffold.subscaffolds]) if self.args.sdf: molecule = MolFromSmiles(scaffold.smiles) if molecule is not None: molecule.SetProp('_Name', str(scaffold.id)) molecule.SetIntProp('HIERARCHY', scaffold.hierarchy) ...
Python
1
Assigner()) # Source original_stream = env.add_source(original_kafka_consumer, type_info=Types.STRING()).assign_timestamps_and_watermarks(watermark_strategy) # Save each record to MinIO original_stream.map(S3MinIOSinkBronze(), output_type=Types.STRING()) # Apply windowing logic, process by locat...
Python
1
import pprint from django.core.management.base import BaseCommand from devilry.apps.core.models.period import Period from devilry.devilry_account.models import AssignmentGuidelinesLookupError, PeriodUserGuidelineAcceptance class Command(BaseCommand): help = 'Show assignment guidelines - for debugging matching in...
Python
1
if not isinstance(obj, dict): return cls.model_validate(obj) _obj = cls.model_validate( { "activeHealthCheck": ( ActiveHealthCheck.from_dict(obj["activeHealthCheck"]) if obj.get("activeHealthCheck") is not None ...
Python
1
@staticmethod def read_calib(calib_path): """ :param calib_path: Path to a calibration text file. :return: dict with calibration matrices. """ calib_all = {} with open(calib_path, 'r') as f: for line in f.readlines(): if line == '\n': break ...
Python
1
492689060539222513, // 31^-60 12805516430937677459, // 31^-54 10584427946771654325, // 31^-48 17497164689077279120, // 31^-42 14462320197950402007, // 31^-36 11953862767183809017, // 31^-30 9880491726141866768, // 31^-24 16333484606893641287, // 31^-18 13500477850600094178, // 31^-12 ...
Rust
0
he gradients norm_type (float or int): type of the used p-norm. Can be ``'inf'`` for infinity norm. """ parameters = list(parameters) max_norm = float(max_norm) norm_type = float(norm_type) if norm_type == float('inf'): total_norm = max(p.grad.data.abs().max() for p in parameters) ...
Python
1
#copyright (c) 2019 PaddlePaddle Authors. All Rights Reserve. # #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 l...
Python
1
@property def is_opk(self) -> bool: """Whether the format has (omega, phi, kappa) orientation.""" return self is CsvFormat.xyz_opk or self is CsvFormat.lla_opk class RpcRefine(_StrChoiceEnum): """RPC refinement method.""" shift = 'shift' """Pixel coordinate translation.""" s...
Python
1
from pathlib import Path from .threedmatch_config import make_cfg as make_3dmatch_cfg from .threedlomatch_config import make_cfg as make_3dlomatch_cfg from .scannetpp_iphone_config import make_cfg as make_scannetpp_iphone_cfg from .scannetpp_faro_config import make_cfg as make_scannetpp_faro_cfg from .tiers_config impo...
Python
1
): """Создаёт граф зависимости в формате DOT и сохраняет в файл.""" print("Создание графа зависимостей...") dot = Digraph(comment="Git Dependency Graph", format="png") # Добавляем узлы и связи в граф for commit, parents in self.dependencies.items(): dot.node(commit, ...
Python
1
// closure from the buttons vector. let mut layout = LinearLayout::vertical(); for button in buttons.drain(..) { layout.add_child(button); } AsyncState::Available(layout) } ...
Rust
0
# PROVA # Desenvolva um programa em Python para calcular a média de notas de alunos em uma disciplina. # O programa deve solicitar ao usuário o número de alunos e, em seguida, para cada # aluno, pedir o nome e três notas. Utilize um loop 'for' para iterar sobre os alunos e suas notas. # Além disso, implemente uma e...
Python
1
import frappe def execute(): recoverable = ("QueryDeadlockError", "QueryTimeoutError", "JobTimeoutException") failed_reposts = frappe.get_all( "Repost Item Valuation", fields=["name", "error_log"], filters={ "status": "Failed", "docstatus": 1, "modified": (">", "2022-04-20"), "error_log": ("is", ...
Python
1
}; let mean_h = water.mean_height(); let mut aabb_transform = Transform::default(); aabb_transform.translation.x = WATER_SIZE / 2.0; aabb_transform.translation.y = WATER_SIZE / 2.0; build_barrier( &mut commands, ...
Rust
0
', '\u{32}', '\u{33}', '\u{34}', '\u{35}', '\u{36}', '\u{37}', '\u{38}', '\u{39}', '\u{3a}', '\u{3b}', '\u{3c}', '\u{3d}', '\u{3e}', '\u{3f}', '\u{40}', '\u{61}', // \u{41} -> a '\u{62}', // \u{42} -> b '\u{63}', // \u{43} -> c '\u{64}', // \u{44} -> d '\u{65}', // \u{45} -> e '\u{66}', // \u{46} -...
Rust
0
t None: x = x.clip_by_value(min=self.clip_values[0], max=self.clip_values[1]) return x, y def _check_params(self) -> None: if not (isinstance(self.window_size, int) and self.window_size > 0): raise ValueError("Sliding window size must be a positive integer.") if se...
Python
1
_ClientToken: 用于保证请求幂等性的字符串。该字符串由客户生成,需保证不同请求之间唯一,最大值不超过64个ASCII字符。若不指定该参数,则无法保证请求的幂等性。 :type ClientToken: str :param _HostName: 云服务器的主机名。<br><li>点号(.)和短横线(-)不能作为 HostName 的首尾字符,不能连续使用。</li><br><li>Windows 实例:主机名字符长度为[2, 15],允许字母(不限制大小写)、数字和短横线(-)组成,不支持点号(.),不能全是数字。</li><br><li>其他类型(Linux 等)实例:主机名字符长度为[...
Python
1
ed from user input. Luckily slices of parameters are supported, too. //! //! ```no_run //! use odbc_api::Environment; //! //! let env = unsafe { //! Environment::new()? //! }; //! //! let mut conn = env.connect("YourDatabase", "SA", "<<PASSWORD>>")?; //! let params = [1980, 2000]; //! if let Some(cursor) = conn.exe...
Rust
0
l Clone for Text { #[inline] fn clone(&self) -> Self { let id = Uuid::new_v4(); if !self.hidden { self.sender.send(TextEvent { id, layer: self.layer, kind: TextEventKind::Created(Box::new(self.raw.to_weak())), }); }...
Rust
0
']} {envs['time']}" elif envs['mode'] == 'cron': cron = croniter.croniter( envs['cron_val'], datetime.datetime.now()) t = cron.get_next(datetime.datetime).strftime( "%Y-%m-%d %H:%M:%S") else: raise Exception(...
Python
1
fn put_ConnectDenied( pVal: VARIANT_BOOL, ) -> HRESULT, fn get_DeniedFrom( pVal: *mut DATE, ) -> HRESULT, fn put_DeniedFrom( pVal: DATE, ) -> HRESULT, fn get_DeniedTo( pVal: *mut DATE, ) -> HRESULT, fn put_DeniedTo( pVal: DATE, ) -> HRESUL...
Rust
0
if let Some(var_903) = &input.ip_v4_addresses { let mut array_904 = object.key("IpV4Addresses").start_array(); for item_905 in var_903 { { array_904.value().string(item_905); } } array_904.finish(); } if let Some(var_906) = &input.ip_v6_add...
Rust
0
Self { match node.kind() { $( stringify!($node_ident) => $enum_name::$ast_type($ast_type::new(source, node)), )* _ => unreachable!(), } } } } } define_ast_node!(SourceFile, [defi...
Rust
0
StatusCode::NotFound => "NotFound".into(), StatusCode::Complete => "Complete".into(), StatusCode::UnknownStatusCode => "UnknownStatusCode".into(), } } } pub type Result<T> = core::result::Result<T, Error>; #[derive(Debug, Clone)] pub struct Error { pub code: StatusCode, ...
Rust
0
self.btn_rm.setIcon(icon1) self.btn_rm.setObjectName("btn_rm") self.verticalLayout.addWidget(self.btn_rm) spacerItem3 = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding) # ludwig modified self.verticalLayout.addItem(spacerItem3) self....
Python
1
= bytes.iter().map(|b| { match b { 48 => 0, 49 => 1, _ => 0, // TODO: ERROR } }).collect::<Vec<u8>>(); compiled.push(Node::NumberLiteral{kind: NumberLiteralKind::Binary, bytes: bin_bytes}); } parser::Node::OctalLiteral{bytes} =>...
Rust
0
cursor.execute(insert_course_query, (course[0], student_id)) conn.commit() # 更新課表人數 update_query = "UPDATE Course SET curNumOfSelect = curNumOfSelect + 1 WHERE course_id = %s" cursor.execute(update_query, (course[0],)) conn.commit() return True ...
Python
1
unlock_oracle_stakes(origin, oracleaccount: T::AccountId) -> dispatch::DispatchResult { // verify it's a signed transaction let sender = ensure_signed(origin)?; // removes the stakes let oracle_stakes = <OracleStakes<T>>::take(&oracleaccount,&sender); // unlo...
Rust
0
og(&self) -> CLRDATATOG_R { CLRDATATOG_R::new(((self.bits >> 7) & 0x01) != 0) } #[doc = "Bit 6 - 6:6\\] This bit is set when a STALL handshake is transmitted. An interrupt is generated when this bit is set. Software should clear this bit."] #[inline(always)] pub fn sentstall(&self) -> SENTSTALL_...
Rust
0
chema_manager.get_schema(schemaspace, resource) except (ValidationError, ValueError, SchemaNotFoundError) as err: raise web.HTTPError(404, str(err)) from err except Exception as err: raise web.HTTPError(500, repr(err)) from err self.set_header("Content-Type", "applicatio...
Python
1
onst BYTES_IN_LONG: usize = 1 << LOG_BYTES_IN_LONG; pub const LOG_BITS_IN_LONG: usize = LOG_BITS_IN_BYTE + LOG_BYTES_IN_LONG; pub const BITS_IN_LONG: usize = 1 << LOG_BITS_IN_LONG; pub const LOG_BYTES_IN_DOUBLE: usize = 3; pub const BYTES_IN_DOUBLE: usize = 1 << LOG_BYTES_IN_DOUBLE; pub const LOG_BITS_IN_DOUBLE: usize...
Rust
0
FromIterator; use crossbeam_epoch; #[cfg(feature = "rayon")] use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, ParallelIterator}; use crate::raw::config::Trivial as TrivialConfig; use crate::raw::{self, Raw}; /// A concurrent lock-free set. /// /// Note that due to the limitations descri...
Rust
0
ty) => { #[derive(Clone, Debug)] pub struct $struct_name {} impl Codec for $struct_name { type P = $primitive_type; fn compress_atoms(&self, primitives: &[$primitive_type]) -> CoreResult<Vec<u8>> { let compressor = RawQCompressor::<$primitive_type>::from_config(CompressorConfig { ...
Rust
0
Acceptor, Reader, Writer, IoResult}; use kinds::Send; use rt::rtio::{IoFactory, LocalIo, RtioUnixListener}; use rt::rtio::{RtioUnixAcceptor, RtioPipe}; /// A stream which communicates over a named pipe. pub struct UnixStream { obj: PipeStream, } impl UnixStream { fn new(obj: ~RtioPipe:Send) -> UnixStream { ...
Rust
0
push(Mat::M(Metal::new(Color::of(0.7, 0.6, 0.5), 0.0))); p += 1; world.push(Sphere { center: Point3::of(4.0, 1.0, 0.0), radius: 1.0, mat_ptr: p, }); (world, materials) } fn main() { // Image let aspect_ratio = 16.0 / 9.0; let image_width = 800; let image_height ...
Rust
0
if (self.box_lasttime_in[index] == False): print(f"目标 {class_name} 第一次进入判定范围") self.box_in[index] = True if type == 1: if (self.box_lasttime_in[index] == False): ...
Python
1
j while 0 <= ni < board.size and 0 <= nj < board.size and test_board.board[ni][nj] == player: count += 1 ni -= di nj -= dj if count >= 5: return True return False def _evaluate_board(self, board): "...
Python
1
.') return queries.tolist() else: rng = np.random.default_rng(0) query_attrs = np.empty((query_num, query_dimensions), dtype=int) for j in range(query_num): query_attrs[j] = rng.choice(len(domain_sizes), query_dimensions, replace=False) query_domains = domain_size...
Python
1
assert_eq!(device_frequent_very_high_rx_drop.len(), 1); assert_eq!(device_frequent_very_high_rx_drop[0].payload, MetricEventPayload::Count(1)); let very_high_tx_drop_time_ratios = test_helper .get_logged_metrics(metrics::TIME_RATIO_WITH_VERY_HIGH_TX_PACKET_DROP_METRIC_ID); assert_eq...
Rust
0
T = int(input()) for _ in range(T): N = int(input()) A = map(int, input().strip().split()) even_wrong = 0 odd_wrong = 0 for i, n in enumerate(A): if i % 2 == 0 and n % 2 != 0: even_wrong += 1 elif i % 2 == 1 and n % 2 != 1: odd_wrong += 1 if even_wrong...
Python
1
map_value: Callable[[str, Any], Any], ) -> list[tuple[str, str, str]]: env1_set, env2_set = set(env1_vars), set(env2_vars) # First, compare the set of keys in each vars dictionary. if env1_set != env2_set: raise NotEqualError( "field set mismatch:", ...
Python
1
l': 'http://%s/feeds/atom.xml' % (config.host,), 'hub.mode': 'publish', }) response = urlfetch.fetch(hub_url, data, urlfetch.POST) if response.status_code / 100 != 2: raise Exception("Hub ping failed", response.status_code, response.content) generator_list.append(AtomContentGenerator) class P...
Python
1
=> Mode::parse(msg)?.into(), _ => msg.clone().into(), }; Ok(out) } } parse! { RoomState { tags, channel } => |msg: &'t Message<'t>| { msg.expect_command("ROOMSTATE")?; Ok(Self { channel: msg.expect_arg(0)?, tags: msg.tags.clone() }) ...
Rust
0
on::from_value::<Pandoc>(json!({ "pandoc-api-version": [PANDOC_API_VERSION[0], PANDOC_API_VERSION[1] + 1], "meta": {}, "blocks": [], })) .is_err()); } } use std::sync::Arc; use http::{Request, Response, Uri}; use crate::error::ConsumerError; #[async_trait] pub ...
Rust
0
{ Less => { out.push(*a); i += 1; } Greater => { out.push(*b); j += 1; } Equal => { out.push(*a); i += 1; j += 1; } } } ...
Rust
0
!(scope, || { let local_port = base_port.fetch_add(1, Ordering::Relaxed); let s = t!(UdpSocket::bind(("0.0.0.0", local_port as u16))); // t!(s.set_write_timeout(Some(Duration::from_secs(io_timeout)))); // t!(s.set_read_timeout(Some(Duration::from_secs(io_t...
Rust
0
import re from typing import List from nonebot.adapters.onebot.v11 import MessageEvent, GroupMessageEvent from nonebot.message import event_preprocessor from tortoise.queryset import Q from LittlePaimon.config import config from LittlePaimon.database import CommandAlias, AliasMode @event_preprocessor async def hand...
Python
1
""" An ultra fast cross-platform multiple screenshots module in pure python using ctypes. This module is maintained by Mickaël Schoentgen <contact@tiger-222.fr>. You can always get the latest version of this module at: https://github.com/BoboTiG/python-mss If that URL should fail, try contacting the author. """ f...
Python
1
ulated = function() { var height = $(window).height(); var switchDistance = height * HEIGHT_RATIO; var normalized = Math.abs(ACCUMULATED_SCROLL / switchDistance); var easing_ratio = easingFunction(normalized); $('#page-wrapper').velocity('stop').velocity({ translateY: -(CURRENT...
Rust
0
self.up_1 = PSPUpsample(1024, 256) self.up_2 = PSPUpsample(256, 64) self.up_3 = PSPUpsample(64, 64) self.final = nn.Conv2d(64, 32, kernel_size=1) def forward(self, x): f = self.feats(x) p = self.psp(f) p = self.up_1(p) p = self.drop(p) p = self.up_2(p...
Python
1
with open('txt/24_1866.txt') as file: st = file.readline() while 'ad' in st or 'da' in st: st = st.replace('ad', 'a d').replace('da', 'd a') st = st.split() print(len(max(st, key=len)))
Python
1
me(".fmt"); let fmt_out = OutputHandleWrapper::open(&out_name, 0); if fmt_out.is_none() { abort!("cannot open format output file \"{}\"", out_name); } let mut fmt_out_owner = fmt_out.unwrap(); let fmt_out = &mut fmt_out_owner; t_print_nl!( "Beginning to dump on file {}", ...
Rust
0
# NOME = Rafaelle Arruda print("======================") print("= BANCO TOMORROWLAND = ") print("======================") # define uma lista com 5 elementos para guardar a quant., das cédulas de 100 a 5 qtd_cedulas = [0]*5 cedulas = [100, 50, 20, 10, 5] saldo = int(input("Informe o saldo do cofre: ")) while(saldo < 0...
Python
1
character -- and // set the control variables appropriately. let ret = std::str::from_utf8(&self.contents[start_idx..end_idx]).unwrap(); self.read_index = end_idx + 1; self.reads_available -= 1; self.previous_read_size = max; // There's a trick here. What happens if we _...
Rust
0
test_u2_shortPred_batch[n+1] = test_u2_next_batch test_z_next_ae_batch = cgkn.autoencoder.encoder(test_u2_next_batch) test_z_concat_next_ae_batch = test_z_next_ae_batch.reshape(-1, dim_z) test_u_extended_initial_batch = torch.cat([test_u1_concat_next_batch, test_z_concat_next...
Python
1
s gap for observe regions" ) .unwrap(); pub static ref RTS_RESOLVED_FAIL_ADVANCE_VEC: IntCounterVec = register_int_counter_vec!( "tikv_resolved_ts_fail_advance_count", "The count of fail to advance resolved-ts", &["reason"] ) .unwrap(); pub static ref RTS_SCAN_DURATION_HI...
Rust
0
ct: [0x8c,0xce,0xbb,0x32,0x41,0x45,0xef,0xed,0x61,0xc8,0x58,0xa8,0x60,0x5f,0x4f,0x2e,] }, Aes128Test { key: [0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,], pt: [0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,0x55,], ct: [0x7...
Rust
0
t_batch_generator(dev_data_generator, places=place) if worker_index == 0: print("Final validation result:") outputs = evaluate(args, test_exe, test_prog, test_pyreader, test_graph_vars, "dev", worker_num, worker_index, data_reader=dev_data_reader) if worke...
Python
1
<bool> where F: AsRef<Vec<FrameBuffer>>, { Ok(match self { Renderer::Vulkan(r) => { r.draw_data(render_pipeline, clear_values, draw_data, frame_buffers)? } Renderer::None => false, }) } } <reponame>ywatanabee/libipt-rs<gh_stars>1-10...
Rust
0
change the stand-by mode of the PHY (USB pads) and the PHY is forced out of stand-by mode. This bit must be 1 as well as the stand-by control from the USB controller, before the mode of the PHY is stand-by."] #[inline(always)] pub fn usb_stb(&self) -> USB_STB_R { USB_STB_R::new((self.bits & 0x01) != 0)...
Rust
0
isplay(&[0x4f, 0x0f, 0x5e, 0x01], "divps xmm8, [r9]"); test_display(&[0xf3, 0x4f, 0x0f, 0x5e, 0x01], "divss xmm8, [r9]"); test_display(&[0x4f, 0x0f, 0x5f, 0x01], "maxps xmm8, [r9]"); test_display(&[0xf3, 0x4f, 0x0f, 0x5f, 0x01], "maxss xmm8, [r9]"); test_display(&[0x0f, 0x70, 0x00, 0x7f], "pshufw mm0, ...
Rust
0
ward_stars( self, user_id: int, task_id: int, quality_score: int, task_difficulty: str = "easy", force_award: bool = False ) -> StarsAward: """ Начисляет звезды пользователю за решение задачи Args: user_id: ID пользовате...
Python
1
simple_query("SELECT 1"); // tokio::time::timeout(Duration::from_secs(60), query) // let inner_client = &self.client; // self.connection.block_on(async { // let trivial_query = inner_client.simple_query(""); // tokio::time::timeout(timeout, trivial_query) // ...
Rust
0
0xf) as u8) } // [3:0] } #[doc="Returns true if ADDSET != 0"] #[inline] pub fn test_addset(&self) -> bool { self.addset() != 0 } #[doc="Sets the ADDSET field."] #[inline] pub fn set_addset<V: Into<::bobbin_bits::U4>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U4 =...
Rust
0
_RevisionNumber, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 9} DEFINE_PROPERTYKEY! {PKEY_Document_Security, 0xF29F85E0, 0x4FF9, 0x1068, 0xAB, 0x91, 0x08, 0x00, 0x2B, 0x27, 0xB3, 0xD9, 19} DEFINE_PROPERTYKEY! {PKEY_Document_SlideCount, 0xD5CDD502, 0x2E9C, 0x101B, 0x93, 0x97, 0x08, 0x00, ...
Rust
0
s), ('exam_id.start_time', '<', self.end_time), ('exam_id.end_time', '>', self.start_time), ('exam_id.state', 'not in', non_conflict_exam_states), ('exam_id', '!=', self.exam_id.id) ]) if booked_rooms: booked_room_names = ', '.join(booked_room...
Python
1
from scipy.spatial.distance import * import scipy.io as sio import numpy as np #mat = sio.loadmat('../exact_match_closest_view_indices_1to100.mat') #print mat #closest_view_indicies = mat['closest_view_indices'] #closest_view_indicies = closest_view_indicies.squeeze() #print closest_view_indicies #print closest_view_i...
Python
1
from flask import Flask, request from flask_restx import Resource, Api from prometheus_flask_exporter import PrometheusMetrics metrics = PrometheusMetrics.for_app_factory() def create_app(): app = Flask(__name__) metrics.init_app(app) with app.app_context(): setup_api(app) metrics.regi...
Python
1
lf.send(get_callback_query_answer.as_ref()) } pub fn get_chat<C: AsRef<GetChat>>(&self, get_chat: C) -> RTDResult<()> { self.send(get_chat.as_ref()) } pub fn get_chat_administrators<C: AsRef<GetChatAdministrators>>(&self, get_chat_administrators: C) -> RTDResult<()> { self.send(get_chat_administrators...
Rust
0
env.env_color(EnvironmentColor::Accent).unwrap().darkened(0.05) } else if *hovered { env.env_color(EnvironmentColor::Accent).unwrap().lightened(0.05) } else { env.env_color(EnvironmentColor::Accent).unwrap() } }); PlainButton::new( ZStack::new(vec![ R...
Rust
0
meta, packet_data: contents, }) } } <gh_stars>1-10 //! [CRC16][1] implementations. //! //! [1]: https://en.wikipedia.org/wiki/CRC-16 pub mod crc16; pub use self::crc16::Crc16; <gh_stars>0 use serde::Deserialize; #[derive(Deserialize, Debug)] pub struct Price { pub max_price: i32, pub ...
Rust
0
n(children) and children[i + 1].type == "image" and children[i + 2].type == "link_close" ): # Image wrapped in link i += 3 else: # Non-image content found return False return True ...
Python
1
from . import networking import logging import random import sys import gevent LOGGER = logging.getLogger(__name__) sub_map = {} sub_lock = set() def substitute_ip(client, dst_black_list): if client.dst_ip not in sub_map: gevent.spawn(fill_sub_map, client.host, client.dst_ip) return False if ...
Python
1
.clone(); let additional_len = rng.gen_range(0, SEGMENT_SIZE / 3); value.append(&mut vec![0u8; additional_len]); batch.insert(u32_to_vec(key), value); } } db.apply_batch(batch).unwrap(); } let mut i = verify_batches(&db); i += 1; ...
Rust
0