text
string
label_name
string
labels
int64
four_augment_three_val = "" if onscreen("./captures/4-2.png"): augments_ss = ImageGrab.grab(bbox = (903, 1080, 1403, 1130)) augments_ss.save("stage_four_first_augment.png") augments_ss.close() stage_four_augment_one_img = cv2.imread("stage_four_first_augment.png")...
Python
1
me { object.key("ModelPackageName").string(var_709); } } pub fn serialize_structure_describe_model_package_group_input( object: &mut smithy_json::serialize::JsonObjectWriter, input: &crate::input::DescribeModelPackageGroupInput, ) { if let Some(var_710) = &input.model_package_group_name { ...
Rust
0
import random from statistics import mean def round_off(x: float): x = str(x) number, decimals = x.split('.') number = int(number) if int(decimals[0]) >= 5: number +=1 return int(number) def simulate_fixture(team1, team2): team1.P += 1; team2.P += 1 # get all the player avg's as ...
Python
1
from kubepyhound.models.entries import ( Node, NodeProperties, StaleReference, EdgePath, Edge, ) class ExtendedProperties(NodeProperties): source_ref: str source_edge_type: str class StaleNode(Node): properties: ExtendedProperties @property def _source_refs(self): st...
Python
1
from django.contrib.auth.models import AbstractUser, BaseUserManager from django.db import models class CustomUserManager(BaseUserManager): def create_user(self, phone_number, password=None, email=None, **extra_fields): if not phone_number: raise ValueError('Необходимо указать номер телефона.'...
Python
1
from modules.model.PixArtAlphaModel import PixArtAlphaModel from modules.modelSaver.BaseModelSaver import BaseModelSaver from modules.modelSaver.mixin.InternalModelSaverMixin import InternalModelSaverMixin from modules.modelSaver.pixartAlpha.PixArtAlphaEmbeddingSaver import PixArtAlphaEmbeddingSaver from modules.modelS...
Python
1
式29中的m) """ log_prior_s = 0 log_va_poser_s = 0 model_preds_s = [] for _ in range(sample_num): # 算法2:第4行 model_preds, log_prior, log_va_poster = self.run_sample(inputs, self.training) log_prior_s += log_prior ...
Python
1
{ assert_ne!(x, x, "custom panic message"); }); assert!(result.is_err()); let result = result.unwrap_err().payload_str().to_owned(); println!("expect={}", expect); println!("result={}", result); with_config_assert_eq!( pretty_assertions::Config { auto_label: true, ...
Rust
0
) return parser @torch.inference_mode() def main(model_provider: str = "gpt"): """Runs the text generation server with the specified model provider.""" initialize_megatron( extra_args_provider=add_text_generate_args, args_defaults={ 'no_load_rng': True, 'no_loa...
Python
1
# allows to red the (python) configuration file and update the layout dictionary def read_config(filepath: str): # Create a dictionary to hold the variables defined in the file local_vars = {} try: # Read the file content with open(filepath, "r") as file: code = file.read() ...
Python
1
sr-Latn': 'mosi', 'sv': 'mossi', 'sw': 'Kimoore', 'ta': 'மோஸ்ஸி', 'te': 'మోస్సి', 'th': 'โมซี', 'ti': 'ሞሲ', 'tk': 'mossi dili', 'to': 'lea fakamosi', 'tr': 'Mossi', 'ug': 'موسسىچە', 'uk': 'моссі', 'ur': 'موسی', 'uz': 'mossi', 'uz-Cyrl': 'мосси', 'uz-Latn': 'mossi', 'vec': 'mosi', 'vi': 'Tiếng Mossi', 'xnr': 'मोस्सी', '...
Python
1
"Distortion 1"; const PARAM_DISTORTION_2_LABEL: &str = "Distortion 2"; const PARAM_DISTORTION_3_LABEL: &str = "Distortion 3"; const PARAM_CALIB_DIM: &str = "calDim"; const PARAM_CALIB_WIDTH: &str = "calWidth"; const PARAM_CALIB_HEIGHT: &str = "calHeight"; const PARAM_CALIB_WIDTH_LABEL: &str = "Calibration width"; c...
Rust
0
# -*- coding: utf-8 -*- ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## # Structurable.py --- # -------------------------------- # Copyright (c) 2013 # Laurent CAPOCCHI # University of Corsica # ...
Python
1
Asset}, prelude::info}; use thiserror::Error; use crate::prelude::Svg; #[derive(Default)] pub struct SvgAssetLoader; impl AssetLoader for SvgAssetLoader { fn load<'a>( &'a self, bytes: &'a [u8], load_context: &'a mut LoadContext, ) -> BoxedFuture<'a, Result<(), anyhow::Error>> { ...
Rust
0
peline { One(i32), Two, } static mut REF_ONE_VALUE: i32 = 0; static mut REF_TWO_COUNT: i32 = 0; struct RefDataPipelineData { mult: i32, } impl RefDataPipeline { fn handle_one(v: i32, arg: &RefDataPipelineData) { unsafe { REF_ONE_VALU...
Rust
0
print("~$Hack ", Fore.RED + "[Error]" + Style.RESET_ALL) sound_error.play() time.sleep(1) starthack() print(random_num_nine) a = input("$ ") c = int(a) if c == random_num_nine: os.system('cls||c...
Python
1
attributes.get( raw.types.DocumentAttributeFilename, None ), "file_name", None ) video_attributes = attributes[raw.types.DocumentAttributeVideo] ...
Python
1
ument("--seed", type=int, default=0) parser.add_argument("--model-path", type=str, default="hf/BAGEL-7B-MoT/") args = parser.parse_args() if not os.path.exists(args.out_dir): os.makedirs(args.out_dir, exist_ok=True) args.datasets = args.datasets.split(",") print("datasets:", args.datasets)...
Python
1
pub const COD_COMPUTER_MINOR_LAPTOP: u32 = 3u32; #[doc = "*Required features: 'Win32_Devices_Bluetooth'*"] pub const COD_COMPUTER_MINOR_PALM: u32 = 5u32; #[doc = "*Required features: 'Win32_Devices_Bluetooth'*"] pub const COD_COMPUTER_MINOR_SERVER: u32 = 2u32; #[doc = "*Required features: 'Win32_Devices_Bluetooth'*"] p...
Rust
0
ts/tts.test?message=Hello%20World" media = await media_source.async_resolve_media(hass, media_id, None) assert media.url.startswith("/api/tts_proxy/") assert media.mime_type == "audio/mpeg" assert await retrieve_media(hass, hass_client, media_id) == HTTPStatus.OK assert len(mock_get_tts_audio.mock_...
Python
1
reduce_map_dimenstions() { for &(normal, reduced) in UTF_REDUCE_MAP { assert_eq!(normal .chars().count(), 1, "UTF_REDUCE_MAP['{}'] != 1", normal); assert_eq!(reduced.chars().count(), 1, "UTF_REDUCE_MAP['{}'].len() != 1", reduced); } } #[test] fn get_char_class() { ...
Rust
0
c - TCD Last Source Address Adjustment"] pub tcd5_slast: TCD5_SLAST, #[doc = "0x10b0 - TCD Destination Address"] pub tcd5_daddr: TCD5_DADDR, #[doc = "0x10b4 - TCD Signed Destination Address Offset"] pub tcd5_doff: TCD5_DOFF, _reserved_110_tcd5_citer: [u8; 2usize], #[doc = "0x10b8 - TCD Last ...
Rust
0
lossyq-send", |i| { tx.put(|v| *v = Some(i)); }); } fn lossyq_recv() { let (mut _tx, mut rx) = channel::<u64>(100); bench_200ms("lossyq-recv", |_i| { for _ii in rx.iter() { } }); } fn lossyq_send_recv() { let (mut tx, mut rx) = channel(100); bench_200ms("lossyq-send-recv", |i| { tx.put(|v|...
Rust
0
# Problem: Redundant Connection - https://leetcode.com/problems/redundant-connection/ class Solution: def findRedundantConnection(self, edges: List[List[int]]) -> List[int]: N= len(edges) par= [i for i in range(N+1)] #ith node-> parent (1-n) rank=[1] *(N+1) def find(n): ...
Python
1
) return GLib.SOURCE_REMOVE for hit_element in packages_array: source_obj = hit_element["_source"] name = source_obj["package_attr_name"] version = source_obj["package_pversion"] description = source_obj["package_descr...
Python
1
#!/usr/bin/env python3 """ 50銘柄を500株ずつ購入するテスト用スクリプト liquidity_data.txtから銘柄コードと価格を読み込み、 .posファイルを生成する処理 このスクリプトは実際の取引を行わず、テスト用のポジションファイルのみを生成します。 """ import os import re import datetime from taq.portfolio import save_execution_to_position_file def parse_liquidity_data(): """ liquidity_data.txtから銘柄コードと価格を抽出する ...
Python
1
} } } ExprF::Field(ref v, ref l) => { let v_borrow = v.as_whnf(); match &*v_borrow { RecordLit(kvs) => match kvs.get(l) { Some(r) => Ret::Value(r.clone()), None => { drop(v_borrow);...
Rust
0
self.SIGNATURE_HEADER, '', self.NOTIFICATION_URL) def test_signature_validation_signature_key_not_configured(self): with self.assertRaisesRegex(ValueError, 'signature_key is empty'): ...
Python
1
from dateutil.easter import EASTER_WESTERN from holidata.holiday import Country from holidata.utils import day __all__ = [ "CZ", ] """ source: https://www.zakonyprolidi.cz/cs/2000-245, §1 and §2. https://www.zakonyprolidi.cz/cs/2000-245/zneni-20200201 (>2020-02-01) https://www.zakonyprolidi.cz/c...
Python
1
#!/usr/bin/env python from vtkmodules.vtkFiltersCore import vtkMarchingCubes from vtkmodules.vtkIOImage import vtkVolume16Reader from vtkmodules.vtkRenderingCore import ( vtkActor, vtkPolyDataMapper, vtkRenderWindow, vtkRenderWindowInteractor, vtkRenderer, ) import vtkmodules.vtkInteractionStyle imp...
Python
1
// if the item in question doesn't have a position or item. let &vec_of_pos!(i_loc) = poses.get(item_ent)?; let item_item = items.get(item_ent)?; info!("passed requirements"); let player_to_item_distance_squared = ...
Rust
0
#!env python3 # # Copyright (c) 2015 Jon Szymaniak <jon.szymaniak@gmail.com> # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # t...
Python
1
if fp.is_dir(): # If the path is a directory, we want to deploy all environments in that directory return EnvFiles(directory=fp) return EnvPerFileGroup( filename=fp, deploy_args=deploy_args, name=filename, help="Deploy a single environment ...
Python
1
import json import os from stack.libs.shared.aws import client as aws_client from stack.libs.shared.aws import ensure_bucket class S3JobRepository: def __init__(self, bucket: str, prefix: str = "results/"): self.bucket = bucket self.prefix = prefix self.s3 = aws_client("s3") @classme...
Python
1
def main(opt): model = get_model(model_name=opt.model, dataset_name=opt.dataset, num_classes=opt.num_classes, pretrained=opt.pretrained) device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') model.to(device) img_size = 3, opt.img_size, opt.img_size input_tensor = torch.randn(...
Python
1
""" src module docstring. The src module provides some continual learning algorithm implementations. Author: Shihong Wang Date: 2024/9/25 """ available_model = ["finetune", "iCaRL", "LUCIR", "LingoCL"]
Python
1
), ) Jump('loc_34C4') def _loc_34C1(): pass label('loc_34C1') Jump('loc_34C4') def _loc_34C4(): pass label('loc_34C4') Jump('loc_34C7') def _loc_34C7(): pass label('loc_34C7') Jump('loc_31AD') def _loc_34CA(): pass label('loc_34CA') Switch( ...
Python
1
toolState = self.TOOLSTATE_Dynamics self.SetToolState(toolState) self._SetupAndPromptForNextAction() _BeginDynamics() else: textEditElementHandle = EditElementHandle() if BentleyStatus.eSUCCESS == self.CreateTextElement(textEditElementHandle, textBl...
Python
1
# Draw the crosshair pygame.draw.line(self.screen, self.green, (self.cross_hair_obj_x.centerx,self.cross_hair_obj_x.centery - self.crosshair_size),\ (self.cross_hair_obj_x.centerx,self.cross_hair_obj_x.centery + self.crosshair_size), 2) pygame.draw....
Python
1
# This upgrader moves memory pool attributes from a vector of pointers to the # next free page and a vector of the limit of each pool to sections which each # represent one pool and which hold the page shift amount, the next free page, # and the total pages in the pool. def upgrader(cpt): systems = {} for sec i...
Python
1
content. Returns: list: A list of dictionaries containing climber's name, ascent type, and date. """ # locate the log elements containing the ascents log_elements = soup.find_all('div', attrs={'class': 'result-row'}) asc...
Python
1
re_signed(origin)?; let ledger = Self::ledger(&controller).ok_or(<Error<T>>::NotController)?; Self::chill_stash(&ledger.stash); } /// (Re-)set the payment target for a controller. /// /// Effects will be felt at the beginning of the next era. /// /// The dispatch origin for this call must be _Signed...
Rust
0
from core.blueprints.base_blueprint import BaseBlueprint profile_bp = BaseBlueprint('profile', __name__, template_folder='templates')
Python
1
d'), 'resnet50_unet': dict(model=smp.Unet, encoder_name='resnet50', encoder_weights='imagenet', in_channels=3, classes=1, activation='sigmoid'), 'mobilenet_v2_unet': dict(model=smp.Unet, encoder_name='mobilenet_v2', encoder_weights='imagenet', in_channels=3, classes=1, activation...
Python
1
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Test Main Flow', 'version': '1.0', 'category': 'Hidden/Tests', 'description': """ This module will test the main workflow of Odoo. It will install some main apps and will try to execute the most...
Python
1
try: response = requests.get(article_url, headers=headers, timeout=10) # Fetch article page. response.encoding = 'utf-8' # UTF-8 encoding. response.raise_for_status() # Handle HTTP errors. article_soup = BeautifulSo...
Python
1
le.markdown("<center>" + clicked_coffee["Bild"].values[0] + "</center>", unsafe_allow_html=True) col1,col2 = st.columns([1,1]) with col1: save_btn = st.form_submit_button("Speichern", use_container_width=True, type="primary") with col2: del_btn = st.fo...
Python
1
receiver.poll_recv_from(cx, &mut read)).await?; assert_eq!(read.filled(), msg); assert_eq!(addr.as_pathname(), Some(sender_path.as_ref())); Ok(()) } #[tokio::test] async fn send_recv_poll() -> std::io::Result<()> { let dir = tempfile::tempdir().unwrap(); let sender_path = dir.path().join("sender....
Rust
0
import py_trees as ptree from typing import Any import enum from py_trees.common import Status # _base Behavior class Bahavior(ptree.behaviour.Behaviour): can_be_expanded = False num_params = 0 valid_params=''' None ''' scene = None print_name_prefix = "" tables_for_placement ...
Python
1
import keras import numpy as np def allclose(x1, x2, rtol=1e-5, atol=1e-5): return keras.ops.all(keras.ops.isclose(x1, x2, rtol, atol)) def assert_allclose(x1, x2, rtol=1e-5, atol=1e-8, msg=""): x1 = keras.ops.convert_to_numpy(x1) x2 = keras.ops.convert_to_numpy(x2) assert x1.shape == x2.shape, "In...
Python
1
: yield coin_entry.coin def all_unspent_coins(self) -> Iterator[Coin]: for coin_entry in self._db.values(): if not coin_entry.spent: yield coin_entry.coin def _add_coin_entry(self, coin: Coin, birthday: CoinTimestamp) -> None: name = coin.name() ...
Python
1
= "Bit 9 - Pad 65 input enable"] #[inline(always)] pub fn pad65inpen(&self) -> PAD65INPEN_R { PAD65INPEN_R::new(((self.bits >> 9) & 0x01) != 0) } #[doc = "Bit 8 - Pad 65 pullup enable"] #[inline(always)] pub fn pad65pull(&self) -> PAD65PULL_R { PAD65PULL_R::new(((self.bits >> 8)...
Rust
0
s where a persistent character buffer /// is needed. #[inline] pub (crate) fn str2cstring(s: &str) -> CString { CString::new(s).unwrap() } /// ```&str -> *const c_char``` /// /// Used internally by the Rust Hexchat API. /// Creates a C compatible character buffer from the `&str` that can be passed /// as a paramet...
Rust
0
#!/bin/python3 import argparse import pcapng import zipfile import hashlib def extract_packets(pcap_file): """Reads a wireshark packet capture and extracts the binary packets""" packets = [] with open(pcap_file, 'rb') as fp: scanner = pcapng.FileScanner(fp) for block in scanner: ...
Python
1
_IPREFETCH_CACHEW { _IPREFETCH_CACHEW { w: self } } #[doc = "Bit 0 - When set, instruction accesses to the SRAM banks will be prefetched (normally 2 cycle read access). Generally, this mode bit should be set for improved performance when executing instructions from SRAM."] #[inline] pub fn ipre...
Rust
0
ler(ColorizingStreamHandler): def colorize(self, line, record): # comment out this method if you don't like the job_lifecycle # logs rendered with cyan text previous_level_map = self.level_map.copy() if record.name == "awx.analytics.job_lifecyc...
Python
1
{ 'name': 'ipinfo.io', 'url': 'https://ipinfo.io/{ip}/json', 'free': True } ] def lookup_ip(self, ip: str) -> Dict[str, Any]: """Геолокация IP адреса""" print(f"\n{Colors.YELLOW}🌍 Геолокация IP {ip}...{Colors.END}") ...
Python
1
use std::fs; use std::io::Write; use std::net::Ipv4Addr; use actix_multipart::{Field, Multipart, MultipartError}; use actix_web::{error, guard, middleware, web, App, Error, HttpResponse, HttpServer}; use futures::future::{err, Either}; use futures::{Future, Stream}; pub fn save_file(field: Field) -> impl Future<Item...
Rust
0
"""Tests for the auto-generated PKI.""" import pytest from devices.issuer import LocalDomainCredentialIssuer from devices.models import DeviceModel from pki.auto_gen_pki import AutoGenPki from pki.models import CertificateModel, DomainModel, IssuingCaModel from pki.util.keys import AutoGenPkiKeyAlgorithm @pytest.ma...
Python
1
use blocking IPC sockets. /// Arguments are: /// 1. ipc, a &str specifying the IPC type /// (either "unix", "netlink", or "char"): see [`ipc`](./ipc/index.html). /// 2. alg, an instance of `impl CongAlg<T: Ipc>`. /// 3. blk, optional argument, either [`Blocking`](./ipc/struct.Blocking.html) or /// [`Nonblocking`](....
Rust
0
8, 6, 2, 10], [ 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5], [10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0], [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3], ]; fn b2b_compress(h: &...
Rust
0
batch_size, v_seq_length, num_heads, head_dim) q = q.permute(0, 2, 1, 3) # [Batch, Head, SeqLen, Embed] k = k.permute(0, 2, 1, 3) v = v.permute(0, 2, 1, 3) # -- perform attention on each head with torch.no_grad(): attn_logits = torch.matmul(q, k.transpose(-2, -1)) / math.sqrt(q.shape[-1]) ...
Python
1
_index_server( indexer: Rc<Indexer>, stream: DriverIndexRequestStream, ) -> Result<(), anyhow::Error> { stream .map(|result| result.context("failed request")) .try_for_each(|request| async { let indexer = indexer.clone(); match request { DriverIndexReq...
Rust
0
from fufanrag.evaluator.evaluator import * from fufanrag.evaluator.metrics import *
Python
1
ger_state.mining_target.unwrap().0] = Tile::Background; digger_state.mining_target = None; digger_state.mining = 0.; break; } } } struct Mining; struct Mined; fn mark_mining_target( mut commands: Commands, mut tile_query: Query<(Entity, &MapTile, &mut Handle<Col...
Rust
0
square_sum(feature_map=feats) # [bs, 1, 7, 7] # 获取特征激活图,2次方能够更加凸显高亮区域 feats_sum = self.adaptor(feats) #print('distill feats_sum ', feats_sum.size()) anomaly_maps = resize( input=anomaly_maps, size=feats.shape[2:], mode='bili...
Python
1
import pytest import torch import numpy as np import os import sys sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) from detector.rplmsed import * # 创建一个示例数据集 @pytest.fixture def sample_dataset(): data = [ DataItem(event_id=1, tweet_id=1, text="Hello world", user_id=1, created_at...
Python
1
fn initialize(mut timer: Timer<TIMER>) { unsafe { NVIC::unmask(stm32l4xx_hal::stm32::Interrupt::TIM15) }; let timer = Self { timer: UnsafeCell::new(timer), waiters: UnsafeCell::new([ None, None, None, None, None, None, None, None, ]),...
Rust
0
j|||}d j||_t j|tj|nXWdt j d Xn|rCtj nWdt j|Xt!t j"|d }g}x,|r|j#|t!t j"|d }qsWd j|}Wd| dk r| dk r|| n|dk r|dk r||n|dk r!|dk r!||nt j|...
Python
1
 \c@sRddlmZddlTddlmZdZdZdZdZd S( i(tunicode_literalsi(t*(trendercCs t|dS(Nu etv/home.html(R(trequest((s&/home/amrit/Projects/DBMS/etv/views.pytindexs...
Python
1
queue_indices: &QueueIndices) -> Result<SwapchainData, Error> { let surface_data = SurfaceData::create(physical_device, surface)?; let extent = surface_data.get_surface_extent(preferred_extent); let (image_sharing_mode, swapchain_queue_family_indices) = ...
Rust
0
f64), y0 + (BUFFER_WIDTH * level as f64), x0 + (BUFFER_WIDTH * level as f64), y1 - (BUFFER_WIDTH * level as f64), ); draw_line( canvas, level, x0 + (BUFFER_WIDTH * level as f64), y1 - (BUFFER_WIDTH * level as f64), x1 - (BUFFER_WIDTH * level as f64...
Rust
0
# ------------------------------------------------------------------------- # # PYTHON for DUMMIES 22-23 # Problème 10 # # Script de test # Vincent Legat # # ------------------------------------------------------------------------- # from numpy import * from timeit import default_timer as timer from numpy import * ...
Python
1
from .ship import Ship from .enums import ShipType class Scout(Ship): """Verkenner: Radar Scan (eenmalig) 3x3 gebied scannen, geen schade.""" def __init__(self, owner: str): super().__init__(ShipType.SCOUT, owner, length=2) class Fighter(Ship): """Jager: Homing Missile (eenmalig) dichtstbijzijnd...
Python
1
class User: def __init__(self, user_login, user_password): self.user_login = user_login self.user_password = user_password self.active = True self.permissionSelect = True self.permissionInsert = False self.permissionUpdate = False self.permissionDelete = Fals...
Python
1
def is_sorted(lst): ''' Given a list of numbers, return whether or not they are sorted in ascending order. If list has more than 1 duplicate of the same number, return False. Assume no negative numbers and only integers. Examples is_sorted([5]) ➞ True is_sorted([1, 2, 3, 4, 5]) ➞ True i...
Python
1
way to create a Seed app. /// /// _NOTE:_ It tries to hydrate the root element content => you can use it also for prerendered website. /// /// # Example /// /// ```rust,no_run /// fn init(url: Url, orders: &mut impl Orders<Msg>) -> Model { /// orders /// .subscribe(Msg::...
Rust
0
"""Zhong: pirated subscription exp for binghamton""" from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes from cryptography.hazmat.backends import default_backend import struct def add_padding(data: bytes) -> bytes: """Add padding to the data to make its length a multiple of 16 bytes.""" ...
Python
1
Display for Card { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "{} of {}", self.name, self.suit) } } impl Card { pub fn name_to_value(&self) -> u8 { match self.name.to_uppercase().trim() { "ACE" => 11, "TWO" => 2, "THREE" => 3, ...
Rust
0
import argparse import subprocess def run_command(cmd): """Runs a shell command and handles errors.""" try: subprocess.run(cmd, shell=True, check=True) except subprocess.CalledProcessError as e: print(f"Error: {e}") def clear_firewall(): """Flush all iptables rules and set default deny...
Python
1
# Code generated by Lark OpenAPI. from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type from lark_oapi.core.construct import init class BatchDeleteDocumentBlockChildrenResponseBody(object): _types = { "document_revision_id": int, "client_token": str, } def __init__...
Python
1
Name::from_labels(const_labels.chain(labels)) }; result.map_err(NameEncoderError::Proto) } /// Decode hex data from a FQDN. pub fn decode_hex(&self, encoded_name: &Name) -> Result<Bytes, NameEncoderError> { let bytes = self.decode(encoded_name)?; let mut hex_bytes = BytesMut...
Rust
0
# Python 3 syntax only use cases, used in test_extending.py # arg name is different, and there's no arg name to match before *args def impl4(z, *args, kw=None): if z > 10: return 1 else: return -1 # arg name is different but at a detectable location, with *args def impl5(z, b, *args, kw=No...
Python
1
3DVertexShader9, 0xefc5557e, 0x6265, 0x4613, 0x8a, 0x94, 0x43, 0x85, 0x78, 0x89, 0xeb, 0x36} DEFINE_GUID!{IID_IDirect3DPixelShader9, 0x6d3bdbdc, 0x5b02, 0x4415, 0xb8, 0x52, 0xce, 0x5e, 0x8b, 0xcc, 0xb2, 0x89} DEFINE_GUID!{IID_IDirect3DStateBlock9, 0xb07c4fe5, 0x310d, 0x4ba8, 0xa2, 0x3c, 0x4f, 0x0f, 0x20, 0x...
Rust
0
> { let mut server = LspServer::new(LspContext::new()); server.did_open_text_document( test_root().join("bar.asm"), "vic: { .const border = $d020 }", )?; server.did_open_text_document( test_root().join("main.asm"), "lda vic.border\n.import ...
Rust
0
esponse> { let resp = LastDistributionResponse { last_distribution_block: load_state(deps.storage)?.last_distribution_block, }; Ok(resp) } /// ## Description /// Returns a [`bool`] type whether funds can be distributed or not /// ## Params /// * **deps** is an object of type [`Deps`] /// /// * **e...
Rust
0
filename = os.path.relpath(file, args.img).replace('/', '_') else: filename = os.path.basename(file) out_file = None if args.show else os.path.join(args.out_dir, filename) progress_bar.update() # Get candidate predict info with score threshold pred_instances = ...
Python
1
model=crf, max_iter=20, batch_size=1, C=100) clf.fit(X, Y) Y_pred = clf.predict(X) assert_array_equal(Y, Y_pred) def test_binary_ssvm_repellent_potentials(): # test non-submodular problem with and without submodularity constraint # dataset is checkerboard X, Y = generate_checker() crf = Gr...
Python
1
} } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { ...
Rust
0
import os import sys sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))) import numpy as np import matplotlib.pyplot as plt from tqdm import tqdm from collections import defaultdict from scipy.interpolate import interp1d import random from models.SIR import SIRSimulation os.makedirs("fig...
Python
1
let (mut signing_key, verifying_key) = hss_keygen::<H>(&parameters, &seed, None).expect("Should generate HSS keys"); let signing_key_const = signing_key.clone(); let mut update_private_key = |new_key: &[u8]| { signing_key.as_mut_slice().copy_from_slice(new_key); ...
Rust
0
().unwrap().view(); let doc2 = document(); // let view_all = doc; // let doc2 = document(); // let v = VNode::VRef(doc2.create_element("div").unwrap().into()); // assert_eq!(doc, doc2); // let doc = document(); // let res = doc.view().query_selector("#root"); // assert_eq!(doc....
Rust
0
# Generated by Django 5.2.7 on 2025-10-01 17:36 import uuid import django.db.models.deletion from django.db import migrations, models class Migration(migrations.Migration): initial = True dependencies = [ ("courses", "0001_initial"), ("departments", "0001_initial"), ] operations =...
Python
1
2HomProjective<ark_bn254::Parameters> { ark_ec::models::bn::g2::G2HomProjective::<ark_bn254::Parameters> { x: parse_quad_from_bytes(&range[0..64].to_vec()), y: parse_quad_from_bytes(&range[64..128].to_vec()), z: parse_quad_from_bytes(&range[128..].to_vec()), } } pub fn parse_proof_b_fro...
Rust
0
"""remove sub_category_id from brand table Revision ID: e6b2f64cc8fe Revises: 2cb720387109 Create Date: 2025-05-22 17:58:59.232536 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = 'e6b2f64cc8fe' down_revision: Union[str, ...
Python
1
target symbol's offset from loc pub fn get_line_and_offset_from_loc( &self, file: &ast::File, loc: &Loc, ) -> (String, usize, usize, usize) { let (start, end) = if let Loc::File(_, start, end) = loc { (start, end) } else { unreachable!(); ...
Rust
0
# The Leginon software is Copyright under # Apache License, Version 2.0 # For terms of the license agreement # see http://leginon.org import wx import leginon.gui.wx.Node import leginon.gui.wx.Settings import leginon.gui.wx.ToolBar class Panel(leginon.gui.wx.Node.Panel): icon = 'targetfilter' def __init__(self, *a...
Python
1
= f["value"] if type_ == "attribute": if SearchExperimentsUtils.is_string_attribute( type_, key, comparator ) and comparator not in ("=", "!=", "LIKE", "ILIKE"): raise MlflowException.invalid_parameter_value( f"Invalid comparator for st...
Python
1
dt.strftime("%Y-%m-%d") except ValueError: pass # (D) 길이가 4 => "y m d"?? (예: "2357" -> 23 5 7 => 2023-05-07) # 매우 모호하므로 필요하면 여기도 처리 if len(s_clean) == 4: # ex: "2357" => yy=23, m=5, d=7 # -> 2023-05-07 # But ambiguous if user meant 02-35-07? # 여기...
Python
1
ypes.h (include k4a/k4a.h)</requirement>"] #[doc = " </requirements>"] #[doc = " \\endxmlonly"] #[repr(C)] #[derive(Debug, Default, Copy, Clone)] pub struct _k4a_version_t { #[doc = "< Major version; represents a breaking change."] pub major: u32, #[doc = "< Minor version; represents additional features, no...
Rust
0