text
string
label_name
string
labels
int64
MRET{}), (0b000, 0b0001000, 0b00101, 0b00000, 0b00000) => Box::new(WFI{}), (0b000, 0b0001001, _, _, 0b00000) => Box::new(SFENCEVMA{ }), (0b001, _, _, _, _) => Box::new(CSRRW { csr: csr, rd: rd, ...
Rust
0
expect_value())) { return false; } // iii. Return true. return true; } } // 8. Else, // a. Assert: ! IsAccessorDescriptor(current) and ! IsAccessorDescriptor(Desc) are both true. // b. If current.[[Configurable]] is false, then ...
Rust
0
http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language gover...
Rust
0
17 = 4; pub const IFLA_VXLAN_TTL: _bindgen_ty_17 = 5; pub const IFLA_VXLAN_TOS: _bindgen_ty_17 = 6; pub const IFLA_VXLAN_LEARNING: _bindgen_ty_17 = 7; pub const IFLA_VXLAN_AGEING: _bindgen_ty_17 = 8; pub const IFLA_VXLAN_LIMIT: _bindgen_ty_17 = 9; pub const IFLA_VXLAN_PORT_RANGE: _bindgen_ty_17 = 10; pub const IFLA_VXL...
Rust
0
1ndtrW { # [ doc = r" Reset value" ] pub fn reset_value() -> Self { S1ndtrW { bits: 0u32 } } # [ doc = "Bits 0:15 - Number of data items to transfer" ] pub fn ndt(&mut self, value: u16) -> &mut Self { const OFFSET: u8 = 0u8; const MASK: u16 = 65535; self.bits &= !((MA...
Rust
0
es::{ReadWriteable, Readable, Writeable}, register_bitfields, register_structs, registers::{ReadOnly, ReadWrite}, LocalRegisterCopy, }; // -------------------------------------------------------------------- // PRIVATE INTERNAL SD HOST REGISTER STRUCTURES AS PER BCM2835 MANUAL // --------------------------...
Rust
0
in updating the `Latch`'s /// internal atomic counter or returns `None`. If the updated counter value /// is `0`, then `LatchState` will be changed to `state_if_zero`. The /// `update` method returns an `Ok` of the previous counter value if the /// closure returned `Some(new)` or an `Err` of the uncha...
Rust
0
row { let my_nested_list_inner_row: Vec<i32> = my_nested_list_inner_row .as_r_rust() .expect("my_nested_list (inner) as rust"); my_nested_list_row.push(my_nested_list_inner_row); } assert_eq!(my_text_list_row, vec!["text1", "text2", "text3"]); ...
Rust
0
uct _DMA_IN_PERI_SEL_CH2; #[doc = "`read()` method returns [dma_in_peri_sel_ch2::R](dma_in_peri_sel_ch2::R) reader structure"] impl crate::Readable for DMA_IN_PERI_SEL_CH2 {} #[doc = "`write(|w| ..)` method takes [dma_in_peri_sel_ch2::W](dma_in_peri_sel_ch2::W) writer structure"] impl crate::Writable for DMA_IN_PERI_SE...
Rust
0
taJson = IndexMetaJson @property def IndexStatus(self): return self._IndexStatus @IndexStatus.setter def IndexStatus(self, IndexStatus): self._IndexStatus = IndexStatus @property def IndexStorage(self): return self._IndexStorage @IndexStorage.setter def IndexS...
Python
1
# ⏱ 4 min # 3. Track the largest positive adjacent difference (ignore negative diffs) nums = [20, 17, 25, 10, 30] # Output: 20 max_diff = float('-inf') for i in range(len(nums)-1): diff = nums[i + 1] - nums [i] if diff > 0: max_diff = max(max_diff, diff) else: continue print(max_diff)
Python
1
stars>1-10 const TABLE_SIZE: u16 = 0x3000; const TABLE_START: u16 = 0x0000; const TABLE_END: u16 = TABLE_START + TABLE_SIZE - 1; const TABLE_MIRROR_OFFSET: u16 = 0x1000; const TABLE_MIRROR_START: u16 = 0x3000; const TABLE_MIRROR_END: u16 = 0x3eff; const PALETTE_SIZE: u16 = 0x20; const PALETTE_START: u16 = 0x3f00; con...
Rust
0
da\xb52\x97\xe6n#\xdd}\xfd/\xa1\xbb\xbd\ \xef\xdf\x01\x9f\xf0:\x7f\xb5\xc8\x02 IR\x83<\x07\ @\x92\xa4\x06Y\x00$Ij\x90\x05@\x92\xa4\x06Y\ \x00$Ij\x90\x05@\x92\xa4\x06Y\x00$Ij\x90\ \x05@\x92\xa4\x06Y\x00$Ij\x90\x05@\x92\xa4\x06\ Y\x00$Ij\x90\x05@\x92\xa4\x06Y\x00$Ij\ \x90\x05@\x92\xa4\x06Y\x00$Ij\x90\x05@\x92\xa4\ \x06Y\...
Python
1
::Debug for ClutterTextBufferClass { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("ClutterTextBufferClass @ {:?}", self as *const _)) .field("inserted_text", &self.inserted_text) .field("deleted_text", &self.deleted_text) .f...
Rust
0
len()-1..] } else { &login.referrer }; ok_addy = &referring; err_addy = { err_temp = String::with_capacity(referring.len() + 20); err_temp.push_str("/admin?redir="); err_temp.push_str(referring); &err_temp }; } else ...
Rust
0
from fastapi import HTTPException, status from sqlalchemy.orm import Session from sqlalchemy.exc import SQLAlchemyError from app.models.article_model import ArticleModel from app.dtos.article_dtos import DeleteArticleDto, InfoDeleteArticleDto, DeleteArticleResponseDto from app.dtos.error_response_dtos import ErrorRes...
Python
1
$floating: expr, $size: expr) => { impl DFPrimitiveType for $ca { type LargestType = $lg; const SIGN: bool = $sign; const FLOATING: bool = $floating; const SIZE: usize = $size; } }; } impl_primitive!(u8, u64, false, false, 1); impl_primitive!(u16, u6...
Rust
0
] _2MA = 0, #[doc = "1: `1`"] _4MA = 1, #[doc = "2: `10`"] _8MA = 2, #[doc = "3: `11`"] _12MA = 3, } impl From<DRIVE_A> for u8 { #[inline(always)] fn from(variant: DRIVE_A) -> Self { variant as _ } } #[doc = "Field `DRIVE` reader - Drive strength."] pub struct DRIVE_R(cra...
Rust
0
> (i32, i32) { match orientation { Orientation::Flat => flat_axial_to_doubled(input), Orientation::Pointy => pointy_axial_to_doubled(input) } } // To Cube pub fn offset_odd_to_cube(input: (i32, i32), orientation: Orientation) -> (i32, i32, i32) { match orientation { Orie...
Rust
0
uct") def update_product(productid: str) -> Product: """更新产品信息""" productid = validator.objectid(productid) name: str = request.form.get("name", default='', type=str) addition: str = request.form.get("addition", default='', type=str) description: str = request.form.get("description", default='', typ...
Python
1
.fetchone()[0] # message_txt = f"Диалог с {result}" # # message_lb = tk.Label( # messages_frame, # text=message_txt, # font=("Verdana", 8, "bold") # ) # # message_lb.grid() ...
Python
1
in place of a port number to allow all ports. /// By default all port forwarding listen requests are permitted. /// Note that the **GatewayPorts** option may further restrict which addresses may be listened on. /// Note also that [ssh(1)](https://man.openbsd.org/ssh.1) will request a listen host of “localhost” if no l...
Rust
0
S: continue n_point_types_base = self.n_template_point_types[base_class_] if n_point_types_base != n_point_types: template_filter = INHERITED_TEMPLATED_TYPES_FILTER types_filter = template_filter.get(base_cla...
Python
1
get_unknown_fields(&self) -> &::protobuf::UnknownFields { &self.unknown_fields } fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields { &mut self.unknown_fields } fn as_any(&self) -> &::std::any::Any { self as &::std::any::Any } fn as_any_mut(&mut self) -...
Rust
0
_fig = PyramidChart(**dict(chart_args_test_segregated_levels_and_approaches)) return dcc.Graph( id="pyramid-chart", figure=pyramid_fig.create( x_group_a_axis=Constants.ScenariosDataJSON.COUNT, y_group_a_axis=Constants.ScenariosDataJSON.TEST_LEVEL, x_group_b_axis=...
Python
1
# This file is distributed under the same license as the Django package. # # The *_FORMAT strings use the Django date format syntax, # see https://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = "j E Y ж." TIME_FORMAT = "G:i" DATETIME_FORMAT = "j E Y ж. G:i" YEAR_MONTH_FORMAT = "F Y ж." MONTH_D...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2019 Google LLC. 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 requir...
Python
1
import socket import ssl # Configurações do servidor HOST = 'localhost' PORT = 12345 CERTFILE = './server.crt' # Certificado do servidor KEYFILE = './server.key' # Chave privada do servidor # Cria um socket TCP/IP server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) # Define o contexto SSL context = ...
Python
1
alg)), } } } #[allow(non_upper_case_globals)] impl From<Algorithm> for yh_algorithm { fn from(alg: Algorithm) -> Self { match alg { Algorithm::RsaPkcs1Sha1 => yh_algorithm_YH_ALGO_RSA_PKCS1_SHA1, Algorithm::RsaPkcs1Sha256 => yh_algorithm_YH_ALGO_RSA_PKCS1_SHA256, ...
Rust
0
usize = 41; impl fmt::Debug for StrRef { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if self.0 < SPECIAL_STR_REF { write!(f, "StrRef(special: {})", self.0) } else { write!(f, "StrRef(regular: {})", self.0 - SPECIAL_STR_REF) } } } /// New StrRefs should be appended to the bo...
Rust
0
OverlayFsOpaque { // For the overlayfs opaque, we need to remove the lower node that has the // same name first, then apply upper node to the node tree of lower layer. child .node .remove_xatt...
Rust
0
x4RelaxedTruncSatF32x4S : [0xfd, 0xa5]: "i32x4.relaxed_trunc_f32x4_s", I32x4RelaxedTruncSatF32x4U : [0xfd, 0xa6]: "i32x4.relaxed_trunc_f32x4_u", I32x4RelaxedTruncSatF64x2SZero : [0xfd, 0xc5]: "i32x4.relaxed_trunc_f64x2_s_zero", I32x4RelaxedTruncSatF64x2UZero : [0xfd, 0xc6]: "i32x4.relaxed_trunc_...
Rust
0
globs.rs use std::path; #[allow(unused_imports)] use color_eyre::{eyre::eyre, eyre::WrapErr, Help}; fn wrap_result<T>(result: eyre::Result<T>, field: &str, file: &str) -> eyre::Result<T> { result .wrap_err(format!("Error while parsing '{}'", field)) .suggestion(format!( "Check the form...
Rust
0
v: Vec<i32>) -> Option<Box<ListNode>> { let mut cur = None; for &x in v.iter().rev() { let mut n = ListNode::new(x); n.next = cur; cur = Some(Box::new(n)); } cur } #[test] fn test_reverse_k_group() { assert_eq!( Solutio...
Rust
0
.is_none() { continue } } let cnum = tcx.extern_mod_stmt_cnum(def_id).unwrap(); if tcx.is_compiler_builtins(cnum) { continue } if tcx.is_panic_runtime(cnum) { continue } if tcx.has_global_allocator(cnum) { ...
Rust
0
0': { 'lane_sets': { 'S-W': ['246780002#1_0'], 'S-S': ['246780002#1_0'], 'S-E': ['246780002#1_0'], 'W-N': ['110904622_2'], 'W-W': ['110904622_2', '110904622_1', '110904622_0'], 'W-S': ['110904622_0'], 'N-E': ['-246780002#5_0'], 'N-N': ['-246780002#5_0'], 'N-W': ['-246780002#5_0'],...
Python
1
b = get_test_nuplan_db() return db.camera[DEFAULT_TEST_CAMERA_INDEX] @lru_cache(maxsize=1) def get_test_nuplan_egopose() -> EgoPose: """Get a nuPlan egopose object with default settings to be used in testing.""" db = get_test_nuplan_db() return db.ego_pose[DEFAULT_TEST_EGO_POSE_INDEX] @lru_cache(max...
Python
1
np.empty((len(labels),)), 'bboxes': np.empty((len(labels), 4))} for idx, ann in enumerate(labels): cls_id = ann['cls_id'] x1 = ann['x1'] * width x2 = ann['x2'] * width y1 = ann['y1'] * height y2 = ann['y2'] * height annotations['bboxes'][...
Python
1
ents_expected_order.len() - 1 { for j in i + 1 .. events_expected_order.len() { assert!(events_expected_order[i].is_before(&events_expected_order[j])); } } } } <gh_stars>10-100 use std::{io, path::PathBuf}; use thiserror::Error; use crate::{Config, ConfigCmd, Confi...
Rust
0
# ============================================================================= # Import OHLCV data and calculate RSI technical indicators # Author : Mayank Rasu # Please report bug/issues in the Q&A section # ============================================================================= # Import necesary libraries im...
Python
1
from market_operations.market import Actor, Bid, EnergyMarket # from market import Actor, Bid, EnergyMarket import pandas as pd import os import requests LOCAL_SERVER_URL = 'http://127.0.0.1:8001' ONLINE_SERVER_URL = 'http://54.202.120.41:8001' CURRENT_URL = ONLINE_SERVER_URL # Setup the energy market with 5 buyers ...
Python
1
#[test] fn parse_rampart() { let json = json!({ "_id": "58e5ae786dace5c319d5b7ee", "hits": 7181701, "hitsMax": 10000000, "nextDecayTime": 20179250, "notifyWhenAttacked": true, "room": "W73N43", "type": "rampart", ...
Rust
0
f `FileUrl` objects containing the URL and where it was found. /// If any path is a directory, will get a list of files in the directory and process the list. /// Writes to stdout if `config.verbose` is set. pub fn check_paths(input_paths: &[&str], config: Option<&Config>) -> Result<Info> { if input_paths.is_empty(...
Rust
0
ub mod screen; use osmpbfreader::objects::{NodeId, WayId}; use super::categorize::EdgeProperties; use geo::{Coordinate, LineString, haversine_length::*}; // Coord are coordinates in decimal degress WGS84 pub type Coord = Coordinate<f32>; pub type Geometry = LineString<f32>; // Node is the OpenStreetMap node #[derive...
Rust
0
s) => s, Err(err) => { return Err(format!("UTF8 Error: {:#?}", err)); } }; let board = match Board::from_str(q) { Ok(b) => b, Err(err) => { return Err(format!("{:#?}", err)); } }; let overlay_board = OverlayBoard::from(board.clone()); f...
Rust
0
from dataclasses import dataclass from typing import List, Optional, Union import numpy as np import PIL.Image from ...utils import ( BaseOutput, ) @dataclass class StableDiffusionSafePipelineOutput(BaseOutput): """ Output class for Safe Stable Diffusion pipelines. Args: images (`List[PIL.I...
Python
1
# Copyright (c) 2020, Oracle and/or its affiliates. # # Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/ # from .base import BaseEnvironment class MinishiftEnvironment(BaseEnvironment): pass
Python
1
__version__ = "0.13.0" import logging import os import sys from pathlib import Path JOBFINDER_ROOT = Path(__file__).parent PROJECT_ROOT = Path(JOBFINDER_ROOT).parent.parent DATA_DIR = PROJECT_ROOT.joinpath("data") RAW_DATA_DIR = DATA_DIR.joinpath("raw") JOBS_DATA_FILE = os.environ.get("JOBS_DATA_FILE", DATA_DIR.joinp...
Python
1
let max_pos: u32 = crabs.keys().max().unwrap().to_owned(); let mut min_total_fuel: u32 = u32::MAX; for position in min_pos..(max_pos + 1) { let mut total_fuel_for_position: u32 = 0; for crab_position in crabs.borrow() { let step: u32 = i32::abs((position as i32) ...
Rust
0
l Encode for Option<Id<'_>> { fn encode(&self, _e: &mut Vec<u8>) { // used for parameters in the tuple impl as well as instruction labels } } impl<T: Encode, U: Encode> Encode for (T, U) { fn encode(&self, e: &mut Vec<u8>) { self.0.encode(e); self.1.encode(e); } } impl<'a> Enco...
Rust
0
ocalhost:8080/auth/realms/other/protocol/openid-connect/token': RequestSpec( MockResponse(status_code=200, response=token_response)), 'http://localhost:8080/auth/realms/master/login-actions/authenticate?session_code' '=bR4rBd0QNGsd_kGuqiyLEuYuY6FK3Lx9...
Python
1
ze, // w座標 } #[wasm_bindgen] pub fn make_initialized_grid() -> JsValue { let mut grid = vec![]; grid.push(vec![Masu { masu: Masu::EMPTY },Masu { masu: Masu::EMPTY },Masu { masu: Masu::EMPTY }]); grid.push(vec![Masu { masu: Masu::EMPTY },Masu { masu: Masu::EMPTY },Masu { masu: Masu::EMPTY }]); ...
Rust
0
las APIs de forma sincrónica""" try: # Crear instancia temporal para obtener estado api_manager = APIManager(self.memory_manager) return api_manager.get_api_status() except Exception as e: logger.error(f"Error obteniendo estado de APIs: {e}") r...
Python
1
::typing::inspect_type_of!( optional_val ); // ordinary pattern if let Some( val ) = optional_val { wtools::typing::inspect_type_of!( val ); } // getting reference if let Some( ref val ) = optional_val { wtools::typing::inspect_type_of!( val ); } // getting mutable reference if let Some( ...
Rust
0
ement of TARGETS: (filename, None) or (filename, [(start,end)]) target_files = [] # hunks_current_list serves as a reference to the hunks list of the # last added file hunks_current_list = None for line in diff_output: file_match = DIFF_FILE_PATT.search(line) hunk_match = DIFF_HUNK_PATT.search...
Python
1
1 = kitties_owned_by_1[0]; let kitty1 = SubstrateKitties::kitties(kid1) .expect("Could have this kitty ID owned by acct 1"); assert_eq!(kitty1.owner, 1); let kid2 = kitties_owned_by_2[0]; let kitty2 = SubstrateKitties::kitties(kid2) .expect("Could have this kitty ID owned by acct 2"); assert_eq!(kitty2...
Rust
0
sors="pt",)["input_ids"].to(model.device) # Run MEND edit_inner = dict( image=image, text_input=text_input, labels=labels, prompts_len=prompts_len ) # cond = {k: sent_tok[k] for k in ["input_ids", "attention_mask"]} _, model_info =...
Python
1
, u16, u16, u16, u16, u16, u16)] pub source: Ipv6Addr, #[construct_with(u16, u16, u16, u16, u16, u16, u16, u16)] pub destination: Ipv6Addr, #[length = "payload_length"] #[payload] pub payload: Vec<u8>, } impl<'p> ExtensionIterable<'p> { pub fn new(buf: &[u8]) -> ExtensionIterable { ...
Rust
0
ext, opts: *const btf_dedup_opts, ) -> ::std::os::raw::c_int; } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_dump { _unused: [u8; 0], } #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct btf_dump_opts { pub ctx: *mut ::std::os::raw::c_void, } pub type btf_dump_printf_fn_t = ::std::option...
Rust
0
import os from tqdm import tqdm def read_input(filename: str) -> list[str]: filepath = os.path.abspath( os.path.join( os.path.dirname(__file__), filename, ) ) with open(filepath, "r") as f: lines = f.readlines() return [line.strip("\n") for line in li...
Python
1
// #[cfg(feature = "option_argument")] #[rustfmt::skip] let opt_ary = [ Opt { sho: b'i', lon: "info", has: Arg::No, num: CmdOP::Info.to(), }, Opt { sho: b'n', lon: "name", has: Arg::Yes, num: CmdOP::Name.to(), }, Opt { sho: b's', lon: "section...
Rust
0
import datetime from ipaddress import IPv4Address, IPv6Address from typing import Union def timestamp2datetime(dt: Union[bytes, int]) -> datetime.datetime: """ Converting Windows timestamps to datetime.datetime format :param dt: Windows timestamp as array of bytes or integer :type dt: bytearray | int ...
Python
1
rvices like static /// file serving to work. Use [`OriginalUri`] if you need the original request /// URI. /// /// Take care when using `nest` together with dynamic routes as nesting also /// captures from the outer routes: /// /// ``` /// use axum::{ /// extract::Path, /// ...
Rust
0
t", "w") as f: for (bcrypt_hash,) in hashes: if bcrypt_hash: f.write(f"{bcrypt_hash}\n") conn.close() export_bcrypt_hashes() def verify_sha512(plaintext, stored_hash): hash_object = hashlib.sha512(plaintext.encode()) return hash_object.hexdigest() == stored_hash def v...
Python
1
Location::new(1, 8), Identifier::new(Location::new(1, 8), "B".to_owned()), IntegerLiteral::new( Location::new(1, 12), LexicalIntegerLiteral::new_decimal("2".to_owned()), ), ), ...
Rust
0
let mut v = <$t>::new(); for x in iter { v.$push(x?) } Ok(v) } } )* } } #[cfg(feature = "alloc")] decode_sequential! { alloc::vec::Vec<T>, push alloc::collections::VecDeque<T>, push_b...
Rust
0
"last", &self.last) .finish() } } #[repr(C)] #[derive(Copy, Clone)] pub struct GeeBidirListIface { pub parent_iface: gobject::GTypeInterface, pub bidir_list_iterator: Option<unsafe extern "C" fn(*mut GeeBidirList) -> *mut GeeBidirListIterator>, pub get_read_only_view: Option<unsafe extern "C" ...
Rust
0
ule.out_features, bias=None, compute_dtype=quant_conf.bnb_4bit_compute_dtype, compress_statistics=True, device=None) if quant_conf.bnb_4bit_compute_dtype != None: quant...
Python
1
''' Author: SpenserCai Date: 2023-03-05 22:16:51 version: LastEditors: SpenserCai LastEditTime: 2023-03-13 22:11:32 Description: file content ''' import json import sys import os import platform TMP = ''' package config var TELBOT_TOKEN = "{TELBOT_TOKEN}" var TELBOT_CHAT_ID = {TELBOT_CHAT_ID} var CLASH_CONN_STR = ...
Python
1
jwfxyaumvtxm8g4yvvdfs9", "slptest:qzwdmm83qjx7372wxgszaukan73ffn8ct522etg3c7", "slptest:qzh3f9me5z5sn2w8euap2gyrp6kr7gf6myta5wpy03", "slptest:qrneuckcx69clprn4nnr82tf8sycqrs3ac2dqmr80g", "slptest:qz742xef07g9w8q52mx0q6m9hp05hnzm65pgr3hcvt", "slptest:qq5dzl0drx8v0layyyuh5aupvxfs80...
Rust
0
"""Testing basic pipeline stages.""" import pandas as pd from pdpipe.cq import StartsWith from pdpipe.basic_stages import ValDrop def test_valdrop_with_columns(): """Testing the ColDrop pipeline stage.""" df = pd.DataFrame([[1, 4], [4, 5], [18, 11]], [1, 2, 3], ["a", "b"]) res_df = ValDrop([4], "a").app...
Python
1
ayers(module=m) elif isinstance(m, (nn.Linear, LinearLayer)): initialize_fc_layer( module=m, init_method=linear_init_type, std_val=linear_std ) elif isinstance(m, GroupLinear): initialize_fc_layer( module=m, ...
Python
1
from project.vehicles.base_vehicle import BaseVehicle class CargoVan(BaseVehicle): MAX_MILEAGE = 180.00 ADDITIONAL_PERCENT = 5 def __init__(self, brand: str, model: str, license_plate_number: str): super().__init__(brand, model, license_plate_number, max_mileage=self.MAX_MILEAGE) def drive(s...
Python
1
Eq, Eq)] pub enum Rotation { Rotation0 = 0, Rotation90 = 1, Rotation180 = 2, Rotation270 = 3, } /// copied from android.opengl.matrix /// intended for framebuffers, which range from (-1, -1) to (1, 1), and not textures, which range /// from (0, 0) to (1, 1) #[allow(dead_code)] pub fn ortho(left: f32, r...
Rust
0
pic = db.update_by_id('topics', topic['topics_id'], topic) tfu = db.create('topic_fetch_urls', { 'topics_id': topic['topics_id'], 'url': hs.page_url('/bar'), 'state': FETCH_STATE_PENDING}) fetch_topic_url(db, tfu['topic_fetch_urls_id'], domain_timeout=0) tfu = db.require_by_id('to...
Python
1
NG, '个半月']) WORKDAY_DELTA_STRING = ''.join([DELTA_NUM_STRING, r'[多余]?(个)?(工作|交易)日']) DAY_DELTA_STRING = ''.join([DELTA_NUM_STRING, r'[多余]?[天日]', I, '半天', I, SINGLE_NUM_STRING, '天半']) WEEK_DELTA_STRING = ''.join([DELTA_NUM_STRING, r'[多余]?((个(多)?)?(星期|礼拜)|周(?!年))', I, r'俩(星期|礼拜)']) HOUR_DELTA_STRING = ''.join([DELTA_NUM_...
Python
1
) def decompose(self): return self.tensors, self.mask def __repr__(self): return str(self.tensors) # Copied from transformers.models.detr.modeling_detr.nested_tensor_from_tensor_list def nested_tensor_from_tensor_list(tensor_list: List[Tensor]): if tensor_list[0].ndim == 3: max_s...
Python
1
()); } #[test] fn test_parse_and_format_not_json() { assert!(parse_and_format("test message", &Level::TRACE, &StackTraceMode::FULL).is_err()); } } #![allow(unused)] pub struct Solution {} impl Solution { pub fn solve_sudoku(board: &mut Vec<Vec<char>>) { let mut board: Vec<_> = boa...
Rust
0
.split_for_impl(); let (_, ty_generics, _) = self.trait_generics.split_for_impl(); quote! { #[automatically_derived] impl#impl_generics ::juniper::macros::reflect::BaseType<#scalar> for #ty#ty_generics #where_clause { c...
Rust
0
went wrong :sob:"); } else { slf.len = slf.presented.len(); } slf.p_null = slf.p_null(); slf } /// ref. https://dl.acm.org/doi/10.1145/572020.572056 fn msd(presented: &str, transcribed: &str) -> Vec<Vec<u128>> { fn r(x: char, y: char) -> u128 { ...
Rust
0
me() == "initramfs" { return module; } } panic!("No initramfs found."); } /// Returns the memory area of the initramfs. pub fn get_initramfs_area() -> MemoryArea<PhysicalAddress> { let module_entry = get_initramfs_module_entry(); MemoryArea::from_start_and_end( PhysicalAdd...
Rust
0
s(chunk_size) { let buf: Vec<u8> = chunk.collect(); writer.write_all(&buf[..]).await.unwrap(); } writer.flush().await.unwrap(); let meta = tokio::fs::metadata(&tmp_file).await.unwrap(); assert_eq!(meta.len(), numbers as u64 * 8); let content = tokio::fs:...
Rust
0
info, hooks, default_args=dict(interval=log_interval) ) self.register_hook(logger_hook, priority="VERY_LOW") def register_training_hooks( self, lr_config, optimizer_config=None, checkpoint_config=None, log_config=None ): """Register default hooks for training. ...
Python
1
marks={"english": 89 , "chemistry": 78 } print(marks["chemistry"]) marks["physics"] = 94; print(marks)
Python
1
""" num 2 and 7 yes no """ num = int(input("Enter a number = ")) if num % 2 == 0 and num % 7 == 0: print("Yes") else: print("No")
Python
1
max_keep_ckpts=-1), ## to save every 1000 iters visualization=dict(type='DepthVisualizationHook', interval=vis_every_iters, max_samples=4, vis_image_width=384, vis_image_height=512), ) ##----------------------------------------------------------------- # dataset settings train_pipeline = [ dict(type='LoadI...
Python
1
et<T> { fn load(read: &mut impl io::Read) -> Result<Self> { let mut ret = Self::new(); for res in read.iter_array()? { ret.insert(res?); } Ok(ret) } } impl<T: Load + std::cmp::Eq + std::hash::Hash, U: Load> Load for HashMap<T,U> { fn load(read: &mut impl io::Re...
Rust
0
().unwrap().parse::<i32>().unwrap(); let mut timestr = cur.next().unwrap().split_whitespace(); let index = timestr.clone().count() - 4; section.time = timestr.nth(index).unwrap().parse::<f32>().unwrap(); section.time_deriv = timestr.last().unwrap().parse::<f32>().unwrap(); let overhead = cu...
Rust
0
ORY = 0i32; #[doc = "*Required features: 'Win32_Media_Audio'*"] pub const AudioCategory_ForegroundOnlyMedia: AUDIO_STREAM_CATEGORY = 1i32; #[doc = "*Required features: 'Win32_Media_Audio'*"] pub const AudioCategory_Communications: AUDIO_STREAM_CATEGORY = 3i32; #[doc = "*Required features: 'Win32_Media_Audio'*"] pub con...
Rust
0
GainputInputDevice.cpp")) .file(tfos.join("gainput/lib/source/gainput/GainputInputManager.cpp")) .file(tfos.join("gainput/lib/source/gainput/GainputInputMap.cpp")) .file(tfos.join("gainput/lib/source/gainput/GainputInputState.cpp")) .file(tfos.join("gainput/lib/source/gainput/GainputMapF...
Rust
0
inox_platform::Key::Backspace => Some(egui::Key::Backspace), inox_platform::Key::Enter => Some(egui::Key::Enter), inox_platform::Key::Space => Some(egui::Key::Space), inox_platform::Key::Insert => Some(egui::Key::Insert), inox_platform::Key::Delete => Some(egui::Key::Delete), ...
Rust
0
; #[no_mangle] pub unsafe extern "C" fn x86_kernel_init() -> ! { // printk!("test"); kernel_init(); loop { asm!("hlt"); } } <reponame>Uyouii/rustboyadvance-ng<filename>core/src/timer.rs use super::dma::DmaController; use super::interrupt::{self, Interrupt, InterruptConnect, SharedInterruptFlags}; use supe...
Rust
0
ight::ZERO.fuzzy_lt(lower) { sum_nonconst_rel_delays += f64::from((upper - lower) / lower); } } else { num_constant += 1; } } debug_assert_eq!(num_constant, self.num_constant()); let nonconst_total_relative_dekay = f64...
Rust
0
ect::<Result<Vec<_>, _>>()?; /// /// // Extract just the tokens out of the resulting list of positions and tokens /// let tokens: Vec<Token> = got.into_iter() /// .map(|(_start, tok, _end)| tok) /// .collect(); /// /// let should_be = vec![Token::Word(String::from...
Rust
0
pected_full_style, plotter.drawer.style) # Check individual plot-options, but only the intersection as those are the ones we expect to be # updated. self.assertOptionsEqual(expected_figure_options, plotter.drawer.figure_options, True) # Coarse equality check of figure_options s...
Python
1
s_path(&fp) .unwrap_or_else(|| panic!("invalid path to config file: {:?}", fp)) }) .map(|fp| { fl.read_file(&fp) .unwrap_or_else(|e| panic!("could not read config file {:?}: {}", fp, e)) }) // TODO: use a Reader to r...
Rust
0
) + u16::from(bytes[1])), _ => Err(self.parse_err("string too long")), } } TokenType::IDENT => { let mut label: &str = &self.cur_tok.literal.as_ref(); let lit = label; let mut offset = 0i16; let...
Rust
0
ing the key again later let app_key_1 = RegKey::load_app_key("myhive.dat", true)?; app_key_1.set_value("answer", &42u32)?; } let answer: u32 = { // NOTE: on Windows 7 this fails with ERROR_ALREADY_EXISTS let app_key_2 = RegKey::load_app_key_with_flags("myhive.dat", KE...
Rust
0
8, pub coefficient_up: Uint128, pub coefficient_down: Uint128, pub coefficient: Decimal, pub claims: Uint64, pub releases: Uint64, } #[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)] pub struct MerkleRootResponse { /// MerkleRoot is hex-encoded merkle root. pub merkle_r...
Rust
0
ror(f"Split file not found: {args.split_path}") return except Exception as e: logging.error(f"Error reading split file {args.split_path}: {e}") return # make output dir try: os.makedirs(args.output_dir, exist_ok=True) except OSError as e: logging.error(f"Failed t...
Python
1