text
string
label_name
string
labels
int64
s from intermediate epoches.") parser.add_argument('-start', '--start_epoch', type=int, default=1, help="!Not supported currently. For training from a break-point.") args = parser.parse_args() device = torch.device("cuda" if torch.cuda.is_available() else "cpu") args.cfg = './configs/' + args.cfg s...
Python
1
= samples.index_axis_move(Axis(1), 0); // convert real to complex let samples_c = samples.mapv(|v| Complex { re: v, im: 0.0 }); // fft parameters let fft_len = 512; let segment_len = 256; let overlap = 192; // build window for fft let window = W::periodic(W::sqrt(W::hann(segm...
Rust
0
ell<OpenAiApi> = OnceCell::new(); interaction_setup! { name = "chatbot", description = "Chat with Pekora!", enabled_if = |config| config.ai_chatbot.enabled, options = [ //! Ask Usada Pekora anything! ask: SubCommand = [ //! Your question. prompt: String, ...
Rust
0
one, }).collect()) } // ============================================================================= type LabelInfoMap = HashMap<Sp<Ident>, RawLabelInfo>; struct RawLabelInfo { time: i32, offset: u64, } /// A quick pass near the end of a subroutine's compilation that collects the offsets of all labels. ...
Rust
0
it__(self): if not utils.get_symbol_value("CONFIG_SCHED_WORKQUEUE"): return super().__init__("worker", gdb.COMMAND_USER) def invoke(self, arg, from_tty): queues = get_work_queues() for queue in queues: print(f"{queue}") if not queue.is_running: ...
Python
1
#!/usr/bin/env python3 import os import shutil import sys _resources = {} _aliases = {} _ignore = ( 'org.gnome.Builder.svg', 'org.gnome.Builder.Devel.svg', 'org.gnome.Builder-symbolic.svg', 'org.gnome.Builder.Devel-symbolic.svg', ) def addResource(directory, name): if directory not in _resources: ...
Python
1
on that guarantee as it would be considered corrupt // if the data changed types underneath. if row < #root::Table::row_cnt(&self.0) { ::core::option::Option::Some( (#( self.#cell_fns(row).expect(#bug_msg) ...
Rust
0
# blog/forms.py from django import forms from .models import Post, Comentario class PostForm(forms.ModelForm): class Meta: model = Post fields = ['titulo', 'conteudo'] class ComentarioForm(forms.ModelForm): class Meta: model = Comentario fields = ['autor', 'texto']
Python
1
from pathlib import Path import subprocess import os import sys import wasabi TEST_DATA = Path(__file__).absolute().parent / "test-data" WASABI_DIR = Path(wasabi.__file__).absolute().parent.parent def test_jupyter(): # This runs some code in a jupyter notebook environment, but without actually # starting up...
Python
1
u32) as i32 * y + x) as isize; let cur = self.linear_buf.offset(offset); let old_color = color::RGBA8::from(*cur); let new_color = color.blend_with(old_color); *cur = new_color.encode(); } } fn clamp(max: i32, value: i32) -> i32 { if value < 0 { ...
Rust
0
"SECTION", " 2", "ENTITIES", " 0", "TEXT", " 7", "some-text-style", " 0", "ENDSEC", " 0", "EOF", ] .join("\r\n") ...
Rust
0
'OpGroupSMaxNonUniformAMD' : 5007, 'OpFragmentMaskFetchAMD' : 5011, 'OpFragmentFetchAMD' : 5012, 'OpSubgroupShuffleINTEL' : 5571, 'OpSubgroupShuffleDownINTEL' : 5572, 'OpSubgroupShuffleUpINTEL' : 5573, 'OpSubgroupShuffleXorINTEL' : 5574, 'OpSubgroupBlockR...
Python
1
t {weather_description} avec une température de {temp_value:.1f}{temp_unit}." else: # Default to English report = f"The current weather in {city_name} is {weather_description} with a temperature of {temp_value:.1f}{temp_unit}." result = {"status": "success", "report...
Python
1
n.into_txout().into_txout(); unvaults_cache.insert( unvault_outpoint, UtxoInfo { txo, is_confirmed: true, }, ); log::debug!( "Transaction spending Unvault '{}' was evicted from mempool. Downgrading vault at \ '{}' from '{}' to 'Unvaulted'", ...
Rust
0
an error while executing the Lua code (eg. a function call /// returns an error), or if the requested return type doesn't match the actual return type. /// /// > **Note**: In order to pass parameters, see `call_with_args` instead. #[inline] pub fn call<V>(&'lua self) -> Result<V, LuaError> where...
Rust
0
0x09, 0x39, // Usage (Hat switch) 0x15, 0x00, // Logical Minimum (0) 0x25, 0x07, // Logical Maximum (7) 0x35, 0x00, // Physical Minimum (0) 0x46, 0x3B, 0x01, // Physical Maximum (315) 0x65, 0x14, // Unit (System: English Rotation, Lengt...
Rust
0
f64| -100.0 * (-x.powi(100)).exp() * x.powi(99); let f = RealFnAndFirst::new(&in_f, &in_df); let conv = DeltaX::new(1e-9); let _ = newton_raphson(&f, 0.99999, &conv, 100).expect_err("no convergence"); } } /* * Copyright (c) 2018 by the author(s) * * ====================================...
Rust
0
#!/usr/bin/env python # -*- coding:utf-8 -*- # __author__ = 'liao gao xiang' from xml.etree.ElementTree import iterparse # 增量式解析大型xml文件,通过迭代器和生成器使用尽可能少的内存 def parse_and_remove(filename, path): path_part = path.split('/') doc = iterparse(filename, ('start', 'end')) next(doc) tag_stack, elem_stack = ...
Python
1
(query_string) => form_urlencoded::parse(query_string.as_bytes()) .into_owned() .fold(HashMap::new(), |mut hm, (k, v)| { hm.entry(k).or_insert(vec![]).push(v); hm }), None => HashMap::new(), }; let fluff = params.get("fluff").is_some(); Box::new(parse_body(req).and_then( move |slate: S...
Rust
0
from turtle import * screensize(1000, 1000) lt(90) m = 10 tracer(0) for i in range(9): fd(22*m) rt(90) fd(6*m) rt(90) up() fd(m) rt(90) fd(5*m) lt(90) down() for i in range(9): fd(53*m) rt(90) fd(75*m) rt(90) up() for x in range(-30, 30): for y in range(-30, 30): goto(x*m, ...
Python
1
import re import struct import ida_struct import idc import ida_bytes, ida_name, ida_offset LOAD_X27_PATTERN = "\[X27,#0x(\S*)\]" RE_LOAD_X27_PATTERN = re.compile(LOAD_X27_PATTERN) # ADD <reg_tmp>, X27, #0x<index_high>,LSL#<index_high_shift> ADD_X27_PATTERN = "ADD (\S*), X27, #0x(\S*),LSL#(...
Python
1
let version_config: &'static str = config.config_parser_version(); // getting text about version of config parser /// ``` /// pub struct config_parser { config_parser: ini::Ini, } /// It is a UART/Sbus/Ibus configuration struct pub struct IbusConfig { /// baudrate (u32 value) pub baudrate: u32, /// Por...
Rust
0
import math import paddle import paddle.nn.functional as F from paddle import Tensor from paddle.nn import Embedding from paddle_geometric.nn.kge import KGEModel class RotatE(KGEModel): r"""The RotatE model from the `"RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space" <https://arxiv....
Python
1
import asyncio import importlib from pyrogram import idle from pytgcalls.exceptions import NoActiveGroupCall import config from VIP_INNOCENT import LOGGER, app, userbot from VIP_INNOCENT.core.call import INNOCENT from VIP_INNOCENT.misc import sudo from VIP_INNOCENT.plugins import ALL_MODULES from VIP_INNOCENT.utils....
Python
1
from unittest import TestCase from container_transform.transformer import BaseTransformer from container_transform.schema import ARG_MAP class BaseTransformerTests(TestCase): """ Tests for the BaseTransformer class """ def test_base_transformer_has_all_methods(self): """ Test to conf...
Python
1
expected); } NodeEvent::OnConnectionInfo { info: _ } => { assert_eq!(zx::Status::OK, expected); } } } async fn assert_read<'a>( file_proxy: &'a FileProxy, length: u64, expected: &'a [u8], ) -> Result<(), Error> { let (status, read_data) = file_proxy.read(length)...
Rust
0
""" Hotjar template tags and filters. """ import re from django.template import Library, Node, TemplateSyntaxError from analytical.utils import disable_html, get_required_setting, is_internal_ip HOTJAR_TRACKING_CODE = """\ <script> (function(h,o,t,j,a,r){ h.hj=h.hj||function(){(h.hj.q=h.hj.q||[]).push(arguments...
Python
1
} } let always_hello = escape_grapheme("a", AlwaysHello); assert_eq!(always_hello, "hello"); struct Simple; impl CharEncoder for Simple { fn encode(iter: &mut dyn Iterator<Item = char>) -> Option<String> { iter.next().map(|i| format!("{}", i a...
Rust
0
Words per minute (WPM) """) st.sidebar.markdown("---") st.sidebar.markdown("### 📘 About") st.sidebar.info(""" This app is built by **Muhammad Jarreer** using AI-based evaluation to give real-time English speaking feedback. 🔗 [Portfolio](https://jarreer.github.io/portfolio/) 📨 [Con...
Python
1
None else: print(f"\n{Fore.RED}Please add your {C}SecurityTrails{Fore.RED} API Key in config.ini file{Fore.RESET}") None def get_domain_historical_ip_address(domain): try: url = f"https://viewdns.info/iphistory/?domain={domain}" headers = { "User-Agent": "Mozilla/5.0...
Python
1
ta()) { eprintln!("{} - {}", record.level(), record.args()); } } fn flush(&self) {} } fn init_logger() -> Result<(), SetLoggerError> { log::set_logger(&LOGGER)?; log::set_max_level(LevelFilter::Debug); Ok(()) } <gh_stars>0 // As opposed to this function, which will never return...
Rust
0
ions: Dimension, pub local_declarations: LocalDeclarations, } #[derive(PartialEq, Debug, Clone)] pub enum RootDefinition { GlobalVariable(GlobalVariable), Struct(StructDefinition), Function(FunctionDefinition), Kernel(Kernel), } pub use slp_shared::opencl::Extension; #[derive(PartialEq, Debug, Cl...
Rust
0
size_hint: g.event_counter, iterators, serialization: g.serialization, }) } } impl std::iter::Iterator for GraphUpdateIterator { type Item = Result<(u64, UpdateEvent)>; fn next(&mut self) -> Option<Self::Item> { // Remove all empty table iterators. ...
Rust
0
rr4r-r&_warnrrr__del__$ z_UnixReadPipeTransport.__del__Fatal error on pipe transportcCsZt|tr|jtjkr|jrtjd||ddn |j||||j d| |dSNz%r: %sTexc_info)message exceptionrrd) r]rHrNZEIOrrr ...
Python
1
_MAX: u32 = 1; pub const FF_RUMBLE: u32 = 80; pub const FF_PERIODIC: u32 = 81; pub const FF_CONSTANT: u32 = 82; pub const FF_SPRING: u32 = 83; pub const FF_FRICTION: u32 = 84; pub const FF_DAMPER: u32 = 85; pub const FF_INERTIA: u32 = 86; pub const FF_RAMP: u32 = 87; pub const FF_EFFECT_MIN: u32 = 80; pub const FF_EFFE...
Rust
0
NC", vec![(0xE6, ZP, 5), (0xF6, ZPX, 6), (0xEE, ABS, 6), (0xFE, ABX, 7)]); add("INX", vec![(0xE8, IMP, 2)]); add("INY", vec![(0xC8, IMP, 2)]); add("JMP", vec![(0x4C, ABS, 3), (0x6C, IND, 5)]); add("JSR", vec![(0x20, ABS, 6)]); add("LDA", vec![(0xA9, IMM, 2), (0xA5, ZP, 3), (0xB5,...
Rust
0
ibike2", 50, TriBike3, "tribike3", 50, TrophyTruck, "trophytruck", 50, TrophyTruck2, "trophytruck2", 50, Tropic, "tropic", 50, Tropic2, "tropic2", 50, Tropos, "tropos", 50, Tug, "tug", 50, Tula, "tula", 50, Tulip, "tulip", 50, Turismo2, "turismo2", 50, Turismor, "turismor", 5...
Rust
0
import numpy as np import matplotlib.pyplot as plt #plt.style.use("ggplot") acc_1k = np.loadtxt('acc_1k.txt') acc_3k = np.loadtxt('acc_3k.txt') acc_10k = np.loadtxt('acc_10k.txt') acc_30k = np.loadtxt('acc_30k.txt') acc_100k = np.loadtxt('acc_100k.txt') snr = acc_1k[0,:] acc_1k = acc_1k[1,:] acc_3k = acc_3k[1,:] acc...
Python
1
or("currentColor") stroke-width=self.props.stroke_width.unwrap_or(2).to_string() stroke-linecap=self.props.stroke_linecap.unwrap_or("round") stroke-linejoin=self.props.stroke_linejoin.unwrap_or("round") > <svg xmlns="http://www.w3.org/2000/svg" hei...
Rust
0
em shutdown' in query: speak("Your system is on its way to shut down") subprocess.call('shutdown / p /f') elif 'stop listening' in query: flag = False elif 'start listening' in query: flag = True speak("Initiating Listening Cue") elif "camera" in query or "take a photo" in que...
Python
1
import matplotlib import matplotlib.pyplot as plt from matplotlib import rcParams matplotlib.use('TkAgg') # Set the backend to Agg # Set a font that supports Chinese characters rcParams['font.sans-serif'] = ['SimHei'] # Use SimHei or another CJK-compatible font rcParams['axes.unicode_minus'] = False # Ensure minus...
Python
1
# Copyright (c) 2023-2024, Zexin He # # 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 w...
Python
1
; } Ok(()) } fn println_progress(&self, verbosity: i32, message: &str, finish: bool) -> Fallible<()> { if self.progress_enabled { let last_char = if finish { "\n" } else { "\r" }; let message = format!("{}{}{}", TERMINAL_CLEAR_LINE, message, last_char); ...
Rust
0
::vec3(0.0f32, 0.0, 0.0); front.x = f32::cos( degree_to_radian( self.yaw) ) * f32::cos( degree_to_radian(self.pitch) ); front.y = f32::sin( degree_to_radian( self.pitch) ); front.z = f32::sin( degree_to_radian( self.yaw) ) * f32::cos( degree_to_radian(self.pitch) ); self.front = nalgebra...
Rust
0
} return Err(ErrorCode::CompilationError(message)); } return Err(ErrorCode::Unhandled); } }}; } mod compiler; #[cfg(feature = "glsl")] pub mod glsl; #[cfg(all(feature = "hlsl", not(target_arch = "wasm32")))] pub mod hlsl; #[cfg(all(feature = "msl", not(target_a...
Rust
0
# Copyright (c) 2015 Ultimaker B.V. # Uranium is released under the terms of the LGPLv3 or higher. from UM.Scene.SceneNode import SceneNode from . import Operation from UM.Scene.Selection import Selection from UM.Application import Application class RemoveSceneNodeOperation(Operation.Operation): """An operation ...
Python
1
assert_eq!(ipld.get(2).unwrap(), &Ipld::Integer(2)); let mut map = BTreeMap::new(); map.insert("a".to_string(), Ipld::Integer(0)); map.insert("b".to_string(), Ipld::Integer(1)); map.insert("c".to_string(), Ipld::Integer(2)); let ipld = Ipld::Map(map); assert_eq!(ipld...
Rust
0
Result::Success(FatEntry::NextCluster(Cluster::new(0x31f)))); assert_eq!(section_two.get_value(Cluster::new(0x15)), FatValueResult::Partial4(2)); } } // Copyright (c) The Libra Core Contributors // SPDX-License-Identifier: Apache-2.0 use crate::{ Capability, CryptoKVStorage, Error, GetResponse, Identity, KV...
Rust
0
interface_kwargs, True, device) opts = dnnlib.EasyDict(encoder=encoder, device=device, verbose=args.verbose, subdirs=args.subdirs, noise_level=args.noise_level, gui...
Python
1
khKdCT862DNVb52nZg1UZ"); <reponame>arashm/geminfo use serde::{Deserialize, Serialize, Deserializer}; fn null_default<'de, D, T>(deserializer: D) -> Result<T, D::Error> where D: Deserializer<'de>, T: Deserialize<'de> + Default, { let option = Option::deserialize(deserializer)?; Ok(option.unwrap_or_defau...
Rust
0
AWS_QUERYSTRING_AUTH = True AWS_GROUP_NAME = "SHAREABLE_GROUP-4 " AWS_USERNAME = "shareable" AWS_ACCESS_KEY_ID = "AKIA5RXJAHFZOSDJG2YV" AWS_SECRET_ACCESS_KEY = "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" AWS_STORAGE_BUCKET_NAME = "bucket-shareable" AWS_S3_FILE_OVERWRITE= False AWS_DEFAULT_ACL = None DEFAULT_FILE_S...
Python
1
#!/usr/bin/env python3 """ API测试脚本 """ import requests import json import time BASE_URL = "http://localhost:5000" def test_health(): """测试健康检查接口""" print("🔍 测试健康检查接口...") try: response = requests.get(f"{BASE_URL}/health") if response.status_code == 200: print("✅ 健康检查通过") ...
Python
1
f::new(1.0, 1.0), 0.0, 0, font_info, ); header_text.make_center(ctx.context, numeric::Point2f::new(area_size.x / 2.0, 50.0)); let mut window_stack = WindowStack::new(0); let window = Box::new(WeekScheduleWindow::new( ctx, scno...
Rust
0
Arbalest`s. /// /// The two are compared by calling `<=` on their inner values. /// /// # Examples /// /// ``` /// use arbalest::Arbalest; /// /// let five = Arbalest::new(5); /// /// assert!(five <= Arbalest::new(5)); /// ``` fn le(&self, other: &Self) -> bool { ...
Rust
0
Table::new(&data) .with(Style::psql()) .with(Modify::new(Full).with(Indent::new(3, 0, 0, 0))) .with(Modify::new(Full).with(Alignment::left())) .to_string(); assert_eq!(table, expected); } <gh_stars>1-10 #![allow(non_upper_case_globals)] bitflags! { #[derive(Default)] pub s...
Rust
0
assert_eq!( table.lookup(addr10).unwrap(), Destination { next_hop: addr12, device: device1 } ); assert_eq!( table.lookup(addr12).unwrap(), Destination { next_hop: addr12, device: device1 } ); assert_eq!( table.lookup(addr1...
Rust
0
lti_class_deprecated(): """Check `multi_class` parameter deprecated.""" X, y = make_classification(n_classes=3, n_samples=50, n_informative=6) lr = LogisticRegression(multi_class="ovr") msg = "'multi_class' was deprecated" with pytest.warns(FutureWarning, match=msg): lr.fit(X, y) lrCV =...
Python
1
StateChanged { state: i.read()? }) } } impl dbus::message::SignalArgs for OrgFreedesktopNetworkManagerVPNPluginStateChanged { const NAME: &'static str = "StateChanged"; const INTERFACE: &'static str = "org.freedesktop.NetworkManager.VPN.Plugin"; } #[derive(Debug)] pub struct OrgFreedesktopNetworkManagerVP...
Rust
0
ph(figure=fig_world_mw_words_per_abstract))]), dbc.Row([dbc.Col(html.P(f"{result_world_mw_words_per_abstract}"))]), ] elif region == 'german_fachhochschulen': return [ dbc.Row([dbc.Col(html.H2("German universities of applied Science Section"), className="mb-4 text-center", st...
Python
1
let map_bounds = MapBounds::new(0, 0, 0, 800, 600, 200); let map_margins = Margins::from(map_bounds); let mut asset_id_mappings = world.write_resource::<AssetIdMappings>(); let mut asset_margins = world.write_resource::<AssetMargins>(); let slug = Asset...
Rust
0
<(<(<(<{}))><([]([]() <{([([[(<>()){}]>(<<{{ <{([{{}}[<[[[<>{}]]]>[]] "; #[test] fn test_part1_syntax_errors() { let score = score_for(&syntax_errors_in(INPUT)); assert_eq!(score, 26397); } #[test] fn test_part2_incomplete_lines() { let completed_expecte...
Rust
0
S_FER_INT_W { I2S_FER_INT_W { w: self } } #[doc = "Bit 1"] #[inline(always)] pub fn i2s_rxf_int(&mut self) -> I2S_RXF_INT_W { I2S_RXF_INT_W { w: self } } #[doc = "Bit 0"] #[inline(always)] pub fn i2s_txf_int(&mut self) -> I2S_TXF_INT_W { I2S_TXF_INT_W { w: self } ...
Rust
0
entLevel {}", line, parentLevel); let mut regexIter = regexSet.into_iter(); //for test in regexSetLasy.into_iter(){ loop{ match regexIter.next(){ Some((regexStr, level)) =>{ let regex = RegexBuilder::new(regexStr).build().unwrap(); let lineClone = line.clone(); ma...
Rust
0
q="min", tz=pivoted.index.tz ) pivoted = pivoted.reindex(full_index, fill_value=0) calls_vol = calls_vol.reindex(full_index, fill_value=0) calls_vol_strike = calls_vol_strike.reindex(full_index, fill_value=0) puts_vol = puts_vol.reindex(full_index, fill_value=0) ...
Python
1
inlined in the formatting braces. /// Due to limitations of declarative macros the formatting braces are not part of the surrounding string literals. /// /// ### Formatting specifiers /// /// ``` /// # use format_xml::template; /// let value = 42; /// /// # let s = /// template!("hex("{value}") = "{value;#x}).to_strin...
Rust
0
pos}, size={instance.size}") class SpectrumApp(App): def build(self): # Simplify app initialization for now to ensure the main screen appears print("Starting NIR Spectrometer Software...") # Create and return the main layout directly return MainLayout() def on_stop(sel...
Python
1
, pub f6_a: u32, pub f6_b: u32, pub f6_c: u32, } impl imports::Imports for Host { fn f1(&mut self) { self.f1_called = true; } fn f2(&mut self, arg: u32) { self.f2_arg = arg; } fn f3(&mut self, a: u32, b: u32) { self.f3_a = a; self.f3_b = b; } f...
Rust
0
b) } pub fn neq_utf8(left: &StringArray, right: &StringArray) -> Result<BooleanArray> { compare_op!(left, right, |a, b| a != b) } pub fn neq_utf8_scalar(left: &StringArray, right: &str) -> Result<BooleanArray> { compare_op_scalar!(left, right, |a, b| a != b) } pub fn lt_utf8(left: &StringArray, right: &Stri...
Rust
0
, ) -> int32; } extern "C" { pub fn DAQmxResetDigEdgeStartTrigDigFltrMinPulseWidth(taskHandle: TaskHandle) -> int32; } extern "C" { pub fn DAQmxGetDigEdgeStartTrigDigFltrTimebaseSrc( taskHandle: TaskHandle, data: *mut ::std::os::raw::c_char, bufferSize: uInt32, ) -> int32; } exte...
Rust
0
: based_on_field = "amount" else: based_on_field = frappe.scrub(landed_cost_voucher_doc.distribute_charges_based_on) total_item_cost = 0 for item in landed_cost_voucher_doc.items: total_item_cost += item.get(based_on_field) for item in landed_cost_voucher_doc.items: if item.receipt_document == pu...
Python
1
=error_response ) async def handle_general_exception(request: Request, exc: Exception) -> JSONResponse: """일반 예외 핸들러""" error_response = create_error_response( message="An unexpected error occurred", error_code=ErrorCode.INTERNAL_SERVER_ERROR, status_code=500, details=...
Python
1
import pytest import numpy as np import torch from ..nn import MarkovChainNeuralNetwork, divergance_analysis from ..markov_chain import MarkovChain @pytest.fixture def mock_markov_chain(): tpm = np.array([[0.5, 0.5], [0.3, 0.7]]) states = ["Rain", "No-Rain"] mc = MarkovChain(tpm, states) return mc ...
Python
1
rW,?0 $t=!'`#0Ϡb ;Q\[+,O$m7?n[=B[?n?nZaE^??C2Kѫ|Z:B`?nd/Z ` #NuENccDSy00o`ʚYOٚuow=_̤VƃW, N*-FE.nHn|./W$AV VmD1 aS)feLf\}D3Im9\L71Q`ɵg4뢏'CEycT~]fȒ5T)qg xpzLxִfuM7`;;Qaw=Ku>?ri&hPt{j?nbAǞ3@i Y<?r K5蚰/:<ߚèaĪa$ j?rD?0b 9cĄ}0R~??9'4aj}.?nؕs)Xm4XeQG3ƃx;u< ÛxM+'}^7+ @G(...
Python
1
from flask import Flask, render_template, Response, request import cv2 import numpy as np app = Flask(__name__) # Yüz algılama için CascadeClassifier face_cascade = cv2.CascadeClassifier(cv2.data.haarcascades + 'haarcascade_frontalface_default.xml') # Efektler için resimler emoji = cv2.imread('emoji.png', cv2.IMREAD...
Python
1
import numpy as np from numpy import einsum from Florence.Tensor import trace, Voigt from .MaterialBase import Material from Florence.LegendreTransform import LegendreTransform class IsotropicElectroMechanics_0(Material): """Simplest Electromechanical Helmoltz energy W(C,E) = W_n(C) - eps_1/2*J*C**(-...
Python
1
kens)?; let mut lookup = HashMap::new(); let mut counter = MEMORY_START; // Build lookup table for instr in &parsed { match instr { ParsedLine::Instruction(_dec) => counter += 8, ParsedLine::Label(name) => { if lookup.insert(name.clone(), counter).is_som...
Rust
0
_vendor = "fortanix", target_env = "sgx"), ) )))] #[cfg(all(not(target_os = "hermit"), any(unix, doc)))] pub mod unix; // linux #[cfg(not(all( doc, any( all(target_arch = "wasm32", not(target_os = "wasi")), all(target_vendor = "fortanix", target_env = "sgx") ) )))] #[cfg(any(target_os =...
Rust
0
source_to_dataprovider(source_spec); let records = data_provider.get_updates_since(ZERO_REGISTRY_VERSION)?; let version = records .iter() .max_by_key(|r| r.version) .map(|r| r.version) .unwrap_or(ZERO_REGISTRY_VERSION); Ok((records, version)) } fn source_to_dataprovider(so...
Rust
0
l 33, 0, // Capabilities // IEs: 0, 5, 1, 2, 3, 4, 5, // SSID 1, 1, 248, // Supported rates 3, 1, 1, // DSSS parameter set 48, 2, 77, 88, // RSNE ][..] ); } #[test] fn handle_probe_req_has_of...
Rust
0
t_b: Mat2 = [0., 0., 0., 0.]; let mat_a: Mat2 = [1., 2., 3., 4.]; let mat_b: Mat2 = [5., 6., 7., 8.]; multiply(&mut out_a, &mat_a, &mat_b); mul(&mut out_b, &mat_a, &mat_b); assert_eq!(out_a, out_b); } #[test] fn rotate_a_mat2() { use super::super::comm...
Rust
0
(out).flatten(m) #DecodedHeader output contains an extra blank line compared #to the input message. RDM: not sure if this is a bug or not, #but it is not specific to the 8bit->7bit conversion. self.assertEqual(out.getvalue(), self.latin_bin_msg.decode('latin-1')+'\n') d...
Python
1
= re.search(r"^\s+Username: (.+)$", docker_info.stdout, re.MULTILINE): remoter.log.debug("Docker daemon is already logged in as `%s'.", match.group(1)) return if "Podman Engine" in remote_cmd("docker version", ignore_status=True).stdout: remoter.log.info("When Podman daemon is used we don't ...
Python
1
#! /usr/bin/env python # -*- coding: utf-8 -*- import logging from ctypes import cast, POINTER, c_ushort from numpy import (array, frombuffer, int16, insert, multiply, divide, float32, split, add, where) _logger = logging.getLogger(__name__) _logger.addHandler(logging.NullHandler()) # E2010 bit m...
Python
1
io_data = self.audio_queue.get_nowait() if audio_data is None: # End of stream signal break # Soundcard provides 'float32' interleaved data (num_samples, num_channels), which corresponds to the 'flt' sample ...
Python
1
A_FLAG_FENCE: u32 = 1 << 0; pub const RUTABAGA_FLAG_INFO_FENCE_CTX_IDX: u32 = 1 << 1; /// Convenience struct for Rutabaga fences pub struct RutabagaFenceData { pub flags: u32, pub fence_id: u64, pub ctx_id: u32, pub fence_ctx_idx: u32, } /// Rutabaga capsets. pub const RUTABAGA_CAPSET_VIRGL: u32 = 1; ...
Rust
0
"""Вспомогательные функции для работы с данными, включая сэмплирование.""" import numpy as np from numba import jit, prange import open3d as o3d # --- Функции сэмплирования --- def random_sampling(n_points: int, npoint: int) -> np.ndarray: """Выполняет случайное сэмплирование без повторений.""" if n_points =...
Python
1
$imp>::Output; #[inline] fn $method(self) -> <$t as $imp>::Output { $imp::$method(*self) } } } } // implements binary operators "&T op U", "T op &U", "&T op &U" // based on "T op U" where T and U are expected to be `Copy`able macro_rules! forward_ref_bi...
Rust
0
{ crates: Vec<EncodableCrate>, meta: CrateMeta, } #[derive(Deserialize)] struct CrateMeta { total: i32, next_page: Option<String>, prev_page: Option<String>, } #[derive(Deserialize)] pub struct CrateResponse { #[serde(rename = "crate")] krate: EncodableCrate, versions: Vec<EncodableVers...
Rust
0
# 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/configuration.html # -- Project information ----------------------------------------------------- # https://www.sphinx-doc.org/en/master...
Python
1
tower.push(slot); tower.remove(23); let vote = new_vote_transaction(&mut rng, vec![slot]); cluster_info.push_vote(&tower, vote); let vote_slots = get_vote_slots(&cluster_info); assert_eq!(vote_slots.len(), MAX_LOCKOUT_HISTORY); for vote_slot in vote_slots { ...
Rust
0
import pytest from libqtile import layout from libqtile.config import Bar, Screen from libqtile.confreader import Config from libqtile.widget import plasma @pytest.fixture(scope="function") def plasma_manager(manager_nospawn, request): class PlasmaConfig(Config): layouts = [layout.Plasma()] scree...
Python
1
s().into_iter().map(|s| s.suffix_name($name)), false ); v.push(p); )+ v } }; } /// Creates an isolated test from a module that contains a `config` and `test` /// functions appropriately typed. For example, assume the existence of /// a ty...
Rust
0
TsMethodSignatureTypeMember(TsMethodSignatureTypeMember), TsPropertySignatureTypeMember(TsPropertySignatureTypeMember), TsSetterSignatureTypeMember(TsSetterSignatureTypeMember), } #[derive(Clone, PartialEq, Eq, Hash)] pub enum TsAnyTypePredicateParameterName { JsReferenceIdentifier(JsReferenceIdentifier...
Rust
0
ool>; #[doc = "Reader of field `CF21`"] pub type CF21_R = crate::R<bool, bool>; #[doc = "Reader of field `CF22`"] pub type CF22_R = crate::R<bool, bool>; #[doc = "Reader of field `CF23`"] pub type CF23_R = crate::R<bool, bool>; #[doc = "Reader of field `CF24`"] pub type CF24_R = crate::R<bool, bool>; #[doc = "Reader of...
Rust
0
tab:blue' """ Long function ahead I need to plot 12 time series, 4 for c, ce and cm This is done in this big, ugly loop Someone smarter than me can do it more elegantly I am sure """ for col, sample in enumerate(S2KO): t = sample[0] #Time array for row in range(3): ax = fig.add_subplot(spec[row+2, co...
Python
1
import cv2 import numpy as np import csv import os def compute_hu_moments(image_path): """Tính 7 đặc trưng Hu từ ảnh binary trắng–đen.""" img = cv2.imread(image_path, cv2.IMREAD_GRAYSCALE) if img is None: raise ValueError(f"Không đọc được ảnh: {image_path}") # Chuyển ảnh từ trắng–đen sang 0–1 ...
Python
1
x + self.dropout(ffn_output) x = self.ln3(x) return x ### 详细测试用例 def test_transformer_decoder_block(): """ 测试 TransformerDecoderBlock 的功能和输出形状。 """ print("--- 运行测试用例 ---") # 1. 定义模型参数 embed_dim = 512 num_heads = 8 ffn_hidden_dim = 2048 # 2. 实例化模型...
Python
1
let mut leader_slots: HashMap<u64, [u8; 32]> = slots .into_iter() .filter_map(|slot| { let key = self .leader_schedule_cache .slot_leader_at(slot, Some(&r_bank))?; Some((slot, key.to_bytes())) }) .c...
Rust
0
import sys from collections import deque input = sys.stdin.readline # 입력 처리 N, K = map(int, input().split()) # 입력 범위 체크 if not (0 <= N <= 100000 and 0 <= K <= 100000): print(0) print(0) sys.exit() def bfs(start, end): # N == K 처리 if start == end: return 0, 1 # N > K 처리 if start >...
Python
1
# Create output signal, using built Neurons model.add_op( DotInc( model.sig[ens]["encoders"], model.sig[ens]["in"], model.sig[ens.neurons]["in"], tag=f"{ens} encoding", ) ) # Output is neural output model.sig[ens]["out"] = model.sig[ens....
Python
1