text
string
label_name
string
labels
int64
Memory 0 Register to ADC12_B Memory 31 Register"] pub mod adc12mem2; #[doc = "ADC12_B Memory 0 Register to ADC12_B Memory 31 Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::wr...
Rust
0
FLAGS.learning_rate, tf_global_step, decay_steps, FLAGS.learning_rate_decay_factor, staircase=True) slim.summaries.add_scalar_summary(lr, 'learning_rate', print_summary=True) # Specify the optimization scheme: optimizer = tf.train.GradientDescentOptimizer(l...
Python
1
map(|(i, v)| (i as f32, *v)), &RED, )) .unwrap(); chart .configure_series_labels() .background_style(&WHITE.mix(0.0)) .border_style(&WHITE) .draw() .unwrap() } #[test] fn plot_splinterpol_elephant()...
Rust
0
"""add-dataset-retrieval-model Revision ID: fca025d3b60f Revises: b3a09c049e8e Create Date: 2023-11-03 13:08:23.246396 """ import sqlalchemy as sa from alembic import op from sqlalchemy.dialects import postgresql # revision identifiers, used by Alembic. revision = 'fca025d3b60f' down_revision = '8fe468ba0ca5' branch...
Python
1
""" Agents module for managing different roles in the multi-agent system. """
Python
1
class Solution: def maskPII(self, s: str) -> str: if "@" in s: s = s.lower() name = s.split("@") print(name) return name[0][:1] +"*****"+ name[0][-1:] +"@"+ name[1] else: nums = '' for i in range(len(s)): if s[i]...
Python
1
H : Key32 = Key32(-19); pub const KEY_LOG : Key32 = Key32(-20); pub const KEY_MAPS : Key32 = Key32(-21); pub const KEY_NAME : Key32 = Key32(-22); pub const KEY_PANIC : Key32 = Key32(-23); pub const KEY_PARAMS : Key32 = Key32(-24); pub const KEY_POST ...
Rust
0
le, pub frag_entry: &'static str, } <filename>libcoppe/rust/coppe-core/src/debug.rs use crate::ffi; pub use ffi::debug_log as log; <reponame>terassyi/rusgb<filename>src/cpu/bus.rs use crate::cartridge::Cartridge; use crate::mem::ram::Ram; use crate::timer::Timer; #[derive(Debug)] pub struct Bus<'a> { cartridg...
Rust
0
ize.pow(35), -2isize.pow(43) - 1, -2isize.pow(43), 2isize.pow(43) - 1, 2isize.pow(43), -2isize.pow(51) - 1, -2isize.pow(51), 2isize.pow(51) - 1, 2isize.pow(51), -2isize.pow(59) - 1, -2isize.pow(59), 2isize.pow(59) - 1, 2isiz...
Rust
0
df['layer'].apply(lambda x: x.split('-')[0]) all_moran_df['layer_num'] = all_moran_df['layer'].apply(lambda x: x.split('-')[1].replace('l', '')) print(all_moran_df.groupby(['layer', 'layer_area', 'layer_num']).size().reset_index(name='count')) # LISA maps ------------------------------------------------------------...
Python
1
video global answer_ent answer_ent.delete('0','end') cv2.destroyAllWindows() video.destroy() clear_lb = tk.Label(window2, font=('Cambria',30),bg='#FFBC8B') clear_lb.place(x = 975, y = 400, width = 300) def display_next(): global next_btn next_btn = tk.Button(window2, text = "N...
Python
1
# -*- coding: utf-8 -*- import pygcb def CreateDBObject(): dbObj=pygcb.tcSignatureModel() dbObj.mzClass='IR_FW_VL_H_LP_4_Super_M2.8' dbObj.aspectModifier_dB=[13.890000,13.890000,13.890000,12.890000,11.890000,11.890000,10.890000,10.890000,10.890000,6.080000,8.630000,10.060000,11.130000,12.100000,13.070000,13...
Python
1
# -*- coding: utf-8 -*- """ExerciciosFuncoesEListas.ipynb Automatically generated by Colaboratory. Original file is located at https://colab.research.google.com/drive/1wSO_fjWsPymP4W6ymjOKIPpTAVmNtb-C ### Aula de exercícios - Funções --- 1) Crie a função > def taboada(n): >>Apresenta a taboada do inteiro n, on...
Python
1
import uuid from square.types.device_checkout_options import DeviceCheckoutOptions from square.types.money import Money from square.types.terminal_checkout import TerminalCheckout from . import helpers sandbox_device_id = "da40d603-c2ea-4a65-8cfd-f42e36dab0c7" def create_terminal_checkout() -> str: client = he...
Python
1
# Copyright 2025 Giacomo Ferretti # # 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 writ...
Python
1
s: Args, help_options: &'static HelpOptions, groups: &[&'static CommandGroup], owners: HashSet<UserId>, ) -> CommandResult { let _ = help_commands::with_embeds(context, msg, args, help_options, groups, owners).await; Ok(()) } #[hook] async fn unknown_command(_ctx: &Context, _msg: &Message, unknown_...
Rust
0
https://crates.io/crates/nix) crate offers safe interface to many low-level functions, //! including //! [`pthread_sigmask`](https://docs.rs/nix/0.11.0/nix/sys/signal/fn.pthread_sigmask.html). //! //! # Portability //! //! It should work on any POSIX.1-2001 system, which are all the major big OSes with the notable //! ...
Rust
0
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Globalization") try: import winrt.windows.foundation except: pass try: import winrt.windows.foundation.collections except: pass try: ...
Python
1
from fastapi import FastAPI, UploadFile, File from fastapi.responses import JSONResponse, FileResponse import analysis as analysis_module analysis_module.VT_API_KEY = os.getenv("VT_API_KEY", None) import os from analysis import run_analysis from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer from report...
Python
1
w: &'a mut W, } impl<'a> RESERVED8_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[inline(always)] pub fn clear_bit(self) -> &'a mut W { self.bit(false) } #[doc = r"Writes...
Rust
0
('a') .long("accumulator") .takes_value(true) .possible_value("mock") .possible_value("naive") .possible_value("iblt") .possible_value("psum")) .get_matches(); let n: usize = matches.value_of("n").unwrap().parse().unwrap(); let b: ...
Rust
0
name = "Long" print(name.lower()) print(name.upper()) print(name.title())
Python
1
.build)(&user_input); assert_eq!("grep ./one", result); } #[test] fn parse_defs_inline_group() { let mut groups = HashMap::new(); groups.insert( "VALUE".to_string(), GroupDef { expect: Some("string".into()), suggest: None, ...
Rust
0
ommon .my.salesforce.com convention that is common for all instance urls. """ if legacy: if org: url = instance_url.replace( f".{org}{dns}", f"--{namespace}.{org}.vf.force.com" ) else: url = instance_url.replace(f"{dns}", f"--{namespace}.vf...
Python
1
VkFunctionTable } impl VkRawType<VkEvent> for RawVkEvent { fn vk_to_wrapped(src: &RawVkEvent) -> VkEvent { VkEvent { _handle: *src, _fn_table: ptr::null_mut() } } } impl VkWrappedType<RawVkEvent> for VkEvent { fn vk_to_raw(src: &VkEvent, dst: &mut RawVkEvent) { ...
Rust
0
ltypes_V4L2_FRMIVAL_TYPE_STEPWISE: v4l2_frmivaltypes = 3; pub type v4l2_frmivaltypes = ::std::os::raw::c_uint; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct v4l2_frmival_stepwise { pub min: v4l2_fract, pub max: v4l2_fract, pub step: v4l2_fract, } #[test] fn bindgen_test_layout_v4l2_frmival_stepwise() ...
Rust
0
"Age vs Parents/Children Aboard by Survival") plt.xlabel("Age") plt.ylabel("Parents/Children Aboard") plt.show() # Insight: # Young children and those with parents had higher survival. # 16. Correlation heatmap numerical = df.select_dtypes(include=['float64', 'int64']) corr_matrix = numerical.corr() plt.figure(figsiz...
Python
1
return Ok(node.clone()) } Err(Error::ErrResolveViaReadlink) => { if *remainingTraversals == 0 { return Err(Error::SysError(SysErr::ELOOP)) } let targetPath = inode.ReadLink(task)?; *remainingTrave...
Rust
0
import csv from pathlib import Path import tkinter as tk from tkinter import filedialog, messagebox, simpledialog from openpyxl import load_workbook # pip install openpyxl def pick_excel_file() -> Path | None: root = tk.Tk() root.withdraw() root.update() path = filedialog.askopenfilename( tit...
Python
1
from abc import ABC, abstractmethod from dataclasses import asdict, dataclass from typing import Any, Dict, Optional, Sequence from browser_use.controller.registry.views import ActionModel @dataclass class BaseTelemetryEvent(ABC): @property @abstractmethod def name(self) -> str: pass @prop...
Python
1
size ); assert_eq!(entry.ancestors_count, ancestors.len() + 1); let ancestors = pool.calc_ancestors(&tx3.proposal_short_id()); let expect_result = vec![tx1.proposal_short_id()].into_iter().collect(); assert_eq!(ancestors, expect_result); let entry = pool.get(&tx3.propos...
Rust
0
\" and use `tools` to fetch the crates + `cargo fetch`")?; writeln!(o, "fuzz \"Prepare workspace\" and use `tools` to fuzz-test the crates")?; writeln!(o, "package \"Prepare workspace\" and use `tools` to package the crates")?; writeln!(o, "run | r \"Prepare workspace\" and use `tools` to run th...
Rust
0
= [], [] if len(gts) > 0: for i, gt in enumerate(gts): scale, shift = ssi_helper( gts[i][gts[i] > 0].cpu().detach(), preds[i][gts[i] > 0].cpu().detach() ) gt = gts[i].cpu().detach().squeeze().numpy() pred = (preds[i].cpu().detach() * scale + s...
Python
1
evision_date: u64, summoner_level: u32, } #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] struct MatchHistoryResult<'a> { #[serde(borrow)] matches: Vec<MatchHistoryMatch<'a>>, } #[derive(Serialize, Deserialize, Debug)] #[serde(rename_all = "camelCase")] struct MatchHistoryMatch...
Rust
0
0xE5: "清除错误失败", 0xF0: "清除错误成功" } # 基础状态解码 base_status = status & 0xF0 if base_status in status_map: base_msg = status_map[base_status] detail = status & 0x0F return f"{base_msg} (详情: 0x{detail:X})" return f"未知状态: 0x{status:X...
Python
1
# 1. Let us say your expense for every month are listed below, # 1. January - 2200 # 2. February - 2350 # 3. March - 2600 # 4. April - 2130 # 5. May - 2190 # Create a list to store these monthly expenses and using that find out, # 1. In Feb, how many dollars you spent extra compare to January? # 2. Fi...
Python
1
ices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False pdf_documents = [ ('about', u'${proj...
Python
1
String::from("LN"), String::from("thirteen"))]), ); assert!(matches!( ReferenceSequence::try_from(record), Err(TryFromRecordError::InvalidLength(_)) )); } } <reponame>cbiffle/emb.rs //! An example program for the STM32F4DISCOVERY board. #![feature(const_fn)] #![no_...
Rust
0
import numpy as np arr = np.array([1, 2, 3, 4, 5, 6]) arr_2d = arr.reshape(2, -1) print(arr_2d)
Python
1
`scrypto_statictypes::XRD`, found enum `MYTOKEN` //! // | //! // = note: expected struct `scrypto_statictypes::prelude::BucketOf<scrypto_statictypes::XRD>` //! // found struct `scrypto_statictypes::prelude::BucketOf<MYTOKEN>` //! //! //! let xrd_vault...
Rust
0
_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for PRI129_R { type Target = crate::FieldReader<u8, u8>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } #[doc = "Field `PRI129` writer - Priority of interrupt 129"] pub struct PRI129_W<'a> { w: &'a mut W, } imp...
Rust
0
_fs_epoll_handler("test_1".to_string()); let event_fd = EventFd::new(0).unwrap(); let mgr = EpollManager::default(); let id = mgr.add_subscriber(Box::new(handler)); let mut inner_mgr = mgr.mgr.lock().unwrap(); let mut event_op = inner_mgr.event_ops(id).unwrap(); let event...
Rust
0
r0 = handlebars.render("t1", &true); assert_eq!(r0.ok().unwrap(), "hello inner true".to_string()); } #[test] fn test_self_inclusion() { let t0 = "hello {{> t1}} {{> t0}}"; let t1 = "some template"; let mut handlebars = Registry::new(); assert!(handlebars.register_te...
Rust
0
raw(), bind_info.len() as u32, bind_info.as_ptr() as *const _ as *const vks::VkBindSparseInfo, fence.handle().to_raw()); error::check(result, "vkQueueBindSparse", ()) } /// Creates a new fence object /// /// https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkCr...
Rust
0
rint is missing a name".into()))?; let reference = footprint .reference .as_ref() .ok_or(MpError::Save("footprint is missing a reference".into()))?; let local: DateTime<Local> = Local::now(); let ts = local.timestamp(); write!(f, "(module {} (layer F.Cu) (tedit {:X})\n", name.txt...
Rust
0
# THIS GAME WAS MADE ONLY USING CHATGPT # (except adding the correct picture path) import pygame import sys # Initialize Pygame pygame.init() # Constants WIDTH, HEIGHT = 800, 600 WHITE = (255, 255, 255) BLACK = (0, 0, 0) BROWN = (160, 82, 45) LIGHT_BROWN = (210, 105, 30) FONT = pygame.font.Font(None, 36) COOKIE_SIZE...
Python
1
texArray, vbo: Buffer, } impl Renderer { pub fn new(config: RendererConfig) -> Renderer { let program = ShaderProgram::new(VS_SRC, FS_SRC).expect("Problem creating shader program"); Renderer { transform: glx::vtx_transform_2d(config.width, config.height), boid_size: con...
Rust
0
all_pair_vrs.iter().map(|x| &x.1)); if fmt == 1 { let mut pair_sets: Vec<Offset16<PairSet>> = vec![]; for left in &coverage.glyphs { let mut pair_value_records: Vec<PairValueRecord> = vec![]; for (right, (vr1, vr2)) in split_mapping.get(&left).unwrap() { ...
Rust
0
xpect(debug_cmd(), 'GC_FORCEINVOKE', 'idx').equal('DONE') env.expect(debug_cmd(), 'GC_WAIT_FOR_JOBS').equal('DONE') # Search for the deleted document res = env.cmd('FT.SEARCH', 'idx', 'ismissing(@t)', 'NOCONTENT') env.assertEqual(res, [0]) # Make sure the GC indeed cleaned the document, and it is ...
Python
1
"webkit_input_method_underline_new")] pub fn new(start_offset: u32, end_offset: u32) -> InputMethodUnderline { assert_initialized_main_thread!(); unsafe { from_glib_full(ffi::webkit_input_method_underline_new( start_offset, end_offset, )) ...
Rust
0
"], Some("false"), ); } #[test] fn test039() { super::test_it ( &vec![" (sequential? \"abc\") "], Some("false"), ); } // ; Testing apply function with core functions and arguments in vector #[test] fn test040() { super::test_it ( &vec![" ...
Rust
0
PayToPubkeyHash(Address), /// Another kind of output Unknown } impl TxOut { /// Determines the template that this output adheres to, if any pub fn classify(&self, network: Network) -> ScriptPubkeyTemplate { if self.script_pubkey.len() == 25 && self.script_pubkey.slice_to(3) == &[0x76, 0xa9, 0x14] &...
Rust
0
from operecoesbd import * def listarFilmes(conexao): filmes = listarBancoDados(conexao, 'select * from filmes') if len(filmes) > 0: print('Lista de filmes') for item in filmes: print(item[0], '»', item[1], ' - ', item[3]) else: print("Não exi...
Python
1
""" Classifies: CHEBI:60834 beta-carbolines """ from rdkit import Chem from rdkit.Chem import AllChem def is_beta_carbolines(smiles: str): """ Determines if a molecule is a beta-carboline based on its SMILES string. A beta-carboline is a pyrido[3,4-b]indole or its hydrogenated derivatives. Args: ...
Python
1
cation) def SubscriberReceivedAddSubscriber(builder, subscriber): builder.PrependUint64Slot(1, subscriber, 0) def AddSubscriber(builder, subscriber): return SubscriberReceivedAddSubscriber(builder, subscriber) def SubscriberReceivedAddSubscriberAuthid(builder, subscriberAuthid): builder.PrependUOffsetTRelativeSlot(...
Python
1
use std::path::Path; #[test] pub fn test_in_memory_files() { let path = Path::new("./abc/bcd/a"); println!("{:?}", path.strip_prefix("./abc/")); // files::InMemFiles::new("/abc", "./static/"); } }struct U { i: i32, f: f32 } <gh_stars>0 use super::*; #[test] fn test_create() { ...
Rust
0
full_buffer) } fn serialize_parser_type(buffer: &mut String, heap: &Heap, parser_type: &ParserType) { use ParserTypeVariant as PTV; fn serialize_variant(buffer: &mut String, heap: &Heap, parser_type: &ParserType, mut idx: usize) -> usize { match &parser_type.elements[idx].variant { PTV::V...
Rust
0
x=input() y=[] y.extend(x) s=0 g=0 for i in y: c=i if i == c.lower(): s+=1 else: g+=1 if s>g: print(x.lower()) elif g>s: print(x.upper()) else: print(x.lower())
Python
1
import subprocess import tempfile import os class CppCodeExecutor: def execute_code(self, code: str, stdin_input: str = "") -> dict: # Write C++ code to a temporary file. with tempfile.NamedTemporaryFile("w", suffix=".cpp", delete=False) as source_file: source_file.write(code) ...
Python
1
_activities, workflow_runner=ANY, interceptors=ANY, activity_executor=ANY, max_concurrent_activities=ANY, ) assert worker == mock_worker_class.return_value def test_get_worker_task_queue(temporal_client: TemporalWorkflowClient): """Test get_worker_task_queue returns the ap...
Python
1
import rclpy from rclpy.node import Node from std_msgs.msg import Float32MultiArray import serial import re class LoraReceiverNode(Node): def __init__(self): super().__init__('lora_receiver') self.publisher_ = self.create_publisher(Float32MultiArray, '/drone/info', 10) # 打開 Arduino...
Python
1
er_window._drag_data['y'] + event.y fresher_window.geometry(f'+{x}+{y}') fresher_window.bind("<ButtonPress-1>", on_drag_start) fresher_window.bind("<B1-Motion>", on_drag_motion) close_button = tk.Button(fresher_window, text="❌", command=fresher_window.destroy, bg="#2c2c2c", fg="white", bd=0, font=...
Python
1
HtmlParamElement { inner } } } impl AsRef<web_sys::HtmlParamElement> for HtmlParamElement { fn as_ref(&self) -> &web_sys::HtmlParamElement { &self.inner } } impl_html_element_traits!(HtmlParamElement); impl_try_from_element!(HtmlParamElement); impl_known_element!(HtmlParamElement, "PARAM")...
Rust
0
import subprocess from pathlib import Path if __name__ == "__main__": dashboard_path = Path(__file__).parent / "dashboard.py" subprocess.run(f"streamlit run {dashboard_path}", shell = True)
Python
1
} } ); } /// Create a PhyInfo object for unit testing. fn send_query_iface_response( exec: &mut Executor, server: &mut fidl_service::DeviceServiceRequestStream, iface_info: Option<&mut fidl_service::QueryIfaceResponse>, ) { assert_var...
Rust
0
elf, index: usize, data: impl IntoIterator<Item=T, IntoIter=I>) where I : Iterator<Item=T> + ExactSizeIterator { assert!(index <= self.num_rows); let mut iter = data.into_iter(); if self.num_rows == 0 { self.num_cols = iter.len(); } else { assert_e...
Rust
0
import heapq import numpy as np class AStarPathfinderNoHeuristic: def __init__(self, grid): self.grid = grid self.rows, self.cols = grid.shape def heuristic(self, a, b): # No heuristic — always returns 0 return 0 def get_neighbors(self, node): directions = [(0, 1),...
Python
1
# Frappe Assistant Core - AI Assistant integration for Frappe Framework # Copyright (C) 2025 Paul Clinton # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License...
Python
1
v`atayim", 32.0697222, 34.8116684, 73.0), City::new(5228, "Israel", "Qiryat Gat", 31.6000000, 34.7666664, 126.0), City::new(5229, "Israel", "`Akko", 32.9236111, 35.0727768, -9999.0), City::new(5230, "Israel", "Elat", 29.5611111, 34.9516678, 72.0), City::new(5231, "Israel", "<NAME>", 32.1508333, 34.8883324, 60.0), ...
Rust
0
); println!( "[kernel] _supervisor_to_user: {:#x}", _supervisor_to_user as usize ); // 在启动程序之前,需要加载内核当前线程的信息到tp寄存器中 unsafe { hart::KernelHartInfo::load_hart(hart_id) }; // 这之后就可以分配地址空间了,这之前只能用内核的地址空间 // todo: 这里要有个地方往tp里写东西,否则目前会出错 let kernel_memory = memory::MemorySet::...
Rust
0
=0x7e => return Err(AcpiError::InvalidGenericAddress), 0x7f => AddressSpace::FunctionalFixedHardware, 0x80..=0xbf => return Err(AcpiError::InvalidGenericAddress), 0xc0..=0xff => AddressSpace::OemDefined(raw.address_space), }; Ok(GenericAddress { address_s...
Rust
0
f collecting the whole graph assert dvc.stage.collect("copy-foo-bar") == [stage] assert dvc.stage.collect_granular("copy-foo-bar") == [(stage, None)] def test_collect_repo_callback(tmp_dir, dvc, mocker): mock = mocker.Mock() dvc.stage_collection_error_handler = mock (stage,) = tmp_dir.dvc_gen("fo...
Python
1
); pub const ZSRCSEL: OtherModeLMask = OtherModeLMask(0x0000_0003); pub const RENDERMODE: OtherModeLMask = OtherModeLMask(0xffff_fff8); // Subsets of RENDERMODE pub const AA_EN: OtherModeLMask = OtherModeLMask(0x0000_0008); pub const Z_CMP: OtherModeLMask = OtherModeLMask(0x0000_0010); pub cons...
Rust
0
PEC>`"] pub type PWM_SCM = crate::Reg<pwm_scm::PWM_SCM_SPEC>; #[doc = "PWM Sync Channels Mode Register"] pub mod pwm_scm; #[doc = "PWM_DMAR register accessor: an alias for `Reg<PWM_DMAR_SPEC>`"] pub type PWM_DMAR = crate::Reg<pwm_dmar::PWM_DMAR_SPEC>; #[doc = "PWM DMA Register"] pub mod pwm_dmar; #[doc = "PWM_SCUC regi...
Rust
0
[offNum] + imgWidth * (_f.y[offNum] + _f.height[offNum]); return calcSumOfs(x,of0,of1,of2,of3, inAlloc); } static int evaluateIntegralNof(const rs_allocation in, const int x, const int imgWidth) { int of0 = nrect.s0 + imgWidth * nrect.s1; int of1 = nrect.s0 + nrect.s2 + imgWidth * nrect.s1; int of2 = n...
Rust
0
zers(&mut self, num: u32) -> WasmResult<()> { self.result .data_initializers .reserve_exact(usize::try_from(num).unwrap()); Ok(()) } fn declare_data_initialization( &mut self, memory_index: MemoryIndex, base: Option<GlobalIndex>, offset: u...
Rust
0
a list with one element for i in argv: if "csv" in i or "json" in i: path = i if os.path.isabs(path): # full path full_path = path else: # relative path full_path = f"{os.getcwd()}/{path}" break...
Python
1
""" Window Rank Line Chart ---------------------- This example shows the Group F rankings in the 2018 World Cup after each matchday. A window transformation is used to rank each after each match day, sorting by points and difference. """ # category: case studies import altair as alt import pandas as pd source = pd.Da...
Python
1
_code_nthcdr_modulo: ("( CODEQUOTE ( A ( B ) C ) 4 CODENTHCDR )", "( CODEQUOTE ( A C ) )"), test_code_nthcdr_empty: ("( CODEQUOTE ( ) 3 CODENTHCDR )", "( CODEQUOTE ( ) )"), test_code_nthcdr_coerce: ("( CODEQUOTE A 3 CODENTHCDR )", "( CODEQUOTE ( ) )"), test_code_null_false: ("( CODEQUOTE ( A ) C...
Rust
0
f_timeline_json_cwd_output(C, I, N, SLEEP): """ Test timeline (core X) file format output. """ json_file = "timeline_json_cwd_%d.json" % os.getpid() tmp_dir = tempfile.TemporaryDirectory() file_path = os.path.join(tmp_dir.name, json_file) cmd = ['wperf', 'stat', '-m', 'imix', ...
Python
1
return Err(Error::new( ErrorKind::Other, format!("invalid protobuf Request: {:?}. Error: {:?}", req, e), )); } } let req_len = (buf_wrtr.len() - size_of::<u32>()) as u32; (&mut buf_wrtr[0..size_of::<u32>()]).co...
Rust
0
ter), KEY_SPACE => Some(Key::Space), KEY_INSERT => Some(Key::Insert), KEY_DELETE => Some(Key::Delete), KEY_HOME => Some(Key::Home), KEY_END => Some(Key::End), // TODO: PageUp // TODO: PageDown KEY_0 => Some(Key::Num0), KEY_1 => Some(Key::Num1), KEY_...
Rust
0
ndom.uniform(0.2, 0.8), 'fail_rate': 0.1 if i % 3 == 0 else 0.0, # 部分任務可能失敗 'priority': TaskPriority.NORMAL, 'task_id': f'batch_task_{i}_{source}' } tasks.append(task_config) # 批量提交任務 start_time = time.time() task_...
Python
1
from _aqt.forms.setlang_qt6 import *
Python
1
import pandas as pd import os target_area_list = ["temp"] startyear = 2016 startmonth = 6 endyear = 2022 endmonth = 9 main_dir =os.path.join(os.getcwd(), "outputs_mesh_centroid_point_road_distance_value") #main_dir = "/path/to/" for target in target_area_list: #import csv df_data =pd.read_csv(os.path.join(m...
Python
1
import cv2 import numpy as np im = cv2.imread('data/src/lena.jpg') print(im.shape) # (225, 400, 3) print(im.dtype) # uint8 im_gray = cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) print(im_gray.shape) # (225, 400) print(im_gray.dtype) # uint8 cv2.imwrite('data/dst/opencv_gray_cvtcolr.jpg', im_gray) # True im_gray_read = cv...
Python
1
ted_today = df.column("mint_sum")? .tail(Some(1)) .u32()? .into_iter() .next() .unwrap() .unwrap(); let total_mint: i32 = df.column("mint_sum")? .sum() .unwrap(); let remaining = MAX_SUPPLY - total_mint; let cent = (total_mint as f32/MAX_SUP...
Rust
0
xes, tag, img_size = img.numpy( ), relations.numpy(), texts.numpy(), gt_bboxes.numpy(), tag.numpy( ).tolist(), img_size.numpy() temp_relations, temp_texts, temp_gt_bboxes = [], [], [] h, w = int(np.max(img_size[:, 0])), int(np.max(img_size[:, 1])) img = paddle.to_tensor(img[:, :,...
Python
1
# Copyright (c) 2011 Advanced Micro Devices, Inc. # 2011 Massachusetts Institute of Technology # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: redistributions of source code must r...
Python
1
from electrumpersonalserver.bitcoin.secp256k1_main import * import hmac import hashlib from binascii import hexlify # Below code ASSUMES binary inputs and compressed pubkeys MAINNET_PRIVATE = b'\x04\x88\xAD\xE4' MAINNET_PUBLIC = b'\x04\x88\xB2\x1E' TESTNET_PRIVATE = b'\x04\x35\x83\x94' TESTNET_PUBLIC = b'\x04\x35\x87\...
Python
1
import kivy kivy.require('1.0.8') from kivy.app import App from kivy.uix.button import Button from kivy.uix.scrollview import ScrollView from kivy.uix.gridlayout import GridLayout class ScrollViewApp(App): def build(self): # create a default grid layout with custom width/height layout = GridLay...
Python
1
corators older than 6 months" ) parser.add_argument( "--dry-run", action="store_true", help="Show what would be removed without making changes" ) parser.add_argument( "files", nargs="*", help="Python files to process (defaults to all tracked Python files)" ) args = parser.parse_...
Python
1
import logging import socket from unittest import mock from app.contacts.contact_tcp import TcpSessionHandler logger = logging.getLogger(__name__) class TestTcpSessionHandler: def test_refresh_with_socket_errors(self, event_loop): handler = TcpSessionHandler(services=None, log=logger) session_...
Python
1
+ Debug + AsRef<[u8]> + AsMut<[u8]> + Copy + Default + sp_std::hash::Hash + Codec, Hasher: Hash<Output = H>, { pub fn new(storage_root: &[u8], code_hash: H) -> Self { let mut buf = Vec::new(); storage_root.using_encoded(|encoded| buf.extend_from_s...
Rust
0
from libs.eth_async.utils.files import read_json from libs.eth_async.classes import AutoRepr, Singleton from data.config import SETTINGS_FILE, ACTUAL_FOLLOWS_TWITTER class Settings(Singleton, AutoRepr): def __init__(self): json_data = read_json(path=SETTINGS_FILE) self.twitter_enabled = json_data.g...
Python
1
allow(clippy::useless_conversion)] aws_smithy_types::Number::NegInt((*var_1749).into()), ); } #[allow(unused_mut)] let mut scope_1750 = writer.prefix("SnapshotId"); if let Some(var_1751) = &input.snapshot_id { scope_1750.string(var_1751); } #[allow(unused_mut)] le...
Rust
0
# Copyright 2023 Garena Online Private Limited # # 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 agr...
Python
1
_vertices() # self.plotVoronoi(vertices, faceVertices, v.centroid(), positions[i], colorList[i]) # new_velo = getVelocity(i, positions, v.centroid()) # if (i == 0): # self.twist1.linear.x = new_velo[0] # self.twist1.linear.y = new_velo[1] # ...
Python
1
// but don't have any data that you want to store in the type itself. // Ownership of struct Data // Let's say you try to store a reference in a struct without specifying lifetimes, like this // which won't work: /*struct User2 { username: &str, email: &str, }; error[E0106]...
Rust
0
import contextlib import pytest import pandas as pd import pandas._testing as tm from pandas.core import accessor def test_dirname_mixin(): # GH37173 class X(accessor.DirNamesMixin): x = 1 y: int def __init__(self): self.z = 3 result = [attr_name for attr_name in d...
Python
1