text
string
label_name
string
labels
int64
from django.urls import path, include, re_path import notifications.urls from . import views from rest_framework.routers import DefaultRouter from rest_framework_simplejwt.views import ( TokenObtainPairView, TokenRefreshView, ) router = DefaultRouter() router.register('subcategory', views.SubCategoryViewSet,...
Python
1
одит список записанных на пользователя ресурсов на определенной странице""" user = await Visitor.get_current(message.chat.id) resources = await Resource.get_resources_on_user(user) if len(resources) == 0: await message.answer(strings.user_have_no_device_msg) # type: ignore return pagina...
Python
1
=> 0, U3::B100 => 1, U3::B101 => 2, U3::B110 => 3, U3::B111 => 4, }; self.hclk() >> shift } fn tim_pclk1(&self) -> Hz { match RCC.cfgr().ppre1() { U3::B000 | U3::B001 | U3::B010 | U3::B011 => self.pclk1(), ...
Rust
0
import zmq HOST = 'localhost' PORT = 5555 context = zmq.Context() socket = context.socket(zmq.SUB) socket.connect(f"tcp://{HOST}:{PORT}") socket.subscribe("") while True: message = socket.recv_string() print(message)
Python
1
'employee_id': cls.employeeC.id, 'state': 'close', 'company_id': cls.company_A.id, }, { 'date_start': datetime(2023, 12, 1), 'name': 'Contract Employee D start december', 'resource_calendar_id': cls.calendar_35h.id,...
Python
1
""" File for storing references to datasets. """ from datetime import date from typing import List import pandas as pd from openmapflow.config import PROJECT_ROOT, DataPaths from openmapflow.constants import CLASS_PROB, COUNTRY, END, LAT, LON, START, SUBSET from openmapflow.datasets import GeowikiLandcover2017 from o...
Python
1
/ let record = record.unwrap(); /// // Do somethind with the record. ///} ///``` pub trait RecordReader: Iterator<Item = Result<Record, Error>> { /// Writes the next record into `record`. It allows to skip excessive memory allocation. /// /// # Errors /// /// If there are no more records to it...
Rust
0
/// remove symbols #[structopt(long)] no_symbols: bool, } impl Args { pub fn parse_args() -> Self { Self::from_args() } pub fn generate_password(&self) -> String { let password_len = self.length; let char_array = self.generate_char_array(); let mut rng = thread_rng(...
Rust
0
evice }; let restored_mmio_transport = MmioTransport::restore( restore_args, &MmioTransportState::deserialize(&mut buf.as_slice(), &version_map, 1).unwrap(), ) .unwrap(); assert_eq!(restored_mmio_transport, mmio_transport); } fn default_block() -> (MmioT...
Rust
0
from sqlalchemy import Column, Integer, Date, Enum, ForeignKey from database.base import Base class UserHabitProgress(Base): __tablename__ = 'user_habit_progress' id = Column(Integer, primary_key=True) user_habit_id = Column(Integer, ForeignKey('user_habits.id', ondelete='CASCADE')) week_start_date = ...
Python
1
avoid: bool) { unsafe { object::set_object_force_vehicles_to_avoid(self.handle(), avoid) } } } impl Entity for Object { /// Gets the underlying entity handle. #[inline] fn handle(&self) -> scripthookv::types::Entity { self.handle } } /// The given handle is not an object handle. #[derive(Debug)] pub...
Rust
0
position_of_real_word_indices: idx_above_word = single_word_idx >= len(words_estimated) if idx_above_word: continue error_word = WordMetrics.edit_distance_python( words_estimated[single_word_idx], words_real[word_idx]) ...
Python
1
from collections import deque # Define the city map city_map = [ [8, 'x', 4, 7, 10, 'x', 12, 5, 'x'], ['x', 'x', 4, 11, 16, 4, 12, 15, 'x'], [3, 'x', 16, 16, 4, 'x', 'x', 'x', 'x'], [11, 6, 3, 12, 8, 2, 19, 14, 'x'], [20, 18, 19, 'x', 4, 18, 'x', 15, 13], [8, 15, 'x', 16, 11, 'x', 10, 14, 1], ...
Python
1
" LDA #$01 STA $FF LSR $FF PHP ", ); assert_eq!(cpu.cpu_read(0xFF), 0x00, "0x01 >> 1 = 0x00"); let status = cpu.cpu_read(0x01FF); assert_eq!(status & 0x01, 0x01, "carry bit set"); assert_eq!(status & 0x02, 0x02,...
Rust
0
t)?; encrypt_impl!( entry, aad, nonce, plaintext, encrypt, VaultFailErrorKind::AeadAesGcmEncrypt ) } fn aead_aes_gcm_decrypt<B: AsRef<[u8]>>( &self, context: SecretKeyContext, cipher_text: B, ...
Rust
0
f.after( 5 * 60 * 1000, self._disableFullAccessCallback, ) elif not enable and self._fullAccessTimerID is not None: self.after_cancel(self._fullAccessTimerID) [call() for call in self._fullAccessLockCallbacks] self._fullAccessText.s...
Python
1
truct HostCategoryDirectory { pub id: i32, pub host_category_id: i32, pub path: String, pub up2date: bool, pub directory_id: i32, } #[derive(Queryable)] pub struct HostCategoryUrl { pub id: i32, pub host_category_id: i32, pub url: String, pub private: bool, } #[derive(Queryable)] p...
Rust
0
_string().as_str()); hasher.result_str()[0..8].to_string() } pub fn hash(input: &str) -> String { use crypto::digest::Digest; use crypto::sha1::Sha1; let mut hasher = Sha1::new(); hasher.input_str(input); hasher.result_str() } pub fn check_password(hash_value: &str, password: &str, salt: &str...
Rust
0
import synalinks import asyncio from knowledge_graph_schema import City, Country, Place, Event from knowledge_graph_schema import IsCapitalOf, IsLocatedIn, IsCityOf, TookPlaceIn class Query(synalinks.DataModel): query: str = synalinks.Field( description="The user query", ) class Answer(synalinks.Da...
Python
1
ts.") //! } //! ``` //! Hint: //! > ⚠️ This crate will only work on POSIX compatible systems, //! > where the "nix" and "libc" crates are available. //! use nix::{ fcntl::{flock, open, OFlag}, libc::{ getgrgid, getgrnam, getpwnam, getpwuid, mode_t, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO, }, ...
Rust
0
'entity_contact_point_phone' __table_args__ = ( UniqueConstraint('contact_point_id', 'phone_number'), mysql_opts(), ) id = col(Integer, primary_key=True) contact_point_id = col( Integer, ForeignKey('entity_contact_point.id', onupdate='CASCADE', ondelete='CASCADE'), ...
Python
1
# <! ----------------------- config ----------------------- !> @staticmethod def deep_merge(base: dict, lang: dict): merged = base.copy() specs = lang.get("specifications") merged["audio"]["stt"].update(specs.get("audio").get("stt")) merged["settings"]["trigger"]["triggers"...
Python
1
jpg\ " } ) CMD_HELP.update( { "appmisc": f"`{cmd}app`\ \nUsage: ketik `{cmd}app namaapp` Dan Dapatkan Detail Informasi App.\ \n\n`.calc`\ \nUsage: `{cmd}calc <term1><operator><term2>\nUntuk eg {cmd}calc 02*02 Atau 99*99 (Angka Nol Penting) (Minimal Dua Suku Dan Dua Digit).\ \n\n`{cmd}xcd`\ \nUsage...
Python
1
from .classifier import * from .regressor import * from .grl import * from .domain_discriminator import * from .kernels import * from .entropy import * __all__ = ['classifier', 'regressor', 'grl', 'kernels', 'domain_discriminator', 'entropy']
Python
1
most recent one let combat_rating = (self.combat_rating + _cs.combat_rating) / 2.0; let total_lifespan = self.get_total_lifespan() + _cs.get_total_lifespan(); //this doesnt completely work, since there are times where a lifespan //does not end in death (i.e. end of game) ...
Rust
0
Punctuation), (r'''(?x)\b(?: next|break|end| axiom|end_axiom|category|end_category|domain|end_domain|inherits| if|%if|then|elif|else|end_if| case|of|do|otherwise|end_case| while|end_while| repeat|until|end_repea...
Python
1
) => { for (i, v) in values.iter().enumerate() { if i > 0 { f.write_str(" ")?; } f.write_str(if *v { "1" } else { "0" })?; } Ok(()) }, ValueArray::Boolean2(values) ...
Rust
0
ymm8 # push ymm8 vmovups [rsp + 32*9], ymm9 # push ymm9 vmovups [rsp + 32*10], ymm10 # push ymm10 vmovups [rsp + 32*11], ymm11 # push ymm11 vmovups [rsp + 32*12], ymm12 # push ymm12 vmovups [rsp + 32*13], ymm13 # push ymm13 vmovups [rsp + ...
Rust
0
Box.html /// [`()`]: https://doc.rust-lang.org/std/primitive.unit.html /// [`L`]: ./struct.L.html pub unsafe trait ListLayout { fn size() -> usize; fn align() -> usize; } unsafe impl ListLayout for () { fn size() -> usize { 0 } fn align() -> usize { 1 } } unsafe impl<E, C: Lis...
Rust
0
pg_publication_pubowner: u32 = 3; pub const Anum_pg_publication_pubtruncate: u32 = 8; pub const Anum_pg_publication_pubupdate: u32 = 6; pub const Anum_pg_trigger_oid: u32 = 1; pub const Anum_pg_trigger_tgargs: u32 = 15; pub const Anum_pg_trigger_tgattr: u32 = 14; pub const Anum_pg_trigger_tgconstraint: u32 = 10; pub co...
Rust
0
55.0 # 得到过去一系列坐标和图片 images_list = [] images_list.append(image) if self.input_n != 0: coor = np.zeros(2*(self.input_n+1), np.float32) coor[0], coor[1] = x, y for i in range(self.input_n): imagepath_past, x_past, y_past, z, w, wx, wy, w...
Python
1
let ignore_path: PathBuf = [source_path.as_path(), Path::new(ignore_filename)] .iter() .collect(); fs::write(&ignore_path, filename_to_ignore).expect("Cannot write file"); let (ignore, _) = Gitignore::new(ignore_path); // add another file to ...
Rust
0
= match res { Ok(lib) => lib, Err(e) => { return Err(e); } }; unsafe { let func_create: Symbol<FN_SSOCK_CREATE> = (&nativelib).get(b"ssock_create").unwrap(); let pssock_ptr = func_create(); let lib = SSockNativeLib...
Rust
0
from world import GroundTruth, Data import numpy as np from typing import List def rmse(a: np.ndarray, b: np.ndarray) -> np.ndarray: return np.sqrt(np.mean((a - b) ** 2)) def interpolate_ground_truth(gts: List[GroundTruth], estimation: Data) -> np.ndarray: # Interpolate the ground truth to the same times ...
Python
1
ile/filter tree at the time of this call. If you later add files to a Filter object which was passed into a previous call to AddFiles(), it will not be reflected in this project. """ self._AddFilesToNode(self.files_section, files) # TODO(rspangler) This also doesn't handle adding files to an existi...
Python
1
.lock().unwrap(); *v += 1; *v }; let response_text = format!( "This server has been up for {} second(s). This is visit number {}.\n", uptime.as_secs(), visits ); let response = response_text.into_response(&state); Box...
Rust
0
""" Dummy job for testing. """ import argparse import os import sys from ast import literal_eval import labtasker if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--arg1", type=str, required=True, ) parser.add_argument("--arg2", type=str, req...
Python
1
# SPDX-FileCopyrightText: 2024 M5Stack Technology CO LTD # # SPDX-License-Identifier: MIT import os, sys, io import M5 from M5 import * import camera import dl import image img = None detector = None detection_result = None res = None kp = None def setup(): global img, detector, detection_result, kp M5.begi...
Python
1
, offset: TextUnit) -> Option<SourceChange> { let file = self.file_syntax(file_id); Some(SourceChange::from_local_edit(file_id, "add semicolon", libeditor::on_eq_typed(&file, offset)?)) } pub fn file_structure(&self, file_id: FileId) -> Vec<StructureNode> { let file = self.file_syntax(fi...
Rust
0
raise RuntimeError( 'AdamW does not support sparse gradients') grads.append(p.grad) state = self.state[p] # State initialization if len(state) == 0: state['step'] = 0 # Exponentia...
Python
1
= 13, TimestampReply: TIMESTAMP_REPLY = 14, } impl IcmpMessageType for Icmpv4MessageType { fn is_err(self) -> bool { use Icmpv4MessageType::*; [DestUnreachable, Redirect, TimeExceeded, ParameterProblem].contains(&self) } } create_net_enum! { Icmpv4DestUnreachableCode, DestNetworkUnreac...
Rust
0
# Subsignal( "gpio17", Pins("Jx:x")), # Subsignal( "gpio18", Pins("Jx:x")), # Subsignal( "gpio19", Pins("Jx:x")), Subsignal( "gpio20", Pins("J2:30")), Subsignal( "gpio21", Pins("J2:29")), Subsignal( "gpio22", Pins("J2...
Python
1
#!/usr/bin/env python3 import argparse import os import numpy as np import cv2 BAYER_MAP = { "BGGR": cv2.COLOR_BayerBG2BGR, "RGGB": cv2.COLOR_BayerRG2BGR, "GRBG": cv2.COLOR_BayerGR2BGR, "GBRG": cv2.COLOR_BayerGB2BGR, } def unpack_raw10(chunk: bytes, h: int, w: int) -> np.ndarray: # Unpack R...
Python
1
::MMIO_MEM_START, (arch::IRQ_BASE, arch::IRQ_MAX)) } #[cfg(target_arch = "x86_64")] fn default_portio_device_manager() -> PortIODeviceManager { PortIODeviceManager::new( Arc::new(Mutex::new(Serial::new_sink( EventFd::new(libc::EFD_NONBLOCK).unwrap(), ))), ...
Rust
0
6, 0xec, 0x34, 0x36, 0x57, 0xc3, 0xdc)] interface ID2D1CommandList(ID2D1CommandListVtbl): ID2D1Image(ID2D1ImageVtbl) { fn Stream( sink: *const ID2D1CommandSink, ) -> HRESULT, fn Close() -> HRESULT, }} RIDL!{#[uuid(0x2c1d867d, 0xc290, 0x41c8, 0xae, 0x7e, 0x34, 0xa9, 0x87, 0x02, 0xe9, 0xa5)] interface...
Rust
0
line_editor = Reedline::create()?; /// let prompt = DefaultPrompt::default(); /// /// let out = line_editor.read_line(&prompt).unwrap(); /// match out { /// Signal::Success(content) => { /// // process content /// } /// _ => { /// eprintln!("Entry aborted!"); /// /// } /// } /// # Ok::<(), io...
Rust
0
sed_lidar_torch_dict, 'label_dict': label_torch_dict}) if self.visualize: origin_lidar = \ np.array(downsample_lidar_minimum(pcd_np_list=origin_lidar)) origin_lidar = torch.from_numpy(origin_lidar) output_dict['ego'].update({...
Python
1
from flask import Blueprint , request,jsonify import numpy as np from helper.index import convert_to_python_type arithmetic = Blueprint("arithmetic",__name__) # add api @arithmetic.route('/add',methods=['Post']) def add(): data = request.get_json() result = np.add(data['x'],data['y']) result = convert_to_...
Python
1
""" 数据类型标准化工具 负责将不同数据库的数据类型标准化为统一格式 """ import re from typing import Optional from app.models.table_schema import ColumnType class TypeNormalizer: """数据类型标准化工具""" def normalize_type(self, column_type: str) -> ColumnType: """ 标准化列数据类型 Args: column_type: 原始数据类型...
Python
1
terface_name in ( "org.freedesktop.DBus.Properties", "org.freedesktop.DBus.Introspectable", ): return {} logger.warning("MPRIS does not implement %s interface", interface_name) return None def _set(self, interface_name: str, property_name: str, value: An...
Python
1
# Copyright 2016 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 agreed to in writing, ...
Python
1
d::InlineAsm(..) | ast::ExprKind::LlvmInlineAsm(..) | ast::ExprKind::Let(..) | ast::ExprKind::Path(..) | ast::ExprKind::Range(..) | ast::ExprKind::Repeat(..) | ast::ExprKind::Ret(..) | ast::ExprKind::Tup(..) | ast::ExprKind::Type(..) | ast::ExprKin...
Rust
0
} } } } impl ToTokensSubst for WherePredicate { fn to_tokens_subst(&self, tokens: &mut TokenStream, subst: &TokenStream) { match self { WherePredicate::Type(ty) => ty.to_tokens_subst(tokens, subst), WherePredicate::Lifetime(lt) => lt.to_to...
Rust
0
max(probs-alpha0) * multipler = 1 - epsilon if maxprob - alpha0s[o] > 0: newmultiplier = (1 - epsilon - alpha0s[o]) / (maxprob - alpha0s[o]) multiplier = min(multiplier, newmultiplier) if multiplier < 1: shape = (len(probtrajectory.outcomes) - 1, len(...
Python
1
# pygame demo 6(b) - using the Ball class, bounce many balls # 1 - Import packages import pygame from pygame.locals import * import sys import random from Ball import * # bring in the Ball class code # 2 - Define constants BLACK = (0, 0, 0) WINDOW_WIDTH = 640 WINDOW_HEIGHT = 480 FRAMES_PER_SECOND = 30 N_BALLS = 3 #...
Python
1
ndle(&self) -> BorrowedHandle<'_> { unsafe { BorrowedHandle::borrow_raw_handle(self.as_raw_handle()) } } } #[cfg(windows)] impl IntoHandle for std::process::Child { #[inline] fn into_handle(self) -> OwnedHandle { unsafe { OwnedHandle::from_raw_handle(self.into_raw_handle()) } } } #[cfg...
Rust
0
емная информация', {'fields': ('created_at', 'uuid', 'banned_at', 'robokassa_recurring_id', 'current_ip')}), ('Дополнительно', {'fields': ('view_logs_link', 'view_payments_link', 'subscriptions_list')}), ) def ban_users(self, request, queryset): if 'apply' in request.POST: form = Ba...
Python
1
import math import numpy as np import torch from torch import FloatTensor from typing import Tuple, Union # https://en.wikipedia.org/wiki/Quaternions_and_spatial_rotation Q = Union[ Tuple[float, float, float, float], Tuple[FloatTensor, FloatTensor, FloatTensor, FloatTensor] ] pi2 = 2 * math.pi def random_...
Python
1
"""ДЗ""" """ Задание 1 (Установка и чтение куки) - Откройте любой сайт и добавьте куки с именем "username" и значением "user123". - Затем обновите страницу и убедитесь, что кука "username" была успешно установлена. - Получите и провалидируйте значение куки "username" и выведите его на экран. Задание 2 (Удаление ...
Python
1
ot os.path.exists(log_dir): os.makedirs(log_dir) setattr(args, "log_dir", log_dir) print(args) model = get_model(args) print(f"Base Network: {args.model_name}") print(f"Source Domain: {args.src_domain}") print(f"Target Domain: {args.tgt_domain}") if args.rst: print(f"Residual...
Python
1
rialize, Serialize, Debug, Clone)] pub struct User { pub id: String, pub username: String, pub links: UserLinks, pub profile_image: UserProfileImage, } #[derive(Deserialize, Serialize, Debug, Clone)] pub struct UserLinks { pub html: String, } #[derive(Deserialize, Serialize, Debug, Clone)] pub str...
Rust
0
import os class CatalogoPeliculas: ruta_archivo = 'peliculas.txt' @classmethod def agregar_peliculas(cls, pelicula): with open(cls.ruta_archivo, 'a', encoding='utf8') as archivo: archivo.write(f'{pelicula.nombre}\n') @classmethod def listar_peliculas(cls): ...
Python
1
t port = get_sensor_port(&port); let sensor_type = get_sensor_type(&sensor_type); unsafe { ev3_sensor_config(port, sensor_type) } } /// センサポートのセンサタイプを取得する pub fn sensor_get_type(port: &SensorPort) -> SensorType { let port = get_sensor_port(&port); let sensor_type = unsafe { ev3_sensor_get_type(port) }; match sen...
Rust
0
i: $t = 2; let z = d.checked_mul(i); assert!(z.is_none()); } }; } gen_checked_mul_integer_tests!(test_checked_mul_u8, u8, 2, -1); gen_checked_mul_integer_tests!(test_checked_mul_i8, i8, 0, 123); gen_checked_mul_integer_tests!(test_checked_mul_u16, u16...
Rust
0
(24329.0 / (n as f64) + 100.0)) as f32); tnd_table }; } pub struct Apu { cycles: u64, last_sampled_cycles: u64, pulse_1: Pulse, pulse_2: Pulse, triangle: Triangle, noise: Noise, dmc: Dmc, frame_counter: FrameCounter, mapper: Rc<RefCell<Box<dyn Mapper>>>, filter: ...
Rust
0
loc; use buffer::{Buffer, STDOUT_BUFFER}; use byte; use dns::{self, DnsTransmit}; use errno::errno; use ip4; use iopause::iopause; use libc; use stralloc::StrAlloc; use strerr::{StrErr, STRERR_SYS}; use tai::Tai; use taia::TaiA; use ulong; extern "C" { fn sgetoptmine(arg1: i32, arg2: *mut *mut u8, arg3: *const u8)...
Rust
0
ing) { println!("{}", content); }#![deny(unsafe_code)] use allo_isolate::Isolate; use async_std::task; use futures::StreamExt; use rustystream::events; use std::sync::atomic::{AtomicBool, Ordering}; static SUBSCRIBED: AtomicBool = AtomicBool::new(false); #[no_mangle] pub extern "C" fn stream_subscribe(port: i64,...
Rust
0
05 => "GroupFMaxNonUniformAMD", 5006 => "GroupUMaxNonUniformAMD", 5007 => "GroupSMaxNonUniformAMD", 5011 => "FragmentMaskFetchAMD", 5012 => "FragmentFetchAMD", 5056 => "ReadClockKHR", 5283 => "ImageSampleFootprintNV", 5296 => "GroupNonUniformPartitionNV", 5299 => "WritePackedPrimitiveInd...
Rust
0
import os import telebot from telebot import types from work_au_parser import WorkUaParser from dotenv import load_dotenv load_dotenv() API_TOKEN = os.getenv('API_TOKEN') if API_TOKEN is None: raise ValueError("API_TOKEN не знайден в .env файлі") bot = telebot.TeleBot(API_TOKEN) specialty = "" location = "" ca...
Python
1
sG2 = serde_wasm_bindgen::from_value(params_g2).unwrap(); let params_2: SigParamsG2 = serde_wasm_bindgen::from_value(desez_params).unwrap(); assert_eq!(params_1, params_2); } #[allow(non_snake_case)] #[wasm_bindgen_test] pub fn bbs_sign_verify() { let messages = vec![ b"Message1".to_vec(), ...
Rust
0
fn get_current_thread_cpu_timer_info(&self) -> Result<JTimerInfo> { let res = jvmti_call_number_result!(self.jvmti_raw(), {JTimerInfo::empty_raw()}, GetCurrentThreadCpuTimerInfo ); Ok(res.into()) } pub fn get_thread_cpu_timer_info(&self) -> Result<JTimerInfo> { let ...
Rust
0
eClass(irr.IEventReceiverWrapper); makeMyEventReceiver(MyEventReceiver); receiver = MyEventReceiver(); device = irr.createDevice(driverType, irr.dimension2d_u32(800, 600), 32, False, False, False, receiver); if device == None : return 1; driver = device.getVideoDriver(); smgr = device.getSceneManager(); dev...
Python
1
testcase!( fn write_append(ptx: &mut dyn PendingTransaction) { write_twice!( ptx, OpenFlags::empty(), FdFlags::APPEND, |first: &str, second| { first.to_string() + second } ); } ); testcase!( fn write_trunc_append(ptx: &mut dyn PendingTransact...
Rust
0
j5gi, rlnqkc9kwbs, m0bx6cqwdjj as ywk40bwzykc pass '# shade_tissue_densities -> carbons_automobiles_juries' @(k9oipaf1k8a for jj0zq3ze_77 in 0.0 if l4_hxwoo0p1 if cnbt92auwhe if False for lfarwuzgxcj in 0 for v7olspv874h in k9vqd53x97f) @(goesz2t30_i, b'', 0.0, zlk7tk596bj, False, bxgijo62zss, cf8ilyepkgp, None...
Python
1
"c": -65.0, "d": 8.0, "V_m_init": -65.0, "V_min": -999, "V_th": 29.99, "I_e": 0.} model = GeNNModel("float", "tutorial_1") model.dt = TIMESTEP neuron_pop = model.add_neuron_...
Python
1
_var("RUST_LOG", format!("{}actix_web=debug,hyper=info", std::env::var("RUST_LOG") .map_or_else(|_| "".to_string(), |ll| format!("{},", ll)) )); env_logger::init(); let pg_spec = std::env::var("DATABASE_URL").expect("DATABASE_URL"); let pg_mgr = ConnectionManager::<PgConnection>::new(...
Rust
0
rite(" type cyclic;"+'\n') f.write(" }"+'\n') f.write(" front"+'\n') f.write(" {"+'\n') f.write(" type cyclic;"+'\n') f.write(" }"+'\n') f.write(" back"+'\n') f.write(" {"+'\n') f.write(" type cyclic;"+'\n') f.write(" }"+'\n') f.write("}"...
Python
1
"""Extends setuptools 'install' command.""" from __future__ import annotations import contextlib import os import sys import warnings from typing import ClassVar, ContextManager from setuptools.command.install import install as _install __all__ = ["Install"] @contextlib.contextmanager def suppress_known_deprecati...
Python
1
import glob from numpy import linalg from numpy import array from numpy import inner import os def to_float_list(l): ret = [] for s in l: ret.append(float(s)) return ret def linear_regression_no_outliers(ops, runtime): num_points = len(ops) # we want to remove the 5% worst points for ...
Python
1
Debug resources // let debug_material_3d_no_depth = begin_load_asset::<MaterialAsset>( asset_uuid!("31c5d4f7-e330-4a02-9544-7cc6db2c4fb5"), resources, ); // // Bloom extract resources // let bloom_extract_material = begin_load_asset::<Mate...
Rust
0
final_progress = ( f"检查已停止!\n" f"总计: {user_task.processed_count} 个号码\n" f"已找到注册用户: {user_task.registered_count} 个\n" f"未注册用户: {user_task.processed_count - user_task.registered_count} 个" ) # 更新最终状态 bo...
Python
1
no_scm, no_dvc, force) } /// Creates a new empty repository on the given directory, basically creating a `.holium` directory. /// /// It is recommended to track the repository with a SCM and a data version control tool. Otherwise, /// the options `--no-scm` and/or `--no-dvc` should be used. /// /// In case the direct...
Rust
0
TORE", "2")) ext.include_dirs.append(self.amalgamation_root) ext.sources.append(os.path.join(self.amalgamation_root, "sqlite3.c")) if sys.platform == "win32": # Try to locate openssl openssl_conf = os.environ.get('OPENSSL_CONF') if not openssl_conf: ...
Python
1
# Copyright 2025 © BeeAI a Series of LF Projects, LLC # SPDX-License-Identifier: Apache-2.0 """add context scoped resources Revision ID: 779011da771d Revises: b2d91792f9b5 Create Date: 2025-08-06 14:46:36.073362 """ from collections.abc import Sequence import sqlalchemy as sa from alembic import op # revision ide...
Python
1
#!/usr/bin/python3 #################################################################################### # # Copyright (c) 2023-2025 Piotr Jochymek # # MIT License # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"),...
Python
1
re.search(r"OUTPUT (AREA|VOLUME|AREAS) =\s*([0-9]+)", msg) if res is not None: return int(res.group(2)) def parse_n(msg: Optional[str] = None) -> Optional[int]: """Parse output of ``N``""" if msg: res = re.search(r"(NODE\s*)([0-9]+)", msg) if res is not None: re...
Python
1
; /// assert!(pt_extents.max_x.fuzzy_eq(1.0)); /// assert!(pt_extents.max_y.fuzzy_eq(1.0)); /// /// polyline.add(3.0, 1.0, 1.0); /// let extents = polyline.extents().unwrap(); /// assert!(extents.min_x.fuzzy_eq(1.0)); /// assert!(extents.min_y.fuzzy_eq(0.0)); /// assert!(extents.max_x.fu...
Rust
0
0; loop { let filename = if suffix == 0 { format!("{}.spl", timestamp) } else { format!("{}-{}.spl", timestamp, suffix) }; let filepath = env::current_exe() .ok() .and_then(|p| p.parent().map(|p| p.to_owned())) .unwrap_or...
Rust
0
DerObject::from_set(vec![DerObject::from_seq(vec![ DerObject::from_obj(BerObjectContent::OID(Oid::from(&[2, 5, 4, 6]).unwrap())), // countryName DerObject::from_obj(BerObjectContent::PrintableString("FR")), ])]), DerObject::from_set(vec![DerObject::from_seq(vec![ ...
Rust
0
import os import pathlib print('Generating constants from godot source') # path to the cloned godot repo godot_path = pathlib.Path(os.environ['GODOT_PATH']) print(f'GODOT_PATH: {godot_path}') repl_path = pathlib.Path('addons/repl') assert repl_path.is_dir(), 'Could not find repl dir. Run this from the project root.' ...
Python
1
0xc5, 0xe8, 0xb5, 0x98, 0x0c, 0x88, 0xe3, 0x89, 0x46, 0xd8, 0xf1, 0x8f, 0x31, 0x34, 0x65, 0xc8, 0x62, 0xa0, 0x87, 0x82, 0x64, 0x82, 0x48, 0x01, 0x8d, 0xac, 0xdc, 0xb9, 0x04, 0x17, 0x88, 0x53, 0xa4, 0x6d, 0xca, 0x3a, 0x0e, 0xaa, 0xee, ...
Rust
0
# [Vanishing Journey] Amnesiac Temple Keeper Kao from net.swordie.ms.world.field.fieldeffect import GreyFieldType KAO = 3003131 KAO_ILLUSTRATION = 3003113 if not sm.hasQuestCompleted(1466): sm.setSpeakerID(KAO) sm.sendNext("..What should we do to assuage their anger?\r\n" "#b(Complete the A Gr...
Python
1
212, 116, 171, 87, 143, 153, 119, 250, ]) .build(), ) .add_output(TransactionOutput::payment(100, &recipient_address)) .build(); assert_ok!(StakedRelayers::is_transaction_invalid( &BOB, transact...
Rust
0
); add_all_tags!(preview_image_tags, tags, tags::PreviewImage); let (start, end) = chapter.get_start_stop_times().unwrap(); tags.add::<tags::TrackNumber>(&(track_number as u32), TagMergeMode::ReplaceAll); tags.add::<tags::TrackCount>(&(chapter_count as u32), TagMergeMod...
Rust
0
use_face_segmentation_condition=use_face_segmentation_condition, use_template=use_template, weight_decay_lora=weight_decay_lora, weight_decay_ti=weight_decay_ti, ) gc.collect() torch.cuda.empty_cache() weights_path = ( Path(cog_o...
Python
1
"""Escribe un programa que dado una serie de números introducidos por el usuario, hasta que introduzca un -1, cuente cuántos de estos números son pares y cuántos son impares. El programa debe imprimir el número de pares e impares introducidos, menos el -1.""" num = int(input("Introduce un numero entero: ")) pares = 0 ...
Python
1
Caps, ) -> *mut gst::ffi::GstCaps { let instance = &*(ptr as *mut T::Instance); let imp = instance.impl_(); let wrap: Borrowed<BaseSrc> = from_glib_borrow(ptr); let caps = from_glib_full(caps); gst::panic_to_error!(&wrap, imp.panicked(), gst::Caps::new_empty(), { imp.fixate(wrap.unsafe_cast...
Rust
0
import os import subprocess import shutil import sys from db_setup.azure_table_setup import main as setup_azure_tables from config import Settings CONFIG = Settings() # Setup Azure Tables def setup_tables(): connection_string = CONFIG.STORAGE_ACCOUNT_CONNECTION_STRING setup_azure_tables(connection_string, res...
Python
1
nge(num_shadow_models+1): # Take uniform random samples of the finetuning data if finetune_dataset_size: sample = random.sample(range(0,len(original_transfer_set)), k=finetune_dataset_size) else: sample = random.sample(range(0,len(original_transfer_set)), k=int(0.85*len(original_trans...
Python
1
lf.alert_count}" # 創建警報 alert = Alert( alert_id=alert_id, alert_type=alert_type, severity=severity, title=title, description=description, source=source, details=details, tags=tags, ) # 添加到警報...
Python
1