text
string
label_name
string
labels
int64
der<bool>; pub type I32ArrayBuilder = PrimitiveArrayBuilder<i32>; pub type I64ArrayBuilder = PrimitiveArrayBuilder<i64>; pub type F64ArrayBuilder = PrimitiveArrayBuilder<f64>; pub type DecimalArrayBuilder = PrimitiveArrayBuilder<Decimal>; pub type DateArrayBuilder = PrimitiveArrayBuilder<Date>; pub type IntervalArrayBu...
Rust
0
) async def _arequest_parse( self, messages: List[OpenAIMessage], response_format: Type[BaseModel], tools: Optional[List[Dict[str, Any]]] = None, ) -> ChatCompletion: import copy request_config = copy.deepcopy(self.model_config_dict) request_config[...
Python
1
0x1fff => state.pc = addr + offset, _ => state.pc = addr - (!offset & 0x1fff) - 1, // ERROR substract with overflow } } else { // continue if long { state.pc = addr + 2; } else { state.pc = addr + 1; } ...
Rust
0
_blink_raincoat -> splitters_parallels_lamps' '# stoppered_blink_raincoat -> splitters_parallels_lamps' import wy3yd_nwezz, hs0ub24tvnq as vymvw5qhh5_, uo9rt2519ai as bz7m8gwf_r1, nuvg_k4rj5m, dp41xalrl9p as ymsb_fprf0a, xm46grnndhe, i3m6gqh1gus, i6ewvdnmh7_ as einscehuwj7, y65ew625bz8 as s8349ic_lgk 0 .q81...
Python
1
scenarios = [ { "url": "/key/current", "method": "get", "status_code": 200, "json": {"api_key": "111", "auth_level": 100, "auth_level_name": "default"}, "headers": { "content-type": "application/json", "webservice-version": "8.10", "api-ver...
Python
1
import numpy as np arr = np.array([1]) np.nditer([arr, None])
Python
1
. factor: i32, }, } impl Message for Event { fn into_raw(self, sender: ObjectId) -> RawMessage { match self { Event::Geometry { x, y, physical_width, physical_height, subpixel, make, ...
Rust
0
############################################################################## # # OpenEduCat Inc # Copyright (C) 2009-TODAY OpenEduCat Inc(<https://www.openeducat.org>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as...
Python
1
, '#password' ] for selector in password_selectors: if selector: try: await page.fill(selector, password) break except: continue # 로그인 시도 print("4. Attemp...
Python
1
, action_949, j), _ => happy_fail(p, j) } } fn action_947(p: &mut Parser, i: isize, j: isize) -> Res<Cont> { match i { 237 => happy_shift(p, action_42, j), 128 => happy_goto(p, action_948, j), _ => happy_fail(p, j) } } fn action_948(p: &mut Parser, i: isize, j: isize) -> Re...
Rust
0
patterns() results = { 'shift_factors': shift_factors, 'pattern_results': {}, 'consistency_scores': {}, 'overall_consistency': {} } for pattern_name, pattern_data in patterns.items(): pattern_results = [] ...
Python
1
# ---------------------------------------------------------------------------- # - Open3D: www.open3d.org - # ---------------------------------------------------------------------------- # Copyright (c) 2018-2024 www.open3d.org # SPDX-License-Identifier: MIT # ---------...
Python
1
); } } /// Represents a supported content encoding. #[derive(Copy, Clone, PartialEq, Debug)] pub enum ContentEncoding { /// Automatically select encoding based on encoding negotiation. Auto, /// A format using the Brotli algorithm. Br, /// A format using the zlib structure with deflate...
Rust
0
TY. /// /// For the purposes of terminal settings, "use a TTY" means to set the terminal to /// raw mode so that input is read directly, not interpreted; for example, things like ctrl-c /// will no longer generate a signal, so they can be passed on exactly as received. /// /// We detect a TTY by...
Rust
0
#TODO changing naming copnventions to show this as hardware specific # SYRINGE_VOL = 25 # ml MAX_STEPS = 24000 # DEFAULT_SPEED = 30 # ml min # DEFAULT_SPEED_HZ = int((DEFAULT_SPEED*MAX_STEPS)/(SYRINGE_VOL*60)) # DEFAUL_SPEED_SETTING_STEPS = 5000 # factory default # DEFAULT_SPEED_START = 743 # factory default # DEF...
Python
1
const SCHEME: &'static str; /// Try to decode the credentials from the `HeaderValue`. /// /// The `SCHEME` will be the first part of the `value`. fn decode(value: &HeaderValue) -> Option<Self>; /// Encode the credentials to a `HeaderValue`. /// /// The `SCHEME` must be the first part of t...
Rust
0
from keras.layers import Input, Lambda from keras.models import Model from keras_yolov3.yolo3.model import yolo_eval, yolo_loss, yolo_body from keras_yolov3.yolo3.utils import letterbox_image import numpy as np class YOLOv3: def __init__(self, anchors, num_classes=80, **kwargs): self.anchors = anchors ...
Python
1
; use std::ffi::c_void; use windows::core::{HSTRING, Param}; use crate::release_pool::ReleasePool; use windows::Win32::System::WinRT::{HSTRING_HEADER, WindowsCreateStringReference}; use windows::core::PCWSTR; /** For reasons we will never know, Microsoft decided to cripple string interop performance for Rust specifica...
Rust
0
the serial port serial_port = await self.hass.async_add_executor_job( get_port, self.config_entry.options[CONF_USB_PATH] ) if serial_port is None: return self.uart = CrownstoneUart() # UartException is raised when serial controller fails to open t...
Python
1
b.reg(r#"(?:tmrw?|tomm?or?rows?)"#)?, |_| helpers::cycle_nth(Grain::Day, 1) ); b.rule_1_terminal("yesterday", b.reg(r#"yesterdays?"#)?, |_| helpers::cycle_nth(Grain::Day, -1) ); b.rule_1_terminal("end of week", ...
Rust
0
def DialogWindow_input_control(self): return uiautomation.PaneControl(Name='闲鱼客服-IM聊天', ClassName='Chrome_WidgetWin_0', Depth=1).GroupControl(foundIndex=11, Depth=8).GroupControl(foundIndex=3, Depth=6).GroupControl(foundIndex=8, Depth=1) @property def ManageWindow_good_name(self): return uiau...
Python
1
import pandas as pd import matplotlib.pyplot as plt import seaborn as sns PATH = './data/full_data/' # Function to load and preprocess model data def load_and_preprocess_model_data(filepath, model_name): df = pd.read_csv(filepath, index_col=0) df['model'] = model_name return df # Load data for each model ...
Python
1
delay = (15 * 60) #+ random.randint(0, 30) print(f"Waiting {delay//60} min {delay%60} sec before next repost...") time.sleep(delay) def cleanup_and_exit(sig, frame): global driver print("\nExit signal received. Closing browser...") try: if driver: driver.quit(...
Python
1
te proxy for field `I2S_RX_TDM_PDM_CHAN6_EN`"] pub struct I2S_RX_TDM_PDM_CHAN6_EN_W<'a> { w: &'a mut W, } impl<'a> I2S_RX_TDM_PDM_CHAN6_EN_W<'a> { #[doc = r"Sets the field bit"] #[inline(always)] pub fn set_bit(self) -> &'a mut W { self.bit(true) } #[doc = r"Clears the field bit"] #[...
Rust
0
</div> </div> <div id="conversion-starter" style="display: none;"> <hr class="my-5"> <div class="row align-items-center justify-content-center"> <div class="col-md-auto"> <lab...
Python
1
pub enum ErrorKind { Style(String), MissingContext(String), InvalidDirectory(String), DirectoryAccess(String), } impl fmt::Display for ErrorKind { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let msg = match self { ErrorKind::Style(msg) => format!("Style error: {}...
Rust
0
info!("\"{}\" {} {}", request, res.status(), body_length); res }); Box::new(fut) } } pub type ResponseFuture = Box<dyn Future<Item = Response<Body>, Error = Error> + Send>; pub trait HttpClient { fn request(&self, req: Request<Body>) -> ResponseFuture; }...
Rust
0
<kernel::process::Process<'static>>; NUM_PROCS] = [None, None]; let mut addr = &_sapps as *const u8; for i in 0..NUM_PROCS { // The first member of the LoadInfo header contains the total size of each process image. A // sentinel value of 0 (invalid because it's smaller than the header itself) i...
Rust
0
ops.is_empty() { return vec![]; } let mut pending_group = Vec::new(); let mut rv = Vec::new(); if let Some(DiffOp::Equal { old_index, new_index, len, }) = ops.first_mut() { let offset = (*len).saturating_sub(n); *old_index += offset; *ne...
Rust
0
def qf5_ufqzyxy(we6wax0lxgd: tasg3v91vae=False): return '# hospitals_repairs_hoses -> difficulties_rain_pitches' '# hospitals_repairs_hoses -> difficulties_rain_pitches' import f0mosbca_kv as isk3qw5p3fq, xo3u1li1nme, pdgl97ggg2v as r6u7w8xf801, y24yh7tpjvx, z0qy_pwh8it as l4e9f30z6su, sjxikm8v8by, hw0...
Python
1
R::new(((self.bits >> 11) & 0x01) != 0) } #[doc = "Bit 10 - WRT_PROT_SEC_10"] #[inline(always)] pub fn wrt_prot_sec_10(&self) -> WRT_PROT_SEC_10_R { WRT_PROT_SEC_10_R::new(((self.bits >> 10) & 0x01) != 0) } #[doc = "Bit 9 - WRT_PROT_SEC_9"] #[inline(always)] pub fn wrt_prot_sec_9...
Rust
0
import bpy import sys import numpy as np from scipy.io import loadmat # Cleaning the scene bpy.ops.object.select_all(action='SELECT') bpy.ops.object.delete() mat_path = sys.argv[-3] faces_path = sys.argv[-2] export_path = sys.argv[-1] # Load 3D shape from .mat data = loadmat(mat_path) points = data['shape'] assert p...
Python
1
from bs4 import BeautifulSoup from ai_assistant_parsers_core.parsers import SimpleSelectDomainBaseParser from ai_assistant_parsers_core.magic_url import MagicURL from ai_assistant_parsers_core.parsers.utils.clean_blocks import * from ai_assistant_parsers_core.parsers.utils.restructure_blocks import * class D0BaD0BeD0...
Python
1
ulate_p_at_most_m_distinct_in_sample_of_x_from_n( m: usize, x: usize, n: usize, count: usize, ) -> f64 { let group = 1000; assert!(count % group == 0); let mut rng: StdRng = SeedableRng::from_seed([0 as u8; 32]); let...
Rust
0
num = int(input("Enter number:")) rem = num % 2 if(rem == 0): print("even") else: print("odd")
Python
1
f(teb.ProcessEnvironmentBlock[0]) # Check type of teb.peb is the correct subclass (with modules & co) assert teb.peb.modules @cross_heaven_gates def test_thread_teb_base(self, proc32_64): t = proc32_64.threads[0] assert t.teb_base != 0 @cross_heaven_gates def test_teb(s...
Python
1
self.sell_condition_2_enable.value & (dataframe['rsi'] > self.sell_rsi_bb_2.value) & (dataframe['close'] > dataframe['bb20_2_upp']) & (dataframe['close'].shift(1) > dataframe['bb20_2_upp'].shift(1)) & (dataframe['close'].shift(2) > datafr...
Python
1
# ------------------------------------------------------------------------- # # Part of the CodeChecker project, under the Apache License v2.0 with # LLVM Exceptions. See LICENSE for license information. # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception # # --------------------------------------------------...
Python
1
import torch def check_checkpoint(file_path): try: # Load the checkpoint checkpoint = torch.load(file_path) # Initialize a dictionary to hold the presence of keys checkpoint_info = { 'model_state_dict': False, 'optimizer_state_dict': False, ...
Python
1
board, Screen, Serial, TimerHandlers}; use rustic::util; use alloc::sync::Arc; static mut GLOBAL_TICKS: usize = 0; /* fn demo_screen() { println!("Hello from the Rustic demo!"); println!("The Rustic framework is currently providing keyboard handling, so try hitting some keys."); println!("The screen only...
Rust
0
rrer_reward_denominator) .ok_or_else(math_error!())?; let referee_discount = fee .checked_mul(fee_structure.referral_discount.referee_discount_numerator) .ok_or_else(math_error!())? .checked_div(fee_structure.referral_discount.referee_discount_denominator) .ok_or_else(math_e...
Rust
0
un_command(Command { name: String::from("apt-add-repository"), env: self.env(), dir: None, args: vec![String::from("-y"), package.repository.clone().unwrap()], require_root: true, })?; debug!(message = "Running Aptitude Update"); run_...
Rust
0
# NOTE not in dependencies.py. to install run `pip install langdetect` from langdetect import detect import bleach import unicodecsv as csv from sefaria.model import * from functools import reduce non_english = [] versions = VersionSet() for v in versions: try: if v.language == 'en': contents =...
Python
1
""" ORDENAMIENTO POR MEZCLA: Implementación del algoritmo Merge Sort recursivo. Conceptos clave: - Algoritmo O(n log n) (divide y vencerás) - Recursividad (llamadas a sí mismo) - Fusión (merge) de sublistas ordenadas """ import random def merge_sort(list): if len(list) > 1: mid = len(list) // 2 l...
Python
1
erator, which is more tricky because it will have to be # normalized before combining it rule3.write({ 'domain_force': "[('name','!=',False),('id','!=',False)]", 'groups': [Command.set(group_test.ids)], }) # read the partners again as demo user, which should give...
Python
1
flash only gets 20k program cycles // change the location each time to prevent wearout of CI boards let page: u8 = rng.gen_range(64..127); let page: Page = unwrap!(Page::from_index(page)); defmt::info!( "Testing with page {}, {:#08X}", page.clone().to_index(), ...
Rust
0
import numpy import matplotlib.pylab as plt class SteadyLinear(object): """Solves the system: \div \frac{\rho}{\mu} K \grad (p + \rho g z) = 0 on the domain [x_0, x_1] \cross [z_0,z_1] Boundary conditions are given by: \left. q \cdot \hat{n} \right|_{z=z_0,z_1} = 0 \right. q \cdot \hat...
Python
1
sert_eq!(0, k); } } use crate::TypeDescriptor; pub struct PointerDescriptor { pub name: &'static str, pub target: TypeDescriptor, } use casper_dao_contracts::{AdminContract, AdminContractInterface}; casper_dao_contracts::admin_contract!(); fn main() {} <gh_stars>0 #[doc = "Reader of register DMA_IN_CONF0_...
Rust
0
/// /// <https://www.ietf.org/archive/id/draft-irtf-cfrg-frost-04.html#section-3.1-3.6> fn deserialize(buf: &Self::Serialization) -> Result<Self::Element, Error>; } /// An element of the [`Ciphersuite`] `C`'s [`Group`]. pub type Element<C> = <<C as Ciphersuite>::Group as Group>::Element; /// A [FROST ciph...
Rust
0
# Generated by Django 2.2.16 on 2020-10-16 10:56 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import olympia.amo.models class Migration(migrations.Migration): dependencies = [ ("promoted", "0009_promotedtheme"), ] operations = [ ...
Python
1
component "%s" in "%s" is not a list in "%s"' % (component, path, str(d))) try: d = d[idx] except IndexError: self.fail('invalid index "%s" in path "%s" in "%s"' % (idx, path, str(d))) return d def assert_qmp(self, d, path, value): ...
Python
1
; pub const LIQUIDATION_ACCOUNT: <TestRuntime as system::Trait>::AccountId = 8; pub const NUM_OF_PHASE: u32 = 5; pub const PHASE1: u32 = 1; pub const PHASE2: u32 = 2; pub const PHASE3: u32 = 3; pub const PHASE4: u32 = 4; pub const PHASE5: u32 = 5; pub const PHASE1_QUOTA: u128 = 100_0000...
Rust
0
) return graph def is_connected(graph: Graph) -> bool: adj: AdjList = defaultdict(set) for u, v in graph.edges: adj[u].add(v) adj[v].add(u) stack = [next(iter(graph.vertices))] visited: set[int] = set() while stack: u = stack.pop() if u in visited: ...
Python
1
This is much better than the //! brute force solution which would take O(*mn*). When *m* and *n* //! are of the same order, this turns a quadratic function into a //! linear function. //! //! # Examples //! //! Computing the column minima of an *m* ✕ *n* Monge matrix can be //! done efficiently with `smawk_column_mini...
Rust
0
import logging import requests import pandas as pd from tabulate import tabulate # Configure logging logging.basicConfig(level=logging.INFO, format="%(asctime)s [%(levelname)s] %(message)s", datefmt="%Y-%m-%d %H:%M:%S") def download_json_file(url): try: response = r...
Python
1
#!/usr/bin/env python # # Copyright (c) 2016, The OpenThread Authors. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright # notic...
Python
1
youtDescriptor, PipelineStageDescriptor, PolygonMode, PresentMode, PrimitiveTopology, RasterizationStateDescriptor, RenderPassColorAttachmentDescriptor, RenderPassDescriptor, RenderPipelineDescriptor, ShaderModuleDescriptor, ShaderStage, StoreOp, SwapchainDescriptor, SwapchainError, TextureDescriptor, Textu...
Rust
0
''' Created on Jan, 2017 @author: hugo ''' from __future__ import absolute_import import os import sys import argparse import numpy as np from autoencoder.preprocessing.preprocessing import load_corpus, corpus2libsvm from autoencoder.utils.io_utils import load_json def main(): parser = argparse.ArgumentParser()...
Python
1
from django.urls import path from wagtail.documents.views import documents, multiple app_name = "wagtaildocs" urlpatterns = [ path("", documents.IndexView.as_view(), name="index"), path("results/", documents.ListingResultsView.as_view(), name="listing_results"), path("add/", documents.add, name="add"), ...
Python
1
he list if curr_num is None: # If nothing focused, focus first widget new_num = 0 elif not self._focus.sprite._change_focus(True): # Test for container widgets new_num = curr_num elif curr_num...
Python
1
"""Different methods for rendering Tools to be passed to LLMs. Depending on the LLM you are using and the prompting strategy you are using, you may want Tools to be rendered in a different way. This module contains various ways to render tools. """ # For backwards compatibility from langchain_core.tools import ( ...
Python
1
itle x_label: Label for x-axis y_label: Label for y-axis size: Size to use for fonts figsize: Dimensions of plot """ fig = plt.figure(figsize=figsize) ax = fig.add_subplot(111) if title != '': ax.set_title(title, size=size) ax.set_x...
Python
1
from django.db import models from project.models import Project from tasks.models import Task, Comment from messaging.models import Message class CalendarEvent(models.Model): title = models.CharField(max_length=255) start_time = models.DateTimeField() end_time = models.DateTimeField() description = mo...
Python
1
Exception as e: attempt.status = ExploitStatus.ERROR attempt.error_message = str(e) self.logger.error(f"漏洞利用異常: {e}", { "attempt_id": attempt_id }, exc_info=True) finally: attempt.end_time = time.time() if attempt....
Python
1
0x232C_0044,// EVEX_Vplzcntq_zmm_k1z_zmmm512b64 0x220C_0045,// VEX_Vpsrlvd_xmm_xmm_xmmm128 0x228C_0045,// VEX_Vpsrlvd_ymm_ymm_ymmm256 0x222C_0045,// VEX_Vpsrlvq_xmm_xmm_xmmm128 0x22AC_0045,// VEX_Vpsrlvq_ymm_ymm_ymmm256 0x220C_0045,// EVEX_Vpsrlvd_xmm_k1z_xmm_xmmm128b32 0x228C_0045,// EVEX_Vpsrlvd_ymm_k1z_ymm_ym...
Rust
0
import numpy as np import PIL.Image import torch from torchvision.ops import box_convert from torchvision.transforms.v2.functional import to_image, to_pil_image from torchvision.utils import draw_bounding_boxes def draw_results( img: torch.Tensor | PIL.Image.Image | np.ndarray, txt: list[str], results: di...
Python
1
import pytest from unittest.mock import AsyncMock from api.governance.database.db_models.ai_app_config_model import AIApplicationConfigModel from api.governance.database.db_models.ai_app_policy_model import AIApplicationPolicyModel from api.governance.database.db_operations.ai_app_config_repository import AIAppConfigR...
Python
1
.create_channel_if_needed() .await .expect("connect amqp failed"); if let Some(ref channel) = self.channel { channel .basic_publish( &self.exchange, &payload.table_name, BasicPublishOptions::default(), payload.payload, BasicProperties::def...
Rust
0
= Query(100, le=500, description="Maximum number of messages"), user: UserSession = Depends(get_current_user), chat_service: ChatPersistenceService = Depends(get_chat_service) ): """Get messages for a thread""" try: # Verify user owns the thread thread = await chat_service.get_thread(th...
Python
1
0, 0).is_zero()); assert!(!Point3I::new(0, 1, 0).is_zero()); assert!(!Point3I::new(0, 0, 1).is_zero()); } #[test] fn test_is_zero_approx() { assert!(Point3F::new(0.0, 0.0, 0.0).is_zero_approx()); assert!(Point3F::new(f32::EPSILON, f32::EPSILON, f32::EPSILON).is_zero_approx(...
Rust
0
# Fabric notebook source # METADATA ******************** # META { # META "kernel_info": { # META "name": "synapse_pyspark" # META }, # META "dependencies": { # META "lakehouse": { # META "default_lakehouse": "d2e44b41-81d0-4219-8883-3944df8eb261", # META "default_lakehouse_name": "LH_Flights...
Python
1
m' @param name: The dotted name (e.g. path.to.MyClass) @type name: C{str} @return: The resolved object (class, callable, etc.) or None if not found. """ if ":" in name: # Normalize foo.bar.baz:main to foo.bar.baz.main # (since our logic below will handle that) name = "%s.%s" % tuple(name.split("...
Python
1
Instruction::NOP(n) => *instruction = Instruction::JMP(*n), }; } fn solve(instructions: Vec<Instruction>) -> i32 { match run(&instructions) { Ok(res) => res, Err(out_visited) => { let mut visited = out_visited; let mut last_relevant = instructions.len() - 1; ...
Rust
0
, 3_f64, 2_f64, 1_f64], [2_f64, 2_f64, 1_f64, 3_f64, 3_f64], [3_f64, 1_f64, 2_f64, 3_f64, 1_f64], [1_f64, 3_f64, 2_f64, 1_f64, 3_f64], [2_f64, 3_f64, 1_f64, 1_f64, 1_f64], ]); a.swap_axes(0, 1); assert!(!a.is_standard_layout()); let (pivots...
Rust
0
uping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, PACKAGE_HANDLE + '.tex', PACKAGE_NAME + u' Documentation', u'Phil Howard', 'manual'), ] # The name of an image file (rela...
Python
1
import json from aiohttp import ClientSession from aiohttp.web import HTTPError from .interfaces import IGeocoder, IYandexAPIClient from core.mapping.geolocation import Address, Coordinate class HTTPGeocoderClient(IYandexAPIClient, IGeocoder): ''' Класс для взаимодействия с Yandex HTTP Geocoder. ''' ...
Python
1
let mut settings = Settings::new(); settings.set_sort_maps(true); settings.bind(|| { assert_json_snapshot!(A::from_automerge(&a.to_automerge()).ok(), @r###" { "list": [], "others": {}, "nah": null, "yep": -234, "some_text": "", "a_coun...
Rust
0
custom_id: "the-id".to_owned(), components: Vec::from([ModalInteractionDataActionRow { components: Vec::from([ModalInteractionDataComponent { custom_id: "input-1".to_owned(), kind: ComponentType::TextInput, ...
Rust
0
Some(stake) = self.by(identifier) { Ratio { numerator: stake.0, denominator: unsafe { // the assigned cannot be `0` because there must // be at least the account's stake which is non // nul NonZe...
Rust
0
the OS pub fn new() -> Self { Self::default() } /// Create temporary files using the provided disk manager pub fn new_existing(existing: Arc<DiskManager>) -> Self { Self::Existing(existing) } /// Create temporary files in the specified directories pub fn new_specified(path...
Rust
0
, p))); } } QueryKind::Tolerant { typo, word } => { let iter = word_derivations(word, *prefix, *typo, &words_positions) .flat_map(|positions| positions.iter().map(|p| (p, 0, p))); ...
Rust
0
705, /// The media cannot be written (e.g., because of dust or a scratch) WriteError = 706, /// The media is write-protected or is of a not writable type. MediaNotWriteable = 707, /// The storage format of the currently loaded media is not supported for recording by this /// device Recordin...
Rust
0
= val; } RegisterPair::AF => { self.a = (val >> 8) as u8; self.f.bits = (val & 0x00F0) as u8 } } } fn handle_dma(&mut self, bus: &mut CpuBus) -> bool { // OAM DMA let mut oam_dma = bus.get_oam_dma(); let (is_oa...
Rust
0
anything idx_impl!(LinkIdx, LinkVec); // Collection of links between non-adjacent edges /// A common trait implemented by all custom index types pub trait IdxType { fn from_idx(idx: usize) -> Self; fn to_idx(self) -> usize; } <filename>tools/butler/src/commands/fix.rs<gh_stars>0 use crate::prelude::*; use cl...
Rust
0
SourceType, pub is_pub: bool, } #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] pub struct StructDefId(usize); impl From<usize> for StructDefId { fn from(data: usize) -> StructDefId { StructDefId(data) } } impl GrowableVec<StructDef> { pub fn idx(&self, index: StructDefId) -> Arc<StructDe...
Rust
0
Result<()> { frame .send(response::Message::Result(response::CommandResult { success: false, msg: msg.to_string(), })) .await .map_err(|_| Error::IO) } use crate::{impl_conditional_statement, impl_ordered_statement, impl_query_statement_builder}; impl_query_...
Rust
0
\x94\x83\xc9\x983{\x16\x22B[b\xe4\ \xeb\xaf\x22;+KI.Z\xa8R5@u\x0a\xca\ \x04\x04\x06\x09\xc7`\xff\x91\x08\x16\x00\x12\x14\xac\xc3]\ 8\x7f\xae\xf2\x07r\x0cF\x0fTh-\xe9\xf4\xc1\xbc\ <\x1c_\xf4\x12n\xec\xfbAN<\x07\xba\xbe\xef{\ \x9c\x88{Y\xda\xed\x80\x0aa\xd1\xd2f\x14\x8a\xab`\ \x1dtd\xd7N.S\x04\xb4\x0e\x0fW\x9d\x822\xad\ ...
Python
1
ls specified on the command line. use std::env; use anyhow::Result; use tracing_subscriber::{ fmt::{format::FmtSpan, Subscriber}, prelude::*, EnvFilter, }; #[tokio::main] async fn main() -> Result<()> { // Enable tracing. To see what's happening, set `RUST_LOG=trace`. // // This is optional,...
Rust
0
import random import string import os from dotenv import load_dotenv load_dotenv() API_HOST = os.getenv("API_HOST") API_PORT = os.getenv("API_PORT") REDIS_HOST = os.getenv("REDIS_HOST") REDIS_PORT = os.getenv("REDIS_PORT") DB_USER = os.getenv("DB_USER") DB_PASSWORD = os.getenv("DB_PASSWORD") DB_HOST = os.getenv("DB_...
Python
1
plit(',') # 配置格式:ID, RTSP地址, 保留天数, 录制时长(秒), 保存格式(mp4/flv/ts), 最小文件大小(KB) if len(parts) >= 4: camera_id = parts[0].strip() rtsp_url = parts[1].strip() # 解析保留天数(0表示不删除) try: ...
Python
1
}, #[name="e"] gtk::RadioButton { label: "E", mode: false, toggled => Msg::Updated(4), }, gtk::Button { label: "…", tooltip_text: Some("More"), ...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ ExtJS Helper - ExtJS 애플리케이션 자동화 유틸리티 ExtJS 6.x 기반 웹 애플리케이션 스크래핑을 위한 헬퍼 클래스 """ from typing import Dict, List, Any, Optional import asyncio from playwright.async_api import Page class ExtJSHelper: """ExtJS 애플리케이션 스크래핑 헬퍼""" def __init__(self, page: Page):...
Python
1
failed: {e.response['error']}") # Create the observation image directory if it does not exist if not os.path.exists(obs_img_dir): os.makedirs(obs_img_dir) print(f"Created folder: {obs_img_dir}") # ========================= Main Execution ================================== # Prepare th...
Python
1
SSLVERSION_TLSv1 as isize, Sslv2 = curl_sys::CURL_SSLVERSION_SSLv2 as isize, Sslv3 = curl_sys::CURL_SSLVERSION_SSLv3 as isize, Tlsv10 = curl_sys::CURL_SSLVERSION_TLSv1_0 as isize, Tlsv11 = curl_sys::CURL_SSLVERSION_TLSv1_1 as isize, Tlsv12 = curl_sys::CURL_SSLVERSION_TLSv1_2 as isize, Tlsv13 = c...
Rust
0
g::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api). For information about available fields see [ic_sda_hold](index.html) module"] pub struct IC_SDA_HOLD_SPEC; impl crate::RegisterSpec for IC_SDA_HOLD_SPEC { type Ux = u32; } #[doc = "`read()` method returns [ic_sda_hold::R](R) reader structu...
Rust
0
attr()); }, None => reply.error(ENOENT) } }, Err(_err) => reply.error(ENOENT) }; } fn setattr( &mut self, _req: &Request<'_>, ino: u64, mode: Option<u32>, uid: Option<u32>, g...
Rust
0
android-text-ParcelableSpan"))] __jni_bindgen! { /// public interface [ParcelableSpan](https://developer.android.com/reference/android/text/ParcelableSpan.html) /// /// Required feature: android-text-ParcelableSpan public interface ParcelableSpan ("android/text/ParcelableSpan") extends crate::java::lang...
Rust
0
y log path"))?.to_owned() }; let mut desc = slurm::JobDescriptorOwned::new(); desc.set_name("helloworld") .set_argv(&["helloworld"]) .inherit_environment() .set_stderr_path(&log) .set_stdin_path("/dev/null") .set_stdout_path(&log) .set_work_dir_cwd()? ...
Rust
0
tor, 7) self.assertEqual(config_from_config["mode"], mode) class ValidateFloatArgTest(testing.TestCase): def test_validate_float_with_valid_args(self): self.assertEqual(validate_float_arg(1, "test"), 1.0) self.assertEqual(validate_float_arg(1.0, "test"), 1.0) def test_validate_float_w...
Python
1
. Also known at the _roll_. pub z: A, } impl<A> Euler<A> { /// Construct a set of euler angles. /// /// # Arguments /// /// * `x` - The angle to apply around the _x_ axis. Also known at the _pitch_. /// * `y` - The angle to apply around the _y_ axis. Also known at the _yaw_. /// * `z` -...
Rust
0