text
string
label_name
string
labels
int64
*self == LPO1KCLKEN_A::LPO1KCLKEN_1 } } impl core::ops::Deref for LPO1KCLKEN_R { type Target = crate::FieldReader<bool, LPO1KCLKEN_A>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `LPO1KCLKEN` writer - 1 kHz LPO_CLK enable"] pub struct LPO1KCLKEN_W<'a> { ...
Rust
0
un and 'archivalTargetResults' in run['archivalInfo'] and len(run['archivalInfo']['archivalTargetResults']) > 0: for archive in run['archivalInfo']['archivalTargetResults']: archiveTarget = archive['targetName'] archiveStatus = archive['status'] ...
Python
1
"isVideoSource": 0, "jumpUrl": "https://image.baidu.com/search/detail?adpicid=0&b_applid=11804063332518040958&bdtype=0&commodity=&copyright=&cs=3270825213%2C1961946507&di=7531461114744274945&fr=click-pic&fromurl=http%253A%252F%252Fwww.imeitou.com%252Fdongwu%252F258981.html&gsm=96&hd=&heigh...
Python
1
newgroup = [] box = (new_row,new_col) group = link_groups.get(box, [box]) for r,c in group: box_move = [] box_new_row = (r+delta_row)%ROWS box_new_col = (c+delta_col)%COLS box_target_tile = board[box_new_row][box_new_col] box_move.app...
Python
1
as i32); fdb::start_network(); } let fdb_database = fdb::open_database(fdb_cluster_file)?; let rt = Runtime::new()?; let cloned_fdb_database = fdb_database.clone(); rt.block_on(async { let fdb_database = cloned_fdb_database; let committed_version = fdb_database ...
Rust
0
0 Calibration Trigger Bit\nNote 1: Before this bit is enabled,ACMPEN(ACMP_CTL0) should be set and the internal high speed RC oscillator (HIRC) should be enabled in advance.\nNote 2: Hardware will auto clear this bit when next calibration is triggered by software\nNote 3: If user must trigger calibration twice or more ...
Rust
0
#!/usr/bin/env vpython3 # Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. # # Use of this source code is governed by a BSD-style license # that can be found in the LICENSE file in the root of the source # tree. An additional intellectual property rights grant can be found # in the file PATENTS. Al...
Python
1
(1, Bytes::default()), (2, "456".into()), (3, "123".into()) ] ) }], &replica.transport[i] ); }); assert!(replica.window.decisions().is_empty()); ...
Rust
0
_base_ = 'mask_rcnn_r50_caffe_fpn_syncbn-all_rpn-2conv_lsj_100e_coco.py' fp16 = dict(loss_scale=512.)
Python
1
"""Touchscreen input device implementation.""" from . import _core from .base import DeviceDefinition, VirtualDevice # Default device definition for touchscreen DEFAULT_TOUCHSCREEN = DeviceDefinition( name="Wolf (virtual) touchscreen", vendor_id=0xAB00, product_id=0xAB03, version=0xAB00, ) class Tou...
Python
1
kernel (physical 0x0 ~ 0xf0000), 960K. setup(768, &mut PTES[1], 0x0, 0, 240); // leave a memory hole here as guard pages. // 0xc0400000 ~ 0xc0c00000 for memory pool (physical 0x100000 ~ 0x900000), 8M. setup(769, &mut PTES[2], 0x100000, 0, 1024); setup(770, &mut PTES[3], 0x500000, 0, 1024); unsafe { ...
Rust
0
// idea is that the WAY that the caller proves // that may change in the future and we want to // give ourselves room to get smarter here. vec![], Component::UnresolvedInferenceVariable(..) => ve...
Rust
0
/// The client is connected to the channel. const CONNECTED = 1; /// The client is connecting to the channel. const CONNECTING = 2; /// The current user is marked away. const MARKED_AWAY = 4; /// The MOTD has ended. const END_OF_MOTD = 8; /// The chan...
Rust
0
rFragment { fn split_off_allowed_ips(peer: Peer<'_>) -> Result<(Self, Vec<AllowedIp<'_>>), SerError> { let mut partial_peer = Nlattr::new::<Vec<u8>>(None, NlaNested::Unspec | NLA_F_NESTED, vec![])?; let public_key = Nlattr::new(None, WgPeerAttribute::PublicKey, peer.public_key.to_vec())...
Rust
0
TILE_SIZE as u8 - 1, 0, PIXEL_WIDTH as i8, )); } segments.push(PixelSegment::new( false, 0, -1, 0, 0, TILE_SIZE as u8 - 1, 0, PIXEL_WIDTH as i8, ...
Rust
0
from Bio import Entrez import re import sys def extract_sequence_id(alignment_file): with open(alignment_file, 'r') as file: content = file.read() # Extract sequence ID from the alignment file match_id = re.search(r'Sequence ID:\s*(\S+)', content) if match_id: return mat...
Python
1
from odoo import models, fields, api, _ class LoanConfiguration(models.Model): _name = 'loan.configuration' _inherit = ['mail.thread', 'mail.activity.mixin'] _description = 'Loan Configuration' name = fields.Char(string='Name', required=True) loan_type = fields.Selection([('short_term_loan', 'Sho...
Python
1
) => {Ok(Sv2Message::ChannelEndpointChanged(*v))} CSv2Message::SetupConnection(v) => { Ok(Sv2Message::SetupConnection(v.to_rust_rep_mut()?)) } CSv2Message::SetupConnectionError(v) => { Ok(Sv2Message::SetupConnectionError(v.to_rust_rep_mut()?)) ...
Rust
0
од домофона: {codes['entry_code']}\n" if codes.get("digital_lock_code"): message += f"🔐 Код замка: {codes['digital_lock_code']}\n" if codes.get("key_safe_code"): message += f"🔑 Код сейфа: {codes['key_safe_code']}\n" if codes.get("owner_phone"): message +=...
Python
1
ta.push_subject_triple(); ta.try_push_predicate(|b| iri(b, "d"))?; ta.try_push_object(|b, _| sl(b, "e"))?; assert_eq!(format!("{}", ta.top()), r#"<< _:a <b> "c" >> <d> "e""#); Ok(()) } #[test] fn nested_triple_as_object() -> Result<(), Infallible> { let mut ta...
Rust
0
msgh_body: mach_msg_body_t, pub entry_handle: mach_msg_port_descriptor_t, } impl ::std::clone::Clone for Struct_Unnamed460 { fn clone(&self) -> Self { *self } } impl ::std::default::Default for Struct_Unnamed460 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } pub type __Reply__mach_memory_obje...
Rust
0
e_negative = true; } while let Some(&ch) = z.peek() { match ch { '0'..='9' => { let digit = ch.to_digit(10).ok_or_else(|| { format_err!("invalid digit in numeric literal: {}", s) ...
Rust
0
for i in range(len(per_class_IoU)): self.log( f"IoU_{i}", per_class_IoU[i], prog_bar=False, logger=True, sync_dist=True, rank_zero_only=True, ) # self.save() # @rank_zero_only # def ...
Python
1
from utils import cur_time class QueueManager: def __init__(self, queues): self.queues = queues def get_delegate_queue(self): return self.queues.delegate_queue def get_submitted_job_queue(self): return self.queues.submitted_job_queue def get_waiting_job_queues(self): return self.queues.waitin...
Python
1
import logging from apscheduler.schedulers.asyncio import AsyncIOScheduler from sqlalchemy import select from sqlalchemy.ext.asyncio import async_sessionmaker from app.bot.services import ReferralService from app.db.models import ReferrerReward from datetime import datetime logger = logging.getLogger(__name__) as...
Python
1
nstant index //! such as `array[0]`, the macro will try to convert the index `0` to a float type, which //! would clearly fail. Thankfully, in most cases these examples will outright fail to compile //! because of type mismatch. One possible resolution to this problem is to use the separate //! macros `replace_float_li...
Rust
0
str!(self.key), Comment: pwstr!(u16cstr!("tunet-rust")), LastWritten: FILETIME::default(), CredentialBlobSize: value.len() as _, CredentialBlob: value.as_ptr() as _, Persist: CRED_PERSIST_LOCAL_MACHINE, AttributeCount: 0, ...
Rust
0
0x100, 3); assert_eq!("[085F:0100] 6621CB And32 ebx, ecx [085F:0103] 6681E311225544 And32 ebx, 0x44552211 [085F:010A] 6625AADDEEFF And32 eax, 0xFFEEDDAA", res); } #[test] fn can_disassemble_cmp32() { let mut machine = Machine::deterministic(); let code: Vec<u8> = vec![ 0x6...
Rust
0
.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [prince_region0_iv_body5](prince_region0_iv_body5) module"] pub type PRINCE_REGION0_IV_BODY5 = crate::Reg<u32, _PRINCE_REGION0_IV_BODY5>; #[allow(missing_docs)] #[doc(hidden)] pub struct _PRINCE_REGION0_IV_BODY5; #[doc = "`read()` met...
Rust
0
n = 5; /// let k = 3; /// let xs = decode(n, k); /// assert_eq!(encode(&xs), 5); /// ``` /// /// See [`decode_mut`] for a version that writes the combination to a provided slice. /// /// # Panics /// /// Panics in debug mode if `n > 0 && k == 0`. /// /// # Examples /// /// ```rust /// # use number_encoding::combinadics...
Rust
0
_ => () } } }); Ok(()) }) } /// ROS API main routine. pub fn start_ros_api<N, B, E, P, RA>( network: Arc<N>, client: Arc<Client<B, E, P::Block, RA>>, pool: Arc<Pool<P>>, keystore: &Keystore, on_exit: impl Future<Item=(),Error=()>...
Rust
0
.iter() .map(|d| d.substitute(ctx)) .collect::<Result<_, _>>()?; Ok(Lambda { result, deps, ty, def_region, }) } } impl ValueData for Lambda {} substitute_to_valid!(Lambda); debug_from_display!(Lambda); pretty_display!...
Rust
0
<button name="button" value="ความรู้สึก" type="submit">ความรู้สึก</button> </form> </body> </html> """ @app.route('/submit', methods=['POST']) def submit(): button_clicked = request.form['button'] if button_clicked == 'ตรวจจับวัตถุ': playsound("speech1.mp3") process...
Python
1
>>> x = np.arange(0, n+1) >>> pmf_dogs = rv.pmf(x) >>> fig = plt.figure() >>> ax = fig.add_subplot(111) >>> ax.plot(x, pmf_dogs, 'bo') >>> ax.vlines(x, 0, pmf_dogs, lw=2) >>> ax.set_xlabel('# of dogs in our group of chosen animals') >>> ax.set_ylabel('hypergeom PMF') >>> plt.show() Instead of using a frozen distribu...
Python
1
# 메모이제이션 기법을 사용해서 피보나치 수 구하기 문제를 해결한 소스 코드 # 한 번 계산된 결과를 메모이제이션(Memoization)하기 위한 리스트 초기화 memo = [0] * 100 # 피보나치 함수를 재귀함수로 구현(Top-down Dynamic Programming) def fibo(x): # 종료 조건(1 혹은 2일 때 1을 반환) if x == 1 or x == 2: return 1 # 이미 계산한 적 있는 문제라면 그대로 반환 if memo[x] != 0: return memo[x] # 아직 계산하지 않은 문제라면 점화식에...
Python
1
import subprocess import subsync_plex.subsync_service as service class DummyData: def __init__(self, media_id, entity_id=None, audio_lang=None, sub_lang=None): self.media_id = media_id self.entity_id = entity_id self.audio_lang = audio_lang self.sub_lang = sub_lang def test_proc...
Python
1
{ // Get the cursor let cursor = cursor(); // get the cursor position. let (x, y) = cursor.pos(); println!("{} {}", x, y); } /// Move the cursor 3 up | demonstration. pub fn move_up() { // Get the cursor let mut cursor = cursor(); // Move the cursor to position 3 times to the up in t...
Rust
0
); }, 0xD413 => { self.voices[2].attack_add = EG_TABLE[ (value >> 4) as usize ]; self.voices[2].decay_sub = EG_TABLE[ (value & 0x0F) as usize ]; }, 0xD414 => { self.voices[2].sustain_level = 0x111111 * (value >> 4) as u32; ...
Rust
0
('ipmi', 'Temp 25', 'unit', 'degrees C'), ('ipmi', 'Temp 26', 'value', '31'), ('ipmi', 'Temp 26', 'unit', 'degrees C'), ('ipmi', 'Temp 27', 'value', 'disabled'), ('ipmi', 'Temp 28', 'value', '26'), ('ipmi', 'Temp 28', 'un...
Python
1
index - 1 } } } } fn compute_r(k: usize, c: f32, delta: f32) -> f32 { c * ((k as f32) / delta).ln() * (k as f32).sqrt() } fn compute_m(k: usize, r: f32) -> usize { ((k as f32) / r).floor() as usize } fn compute_beta(k: usize, m: usize, r: f32, delta: f32) -> f32 { ...
Rust
0
rue except Exception as e: error_msg = f"更新汇率失败: {str(e)}" print(error_msg) return False def show_menu(self): while True: os.system('cls' if os.name == 'nt' else 'clear') print("\n=== VPS到期监控 ===") print() ...
Python
1
=> CommitmentConfig::root(), "single" => CommitmentConfig::single(), "singleGossip" => CommitmentConfig::single_gossip(), _ => CommitmentConfig::default(), }) } #[cfg(test)] mod tests { use super::*; use clap::{App, Arg}; use solana_sdk::signature::write_keypair_file; use s...
Rust
0
icted') fig.savefig(Path(save_dir) / 'confusion_matrix.png', dpi=250) except Exception as e: print(f'WARNING: ConfusionMatrix plot failure: {e}') def print(self): for i in range(self.nc + 1): print(' '.join(map(str, self.matrix[i]))) def bbox_iou(box1, box2, x1...
Python
1
import os from PIL import Image def redimensionar_imagens(novo_tamanho): for arquivo in os.listdir(): if arquivo.lower().endswith('.png'): # Abre a imagem PNG imagem = Image.open(arquivo) # Redimensiona a imagem mantendo o conteúdo original centralizado ...
Python
1
uccess_group) ) # Now we do the same for the failures - the only difference # here is that failure_threshold is # # 1 + (num_children - success_threshold) # # because of the semantics of Parallel explained in the class # docstring # The minim...
Python
1
import os from dotenv import load_dotenv load_dotenv() # uvicorn settings app_host = os.environ.get("APP_HOST", "127.0.0.1") app_port = int(os.environ.get("APP_PORT", 8000)) app_root = os.environ.get("APP_ROOT", "") app_root = "" if app_root == "/" else app_root app_url = os.environ.get("APP_URL", "https://up.turou....
Python
1
height of the 'hills'. A value of around 55 (times) gives reasonable results for Earth-based DEMs. The default value is system-dependent. self.reliefFactor = reliefFactor #: Colour Channels are identified by a system and data-dependent character identifier. Contrast enhancement may be applied to each c...
Python
1
can_hold(&self, other: &Rectangle) -> bool { self.width > other.width && self.height > other.height } } // To call this associated function, we use the :: syntax with the struct name fn main() { let sq = Rectangle::square(10); println!("{:?}", sq); } main(); }...
Rust
0
#!/usr/bin/python3 import btrfs import errno import sys if len(sys.argv) < 3: print("Usage: {} <vaddr> <mountpoint>".format(sys.argv[0])) sys.exit(1) def using_v1(fd, vaddr): return btrfs.ioctl.logical_ino(fd, vaddr) def using_v2(fd, vaddr): inodes, bytes_missed = btrfs.ioctl.logical_ino_v2(fd, va...
Python
1
import sys from src.logger import logging def error_message_detail(error, error_detail: sys): _, _, exc_tb = error_detail.exc_info() file_name = exc_tb.tb_frame.f_code.co_filename # Create the detailed error message error_message = "Error occurred in python script name [{0}] line number [{1}] error m...
Python
1
receiptsRoot: HexBytes sealFields: Sequence[HexStr] sha3Uncles: HexBytes size: int stateRoot: HexBytes timestamp: Timestamp totalDifficulty: HexStr transactions: Sequence[HexBytes] transactionsRoot: HexBytes uncles: Sequence[HexBytes] # # txpool types # # syntax b/c "from" keywo...
Python
1
undNumOf<I>, CoordNum = CoordNumOf<I>, Yea = YeaOf<I>, Nay = NayOf<I>, Abstain = AbstainOf<I>, >, B: Buffer<RoundNum = RoundNumOf<I>, CoordNum = CoordNumOf<I>, Entry = LogEntryOf<I>>, { pub(crate) async fn spawn( kit: StateKeeperKit<I>, args: SpawnAr...
Rust
0
_27D(): pass label('loc_27D') Jump('loc_2A0') def _loc_280(): pass label('loc_280') If( ( (Expr.TestScenaFlags, ScenaFlag(0x007F, 4, 0x3FC)), (Expr.Eval, "OP_29(0x0020, 0x00, 0x10)"), Expr.Nez64, (Expr.Eval, "OP_29(0x0020, 0x00, 0x40)"), ...
Python
1
.index) # List of all pathway names GeneSymbols = [] # List of all pathway gene sets # Import the pathway gene set into GeneSymbols in the correct way for i in Pathways: A = BP_data.loc[i] A = A.dropna() Temp_list = [] for value in A: ...
Python
1
# 导包 import carla import time import math import sys import torch from RSSModel import RSSModel from FrenetCoordinateSystem import FrenetCoordinateSystem import pygame import numpy as np import weakref from collections import deque import threading from scipy.interpolate import splprep, splev sys.path.append('/home/mo...
Python
1
remove this cast somehow? if genes[i] == i as i8 { result += 1; } } return result; } // Assumes population is sorted fn find_best(population: [Chromosome; POPULATION_SIZE]) -> Chromosome { return population.last().expect("Population was empty, somehow").to_owned(); } // Assume...
Rust
0
""" ¿Está en el rango? • Escriba una función que permita determinar si un número se encuentra en un rango determinado. • La función debe tener como parámetros el número a testear, el valor inferior del rango, el valor superior del rango. • La función debe retornar True si el número está en el rango; caso contrario...
Python
1
on::PERM, } #[doc = r"Register block"] #[doc = "Unspecified"] pub mod flashregion; #[doc = r"Register block"] #[repr(C)] pub struct RAMREGION { #[doc = "0x00 - Description cluster: Access permissions for RAM region n"] pub perm: self::ramregion::PERM, } #[doc = r"Register block"] #[doc = "Unspecified"] pub mod ...
Rust
0
4 * k_seq:4 + 4 * k_seq], K=4) for n_seq in seq(0, 8, pragma_unroll=0): for k_seq in seq(0, 4, pragma_unroll=0): S...
Python
1
#!/usr/bin/env python3 import rospy from mavbase.MAV import MAV import numpy as np import math def go(): rospy.init_node("mav_test") mav = MAV("1") altitude = 0.6 takeoff_alt = altitude start_x = 0 radius = 0.5 start_y = radius start_yaw = -math.pi/2 circle_discretization = 20 ...
Python
1
ObjectTransform, pub model: Option<PrefabBasicAssetDataObjectModel>, pub light: Option<PrefabBasicAssetDataObjectLight>, } #[derive(TypeUuid, Serialize, Deserialize, Clone, Debug)] #[uuid = "1af63a91-de3e-48fc-8908-ab309730b8b5"] pub struct PrefabBasicAssetData { pub objects: Vec<PrefabBasicAssetDataObject...
Rust
0
# In this section, I solved LeetCode # 88 "Merge Sorted Array". The problem statement reads as: # You are given two integer arrays nums1 and nums2, sorted in non-decreasing order, and two integers m and n, # representing the number of elements in nums1 and nums2 respectively. Merge nums1 and nums2 into a single array #...
Python
1
#!/usr/bin/python3 a = 98 """Simple variable """
Python
1
from pathlib import Path from pydantic import field_validator from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): BASE_PATH: Path = Path(__file__).parent.parent.parent model_config = SettingsConfigDict( env_file=BASE_PATH / '.env', env_file_encoding='utf-8', ex...
Python
1
self.missions_succeeded_epic_arc = Some(missions_succeeded_epic_arc); } pub fn with_missions_succeeded_epic_arc(mut self, missions_succeeded_epic_arc: i64) -> GetCharactersCharacterIdStatsPve { self.missions_succeeded_epic_arc = Some(missions_succeeded_epic_arc); self } pub fn missions_succeeded_...
Rust
0
ted_fault_type == "Invalid_DA": self._requested_fault_type = "Invalid DA" if self._requested_fault_type == "Invalid_U": self._requested_fault_type = "Invalid U" if self._requested_fault_type == "Invalid_X": self._requested_fault_type = "Invalid X" if self._req...
Python
1
he field `P1_29`" ] # [ derive ( Clone , Copy , Debug , PartialEq ) ] pub enum P1_29R { # [ doc = "GPIO P1.29" ] GPIO_P1, # [ doc = "MCOB2" ] MCOB2, # [ doc = "PCAP1.1" ] PCAP1, # [ doc = "MAT0.1" ] MAT0, } impl P1_29R { # [ doc = r...
Rust
0
from elements.element_creator import DrawElement, \ Position, Offset, AnchorConfig class TitleImage(DrawElement): POS = Position(40, 35, 315, 75) class TicketListTitle(DrawElement): POS = Position(0, 0, 265, 30) INPUT = "TICKET LIST" ANCHOR = {'left':'left', 'bottom':'bottom'} ANCHOR_CONFIG...
Python
1
""" Tests that bool types work """ import lldb from lldbsuite.test.lldbtest import * import lldbsuite.test.lldbutil as lldbutil class CPPTestDiamondInheritance(TestBase): mydir = TestBase.compute_mydir(__file__) def test_with_run_command(self): """Test that virtual base classes work in when SBValue ...
Python
1
x = &mut x[sz..]; } Ok(()) } use axum_debug::debug_handler; use std::future::Future; #[debug_handler] fn handler() -> impl Future<Output = ()> { async {} } fn main() {} <gh_stars>1-10 // Copyright (C) 2020 - 2022, J2 Innovations //! Zinc identifier decoding use super::scanner::Scanner; use std::io::{Er...
Rust
0
.watch( format!("{}/.beamium", env!("HOME")), RecursiveMode::Recursive, ) .with_context(|err| { format!( "could not put a watch on '{}/.beamium', {}", ...
Rust
0
import json import os from typing import Dict, Any, List, Optional import comfy.samplers import comfy.sd import comfy.utils import re import importlib # 名词定义 # “悲伤的”、“情绪的”、“愤怒的”、“快乐的”、“令人振奋的”、“强烈的”、“浪漫的”、“忧郁的” EMOTIONS = [ "sad", "emotional", "angry", "happy", "uplifting", "intense", "romantic", "melancholic" ...
Python
1
_string(), log_color: COLOR_WHITE, }; ctx.window.keypad(true); noecho(); ctx.window.nodelay(true); ctx.log_msg.insert_str(0,ctx.entries[ctx.cur_entry].description.as_ref()); ctx } fn add_entry(&mut self, ent: Entry, parent_menu: DefaultKey) -> Default...
Rust
0
: Data<Store>, mem_pool_state: Data<Arc<MemPoolState>>, ) -> Result<JsonH256, RpcError> { let (account_id, key, block_number) = match params { GetStorageAtParams::Tip(p) => (p.0, p.1, None), GetStorageAtParams::Number(p) => p, }; let value = match block_number { Some(block_numbe...
Rust
0
for method in methods: if "georisk5" + metric not in methods_dics[method]: methods_dics[method]["georisk5" + metric] = [] r = [georisk[cont]] * size methods_dics[method]["georisk5" + metric].extend(r) cont += 1 g_metrics = [] for m...
Python
1
# Set of useful utilities when running an integration test import math from core import Core from typing import Tuple from camera.mock import MockCamera from dronekit import Vehicle RADIUS_OF_EARTH = 6378100.0 # in meters Environment = Tuple[Vehicle, MockCamera, Core] def headingDiff(h1, h2) -> int: ''' Th...
Python
1
{ _cfg2 = q.0; r = q.1; } Err(e) => return Err(e), } if r.is_zero() { heu_poly = heu_poly.mul_scalar(gcd_val); return Ok((heu_poly, _cff2, _cfg2)); ...
Rust
0
mail_url = "https://tempmail.plus" logging.info("正在生成随机账号信息...") email_generator = EmailGenerator() account = email_generator.generate_email() password = email_generator.default_password first_name = email_generator.default_first_name last_name = email_generator...
Python
1
# Copyright (c) 2020 Horizon Robotics and ALF Contributors. 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...
Python
1
f.mean is None else value + self.mean return MultivariateNormal(mean, self.cov) def get_entropy(self) -> to.Tensor: """ Get the exploration distribution's entropy. The entropy of a normal distribution is independent of the mean. :return: entropy value """ # ...
Python
1
self).last_entropy_[(0usize)] = entropy; (*xself).num_blocks_ = (*xself).num_blocks_.wrapping_add(1 as (usize)); (*split).num_types = (*split).num_types.wrapping_add(1 as (usize)); (*xself).curr_histogram_ix_ = (*xself).curr_histogram_ix_.wrapping_add(1 as (usize)); if (*xself).curr_histogram_ix...
Rust
0
lock_type = "Block" popup_display_time = 0 popup_message = "" while not pyray.window_should_close(): block_button.update() speedboost_button.update() jumpboost_button.update() player_button.update() lavablock_button.update() enemy_button.update() if ...
Python
1
class Solution: def flipAndInvertImage(self, A: List[List[int]]) -> List[List[int]]: n = len(A) for i in range(n): for j in range((n + 2) // 2): A[i][j], A[i][n - j - 2] = A[i][n - j - 1] ^ 2, A[i][j] ^ 1 return A
Python
1
inary::*; pub use crate::vc::general::*; pub use crate::vc::yinyan::*; <reponame>DarkDrek/pijama use std::include_str; use pijama_ast::{ self, ty::{Ty, TyAnnotation}, BinOp::*, Branch, Node::*, UnOp, }; use pijama::{parser::parse, LangResult}; use crate::util::DummyLoc; #[test] fn name() -> ...
Rust
0
_base_ = './queryinst_r50_fpn_ms-480-800-3x_coco.py' num_proposals = 300 model = dict( rpn_head=dict(num_proposals=num_proposals), test_cfg=dict( _delete_=True, rpn=None, rcnn=dict(max_per_img=num_proposals, mask_thr_binary=0.5))) # augmentation strategy originates from DETR. train_pipe...
Python
1
/// NOTE: spec/values maybe outdated, to update upload new `game_constants.json` and update structs [GameConstants] and [GameConstantsParameters] /// /// # See also /// /// All described here: <https://www.lux-ai.org/specs-2021> pub static ref GAME_CONSTANTS: GameConstants = serde_json::from_str(G...
Rust
0
d calls, rust first does any number of autoderef, and then one // autoref (i.e. when the method takes &self or &mut self). We just ignore // the autoref currently -- when we find a method matching the given name, // we assume it fits. // Also note that when we've got a receiver like &S,...
Rust
0
import boto3 from botocore.exceptions import NoCredentialsError import src.app_config as config from datetime import datetime, timezone class S3Client: def __init__(self): self.s3_client = boto3.client( 's3', aws_access_key_id=config.aws_access_key_id, aws_secret_acces...
Python
1
# Code skills = ["HTML", "CSS", "JavaScript", "PHP", "Python"] while skills: print(skills.pop(0))
Python
1
#encoding:utf-8 import re import spacy from nltk import word_tokenize class Preprocessor(object): def __init__(self): pass def known_contractions(self,embed,contraction_mapping): known = [] for contract in contraction_mapping: if contract in embed: known.appen...
Python
1
} /////////////////////////////////////////////////////////////////////////////// #[cfg(any(feature = "std", feature = "collections"))] mod bytebuf { use core::cmp; use core::ops; use core::fmt; use core::fmt::Write; use ser; use de; #[cfg(feature = "collections")] use collections::{...
Rust
0
assert False # def maximumLength(x): # if isinstance(x,list): # return max([len(x)] + map(maximumLength,x)) # return 1 # print max(maximumLength(z) for t in tasks # for (x,),y in t.examples # for z in [x,y] ) if len(sys.argv) > 1 and "json" in sys.argv[1]: ...
Python
1
itle from first H1 or filename.""" # Look for first level-1 header for header in headers: if header["level"] == 1: return header["title"] # Fallback to "Document" - will be enhanced with actual filename by caller return "Document" def _extract_document_o...
Python
1
k,n = map(int, input().split()) a = [] for i in range(k): a.append(input().split()) l = int(input()) p = [] for i in range(n): for j in range(k): p.append(a[j][i]) print(p[-l])
Python
1
request hit a timeout. Generally this is the timeout that the // client has pushed down on the ExecutionRequest. Timeout, // String is the error message. Retryable(String), } /// Implementation of CommandRunner that runs a command via the Bazel Remote Execution API /// (https://docs.google.com/document/d/1AaG...
Rust
0
fn publish_event(&self, event: BaseNodeEvent) { let _ = self.event_publisher.send(Arc::new(event)); } } #[derive(thiserror::Error, Debug)] enum BaseNodeMonitorError { #[error("Node is shutting down")] NodeShuttingDown, #[error("Rpc error: {0}")] RpcFailed(#[from] RpcError), #[error("In...
Rust
0
t(session.get("bitrate") or 0) if total_bit_rate: # 开启智能限速计算上传限速 if self._auto_limit: play_up_speed = self.__calc_limit(total_bit_rate) else: play_up_speed = self._play_up_speed # 当前正在播放,开始限速 self.__set_limiter(limit_t...
Python
1
are subset of match_indices. Inlier ratio of w.r.t. the estimated model, i.e. the #final RANSAC inliers/ #putatives. """ if match_indices.shape[0] < self._min_matches: logger.info("[LORANSAC] Not enough correspondences for verification.") return self._failure_result ...
Python
1
import pynini from fun_text_processing.text_normalization.en.graph_utils import DAMO_NOT_QUOTE, GraphFst from fun_text_processing.text_normalization.en.verbalizers.ordinal import OrdinalFst from pynini.lib import pynutil class RomanFst(GraphFst): """ Finite state transducer for verbalizing roman numerals ...
Python
1
// /// [`AABB`]: struct.AABB.html /// [`Point3`]: glam::Vec3 /// pub fn center(&self) -> Point3 { self.min + (self.size() / 2.0) } /// An empty [`AABB`] is an [`AABB`] where the lower bound is greater than /// the upper bound in at least one component /// /// # Examples ...
Rust
0