text
string
label_name
string
labels
int64
define_print! { ('tcx) ty::ProjectionPredicate<'tcx>, (self, f, cx) { debug { print!(f, cx, write("ProjectionPredicate("), print(self.projection_ty), write(", "), print(self.ty), write(")")) } ...
Rust
0
class MonteCarloTreeSearchBasedPlayer(): def __init__(self, game, nnet, args): """ Args: game: OthelloGame instance Instance of the OthelloGame class above; nnet: OthelloNet instance Instance of the OthelloNNet class above; args: dictionary Instantiates number of ite...
Python
1
rdr) // .unwrap_or_else(|()| panic!("Can't parse tls certificate file: {}", cert_filename)) // }; // let key = { // let mut pkcs8 = { // let file = File::open(&key_filename) // .unwrap_or_else(|e| panic!("Can't open tls key file: '...
Rust
0
total_time = end_time - start_time average_time = total_time / num_iterations print(f"Average inference time for input: {average_time:.6f} seconds") # Main function to handle different commands if __name__ == '__main__': if len(sys.argv) < 2: print("Usage:") print("python CNNclassify...
Python
1
from refo import finditer, Predicate, Star, Any, Disjunction import re # encoding UTF-8 """ 这是一个多行注释。 你可以在这里写很多行, 它们都不会被执行。 """ ''' 本代码设置问题模板。将自然语言问题转化为可查询的SPARQL语句 模板内容如下: 1. XX会议的参会人员有谁? 2. XX会议包括什么内容? 3. XX会议发生于什么时间? 4. XX会议举办于什么地点? 5. XX人物就职于什么组织? 6. XX决议通过的内容有几个? 7. XX决议通过XX内容吗? 8. XX会议发生于XX时间吗? 9. XX人物就职于XX组织吗? ...
Python
1
import pygame, sys, random WIDTH, HEIGHT = 800, 600 BLUE, BROWN, GREEN, WHITE, GOLD = (80, 120, 255), (139, 69, 19), (0, 150, 0), (255, 255, 255), (255, 215, 0) player = pygame.Rect(50, HEIGHT-150, 30, 50) # HEIGHT-150 -> HEIGHT-90 velocity_y = 0 isJumping = False gravity = 0.5 jumpStrength = 12 moveSpeed = 5 PLATFO...
Python
1
#!/usr/bin/env python3 # Copyright (c) Facebook, Inc. and its affiliates. # This source code is licensed under the Creative Commons license found in the # LICENSE file in the root directory of this source tree. from habitat.config.default import get_config def get_dataset_config( dataset_path, data_subset, max_...
Python
1
::*; use ::*; // TODO: redefine Debug so only initial bytes of BytesMut are printed, and printed in hex /// Data packet for block read|write. Note that `header.data_len == data.len()` #[derive(Debug, PartialEq, Clone)] pub struct BlockDataPacket { pub header: PacketHeaderProto, pub checksum: Bytes, pub dat...
Rust
0
fied": bool(user_info.get("verified", False)), "exp": user_info.get("exp"), "level": user_info.get("level"), "characters": json.loads(user_info.get("characters", '[]')) if isinstance(user_info.get("characters"), str) else user_info.get("characters", [""]), ...
Python
1
se jormungandr_lib::{crypto::hash::Hash, interfaces::Block0Configuration}; use jormungandr_testing_utils::wallet::Wallet; use rand::prelude::*; use rand_chacha::ChaChaRng; use std::collections::HashMap; pub struct VoteRoundGenerator { block0: Block0Configuration, block0_hash: Hash, wallets: HashMap<Address...
Rust
0
() -> ::protobuf::descriptor::FileDescriptorProto { ::protobuf::Message::parse_from_bytes(file_descriptor_proto_data).unwrap() } pub fn file_descriptor_proto() -> &'static ::protobuf::descriptor::FileDescriptorProto { file_descriptor_proto_lazy.get(|| { parse_descriptor_proto() }) } use crate::{ ...
Rust
0
)) } } pub fn find_in_slice<T: Eq>(haystack: &[T], needle: &[T]) -> Option<usize> { // naive algorithm only meant for small needles if needle.len() > haystack.len() { return None; } for i in 0..=haystack.len() - needle.len() { let mut matching = true; for j in 0..nee...
Rust
0
''' Abbreviation Extension for Python-Markdown ========================================== This extension adds abbreviation handling to Python-Markdown. Simple Usage: >>> import markdown >>> text = """ ... Some text with an ABBR and a REF. Ignore REFERENCE and ref. ... ... *[ABBR]: Abbreviation ...
Python
1
_fields: sample = oversized_fields[:5] errors.append( MetadataValueError( f"Oversized metadata fields: {', '.join(sample)}" f"{'...' if len(oversized_fields) > 5 else ''}", f"Metadata field values must not exceed {MAX_JS...
Python
1
# **************************************************************************** # # # # ::: :::::::: # # main.py :+: :+: :+: ...
Python
1
collected_attributes.update(_set_job_attributes(job_ref)) if attributes: collected_attributes.update(attributes) final_attributes = {k: v for k, v in collected_attributes.items() if v is not None} return final_attributes def _set_client_attributes(client): return {"db.name": client.proj...
Python
1
Data::Struct(ref fields, _) => { format_struct_struct(context, struct_parts, fields, offset, one_line_width) } } } pub(crate) fn format_trait( context: &RewriteContext<'_>, item: &ast::Item, offset: Indent, ) -> Option<String> { if let ast::ItemKind::Trait(trait_kind) = &item.ki...
Rust
0
# Copyright 2015 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
#!/usr/bin/env python3 #Ip_portatil= 192.168.68.117 #Ip_router=192.168.68.1 --> mac_router= 6c:5a:b0:c9:9e:90 #mi_mac= 50-E0-85-AA-31-D3 import scapy.all as scapy import argparse import signal import sys from termcolor import colored def signal_handler(signal,frame): print(colored("\nDeteniendo ARP spoofing y r...
Python
1
/// (<subquery>)`. struct Desugarer<'a> { scx: &'a StatementContext<'a>, status: Result<(), PlanError>, recursion_guard: RecursionGuard, } impl<'a> CheckedRecursion for Desugarer<'a> { fn recursion_guard(&self) -> &RecursionGuard { &self.recursion_guard } } impl<'ast> VisitMut<'ast, Raw> ...
Rust
0
"Offset of field: ", stringify!(st_mysql_cmd_buffer), "::", stringify!(length) ) ); } pub type MYSQL_CMD_BUFFER = st_mysql_cmd_buffer; #[repr(C)] #[derive(Copy, Clone)] pub struct st_mysql_error_info { pub error_no: ::std::os::raw::c_uint, pub error: [::...
Rust
0
13, 0x1d, 0x47, 0x49, 0x5b, 0x55, 0x7f, 0x71, 0x63, 0x6d, 0xd7, 0xd9, 0xcb, 0xc5, 0xef, 0xe1, 0xf3, 0xfd, 0xa7, 0xa9, 0xbb, 0xb5, 0x9f, 0x91, 0x83, 0x8d, ]; #[cfg(test)] mod tests { use super::*; use crate::hex; use quickcheck_macros::quickcheck; #[test] fn test_encrypt_decrypt_128() { ...
Rust
0
import base64 from Crypto.Cipher import AES from django.conf import settings def encrypt(value): """Return the encrypted value of the setting. Uses the character '\0' as padding. <target> """ cipher = AES.new(settings.SITE_SETTINGS_KEY, AES.MODE_ECB) value = unicode(value).encode('utf-8') </targe...
Python
1
<<Self as frame_system::Config>::Event>; /// A dispatchable call. type Call: Parameter + Dispatchable<Origin=Self::Origin> + GetDispatchInfo + From<frame_system::Call<Self>>; /// The currency trait. type Currency: ReservableCurrency<Self::AccountId>; /// Handler for the unbalanced decrease when fees are burne...
Rust
0
import torch import torch.nn as nn import torch.nn.functional as F from pytorch3d.transforms import quaternion_multiply, quaternion_to_matrix from scipy.stats import multivariate_normal from scipy.linalg import sqrtm import numpy as np # waterstein distance of two gaussians modified by Junli class WassersteinGaussi...
Python
1
import asyncio import json from bot.logger import logger async def ping_market_loop(ws): try: while not ws.closed: await asyncio.sleep(30) if ws.closed: break try: ping_message = {"method": "PING"} await ws.send_json(ping_...
Python
1
, #[doc = "0x118 - Interrupt Flag Set Register"] pub ifs: IFS, #[doc = "0x11c - Interrupt Flag Clear Register"] pub ifc: IFC, #[doc = "0x120 - I/O Routing Register"] pub route: ROUTE, #[doc = "0x124 - Input Sense Register"] pub insense: INSENSE, #[doc = "0x128 - Configuration Lock Re...
Rust
0
BUCKET_CAP: i64 = 100; const DIGITS_PER_BUCKET: usize = 2; /// An unbounded, unsigned integer. /// /// # Internal Representation /// `BigUint` is represnted internally by a `Vector<i64>`. /// Each index of the vector (referred to as a `bucket`) contains /// up to 2 digits of a number, with the highest-order digits...
Rust
0
# -*- coding: utf-8 -*- # pylint: disable=attribute-defined-outside-init from tcms.rpc.tests.utils import APIPermissionsTestCase from tcms.testplans.models import PlanType from tcms.tests.factories import PlanTypeFactory from tcms.xmlrpc_wrapper import XmlRPCFault class TestPlanTypeFilter(APIPermissionsTestCase): ...
Python
1
{ fn can_parse(mut data: &[u8]) -> bool { let _visibility = parse!(data, Visibility); data.starts_with(b"enum") } } impl Parse for Enum { fn parse(mut data: &[u8]) -> (&[u8], Self) { let visibility = parse!(data, Visibility); assert!(data.starts_with(b"enum")); dat...
Rust
0
role = threads.THREADS[q]['role'] # Skip queues that have their data already preloaded if threads.THREADS[q]['preload'] and data.loaded: continue refs = [] for idx in self.visible_rows['source_rows']: # I...
Python
1
if nbr.GetAtomicNum() == 17: chlorine_count += 1 # Allow oxygen if it appears to be -OH (has at least one implicit H) elif nbr.GetAtomicNum() == 8 and nbr.GetTotalNumHs() > 0: continue # Allow a carbon if it is part of another isol...
Python
1
_FUNC121_IN_SEL`"] pub struct GPIO_FUNC121_IN_SEL_W<'a> { w: &'a mut W, } impl<'a> GPIO_FUNC121_IN_SEL_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: u8) -> &'a mut W { self.w.bits = (self.w.bits & !0x1f) | ((value as u32) & 0x1f); self...
Rust
0
et_token(operation_config.token_credential_resource()) .await .map_err(list_by_subscription::Error::GetTokenError)?; req_builder = req_builder.header(http::header::AUTHORIZATION, format!("Bearer {}", token_response.token.secret())); } url.query_pairs_mut().app...
Rust
0
at = slot.interned_at; db.salsa_runtime().report_query_read( slot.database_key_index, INTERN_DURABILITY, interned_at, ); Ok(value) } fn durability(&self, _db: &Q::DynDb, _key: &Q::Key) -> Durability { INTERN_DURABILITY } fn entries<C>...
Rust
0
rue' or 'false' else: params['%s.%s' % (label, k)] = v def _make_request(self, action, verb, path, params): params['ContentType'] = 'JSON' response = self.make_request(action=action, verb='POST', path='/', params=params) body ...
Python
1
import os import requests from datetime import datetime, timedelta import pytz from dotenv import load_dotenv # Load environment variables load_dotenv() API_KEY = os.getenv('FOOTBALL_API_KEY') def get_next_matchday_matches(): # Fetch all matches with relevant statuses response = requests.get( "https:...
Python
1
)), _, ) = response { if let Ok(UpdateState::Updated) = result { trace!( nonce, "write_setting notify", "setting_type"...
Rust
0
import pytest from unittest.mock import Mock, patch from routers.costs import calculate_final_cost, find_resource_types from fastapi.testclient import TestClient from main import app client = TestClient(app) class TestCostCalculation: """コスト計算機能のテストクラス""" def test_find_resource_types_simple(self): ...
Python
1
def envolve(population,fitness): #print("initial fitness = ",fitness) selected_population, parents_fitness = select_order(population, fitness) #从上一代中挑出50个 p = parents_fitness #kids = mutate(selected_population, N_KID) for i in range(10): id = random.ran...
Python
1
sociated documentation files (the // "Software"), to deal in the Software without restriction, including // without limitation the rights to use, copy, modify, merge, publish, // distribute, sublicense, and/or sell copies of the Software, and to // permit persons to whom the Software is furnished to do so, subject to /...
Rust
0
cadena=("hola sergio cometrabas cabron") cadena=[x for x in cadena.title().split()] print(cadena)
Python
1
); assert_eq!(allocator.num_allocated_chunks, 3); } #[test] fn allocate_then_deallocate() { let mem = make_memory(); let allocation_size = Bytes::from(16u64); let allocator_addr = Address::from(0); let mut allocator = Allocator::new(mem.clone(), allocator_a...
Rust
0
in2vis=q_main2vis, q_vis2main=q_vis2main, config=config, local_map_default_on=False, mesh_default_on=mesh_on, neural_point_map_default_on=config.neural_point_map_default_on, ) gui_process = mp.Process(target=slam_gui.run, args=(params_gui,)) ...
Python
1
x=True) }}", Extraction::populate( Some(vec![("x".to_string(), None)]), Some(vec![("package".to_string(), "table".to_string())]), Some(configs), ), ); } // TODO wow this needs a refactor. get some helpers in here. #[test] fn extracts_from_deepyly_nested_config()...
Rust
0
from datetime import datetime import numpy as np import os import torch import random from models.model import CNN_cifar,LeNet_mnist,CNN_fmnist,resnet20 from sklearn.cluster import KMeans from models.resnet50 import resnet50 def model_init(dataset,device): if dataset=='MNIST': model = LeNet_mnist().to(devi...
Python
1
ority storage. fn pending_priority() -> *const AtomicU8; /// Returns a raw pointer to the thread priority storage. fn priority(&self) -> *const AtomicU8; /// Sets the `thr_idx` thread pending. /// /// See [the trait level documentation](SoftThread) for details. /// /// # Safety ///...
Rust
0
Key, iv: &[u8], extra: &[u8], ) -> Box<dyn MessageEncrypter>; } /// A `MessageEncrypter` for AES-GCM AEAD ciphersuites. TLS 1.2 only. struct GcmMessageEncrypter { enc_key: aead::LessSafeKey, iv: Iv, } /// A `MessageDecrypter` for AES-GCM AEAD ciphersuites. TLS1.2 only. struct GcmMessageDe...
Rust
0
import json from nimbus import __version__ from nimbus.requests import NimbusCommandRequest EXAMPLE_TAG = "??? example" def generate_web_examples(command: str, param: dict | None = None) -> str: return f""" {EXAMPLE_TAG} "Example" {generate_web_shell_example(command, param)} {generate_web_httpx_example(...
Python
1
#!/usr/bin/env python3 """ Launcher for clang which computes the dependency for the file being compiled. """ import sys import os import subprocess import time import json import tempfile import fcntl TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) def trim_clang_args_in_cdb(cdb): """Trim -Xclang options...
Python
1
m affineIndex affine index to use (if < 0 or > 31 the sprite will be unrotated)"] #[doc = " \\param sizeDouble if affineIndex >= 0 this will be used to double the sprite size for rotation"] #[doc = " \\param hide if non zero (true) the sprite will be hidden"] #[doc = " \\param vflip flip the spr...
Rust
0
import numpy import os import math import numpy as np def parse_file(file_path): with open(os.path.join(file_path)) as f: lines = f.read().splitlines() return lines def operations(secret_number): secret_number = (secret_number * 64) ^ secret_number secret_number = secret_number % 16777216 ...
Python
1
object_mut().unwrap()) } None => { // Otherwise, initialize `nest_result` to result. result } }; (nest_result, term_definition.container) } None => (result, Container::None), }; // Initialize container to container mapping for item active property // in active context, or to a new e...
Rust
0
rarKrarLrbrMrcrNrdrOrerPrfrQrerRrgrSr9rTrhrir")2rUrrr=rWr>rXr?rYr@rZrAr[rBr\rCr]rDr^rEr^rFr_rGr`rIrarJrarKrarLrbrMrcrNrdrOrerPrf...
Python
1
#!/usr/bin/python import sys, os, re #mergestr = lambda x: reduce((lambda a,b: a+" "+b),x,"") pathjoin = lambda a,b: os.path.normpath(os.path.join(a,b)) include_re = re.compile("\s*#\s*include\s*\"([^\"]*)\"") incmatch = lambda x: ( include_re.match(line) for line in open(x) ) incline = lambda x,m: pathjoin(os.path....
Python
1
from splunk_add_on_ucc_framework.generators.conf_files import EventtypesConf from textwrap import dedent def test_init( global_config_all_json, input_dir, output_dir, ): eventtypes_conf = EventtypesConf( global_config_all_json, input_dir, output_dir, ) assert eventtypes...
Python
1
g_if = "Option::is_none")] pub created_at: Option<String>, #[serde(rename = "lastModifiedBy", default, skip_serializing_if = "Option::is_none")] pub last_modified_by: Option<String>, #[serde(rename = "lastModifiedByType", default, skip_serializing_if = "Option::is_none")] pub last_modified_by_type: ...
Rust
0
/// ``` /// use lru::LruCache; /// let mut cache = LruCache::new(2); /// /// assert_eq!(None, cache.put(1, "a")); /// assert_eq!(None, cache.put(2, "b")); /// assert_eq!(Some("b"), cache.put(2, "beta")); /// /// assert_eq!(cache.get(&1), Some(&"a")); /// assert_eq!(cache.get(&2), Som...
Rust
0
inputs, vc_transform1, f0method1, file_index1, file_index2, # file_big_npy2, index_rate1, ...
Python
1
""" summary: list segment functions (and cross-references to them) description: List all the functions in the current segment, as well as all the cross-references to them. keywords: xrefs see_also: list_segment_functions_using_idautils level: beginner """ import ida_kernwin import ida_segment import ida_funcs ...
Python
1
ave_pretrained("./Integrating Symptoms & Age/synthetic data/model") # Evaluation: Generate predictions predictions_diagnosis = [] predictions_report = [] actual_diagnoses = [] actual_reports = [] correct_diagnosis = 0 correct_report = 0 total = 0 for batch in DataLoader(test_dataset, batch_size=16): # Batch size for...
Python
1
RTC1_8X8_UNORM_GLI }; pub const GLI_RGB_PVRTC1_8X8_SRGB : DXGIFormat = DXGIFormat { gli: gli::dx_dxgi_format_gli_DXGI_FORMAT_RGB_PVRTC1_8X8_SRGB_GLI }; pub const GLI_RGB_PVRTC1_16X8_UNORM : DXGIFormat = DXGIFormat { gli: gli::dx_dxgi_format_gli_DXGI_FORMAT_RGB_PVRTC1_16X8_UNORM_GLI }; pub const GLI_RGB_...
Rust
0
HEBREW LETTER MEM 0x0CEF: 0x05DF, # hebrew_finalnun ן HEBREW LETTER FINAL NUN 0x0CF0: 0x05E0, # hebrew_nun נ HEBREW LETTER NUN 0x0CF1: 0x05E1, # hebrew_samech ס HEBREW LETTER SAMEKH 0x0CF2: 0x05E2, # hebrew_ayin ע HEBREW LETTER AYIN 0x0...
Python
1
../truncated_bptt/truncated_bptt_lm_task.py
Python
1
interval. ax : AxesSubplot matplotlib Axes instance to use **predict_kwargs Any additional keyword arguments to pass to ``result.get_prediction``. Returns ------- Figure matplotlib Figure containing the prediction plot """ from statsmodels.graphics.utils impo...
Python
1
鲜献险陷宪纤掀弦腺锨仙咸贤衔舷闲涎嫌馅羡冼苋莶藓岘猃暹娴氙燹祆鹇痫蚬筅籼酰跣跹霰", "xiang :想向相象响项箱乡香像详橡享湘厢镶襄翔祥巷芗葙饷庠骧缃蟓鲞飨", "xiao :小消削效笑校销硝萧肖孝霄哮嚣宵淆晓啸哓崤潇逍骁绡枭枵筱箫魈", "xie :些写斜谢协械卸屑鞋歇邪胁蟹泄泻楔蝎挟携谐懈偕亵勰燮薤撷獬廨渫瀣邂绁缬榭榍躞", "xin :新心信锌芯辛欣薪忻衅囟馨昕歆鑫", "xing :行性形型星兴醒姓幸腥猩惺刑邢杏陉荇荥擤饧悻硎", "xiong :雄胸兄凶熊匈汹芎", "xiu :修锈休袖秀朽羞...
Rust
0
f203', #  'laugh': '\uf599', #  'laugh-beam': '\uf59a', #  'laugh-squint': '\uf59b', #  'laugh-wink': '\uf59c', #  'layer-group': '\uf5fd', #  'lea...
Python
1
`$p:pat` ($s:stmt $e:expr) => {}; //~ERROR `$s:stmt` is followed by `$e:expr` ($s:stmt $t:ty) => {}; //~ERROR `$s:stmt` is followed by `$t:ty` ($s:stmt $s:stmt) => {}; //~ERROR `$s:stmt` is followed by `$s:stmt` ($s:stmt $p:path) => {}; //~ERROR `$s:stmt` is followed by `$p:path` ($s:stmt $b:...
Rust
0
if cursor_row == 0 and cursor_col < len(PROMPT): cursor_col = len(PROMPT) update_char_display(display, screen_buffer, cursor_col, cursor_row, cursor_col, cursor_row) # Draw new cursor needs_partial_update = False # Handled manually # --- Simplified Update Display --- ...
Python
1
# squares between a and b a = int(input("Enter the first number: ")) b = int(input("Enter the second number: ")) def squares_a_b(a, b): start = 1 while start ** 2 <= b: # the 'while' loop works until we reach the 'b' if start ** 2 >= a: # if our the square of 'start' is greater or equal to a, yield it...
Python
1
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import math def f_gold ( base , area ) : return math.ceil ( ( 2 * area ) / base ) #TOFILL if __name__ == '__main__': ...
Python
1
notifier error {:?}. Ignoring file event.", e); return; } }; match event.kind { EventKind::Create(_) => debug!("files created {:?}", &event.paths), EventKind::Modify(_) => debug!("files modified {:?}", &event.paths), ...
Rust
0
Decode, Encode}; use rstd::prelude::Vec; use sr_primitives::traits::{Bounded, Hash}; use support::{ decl_event, decl_module, decl_storage, dispatch::Result, ensure, StorageMap, StorageValue, }; use system::ensure_signed; #[derive(Encode, Decode, Default, Clone, PartialEq)] #[cfg_attr(feature = "std", derive(Debug...
Rust
0
of the `i`-th S-box of the `round`-th round of the first set /// of full rounds. fn wire_full_sbox_0(round: usize, i: usize) -> usize { debug_assert!( round != 0, "First round S-box inputs are not stored as wires" ); debug_assert!(round < poseidon::HALF_N_FULL_RO...
Rust
0
ᏆᎴᏍᏗ"], }, #[cfg(feature = "cs")] crate::Annotation { lang: "cs", tts: Some("fotbalový míč"), keywords: &["fotbal", "fotbalový míč", "míč"], }, #[cfg(feature = "cy")] crate::Annotation { lang: "cy", tts: Some("pê...
Rust
0
d after forward for the last # transformer block since FSDP would prefetch it immediately reshard_after_forward = int(layer_id) < len(model.layers) - 1 else: raise ValueError( f"Invalid reshard_after_forward_policy: {reshard_after_forward_policy}." ...
Python
1
import os import argparse import random import shutil import torch from torchvision import transforms from tqdm import tqdm import numpy as np from trainer import Trainer from utils import get_config, get_model_list, get_loaders, write_image parser = argparse.ArgumentParser() parser.add_argument('--name', type=str,de...
Python
1
hSet<&'a str>, surrounding_quote: Option<char>, } impl<'a> PathVariable<'a> { pub fn parse(val: &'a str) -> Self { let mut paths: Vec<_> = val.split(':').into_iter().collect(); // Roughly regard the whole path is surrounded by double quotes by simple logic let quote_candidates = vec!['...
Rust
0
# Copyright (c) OpenMMLab. All rights reserved. import unittest from mmyolo.datasets import YOLOv5CocoDataset class TestYOLOv5CocoDataset(unittest.TestCase): def test_batch_shapes_cfg(self): batch_shapes_cfg = dict( type='BatchShapePolicy', batch_size=2, img_size=640,...
Python
1
lazy_static! { static ref CLOCK: DefaultClock = DefaultClock::default(); } /// Once the rate limit has been reached, the middleware will respond with /// status code 429 (too many requests) and a `Retry-After` header with the amount /// of time that needs to pass before another request will be allowed. #[derive(D...
Rust
0
doing well, thanks for asking! Always ready to chat about my projects, skills, and experience in computer science. How can I help you today?", "doing": "Currently, I'm focused on enhancing my skills in deep learning and exploring new applications for my projects. I'm also looking for opportunities to contribute to ...
Python
1
ls_list: if not vals.get('created_date'): vals['created_date'] = fields.Date.today() return super(PropertyOffer, self).create(vals_list) @api.constrains('validity') def _check_validity(self): for record in self: if record.deadline and record.created_date:...
Python
1
, success except Exception as e: error_details = {"error": str(e)} self.log_step("アウトライン生成", "error", error_details) raise def select_appropriate_template(self, topic: str, outline: SlideDeck, style: str, requirements: Dict) -> SlideTheme: """ ...
Python
1
# -*- coding: utf-8 -*- # Form implementation generated from reading ui file 'Ui_QrCodeLogin.ui' # # Created by: PyQt5 UI code generator 5.15.9 # # WARNING: Any manual changes made to this file will be lost when pyuic5 is # run again. Do not edit this file unless you know what you are doing. from PyQt5 import QtCor...
Python
1
rsive::new(); /// /// siv.menubar() /// .add_subtree("File", /// MenuTree::new() /// .leaf("New", |s| s.add_layer(Dialog::info("New file!"))) /// .subtree("Recent", MenuTree::new().with(|tree| { /// for i in 1..100 { /// ...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. import threading from typing import Any import torch from .lie_group import LieGroup class _LieGroupContext(object): contexts = thre...
Python
1
pub fn CoolBar_Scale96ToFont(AObj: usize, ASize: i32) -> i32; pub fn CoolBar_ScaleFontTo96(AObj: usize, ASize: i32) -> i32; pub fn CoolBar_ScaleScreenToFont(AObj: usize, ASize: i32) -> i32; pub fn CoolBar_ScaleFontToScreen(AObj: usize, ASize: i32) -> i32; pub fn CoolBar_Scale96ToScreen(AObj: usize, ASize: i32) ...
Rust
0
# Databricks notebook source print("hello babaji") # COMMAND ---------- print("I am in 2nd cell") # COMMAND ---------- # MAGIC %sql # MAGIC select "hello SQL babaji!" # COMMAND ---------- # MAGIC %md # MAGIC # MAGIC #First # MAGIC ##Second Title Type # MAGIC ### Third Title Type # MAGIC # MAGIC text with **bold**...
Python
1
data = rv.data.decode("utf-8") ok_(NOTNULL_VALIDATION_STRING in data) self.clean_data() def test_model_base_filter(self): """ Test Model base filtered views """ client = self.app.test_client() self.browser_login(client, DEFAULT_ADMIN_USER, DEFAULT_ADMIN_...
Python
1
SessionOptions::new(), &self.graph)?; let mut args = SessionRunArgs::new(); args.add_feed(&self.graph.operation_by_name_required("net_input")?, 0, &input); let out = args.request_fetch(&self.graph.operation_by_name_required("net_output")?, 0); session.run(&mut args)?; l...
Rust
0
接 while curr_img == prev_img: page_source = driver.page_source pattern = IMG_REGEX res = re.search(pattern=pattern, string=page_source) curr_img = res.group(1) # 存入当前图片 curr_img = curr_img.replace('amp;', '') reqs = requests.get(url=IMG_PA...
Python
1
import sys, string as str words = { 1 : 'one', 2 : 'two', 3 : 'three', 4 : 'four', 5 : 'five', 6 : 'six', 7 : 'seven', 8 : 'eight', 9 : 'nine', 10 : 'ten', 11 : 'eleven', 12 : 'twelve', 13 : 'thirteen', 14 : 'fourteen', 15 : 'fifteen', 16 : 'sixteen', ...
Python
1
str::<SparsityPattern>(r#"{"major_dim":3,"minor_dim":6,"major_offsets":[1, 2, 2, 5],"minor_indices":[0, 5, 1, 2, 3]}"#).is_err()); assert!(serde_json::from_str::<SparsityPattern>(r#"{"major_dim":3,"minor_dim":6,"major_offsets":[0, 2, 2, 4],"minor_indices":[0, 5, 1, 2, 3]}"#).is_err()); assert!(serde_json::from_...
Rust
0
EDTEXT: WBEM_GET_KEY_FLAGS = 2i32; #[doc = "*Required features: 'Win32_System_Wmi'*"] pub type WBEM_GET_TEXT_FLAGS = i32; #[doc = "*Required features: 'Win32_System_Wmi'*"] pub const WBEMPATH_COMPRESSED: WBEM_GET_TEXT_FLAGS = 1i32; #[doc = "*Required features: 'Win32_System_Wmi'*"] pub const WBEMPATH_GET_RELATIVE_ONLY:...
Rust
0
nt $from:ident $try_from:ident $from_truncated:ident ) => { mod $mod_name { use super::*; use crate::ThresholdEnum::*; #[test] fn to_from_basic() { for &mask in &[ $threshold_expr | B | C | D, $t...
Rust
0
np.empty((num_spectrogram_bins, num_mel_bins)) for i in range(num_mel_bins): lower_edge_mel, center_mel, upper_edge_mel = band_edges_mel[i:i + 3] # Calculate lower and upper slopes for every spectrogram bin. # Line segments are linear in the *mel* domain, not hertz. lower_slope = ((spectrogram_bins_m...
Python
1
=> Err(WechatyError::from(e)), } } /// Find all contacts that match the query string pub async fn contact_find_all_by_string(&self, query_str: String) -> Result<Vec<Contact<T>>, WechatyError> { debug!("contact_find_all_by_string(query_str = {:?})", query_str); if !self.is_logged_in...
Rust
0
# ##### BEGIN MIT LICENSE BLOCK ##### # # MIT License # # Copyright (c) 2023 Steven Garcia # # 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 ...
Python
1
ext(), None); // Test a single-line comment let mut it = ReplaceComments::new("a//foo\nb"); assert_eq!(it.next(), c('a', 1)); assert_eq!(it.next(), c(COMMENT_SENTINEL_VALUE, 1)); assert_eq!(it.next(), c('\n', 1)); assert_eq!(it.next(), c('b', 2)); assert_eq!(it.next(), None); // Test a...
Rust
0
""" Программа вычисляет минимальное количество ходов для приведения всех элементов списка к одному числу. За один ход элемент может быть увеличен или уменьшен на 1. """ import sys def convert_txt_in_list(path): """Преобразует содержимое текстового файла в список чисел.""" with open(path, encoding="utf-8") as ...
Python
1