text
string
label_name
string
labels
int64
# we are gonna use moviepy i learned from it docs how to basically use it import os import random from moviepy import * # Define paths MEME_DIR = "C:/Users/DELL/Desktop/learning-python-/Mega project 1 - MEME-BOT/memes" MUSIC_DIR = "C:/Users/DELL/Desktop/learning-python-/Mega project 1 - MEME-BOT/musics" OUTPUT_DIR = "...
Python
1
# Import modules import configparser import mido import mido.backends.rtmidi import os import os.path import sys from tabulate import tabulate executable_path = "nuked-sc55" arguments = "" config = configparser.ConfigParser() # Read INI file if it exists if os.path.isfile("nuked-port-selector.ini"): config.read("nu...
Python
1
musi = { # Bollywood Songs "tum hi ho": "https://www.youtube.com/watch?v=Umqb9KENgmk", "apna bana le": "https://www.youtube.com/watch?v=Ghn6e_9VjEg", "kesariya": "https://www.youtube.com/watch?v=BddP6PYo2gs", "tere pyaar mein": "https://www.youtube.com/watch?v=OCrToxWn3NQ", "pasoori": "https://w...
Python
1
import os from pathlib import Path # 常见的编码格式列表,按尝试顺序排列 ENCODING_CANDIDATES = ['utf-8', 'gbk', 'latin-1'] def fix_file_encoding(file_path): """ 尝试用多种编码格式读取文件,并将其统一重写为 UTF-8。 这能修复因编码问题(如GBK)导致的工具崩溃,同时保留中文等合法字符。 """ for encoding in ENCODING_CANDIDATES: try: # 尝试用当前编码格式读取 ...
Python
1
dims.0 as i32, image_dims.1 as i32, 0, gl::RGBA, gl::UNSIGNED_BYTE, image.into_rgba8().as_raw().as_ptr() as *const std::os::raw::c_void, ); gl::TexParameteri(texture_type, gl::TEXTURE_MIN...
Rust
0
0 aggressive_factor = 10.0 # КАРДИНАЛЬНО агрессивные рекомендации для достижения реальных пределов recommendations = { 'global_limit': { 'conservative': int(cpu_cores * 15 * conservative_factor), # 6 * 15 * 3.0 = 270 'optimal': int(cpu_c...
Python
1
, /// European Monetary Unit (E.M.U.-6) #[serde(rename = "956")] N956, /// European Unit of Account 9 (E.U.A.- 9) #[serde(rename = "957")] N957, /// European Unit of Account 17 (E.U.A.- 17) #[serde(rename = "958")] N958, /// Palladium #[serde(rename = "964")] N964, /// Platinum #[serde(rename = "962")] N...
Rust
0
t('access_token') app_state['user_email'] = data.get('email') app_state['is_admin'] = data.get('is_admin', False) return gr.update(visible=False), gr.update(visible=True) # Login gizle, main göster else: print(f"❌ Token doğrul...
Python
1
format!( "{}_{}-{}", self.summary.name().group(), self.summary.name().name(), self.hash ) } } /// Information about the build of library that is available somewhere in the file system. #[derive(Debug)] pub struct Binary { // The built version of the...
Rust
0
import tkinter as tk from tkinter import ttk import awesometkinter as atk # our root root = tk.Tk() root.config(background=atk.DEFAULT_COLOR) # select tkinter theme required for things to be right on windows, # only 'alt', 'default', or 'classic' can work fine on windows 10 s = ttk.Style() s.theme_use('default') # 3...
Python
1
import os import cv2 import sys import os.path as osp import numpy as np import time import torch import torchreid from scripts.mydatasets import MTA_reid_new torchreid.data.register_image_dataset('MTA_reid_new', MTA_reid_new) import scripts.compute_weight_distance as cwd from scripts.compute_weight_distance import com...
Python
1
".as_bytes(), 250.13); t.put("seashells".as_bytes(), 50.13); // delete middle t.delete("seashell".as_bytes()); assert_eq!(None, t.get("seashell".as_bytes())); assert_eq!(Some(&120.93), t.get("sea".as_bytes())); assert_eq!(Some(&150.13), t.get("seafood".as_bytes())); assert_eq!(Some(&50.13), t.get("seashe...
Rust
0
authorizations: Default::default(), } ); test.index.write().apply({ srv.spec.pod_selector = Some(("label", "value")).into_iter().collect(); srv }); assert!(rx.has_changed().unwrap()); assert_eq!(*rx.borrow(), test.default_server()); } <reponame>montekki/rust-libp2p<filename...
Rust
0
# Definition for singly-linked list. class ListNode(object): def __init__(self, val=0, next=None): self.val = val self.next = next class Solution(object): def reorderList(self, head): """ :type head: Optional[ListNode] :rtype: None Do not return anything, modify head in-p...
Python
1
be modified after cache creation. /// A future version may support to modify it. pub fn policy(&self) -> Policy { let mut policy = self.inner.segments[0].policy(); policy.set_max_capacity(self.inner.desired_capacity); policy.set_num_segments(self.inner.segments.len()); policy ...
Rust
0
t(X) l = loss(y_hat, y) l.backward() optimizer.step() with th.no_grad(): metric.add(l * X.shape[0], accuracy(y_hat, y), X.shape[0]) timer.stop() train_l = metric[0] / metric[2] train_acc = metric[1] / metric[2] ...
Python
1
from asyncio import Queue from collections import defaultdict from typing import Any class PubSub: def __init__(self): self._queues: dict[str, set[SubscribedQueue]] = defaultdict(set) def subscribe(self, topic: str): queue = SubscribedQueue(self, topic) self._queues[topic].add(queue) ...
Python
1
#[inline(always)] pub fn adc_dcctl6_cim_once(self) -> &'a mut W { self.variant(ADC_DCCTL6_CIMW::ADC_DCCTL6_CIM_ONCE) } #[doc = "Hysteresis Always"] #[inline(always)] pub fn adc_dcctl6_cim_halways(self) -> &'a mut W { self.variant(ADC_DCCTL6_CIMW::ADC_DCCTL6_CIM_HALWAYS) } ...
Rust
0
shCap: self.dash_cap as u32, lineJoin: self.line_join as u32, miterLimit: self.miter_limit, dashStyle: self.dash_style as u32, dashOffset: self.dash_offset, } } } use std::collections::HashSet; use bevy::{ diagnostic::{FrameTimeDiagnosticsPlugin, LogDiagn...
Rust
0
_and_generate(account, password): folder = FIT_FOLDER downloaded_ids = get_downloaded_ids(folder) coros = Coros(account, password) await coros.init() activity_ids = await coros.fetch_activity_ids() print("activity_ids: ", len(activity_ids)) print("downloaded_ids: ", len(downloaded_ids)) ...
Python
1
pIROKx3F7qCttYIFGh5dXNzFzID7u8vKykA8Uejf7XXz//S4nKvW//ofS/ QastYw== """) ##file distutils-init.py DISTUTILS_INIT = convert(""" eJytV92L4zYQf/dfMU0ottuse7RvC6FQrg8Lxz2Ugz4si9HacqKuIxlJ2ST313dG8odkO9d7aGBB luZLv/nNjFacOqUtKJMIvzK3cXlhWgp5MDBsqK5SNYftsBAGpLLA4F1oe2Ytl+9wUvW55TswCi4c KibhbFDSglXQCFmDPXIwtm7FawLRbwtPzg2T9g...
Python
1
g, suffix .iter() .cloned() .chain(Some(child.value.clone())) .collect(), child, ) }) .collect() ...
Rust
0
# Copyright (c) 2022-2024, The Isaac Lab Project Developers. # All rights reserved. # # SPDX-License-Identifier: BSD-3-Clause from omni.isaac.lab.markers import VisualizationMarkersCfg from omni.isaac.lab.markers.config import CONTACT_SENSOR_MARKER_CFG from omni.isaac.lab.utils import configclass from ..sensor_base_c...
Python
1
import gin from dataclasses import dataclass from typing import Collection, Optional, Tuple, List, Callable, Dict @gin.configurable @dataclass class CompetitionConfig: """ Config competition simulation Args: measure_names (list[str]): list of names of measures aggregation_type (str): agg...
Python
1
Manager<T>>() } } <filename>cnn/src/main/rs/Test.rs #pragma version(1) #pragma rs java_package_name(layers) rs_allocation In_Blob; rs_allocation Out_Blob; float num; float __attribute__((kernel)) compute(float4 in, uint32_t x) { float sum = 0; for(int i=0;i<100;i++){ float4 s = (in + i) * in; ...
Rust
0
import AppKit from PyObjCTools.TestSupport import TestCase, min_os_level class TestNSToolbarItemGroup(TestCase): def test_enum_types(self): self.assertIsEnumType(AppKit.NSToolbarItemGroupControlRepresentation) self.assertIsEnumType(AppKit.NSToolbarItemGroupSelectionMode) def test_constants(se...
Python
1
unwrap()); assert_eq!(parse("a + (b - c)", &model).unwrap(), parse("(a + b) - c", &model).unwrap()); assert_eq!(parse("a + b - c)", &model).unwrap(), parse("a - c + b", &model).unwrap()); assert!(parse("a + b", &model) != parse("a - b", &model)); } ...
Rust
0
32(20.0), ChannelValue::Decimal32(20.0), ChannelValue::Decimal32(10.0), ], vec![], ]; let mod0: &dyn ProcessModbusTcpData = &m0; let mod1: &dyn ProcessModbusTcpData = &m1; let addr_out_0 = to_bit_address(ADDR_PACKED_PROCESS_OUTPUT...
Rust
0
id VARCHAR PRIMARY KEY, description TEXT, data TEXT NOT NULL)", [], )?; } if !tbl_stmt.exists(["metafile"])? { conn.execute( "CREATE TABLE metafile ( feed VARCHAR PRIMARY KEY, last_modified_date VARCHAR NOT...
Rust
0
# Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import pytest from pytorch_layer_test_class import PytorchLayerTest class TestMatMul(PytorchLayerTest): def _prepare_input(self, m1_shape=(2, 2), m2_shape=(2, 2), bias_shape=None): import numpy as np if bias_shape ...
Python
1
File> { Ok(NamedFile::open("./assets/index.html")?) } pub fn routes(cfg: &mut web::ServiceConfig) { // Setup and configure all of our routes cfg.service(Files::new("/public", "./assets/public")) .service( web::scope("/api") // Our healthchecks .service(he...
Rust
0
}, 'loggers': { 'django': { 'handlers': ['console'], 'level': 'INFO', 'propagate': True, }, 'django.request': { # This is the logger for Django's request logging 'handlers': ['console', 'file'], 'level': 'DEBUG', 'prop...
Python
1
e = torch.tensor(viewpoint_camera.time).to(means3D.device).repeat(means3D.shape[0], 1) # If precomputed 3d covariance is provided, use it. If not, then it will be computed from # scaling / rotation by the rasterizer. scales = None rotations = None cov3D_precomp = None if pipe.compute_cov3D_pyth...
Python
1
from datetime import datetime import pytz from django.conf import settings from django.db.models import Q from oscar.core.loading import get_model from ecommerce.courses.constants import CertificateType from ecommerce.enterprise.api import get_enterprise_id_for_user from ecommerce.enterprise.utils import get_enterpri...
Python
1
-> &BiMap<String, WordIdInt> { &self.word_store } fn str_for_word_id(&self, id: &WordIdInt) -> &str { self.word_store .get_by_right(id) .expect("only valid word ids are created") } fn str_for_pos_id(&self, id: &PosIdInt) -> &str { self.tag_store ...
Rust
0
from setuptools import setup, find_packages setup( name="json-module", version="0.1.0", packages=find_packages(), install_requires=[ # List your dependencies here, if any ], author="AmineGm73", author_email="aminegazit30@gmail.com", description="A module for JSON operations", ...
Python
1
1) t = bboxes[:, :, 1].view(batch, 1, K, 1).expand(batch, num_joints, K, 1) r = bboxes[:, :, 2].view(batch, 1, K, 1).expand(batch, num_joints, K, 1) b = bboxes[:, :, 3].view(batch, 1, K, 1).expand(batch, num_joints, K, 1) mask = (hm_kps[..., 0:1] < l) + (hm_kps[..., 0:1] > r) + \ (h...
Python
1
ter(_) => (), SubCommand::ProposeToAddOrRemoveDataCenters(_) => (), SubCommand::ProposeToUpdateNodeRewardsTable(_) => (), SubCommand::ProposeToUpdateUnassignedNodesConfig(_) => (), SubCommand::ProposeToAddNodeOperator(_) => (), SubCommand::ProposeToRemoveNodeO...
Rust
0
ata: Some(raw), signatures: signatures.into_iter().map(|sig| sig.into()).collect(), ..Default::default() }; let indexed_txn = IndexedTransaction::from_raw(txn).ok_or("invalid transaction")?; let ref mut manager = ctx.data_unchecked::<Arc<AppContext>>().manager.write().un...
Rust
0
public_key) } } } } #[cfg(target_arch = "wasm32")] // If the TP will be compiled to WASM to be run as a smart contract in Sabre this apply method will be // used as wrapper for the handler apply method. For Sabre the apply must return a boolean fn apply(request: &TpProcessRequest, context: &mu...
Rust
0
from aiogram import Bot, Dispatcher # мы импортируем два основополагающих объекта из import aiogram from aiogram.fsm.storage.memory import MemoryStorage # aiogram import asyncio as asy # для запуска асинхронных функций мы пользуемся asyncio BOT_TOKEN = "6353873033:AAHXjfqGRdMatA9n_zWwew2VhHfBbhIhmfA" # мы закрепляем ...
Python
1
(Copy, Clone, PartialEq)] pub enum SegLvl { SEG_LVL_ALT_Q = 0, /* Use alternate Quantizer .... */ SEG_LVL_ALT_LF_Y_V = 1, /* Use alternate loop filter value on y plane vertical */ SEG_LVL_ALT_LF_Y_H = 2, /* Use alternate loop filter value on y plane horizontal */ SEG_LVL_ALT_LF_U = 3, /* Use alternate lo...
Rust
0
from sqlalchemy.ext.asyncio import AsyncSession from typing import Dict, List, Optional, Any from datetime import datetime from ..repository.doctor import DoctorRepository from ..repository.appointment import AppointmentRepository from ..schemas.appointment import AppointmentRequest, AppointmentUpdateRequest from .sch...
Python
1
const UNSPECIFIED: u8 = 0u8; const VALUE_RANGE: u8 = 1u8; const DISCRETE_VALUES: u8 = 2u8; } #[derive(Debug, AperCodec)] #[asn(type = "SEQUENCE-OF", sz_extensible = false, sz_lb = "1", sz_ub = "16")] pub struct Alt_RAB_Parameter_GuaranteedBitrates(Vec<Alt_RAB_Parameter_GuaranteedBitrateList>); #[derive(De...
Rust
0
from __future__ import annotations import math from collections.abc import Callable def line_length( fnc: Callable[[float], float], x_start: float, x_end: float, steps: int = 100, ) -> float: """ Approximates the arc length of a line segment by treating the curve as a sequence of linear l...
Python
1
import cv2 import numpy as np # Global variables polygon_points = [] # Read your video file video_path = r'C:\Users\Admin\Desktop\computervision videos/carsvid.mp4' cap = cv2.VideoCapture(video_path) # Callback function for mouse events def mouse_callback(event, x, y, flags, param): global polygon_points if...
Python
1
(older_timestamp, 1); assert!(older_ts_x_value < anchor_x_value); } #[test] fn test_identical_timestamp_should_have_same_x_value() { setup_fake_clock_to_prevent_substract_overflow(); let anchor_timestamp = Timestamp::now() - Duration::from_secs(random::<u8>() as u64); let ...
Rust
0
from typing import Tuple from brax import jumpy as jp from brax.physics.base import P, QP from brax.physics.actuators import Angle def compute_pd_control(target_angles, current_angles, current_velocities, Kp, Kd): error = target_angles - current_angles error_derivative = -current_velocities control_outpu...
Python
1
erator_SVDF, tflite::ops::micro::Register_SVDF() ); }); self } /// Use the CONV_2D operator in this op resolver pub fn conv_2d(mut self) -> Self { self.check_then_inc_len(); let inner_ref = &mut self.inner; cpp!(unsafe [inner_ref as "tfli...
Rust
0
# -*- coding: utf-8 -*- from __future__ import print_function __author__= "Luis C. Pérez Tato (LCPT) and Ana Ortega (AO_O)" __copyright__= "Copyright 2015, LCPT and AO_O" __license__= "GPL" __version__= "3.0" __email__= "l.pereztato@ciccp.es ana.ortega@ciccp.es" import geom pol1=geom.Polygon2d([geom.Pos2d(0,0), geom...
Python
1
print(f"50%: {stats['50%']:.2f}") print(f"75%: {stats['75%']:.2f}") print(f"Max: {stats['max']:.2f}") print(f"Std: {stats['std']:.2f}") # Print the date when max value occurred max_date = agg_df.loc[agg_df[metric] == stats['max'], 'date'].iloc...
Python
1
_generic_round_function_conditional< E: Engine, CS: ConstraintSystem<E>, P: HashParams<E, RATE, WIDTH>, const RATE: usize, const WIDTH: usize, >( cs: &mut CS, state: &mut [LinearCombination<E>; WIDTH], execute: &Boolean, params: &P, ) -> Result<(), SynthesisError> { let mut old_s...
Rust
0
list() X = array.multi_index[:, indices][""] X = scipy.sparse.csc_matrix(X) var = pd.DataFrame(index=var_keys) if len(obs_keys) > 0: obs = pd.DataFrame() _obs_keys = [] for key in obs_keys: if key == "index": ...
Python
1
(self) -> pd.DataFrame: """Forecast values for the conditional mean of the process""" return self._mean @property def variance(self) -> pd.DataFrame: """Forecast values for the conditional variance of the process""" return self._variance @property def residual_variance(...
Python
1
t('S8=', angular_kernels.s8) print('S9=', angular_kernels.s9) print('S10=', angular_kernels.s10) print('S11=', angular_kernels.s11) print('S12=', angular_kernels.s12) print('S13=', angular_kernels.s13) print('S14=', angular_kernels.s14) print('S15=', angular_kerne...
Python
1
#[cfg(test)] mod tests { use super::*; use blake3::Hasher as Blake3; #[test] fn test_hash_chain() { use blake3::Hasher as Blake3; let hash_chain_output = hash_chain::<Blake3>(b"01234567890123456789012345678901", 3); assert_eq!( hex::encode(hash_chain_output), ...
Rust
0
test] fn test_content() { let mut table = DirectoryContent::new(1); assert_eq!(table.as_raw(), [0; EXPECTED_FILE_INFO_SIZE * 1]); assert_eq!( table.push(FileInfo::try_from_path_and_index("./data/TEST.TXT", 0x1234).unwrap()), Ok(()), ); assert_eq!( ...
Rust
0
r) magW = vtkMagnifierWidget() magW.SetInteractor(iRen) magW.SetRepresentation(magRep) magW.AddObserver("WidgetValueChangedEvent",ChangeMag) # Handle playback of events recorder = vtkInteractorEventRecorder() recorder.SetInteractor(iRen) #recorder.SetFileName("record.log") #recorder.On() #recorder.Record() recorder.R...
Python
1
e".to_string(), "a")) ); assert!(super::field_name().parse("my_field_name").is_err()); assert!(super::field_name().parse(":a").is_err()); assert!(super::field_name().parse("-my_field:a").is_err()); assert_eq!( super::field_name().parse("_my_field:a")?, ("_...
Rust
0
path) .map_err(|e| exceptions::PyIOError::new_err(e.to_string())) } /// Serialize a Time-Space coverage into a JSON file /// /// # Arguments /// /// * ``index`` - The index of the Time-Space coverage /// to serialize. /// * ``path`` - the path of the output file #[pyfn(m...
Rust
0
ponse::InternalServerError().body(error.to_string()), } } /// Object used to alter Swagger UI settings. /// /// # Examples /// /// Simple case is to create config directly from url that points to the api doc json. /// ```rust /// # use utoipa_swagger_ui::Config; /// let config = Config::from("/api-doc.json"); /// ...
Rust
0
raise ValueError(f"n must be positive. Got {n}") init_vals = jnp.atleast_1d(init_vals) n_inits = init_vals.shape[0] if not n_inits == self.differencing_order: raise ValueError( "Must have exactly as many " "initial difference values as " ...
Python
1
entity => HeaderValue::from_str("identity").unwrap(), } } } fn select_encoding(headers: &HeaderMap) -> Result<Option<Encoding>> { let mut preferred_encoding = None; let mut max_qval = 0.0; for (encoding, qval) in accept_encodings(headers)? { if qval > max_qval { preferred_e...
Rust
0
X-License-Identifier: MIT mod storage_blocks_genesis_init_additional_data_put_state; pub use storage_blocks_genesis_init_additional_data_put_state::*; mod storage_blocks_genesis_init_additional_data_put_actions; pub use storage_blocks_genesis_init_additional_data_put_actions::*; mod storage_blocks_genesis_init_addit...
Rust
0
#[test] fn test_sample() { let graph = Graph::from(SAMPLE_DATA); let path = PathBuf::new().join("debug").join("day12-sample.dot"); save_graph_to_disk(&graph, &path); assert_eq!(graph.find_paths().len(), 10); } #[test] fn test_sample_2() { let graph = Graph...
Rust
0
.insert( "other".to_string(), Value::String("value".to_string()).into(), ); Annotated::from(map) }, })); assert_eq_dbg!(context, serde_json::from_str(json).unwrap()); assert_eq_str!(json, serde_json::to_string_p...
Rust
0
from app.setup.postgres import (create_permissions_table, create_users_table) def setup_tables(): create_permissions_table() create_users_table()
Python
1
from fastapi import FastAPI, HTTPException from pydantic import BaseModel from typing import List, Optional from crew import crew, analyze_communication_task, summarize_analyzer_output_task, provide_feedback_task from tools.custom_tool import AudioTranscriberTool app = FastAPI() class UserInput(BaseModel): messag...
Python
1
en_rw(path: &Path) -> Result<File> { OpenOptions::new() .read(true) .write(true) .create(true) .open(path) .context(format!("cannot open {:?}", path)) } <reponame>s32k-rust/s32k144.rs #[doc = r" Value read from the register"] pub struct R { bits: u8, } #[doc = r" Value to...
Rust
0
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
Python
1
feature(test)] extern crate bincode; extern crate bn; extern crate rand; extern crate test; use bn::*; use bincode::SizeLimit::Infinite; use bincode::rustc_serialize::{decode, encode}; const SAMPLES: usize = 30; macro_rules! benchmark( ($name:ident, $input:ident($rng:ident) = $pre:expr; $post:expr) => ( ...
Rust
0
SigLIP_MODEL_CONFIG = { "SigLIPBaseP16": { "patch_size": 16, "vision_hidden_dim": 768, "vision_num_layers": 12, "vision_num_heads": 12, "vision_intermediate_dim": 3072, "vocabulary_size": 32000, "embed_dim": 768, "text_hidden_dim": 768, "text_n...
Python
1
# 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 agreed to in writing, s...
Python
1
mod config; mod incoming; use bot::Bot; use config::{CONF_PATH, BotConfig}; use futures::StreamExt; use incoming::command_parser; use telegram_bot::*; #[tokio::main] async fn main() -> Result<(), Error> { let config: BotConfig = confy::load_path(CONF_PATH).unwrap(); let bot = Bot::new(config); // Fetc...
Rust
0
l'], ndmin=2)[:, -1] aps[:, i] = cls_result['ap'] num_gts[:, i] = cls_result['num_gts'] label_names = class_name if not isinstance(mean_ap, list): mean_ap = [mean_ap] header = ['class', 'gts', 'dets', 'recall', 'ap'] for i in range(num_scales): if scale_ranges is not N...
Python
1
.clone_ref(py), equals_v.clone_ref(py)), K::At => (at.clone_ref(py), at_v.clone_ref(py)), K::BracketL => (bracket_l.clone_ref(py), bracket_l_v.clone_ref(py)), K::BracketR => (bracket_r.clone_ref(py), bracket_...
Rust
0
=== // =================== /// Texture downloaded from URL. This source implies asynchronous loading. #[derive(Debug)] pub struct RemoteImageData { /// An url from where the texture is downloaded. pub url: String, } // === Instances === impl<I, T> StorageRelation<I, T> for RemoteImage { type Storage = R...
Rust
0
mpoundQueryFilterDeviceVulnerability: """Create an instance of ValidatingCompoundQueryFilterDeviceVulnerability from a dict""" if obj is None: return None if not isinstance(obj, dict): return ValidatingCompoundQueryFilterDeviceVulnerability.parse_obj(obj) _obj =...
Python
1
ed<Vec<Path>>, pub(super) added_roots: Pooled<Vec<Path>>, pub(super) removed_roots: Pooled<Vec<Path>>, } impl Update { fn new() -> Update { Update { data: PDPAIR.take(), formula: PDPAIR.take(), on_write: PDPAIR.take(), locked: PATHS.take(), ...
Rust
0
end column of the supplied flat capabilities table. The value corresponding to total is the total count of functions in the given module, and the value associated to the other keys is the count of functions that support that particular backend. The bool is False if the calculation may be...
Python
1
- 1; let mut tip_block_hash = None; let mut tip_block_height = None; // Apply unstable blocks to the UTXO set. for (i, block) in main_chain.iter().enumerate() { let block_height = state.height + (i as u32); let confirmations = main_chain_height - block_height + 1; if confirmati...
Rust
0
BUS Entry Pt. (32bit ARM branch opcode, eg. "B joy_start") /// #[derive(Serialize, Deserialize, Clone, Debug)] pub struct CartridgeHeader { // rom_entry_point: Addr, pub game_title: String, pub game_code: String, pub maker_code: String, pub software_version: u8, pub checksum: u8, // ram_entr...
Rust
0
# Write a function that takes a floating point number representing an angle between 0 and 360 degrees and returns a string representing that angle in degrees, minutes, and seconds. You should use a degree symbol (°) to represent degrees, a single quote (') to represent minutes, and a double quote (") to represent secon...
Python
1
#!/usr/bin/env python3 # Create the codemirror_language_list.py file: list of all languages # supported by codemirror # python3 mk-codemirror-language-list.py > codemirror_language_list.py import urllib.request from bs4 import BeautifulSoup import re, sys, os from django.conf import settings os.environ['DJANGO_SE...
Python
1
{ body: vec![] } } }; // let action_result = do_flight_action.await?; Ok(RawResponse::new( Box::pin(tokio_stream::once(Ok(action_result))) as FlightStream<FlightResult>, )) } type ListActionsStream = FlightStream<ActionType>; async fn list_actions(...
Rust
0
dr: String, }, // Bridge functions // Users use this to transfer to eth TransferToMaticAddr { recipient: String, coin: String, amount: Uint128, }, // Admin use this to give users their transfered assets ReceiveFromMaticAddr { recipient: HumanAddr, coi...
Rust
0
ast byte is done // while self.spi.sr.read().bsy().bit_is_set() {} // // clear OVR flag // unsafe { // ptr::read_volatile(&self.spi.dr as *const _ as *const u8); // } // self.spi.sr.read(); // Ok(()) // } // } pub mod my; const IAMCONSTANT:&'static str ...
Rust
0
multiple_char('\t', num_indents))?; write_str(writer, key, render_type)?; // Followed by the value if value.is_str() { writer.write_char('\t')?; } else { writer.write_char('\n')?; } value.write_indented(writer, num_indents, render_type)?; writer.write_char('\n') } fn write...
Rust
0
"""New depictions for POL units""" from .OT_64_SKOT_2_CMD_POL import ot_64_skot_2_cmd_pol POL_NEW_DEPICTIONS = { "ot_64_skot_2_cmd_pol": ot_64_skot_2_cmd_pol } __all__ = ["POL_NEW_DEPICTIONS"]
Python
1
f.graph_list_df = graph_list_df def __call__( self, data: Dict, ) -> Dict: path = data[self.load_path_df] # data[self.graph_list_df] = torch.load( # f=path # ) with open(path, 'rb') a...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- """ 현재 비밀번호 찾기 페이지의 캡차 캡처 및 분석 """ import asyncio from playwright.async_api import async_playwright from datetime import datetime import os async def capture_captcha_now(): """휴대폰 인증 화면의 캡차 이미지 캡처""" print("\n[CAPTURING CURRENT CAPTCHA]") print("="*60) ...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from odoo import models class Followers(models.Model): _inherit = ['mail.followers'] def _get_recipient_data(self, records, message_type, subtype_id, pids=None): recipients_data = super()._get_recipien...
Python
1
xt.curh.0 / synctex_ctxt.unit, synctex_ctxt.curv.0 / synctex_ctxt.unit, Kern(p).width().0 / synctex_ctxt.unit, ); synctex_ctxt.lastv = cur_v + S_72_27; if let Ok(len) = synctex_ctxt.file.as_mut().unwrap().write(s.as_bytes()) { synctex_ctxt.total_length += len; synctex_ctxt.co...
Rust
0
)}` // id ); } } // 重置画布的函数 function resetFlow() { if (window.flowEditor) { window.flowEditor.clear(); } } // 添加逻辑表达式编辑功能 window.editLogicExpress...
Python
1
assert_eq!( sub_manager.subscribed_ports(), ports_set, "Port sets should be equal", ); // Add subscriber2, but provide no ports sub_manager.add_subscription(sub2_req); // Broadcast a message to everyone let all_subscribers_msg = SerialResponse::Ok { msg: "Broadcast all!".t...
Rust
0
_modified: modified_lines = ['const tracy = @import("tracy");'] + modified_lines # need an extra newline at the end of the file modified_lines.append("\n") return "\n".join(modified_lines), was_modified def process_file(path: Path, remove: bool) -> bool: """Process a single file. Returns True ...
Python
1
import sys import os.path from PySide6.QtGui import QIcon from PySide6.QtCore import QSize from PySide6.QtWidgets import QLabel from src.utils import get_resource_path icons = dict() def loadIcons(): """This function must be called AFTER creating a QGuiApplication""" icons["anaouder"] = QIcon(get_resource...
Python
1
1, "test-msg-for-retries", &local_signer_key, ); let mut peer = MockPeerConnection::new(peer_uri.clone(), local_node_id, ledger, 0); // Configure peer to fail many times - we should see 8 attempts // (number is hardcoded in `get_retry_iterator`. ...
Rust
0
" {0} [OPTIONS] [--] infile.png [outfile.png]", program_name); println!(" {0} [OPTIONS] < infile.png > outfile.png", program_name); println!(" {0} --help|-?|--version", program_name); println!(); println!("{}", PROGRAM_DESCRIPTION); println!(); println!(" {:3} {:20} {}", "", "--copy-unsafe", "continue e...
Rust
0
cted_open { return LineResult::Invalid { ch }; } } } if stack.is_empty() { return LineResult::Valid; } let mut completion = Vec::new(); while !stack.is_empty() { completion.push(get_close(stack.pop_front().unwrap())); } return LineResult:...
Rust
0