text
string
label_name
string
labels
int64
| map!(unquoted_string, |x: String| { (x, false) }) ) ), concat_strings )); named!(hocon_string_val<JsonValue>, map!(hocon_string, |x: String| { JsonValue::String(x) })); named!(json_int<JsonValue>, map!( map_res!( ...
Rust
0
, y: u16::MAX } } ); } #[test] fn try_from_range() { assert_eq!( Rect::<i16>::try_from_range(Vec2 { x: 1, y: 2 }, Vec2 { x: 4, y: 3 }), Some(Rect { start: Vec2 { x: 1, y: 2 }, size: Vec2 { x: 3, y: 1 } }) ); assert_eq!( Rect::<i16>::try_from_range(Vec2 { x: -5, y: 1 }, ...
Rust
0
er, "Parse args failed, reason: unknown attribute inside the macro", )); }, } } let config = config.build(); let (last_stmt_start_span, last_stmt_end_span) = { let mut last_stmt = input .block .stmts .last(...
Rust
0
new(self.interpreter, lhs == rhs)), _ => op_error(), }, _ => op_error(), } } } <filename>src/ctx/str.rs use crate::{check_len, Error, Result, TryRead, TryWrite}; use core::str; /// Context for &str to determine where a &str ends. /// /// Pattern will **not** be inclu...
Rust
0
tributes for ECC key pair. fn get_default_ecc_attrs() -> Attributes { Attributes { lifetime: Lifetime::Persistent, key_type: Type::EccKeyPair { curve_family: EccFamily::SecpR1, }, bits: 256, policy: Policy { usage_flags: UsageFlags::default(), ...
Rust
0
# @Time : 2/11/18 2:17 PM # @Author : Huaizheng Zhang # @Site : zhanghuaizheng.info # @File : pt_detector.py import mmcv import os.path as osp from mmcv.runner import load_checkpoint from mmdet.models import build_detector from .pt_inference import inference_detector from utils.logger import Logger logger ...
Python
1
]} 修改为{sql}") cur.execute(sql) con.commit() con.close() def change_cron_old(cron_file_path="/ql/db/crontab.db", repositories="cddjr_check"): print("尝试修改定时时间") def change_time(time_str: str): words = re.sub("\\s+", " ", time_str).split() words[0] = str(random.randrange(60)...
Python
1
read), 0xC..0xC + bs - 4)(i0)?; Ok((i, BasicArchive { align, entries })) } } impl<'a> BaseArchive<'a> { pub fn read(i0: &'a [u8]) -> Result<'a, Self> { Self::read_magic(i0, "FArc") } } impl<'a> CompressArchive<'a> { pub fn read(i0: &'a [u8]) -> Result<'a, Self> { Self::read_magic...
Rust
0
x, Some(payload))) } } } impl PlainInitiateBox { pub fn seal_precomputed(&self, tiny_nonce: &Nonce8, precomputed_key: &PrecomputedKey, payload: Option<&[u8]>) -> InitiateBox { let payload_len = payload.map(|s| s.len()).unwrap_or(0); let plaintext = Vec::with_...
Rust
0
ptions>) -> Box<dyn CongestionControl> where Self: Sized; } pub type CongestionControlConstructor = fn(usize, SeqNumber, Option<options::Options>) -> Box<dyn CongestionControl>; use std::str; const REQUIRED_KEYS: [&[u8]; 7] = [b"byr", b"iyr", b"eyr", b"hgt", b"hcl", b"ecl", b"pid"]; pub fn parse_input(input: &str) -...
Rust
0
model._deserialize(response["Response"]) return model else: code = response["Response"]["Error"]["Code"] message = response["Response"]["Error"]["Message"] reqid = response["Response"]["RequestId"] raise TencentCloudSDKExc...
Python
1
let mut ob = get_default_ob(); let payee = "test_payee.testnet".to_string(); let payer = "test_payer.testnet".to_string(); let signer = "test_signer.testnet".to_string(); let amount = 1; let description= "test payment".to_string(); let payment_status = "TEST".to_string(); let payment...
Rust
0
from ScoutSuite.providers.azure.facade.base import AzureFacade from ScoutSuite.providers.azure.resources.base import AzureResources from ScoutSuite.providers.utils import get_non_provider_id class AutoProvisioningSettings(AzureResources): def __init__(self, facade: AzureFacade, subscription_id: str): sup...
Python
1
99004745483398, a2: 0.99007225036621, b0: 1., b1: -2., b2: 1., }; ( DirectForm1::<f64>::new(stage1), DirectForm1::<f64>::new(stage2), ) } /// Calculate the loudness of audio in a single channel /// ``` /// let samples = (0..4800).map(|i| (1000. * (i as f64 /...
Rust
0
with a better solution. // // https://rt.openssl.org/Ticket/Display.html?id=4362 if cfg!(any(target_arch = "arm", target_arch = "x86")) && src.start != 0 { let len = in_out.len() - src.start; in_out.copy_within(src, 0); self.encrypt_in_place(counter, &mut in_o...
Rust
0
U', 'L', 'D', 'R']; fn length(hs: &Vec<Vec<i32>>, vs: &Vec<Vec<i32>>, p: (usize, usize), dir: usize) -> i32 { match dir { 0 => vs[p.0 - 1][p.1], 1 => hs[p.0][p.1 - 1], 2 => vs[p.0][p.1], 3 => hs[p.0][p.1], _ => unreachable!() } } pub fn compute_shortest_path(hs: &Vec<Vec<i32>>, vs: &Vec<Vec<i32>>, s: (usi...
Rust
0
mut _ = singleton!(: [Option<(IpCidr, Route)>; 1] = [None; 1]).unwrap(); let routes = Routes::new(routes_storage.as_mut_slice()); let mut iface = InterfaceBuilder::new(gmac, sockets.as_mut_slice()) .hardware_addr(EthernetAddress::from_bytes(&[0x04, 0x91, 0x62, 0x01, 0x02, 0x03]).into()) ...
Rust
0
mpty(&self) -> bool { self.poplist.get().is_null() && self.pushlist.load(Ordering::Relaxed).is_null() } #[inline] pub unsafe fn push(&self, item_ptr: *mut T) { debug_assert!(!item_ptr.is_on_queue()); let old_head = self.pushlist.load(Ordering::Relaxed); item_ptr.set_next(ol...
Rust
0
metrics.log_scalar("loss", loss_sum / sample_size, sample_size, round=3) metrics.log_scalar("ntokens", ntokens) metrics.log_scalar("nsentences", nsentences) metrics.log_scalar("sample_size", sample_size) builtin_keys = { "loss", "ntokens", "nse...
Python
1
sion, code_ref, &execution_message, None) } else { let mut execution_context = unsafe { ::evmc_vm::ExecutionContext::new( host.as_ref().expect("EVMC host is null"), context, ) ...
Rust
0
U_RP2C07_VACTIVE: u32 = 240; pub const PPU_RP2C07_VSLEEP: u32 = 1; pub const PPU_RP2C07_VINT: u32 = 70; pub const PPU_RP2C07_VDUMMY: u32 = 1; pub const PPU_RP2C07_VBLANK: u32 = PPU_RP2C07_VSLEEP + PPU_RP2C07_VINT + PPU_RP2C07_VDUMMY; pub const PPU_RP2C07_VSYNC: u32 = PPU_RP2C07_VACTIVE + PPU_RP2C07_VBLANK; pub const PP...
Rust
0
doc = "Bit 10"] #[inline(always)] pub fn tx_pd_override_en(&self) -> TX_PD_OVERRIDE_EN_R { TX_PD_OVERRIDE_EN_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 9"] #[inline(always)] pub fn rx_pd_override_en(&self) -> RX_PD_OVERRIDE_EN_R { RX_PD_OVERRIDE_EN_R::new(((self.bits ...
Rust
0
v]); } } assert_eq!(mst.len(), n - 1); mst } pub fn prim_sparse(n: usize, g: &Vec<(usize, usize, i64)>) -> Vec<(usize, usize, i64)> { let mut t: Vec<Vec<(usize, i64)>> = vec![vec![]; n]; for (u, v, w) in g.iter() { t[*u].push((*v, *w)); t[*v].push((*u, *w)); } let ...
Rust
0
ides", vec![1, stride as i64, stride as i64, 1]) .attr("dilations", vec![1, 1, 1, 1]) .attr("padding", if valid { "VALID" } else { "SAME" }) .attr("T", DT_FLOAT); let graph = tfpb::graph().node(placeholder_f32("data")).node(const_f32("kernel", k)).node(conv); Ok(graph.write_to_bytes()?...
Rust
0
]) + np.sum([ np.sum([ safe_div( x[aprime], np.sum([x[dublaprime] for dublaprime in range(start_anion, stop_anion)]) ) * x[c] * safe_div( G[a][aprime], ...
Python
1
import cv2 import numpy as np import utils curveList = [] avgVal = 10 def get_lane_curve(img, display=2): img_copy = img.copy() img_result = img.copy() # Step 1: Thresholding img_thres = utils.thresholding(img) # Step 2: Perspective Transformation hT, wT, c = img.shape points = utils.va...
Python
1
] #[doc = "*This API requires the following crate features to be activated: `Window`*"] pub fn set_timeout_with_str_and_timeout_and_unused_6( this: &Window, handler: &str, timeout: i32, unused_1: &::wasm_bindgen::JsValue, unused_2: &::wasm_bindgen::JsValue, unused...
Rust
0
import pandas as pd import os import numpy as np from collections import OrderedDict import rapidfuzz from rapidfuzz import fuzz, distance import re import time def process_indication_standardization(input_file, output_folder, column_index=3, group_column_index=1, similarity_thre...
Python
1
cWm\xa1\x11\xa8Z9\xe8\xecxP\x0d\xe7\ \xe4\xb9\xf3\xcb\xe6\xac)\x98A\xf4\xee\xaf!\xe7Hm\ \xc9\xff\x85c\xb6\x88\xe7\xbdX\x89gL\x8b\x08C\xdb\ ,\xc5\x8b\xf3\xce\x01\xff\x08D7\x11\x10&ru\x7f\ B\xce\x8dE\xb4\x82\xe1\xa1\xe1\xa7d\xfa\xb9\xeeT\x05\ \xe1\xaa\xfde\x09?\xa4Zp\xae\xf2<\xf3%\xe4\xf0\ \xcb\x8f\xf9}\xc9\xa9\xd6\x0c\x...
Python
1
n.request(request) resp.dump() #request['PrimaryName'] = NULL #request['ComputerName'] = target_computer + '\x00' #request['OpaqueBuffer'] = b'HOLABETOCOMOANDAS\x00' #request['OpaqueBufferSize'] = len(b'HOLABETOCOMOANDAS\x00') #resp = rpc_con.request(request) #resp.dump() ...
Python
1
ColoredString { fgcolor: Some(color.into()), ..self } } fn on_red(self) -> ColoredString { self.on_color(Color::Red) } fn on_yellow(self) -> ColoredString { self.on_color(Color::Yellow) } fn on_blue(self) -> ColoredString { self.color(Color::Blue) } fn on_col...
Rust
0
from resources.analytics.vertical import AnalyticsVerticalResource from resources.analytics.vertical_result import AnalyticsVerticalResultResource from resources.analytics.vertical_run import AnalyticsVerticalRunResource from resources.analytics.vertical_logs import AnalyticsVerticalLogsResource from resources.analytic...
Python
1
=> { eprintln!("{}", err); return Err("Unable to save output!") }, } } Ok(()) } } /// Loads a grid stored at `filename` (in a custom binary format) into an /// `fftw::array::AlignedVec` object. This custom format stores the 3D gr...
Rust
0
ads) .add_option(&["-t", "--threads"], Store, "Does nothing as thread support was disabled at complie time") .metavar("NUM"); match ap.parse_args() { Ok(()) => {} Err(x) => return x, } } let mut cfg = ScannerConfig::new(); cfg....
Rust
0
mut buf = Vec::new(); let mut tmp = String::new(); while bytes.has_remaining() { let mut c = bytes.get_u8(); // Null-terminated C-strings. while c != 0 { tmp.push(c as char); c = bytes.get_u8(); } if tmp.len() > 0 { buf.push(tmp.clo...
Rust
0
'#66ccff': '天蓝', '#ff69b4': '粉红', '#ff69b4': '热粉红', '#98fb98': '浅绿', '#ffa500': '橙色', '#f0e68c': '卡其色', '#87ceeb': '天蓝色', '#dda0dd': '梅红色', '#ff7f50': '珊瑚色', } return color_map.get(hex_color.lower(), hex_color) def get_danmaku(cid: str, bvid: s...
Python
1
f.method_payload.len(); let max_size_intra_subnet = self.max_size_inter_subnet * self.multiplier_max_size_intra_subnet; if size as u64 > max_size_intra_subnet.get() - current_size as u64 { Err(HypervisorError::ContractViolation(format!( "RequestInPrep: current_siz...
Rust
0
import pandas as pd import json train_path = './data/msrvtt/train_val_videodatainfo.json' test_path = './data/msrvtt/test_videodatainfo.json' f = open(train_path, 'r') ds = json.load(f) f.close() train_video_ids = [] val_video_ids = [] for sp in ds['videos']: if sp['split'] == 'train': train_video_ids.ap...
Python
1
import logging from django.contrib import admin # Register your models here. from django.urls import reverse from django.utils.html import format_html logger = logging.getLogger(__name__) class OAuthUserAdmin(admin.ModelAdmin): search_fields = ('nickname', 'email') list_per_page = 20 list_display = ( ...
Python
1
.config_path(), "service.json") try: with open(config_filename, "r") as f: return cast( "DockerZenServer", DockerZenServer.from_json(f.read()) ) except FileNotFoundError: return None def _get_container_cmd(self) -> Tuple[Li...
Python
1
the UI using [`tui`] -- everything on screen *except* for /// the raytraced scene. /// /// This function also stores the current scene viewport for future frames. fn write_ui(&mut self, frame: &FrameOutput) -> crossterm::Result<()> { let FrameOutput { info, .. } = frame; // TODO: In Rus...
Rust
0
import urllib.parse from flask import current_app from sqlalchemy.exc import SQLAlchemyError from datetime import datetime, timezone import requests from models import UsersModel, CommandsModel, RequestsModel from db import db # Testing # import json def run(data): user_query = data['user_query'] user_offse...
Python
1
ol, pub is_temporary: bool, pub is_sync: bool, pub format: Option<Vec<Field>>, } impl Default for SpaceCreateOptions { fn default() -> Self { SpaceCreateOptions { if_not_exists: false, engine: SpaceEngineType::Memtx, id: None, field_count: 0, ...
Rust
0
opa: (), } lazy_static! { pub(super) static ref TABLES: Tables = { let handlers_xx = read_legacy(); #[cfg(not(feature = "no_vex"))] let (handlers_vex_0fxx, handlers_vex_0f38xx, handlers_vex_0f3axx) = read_vex(); #[cfg(not(feature = "no_evex"))] let (handlers_evex_0fxx, handlers_evex_0f38xx, handlers_evex_0f...
Rust
0
ZdZdZdZy)TraversableReaderz A TraversableResources based on SimpleReader. Resource providers may derive from this class to provide the TraversableResources interface by supplying the SimpleReader interface. ct|Sr+)r(r s rr=zTrav...
Python
1
se { zk_server_id: error_if_none!(zk_server_id), zk_extras, }) } } /// Sub-set of the "conf" response the agent needs. pub struct Response { pub zk_server_id: String, pub zk_extras: HashMap<String, String>, } #[cfg(test)] mod tests { use zk_4lw::FourLetterWord; use...
Rust
0
essor::<_, ::protobuf::types::ProtobufTypeBytes>( "auxiliary_data_hash", |m: &CardanoTxAuxiliaryDataSupplement| { &m.auxiliary_data_hash }, |m: &mut CardanoTxAuxiliaryDataSupplement| { &mut m.auxiliary_data_hash }, )); fields.push(::protobuf::refle...
Rust
0
# Lc 392 # is SUbsequence # bottom up dp def isSubseq(s,t): dp = [[False for _ in range(len(t)+1)] for _ in range(len(s)+1)] for i in range(len(t)+1): dp[len(s)][i] = True for i in range(len(s)-1,-1,-1): for j in range(len(t)-1,-1,-1): if s[i] == t[j]: dp[i][j...
Python
1
row_weights: A dense tensor of rank 1. col_weights: A dense tensor of rank 1. Returns: The total loss. """ wr = (array_ops.expand_dims(row_weights, 1) if row_weights is not None else constant_op.constant(1.)) wc = (array_ops.expand_dims(col_weights, 0) if col_weights is not None else c...
Python
1
from isaacgym.torch_utils import * import torch import json import numpy as np import sys from poselib.core.rotation3d import * from poselib.skeleton.skeleton3d import SkeletonTree, SkeletonState, SkeletonMotion from poselib.visualization.common import plot_skeleton_state, plot_skeleton_motion_interactive import yaml i...
Python
1
import uuid from enum import Enum from sqlalchemy import Boolean from sqlalchemy import Column from sqlalchemy import String from sqlalchemy.dialects.postgresql import ARRAY from sqlalchemy.dialects.postgresql import UUID from sqlalchemy.orm import declarative_base ############################## # BLOCK WITH DATABASE...
Python
1
FUNC94_IN_SEL_CFG, #[doc = "0x2d0 - GPIO_FUNC95_IN_SEL_CFG"] pub gpio_func95_in_sel_cfg: GPIO_FUNC95_IN_SEL_CFG, #[doc = "0x2d4 - GPIO_FUNC96_IN_SEL_CFG"] pub gpio_func96_in_sel_cfg: GPIO_FUNC96_IN_SEL_CFG, #[doc = "0x2d8 - GPIO_FUNC97_IN_SEL_CFG"] pub gpio_func97_in_sel_cfg: GPIO_FUNC97_IN_SEL_...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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 law or...
Python
1
elf.w } } #[doc = "Reader of field `SENSITIVE_DMA_APBPERI_MAC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_0`"] pub type SENSITIVE_DMA_APBPERI_MAC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_0_R = crate::R<u8, u8>; #[doc = "Write proxy for field `SENSITIVE_DMA_APBPERI_MAC_PMS_CONSTRAIN_SRAM_WORLD_1_PMS_0`"] pub struct SENSITIVE_DMA_APBPERI_M...
Rust
0
} } impl fmt::Debug for CellMeta { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.debug_struct("CellMeta") .field("cell_output", &self.cell_output) .field("out_point", &self.out_point) .field("transaction_info", &self.transaction_info) .field("dat...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ 🔥 REAL DATA ANALYSIS REPORT 🔥 วิเคราะห์และสรุปข้อมูลจริงที่ดึงได้จาก Telegram """ import json import glob from datetime import datetime class Colors: RED = '\033[91m' GREEN = '\033[92m' YELLOW = '\033[93m' BLUE = '\033[94m' BOLD = '\033[1m' ...
Python
1
_base_ = [ 'mmsegext::_base_/datasets/ade20k_512_tta_without_ratio.py', 'mmseg::_base_/default_runtime.py', 'mmseg::_base_/schedules/schedule_160k.py' ] data_preprocessor = dict( type='SegDataPreProcessor', size=(512, 512), mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], bg...
Python
1
# In this example we will create a neural network which determines if a point is inside ou outside a given circle import numpy as np import tensorflow as tf from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense def generate_data(num_samples): centers = np.random.rand(num_samples...
Python
1
s." " The study of mathematical optimization delivers methods, th" "eory and application domains to the field of machine learnin" "g. Data mining is a field of study within machine learning, " "and focuses on exploratory dat...
Python
1
size_of::<WNDCLASSEXW>() as UINT; class.lpszClassName = class_name.as_ptr(); class.lpfnWndProc = Some(DefWindowProcW); RegisterClassExW(&class); let hwnd = CreateWindowExW( 0, class_name.as_ptr(), std::ptr::null(), ...
Rust
0
ndent)?; } writeln!(file, "{} }}", indent)?; } writeln!(file, "{} }}", indent)?; writeln!(file, "{}}}", indent)?; Ok(()) } /// Defines the `impl Deserializable` corresponding to the type definitions: /// /// ``` /// impl crate::Deserializable for Name { /// fn deserialize<...
Rust
0
(&cos_closure), "tan" => BuiltInFunction::boxed(&tan_closure), "asin" => BuiltInFunction::boxed(&asin_closure), "acos" => BuiltInFunction::boxed(&acos_closure), "atan" => BuiltInFunction::boxed(&atan_closure), "sinh" => BuiltInFunction::boxed(&sinh_closure), "cosh" => Bui...
Rust
0
is_hrule(b"* * *\n").is_some()); assert!(is_hrule(b"***\n").is_some()); assert!(is_hrule(b"*****\n").is_some()); assert!(is_hrule(b"- - -\n").is_some()); assert!(is_hrule(b"---------------------------------------\n").is_some()); // up to three spaces ignored assert!(is_hrule(b" ***\n").is_some(...
Rust
0
Self { skip_assert_initialized!(); Self { red: 1f32, green: 1f32, blue: 1f32, alpha: 1f32, } } } impl fmt::Display for RGBA { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { let string: glib::GString = unsafe { ...
Rust
0
::raw("Max n", str::parse); let s = query::raw("Max s", str::parse); let res = Resolution::new(); res.compute_through_stem(s, n); println!("{}", res.graded_dimension_string()); } use amethyst_core::cgmath::{Basis2, Point2, Point3, Quaternion}; use collision::primitive::{Primitive2, Primitive3}; use col...
Rust
0
dst_access_mask: vk::ACCESS_COLOR_ATTACHMENT_WRITE_BIT, dependency_flags: vk::DEPENDENCY_BY_REGION_BIT, }, // end of render pass dependency vk::SubpassDependency { src_subpass: 0, dst_subpass: vk::SUBPAS...
Rust
0
pan_handler, } pub type vt = visit::vt<@mut Ctx>; pub fn extend(cx: @mut Ctx, elt: ident) -> @path { @(vec::append(copy cx.path, [path_name(elt)])) } pub fn mk_ast_map_visitor() -> vt { return visit::mk_vt(@visit::Visitor { visit_item: map_item, visit_expr: map_expr, visit_stmt: map_s...
Rust
0
str> = s.split(": ").collect(); assert_eq!(parts.len(), 2); let ranges: Vec<Range<i32>> = parts[1].split(" or ").map(|s| { let parts: Vec<i32> = s.split("-").map(|s| s.parse().unwrap()).collect(); Range { start: parts[0], end: parts[1]+1 } }).collect(); (parts[0].to_owned(), ranges) } f...
Rust
0
#!/bin/python3 import os import sys import pytest from pydantic import ValidationError from datetime import datetime sys.path.insert(0, os.path.abspath("../../src")) from test_common import osConf from wazuh.opensearch_dsl import Match, OrderBy # random.seed(0) timestampshs = [ "1 week ago", "2024-01-02", ...
Python
1
# coding: utf-8 import numpy as np import matplotlib.pyplot as plt def sigmoid(x): return 1 / (1 + np.exp(-x)) def ReLU(x): return np.maximum(0, x) def tanh(x): return np.tanh(x) input_data = np.random.randn(1000, 100) # 1000个数据 node_num = 100 # 各隐藏层的节点(神经元)数 hidden_layer_size = 5 # 隐藏层有5层 act...
Python
1
: u16, pub AccessMask: u32, } impl ::core::marker::Copy for AUDIT_OBJECT_TYPE {} impl ::core::clone::Clone for AUDIT_OBJECT_TYPE { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: 'Win32_Security_Authorization'*"] pub struct AUDIT_OBJECT_TYPES { pub Count: u16, pub...
Rust
0
, pub rmdir_fn: (unsafe extern "C" fn(c: *mut SMBCCTX, fname: *const c_char) -> c_int), pub setxattr_fn: (unsafe extern "C" fn(context: *mut SMBCCTX, fname: *const c_char, name: *const c_char, value: *const c_void, ...
Rust
0
ux (one-hot). This slice does not have a glitchless mux (only the AUX_SRC field is present, not SRC) so this register is hardwired to 0x1."] pub clk_usb_selected: crate::Reg<clk_usb_selected::CLK_USB_SELECTED_SPEC>, #[doc = "0x60 - Clock control, can be changed on-the-fly (except for auxsrc)"] pub clk_ad...
Rust
0
"""Sphinx configuration.""" import datetime import doctest import os import sys import sphinx_rtd_theme import chemicalx sys.path.insert(0, os.path.abspath("../../")) extensions = [ "sphinx.ext.autodoc", "sphinx.ext.autosummary", "sphinx.ext.doctest", "sphinx.ext.coverage", "sphinx.ext.intersph...
Python
1
A-end b-end"; const PATHS1: &str = r"start,A,b,A,c,A,end start,A,b,A,end start,A,b,end start,A,c,A,b,A,end start,A,c,A,b,end start,A,c,A,end start,A,end start,b,A,c,A,end start,b,A,end start,b,end"; const PATHS1_P2: &str = r"start,A,b,A,b,A,c,A,end start,A,b,A,b,A,end start,A,b,A,b,end start,A,b,A,c,A,b,A,en...
Rust
0
-> u8; } } // NOTE: Vref/Temperature/Vbat are only available on ADC3 on H7, this currently cannot be modeled with stm32-data, so these are available from the software on all ADCs pub struct Vref; impl<T: Instance> InternalChannel<T> for Vref {} impl<T: Instance> sealed::InternalChannel<T> for Vref { fn channel...
Rust
0
_eq!(invalid_value, None); } #[test] fn successfully_retrieve_element_as_mut_and_modify_bst() { let mut expected_bst = IterativeBST::new(); expected_bst.insert(10); expected_bst.insert(2); let mut actual_bst = IterativeBST::new(); actual_bst.insert(10); actual_bst.insert(5); let _retrieve...
Rust
0
Type::Delete)?; rmp::encode::write_map_len(stream, 3)?; rmp::encode::write_pfix(stream, SPACE_ID)?; rmp::encode::write_u32(stream, space_id)?; rmp::encode::write_pfix(stream, INDEX_ID)?; rmp::encode::write_u32(stream, index_id)?; rmp::encode::write_pfix(stream, KEY)?; rmp_serde::encode::writ...
Rust
0
.min(field.align.abi).restrict_for_offset(target_offset); packed |= effective_field_align < field.align.abi; debug!( "struct_llfields: {}: {:?} offset: {:?} target_offset: {:?} \ effective_field_align: {}", i, field, offset, ta...
Rust
0
from collections import deque n,m=list(map(int,input().split())) nums=list(map(int,input().split())) queue=deque([]) for index,num in enumerate(nums): queue.append((index,num)) while len(queue)>1: index,cur=queue.popleft() if cur>m: queue.append((index,cur-m)) else: continue index,_=queu...
Python
1
(target_accept_ratio: T) -> HmcParam<T> { Self::new(target_accept_ratio, T::zero()) } } impl<T> std::default::Default for HmcParam<T> where T: Float, { fn default() -> Self { HmcParam::new(T::from(0.99).unwrap(), T::from(0.000_001).unwrap()) } } pub fn sample<T, U, V, F, G>( flogpr...
Rust
0
mut self) { self.systems = None; } } <filename>src/util.rs macro_rules! error { ($($args:expr),+) => ({ eprintln!($($args),+); std::process::exit(1); }) } <reponame>alihaihq/alihai-api-server use crate::prelude::*; use hyper::{header::HeaderName, Body, Request}; use std::env; use std::...
Rust
0
Ref, RandomState>>, ) -> Option<Vec<AuTelemetry>> { debug!("handling {} {} {:?}", cmd, root, path); let aumsg: AuMsg<Vec<AuTelemetry>> = AuMsg { data: msg, op: cmd, path: safe_path(path), }; let actor = match roots_shared.get(&root) { Some(actor) => { debug!(...
Rust
0
assert_last_event::<T, I>(Event::TradedSuccessfully(caller, original_amount_in, routes, amount_out).into()); } } impl_benchmark_test_suite!(AMMRoute, crate::mock::new_test_ext(), crate::mock::Runtime,); use std::ops::Deref; use ndarray::{Array2, ArrayView1, Axis}; use serde::{Deserialize, Serialize}; #[...
Rust
0
) -> crate::TestRunner { super::runner() } #[test] fn test() { assert_eq!( runner().ok("@mixin all-vip() {\ \n test: vip;\ \n}\ \n@mixin gold() {\ \n test: gold;\ \n}\ \n@mixin platinum() {\ \n test: platinum;...
Rust
0
Err(get_last_error()) } else { Ok(&*ret_val) } } } } impl Image { /// Destroy the created image pub fn destroy(&self) { unsafe { let self_ = std::mem::transmute(self); fl_image_destroy_impl(self_); } } } <fil...
Rust
0
from beanie import Document from pydantic import BaseModel, Field from typing import Dict, List, Optional, Union from datetime import datetime, timezone, date from pymongo import GEOSPHERE, IndexModel def get_utc_now(): return datetime.now(timezone.utc) class CachedLocation(Document): name: Optional[str] ...
Python
1
er::Div1, lptim::Prescaler::Div2, lptim::Prescaler::Div4, lptim::Prescaler::Div8, lptim::Prescaler::Div16, lptim::Prescaler::Div32, lptim::Prescaler::Div64, lptim::Prescaler::Div128, ]; for (src, pre) in itertools::ipro...
Rust
0
.rs //! Autogenerated: src/ExtractionOCaml/word_by_word_montgomery --lang Rust p192k1_scalar 64 '2^192 - 146402144145231529263189000819' mul square add sub opp from_montgomery to_montgomery nonzero selectznz to_bytes from_bytes //! curve description: p192k1_scalar //! machine_wordsize = 64 (from "64") //! requested ope...
Rust
0
,您可以更换其他职业参与本次团队活动!\n可使用“团队列表”查看该团队的职业人数限制!\n可使用“查看团队”查看该团队目前报名情况!" job_icon = Kungfu(role_actual_type).icon if role_actual_type != "老板" else build_path(ASSETS, ["image", "jx3", "kungfu"], end_with_slash=True) + "老板.png" new = { "role": role_name, "role_type": role_actual_type, ...
Python
1
ern).unwrap(); let mut lister = |name: &str, path: &str| { if let Some(mm) = re.captures(name) { let mask = format!("{}{}_y{}{}_mc{{mc}}{}.txt", mm.get(1).unwrap().as_str(), mm.get(2).unwrap().as_str(), mm.get(3).unwrap().a...
Rust
0
a BSD-style license that can be // found in the LICENSE file. use alloc::collections::hash_map::{Entry, HashMap}; use core::hash::Hash; /// The result of inserting an element into a [`RefCountedHashMap`]. #[cfg_attr(test, derive(Debug, Eq, PartialEq))] pub(crate) enum InsertResult<O> { /// The key was not previo...
Rust
0
t, b: uint32x4_t) -> uint32x4_t { #[allow(improper_ctypes)] extern "C" { #[cfg_attr(target_arch = "arm", link_name = "llvm.arm.neon.vhsubu.v4i32")] #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.uhsub.v4i32")] fn vhsubq_u32_(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t...
Rust
0
1: &[LangInt], arg2: &[LangInt]) -> Vec<ConstValue> { vec![ ConstValue::Vector(arg1.to_vec()), ConstValue::Vector(arg2.to_vec()), ] } fn ok_rect<T>(start: &[LangInt], end: &[LangInt]) -> Result<ConstValue, T> { Ok(ConstValue::Rectangle(start.to_vec(), end.to_vec())) } #[test] fn test_rectan...
Rust
0
rupt the test subject yet but it is already invalid???", ) .into_inner() } #[test] fn test_governance_proto_must_have_root_canister_ids() { let mut proto = basic_governance_proto(); proto.root_canister_id = None; assert!(ValidGovernanceProto::try_from(proto)....
Rust
0
if char not in self.dictionary.keys(): char = 'unk' smiles_matrix[self.dictionary[char], index] = 1 # fill the rest of the matrix with the padding token smiles_matrix[self.dictionary[''], len(tokens):] = 1 return smiles_matrix def inverse_transform(self,...
Python
1
HRESULT, fn get_DocumentAlternate2Font(&self, out: *mut *mut LanguageFont) -> HRESULT }} impl ILanguageFontGroup { #[inline] pub fn get_uitext_font(&self) -> Result<Option<ComPtr<LanguageFont>>> { unsafe { let mut out = null_mut(); let hr = ((*self.lpVtbl).get_UITextFont)(self as *const _ as *...
Rust
0
# matn begire -> code ascii ro zakhire kone # az bozorge be kochik moratab kone total = [] text = "Hello im LearNIng PYThon" # ord print(ord("A")) for i in text: total.append(ord(i)) print(total) total.sort(reverse=True) print(total)
Python
1
os_rendering: Box<dyn ToRenderables> = match line_info { collision::LineInfo::LineBeg(_) => Box::new(self.beg), collision::LineInfo::LineEnd(_) => Box::new(self.end), collision::LineInfo::Point(x, collision::LineSide::Left) => Box::new(self.get_point(1.0 - x)), collision:...
Rust
0
} else { diffuse_radiation * diffuse_function(slope, 0.25227) } } fn diffuse_function(slope: f64, n: f64) -> f64 { ((1. + slope.cos()) / 2.) + (slope.sin() - slope * slope.cos() - PI * (slope / 2.).sin().powf(2.)) * n } <reponame>liangyongrui/sentinel-rust pub mod base; pub mod system_metric; /...
Rust
0