text
string
label_name
string
labels
int64
result_forecast = base_perfectforecaster.forecast_day_ahead_capacity_factor( date, hour, gen, horizon ) expected_forecast = [i / 100 for i in range(24)] pyo_unittest.assertStructuredAlmostEqual( first=result_forecast.tolist(), second=expected_forecast ) @pytest.mark.unit def test_fore...
Python
1
pid, strides, scale, shift): ipos = pid[:, None] // strides[None, :] # the size of the highest dimension is unknown. sizes = (strides[:-1] // strides[1:]) ipos[:, 1:] = ipos[:, 1:] % sizes pos = (ipos + shift) * scale return pos.astype("f8") def main(): ns = ap.parse_args() if ns.verbos...
Python
1
name = input("Kérlek add meg a neved: ").strip().capitalize() age = input("Kérlek add meg az életkorod: ") age = int(age) agedays = age*365 python_exp_in_years = input("Kérlek add meg hány éves Python tapasztalatod van: ") #-----szorgalmi proxp = input("Szeretnéd, hogy a karaktered profi Python fejlesztő legyen? (yes...
Python
1
juin au 1er juillet", "entre le 10 juin et le 1er juillet", "du 10 juin au 1er juillet"); example!(v, check_moment_span!(c, [2017,4,6], [2017,6,9]), "du six avril au huit juin deux mille dix-sept"); example!(v, check_moment_span!(c, [2013, 2, 14, 9, 30], [2013, 2, 14, 11]), "9h30 - 11h00 Jeudi", "de 9h30 jusqu...
Rust
0
# Python code from win32com . server . register import UseCommandLine from win32api import MessageBox from win32com . client import Dispatch from win32ui import MessageBox class StemmerFactory : _reg_clsid_ = "{602D10EB-426C-4D6F-A4DF-C05572EB780B}" _reg_desc_ = "LangTech Stemmer" _reg_progid_ = "LangTech....
Python
1
elf.uuids.lock().unwrap().replace(uuids.into()); } pub async fn register(self: &Self) -> Result<(), Error> { // Register with DBus let proxy = self.connection.get_bluez_proxy(&self.adapter); proxy .method_call( LE_ADVERTISING_MANAGER_IFACE, "R...
Rust
0
ispatchError> { Ok(16u32) } fn get_metaverse_marketplace_listing_fee(metaverse_id: MetaverseId) -> Result<Perbill, DispatchError> { Ok(Perbill::from_percent(1u32)) } fn get_metaverse_treasury(metaverse_id: MetaverseId) -> AccountId { match metaverse_id { ALICE_METAVERSE_ID => return ALICE_METAVERSE_FUND,...
Rust
0
import pytest from nltk.tree.tree import Tree class TestTextPreparation: @pytest.mark.parametrize( "expected", [["review", "summar", "summar", "review"]], ) def test_stemmed(self, text_preparation, expected): assert text_preparation.stemmed() == expected @pytest.mark.paramet...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ This demo allows for automated testing of the sound latency on your system. To use it you need a labjack (or adapt for a similar device) and a cable to connect the earphones jack to the AIN0 (and GND) pins of the labjack. (The PsychoPy team would be interested to hear...
Python
1
#!/usr/bin/env cs_python # Copyright 2024 Cerebras Systems. # # 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 applicab...
Python
1
demonstration...") # Search for players # players = self.search_and_analyze_players() # self.player_db.save_players(players) # # Print summary # rospy.loginfo(self.get_player_summary()) # players_to_look = [p for p in self.players if p.is_present == True...
Python
1
/// assert!(h1_3.next(&org).is_none()); /// assert!(h1_2_2.next(&org).is_none()); /// ``` pub fn next(self, org: &Org) -> Option<Headline> { org.arena[self.hdl_n].next_sibling().map(|n| match org[n] { Element::Headline { level } => Headline::from_node(n, level, org), _ =...
Rust
0
in all_results: audio_results = all_results[audio_name] for phase_name, result in audio_results.items(): if result.success: best_sza_performance.append((audio_name, phase_name, result.similarity_score)) if best_sza_performance:...
Python
1
ft_kernels(mask.shape, voxel_spacing) pbar.update(1) coord_time = time.time() - coord_start logger.info(f"✅ Coordinate systems computed in {coord_time:.2f}s") # Process with soft masking logger.info("🎭 Applying soft masking to input grid...") mask_start = time.time() with...
Python
1
#========================================================# # # # Correrlo en un JUPYTER Notebook (es una salida html) # # # #========================================================# import yfinance as yf co...
Python
1
host", 6971) # No results phase.results = [] # Create mock socket for DONE message mock_socket = MagicMock() mock_create_connection.return_value = mock_socket # Call return_results phase.return_results() # Should only create one connection for DONE mes...
Python
1
(filename) = self.track_file.read().unwrap().file_name() { if let Some(name) = filename.to_str() { print::gpx_track_start(&mut fd, name.to_string()).unwrap(); } } } self.new_file.lock().unwrap...
Rust
0
rr.clone(); assert_eq!( arr.multi_slice_mut(($($s,)*)), ($(copy.clone().slice_mut($s),)*) ); } }; } let mut arr = Array1::from_iter(0..48).into_shape((8, 6)).unwrap(); assert_eq!( (arr.clone().view_mut(),),...
Rust
0
import cv2 cap = cv2.VideoCapture(0) while True: ret, frame = cap.read() if not ret: break cv2.imshow('photo', frame) key = cv2.waitKey(1) if key == 27: break if key == 115: cv2.imwrite('cover.jpg', frame)
Python
1
olds, width) { let key = hashable_cursor_key(&cursor); if seen.contains(&key) { panic!("Infinite loop"); } seen.insert(key); check_advance_regress(&cursor, &folds, width); } ...
Rust
0
isolation issues: helper functions test also depends on check installation command which has dependency manager singleton conflicts" ) class TestCheckInstallationHelperFunctions: """Test helper functions for check_installation command.""" def setup_method(self): """Set up test fixtures.""" sel...
Python
1
"), ("Secret ID", "机密(Secret)ID"), ("Secret env variables", "机密(Secret)环境变量"), ("Secrets", "机密(Secret)"), ("Secrets required", ""), ("Secure Web Server (HTTPS)", "安全 Web 服务 (HTTPS)"), ("Secure your supply chain at every level.", "在每个层级保护你的供应链。"), ("Securely manage sensitive data", "安全地管理敏感数据...
Python
1
16/32 bit unsigned integer data_format : str HW, CHW, HWC Returns: numpy[float32] : response map ''' # Loads response map from 16-bit PNG file response = np.array(Image.open(path), dtype=np.float32) # Convert using encodering multiplier response = response / multip...
Python
1
), } } } else { Ok(()) } } } impl<T: DeviceCopy> AsRef<[T]> for LockedBuffer<T> { fn as_ref(&self) -> &[T] { self } } impl<T: DeviceCopy> AsMut<[T]> for LockedBuffer<T> { fn as_mut(&mut self) -> &mut [T] { self } } impl<T: Devi...
Rust
0
# Set labels ax1.set_ylabel('Price ($)') ax1.set_title(f'{ticker} Dark Pool Activity') ax1.grid(True) # Plot 2: Cumulative Volume df['cumulative_volume'] = df['size'].cumsum() ax2.plot(df['tape_time'], df['cumulative_volume'], 'b-',...
Python
1
U, V, W, X, Y, Z, LWIN = 0x5B, RWIN = 0x5C, APPS = 0x5D, SLEEP = 0x5F, NUMPAD0 = 0x60, NUMPAD1 = 0x61, NUMPAD2 = 0x62, NUMPAD3 = 0x63, NUMPAD4 = 0x64, NUMPAD5 = 0x65, NUMPAD6 = 0x66, NUMPAD7 = 0x67, NUMPAD8 = 0x68, NUMPAD9 = 0x69, MULT...
Rust
0
tasks =[] while True: print("Welcome to the To-Do List App ! ") print("1. Add Tasks ") print("2. View Tasks") print("3. Mark Task as completed and delete task ") print("4. Exit") choice = int(input("Enter you choice : ")) if choice == 1: task = input("Enter the task : ") tas...
Python
1
_INTERP0_CTRL_LANE1_SHIFT_ACCESS: &'static [u8; 3usize] = b"RW\0"; pub const SIO_INTERP0_ACCUM0_ADD_OFFSET: u32 = 180; pub const SIO_INTERP0_ACCUM0_ADD_BITS: u32 = 16777215; pub const SIO_INTERP0_ACCUM0_ADD_RESET: u32 = 0; pub const SIO_INTERP0_ACCUM0_ADD_MSB: u32 = 23; pub const SIO_INTERP0_ACCUM0_ADD_LSB: u32 = 0; pu...
Rust
0
t = x2.wrapping_mul(y2); acc4 = acc4.wrapping_add(top); acc4 = acc4.wrapping_add(t); top = acc4 >> 64; acc4 &= 0xffff_ffff_ffff_ffff; t = x3.wrapping_mul(y2); acc5 = acc5.wrapping_add(top); acc5 = acc5.wrapping_add(t); let mut acc6 = acc5 >> 64;...
Rust
0
import socket from cloudflare_ddns import CloudFlare # https://pypi.org/project/cloudflare-ddns/ # GDrive -> Websites > sqlmonitor.ajaydwivedi.com > cloudflare-ddns-update-Python.py api_key = "youapikeyherewhichshouldbeverylong" sqlmonitor_subdomain = "sqlmonitor.ajaydwivedi.com" email = "sqlagentservice@gmail.com" no...
Python
1
RT, END, S>(tag: &'static str, start: START, end: END, op: OP) -> R where OP: FnOnce() -> R, START: FnOnce() -> S, END: FnOnce(S) -> usize, { let s = start(); start_subgraph(tag); let r = op(); let measured_value = end(s); end_subgraph(tag, measured_value); r } /// Stop current task...
Rust
0
itivApplyNodeRandomNormal, shape.into().as_ptr(), mean, sd, dev.map(|d| d.as_mut_ptr()).unwrap_or(ptr::null_mut()), g.map(|_g| _g.as_mut_ptr()).unwrap_or(ptr::null_mut()) ) } pub fn log_normal<S: Into<Shape>>(shape: S, mean: f32, sd: f32) -> N...
Rust
0
from enum import Enum from typing import Any, List, Optional from pydantic import BaseModel class SandboxStatus(Enum): """ Enumerated type for agent types. """ success = "success" failed = "failed" timeout = "timeout" class CodeOutput(BaseModel): type: str content: str class ReturnedF...
Python
1
defined in the [`core_api`] module. These traits //! operate at a block-level and do not contain any built-in buffering. //! They are intended to be implemented by low-level algorithm providers only. //! Usually they should not be used in application-level code. //! //! Additionally hash functions implement trai...
Rust
0
create_solution_pdf(&rand_num.to_string(), solution); output_string = format!("{} solution_{}.pdf saved to disk!", "Outputfile", rand_num); output.clear(); output.insert(1, &output_string); } ...
Rust
0
ataset_dir or 'xiezhi' in task: data_indices_by_label = defaultdict(list) # 遍历数据集 for i, item in enumerate(dataset['train']): # 假设 labels 是以 '||' 分隔的字符串 for label in item['labels'].split('||'): # 将数据的索引添加到对应的标签下 ...
Python
1
"""Tests for CDP API action provider.""" import os from unittest.mock import patch import pytest from coinbase_agentkit.__version__ import __version__ from coinbase_agentkit.action_providers.cdp.cdp_api_action_provider import cdp_api_action_provider from coinbase_agentkit.network import Network from coinbase_agentki...
Python
1
from typing import Optional from pydantic import BaseModel, Field from .prompt import CharacterPromptResponse from .image import CharacterImageFileResponse, CharacterImageURLResponse, CharacterImageResponse from .info import CharacterInfoResponse class CharacterResponse(BaseModel): character_id: int = Field( ...
Python
1
oses[[rand_idx]]).to(self.density_bitfield.device) lm68 = self.lm68s[[rand_idx]].to(self.density_bitfield.device).reshape([1, 68*2]) if self.torso_individual_embedding_dim > 0: ind_code = self.torso_individual_codes[[rand_idx]] else: ind_code = None X = torch.ar...
Python
1
ion_Crew = Integration_Crew.kickoff() yield Integration_Crew End2End_Crew = Crew( agents=[End2End_Agent], tasks=[End2End_Task], verbose=1 ) End2End_Crew = End2End_Crew.kickoff() yield End2End_Crew def write_debugged_code(code_raw, file...
Python
1
eaklabel # sampling_strategy = {weakLabel: desired_sample_count} # weakLabel和設置desired_sample_count為希望稱生成的樣本數量 # # SMOTE進行過抽樣時,所請求的樣本數應不小於原始類別中的樣本數。 # oversample = SMOTE(sampling_strategy=sampling_strategy, k_neighbors=k_neighbors, random_state=42) # # 參數說明: # ...
Python
1
; } extern "C" { pub fn FT_Face_GetCharsOfVariant(face: FT_Face, variantSelector: FT_ULong) -> *mut FT_UInt32; } extern "C" { pub fn FT_MulDiv(a: FT_Long, b: FT_Long, c: FT_Long) -> FT_Long; } extern "C" { pub fn FT_MulFix(a: FT_Long, b: FT_Long) -> FT_Long; } extern "C" { pub fn FT_DivFix(a: FT_Lo...
Rust
0
urn: This generator produces a series of tuples of trees. The ith element of each tuple is a tree whose root node is assigned the state states[i] by this BUTA. This generator produces all possible tuples of this form """ for q in states: check_is_nontermin...
Python
1
s= '8'*86 while '1111'in s or '8888' in s: if '1111'in s: s =s.replace('1111','8',1) else: s = s.replace('8888','11',1) print(s) #88
Python
1
# The source code in this file is mainly adapted from # https://github.com/HazyResearch/fm_data_tasks/blob/main/fm_data_tasks/utils/utils.py # which is under Apache License Version 2.0. """Misc utils.""" import logging from pathlib import Path from typing import List from rich.logging import RichHandler def setup_l...
Python
1
from random import randint as r while True: a = int(input("Enter your ticket number between 1 and 5: ")) b = r(1,3) if a==b: print("Congratulation!!! you've won $200,000 Lottery") else: print(f"Sorry, better luck next time. The number was {b}")
Python
1
" | "mode3" | "3" => Ok(TransferMode::Mode3), _ => Err(SpiError::InvalidTransferMode(s.to_string())), } } } #[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub enum ClockPhase { SampleLeading, SampleTrailing, } #[derive(Debug, Clone, Copy, Serialize, Deserialize)] pub enum ClockP...
Rust
0
ctual data that is carried by the event is held by child nodes of the # data node. In the case of the Exposure End event, the child nodes are EventExposureEndFrameID and EventExposureEndTimestamp. # The CSampleCameraEventHandler demonstrates how to access the child nodes within # a callback that is fired f...
Python
1
!(); println!("Received interrupt, exiting. Goodbye."); exit(0); } }) .map_err(Error::SignalHandler)?; let mut i = 1; while !renderings.is_empty() { info!("====== RENDERING QUEUE ======"); for job in &renderings { info!( "{} ==...
Rust
0
#!/usr/bin/env python3 """Test script to check tooth routing functionality.""" from RAG.app.pipeline import build_pipeline, answer_with_contexts from RAG.app.pipeline_modules.pipeline_ingestion import discover_input_paths def test_tooth_routing(): print("Testing tooth routing functionality...") # Build p...
Python
1
ef_124454) # OR operation ref_124697 = ref_124468 # MOV operation ref_124699 = ((0x40 - ref_124697) & 0xFFFFFFFFFFFFFFFF) # SUB operation ref_124707 = ref_124699 # MOV operation ref_124811 = ref_122094 # MOV operation ref_124815 = ref_124707 # MOV operation ref_124817 = (ref_124815 & 0xFFFFFFFF) # MOV operation ref_124...
Python
1
) writer structure"] impl crate::Writable for FLEXPWM1_PWMB1_SELECT_INPUT {} #[doc = "FLEXPWM1_PWMB1_SELECT_INPUT DAISY Register"] pub mod flexpwm1_pwmb1_select_input; #[doc = "FLEXPWM1_PWMB2_SELECT_INPUT DAISY Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset),...
Rust
0
from .memory_strategy.global_lt_balance_update import Global_lt_balance_update from .memory_strategy.part_st_balance_retrieve import Part_st_balance_retrieve from .memory_strategy.part_st_balance_update import Part_st_balance_update from .memory_strategy.part_lt_balance_retrieve import Part_lt_balance_retrieve from ...
Python
1
mbda('lambda_1F96') def lambda_1F96(): CameraMove(-66700, 0, -62400, 2000) ExitThread() DispatchAsync(0x0101, 0x0001, lambda_1F96) @scena.Lambda('lambda_1FAE') def lambda_1FAE(): OP_67(0, 5450, -10000, 2000) ExitThread() DispatchAsync(0x0101, 0x0002, lambda_1FAE)...
Python
1
from homeassistant.components.sensor import SensorEntity from homeassistant.util.dt import now, get_default_time_zone from .manifest import manifest async def async_setup_entry(hass, config_entry, async_add_entities): async_add_entities([WeComSensor(hass, config_entry)]) class WeComSensor(SensorEntity): ...
Python
1
w_test_data.sin_cos() Asymmetric step with Sakoe-Chiba band >>> asyband = dtw(query,reference, ... keep_internals=True, step_pattern=asymmetric, ... window_type=sakoeChibaWindow, ... window_args={'window_size': 30} ); >>> dtwPlot(asyband,type="density") # doctest: +SKIP Display some wi...
Python
1
SUPPORTED_LLM_MODELS = { "tiny-llama-1b": { "model_id": "TinyLlama/TinyLlama-1.1B-Chat-v1.0", "prompt_template": "<|user|>\n{instruction}</s> \n<|assistant|>\n", "tokenizer_kwargs": {"add_special_tokens": False}, }, "phi-2": { "model_id": "susnato/phi-2", "prompt_temp...
Python
1
ready exists at prim path: '{prim_path}'.") # modify variants if hasattr(cfg, "variants") and cfg.variants is not None: select_usd_variants(prim_path, cfg.variants) # modify rigid body properties if cfg.rigid_props is not None: schemas.modify_rigid_body_properties(prim_path, cfg.rigid_...
Python
1
ing, #[derivative(Hash = "ignore")] #[derivative(Debug = "ignore")] #[serde(skip)] span: Option<Span>, } impl Id { pub fn new<S: ToString>(id: S, span: Option<Span>) -> Self { Self { id: id.to_string(), span, } } } impl WithPos for Id { fn copy_span(...
Rust
0
_query_value(None, "journal_mode", |row| row.get(0))); let expected_journal_mode = if is_memory { "memory" } else { "wal" }; assert_eq!(foreign_keys, 1); assert_eq!(journal_mode, expected_journal_mode); conn.set_prepared_statement_cache_capacity(100); if !c!("checking foreign keys" => conn.db_conf...
Rust
0
(13521, 24817), (13521, 23198), (13521, 33852), (13521, 15834),]; pub static NAME2CODE_CODE: &'static [char] = &[ 'ឡ', '🠷', 'ᴀ', 'េ', '8', '𐃆', '𔐈', 'פּ', 'ꤽ', '𝋱', '\u{d63}', '𒒏', 'Ứ', '⦷', '𖾇', '𝡀', 'ᔟ', 'こ', 'ŝ', '₾', '↓', '𑌏', '⺭', '㋏', 'ᤒ', '盧', '𛰘', '𛁅', '\u{8ec}', '𒒧', 'Ⓝ', 'Ⓑ', '᭠', ...
Rust
0
ut().store8(address.to_usize(), value)?; Ok(()) } pub fn sh<Mac: Machine<R, M>, R: Register, M: Memory>( machine: &mut Mac, rs1: RegisterIndex, rs2: RegisterIndex, imm: Immediate, ) -> Result<(), Error> { let (address, _) = machine.registers()[rs1].overflowing_add(R::from_i32(imm)); let val...
Rust
0
pub email: String, pub password: String, } #[derive(cynic::InputObject, Debug, Clone)] pub struct LoginUser { pub email: String, pub password: String, } #[derive(cynic::Scalar, Debug, Clone)] pub struct DateTime(pub String); #[derive(cynic::Scalar, Debug, C...
Rust
0
#[derive(Clone, Debug)] pub enum KafkaTarget { Internal { topic: String }, External { config: KafkaConfig }, } impl KafkaTarget { pub fn topic_name(&self) -> &str { match self { Self::Internal { topic } => topic, Self::External { config } => &config.topic, } } ...
Rust
0
fn connect_alt_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; #[doc(alias = "autofocus")] fn connect_autofocus_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId; #[doc(alias = "capture")] fn connect_capture_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandler...
Rust
0
o_int("LVIII".to_string()), 58); assert_eq!(Solution::roman_to_int("MCMXCIV".to_string()), 1994); } } <filename>src/crypto/mod.rs pub mod hash; mod merkle; pub use merkle::{ MerkleTree, BatchMerkleProof, build_merkle_nodes }; pub type HashFunction = fn(&[u8], &mut [u8]);<gh_stars>1-10 use std::fmt; pub f...
Rust
0
ec![1, 4], Some((Some(3), Some(0)))); } #[test] #[should_panic] fn replace_slice_out_of_range() { replace_slice(&vec![1], &vec![1, 4], Some((Some(0), Some(5)))); } }<gh_stars>1-10 mod random_graph; use bron_kerbosch::graph::{NewableUndirectedGraph, Vertex, VertexSetLike}; use bron_kerbosch...
Rust
0
from random import * s="zxcvbnmsdfghjklqwertyuiop" city=['Delhi','Mumbhai','Ghaziabad','Gujrat','Rajistan','Ahmedabad','Ajmer','Hyderabad','Agra','Bangalore'] designation=['Manager','Accountant','Assistant Manager','Clark','Salesman','Analyst','Peon','Ass Exec Eng','Chief Engineer','Receptionist'] def get_fack_name()...
Python
1
es, ValueQuery>; #[pallet::call] impl<T: Config<I>, I: 'static> Pallet<T, I> { /// Create a order to sell a non-fungible asset #[pallet::weight(<T as Config<I>>::WeightInfo::sell())] #[transactional] pub fn sell( origin: OriginFor<T>, #[pallet::compact] class_id: T::ClassId, #[pallet::compact] token...
Rust
0
cache = &mut self.glyph_cache; // Draw grid { let _sampler = self.meter.sampler(); // Make a copy of size_info since the closure passed here // borrows terminal mutably // // TODO I wonder if the renderable cells it...
Rust
0
{ input, folder: Fold { identity_op: || None.into_iter().sum(), fold_op: |s: SUM, i: I, limit: usize| { let (todo, remaining) = i.divide_at(limit); let s2 = todo.into_iter().sum(); (s + s2, remaining) ...
Rust
0
[doc = "Checks if the value of the field is `SYSCTL_MEMTIM0_EBCHT_1`"] #[inline(always)] pub fn is_sysctl_memtim0_ebcht_1(&self) -> bool { *self == SYSCTL_MEMTIM0_EBCHTR::SYSCTL_MEMTIM0_EBCHT_1 } #[doc = "Checks if the value of the field is `SYSCTL_MEMTIM0_EBCHT_1_5`"] #[inline(always)] ...
Rust
0
progver:progver, procedure:procedure, } )) ); #[derive(Debug,PartialEq)] pub struct RpcPacket<'a> { pub hdr: RpcPacketHeader<>, pub rpcver: u32, pub program: u32, pub progver: u32, pub procedure: u32, pub creds_flavor: u32, pub creds: RpcReque...
Rust
0
nds::SAVE_FILE) { let config_path = get_config_path(); std::fs::create_dir_all(&config_path).expect("Could not create data directory"); let profile_path = config_path.join(PROFILE_FILENAME); let profile = data.get_profile(); let mut file = File::create(profi...
Rust
0
yright holder is ImageMagick Studio LLC. The ImageMagick license may be found at http://www.imagemagick.org/www/Copyright.html. IML++ and SparseLib++: The IML++ library of iterative matrix methods in C++ and the SparseLib++ library for sparse matrix computations are available from NIST at http://math.nist.gov/iml++/...
Python
1
ii=True): img = Image.open(img) if img.width != 256 or img.height != 256: img = img.resize([256, 256], Image.BICUBIC) results.append(img_to_array(img)) results = np.stack(results).reshape([40, 32, 256, 256, 3]) savemat(str(save_dir), {"results": results}) print(" [*] Saved to {}.mat".format(save...
Python
1
filter_func) => { if !filter_func.call(())? { return Ok(None); } } rlua::Nil => {} _ => bail!("Unexpected value for __filter_func"), } match ctx.global...
Rust
0
self.user) self.user_is_examiner = user_model.objects.user_is_examiner_or_can_selfassign_as_examiner(self.user) self.user_is_anyadmin = user_model.objects.user_is_admin_or_superuser(self.user) self.user_has_no_roles = True if self.user_is_student: self.__append_student_item()...
Python
1
ullFormatter()) axes[i_ax].yaxis.set_major_formatter(NullFormatter()) axes[i_ax].axis("tight") i_ax += 1 fig.tight_layout() plt.show() # %% # Sample output:: # # Benchmarking on MNIST_10000: # ---------------------------- # TSNE with internal NearestNeighbors 24.828 sec (fit_transf...
Python
1
// pub properties_map_parsing : bool, // pub properties_maps : HashMap< String, String >, // pub severalValues : bool, /* qqq : implement */ // } // impl InstructionsParseOptions // { // // field_str!{ hint } // // field_str!{ hint, h } // // field_str!{ long_hint } // // field_str!{ long_hint, lh } // ...
Rust
0
import os import cv2 from sklearn.metrics import accuracy_score from ultralytics import YOLO ALERT_CLASSES = ['knife', 'scissors'] CLASS_ID_MAP = {0: 'knife', 1: 'scissors'} # Adjust the mapping based on your class IDs def load_images_and_labels(image_dir, label_dir): images = [] labels = [] for img_file...
Python
1
anager.add_subtree_structure("node_name.nested", TreeStructure()) subtree_manager.add_subtree_state("node_name.nested", TreeState()) subtree_manager.add_subtree_data("node_name.nested", TreeData()) subtree_manager.add_subtree_structure("node_name_2", TreeStructure()) subtree_manager.add_...
Python
1
estDetailsRequest, pool: &crate::helpers::DbPool, ) -> Result<Self, super::errors::GetContestDetailsError> { let auth = crate::sessions::resolvers::Auth::resolve(auth, &pool).await?; let contest = if auth.user.is_admin() { super::models::Contest::find(contest_id) ...
Rust
0
# 珂莱塔 import copy from .buff import shouanren_buff, zhezhi_buff from .damage import echo_damage, weapon_damage, phase_damage from ...api.model import RoleDetailData from ...ascension.char import WavesCharResult, get_char_detail2 from ...damage.damage import DamageAttribute, calc_percent_expression from ...damage.utils...
Python
1
:OFF) || (*eqtb.offset( (1i32 + (0x10ffffi32 + 1i32) + (0x10ffffi32 + 1i32) + 1i32 + 15000i32 + 12i32 + 9000i32 + 1i32 + 1i32 + 19i32 + 256i...
Rust
0
impl fmt::Debug for FtpsConfig { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { FtpsConfig::Off => write!(f, "Off"), FtpsConfig::Building { .. } => write!(f, "Building"), FtpsConfig::On { .. } => write!(f, "On"), } } } #[derive(Debug, Copy...
Rust
0
SmolStr), }, } /* * Copyright 2018 <NAME> <<EMAIL>> * * 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 app...
Rust
0
, 14, 15, 22, 23, 30, 0, 0 ]; #[rustfmt::skip] static mcol_scan_8x4_neighbors : [u16; 33 * MAX_NEIGHBORS] = [ 0, 0, 0, 0, 8, 8, 16, 16, 0, 0, 1, 8, 9, 16, 17, 24, 1, 1, 2, 9, 10, 17, 18, 25, 2, 2, 3, 10, 11, 18, 19, 26, 3, 3, 4, 11, 12, 19, 20, 27, 4, 4, 5, 12, 13, 20, 21, 28, 5, 5, 6, ...
Rust
0
_df["person"].struct.field( "name" ).str.len() + nested_structs_df["person"].struct.field("age") pd.testing.assert_series_equal(result.to_pandas(), expected.to_pandas()) def test_sql_scalar_outputs_struct_series(nested_structs_df): result = bbq.sql_scalar("{0}", [nested_structs_df["person"]]) ...
Python
1
# Copyright: Ankitects Pty Ltd and contributors # License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html # Configuration file for the Sphinx documentation builder. # # For the full list of built-in configuration values, see the documentation: # https://www.sphinx-doc.org/en/master/usage/configurat...
Python
1
STIN must be exactly 15 characters long.") else: receiver_name = receiver_choice receiver_gstin = party_data[receiver_choice] st.markdown(f"**GSTIN:** `{receiver_gstin}`") with st.form("bill_form"): tab1, tab2, tab3 = st.tabs(["Company Info", "Billing Info", "Tax and Export"]) with...
Python
1
return Err(Error::IncompatibleTypesOp{op: "*", left_ty: get_ty(&a), right_ty: get_ty(&b)}), }, Expr::Div(ref a, ref b) => match (a.eval(styles, node)?, b.eval(styles, node)?) { (Value::Integer(a), Value::Integer(b)) => Value::Integer(a / b), (Value::Float(a), Valu...
Rust
0
import tkinter as tk from tkinter import messagebox def get_button(window, text, color, command, fg='white'): """ Create and return a button widget. :param window: The parent window to place the button on. :param text: The text to display on the button. :param color: The background color of the but...
Python
1
::Bump; use criterion::*; use scoped_arena::Scope; use std::alloc::{Allocator, Global}; #[derive(Default)] struct Small(u8); #[derive(Default)] struct Big([usize; 32]); const ALLOCATIONS: usize = 10_000; const VEC_COUNT: usize = 100; fn vec_alloc<T: Default, A: Allocator>(alloc: A, count: usize) { let mut vec =...
Rust
0
lar, so we'll just match the whole opcode match nes.cpu.opcode { 0x00 => opcodes::brk(nes), // Various unofficial NOPs 0x80 => (addressing::IMMEDIATE.read) (nes, opcodes::nop_read), 0x04 | 0x44 | 0x64 => (addressing::ZERO_PAGE.read) (nes, opcodes::nop_read), 0x0C => (addres...
Rust
0
nside a directory, but not the directory itself. Standard globs // will match the directory. So we add `/*` to force the issue. if glob.actual.ends_with("/**") { glob.actual = format!("{}/*", glob.actual); } let parsed = GlobBuilder::new(&glob.actual) ...
Rust
0
=0) # (N_unique, 2) array of unique coordinates pairwise_distances = scipy.spatial.distance.cdist(X_unique, X_unique) percentile_distances_without_self = np.ma.masked_equal(pairwise_distances, 0) # Compute the closest distance from each station to each other station closest_distances_...
Python
1
the libuv library. * * This module contains a set of direct, 'bare-metal' wrappers around * the libuv C-API. * * We're not bothering yet to redefine uv's structs as Rust structs * because they are quite large and change often between versions. * The maintenance burden is just too high. Instead we use the uv's *...
Rust
0
nline(always)] pub fn pro_cache_mask_iram0(&self) -> PRO_CACHE_MASK_IRAM0_R { PRO_CACHE_MASK_IRAM0_R::new((self.bits & 0x01) != 0) } #[doc = "Bit 1"] #[inline(always)] pub fn pro_cache_mask_iram1(&self) -> PRO_CACHE_MASK_IRAM1_R { PRO_CACHE_MASK_IRAM1_R::new(((self.bits >> 1) & 0x01)...
Rust
0
_module! { pub struct Module<T: Config> for enum Call where origin: T::Origin { #[weight = 10_000] pub fn create_cat(origin, age: u8) -> DispatchResult { let caller = ensure_signed(origin)?; ensure!(pallet_accounts::Module::<T>::account_is_cat_owner(&caller), Error::<T>::OhCrapErro...
Rust
0