text
string
label_name
string
labels
int64
= myproc(); if (p == null_mut()) { cpanic("sleep"); } if (lk == null_mut()) { cpanic("sleep without lk"); } // Must acquire ptable.lock in order to // change p->state and then call sched. // Once we hold ptable.lock, we can be // guaranteed that we won't miss any wakeu...
Rust
0
result = format!("{}\nAnd all for the want of a {}.\n", result, list[0]); } else { result = format!("{}\nFor want of a {} the {} was lost.", result, list[i], list[i + 1]); } } String::from(result.trim()) } use anyhow::{anyhow, Context, Result}; use bincode; use names; use sled; us...
Rust
0
''' `map` and `filter` are built-in Python functions that allow you to perform operations on iterable objects (e.g., lists, tuples) in a concise and functional manner. They are often used with lambda functions or regular functions to apply transformations and filters to the elements of an iterable.'...
Python
1
0.02, 0.8), 0.9, 0.4, Rgb::new(0.0, 0.0, 0.0)); // let brdf = brdf::Lambert::new(Rgb::new(0.0, 0.2, 0.9)); let brdf = brdf::UnlimitedChromatic::new(Rgb::new(0.0, 0.02, 0.8), Rgb::new(0.99, 0.9, 0.95), 0.4); let sphere = Sphere::new(Vec3::new(-3.0, 0.0, 7.0), 2.0, brdf); raytracer.add_entity...
Rust
0
sysroot_path: &AbsPathBuf, current_dir: &AbsPath, ) -> Result<AbsPathBuf> { if let Ok(path) = env::var("RUST_SRC_PATH") { let path = AbsPathBuf::try_from(path.as_str()) .map_err(|path| format_err!("RUST_SRC_PATH must be absolute: {}", path.display()))?; let core = path.join("core...
Rust
0
&FILE_BB[sq.file() as usize] & &!&(&RANK1_BB | &RANK9_BB); const BITS: usize = 7; for i in 0..1 << BITS { let occupied = index_to_occupied(i, BITS, &block_mask); unsafe { LANCE_ATTACK_BB[color_index][sq.index()][i] = &...
Rust
0
from baidupcs_py.baidupcs import BaiduPCSApi from baidupcs_py.baidupcs.errors import BaiduPCSError from loguru import logger import json import os import time import re from notify import send as notify_send import posixpath from threading import Lock import traceback import subprocess import shutil import json import ...
Python
1
yaml.read(Path()) emit.progress("Running linters...") for name, linter_class in LINTERS.items(): if lint and lint.all_ignored(name): continue categories = linter_class.get_categories() if lint and categories and all(lint.all_ignored(c) for c in cate...
Python
1
try: desc = info.split("<descripcion>")[1].split("<![CDATA[")[1].split("]]>")[0].strip() except: desc = u"Vídeo de Canal Plus".encode('utf8') # Probar título y descripción de la página si es vídeo de plus.es # La url del vídeo ya queda, aunque suele venir en el propio ...
Python
1
Configs` requests. /// /// If this value appears in [`xcb_protocol_request_t::opcode`], and /// [`xcb_protocol_request_t::ext`] is [`XcbGlx::xcb_glx_id()`], then the type of the request is /// [`xcb_glx_get_visual_configs_request_t`]. pub const XCB_GLX_GET_VISUAL_CONFIGS: u8 = 14i32 as u8; /// The `Glx::GetVisualConfi...
Rust
0
# 벽돌 싹 돌면서 공과의 거리 체크... for brick in bricks.bricks: # 공과 벽돌의 거리가 40 미만일떄 = 충돌 if ball.distance(brick) < 40: brick.hp -= 1 bricks.total_bricks_hp -= 1 if brick.hp == 0: brick.clear() brick.goto(3000, 3000) #임시 bricks.bricks.remove(brick) # 좌측 부딪 if ball.xcor() < brick.left_wa...
Python
1
mpty:{self.model}:{self.id}:{self.counter}:{attempt}:{end-start:.3f}") except Exception as e: end = time.time() if '429' in str(e):#if it's a rate limit error, not a big issue logging.info(f"prompt:error:exception_ratelimit:{str(e)}:{self.model}:{self.id}:...
Python
1
mm4", "mm5", "mm6", "mm7", "xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7", "ymm0", "ymm1", "ymm2", "ymm3", "ymm4", "ymm5", "ymm6", "ymm7", "zmm0", "zmm1", "zmm2", "zmm3", "zmm4", "zmm5", "zmm6", "zmm7" // When we move to the new asm!, most of the registers are remained as clobbered, except: // *...
Rust
0
td::time::{Duration, Instant}; use serde_derive::*; use sonnerie::*; pub use hyper::Body; pub type Response = hyper::Response<Body>; pub type Request = hyper::Request<Body>; use escape_string::split_one; use futures::sink::SinkExt; use futures::stream::StreamExt; fn main() { use clap::Arg; let matches = clap::Ap...
Rust
0
1000, ); // Device driver initialization with default values. This values can be found in defs mod. let mut radio_tuner = TEA5767::new( i2c, 107.0, BandLimits::EuropeUS, SoundMode::Stereo ).unwrap(); // start searching down for radio channel from frequenc...
Rust
0
t test_directory = Path::new(TMP_DIR).join(config_name); // Cleanup test directory if test_directory.exists() { std::fs::remove_dir_all(&test_directory).unwrap(); } // Prepare test directory std::fs::create_dir_all(&test_directory).unwrap(); let tt_binary = PathBuf::from(format!( ...
Rust
0
make_ascii_lowercase(&mut self) { for byte in self { byte.make_ascii_lowercase(); } } } #[allow(deprecated)] impl OwnedAsciiExt for Vec<u8> { #[inline] fn into_ascii_uppercase(mut self) -> Vec<u8> { self.make_ascii_uppercase(); self } #[inline] fn i...
Rust
0
1/hx8399/nt35516,其中hdmi默认置为lt9611,分辨率1920*1080;lcd默认置为st7701,分辨率800*480 display_mode="hdmi" # k230保持不变,k230d可调整为[640,360] rgb888p_size = [1280, 720] # 手掌检测模型路径 hand_det_kmodel_path="/sdcard/examples/kmodel/hand_det.kmodel" # 手掌关键点模型路径 hand_kp_kmodel_path="/sdcard/examples/kmodel/handkp_det.k...
Python
1
MICROSECONDS_MAX: f64 = SET_PULSE_WIDTH_ARG_MICROSECONDS_MAX!(); macro_rules! SET_PULSE_WIDTH_RES_LEN { () => { 6 }; } pub const SET_PULSE_WIDTH_RES_LEN: u8 = SET_PULSE_WIDTH_RES_LEN!(); // ----- // ----- // Set pulse period. macro_rules! SET_PULSE_PERIOD_COMMAND { () => { "46" }; } pub const SET_PULSE_PERIO...
Rust
0
import requests from bs4 import BeautifulSoup import pymysql.cursors import numpy as np import time # try: # connection = pymysql.connect(host='localhost',user='mojtaba',password='1234',db='extractdata') # except: # print("Ops... Can Not Connection to DataBase") # while True: #url = 'http://gatechan...
Python
1
dates. Dividends on the 'from' date are not /// included. Dividends on the 'to' date are included. It is /// permissible, but not very useful, to supply a to date before /// the from date, in which case a negative number may be returned. pub fn undiscounted_sum(&self, from: Date, to: Date) -> ...
Rust
0
elp="Output format", choices=["parquet", "jsonl", "zarr"], default="zarr" ) parser.add_argument( "--whitelist", help="Optional whitelist of fields to save when output format is parquet or zarr. Use obs, obsm, or X to save all entries for these fields. Use field.name to save a specific entry (e.g...
Python
1
SolipathDirectoryFinderTrait, solipath_download::file_to_string_downloader::FileToStringDownloaderTrait, }; #[cfg(test)] use mockall::{automock, predicate::*}; const BASE_DEPENDENCY_URL: &str = "https://raw.githubusercontent.com/Solipath/Solipath-Install-Instructions/main"; #[cfg_attr(test, automock)] #[async_tr...
Rust
0
def job_scheduling(jobs): # Sort jobs by profit in decreasing order jobs.sort(key=lambda x: x[1], reverse=True) # Find the maximum deadline max_deadline = max(job[0] for job in jobs) # Initialize the schedule (slots) schedule = [-1] * max_deadline # -1 means slot is empty total_profit = 0...
Python
1
DITLABEL`](https://docs.microsoft.com/en-us/windows/win32/controls/tvm-editlabel) /// message parameters. /// /// Return type: `WinResult<HWND>. pub struct EditLabel { pub hitem: HTREEITEM, } impl MsgSend for EditLabel { type RetType = WinResult<HWND>; fn convert_ret(&self, v: isize) -> Self::RetType { ...
Rust
0
rol<A: AddressingMode>( c: &mut Cpu, d: Option<&Debugger>, _opcode_byte: u8, in_cycles: usize, extra_cycle_on_page_crossing: bool, decode_only: bool, quiet: bool, ) -> Result<(i8, usize), CpuError> { let (tgt, extra_cycle) = A::target_address(c, extra_cycle_on_page_crossing)?; if !q...
Rust
0
# Copyright (c) 2010-2024 openpyxl from openpyxl.descriptors.serialisable import Serialisable from openpyxl.descriptors import ( Typed, Set, Bool, Integer, Sequence, Alias, ) from openpyxl.descriptors.excel import ExtensionList from openpyxl.descriptors.nested import ( NestedMinMax, Ne...
Python
1
# Copyright 2022 The FeatHub Authors # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in ...
Python
1
dation_metric for kwd in ('loss', 'ppl')): # if smaller is better eval_score = -eval_score # save checkpoint is_best = eval_score > self.custom_states.best_score if is_best: ...
Python
1
# -*- coding: utf-8 -*- """08/03/2024 - 11/03/2024.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1coWIPMjHh449yrVYSYsT3FQmre7CH-N6 Você foi designado para desenvolver uma calculadora em Python que permita aos usuários realizar diversas operaçõe...
Python
1
from frontend.flask_app.Extensions import DATABASE as db class ResponseModel(db.Model): __tablename__ = 'response' id = db.Column(db.Integer, primary_key=True) user_id = db.Column(db.Integer, db.ForeignKey('user.id'), nullable=False) # Fields from ScholarshipApplicationForm years_in_college = d...
Python
1
l. unshare(CloneFlags::CLONE_NEWNS).unwrap(); // Set the mount propagation to private on root. This ensures that *all* // mounts get cleaned up upon process termination. The approach to bind // mount the run_dir only (this is where the mounts from northstar happen) // doesn't work for the tests sin...
Rust
0
].len(); Grid { rows, width, height, } } struct Point { row: usize, col: usize, height: u8, } fn find_low_points(grid: &Grid) -> Vec<Point> { let mut points = Vec::new(); for (row_idx, row) in grid.rows.iter().enumerate() { for (col_idx, height) in row.ite...
Rust
0
ering::Relaxed) } fn set_updates(&self) { self.updates.fetch_add(1, Ordering::Relaxed); } } /// RaptorQ encoder pub struct RaptorqEncoder { encoder_index: usize, engine: raptorq::Encoder, params: FecTypeRaptorQ, source_packets: Vec<raptorq::EncodingPacket> } impl RaptorqEncoder { ...
Rust
0
ct::<&[u8]>(rb, con, &mut 96)?; let n_mzs = extract::<u32>(rb, con, &mut Endian::Little)?; if n_mzs > 100_000 { return Err("Too many m/z ranges".into()); } for _ in 0..n_mzs { let start_mz = extract::<u32>(rb, con, &mut Endian::Little)?; ...
Rust
0
import RopChain import Gadgets import Sequences import ImmEncoder import IpcCommand import Service import StringEncoder r = RopChain.Chain() r.add(Sequences.Nop()) # Required. SERVICES = { 'apm':True, 'apm:p':True, 'apm:sys':True, 'fgm':True, 'fgm:0':True, 'fgm:9':True, 'caps:a':True, 'caps:c':True, 'fsp-...
Python
1
= (self.w.bits & !(0x01 << 3)) | (((value as u32) & 0x01) << 3); self.w } } #[doc = "Reader of field `GPIO_PIN5_MUX_SEL`"] pub type GPIO_PIN5_MUX_SEL_R = crate::R<bool, bool>; #[doc = "Write proxy for field `GPIO_PIN5_MUX_SEL`"] pub struct GPIO_PIN5_MUX_SEL_W<'a> { w: &'a mut W, } impl<'a> GPIO_PIN5_MU...
Rust
0
#!/usr/bin/env python3 # Created by WaitingIdly for Divine Journey 2, licensed as GPLv3 """Updates the version for the DJ2 pack Presumes that the old version is exactly equal to the tag used """ from argparse import ArgumentParser from subprocess import run from os import getenv, path from shutil import copyfile f...
Python
1
[inline] pub fn alloc_all( uses: Uses, dom: DAGPtr, img: NonNull<Lam>, parents: Option<NonNull<Parents>>, ) -> NonNull<All> { unsafe { let all = alloc_val(All { uses, dom, img, copy: None, dom_ref: mem::zeroed(), img_ref: mem::zeroed(), parents, }); (*all....
Rust
0
import pygame import datetime pygame.init() window_width, window_height = 1000, 800 screen = pygame.display.set_mode((window_width, window_height)) pygame.display.set_caption("Mickey Mouse Clock") mickey_image = pygame.image.load('img/mainclock.png') right_hand_image = pygame.image.load('img/leftarm.png') left_hand_...
Python
1
def f(A): for x in range(1000): for y in range(1000): f = (x * y < A) or (x < y) or (9 < x) if not f: return 0 return 1 for A in range(1000): if f(A): print(A) break
Python
1
)); } Ok(lines) } op_as_typed_op!(); } impl StatefullOp for Codegen { fn state( &self, _session: &mut SessionState, _node_id: usize, ) -> TractResult<Option<Box<dyn OpState>>> { Ok(Some(Box::new(State { position: 0, hidden_state: ...
Rust
0
_bond_talbe(&mol.atoms, &(0..mol.atoms.len()).collect()), bondtable); } } #[test] fn test_canonical_numbering_and_symmetry_perception() { type InputType1 = String; let test_data: Vec<InputType1> = vec![ // // *** SOLVED *** // "CCn1c2ccc3cc2c2cc...
Rust
0
ize }, 4usize, concat!( "Offset of field: ", stringify!(FS_SIZEF_), "::", stringify!(height) ) ); } #[doc = " Rectangle size. Coordinate system agnostic."] pub type FS_LPSIZEF = *mut FS_SIZEF_; #[doc = " Rectangle size. Coordinate system agnost...
Rust
0
impl TypeTag { pub fn new<T: 'static>(name: &'static str, flat_type_tag: Option<FlatTypeTag>) -> Self { TypeTag { type_tag_hash: TypeTagHash::new(name), type_tag_name: name, native_name: type_name::<T>(), native_id: TypeId::of::<T>(), flat_type_ta...
Rust
0
p.array([policy_gen(t_pre, x, period) for t_pre, x in zip(tau_pre, panelX[:, period, :])]) resTX = np.zeros( (n_periods, (len(self.hetero_inds) + 1) * self._n_treatments)) for kappa in np.arange(n_periods): resTX[kappa] = np.mean(cross_p...
Python
1
import pandas as pd from sklearn.model_selection import train_test_split # Load the dataset file_path = "asap-aes/training_set_rel3.tsv" df = pd.read_csv(file_path, sep="\t", encoding="ISO-8859-1") # Filter for argumentative essays (essay_set in [1, 2, 3, 4, 5, 6]) argumentative_essays = df[df['essay_set'].isin([1, 2...
Python
1
rate::codegen::i16x8 } impl_shuffle! { [u32; 16], i16, crate::codegen::i16x16 } impl_shuffle! { [u32; 32], i16, crate::codegen::i16x32 } impl_shuffle! { [u32; 2], u16, crate::codegen::u16x2 } impl_shuffle! { [u32; 4], u16, crate::codegen::u16x4 } impl_shuffle! { [u32; 8], u16, crate::codegen::u16x8 } impl_shuffle! { [...
Rust
0
ame.K_UP and last_key!="K_DOWN": dx = 0 dy = -10 last_key = "K_UP" if event.key == pygame.K_DOWN and last_key!="K_UP": dx = 0 dy = 10 last_key = "K_DOWN" if event.key == pygame.K_p: ...
Python
1
from .imagefunc import * NODE_NAME = 'MaskStroke' class MaskStroke: def __init__(self): pass @classmethod def INPUT_TYPES(self): return { "required": { "mask": ("MASK", ), # "invert_mask": ("BOOLEAN", {"default": True}), # 反转mask ...
Python
1
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # import sys from airbyte_cdk.entrypoint import launch from source_lever_hiring import SourceLeverHiring def run(): source = SourceLeverHiring() launch(source, sys.argv[1:])
Python
1
AlterTableClause<'_> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { match self { AlterTableClause::AddForeignKey(fk) => { f.write_str("ADD ")?; fk.fmt(f) } } } } #[derive(Debug)] pub struct ForeignKey<'a> { pub...
Rust
0
reader.read_u8()?; // Read color (if it exists) let color = if let Some(color_offset) = offset_to_color_block { reader.seek(SeekFrom::Start((idx * size_of_single_color) + color_offset))?; let r = reader.read_u16::<LittleEndian>()?; let g = reader.read_u16::<LittleEn...
Rust
0
a(get_gamma, output_shape=(n_centroid,))(z_mean) sample_output = Model(x, z_mean) p_c_z_output = Model(x, p_c_z) #=========================================== vade = Model(x, x_decoded_mean) vade.load_weights('trained_model_weights/mnist_weights_nn.h5') accuracy,ind = cluster_acc(np.argmax(p_c_z_output.predict(X,...
Python
1
import ROOT def drawHisto(histo,yaxis_title,ymin,ymax,option="HISTOP",draw=True): ROOT.gStyle.SetPadRightMargin(0.02) ROOT.gStyle.SetPadLeftMargin(0.07) histo.SetStats(0) histo.SetLineWidth(3) histo.SetMarkerStyle(20) histo.SetMarkerSize(0.9) histo.GetYaxis().SetRangeUser(ymin,ymax) ...
Python
1
from windows_toasts import ( InteractableWindowsToaster, Toast, ToastInputTextBox, ToastInputSelectionBox, ToastSelection, ToastButton, ToastDuration, ToastDisplayImage, ToastImagePosition, ToastImage, ToastButtonColour, ToastActivatedEventArgs, ToastAudio, ) try: ...
Python
1
}; mod args; pub mod builder; pub mod config; mod help; mod subcommand; enum Command { NoSubcommand, Build(Args), Run(Args), Test(Args), Runner(RunnerArgs), Help, BuildHelp, RunHelp, TestHelp, CargoBootimageHelp, RunnerHelp, Version, } /// The entry point for the bina...
Rust
0
he number of seconds during which the data gathering was delayed because I/O bottleneck Returns: duration in seconds """ return self.tot_wait class DatasetFromPatchesImages(Dataset): """ Handles the "mining" of a set of patches images. :see PatchesImagesReader...
Python
1
} ); ); /// Used to wrap common expressions and function as macros /// /// ``` /// # #[macro_use] extern crate nom; /// # use nom::IResult; /// # fn main() { /// fn take_wrapper(input: &[u8], i: u8) -> IResult<&[u8],&[u8]> { take!(input, i * 10) } /// /// // will make a parser taking 20 bytes /// nam...
Rust
0
::{ context::{self, Context}, effects::{BaseEffect, Effect, EffectInput}, source::{ generic::GenericSourceBuilder, spatial::SpatialSourceBuilder, SoundSource, Status, }, }, utils::translate_event, }; use std::{ cell::RefCell, fs::File, io::Write, path:...
Rust
0
_id) ### val elif int(scene_id) >= 3000 and int(scene_id) < 3250: coco_val_dict["images"].append(img_dict) coco_val_dict["annotations"] += polygons_list export_density(density, val_img_folder, scene_id) ### test else: ...
Python
1
"""empty message Revision ID: 0056_minor_updates Revises: 0055_service_whitelist Create Date: 2016-10-04 09:43:42.321138 """ # revision identifiers, used by Alembic. revision = "0056_minor_updates" down_revision = "0055_service_whitelist" import sqlalchemy as sa from alembic import op def upgrade(): ### comma...
Python
1
[ state_population, state_avg_invoice_amount_28d, state_mean_latitude, state_mean_longitude, customer_inventory_stability_14d28d, customer_state_similarity_28d, customer_spend_28d, customer_avg_invoice_amount_28d, ...
Python
1
Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic...
Rust
0
qlen, chunk_size, k, ngroups if has_groups else 1, a.strides[0], a.strides[1], 0 if not has_groups else a.strides[2], a.strides[-1], dout.strides[0], dout.strides[1], 0 if not has_groups else dout.strides[2], dout.strides[-2], ...
Python
1
thPostInfo { // set resource id assert_ok!(Bridge::set_resource(Origin::root(), *resource_id, resource)); // make proposals let result1 = Bridge::acknowledge_proposal( Origin::signed(RELAYER_A), prop_id, src_chain_id, *resource_id, Box::new(update_proposal.clone()), ); let result2 = Bridge::acknowledge_...
Rust
0
from django.urls import path from . import views urlpatterns = [ path('', views.home,name='index'), path('<int:id>', views.view_student, name='view_student'), path('add/', views.add, name='add'), path('edit/<int:id>/', views.edit, name='edit'), path('delete/<int:id>/', views.delete, name='delete'),...
Python
1
f.write("banana") env["FRUIT"] = "cucumber" assert env["FRUIT"] == "banana" def test_set_file_key(self, tmp_f): env = environ.FileAwareMapping(env={"ANIMAL": "cat"}) env["ANIMAL_FILE"] = tmp_f assert env["ANIMAL"] == "fish" def test_change_file_key_clears_cache(self, tm...
Python
1
ecretKey) where T: SigningTranscript+Clone { let seed = Keypair::generate(thread_rng()); let cert_secret = self.issue_ecqv_cert(t.clone(), &seed.public); self.public.accept_ecqv_cert(t, &seed.secret, cert_secret).expect("Cert issued above and known to produce signature errors; qed") ...
Rust
0
GaugeDataType::U8 => 1, GaugeDataType::I8 => 1, GaugeDataType::B8 => 1, GaugeDataType::B16 => 2, } } pub fn value(&self, data: &[u8], slot_start: u8) -> f32 { let slot_end: usize = (slot_start + self.slot_size()).into(); let sliced_data = &data[slot...
Rust
0
play(self): logger.info('VideoPlayerInternal: Play movie') self.playing = True def pause(self): logger.info('VideoPlayerInternal: Pause movie') self.playing = False def stop(self): # raise NotImplementedError # logger.info('VideoPlayerInternal: Stopping player')...
Python
1
py(clsts)) del clsts, ds_sq # noinspection PyArgumentList self.conv.weight = nn.Parameter( (2.0 * self.alpha * self.centroids).unsqueeze(-1).unsqueeze(-1) ) # noinspection PyArgumentList self.conv.bias = nn.Parameter( ...
Python
1
d::io; #[cfg(feature="std")] use std::rc::Rc; // external rngs pub use jitter::JitterRng; #[cfg(feature="std")] pub use os::OsRng; // pseudo rngs pub use isaac::{IsaacRng, Isaac64Rng}; pub use chacha::ChaChaRng; pub use prng::XorShiftRng; // local use declarations #[cfg(target_pointer_width = "32")] use prng::IsaacR...
Rust
0
command: {cmd}") p = subprocess.Popen(cmd, stdout=subprocess.DEVNULL, shell=True) (output, err) = p.communicate() return True @staticmethod def stop_cluster_manager() -> bool: """ Stops the local cluster manager :return: True if it was stopped, False otherwise ...
Python
1
import numpy as np from ...utils import box_utils def transform_annotations_to_kitti_format(annos, map_name_to_kitti=None, info_with_fakelidar=False): """ Args: annos: map_name_to_kitti: dict, map name to KITTI names (Car, Pedestrian, Cyclist) info_with_fakelidar: Returns: """...
Python
1
(APC, self)._send_midi(midi_bytes, optimized=optimized) return False def _send_identity_request(self): self._identity_response_pending = True self._send_midi((240, 126, 0, 6, 1, 247)) def _send_introduction_message(self, mode_byte = ABLETON_MODE): self._send_midi((240, ...
Python
1
pusher_start, y_pusher_start, dx, dy]) pred_state_seq.append((scale * state_planner[:state_dim]).tolist()) # execute the action env.set_pusher_position(x_pusher_start, y_pusher_start) env.update((x_pusher_start + (x_pusher-x_pusher_start)/1e4, y_pusher_start + (y_pusher-y_pusher_start)/...
Python
1
posable_tests_helpers::test::helper::{ acceptable_computation_error, default_acceptable_computation_error, }; use composable_traits::{defi::CurrencyPair, dex::CurveAmm}; use frame_support::{ assert_err, assert_ok, traits::fungibles::{Inspect, Mutate}, }; use sp_runtime::{Permill, TokenError}; fn create_pool( base_...
Rust
0
ly Transformer blocks for blk in self.rep_decoder_blocks: x = blk(x) x = self.rep_decoder_norm(x) # predictor projection x = self.rep_decoder_pred(x) # # remove cls token # x = x[:, 1:, :] return x def forward(self, imgs, imgs_masks, specific_f...
Python
1
.termios.c_cflag & PARENB != 0 { if self.termios.c_cflag & PARODD != 0 { Some(core::ParityOdd) } else { Some(core::ParityEven) } } else { Some(core::ParityNone) } } fn stop_bits(&self) -> Option<...
Rust
0
.reset_index() # Gráfico de sorogrupos por região fig_sorogrupos = go.Figure() sorogrupos = ['A', 'B', 'C', 'D', 'X', 'Y', 'Z', 'W135'] cores_sorogrupos = ['#FF9999', '#66B2FF', '#99FF99', '#FFCC99', '#FF99CC', '#99CCFF', '#CCFF99', '#FFCCCC'] for i, sorogrupo ...
Python
1
:ext`] is [`XcbRecord::xcb_record_id()`], then the type of the request is /// [`xcb_record_disable_context_request_t`]. pub const XCB_RECORD_DISABLE_CONTEXT: u8 = 6i32 as u8; /// The `Record::DisableContext` request. #[derive(Copy, Clone, Debug)] #[repr(C)] pub struct xcb_record_disable_context_request_t { pub maj...
Rust
0
-public.tos-cn-beijing.volces.com/MTLogo.png" width="130"> </div> ''' description = ''' # MooER 摩耳 *MooER* [the repo](https://github.com/MooreThreads/MooER). Please note that the current version DOES NOT SUPPORT mobile phones. Use your PC or Mac instead. ''' with gr.Blocks(title="MooER online demo")...
Python
1
segments.push(segment_str); /* Flip the flag, as the next word should be the opposite */ on_a_number = !on_a_number; /* Sweep the floor clean. This is now a new, empty segment */ this_segment.clear(); } /* Stick ...
Rust
0
: return this info somehow println!("need to ping {:?}", node_to_ping); } _ => (), } } #[inline] fn kbuckets_find_closest(&self, addr: &PeerId) -> Vec<PeerId> { self.kbuckets.find_closest(addr).collect() } } impl<R, P, Pc, T, C> query::QueryInter...
Rust
0
2.6055195863104e-02, 2.8435872863284e-02, 2.9293319149544e-02, 2.852976858014e-02, 2.6176557156294e-02, 2.2371510270395e-02, 1.7332485267759e-02] assert_allclose(b, b2) # Verify IIR filter coefficients with the paper's MATLAB implementation def test_iir_ba_...
Python
1
import os import sys cwd = os.getcwd() sys.path.append(cwd) import pybullet as p import time p.connect(p.GUI) p.loadURDF(cwd + "/../pybullet_robots/data/plane.urdf") humanoid = p.loadURDF( cwd + "/../pybullet_robots/data/cassie/urdf/cassie_collide.urdf", [0, 0, 0.8], useFixedBase=False) gravId = p.addUser...
Python
1
Some(color) = &self.color { Some(color) } else { None } } } <gh_stars>0 mod anonymous_function; mod argument; mod array; mod call; mod for_condition; mod hashmap; mod infix; mod prefix; mod suffix; pub use argument::function_arguments_to_string; use crate::{ Environment, ...
Rust
0
y_enabled=True, autopay_threshold_centricredits=1000, autopay_stripe_customer_id="cus_test789", ) command = Command() with patch("bots.tasks.autopay_charge_task.autopay_charge.delay") as mock_delay: with patch("django.utils.timezone.now", return_value=self.n...
Python
1
&*(f as *const F); f(&SettingTeam::from_glib_borrow(this).unsafe_cast()) } unsafe { let f: Box_<F> = Box_::new(f); connect_raw( self.as_ptr() as *mut _, b"notify::mcast-rejoin-interval\0".as_ptr() as *const _, Some(trans...
Rust
0
ess, doubleTmp ).IsSuccess ) readDouble = plc.ReadDouble( address, len(doubleTmp )).Content for i in range(len(doubleTmp)): self.assertTrue( readDouble[i] == doubleTmp[i] ) # long类型 self.assertTrue( plc.WriteInt64( address, 123617231235123 ).IsSuccess ) self.assertTr...
Python
1
_base_ = [ '../_base_/models/mask-rcnn_r50_fpn.py', '../_base_/schedules/schedule_1x.py', '../_base_/default_runtime.py', '../_base_/datasets/dsdl.py' ] # dsdl dataset settings. # please visit our platform [OpenDataLab](https://opendatalab.com/) # to downloaded dsdl dataset. data_root = 'data/COCO2017' im...
Python
1
import torch import torch.nn as nn from models.PointNet import PointNetSetAbstractionMsg, PointNetFeaturePropagation class Encoder(nn.Module): def __init__(self, d_point=128): super(Encoder, self).__init__() self.sa1 = PointNetSetAbstractionMsg(1024, [0.05, 0.1], [16, 32], 0, [[16, 16, 32], [32, ...
Python
1
.tableWidget.horizontalHeaderItem(2) item.setText(_translate("proyectos", "Descripción")) item = self.tableWidget.horizontalHeaderItem(3) item.setText(_translate("proyectos", "Estado")) self.btnAgregar.setText(_translate("proyectos", "Agregar proyecto")) self.btnEliminar.setText(...
Python
1
from unittest.mock import Mock, patch from notification_client.notification_api_handler import ( fetch_cpu_usage, fetch_memory_percent, fetch_network_bandwidth, ) @patch("requests.get") def test_fetch_cpu_usage(mock_requests_get): # Mock API response mock_requests_get.return_value = Mock( ...
Python
1
assert_eq!(d.unwrap().actions.len(), d0.actions.len()); let c = list.find(&StoryTrigger::DialogueChoice(StoryChoice::new(7))); assert!(c.is_some()); assert_eq!(c.unwrap().trigger, c0.trigger); assert_eq!(c.unwrap().actions.len(), c0.actions.len()); let c2 = list.find(&StoryTrig...
Rust
0
Reprocess(State), Backtrack, Abort(Token), End(Token), } fn step(state: State, c: Option<char>) -> Step { match state { State::Start => match c { Some(' ') | Some('\t') | Some('\r') | Some('\n') => Step::Continue(State::Whitespace), Some('!') => Step::Continue(State::B...
Rust
0
&str, cb: CB, ) -> FsReqErrResult { self._fs_readlink(path, cb) } /// Equivalent to readlink(2). pub fn fs_readlink_sync(&self, path: &str) -> Result<String, Box<dyn std::error::Error>> { self._fs_readlink(path, ()).and_then(|mut req| { let path = req.real_path(); ...
Rust
0
num_faults, num_epochs, initial_entropy, entropy, bitmaps, include_dummy_epochs, None, )); } #[test] fn test_multiple_epochs_with_no_initial_entropy() { run_profile_constrai...
Rust
0
# ===================================================================== # EJERCICIO 80: Clase Carrito de Compras # --------------------------------------------------------------------- # Crear una clase Producto con los siguientes atributos: # • nombre # • precio # • cantidad # Crear una lista que cargue varios product...
Python
1