text
string
label_name
string
labels
int64
it() # Calculate time instances for these smartly detected peaks smart_peak_times = smart_peaks / sample_rate # Initialize array to store smart BPM values smart_bpm_values = [] # Calculate BPM for each time window using smart peaks for start_time in time_windows: end_time = start_time + 5 peaks_in_window = s...
Python
1
as SPWN code") .visible_alias("e") .args(&[ arg!(-c --"console-output" "Makes the script print the created level into the console instead of writing it to your save file"), arg!(-l --"no-level" "Only compiles the script, no level creation at all")...
Rust
0
content def generate_line_timestamp(line: Line) -> str: timestamp = f'[{format_time(line["begin"])}]' if line['agent']: timestamp += line['agent'] + ':' return timestamp def generate(data: Data) -> str: content = '' last_line_end = 0 timing = data['timing'] for line in data['lyr...
Python
1
ization primitives that have both synchronous and asynchronous variants under the same //! interface. #[cfg(feature = "__sync")] mod blocking; #[cfg(feature = "__async")] mod futures; #[cfg(feature = "__sync")] use self::blocking as imp; #[cfg(feature = "__async")] use self::futures as imp; /// A type alias for eith...
Rust
0
); } } array_383.finish(); } if let Some(var_386) = &input.configuration { let mut object_387 = object.key("configuration").start_object(); crate::json_ser::serialize_structure_crate_model_cluster_configuration( &mut object_387, var_386, ...
Rust
0
_len: count }])?.into()) } pub fn sys_write( ctx: &SyscallContext<'_>, fd: FdNumber, buffer: UserAddress, count: usize, ) -> Result<SyscallResult, Errno> { let file = ctx.task.files.get(fd)?; Ok(file.ops().write(&file, &ctx.task, &[iovec_t { iov_base: buffer, iov_len: count }])?.into()) } pub ...
Rust
0
import pandas as pd file_path = "DS Internship - EDA - Data.xlsx" data_df = pd.read_excel(file_path, sheet_name="Data") remodelled_stores = data_df[data_df["Store Modification"].notna() & (data_df["Store Modification"].str.lower() != "no modifications")]["Store"].nunique() print("The number of stores remodelled durin...
Python
1
import sys import E8_Vinicultores as interfaz from PyQt5 import uic, QtWidgets, QtGui class MyDialog(QtWidgets.QDialog, interfaz.Ui_Dialog): def __init__(self): QtWidgets.QDialog.__init__(self) interfaz.Ui_Dialog.__init__(self) self.setupUi(self) # Área de los Signals self...
Python
1
write(&mut self, buf: &[u8]) -> io::Result<usize> { if let Ok(mut inner) = self.inner.lock() { inner.extend_from_slice(buf); } Ok(buf.len()) } fn flush(&mut self) -> io::Result<()> { Ok(()) } } impl thrift::transport::TIoChannel for TBufferChannel { fn spli...
Rust
0
e))] pub struct ValueStateKey(pub Vec<u8>, pub u64); /// The state of the value for a given key, starting at a particular epoch. #[derive(Debug, Clone, PartialEq, Eq, Hash)] #[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))] #[cfg_attr(feature = "serde", serde(bound = ""))] pub struct ValueSt...
Rust
0
rwardMsg: """ When we are here, the message queue is cleared from non-lifecycle messages before they were flushed to the browser. If there were no non-lifecycle messages in the queue, changing the type here should not matter for the frontend anyways, so we optimistically change the `script_fini...
Python
1
pd = np.mean(negative_log_predictive_density(y=Y_t, post_mean=posterior_mean, post_cov=posterior_var, lik_cov=noise_var)) rmse = np.sqrt(np.nanmean((np.squeeze(Y_t) - np.squeeze(p...
Python
1
import sys from hpo.experiments import bo, soo, bamsoo, sampling if len(sys.argv) < 2: print("No argument provided") sys.exit(1) arg = sys.argv[1] print(f"Received argument: {arg}") if arg == "sampling" : sampling.main() elif arg == "bo" : bo.main() elif arg == "soo" : soo.main() elif arg == ...
Python
1
bro_mesa", "organismo_estado": miembro_row.organismo_estado }) # Verificar si es agente policial query_agente = text(""" SELECT ap.comisaria, ap.id_establecimiento, e.nombre as establecimiento_nombre FROM agente_policial ap LEFT JOIN establecimiento e ON ap.id_es...
Python
1
discount_amount == "": discount_amount = "0" except Exception as e: discount_amount = "No discount" print(f"Amount discount: {discount_amount}") return discount_amount from selenium.webdriver.common.by import By from selenium.common.exceptions import NoSuchElementException def check_st...
Python
1
convert::TryFrom; use std::ffi::{CStr, CString}; use std::fmt; use std::marker::PhantomData; use std::mem::MaybeUninit; use std::str::FromStr; use libc::c_char; use crate::context::Context; use crate::decimal::Decimal; use crate::decimal64::Decimal64; use crate::error::ParseDecimalError; /// A 32-bit decimal floatin...
Rust
0
features } fn acked_features(&self) -> u64 { self.acked_features } fn set_acked_features(&mut self, acked_features: u64) { self.acked_features = acked_features; } fn read_config(&self, offset: u64, mut data: &mut [u8]) { let config_space_bytes = self.config_space.as_sl...
Rust
0
with_version(); let longs = longs_and_visible_aliases(&cmd); assert_eq!(longs.len(), 2); assert_eq!(longs[0], "help"); assert_eq!(longs[1], "version"); let sc_longs = longs_and_visible_aliases(find_subcommand_with_path(&cmd, vec!["test"])); assert_eq!(sc_longs.len(), 3...
Rust
0
PairingCurve, PairingEngine, }, fields::bls12_377::{Fq, Fq12, Fq12Parameters, Fq2Parameters, Fq6Parameters}, }; pub mod g1; pub mod g2; #[cfg(test)] mod tests; use self::{g1::Bls12_377G1Parameters, g2::Bls12_377G2Parameters}; pub struct Bls12_377Parameters; impl Bls12Parameters for Bls12_377Paramet...
Rust
0
deprecated(since = "0.1.0", reason = "use unsigned indices instead") )] impl<T> Index<i64> for List<T> { #[cfg_attr(feature = "unstable", stable(feature = "list", since = "0.1.0") )] #[cfg_attr(feature = "unstable", deprecated(since = "0.1.0", reason = "use unsigned indices instead") )] ...
Rust
0
Gradient4" cx="50%" cy="50%" fx="50%" fy="50%" r=".5"> <animate attributeName="fx" dur="23s" values="0%;5%;0%" repeatCount="indefinite"></animate> <stop offset="0%" stop-color="rgba(0, 255, 0, 1)"></stop> <stop offset="100%" stop-color="rgba(0, 255, 0, 0)"></stop> </radialgra...
Python
1
: {}", count_2); } fn parse_input(path: &str) -> Vec<usize>{ let lines = read_file::get_lines(&path); lines.map(|line| { line .unwrap() .parse() .unwrap() }) .collect() } fn solve_part_1(values: Vec<usize>) -> usize{ let mut values = values.into_iter(); ...
Rust
0
from pirates.pirate.PAvatarHandle import PAvatarHandle class PTalkHandle(PAvatarHandle): def __init__(self, doId, message): self.avatarId = doId self.avatarName = None self.accountId = None self.accountName = None self.addMessageInfo(message) self.bandId = (0, 0) ...
Python
1
failed to duplicate view_ref"); } } // // // This file is a part of Aleph // // https://github.com/nathanvoglsam/aleph // // MIT License // // Copyright (c) 2020 Aleph Engine // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (th...
Rust
0
elds.next().unwrap().parse().unwrap(), name: read_u25(fields.next().unwrap()), address: AbomonationWrapper { element: ArrayString::from(fields.next().unwrap()).unwrap() }, nation_key: fields.next().unwrap().parse().unwrap(), phone: read_u15(fields.next().unwrap()), ...
Rust
0
. If you want a mathematical // justification for choosing this value, observe that the graph of // `f(x) = a/x` for positive `a` approaches infinity as `x` goes to `0` and // it continues to do so as `a` approaches `0` as well. A pragmatic // justification for this value is that `0.0...
Rust
0
<K, V>> { // This implementation is actually unsafe since we don't check if the // index is in-bounds. But this is fine since this is only used internally. unsafe { self.pointers.get_unchecked(index) } } } /// Tower at the head of a skip list. /// /// This is located in the `SkipList` struc...
Rust
0
panic::catch_unwind(move || test(&testpath)); std::fs::remove_file(dbpath).unwrap(); match result { Ok(res) => res, Err(err) => { std::panic::resume_unwind(err); } } } fn temp_db_path() -> String { let mut temp_dir = std::env::temp_dir(); let thread_id = GLOBA...
Rust
0
: usize = $crate::count![@COUNT; $($element),*]; #[allow(unused_mut)] let mut vs = Vec::with_capacity($crate::count![@COUNT; $($element),*]); $(vs.push($element);)* vs }}; ($($element:expr),*) => {{ $crate::avec![$($element),*] }}; ($element:expr; $count:expr) =>...
Rust
0
thumb; } } } } fn calculate_size(&self, _: Size) -> Size { self.size } } use chrono::{DateTime, FixedOffset}; use common::{ geo, model::{ opportunity::{ Cost, Descriptor, EntityType, OpportunityQuery, OpportunityQueryOrdering, ...
Rust
0
import os import time import subprocess from mobile_safety.utils import file as file_lib from mobile_safety.utils import utils as utils_lib from mobile_safety.utils import bluetooth as bluetooth_lib def task_init(init_params): """_summary_ Args: console_port (str, optional): _description_. Defaults ...
Python
1
c_meta_data: func_name = meta_data[0] w_shape = list(meta_data[1]) layout_shape = () dump_point = meta_data[2] func_type = meta_data[3] data_index = meta_data[6] if '{}-{}'.format(func_name, func_type) not in logged_func: logged_func.append('{}-{}'.for...
Python
1
#!/usr/bin/python3 """ This script defines a City class to work with MySQLAlchemy ORM. """ from relationship_state import Base, State from sqlalchemy import Column, Integer, String, ForeignKey class City(Base): """City class Attributes: __tablename__ (str): The table name of the class id (int...
Python
1
aker.similarity.model1Score = 0.8 skill_matchmaker.similarity.model2Score = 0.6 skill_matchmaker.similarity.ensembleScore = 0.7 skill_matchmaker.model1 = MagicMock() skill_matchmaker.model2 = MagicMock() skill_matchmaker.reset() assert skill_matchmaker.similarity.model1Score is None assert s...
Python
1
, "{}{}{}", from, to, if promote { "+" } else { "" }) } Move::Drop { to, piece_type } => { write!(f, "{}*{}", piece_type.to_string().to_uppercase(), to) } } } } impl str::FromStr for Move { type Err = ParseMoveError; fn from_str(s: &str) -> Resul...
Rust
0
""" Script to create a simple sample model for testing. """ import os import pickle import json import numpy as np from sklearn.ensemble import RandomForestClassifier # Create model directory if it doesn't exist os.makedirs('./model', exist_ok=True) # Create a simple random forest model model = RandomForestClassifier...
Python
1
step = 0 # Explicit iterator lets us call next() manually train_iter = iter(train_loader) for epoch in range(EPOCHS): running_loss = 0.0 running_acc = 0.0 for i in range(len(train_loader)): # Dataloader fetch (measures wait time of GPU if available) print(...
Python
1
result = {} for attr, _ in self.swagger_types.items(): value = getattr(self, attr) if isinstance(value, list): result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) elif hasattr(value, "to_dict"): resul...
Python
1
"Command".cell().bold(true), program_def .args .iter() .map(|x| x.to_string()) .collect::<Vec<String>>() .join("\n") .cell(), ]); rows.push(vec![ "Stdout".cell().bold(true), stdio_to_cell(&program_def.stdout), ])...
Rust
0
3, Vector3}; use ncollide3d::shape::{Cuboid, ShapeHandle}; use nphysics3d::object::{ColliderDesc, RigidBodyDesc}; use nphysics3d::material::{BasicMaterial, MaterialHandle}; use nphysics3d::world::World; use nphysics_testbed3d::Testbed; fn main() { /* * World */ let mut world = World::new(); world...
Rust
0
: false, can_present: false, max_layers: 0 } } } use std::fmt; /// VN error kinds. /// /// Low-level error kinds. /// As a general rule, these should not be matched against. #[derive(Copy, Clone, Debug, PartialEq, Eq)] #[non_exhaustive] pub enum VnErrorKind { /// Bad payload co...
Rust
0
::ErrorKind::Interrupted), AddrInUse => io::Error::from(io::ErrorKind::AddrInUse), AddrNotAvailable => { io::Error::from(io::ErrorKind::AddrNotAvailable) } NotFound(msg) => io::Error::new(io::ErrorKind::NotFound, msg), SocketLimit => { ...
Rust
0
""" 这实际上是一个第三方库,并不是我们自己写的。 https://github.com/mherrmann/gitignore_parser 但由于报错。需要对文件进行更改。 """ import collections import os import re from os.path import abspath, dirname from pathlib import Path from typing import Reversible, Union def handle_negation(file_path, rules: Reversible["IgnoreRule"]): for rule in rev...
Python
1
Return: val: generated np.ndarray based on ratio of timestamp difference ''' timestamp = [total_timestamp[idx] for idx in range(start_idx, end_idx + 1)] timestamp_diff = np.diff(timestamp) total_timestamp_diff = max(timestamp) - min(timestamp) timestamp_diff_cumsum = np.cumsum(timestam...
Python
1
"""Basic functionality tests that actually work.""" from unittest.mock import patch from src.registry import register_all_tools from src.server import mcp from src.tools.get_all_pages import get_all_pages class TestBasicFunctionality: """Basic tests that verify core functionality works.""" def test_import...
Python
1
addr: Some(Subnet { addr: IpAddress::Ipv6(Ipv6Address { addr: [254, 128, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], }), prefix_len: 2, }), ..Address::EMPTY }; let ipv4_address = Address { ...
Rust
0
[`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 [fc0_ref_khz](fc0_ref_khz) module"] pub type FC0_REF_KHZ = crate::Reg<u32, _FC0_REF_KHZ>; #[allow(missing_docs)...
Rust
0
( unsafe { &(*(::std::ptr::null::<uv_dir_s>())).nentries as *const _ as usize }, 8usize, concat!( "Offset of field: ", stringify!(uv_dir_s), "::", stringify!(nentries) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<uv_dir_...
Rust
0
# Import QRCode from pyqrcode import pyqrcode from pyqrcode import QRCode import png as png # String which represents the QR code s = input(" Enter the site you want to search >> ") # Generate QR code url = pyqrcode.create(s) # Create and save the svg file naming "myqr.svg" url.svg("myqr.svg", scale...
Python
1
const NCALPHA_FG_RGB_MASK: u64 = crate::bindings::ffi::NC_FG_RGB_MASK; // NcChannels // /// 64 bits containing a foreground and background [`NcChannel`] /// /// At render time, both 24-bit [`NcRgb`] values are quantized down to terminal /// capabilities, if necessary. There's a clear path to 10-bit support should /// ...
Rust
0
import paho.mqtt.client as mqtt import psycopg2 import sqlite3 import json import os from dotenv import load_dotenv load_dotenv() #POSTGRES POSTGRES_HOST = os.getenv('POSTGRES_HOST') POSTGRES_PORT = os.getenv('POSTGRES_PORT') POSTGRES_DATABASE = os.getenv('POSTGRES_DATABASE') POSTGRES_USER = os.getenv('POSTGRES_USER')...
Python
1
v::temp_dir(); tmp_dir.push("urandom"); let tmp_dir_str = tmp_dir.to_str().unwrap(); let tmp_dir_c_str = CString::new(tmp_dir_str).unwrap(); let ptr = tmp_dir_c_str.as_ptr() as *const i8; let mut urandom_file = File::create(tmp_dir).unwrap(); // cr...
Rust
0
k7r$tj|jd|t |t r|}t |t ur td||_|j|_ t|_|jd|_ y)zMark the future done and ...
Python
1
.next(control); let to = to.next(control); from + controller.read(control.storage) * (to - from) } }, } } } impl<C> Add for LfSource<C> { type Output = Self; fn add(self, rhs: Self) -> Self::Output { LfSourceExpr::Add(sel...
Rust
0
{ Err(DecodeError::new("only record types are allowed inside UnionRecord").into()) } } None => Err(DecodeError::new("UnionRecord index out of bounds").into()), } } <reponame>aki-akaguma/aki-xcat /*! concatenate files that are plain, gzip, xz and zstd. # Features - conca...
Rust
0
# Copyright (c) 2020 Alexander Todorov <atodorov@MrSenko.com> import glob import inspect import os def import_local_settings(scan_dir, **kwargs): """ Add/override the global settings object with additional settings defined in files found under @scan_dir. Files are executed in alphabetic order! ...
Python
1
#!/usr/bin/env python # encoding: utf-8 from .http import * from .access_token import * class KKBOXOAuth: ''' Implements various KKBOX Oauth 2.0 authorization flows. See `https://docs-en.kkbox.codes/docs/appendix-b`. ''' OAUTH_TOKEN_URL = 'https://account.kkbox.com/oauth2/token' def __init__...
Python
1
# -*- coding:utf-8 -*- import pygame import sys from SceneManager import SceneManager from Settings import * from Player import Player def run_game(): pygame.init() window = pygame.display.set_mode((WindowSettings.width, WindowSettings.height)) pygame.display.set_caption(WindowSettings.name) scene...
Python
1
assert payload["dtype"] == "<f8" assert payload["ndim"] == 2 assert payload["shape"] == [2, 2] assert payload["size"] == 4 def test_scalar_dataset(self): response = self.tester.get(["meta", "test_file.h5"], params={"uri": "/scalar"}) assert response.status_code == 200 ...
Python
1
middle::trans::_match; use middle::trans::adt; use middle::trans::asm; use middle::trans::base::*; use middle::trans::base; use middle::trans::build::*; use middle::trans::callee::DoAutorefArg; use middle::trans::callee; use middle::trans::closure; use middle::trans::common::*; use middle::trans::consts; use middle::t...
Rust
0
TRAIN_FILE = "data/train.csv" TEST_FILE = "data/test.csv" SUB_DIR = "output" NUM_SPLITS = 3 RANDOM_SEED = 2017 # types of columns of the dataset dataframe CATEGORICAL_COLS = [ 'ps_ind_02_cat', 'ps_ind_04_cat', 'ps_ind_05_cat', 'ps_car_01_cat', 'ps_car_02_cat', 'ps_car_03_cat', 'ps_car_04_cat', 'ps_car_0...
Python
1
lseAudio sound server via //! PulseAudio’s existing C API. This binding provides a safe(r) Rust interface which might be //! preferred over the raw C API provided by the underlying `sys` linking crate. //! //! This crate provides an interface to PulseAudio’s ‘GLIB mainloop’ component, and should be used //! in addition...
Rust
0
String::from_slice("else"); #[allow(non_upper_case_globals)] const STR_SLICE_3: FeString = FeString::from_slice("Adam"); #[allow(non_upper_case_globals)] const STR_SLICE_4: FeString = FeString::from_slice("1"); #[allow(non_upper_case_globals)] const STR_SLICE_5: FeString = FeString::from_slice("2"); #[allow(non_upp...
Rust
0
// Move to first word two screen lines up. let mov = MoveType::ScreenFirstWord(MoveDir1D::Previous); let count = Count::Exact(2); let cursor = Cursor::new(1, 7); let cursor = rope.movement(&cursor, &mov, &count, cmctx!(vwctx, vctx)).unwrap(); assert_eq!(cursor, Cursor::new(0,...
Rust
0
ut); assert_eq!(&hash.to_hex(), output, "hash mismatch"); } // Now in two chunks. This is especially important for the ONE_BLOCK case, because it would be // a mistake for update() to call compress, even though the buffer is full. for &(input, output) in io { let mut state = State::new()...
Rust
0
import numpy as np import cv2 def enhance_lines(image): # Detecta bordas usando o detector de bordas Canny bordas = cv2.Canny(image, 50, 150, apertureSize=3) # Detecta linhas usando a Transformada de Hough linhas_detectadas = cv2.HoughLines(bordas, 1, np.pi / 180, 200) if linhas_detectada...
Python
1
gen::<[u8; 2]>()), encode(rand::thread_rng().gen::<[u8; 6]>()), ); format!( "{}-{}-{}-{}-{}", bytes.0, bytes.1, bytes.2, bytes.3, bytes.4 ) } /// Generates 32-byte UUID as a String pub fn uuid32() -> String { let bytes = ( encode(rand::thread_rng().gen::<[u8; 8]>()), ...
Rust
0
ve_charge_tags] original_positions = snap.particles.position[negative_charge_ind] static_positions = snap.particles.position[positive_charge_ind] # Test that the filter merely works as expected and that tags are correctly # grabbed on local MPI ranks assert all(np.sort(charge_filter(sim.sta...
Python
1
pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: _bindgen_ty_4 = 1125; pub const _CS_POSIX_V6_LP64_OFF64_LIBS: _bindgen_ty_4 = 1126; pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: _bindgen_ty_4 = 1127; pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: _bindgen_ty_4 = 1128; pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: _bindgen_ty_4 =...
Rust
0
from sqlalchemy import Column, Integer, ForeignKey, DateTime, String, Float from sqlalchemy.orm import relationship from app.db.base import Base from datetime import datetime class PostRatings(Base): __tablename__ = "post_ratings" id = Column(Integer, primary_key=True, index=True, autoincrement=True) pos...
Python
1
# Copyright 2016-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import torch import os import pickle train = [] test = [] p = [ 45, 9, 3, 34, 31, 25, 23, 1...
Python
1
M, H, G>, C: CoalescenceSampler<M, H, R, S>, T: TurnoverRate<M, H>, N: SpeciationProbability<M, H>, E: EventSampler<M, H, G, R, S, X, D, C, T, N>, I: ImmigrationEntry<M>, A: ActiveLineageSampler<M, H, G, R, S, X, D, C, T, N, E, I>, > Simulation<M, H, G, R, S, X, D, C,...
Rust
0
# Copyright (C) 2017, Philsong <songbohr@gmail.com> import logging import requests from .market import Market # https://api.bitfinex.com/v1/symbols_details # { # "pair": "bchbtc", # "price_precision": 5, # "initial_margin": "30.0", # "minimum_margin": "15.0", # "maximum_order_size": "2000.0", # ...
Python
1
r_sampled_addmm_kernelrp2FMMq)  1-  ')3 4!M1 2 WW45 ''"9<O"OP"J. a< 99Q 699Q 6 !I- .*, -&(8D(AA B&(8q(AA  B  &2 3 :- .  )+ ,#m3 4$&6q$w&?? @ ...
Python
1
`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [lc_hung_conf](lc_hung_conf) module"] pub type LC_HUNG_CONF = crate::Reg<u32, _LC_HUNG_CONF>; #[allow(missing_docs)] #[doc(hidden)] pub struct _LC_HUNG_CONF; #[doc = "`read()` met...
Rust
0
FormatItem::Literal(b"Z"), ]; date_time.format(format_desc.as_ref()) } else { let format_desc = [ FormatItem::Compound(PREFIX), FormatItem::Literal(b"."), FormatItem::Component(Component::Subsecond({ let mut subsec = Subsecond::defau...
Rust
0
ticle_parts) formatted_article = await self.search_and_add_citations(article_text) # 保存文章 print("正在保存文章...") os.makedirs(os.path.dirname(output_file), exist_ok=True) with open(output_file, 'w', encoding='utf-8') as f: f.write(forma...
Python
1
############################################################################### # (c) Copyright 2018-2020 CERN for the benefit of the LHCb Collaboration # # # # This software is distributed under the terms of the Apache License # ...
Python
1
#%% # Importando a biblioteca pandas import pandas as pd # Criando um dicionário com dados de exemplo e convertendo-o em um DataFrame data = { "Nome": ["Téo", "Nah", "Maria", "Nah", "Lara", "Téo"], "Idade": [32, 33, 2, 33, 31, 32], "updated_at": [1, 2, 3, 1, 2, 3] } df = pd.DataFrame(data) df #%% # Orde...
Python
1
.authentication().key_type(), MethodType::Ed25519VerificationKey2018 ); assert_eq!( document.authentication().key_data(), &MethodData::PublicKeyBase58(String::from("<KEY>")) ); } #[test] fn test_new() { //from keypair let keypair: KeyPair = generate_testkey(); let docume...
Rust
0
1_delegator_stakes_1: U512 = bids_1 .get(&NON_FOUNDER_VALIDATOR_1_PK) .expect("should have bids") .delegators() .iter() .map(|(_, delegator)| *delegator.staked_amount()) .sum(); assert!(validator_1_delegator_stakes_1 > U512::zero()); let validator_2_delegator_sta...
Rust
0
workflow_id.clone(), run_id.clone(), query.clone() ) } async fn describe_workflow_execution( &self, workflow_id: String, run_id: Option<String>, ) -> Result<DescribeWorkflowExecutionResponse> { retry_call!( self, ...
Rust
0
075e1d502a5d0cf71bca496181ee541d06d9c76acc12fd2bbf8".into(), "cc9b4d01d9c9072b3d86fd8e42a6490b907b244988107b1fd7729c1c8b358ab7".into(), "dd6738c0b5ae245b1695817a24025834cfb932910608b1ae3fa1385ba693c1d4".into(), "b07eb9ef49d7be02bfddedeb0915139d6a4390335eb029b5f74b36c767a6ab8e".into()...
Rust
0
_ID, WORKER_ADDR); let deal_ids = publish_deals( &mut rt, &MINER_ADDRESSES, &[ verified_deal_1.clone(), verified_deal_2.clone(), unverified_deal_1.clone(), unverified_deal_2.clone(), ], ); let response = verify_deals_for_activa...
Rust
0
#tạo list #ListStudents= ["Hạnh", "Hằng", "Hòa", "Hoa", "Trang"] #in kiểu dữ liệu #print(type(ListStudents)) # đếm số lượng #print(len(ListStudents)) #print(ListStudents[3]) #ListStudents.append("Nhím") #print(ListStudents) #ListStudents.pop(1) #print(ListStudents) #ListStudents.remove("Nhím") #print(ListStudents) Lis...
Python
1
state = register_widget( color_picker_proto.id, on_change_handler=on_change, args=args, kwargs=kwargs, deserializer=serde.deserialize, serializer=serde.serialize, ctx=ctx, value_type="string_value", ) if wid...
Python
1
""" Local development settings for Redimensiona project. """ import os from .base import * # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = os.environ.get('SECRET_KEY') # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = os.environ.get('ALLOW...
Python
1
#!/usr/bin/python3 import sys processing = __import__('1-batch_processing') ##### print processed users in a batch of 50 try: processing.batch_processing(50) except BrokenPipeError: sys.stderr.close()
Python
1
- 1 { 0 } else { i + 1 }; let p0 = self.vertices[i].to_vec(); let p1 = self.vertices[j].to_vec(); let a = p0.cross(&p1).abs(); let b = p0.dot(p0) + p0.dot(p1) + p1.dot(p1); denom += a * b; are...
Rust
0
PartialEq)] #[repr(u8)] pub(crate) enum Op { $( $name , )* } impl From<u8> for Op { fn from(n: u8) -> Op { unsafe { std::mem::transmute::<u8, Op>(n) } } } ); } OPS!(define_op_enum); pub(crate) const REGISTER_COUNT: usiz...
Rust
0
南省永仁县"), ("532328", "云南省元谋县"), ("532329", "云南省武定县"), ("532330", "云南省禄劝县"), ("532331", "云南省禄丰县"), ("532400", "云南省玉溪地区"), ("532401", "云南省玉溪市"), ("532421", "云南省玉溪县"), ("532422", "云南省江川县"), ("532423", "云南省澄江县"), ...
Rust
0
:policy::*; use crate::uses::*; #[derive(Debug, Default, Clone, Copy, PartialEq, Serialize, Deserialize)] pub struct GL_TEXTURE_1D; impl TexType for GL_TEXTURE_1D { const TYPE: GLenum = gl::TEXTURE_1D; } #[derive(Debug, Default, Clone, Copy, PartialEq, Serialize, Deserialize)] pub struct GL_TEXTURE_2D; impl TexType f...
Rust
0
assert_eq!(mydata, r!(List::from_pairs(vec![("x", r!(1)), ("y", r!(2))])).set_class(&["data.frame"])?); /// } /// ``` /// /// Panics on error. #[macro_export] macro_rules! data_frame { () => { call!("data.frame").unwrap() }; ($($rest: tt)*) => { call!("data.frame", $($rest)*).unwrap() };...
Rust
0
::<INT>("let x = [1, 2, 3,]; x[1]")?, 2); assert_eq!(engine.eval::<INT>("let y = [1, 2, 3]; y[1] = 5; y[1]")?, 5); assert_eq!( engine.eval::<char>(r#"let y = [1, [ 42, 88, "93" ], 3]; y[1][2][1]"#)?, '3' ); assert_eq!(engine.eval::<INT>("let y = [1, 2, 3]; y[0]")?, 1); assert_eq!(eng...
Rust
0
# -*- python -*- # This software was produced by NIST, an agency of the U.S. government, # and by statute is not subject to copyright in the United States. # Recipients of this software assume all responsibilities associated # with its operation, modification and maintenance. However, to # facilitate maintenance we ...
Python
1
ess": False, "error": "Character file name is required"}) file_path = os.path.join(CHARACTERS_DIR, file_name) # 写入角色文件 with open(file_path, 'w', encoding='utf-8') as f: f.write(content) return jsonify({"success": True}) except Exception as e: return jsonify({"s...
Python
1
#this function is used to delete an element from the given list a=[5,"ram",10,"ravi",10] a.remove(10) print(a) #program to implement a=[] for i in range(6): b=input("enter element") a.append(b) print("list before removal of element",a) element=input("enter element you want to remove") a.remove(element) pri...
Python
1
6 " " KwCase@36..40 "case" error at 20..25: unexpected token | error for 20..25: expected ‘of’, but found ‘label’"#]], ); } #[test] fn recover_case_stmt_missing_expr() { check( r#" case of label : end case"#, expect![[r#" S...
Rust
0
) = &input.notebook_instance_name { object.key("NotebookInstanceName").string(var_1288); } if let Some(var_1289) = &input.instance_type { object.key("InstanceType").string(var_1289.as_str()); } if let Some(var_1290) = &input.role_arn { object.key("RoleArn").string(var_1290); ...
Rust
0
"""coBib's `PresetFilter` selection screen. This screen renders a Textual-`OptionList` with all the preset filters configured via `config.tui.preset_filters` for the user to choose from. .. warning:: This module makes no API stability guarantees! Refer to `cobib.ui.components` for more details. """ from __future...
Python
1