text
string
label_name
string
labels
int64
# Copyright (c) 2022-2024, The Isaac Lab Project Developers. # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause from omni.isaac.lab.sensors import FrameTransformerCfg from omni.isaac.lab.sensors.frame_transformer.frame_transformer_cfg import OffsetCfg from omni.isaac.lab.utils import configclass from om...
Python
1
tions = shop_paths.copy() analyze_partitions = individual_partitions + [all_partitions] for path_idx, this_partition in enumerate(analyze_partitions): sub_robustness_list = [] sub_consistency_list = [] Lambda_list = [] if path_idx < len(individual_partitions): pa...
Python
1
CrossingMode::Normal => "Normal", CrossingMode::Grab => "Grab", CrossingMode::Ungrab => "Ungrab", CrossingMode::GtkGrab => "GtkGrab", CrossingMode::GtkUngrab => "GtkUngrab", CrossingMode::StateChanged => "StateChanged", ...
Rust
0
assert_eq!(heap.peek(), Some(&10)); assert_eq!(heap.pop(), Some(10)); assert!(heap.index_consistent()); assert_eq!(heap.peek(), Some(&9)); assert_eq!(heap.pop(), Some(9)); assert!(heap.index_consistent()); assert_eq!(heap.peek(), Some(&7)); assert_eq!(...
Rust
0
import threading import pyautogui import time # 方法1:通过函数创建 def task(): while True: if pyautogui.locateOnScreen('C:/Users/DELL/PycharmProjects/AUTO/resource/SR/zhandou.png', confidence=0.9, region=(54, 9, 90, 29)): pyautogui.press('v') else: ...
Python
1
rap(); assert_ne!(res.status_code(), UNSUCCESS_CODE); } // Copyright (c) SimpleStaking and Tezedge Contributors // SPDX-License-Identifier: MIT //! This module covers functionality to resolve if node is bootstrapped // TODO: TE-244 - reimplement use std::collections::HashMap; use std::sync::atomic::{AtomicBool, O...
Rust
0
(); assert!(handle(&mut session, request).is_ok()); let mut entries = entries(&session); entries.sort_by_key(|entry| entry.path.clone()); assert_eq!(entries.len(), 3); assert_eq!(path(&entries[1]), Some(file_path)); assert_eq!(path(&entries[2]), Some(hardlink_path)); ...
Rust
0
from time import sleep from base64 import b64encode from random import choice, random, randrange from urllib.parse import quote from urllib3 import disable_warnings from cloudscraper import create_scraper from bot import LOGGER, shorteners_list def short_url(longurl, attempt=0): if not shorteners_list: ...
Python
1
#!/usr/bin/python3 """ Module contains one class """ class MyList(list): """ Class inherits from 'list' Has one method """ def __init__(self): """ initialize the object """ super().__init__() def print_sorted(self): """ method prints a sorted li...
Python
1
7" { // These are not listed in /proc/partitions but generate events return Ok(format!("/dev/loop{}", minor)); } for line in self.proc_partitions.lines().skip(2) { let fields: Vec<&str> = line.split_ascii_whitespace().collect(); if fields[0] == major && f...
Rust
0
nge"); } let mut proof_values = self.query_key_blocks_proofs(mc_seq_no_range).await?; self.add_mc_blocks_file_hashes(&mut proof_values).await?; let mut last_proof = None; for (mc_seq_no, proof_json) in proof_values { let proof = BlockProof::from_value(&proof_json)?;...
Rust
0
import RPi.GPIO as GPIO import time # Pin Definitions enA = 22 in1 = 26 in2 = 6 in3 = 12 in4 = 16 enB = 5 # GPIO setup GPIO.setmode(GPIO.BCM) GPIO.setup(enA, GPIO.OUT) GPIO.setup(in1, GPIO.OUT) GPIO.setup(in2, GPIO.OUT) GPIO.setup(in3, GPIO.OUT) GPIO.setup(in4, GPIO.OUT) GPIO.setup(enB, GPIO.OUT) # Set PWM pwmA = GP...
Python
1
0xcf,0x14,0x13,0x16,0xeb,0xeb,0x0c,0x7b, 0x52,0x28,0xc5,0x2a,0x4c,0x62,0xcb,0xd4, 0x4b,0x66,0x84,0x9b,0x64,0x24,0x4f,0xfc, 0xe5,0xec,0xba,0xaf,0x33,0xbd,0x75,0x1a, 0x1a,0xc7,0x28,0xd4,0x5e,0x6c,0x61,0x29, ...
Rust
0
import pytest @pytest.fixture def transmute_config() -> str: return "simple.toml" @pytest.mark.parametrize( "key,expected", [ ["config.debug", True], ["config.report", 2000], ["principals.default", "User"], ["review_state.filter.allowed", ("visible", "published")], ...
Python
1
A: &str = codes!(95); pub const CYAN: &str = codes!(96); pub const WHITE: &str = codes!(97); } } /// Text (background) highlighting colour pub mod bg { use super::codes; pub const BLACK: &str = codes!(40); pub const RED: &str = codes!(41);...
Rust
0
# Copyright 2025 Emcie Co Ltd. # # 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 agreed to in writing...
Python
1
printer.barcode(code, 'CODE39', width=2, height=60) printer.text("\n") barcode_success = True self.logger.info(f"✅ Código de barras CODE39 con altura: {code}") exc...
Python
1
import hashlib import os import sys from pathlib import Path import yaml from mkdocs import plugins from mkdocs.config.defaults import MkDocsConfig from mkdocs.structure.files import Files from mkdocs.structure.pages import Page sys.path.append(os.path.dirname(os.path.abspath(__file__))) import re from copy import co...
Python
1
return jsonify({"error": "Internal server error"}), 500 @app.route('/api/config') def get_config(): """ Get non-sensitive configuration information Demonstrates separation of sensitive and non-sensitive data """ config = { "environment": os.environ.get('ENVIRONMENT', 'development')...
Python
1
from cryptography.hazmat.primitives.asymmetric import padding from cryptography.hazmat.primitives import hashes from key_management import load_private_key, load_public_key import base64 def encrypt_data(data): """Encrypt data using the public key.""" public_key = load_public_key() encrypted = public_key.e...
Python
1
ion values range from -1 to 1: <ul style='margin: 0.5rem 0;'> <li>1.0: Perfect positive correlation</li> <li>0.0: No correlation</li> <li>-1.0: Perfect negative correlation</li> </ul> The current data shows very weak correlations betwee...
Python
1
oc = "*Required features: `\"Win32_Security_Cryptography_Certificates\"`*"] pub const AllowUntrustedCertificate: InstallResponseRestrictionFlags = 2i32; #[doc = "*Required features: `\"Win32_Security_Cryptography_Certificates\"`*"] pub const AllowUntrustedRoot: InstallResponseRestrictionFlags = 4i32; #[doc = "*Required...
Rust
0
`program_change` - The currently selected program/patch changed /// - `channel` /// - `program` - New program value (0-127) /// - `channel_aftertouch` - Pressure on already held key changes (but not key-specific) /// - `channel` /// - `value` - New level of pressure on whatever is held down /// - `pitch...
Rust
0
{ status_code: http::StatusCode, value: models::ErrorResponse, }, #[error("Failed to parse request URL: {0}")] ParseUrlError(url::ParseError), #[error("Failed to build request: {0}")] BuildRequestError(http::Error), ...
Rust
0
by the module and will be //! transfered here as soon as possible. //! //! A few additional feature flags that enable the use of other crates either //! by adding features to this crate or by implementing traits for types //! defined by those crates. See the overview of feature flags below. //! //! # Overview of Featu...
Rust
0
clone()); } Join::Single(join_predicates) } Join::Mark(mark, additional_predicates) => { for p in additional_predicates { join_predicates.push(p.clone()); } Join::Mark(mark.clone(), join_predicate...
Rust
0
8, u8>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `rf_ext_pa_sb` writer - "] pub struct RF_EXT_PA_SB_W<'a> { w: &'a mut W, } impl<'a> RF_EXT_PA_SB_W<'a> { #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, value: ...
Rust
0
_checker = Arc::new(CheckerTexture::new( &Vec3::new(0.2, 0.3, 0.1), &Vec3::new(0.9, 0.9, 0.9), )); // light checker ball let material2 = Arc::new(DiffuseLight::new(_checker)); world.push(Arc::new(Sphere::new( Vec3::new(4.0, 1.0, 0.0), 1.0, material2, ))); ...
Rust
0
4, 5]); } } //! Tools for creating and manipulating physically simulated ropes. use crate::{ graph::{self, LayerViewMut}, graphics::{Mesh, MeshShape}, math as m, physics::{collision::ROPE_LAYER, Body, Collider, Mass, Material}, }; /// A rope built out of connected particles. /// /// The representat...
Rust
0
ream: TcpStream) -> Result<(), RequestHandlingError> { let mut buffer = [0; 1024]; let _ = stream.read(&mut buffer)?; let mut output_buffer = vec![]; let encoder = prometheus::TextEncoder::new(); let metric_families = prometheus::gather(); if let Err(e) = encoder.encode(&metric_families, &mut o...
Rust
0
_NATIVE_UCHAR_g); extern_static!(H5T_NATIVE_SHORT, H5T_NATIVE_SHORT_g); extern_static!(H5T_NATIVE_USHORT, H5T_NATIVE_USHORT_g); extern_static!(H5T_NATIVE_INT, H5T_NATIVE_INT_g); extern_static!(H5T_NATIVE_UINT, H5T_NATIVE_UINT_g); extern_static!(H5T_NATIVE_LONG, H5T_NATIVE_LONG_g); extern_static!...
Rust
0
from_str(value, DATE_FORMAT).map(|d| d.and_hms(0, 0, 0))?; time_zone .from_local_datetime(&datetime) .single() .ok_or_else(|| err_msg("unable to parse date")) } } use rand::seq::SliceRandom; use rand::thread_rng; use serde::{Deserialize, Serialize}; #[derive(Serialize, D...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- '''Ripyl protocol decode library infrared/rc5.py test suite ''' # Copyright © 2013 Kevin Thibedeau # This file is part of Ripyl. # Ripyl is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published b...
Python
1
{ props.optimal_tiling |= format::ImageFeature::SAMPLED_LINEAR; } if support.OutFormatSupport & d3d11::D3D11_FORMAT_SUPPORT_RENDER_TARGET != 0 { props.optimal_tiling |= format::ImageFeature::COLOR_ATTACHMENT | format::ImageFeature::BLIT_DST; if ca...
Rust
0
Size::new(3.0, 5.0), PriceSize::new(3.5, 4.0), PriceSize::new(4.0, 5.0), PriceSize::new(6.0, 5.0), ] ); PriceSizeBackLadder(&mut ps) .deserialize(&mut deser) .expect("failed to deserialize"); assert_eq!( ...
Rust
0
Pause, Stop, SessionConnect(Session), SessionDisconnect(Session), SessionRemoteConnect(Session), SessionRemoteDisconnect(Session), SessionLogon(Session), SessionLogoff(Session), SessionLock(Session), SessionUnlock(Session), Custom(T), } impl<T> fmt::Display for ServiceEvent<T> ...
Rust
0
import os import random import logging import torch import numpy as np from sklearn.metrics import precision_recall_fscore_support, accuracy_score def init_logger(): logging.basicConfig(format='%(asctime)s - %(levelname)s - %(name)s - %(message)s', datefmt='%m/%d/%Y %H:%M:%S', ...
Python
1
PropertiesValidator().validate_json_schema(json_schema) def test_unit__validate_json_schema__err__missing_title(self): json_schema = { "properties": { "super": {"section": "a long text"}, "something": {"title": "Something"}, } } with p...
Python
1
############################################################################### # # Welcome to Baml! To use this generated code, please run the following: # # $ pip install baml-py # ############################################################################### # This file was generated by BAML: please do not edit ...
Python
1
constant:constant] }; NSLayoutConstraint { ptr: ptr } } /// Stick two views together with a constant of 0 pub fn bind(view1: &NSView, attr1: NSLayoutAttribute, view2: &NSView, attr2: NSLayoutAttribute) -> Self { NSLayoutConstraint::new(view1, a...
Rust
0
ry: return fields_dict(item_class)[field_name].metadata # type: ignore except KeyError: raise KeyError("%s does not support field: %s" % (item_class.__name__, field_name)) elif _is_pydantic_model(item_class): try: return _get_pydantic_model_metadata(item_class, f...
Python
1
#!/usr/bin/env python3 import json import yaml import argparse from typing import Dict, Any class InterfaceTransformer: def __init__(self, mapping_file: str): """Initialize with path to YAML mapping file.""" with open(mapping_file, 'r') as f: self.mapping = yaml.safe_load(f) de...
Python
1
ation ratio. Default: 1. truncation_latent (Tensor | None): The truncation latent tensor. Default: None. inject_index (int | None): The injection index for mixing noise. Default: None. return_latents (bool): Whether to return style latents. Default: False. """ # style...
Python
1
Box::new(Expression::Ident(String::from("y"))), ), body: Box::new(Statement::Block(vec!( Box::new(Statement::Expr(Expression::Ident(String::from("x")))), ))), }), Statement::Expr(Expression::Call { ...
Rust
0
Data) return res def deleteJob(credential, job_id): url = api_url + 'delete' postData = {'credential': credential, 'id': job_id} httpJsonPost(url, postData) def getCredentials(): password_from_envvar = os.environ.get("HSC_SSP_CAS_PASSWORD") user_from_envvar = os.environ.get("HSC_SSP_CAS_USER...
Python
1
urn ret def _inspects( *types: Type[Any], ) -> Callable[[_F], _F]: def decorate(fn_or_cls: _F) -> _F: for type_ in types: if type_ in _registrars: raise AssertionError("Type %s is already registered" % type_) _registrars[type_] = fn_or_cls return fn_or_c...
Python
1
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. from setuptools import setup PACKAGE_NAME = "mozfile" PACKAGE_VERSION = "3.0.0" setup( name=PACKAGE_NAME, vers...
Python
1
, td {class => "package-item-doc"} => { $slf.doc(v.comment.iter().take(1))?; }); }); } }}; } }; } define_processor!(PackageProcessor, Data<'session>, self, process => { self.write_doc(|| { ...
Rust
0
pub fn no_params_fate(self, world: &mut World) { world.send(self.as_raw(), MSG_SomeActor_no_params_fate()); } pub fn init_ish(some_param: usize, world: &mut World) -> Self { let id = SomeActorID::<A, B>::from_raw(world.allocate_instance_id::<SomeActor<A, B>>()); let swarm = world....
Rust
0
table, &b); end_timer!(b_g2_time); // Compute the H-query let h_time = start_timer!(|| "Calculate H"); let mut h_query = FixedBaseMSM::multi_scalar_mul::<E::G1Projective>( scalar_bits, g1_window, &g1_table, &(0..m_raw - 1) .into_par_iter() .map(|i...
Rust
0
ter, type(subparser.arguments[0].completer)) self.assertEqual(LocalObjectCompleter, type(subparser.arguments[1].completer)) self.assertEqual(CloudOrLocalObjectCompleter, type(subparser.arguments[2].completer)) self.assertEqual(NoOpCompleter, typ...
Python
1
same /// transaction was ongoing ConcurrentTransactions = 51, /// Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current /// coordinator for a given producer TransactionCoordinatorFenced = 52, /// Transactional Id authorization failed TransactionalIdAut...
Rust
0
xception {:#x}", ex) } Some(ProcessEnd::Success) => tracing::trace!("Command was successful"), None => tracing::trace!("Command completed"), }; action.outcome(Outcome::DoNothing); return fut } ...
Rust
0
4 = DummyCS; log::info!("Waiting 5 seconds before querying MPU9250..."); systick.delay(4000); match ak8963_init(&mut systick, &mut spi4, &mut cs4) { Ok(()) => (), Err(err) => { log::warn!("Unable to initialize AK8963: {:?}", err); loop { core::sync::a...
Rust
0
from __future__ import absolute_import, division, print_function from cctbx.development import random_structure from cctbx.sgtbx import space_group_info from cctbx_asymmetric_map_ext import * from cctbx.array_family import flex from cctbx import maptbx from six.moves import range result = flex.double() def run_group(...
Python
1
LJ_EPS : f64 = 1.0; const LJ_SIG : f64 = 1.0; const AVG_OUTPUT_INTERVAL : usize = 10; fn main() { let mut filename = "montecarlo.xyz".to_string(); let mut skip: usize = 0; // parse cmd line args let args: Vec<String> = env::args().collect(); for i in 0..args.len() { if args[i] == "-f" { ...
Rust
0
let alloc_fut = pool.alloc_tx_checked(1); futures::pin_mut!(alloc_fut); // The allocation should block. assert_matches!(executor.run_until_stalled(&mut alloc_fut), Poll::Pending); // And the allocation request should be queued. assert!(!pool.tx_alloc_state.lock().request...
Rust
0
n1 = int(input("Digite um numero:")) print(f"O numero digitado foi {n1}")
Python
1
from dash import html, dcc from ..icons.hero import ICON def _contact_button(contact): return dcc.Link([ ICON.CALENDER, contact ], href='#', className='btn btn-sm btn-secondary d-inline-flex align-items-center') def _teamMember(name, picture, text, status, contact): return html.Li([ ...
Python
1
orrsponding file /// - size: of the file #[derive(Debug, Clone)] pub struct DlcLink { pub url: String, pub name: String, pub size: String } impl DlcLink { /// Create a new empty DlcLink structure. fn new() -> DlcLink { DlcLink { url: String::new(), name: String::new(...
Rust
0
rust-nightly-example.toml"); // From brson's live build-rust-manifest.py script static EXAMPLE2: &'static str = include_str!("channel-rust-nightly-example2.toml"); #[test] fn parse_smoke_test() { let x86_64_unknown_linux_gnu = TargetTriple::from_str("x86_64-unknown-linux-gnu"); let x86_64_unknown_linux_musl = ...
Rust
0
n line: self.text_widget.insert(tk.END, line, 'WARNING') elif 'INFO' in line: self.text_widget.insert(tk.END, line, 'INFO') else: self.text_widget.insert(tk.END, line) def scroll_to_end(self): """Scroll to the last line of the text wid...
Python
1
out::MIN); /// ``` /// /// Value too low: /// /// ``` /// use core::time::Duration; /// use stm32wl_hal_subghz::{Timeout, ValueError}; /// /// const LOWER_LIMIT_NANOS: u128 = 7813; /// const TOO_LOW_NANOS: u128 = LOWER_LIMIT_NANOS - 1; /// const TOO_LOW_DURATION: Duration = D...
Rust
0
g from selected [Environment]. /// Returns a Result containing config struct. /// Convenience [load_custom_config]. /// /// # Example /// /// ``` /// # use serde::Deserialize; /// # use avantis_utils::config::load_config; /// # use avantis_utils::config::Environment; /// #[derive(Clone, Debug, Deserialize, PartialEq)] ...
Rust
0
ent( ip_address, port="LPR", label="Print items", timeout=240, ) as lpr: if raw: lpr.send( escp2.EXIT_PACKET_MODE + escp2.INITIALIZE_PRINTER ...
Python
1
(2 * dx) # Exz = 0.5 * (Uk[2:, :, :] - Uk[:-2, :, :]) / tf.maximum(DZ2, thr) # Eyz = 0.5 * (Vk[2:, :, :] - Vk[:-2, :, :]) / tf.maximum(DZ2, thr) # Exx = tf.where(DZ2 > 1, Exx, 0.0) # Eyy = tf.where(DZ2 > 1, Eyy, 0.0) # Ezz = tf.where(DZ2 > 1, Ezz, 0.0) # Exy = tf.where(DZ2 > 1, Exy, 0.0) # ...
Python
1
sum = 1 num=int(input('Enter a number: ')) for x in range (num,0,-1): sum *= x print(f"The factorial of {num} is {sum}")
Python
1
if SPUEN is set to 0\nSPROM is programmed at SPROM secured mode.\nPage Erase command at LOCK mode with ICE connection\nErase or Program command at brown-out detected\nDestination address is illegal, such as over an available range.\nInvalid ISP commands\nNote: This bit is write-protected. Refer to the SYS_REGLCTL regi...
Rust
0
_display_word = search_phrase_token.lemma_ else: search_phrase_display_word = search_phrase_token._.holmes.lemma word_match = WordMatch( search_phrase_token=search_phrase_token, search_phrase_word=search_phra...
Python
1
s for Texinfo output ---------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'drheader', u'drHEADer Documentation', author, ...
Python
1
te let_match_macro; /// # use let_match_macro::m; /// # /// # #[derive(Debug)] /// # enum Example { /// # A(String), /// # B { /// # x: String, /// # y: u32, /// # }, /// # C(u32, u32), /// # } /// # use self::Example::*; /// # /// # fn main() { /// let mut e = B { x: "Hello".into(), y: ...
Rust
0
ULONGLONG, }} BITFIELD!{SLIST_HEADER_HeaderX64 BitFields1: ULONGLONG [ Depth set_Depth[0..16], Sequence set_Sequence[16..64], ]} BITFIELD!{SLIST_HEADER_HeaderX64 BitFields2: ULONGLONG [ Reserved set_Reserved[0..4], NextEntry set_NextEntry[4..64], ]} UNION!{union SLIST_HEADER { [u64; 2], s s_mut...
Rust
0
e| *e).sum(); let modulus_bits = <F as PrimeField>::size_in_bits(); let out_mac_keys = vec![F::zero(); layers.len()]; let out_mac_shares = vec![F::zero(); activations]; let inp_mac_keys = vec![F::zero(); layers.len()]; let inp_mac_shares = vec![F::zero(); activations]; let labels: Vec<(Block, B...
Rust
0
ule<C>, builder: &mut CodeBuilder<C>, ) -> bool { have_memory(module, builder) && module.config.bulk_memory_enabled() && builder.types_on_stack(&[ValType::I32, ValType::I32, ValType::I32]) } fn memory_fill<C: Config>( u: &mut Unstructured, module: &ConfiguredModule<C>, builder: &mut...
Rust
0
; pub const MCHT_CALENDARDATEPREV: UINT = MCHT_CALENDARDATE | MCHT_PREV; pub const MCHT_CALENDARDAY: UINT = MCHT_CALENDAR | 0x0002; pub const MCHT_CALENDARWEEKNUM: UINT = MCHT_CALENDAR | 0x0003; pub const MCHT_CALENDARDATEMIN: UINT = MCHT_CALENDAR | 0x0004; pub const MCHT_CALENDARDATEMAX: UINT = MCHT_CALENDAR | 0x0005;...
Rust
0
if the value of the field is `TCLK0`"] #[inline] pub fn is_tclk0(&self) -> bool { *self == TC0XC0SR::TCLK0 } #[doc = "Checks if the value of the field is `NO_CLK`"] #[inline] pub fn is_no_clk(&self) -> bool { *self == TC0XC0SR::NO_CLK } #[doc = "Checks if the value of the...
Rust
0
rcase. if self.jurisdiction_code: slug = f"{self.unit}_{self.version}_{self.jurisdiction_code}" else: slug = f"{self.unit}_{self.version}" slug = slug.replace(".", "") slug = slug.lower() return slug def identifier(self): """ Returns e...
Python
1
import os from kitty.boss import Boss # import json # class CustomEncoder(json.JSONEncoder): # def default(self, obj): # try: # return vars(obj) # except TypeError: # return str(obj) def main(args: list[str]) -> str: pass from kittens.tui.handler import result_handle...
Python
1
::Option<&str> { self.last_modified.as_deref() } /// <p>The SHA256 hash of the function's deployment package.</p> pub fn code_sha256(&self) -> std::option::Option<&str> { self.code_sha256.as_deref() } /// <p>The version of the Lambda function.</p> pub fn version(&self) -> std::op...
Rust
0
{ to_lower!($d, $src, 28); $d[28] = table[$src[28] as usize]; }; ($d:ident, $src:ident, 30) => { to_lower!($d, $src, 29); $d[29] = table[$src[29] as usize]; }; ($d:ident, $src:ident, 31) => { to_lower!($d, $src, 30); $d[30] = table[$src[30] as usize]; }; ($d:ident, $src:ident, 32) => { to_lower...
Rust
0
k_EStreamDeviceFormFactorUnknown = 0, k_EStreamDeviceFormFactorPhone = 1, k_EStreamDeviceFormFactorTablet = 2, k_EStreamDeviceFormFactorComputer = 3, k_EStreamDeviceFormFactorTV = 4, } impl ::protobuf::ProtobufEnum for EStreamDeviceFormFactor { fn value(&self) -> i32 { *self as i32 } ...
Rust
0
"""Brute Force""" # class Solution: # def maxArea(self, heights: List[int]) -> int: # max_water = 0 # for i in range(len(heights)): # for j in range(i+1, len(heights)): # w = j - i # h = min(heights[i], heights[j]) # max_water = max(max_...
Python
1
pub fn adpll_adc_vref_coarse(&self) -> ADPLL_ADC_VREF_COARSE_R { ADPLL_ADC_VREF_COARSE_R::new(((self.bits >> 8) & 0x03) as u8) } #[doc = "Bits 4:5"] #[inline(always)] pub fn adpll_adc_vref_fine(&self) -> ADPLL_ADC_VREF_FINE_R { ADPLL_ADC_VREF_FINE_R::new(((self.bits >> 4) & 0x03) as ...
Rust
0
CERT_MANIFOLD: &'static str = "1.3.6.1.4.1.311.20.3"; pub const szOID_CERTSRV_CA_VERSION: &'static str = "1.3.6.1.4.1.311.21.1"; pub const szOID_CERTSRV_PREVIOUS_CERT_HASH: &'static str = "1.3.6.1.4.1.311.21.2"; pub const szOID_CRL_VIRTUAL_BASE: &'static str = "1.3.6.1.4.1.311.21.3"; pub const szOID_CRL_NEXT_PUBLISH: &...
Rust
0
e(m, nn.Conv1d) or isinstance(m, nn.ConvTranspose1d) or isinstance(m, nn.Conv2d) or isinstance(m, nn.ConvTranspose2d) ): m.weight.data.normal_(0.0, 0.02) self.apply(_reset_parameters) class NLayerSpecDiscriminator(nn.Module): """...
Python
1
from scatter import * draw_scatter_chart( "scatter_chart.png", ["包数", "丢包数"], ["12", "23", "34", "45", "56", "67", "78", "89"], [ [20,30], [40,50], [60,70], [80,90], [100,110], [120,130], [140,150], [160,170], ] )
Python
1
# 控制每次循环的间隔,避免过于频繁地调用 if start_time % 60 < 58: time.sleep(1) continue # 获取最新的数据 feature_df = get_latest_data(max_candles=500) # 获取看涨模型的预测结果 result_dfs_up = [predictor.predict(new_data_path) for predictor in predictors_up] ...
Python
1
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
Returns: True if log scale should be used, False otherwise """ try: # Remove NaN values and ensure positive values for log scale clean_data = data.dropna() if clean_data.empty or (clean_data <= 0).any(): return False ...
Python
1
-msvc let target_components: Vec<_> = target.as_str().split("-").collect(); // We check that we're building for Windows. This code assumes that the layout in // CUDA_PATH matches Windows. if target_components[2] != "windows" { panic!( "The CUDA_PATH variable ...
Rust
0
e => VertexType::Light, } } } #[derive(Debug, Copy, Clone, PartialEq)] pub struct SurfaceVertex { pub vertex_type: VertexType, pub time: f32, pub lambda: f32, pub local_wi: Vec3, pub point: Point3, pub normal: Vec3, pub uv: (f32, f32), pub material_id: MaterialId, pub in...
Rust
0
FF\xFF\xFF\xFC": SASIndex.column_attributes_index, b"\xFC\xFF\xFF\xFF\xFF\xFF\xFF\xFF": SASIndex.column_attributes_index, b"\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFC": SASIndex.column_attributes_index, b"\xFE\xFB\xFF\xFF": SASIndex.format_and_label_index, b"\xFF\xFF\xFB\xFE": SASIndex.format_and_label_index, ...
Python
1
ad).json() for tick in interim_result: ticks.append(tick) if len(interim_result) != 1000: maxed_out = False # check median tick timestamp matches start_iso median_dt = parser.parse(ticks[int((len(ticks) / 2))]['timestamp']) match_dt = parser.parse(st...
Python
1
::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [ledc_lsch3_hpoint](...
Rust
0
(), } println!("Contrasting chess not available yet..."); return false.into(); } _ => { return false.into(); } } return true.into(); } fn to_java_piece_type_chess( piece: &chess_like::RawSquare<chess::ChessPiece, chess_like::DefaultC...
Rust
0
assets::Assets>, audio_output: &Res<Audio>, ) { if weapon.repeat_timer.finished() { projectile::spawn(&mut commands, &asset_server, &assets, &audio_output, transform); weapon.repeat_timer.reset(); } } pub struct Laser { pub despawn_timer: Timer, } pub struct Damage { pub value: u32...
Rust
0
eam()`](templates_add_for_team). pub template_id: TemplateId, } impl UpdateTemplateResult { pub fn new(template_id: TemplateId) -> Self { UpdateTemplateResult { template_id, } } } const UPDATE_TEMPLATE_RESULT_FIELDS: &[&str] = &["template_id"]; impl UpdateTemplateResult { p...
Rust
0
guments: model_name(str): Initial model name of the chain. Defaults to config file temperature(float): Initial temperature value of the chain. Defaults to config file verbose(bool): Initial verbose value of the chain. Defaults to config file Returns: ...
Python
1
#!/usr/bin/env python3 # https://dmoj.ca/problem/ccc97s1 def generate_sentences(subjects: list[str], verbs: list[str], objects: list[str]) -> list[str]: """Generate all possible sentences in alphabetical order. Args: subjects: List of subject phrases verbs: List of verb phrases ob...
Python
1
alyzer function def simple_emotion_analyzer(text: str) -> Dict[str, float]: """A very simple emotion analyzer that looks for key words.""" emotions = { "sadness_joy": 0.0, "fear_courage": 0.0, "distrust_trust": 0.0 } # Simple keyword match...
Python
1