text
string
label_name
string
labels
int64
# -*- coding: utf-8 -*- import numpy as np import pandas as pd import matplotlib.pyplot as plt import seaborn as sns from pylab import mpl mpl.rcParams['font.sans-serif'] = ['SimHei'] # 黑体 mpl.rcParams['axes.unicode_minus'] = False myfont = mpl.font_manager.FontProperties(fname='simhei.ttf') font = {'family': 'simhei...
Python
1
kk': 'поллард фонетикалық жазуы', 'km': 'ផូឡាដ', 'kn': 'ಪೊಲ್ಲಾರ್ಡ್ ಫೊನೆಟಿಕ್', 'ko': '폴라드 표음 문자', 'ks': 'پولاڑ پھونِٹِک', 'ks-Arab': 'پولاڑ پھونِٹِک', 'lb': 'Pollard Phonetesch', 'lo': 'ສັດຕະສາດພໍຮລາ', 'lt': 'polard fonetinė', 'mk': 'Полардово', 'ml': 'പൊള്ളാർഡ് ശബ്ദലിപി', 'mn': 'Пирд', 'mr': 'पोलार्ड फोनेटिक', 'ms': 'F...
Python
1
source_header_property_check( request, ffi::mrcp_recognizer_header_id::RECOGNIZER_HEADER_SENSITIVITY_LEVEL, ) } { unsafe { Some((*headers).sensitivity_level) } } else { None }; let sensitivity = header_sensitivity ...
Rust
0
ub(1)); } // Mnemonic: RRCA // Full Name: Rotate Right Circular A // Description: Sets A to, (A >> 1) | (A << 7) // Affected Flags: Z (res), N (res), H (res), C (set|res) // Remarks: Carry is set if bit 0 is set, otherwise it is reset. // Timing: Instant. pub fn rrca(cpu: &mut Cpu) { cpu.regs.f = Flag::empty(); ...
Rust
0
pub mod request; /* * Copyright (C) 2020 <NAME> */ static OVERHEAD_TIME: u128 = 50; pub struct TimeCapacity { pub main_time_millis: u128, pub extra_time_millis: u128, } pub fn calculate_time_capacity(total_time_millis: u128, moves_to_go: u128, increment: u128) -> TimeCapacity { let main_time_millis = t...
Rust
0
} } bpm if bpm.starts_with("#BPM") => { let id = command.trim_start_matches("#BPM"); let bpm = c.next_token().ok_or_else(|| c.err_expected_token("bpm"))?; Self::BpmChange(ObjId::from(id, c)?, bpm) } ...
Rust
0
gs, pub attachmentCount : u32, pub pAttachments : *const AttachmentDescription2, pub subpassCount : u32, pub pSubpasses : *const SubpassDescription2, pub dependencyCount : u32, pub pDependencies : *const SubpassDependency2, pub correlatedViewMaskCount : u32, pub pCorrelatedViewMasks : *const u32, } #[repr(C)] ...
Rust
0
l='/landpage') def delete_lecture_note(request, course_id, lecture_id): response_data = {'status' : 'failed', 'message' : 'unknown error with deleting'} if request.is_ajax(): if request.method == 'POST': upload_id = int(request.POST['upload_id']) try: upload = Fil...
Python
1
erializezs  #     #   % +  #   #   #   #   #  +%    #   # %  % + % + )/  #  ...
Python
1
pt") # Verify no failures assert not failed_samples, f"Split {split} failed: {failed_samples}" print(f"✓ {split}: {sample_count} samples validated successfully") def test_real_dataset_comprehensive(): """Test comprehensive validation showing real dataset details.""" dataset = ...
Python
1
tedError('Not implemented action type') except WebDriverException as e: logging.getLogger('nexus_pylon').debug({ 'action': 'error', 'mode': 'pylon', 'error': str(e), }) return False return True async def execute_pre...
Python
1
oogle LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software /...
Rust
0
(); let time = precise_time_ns(); let dt = (time - prev) as f32 / 1000000000.0f32; prev = time; let mut stop = false; events_loop.poll_events(|ev| { use glium::glutin::Event::WindowEvent; use glium::glutin::WindowEvent::*; match ev { ...
Rust
0
meters ($fn:ident, $typ:tt, $count: ident, $param_1: ident, $param_2: ident) => {{ let arr_len = $count as usize; let mut all_objects: $typ = std::vec::from_elem(ptr::null_mut(), arr_len); let status_code = unsafe { $fn( $param_1, $param_2, ...
Rust
0
g attributes are: 'data', the data to learn and 'target', the labels for each sample. """ base_dir = join(dirname(__file__), 'data') data = np.loadtxt(join(base_dir, 'diabetes_data.csv.gz')) target = np.loadtxt(join(base_dir, 'diabetes_target.csv.gz')) return Bunch(data=data, targe...
Python
1
"""Functions related to the Wiener index of a graph.""" from itertools import chain import networkx as nx from .components import is_connected, is_strongly_connected from .shortest_paths import shortest_path_length as spl __all__ = ["wiener_index"] #: Rename the :func:`chain.from_iterable` function for the sake of...
Python
1
nput datetime Returns ------- datetime.timedelta """ seconds = b.replace(microsecond=0) - a.replace(microsecond=0) seconds = int(round(seconds.total_seconds())) microseconds = b.microsecond - a.microsecond return datetime.timedelta(seconds=seconds, microseconds=microseconds) def _conv...
Python
1
ASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // //////////////////////////////////////////////////////////////////////////////// //! Provides subtle implementations of the `tink...
Rust
0
* * 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 writing, software * distrib...
Rust
0
use serde_json::{Map, Value}; #[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] pub struct Difficulty { #[serde(rename = "_version")] pub version: String, #[serde(rename = "_events")] pub events: Vec<Event>, #[serde(rename = "_notes")] pub notes: Vec<Note>, #[serde(rename = "_obs...
Rust
0
pub fn move_index(&mut self, delta: i32) { self.display_index = min( self.entries.len() as i32 - 1, max( 0, self.display_index + delta)); } } impl LogEntry { pub fn get_formatted_message(&self) -> String { if self.count == 1 { ...
Rust
0
PeerInfo::random(), disable_seed: false, protocols: vec![], } } } impl NetworkConfiguration { /// Create a new instance of default settings. pub fn new() -> Self { Self::default() } /// Create new default configuration for localhost-only connection with ran...
Rust
0
.offset(&l3).unwrap(), -10); assert_eq!(l3.offset(&l1).unwrap(), 20); assert_eq!(l1.offset(&l3).unwrap(), -20); let l4 = Label::from_label_offset(&l3, 10); assert_eq!(l4.offset(&l1).unwrap(), 30); // Check that chains of label offsets work properly. let l5 = Label::from_label_offset(&l1, 10); ...
Rust
0
t quite. PMF is a term specifically used for discrete probability distributions.") q3 = st.radio( "3. In a probability distribution, what does the term 'mean' represent?", ["The most common value in the data", "The middle value of the data", "The average value of the data", ...
Python
1
#new_fn } } pub fn write(&self, addr:InsnT, value:RegT)->Option<()> { match addr { #write_matchs _ => None } } pub fn read(&self, addr:...
Rust
0
# -*- coding: utf-8 -*- # Author: Yifan Lu <yifan_lu@sjtu.edu.cn> # License: TDG-Attribution-NonCommercial-NoDistrib import argparse import os import statistics import torch from torch.utils.data import DataLoader, Subset from tensorboardX import SummaryWriter import opencood.hypes_yaml.yaml_utils as yaml_utils from...
Python
1
_KEY_SERVER_LISTEN))?, )) } else { Ok(None) } } fn repository_query(repo_name: &str) -> String { let repo_name = percent_encode(repo_name.as_bytes(), ESCAPE_SET); format!("{}.{}", CONFIG_KEY_REPOSITORIES, repo_name) } fn registration_query(repo_name: &str, target_identifier: &str) -> S...
Rust
0
_t, pub flavor: vm_region_flavor_t, pub infoCnt: mach_msg_type_number_t, } impl ::std::clone::Clone for Struct_Unnamed327 { fn clone(&self) -> Self { *self } } impl ::std::default::Default for Struct_Unnamed327 { fn default() -> Self { unsafe { ::std::mem::zeroed() } } } pub type __Request__vm_region_64...
Rust
0
''' Automatic generation evaluation metrics wrapper The most useful function here is get_all_metrics(refs, cands) ''' from pycocoevalcap.tokenizer.ptbtokenizer import PTBTokenizer from pycocoevalcap.spice.spice import Spice from pycocoevalcap.meteor.meteor import Meteor from pycocoevalcap.bleu.bleu import Bleu from p...
Python
1
font_family='Roboto Condensed Medium' ), name_input, ft.Row( [hello_button, clear_button, info_button], alignment=ft.MainAxisAlignment.CENTER, spacing=10 ), ft.Divider(height...
Python
1
default_initial_settings = { "name": "HCTECH_HC300-M3", "manufacturer": "HCTECH", "start_gcode": "G28 X Y ;Home XY\nG92 E0 ;Reset Extruder\nG1 E-1 F2400 ;Retract\nG92 E0 ;Reset Extruder\nG28 Z ;home Z\nG29 ; Measure the bed\nM500 ; Store to EEPROM\nG1 Z2.0 F3000 ; Move Z Axis up little to prevent scratching...
Python
1
](super) that allows deriving one resolved value /// from the other. /// /// Functions must be provided to derive in both directions. Whichever value is /// resolved first will be used to derive the other. /// /// ``` /// use canrun::{Goal, all, unify, var, map_1}; /// use canrun::example::I32; /// /// let (x, y) = (va...
Rust
0
by the data size defines the number /// of bits by which the first source register is right-shifted. /// /// This instruction is used by the alias ASR (register). fn asrv_32(&mut self, rd: RegA64, rn: RegA64, rm: RegA64) -> Result<(), Self::Error>; /// See [`ArmV8aA64User::asrv_32`] f...
Rust
0
} else if text.starts_with("&&") { (Tok::AmpAmp, 2) } else { (Tok::Amp, 1) } } '|' => { if text.starts_with("||") { (Tok::PipePipe, 2) } else { (Tok::Pipe, 1) } } ...
Rust
0
ngResult<usize> { let mut crs = input.char_indices(); match crs.next() { Some((_, '#')) => {} None => return Err("Expected register name, found EOF"), Some(_) => return Err("Expected `#`"), } let tail = crs.as_str(); let idx = crs .find(|(_, chr)| !chr.is_numeric())...
Rust
0
MA_OUT_EOF_CH1_INT_ENA_R = crate::R<bool, bool>; #[doc = "Write proxy for field `DMA_OUT_EOF_CH1_INT_ENA`"] pub struct DMA_OUT_EOF_CH1_INT_ENA_W<'a> { w: &'a mut W, } impl<'a> DMA_OUT_EOF_CH1_INT_ENA_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { sel...
Rust
0
q!(s.check_applying_snap(), CheckApplyingSnapStatus::Success); assert_eq!(*s.snap_state.borrow(), SnapState::Relax); // Relax is not applying snapshot. assert_eq!(s.check_applying_snap(), CheckApplyingSnapStatus::Idle); assert_eq!(*s.snap_state.borrow(), SnapState::Relax); s.sna...
Rust
0
f): tree = ( AndOperation( Range(Word("*"), Word("2"), True, True), Range(Word("*"), Word("*"), True, True), Range(Word("*"), Word("3"), True, True), Range(Word("1"), Word("*"), True, True), Range(Word("4"), Word("*"), T...
Python
1
String::from("Success")), Err(String::from("Fail"))); let (ret1, ret2) = generic_test::<Result<String, String>>( "store_result", "test_Result", value1.clone(), value2, ); assert_eq!(value1, ret1); assert!(ret2.is_err()); } #[test] ...
Rust
0
"""The reflex (rx) app configuration.""" import reflex as rx config = rx.Config( # pylint: disable=not-callable app_name="app", # https://reflex.dev/docs/hosting/self-hosting/ # api_url="http://localhost:8000", plugins=[ rx.plugins.SitemapPlugin(), rx.plugins.TailwindV4Plugin(), ]...
Python
1
from django.urls import path from . import views urlpatterns = [ # Pages principales path('', views.HomeView.as_view(), name='home'), path('dashboard/', views.dashboard_view, name='dashboard'), path('comparison/', views.price_comparison_view, name='price_comparison'), # Gestion des destinations ...
Python
1
create_ssh_tunnel(server) def show_add_server_dialog(self): dialog = AddServerDialog(self) if dialog.exec_(): self.fetch_servers() if __name__ == '__main__': app = QApplication(sys.argv) window = SshMonitorApp() # Set up dark theme palette = QPalette() palette....
Python
1
})); } let mut bits: [u8; 96] = [0u8; 96]; bits.copy_from_slice(&bytes[..96]); Ok(SignatureVRF(bits)) } } mod bindings; use anyhow::Error; use bindings::{rtmsg, Operation}; /// Add default route /// /// This operation may fail for several reasons, such as /// unreachea...
Rust
0
import pytest def test_input_generators(si_structure, basis_and_potential): from atomate2.cp2k.sets.core import ( CellOptSetGenerator, HybridCellOptSetGenerator, HybridRelaxSetGenerator, HybridStaticSetGenerator, MDSetGenerator, NonSCFSetGenerator, RelaxSetG...
Python
1
#!/usr/bin/env python # -*- coding:utf-8 -*-  """ Date: 2023/11/20 10:06 """
Python
1
mid": 24145047}, {"mid": 26129556, "uname": "石榴次猫", "roomid": 458033}, {"mid": 431573732, "uname": "翻车鱼2022号", "roomid": 21430508}, {"mid": 2110481733, "uname": "砂糖Satou_", "roomid": 23087199}, {"mid": 58789280, "uname": "砂糖元_Channel", "roomid": 22769467}, {"mid": 20699734, "uname": "砂糖猪猪睡不醒", "roomid": 21906437}, {"mi...
Python
1
bound = f(self.south_ix(self.ix(i, j)), " ", "---"); top.push_str(body); top.push_str(&east_bound); bottom.push_str(&south_bound); bottom.push_str("+"); } writeln!(f, "{}", top)?; writeln!(f, "{}", bottom)?; }...
Rust
0
e='cascade') scheduled_date = fields.Datetime('Scheduled Time', compute='_compute_scheduled_date', store=True) mail_sent = fields.Boolean('Mail Sent') def execute(self): now = fields.Datetime.now() todo = self.filtered(lambda reg_mail: not reg_mail.mail_sent and \ re...
Python
1
erate(best_sources[:2]): # Ensure we only process 2 sources logger.info(f"🏆 Selected source {i+1}: {source.get('title', 'N/A')}") logger.info(f"🔗 URL: {source.get('link', 'N/A')}") # Scrape content from each source ...
Python
1
import torch from torch import nn from src.model.base_model import ( BaseAudioModel, BaseModel, BaseSeparatorModel, BaseVisualModel, ) class SeparatorWrapper(BaseSeparatorModel): def __init__( self, separator: BaseSeparatorModel, visual_model: BaseVisualModel, pre_...
Python
1
] zj = z[i] # Cylindrical conversion rj = math.sqrt(xj**2 + yj**2) if (rj != 0.): invr = 1./rj cos = xj*invr # Cosine sin = yj*invr # Sine else: cos = 1. sin = 0. # Calculate azimuthal complex factor e...
Python
1
mesalock_sgx", no_std)] #[cfg(feature = "mesalock_sgx")] extern crate sgx_tstd as std; /// maiyfail use duck typing. /// /// Syntax: /// `(instr)*; ret expr` /// /// instr can be: /// /// * `pattern =<< expression`: unbox the value as `pattern` from `expression`. /// `expression` can be converted to a monadic value of...
Rust
0
V[56], stg3[8], -COSPI_INV[8], stg3[9], INV_COS_BIT), half_btf(COSPI_INV[40], stg3[10], COSPI_INV[24], stg3[11], INV_COS_BIT), half_btf(COSPI_INV[24], stg3[10], -COSPI_INV[40], stg3[11], INV_COS_BIT), half_btf(-COSPI_INV[56], stg3[12], COSPI_INV[8], stg3[13], INV_COS_BIT), half_btf(COSPI_INV[8], stg3[12...
Rust
0
&Element, next_sibling: NodeRef, ancestor: Option<VNode>, ) -> NodeRef { let (already_suspended, children_ancestor, fallback_ancestor) = match ancestor { Some(VNode::VSuspense(mut m)) => { // We only preserve the child state if they are the same suspense. ...
Rust
0
[cfg(test)] mod tests { use super::*; use std::env; #[test] fn filename_completion() { let current_dir = env::current_dir().expect("Unable to get current directory"); let completer = IonFileCompleter::new( current_dir.to_str(), &DirectoryStack::new(), ...
Rust
0
#!/usr/bin/env python3 """ 캐글 우승자 기법 기반 고급 특징 엔지니어링 Two Sigma, Jane Street, Optiver 등 대회 우승 솔루션 적용 """ import sys sys.path.append('/root/workspace') import numpy as np import pandas as pd import logging from typing import Dict, List, Tuple, Optional from sklearn.base import BaseEstimator, TransformerMixin from sklear...
Python
1
0.520575, 0.055645, 6.0e-05], ) class TestBartlett(unittest.TestCase): def test_basic(self): np.testing.assert_allclose(_windows._bartlett(6), [0, 0.4, 0.8, 0.8, 0.4, 0]) np.testing.assert_allclose(_windows._bartlett(7), [0, 1 / 3, 2 / 3, 1.0, 2 / 3, 1 / 3, 0]) class TestHann(unittest.Te...
Python
1
led, the address will be 0x00 /// but when specifying the 10th led, the address will be 0x01 (the next chip address) continuous_addressing: bool, /// Chip select address (ignored when continuous addressing is set to true) active_address: Address, /// The Display Mode of the LP50XX, which modifies th...
Rust
0
# Copyright (c) 2017, All Contributors (see CONTRIBUTORS file) # Authors: Cristina Muntean <cristina.muntean@isti.cnr.it> # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0...
Python
1
from __future__ import print_function import cv2 from pylab import * from sklearn.cluster import KMeans import numpy as np from PIL import Image from skimage.morphology import disk, opening def grayscale(im): return cv2.cvtColor(im, cv2.COLOR_BGR2GRAY) def white_image(im): return cv2.bitwise_not(np.zeros(im...
Python
1
/// parts of a func curve. Mech(bool), /// Determines the number of separate parts in a func plot. /// Works with [`Plot::plotopt`] only. NumPoints(usize), /// If true, bevy_plot computes the `function` field of [`BezierData`] at every frame. /// Needs to be used in conjunction with a fun...
Rust
0
wh.x == 0.0 && wh.y == 0.0 && wh.z == 0.0 { return Spectrum::new(0.0); } wh = wh.normalize(); let cos_thetad = wi.dot(&wh); let fo = schlick_weight(abs_cos_theta(&wo)); let fi = schlick_weight(abs_cos_theta(&wi)); let Rr = 2.0 * self.roughness * cos_thetad * cos_thetad; ...
Rust
0
# This file is where you keep secret settings, passwords, and tokens! # If you put them in the code you risk committing that info or sharing it secrets = { 'ssid' : 'ATTh6Fxecl', 'password' : '?pesjsvr2tnv', 'timezone' : "America/Los_Angeles", # http://worldtimeapi.org/timezones 'github_token' : 'fawfj...
Python
1
# (c) 2014, Chris Church <chris@ninemoreminutes.com> # # This file is part of Ansible. # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any lat...
Python
1
rue if GPIOARST != 0"] #[inline] pub fn test_gpioarst(&self) -> bool { self.gpioarst() != 0 } #[doc="Sets the GPIOARST field."] #[inline] pub fn set_gpioarst<V: Into<::bobbin_bits::U1>>(mut self, value: V) -> Self { let value: ::bobbin_bits::U1 = value.into(); let value: u32 = v...
Rust
0
<_>>()?) } else { let tags = self.generate()?; Ok(std::iter::repeat(tags).take(num_lines).collect()) } } /// Returns the current value and potentially increments the counter for /// next time. fn increment(&mut self) -> usize { let counter = self.counter;...
Rust
0
stdscr, "end") # End scene if variables.check_setting(): # Ending 4 variables.fixed_setting("4") variables.currentNarrative = "text.ending.4.0" display_scene(stdscr, "bedroom") display_paused_narrative(stdscr, "4") variables.currentNarrative = "text.ending.4.1" di...
Python
1
::c_ushort = 8576; pub const DAQmx_AI_Excit_ActualVal: ::std::os::raw::c_ushort = 6275; pub const DAQmx_AI_Excit_DCorAC: ::std::os::raw::c_ushort = 6139; pub const DAQmx_AI_Excit_VoltageOrCurrent: ::std::os::raw::c_ushort = 6134; pub const DAQmx_AI_Excit_IdleOutputBehavior: ::std::os::raw::c_ushort = 12472; pub const D...
Rust
0
.build(); m.content(request_msg); m }) .await; } Err(_) => (), } } Ok(()) } <gh_stars>1-10 // Copyright 2019 <NAME> and/or applicable contributors. // // Licensed under the Apache License, V...
Rust
0
condition(pods.clone(), "blog", is_pod_running()); let _ = tokio::time::timeout(std::time::Duration::from_secs(15), establish).await?; // Verify we can get it info!("Get Pod blog"); let p1cpy = pods.get("blog").await?; if let Some(spec) = &p1cpy.spec { info!("Got blog pod with containers: {...
Rust
0
parse_u32(debug_offset)? } else { 0xf00f0000 }; if memory_address.is_none() && server_kind == ServerKind::None { Err(ConfigError::NoOperationSpecified) } else { Ok(Config { usb_pid, usb_vid, ...
Rust
0
from langchain_groq import ChatGroq from langchain_core.prompts import ChatPromptTemplate from src.config.config import GROQ_API_KEY # Initialize the LLM using Groq's LLaMA model with API key llm = ChatGroq( groq_api_key=GROQ_API_KEY, model_name="llama-3.3-70b-versatile", # Using Groq's high-performance LLaMA...
Python
1
_addr) .unwrap() .ssa_mut() .replace_value(use_node, call_reg_map[regid]); } } Some(()) } fn analyze_fn(&self, rfn: &RadecoFunction, reginfo: &SubRegisterFile) -> Option<RegisterUsage> { radeco_trace!("analyzing fn...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2025 Google LLC # # 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...
Python
1
[doc = "*Required features: 'Win32_Storage_Packaging_Appx'*"] pub type APPX_FOOTPRINT_FILE_TYPE = i32; #[doc = "*Required features: 'Win32_Storage_Packaging_Appx'*"] pub const APPX_FOOTPRINT_FILE_TYPE_MANIFEST: APPX_FOOTPRINT_FILE_TYPE = 0i32; #[doc = "*Required features: 'Win32_Storage_Packaging_Appx'*"] pub const APP...
Rust
0
""" Queries the Kuebernetes namespaces created by rules_k8s E2E tests and attempts to delete them. Deletion is best effort, i.e., any errors returned by any kubectl calls are ignored. """ import subprocess import logging import json from datetime import datetime # Logger instance _log = None def list_namespaces(): ...
Python
1
her the primary or mask stencil :type mask: typing.Union[bool, typing.Any] ''' pass def stencil_reset_transform(override_context: typing. Union[typing.Dict, 'bpy.types.Context'] = None, execution_context: typing.Union[str, int] = None, ...
Python
1
derive(Debug, Clone)] pub struct LineCursor { start: Point, width: u32, position: u32, tab_width: u32, } impl LineCursor { /// Creates a new object whose position isn't important. pub fn new(width: u32, tab_width: u32) -> Self { Self { start: Point::zero(), width...
Rust
0
import unittest from commands import discover_commands class TestCommandDiscovery(unittest.TestCase): def test_discover_class_based_command_groups(self): # When commands, _, _, command_groups = discover_commands() # Then self.assertIn("guild", command_groups) self.assertIn(...
Python
1
v(pos_ms1_out_file, index=None) pos_df_features_all.to_csv(pos_features_all_out_file, index=None) print("Output Done!") print("Done!") # neg mode print("Process neg mode data") neg_ms1_file = "example/data/Hela/neg-Hela_quant_full.csv" neg_ms1_file_type = "mzmine" ne...
Python
1
, start: u64, end: u64, shift_to_zero: bool) -> Self { let (mut lo, mut hi) = (self.domain.low(), self.domain.high()); assert!(axis < MAX_DIMS); assert!( lo[axis] <= start && start <= end && end <= hi[axis], "slice range {}..{} not within array domain {}..{}", ...
Rust
0
els.generate_content( model=google_model, contents=[prompt], config=google_types.GenerateContentConfig(system_instruction=system_instruction) ) except Exception: # Fallback: just prepend system instruction to prompt response = c...
Python
1
fiers_2ri5)zCdeclaration_specifiers -> declaration_specifiers function_specifierrr p_declaration_specifiers_3ri:)zIdeclaration_specifiers -> declaration_specifiers type_specifier_no_typeidrr p_declaration_specifiers_4ri?)z(declaration_specifiers -> type_specifierrrp_declaratio...
Python
1
Path(elem) => elem, Motion(elem) => elem, Group(elem) => elem, Transformation(transform) => transform, Error => &*ERROR_ELEMENT } } } use std::sync::{atomic::Ato...
Rust
0
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT import time import board from adafruit_ina260 import INA260, Mode i2c = board.I2C() ina260 = INA260(i2c) # trigger a sample ina260.mode = Mode.TRIGGERED print("Current (one shot #1): %.2f" % (ina260.current)) print("Voltage...
Python
1
return groups[0][0]; } else { warn!("规则4: 剩下更多的可能无法判断,返回第一项!"); return groups[0][0]; } } pub fn simple_cut(chars: &[char], output: &mut Vec<String>) { assert_eq!(chars.len() > 0, true); let mut start: usize = 0; loop { if start >= chars.len() { break; ...
Rust
0
import os from config.config import SessionID, SettingsManager, Singleton @Singleton class PromptManager: def __init__(self): self.__settings_manager__ = SettingsManager(session_id=SessionID.NONE) self.__prompts_dir__ = os.path.join( self.__settings_manager__.root_dir, "pr...
Python
1
import numpy as np import matplotlib.pyplot as plt from mpl_toolkits.mplot3d import Axes3D # noqa: F401 def plot_mass_histograms(mass_snapshots_initial, bins=100, interval=1, path="frames/mass_hist.png"): # Step 1: 全部扫描,统一 bin 范围 all_masses_initial = np.concatenate([m[m < 1] for m in mass_snapshots_initi...
Python
1
: """ Check if request cookies match some database cookies """ for cookie in cookies: # cookies in db are regexes so we must test them all cookie = cookie.replace("*","") # FIX for "Fe26.2**" hapi.js cookie in the database for biscuit in self.data['coo...
Python
1
0x01, 0x02, 0x03, 0x04, 0x05, vec![0x06, 0x07], 0x08, 0x09, 0x0A, 0x3846A, vec![ 0x06, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x77, 0x86, 0x62, 0x95, 0x64, 0x0A, 0x2D, 0x34, 0x2B, 0x0A ] ); set_pokemon_stats_test!( set_pokemon_stats_7, ...
Rust
0
# ======================================================================= # # Copyright (C) 2020 - 2025 Dominik Willner <th33xitus@gmail.com> # # # # This file is part of KIAUH - Klipper Installation And Update Helper # # https://githu...
Python
1
uator.add_single_detected_image_info( decoded_dict[standard_fields.DetectionResultFields.key], decoded_dict) else: skipped_images += 1 tf.logging.info('Skipped images: {0}'.format(skipped_images)) return object_detection_evaluator.evaluate() raise ValueErr...
Python
1
me) return loaded_params class Qwen2ForCausalLM(nn.Module, SupportsLoRA, SupportsPP, SupportsEagle3): packed_modules_mapping = { "qkv_proj": [ "q_proj", "k_proj", "v_proj", ], "gate_up_proj": [ "gate_proj", "up_proj", ...
Python
1
nt8 + col_int32, col_int8 + col_int64 from table_sig""" bc.sql(query_col_op_1) query_col_op_2 = """select col_int16 + col_int32, col_int16 + col_int64 from table_sig""" bc.sql(query_col_op_2) query_col...
Python
1
def user_input_data_processor(): firstName = input("pls enter your first name, input must be at least 2 chracters long: ") lastName = input("pls enter your last name, input must be at least 2 characters long: ") if len(firstName) < 2: print("error fisrt name must be at least 2 characters long") ...
Python
1
dTemplate { fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result { f.debug_struct(&format!("GstPadTemplate @ {:p}", self)) .field("object", &self.object) .field("name_template", &self.name_template) .field("direction", &self.direction) .field("pr...
Rust
0
): optional_list_method_params = [ "display_name", "lifecycle_state", "sort_order", "sort_by", ] optional_kwargs = dict( (param, self.module.params[param]) for param in optional_list_method_params if self.module....
Python
1
from pathlib import Path import matplotlib.pyplot as plt if __name__ == "__main__": data = [] with open("results.csv") as f: header = next(f).strip().split(",") for line in f: fields = line.strip().split(",") conf_name = str(Path(fields[0]).with_suffix("")) ...
Python
1
_LOOP, EMFILE = wasi::__WASI_ERRNO_MFILE, EMLINK = wasi::__WASI_ERRNO_MLINK, EMSGSIZE = wasi::__WASI_ERRNO_MSGSIZE, EMULTIHOP = wasi::__WASI_ERRNO_MULTIHOP, ENAMETOOLONG = wasi::__WASI_ERRNO_NAMETOOLONG, ENETDOWN = wasi::__WASI_ERRNO_NETDOWN, ENETRESET = wasi::__WASI_ERRNO_NETRESET, ENET...
Rust
0
et"]) .reshape(2, -1) .tolist() ) gender_analogy_templates = list( multiclass_debias_wordsets["gender_analogy_templates"].values() ) query = Query( [gender_eval[0], gender_eval[1]], [gender_analogy_templates[0], gender_analogy_templates[1]], target_sets_na...
Python
1