text
string
label_name
string
labels
int64
unctionDef")] xcm::latest::Junction, #[serde(with = "JunctionDef")] xcm::latest::Junction, #[serde(with = "JunctionDef")] xcm::latest::Junction, #[serde(with = "JunctionDef")] xcm::latest::Junction, #[serde(with = "JunctionDef")] xcm::latest::Junction, #[serde(with = "JunctionDef")] xcm::latest::Junction, ),...
Rust
0
scale; } Ok(()) } #[cfg(feature = "image")] pub fn import_bitmap<C: std::ops::Deref<Target = [u8]>>( renderer: &mut Gles2Renderer, image: &ImageBuffer<Rgba<u8>, C>, ) -> Result<Gles2Texture, Gles2Error> { use smithay::backend::renderer::gles2::ffi; renderer.with_context(|renderer, gl| unsafe ...
Rust
0
"is_feasible_args":[str(grid_list), lower_range, upper_range], "is_correct_args":[str(grid_list), lower_range, upper_range], "A*_args": [str(grid_list), str(lower_range), str(upper_range)], "...
Python
1
_norm = np.append(vec_norm, vec_norm[-1:], axis=0) trajectory = [] for idx in range(0, len(vec_norm) - self._window_size): # Meas has to be over axis 0 so it handles arrays of arrays element = np.mean( vec_norm[(idx + 1) : (...
Python
1
ix::users::FollowRelationship, ClientError<'a, C>>> + Send + 'a, >, > where T: TwitchToken + Send + Sync + ?Sized, { let req = helix::users::GetUsersFollowsRequest::builder() .to_id(to_id) .from_id(from_id) .first(10...
Rust
0
from figures import Figure, Triangle, Rectangle, Trapeze, Parallelogram, Circle from figures import Len, Area class ReaderFiguresData: def __init__(self, filepath: str): self.filepath = filepath self._max_figure: Figure = None self.max_perimeter: Len = -1 self.max_area: Area = -1...
Python
1
ameter sensitivity analysis. The sweep will be applied to each month of data selected.\n\nIn this example, a sweep over the power rating from 5 to 20 MW in ten evenly-spaced points will be performed for each month selected in the 'Data' tab. If four months were selected then a total of 40 models will be solved." ...
Python
1
ile(api_key: &String) { let mut file = File::create("api.key").expect("Failed to write to api.key file."); file.write_all(&api_key.clone().into_bytes()).expect("Failed to write api key to file."); } /// Gets an api key from `api.key` file fn get_api_key_from_file() -> Option<String> { let mut file = File::...
Rust
0
Option::Some(PhaseCodeKind::PhaseCodeKind_other), 16 => ::std::option::Option::Some(PhaseCodeKind::PhaseCodeKind_N), 32 => ::std::option::Option::Some(PhaseCodeKind::PhaseCodeKind_C), 33 => ::std::option::Option::Some(PhaseCodeKind::PhaseCodeKind_CN), 40 => ::std::option:...
Rust
0
import speech_recognition as sr import webbrowser import pyttsx3 import musicLibrary import requests recognizer = sr.Recognizer() engine=pyttsx3.init() newsapi = "b44fa2ebc6004c42b6a6500d822e4c90" def speak(text): engine.say(text) engine.runAndWait() def processCommand(c): if "open google" in c.lower()...
Python
1
import torch import torch.nn as nn class Generator(nn.Module): def __init__(self, latent_dim): super(Generator, self).__init__() self.model = nn.Sequential( nn.Linear(latent_dim, 256), nn.ReLU(inplace=True), nn.Linear(256, 512), nn.BatchNorm1d(512), ...
Python
1
async fn main() -> Result<(), Box<dyn Error>> { let addr = "127.0.0.1:6142".parse()?; // Open a TCP stream to the socket address. // // Note that this is the Tokio TcpStream, which is fully async. let mut stream = TcpStream::connect(&addr).await?; println!("created stream"); let result = ...
Rust
0
ased on the selected RMM events u850_obs_anom_mjo = u850_obs_anom_djfm.sel(time=mjo_events.time) olr_obs_anom_mjo = olr_obs_anom_djfm.sel(time=mjo_events.time) # Calculate the averages u850_avg_fcst = u850_fcst_anom_mjo.mean(dim='time') olr_avg_fcst = olr_fcst_anom_mjo.mean(dim='time') u850_avg_obs = u850_obs_anom_m...
Python
1
(feature = "proto-ipv4")] use smoltcp::wire::Ipv4Address; #[cfg(feature = "proto-ipv6")] use smoltcp::wire::Ipv6Address; use smolsocket::{port_to_bytes, SocketAddr}; use super::*; #[test] fn test_addr_len() { #[cfg(feature = "proto-ipv4")] assert_eq!(addr_len(Atyp::V4, Non...
Rust
0
no [T; 33] / [u8; 33] impl in parity-codec :/ // TODO: Do we remove `RawPubKey` and directly use [u8; 33] as `Encode` and `Decode` impls are now available? #[derive(Clone, Encode, Decode)] pub struct RawPubkey(H264); #[cfg(not(feature = "mesalock_sgx"))] impl ::serde::Serialize for RawPubkey { fn serialize<S: ::s...
Rust
0
import streamlit as st import pandas as pd import numpy as np import shap import joblib import matplotlib.pyplot as plt import seaborn as sns # Load Data @st.cache_data def load_data(): counts = pd.read_csv("combined_counts.txt", sep="\t", index_col=0) metadata = pd.read_csv("sample_metadata.txt", sep="\t", in...
Python
1
# OrKa: Orchestrator Kit Agents # Copyright © 2025 Marco Somma # # This file is part of OrKa – https://github.com/marcosomma/orka-reasoning # # Licensed under the Apache License, Version 2.0 (Apache 2.0). # You may not use this file for commercial purposes without explicit permission. # # Full license: https://www.apac...
Python
1
import json import requests # Function to load a JSON file def load_json(file_path): with open(file_path, 'r') as file: data = json.load(file) return data def request_assemblies(service_url, pdb_id): url = f"{service_url}/search/assembly/{pdb_id}/1" response = requests.get(url) response....
Python
1
slate-EN', 'charm-reason-Chinese_Sport_Understanding_Translate-EN', 'charm-reason-Chinese_Time_Understanding_Translate-EN', 'charm-reason-Global_Anachronisms_Judgment_Translate-EN', 'charm-reason-Global_Movie_and_Music_Recommendation_Translate-EN', 'charm-reason-Global_Natural_La...
Python
1
//www.fileformat.info/info/unicode/category/Cf/list.htm ('\u{200B}'..='\u{206F}').contains(&c) // TODO: heed bidi characters } fn allocate_glyph( atlas: &mut TextureAtlas, font: &ab_glyph::FontArc, glyph_id: ab_glyph::GlyphId, scale_in_pixels: f32, y_offset: f32, pixels_per_point: f32, ) ->...
Rust
0
import torch import torch.nn as nn import torch.nn.functional as F try: from LovaszSoftmax.pytorch.lovasz_losses import lovasz_hinge except ImportError: pass # 🆕 3クラス用損失関数を追加 class CrossEntropyLoss(nn.Module): """多クラス用CrossEntropyLoss""" def __init__(self, weight=None, ignore_index=-100): sup...
Python
1
.boolean_value_of(b), values[1], "b"); assert_eq!(model.boolean_value_of(c), values[2], "c"); assert_eq!(model.boolean_value_of(d), values[3], "d"); }; check_values(&model, [None, None, None, None]); // not(a) and not(b) model.discrete.set_ub(a, 0, Cause::Decisio...
Rust
0
<= wallet_service.gap_limit, "test broken" # create some unused addresses wallet_service.get_new_script(mixdepth, BaseWallet.ADDRESS_TYPE_INTERNAL) wallet_service.get_new_script(mixdepth, BaseWallet.ADDR...
Python
1
from kivy.clock import Clock from kivymd.app import MDApp from kivymd.uix.chip import MDChip, MDChipLeadingIcon, MDChipText from kivymd.uix.screen import MDScreen len_callbacks = 0 class MyScreen(MDScreen): def remove_widget(self, *args, **kwargs) -> None: global len_callbacks super().remove_wi...
Python
1
graphql_object!(FileData: Context as "File" |&self| { interfaces: [EntryData] field name() -> Option<&str> as "Name of the file" { self.name() } field is_folder() -> bool { !self.path().is_file() } field is_file() -> bool { self.path().is_file() } field absol...
Rust
0
# Copyright (C) 2024 Intel Corporation # SPDX-License-Identifier: Apache-2.0 import random import argparse import torch import torch.backends.cudnn as cudnn import numpy as np from embedding.video_llama.common.config import Config from embedding.video_llama.common.dist_utils import get_rank from embedding.video_llama...
Python
1
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # NO CHECKED-IN PROTOBUF GENCODE # source: protos/perfetto/metrics/android/thread_time_in_state_metric.proto # Protobuf Python Version: 5.27.3 '''Generated protocol buffer code.''' from google.protobuf import descriptor as _descriptor fr...
Python
1
std::ptr::copy_nonoverlapping( self.get_unchecked(index), swap_scratch, self.item_layout.size(), ); std::ptr::copy( self.get_unchecked(last), self.get_unchecked(index), self.item_layout.size(), ); self.len -...
Rust
0
test_file_path = "C:/Users/peter/Documents/GitHub/advent-of-code/2024/day2/test2.txt" input_file_path = "C:/Users/peter/Documents/GitHub/advent-of-code/2024/day2/input.txt" lists = [[int(char) for char in line.split()] for line in open(input_file_path).read().splitlines()] # Part 1 def check_valid_p1(seq): change...
Python
1
ion_channel_registry; pub mod service; /// Long running operations return a StatusEmitter. /// A status emitter can either be awaited and the final return value evaluated (for tests for example), /// or pushed into the notification service. pub struct StatusEmitter { inner: tokio::sync::watch::Receiver<()>, ab...
Rust
0
# Algorithm that find maximum and minimum number in given array in minimum number of comparison def minimum_number_of_comparison(arr, length): """ TIME COMPLEXITY : O(n) if n is odd : number of comparison is 3(n - 1) / 2 if n is even : number of comparison is 3(n - 2) / 2 + 1 """ # if length i...
Python
1
#!/usr/bin/env python3 import os import sys import argparse from pathlib import Path # Add the project root to the path so we can import project modules project_root = Path(__file__).resolve().parent.parent.parent sys.path.append(str(project_root)) from src.ground_truth.create_ground_truth import create_ground_truth_...
Python
1
import pytest from ariadne import gql @pytest.fixture def benchmark_query(): return gql( """ query GetThreads { threads { id category { id name slug color parent { id ...
Python
1
# Copyright (c) 2015 Ansible, Inc. # All Rights Reserved. import os import logging import django from awx import __version__ as tower_version # Prepare the AWX environment. from awx import prepare_env, MODE from channels.routing import get_default_application # noqa prepare_env() # NOQA """ ASGI config for AWX pr...
Python
1
#!/bin/env python3 # SPDX-FileCopyrightText: © 2015 Herbert Poetzl <herbert@13thfloor.at> # SPDX-License-Identifier: GPL-2.0-only import os import sys import mmap import struct import math from time import sleep base_addr = 0x18100000 length = 0x08000000 debug=[(0,x) for x in range(600,610)] ddc = { -1 : 'D', 0 : ...
Python
1
} else { 0.0 }) != 0.0 } /// Retrieve a reference to the real-valued eigenvalue list pub fn eigenvalues_real(&self) -> &Vec<f64> { &self.eigs.0 } /// Retrieve a reference to the imaginary-valued eigenvalue list pub fn eigenvalues_imag(&self) -> &Vec<f64> { &self.eigs.1 } ...
Rust
0
Parameter::new(ADDRESS_RUNTIME_ARG_NAME, Address::cl_type()), ], <()>::cl_type(), EntryPointAccess::Public, EntryPointType::Contract, ); let check_allowance_of_entrypoint = EntryPoint::new( String::from(CHECK_ALLOWANCE_OF_ENTRY_POINT_NAME), vec![ Para...
Rust
0
RIEND_REALM_1): self.wait_until_stable(self.I_CHECK_FRIEND_REALM_1) logger.info('Appear enter friend realm button') break if self.appear(self.I_CHECK_FRIEND_REALM_3): self.wait_until_stable(self.I_CHECK_FRIEND_REALM_3) logger.in...
Python
1
hIterator { DerivationPathIterator::start_from(&self, ChildNumber::Hardened{ index: 0 }) } } impl fmt::Display for DerivationPath { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { f.write_str("m")?; for cn in self.0.iter() { f.write_str("/")?; fmt::Display...
Rust
0
_base_ = '../faster_rcnn/faster-rcnn_r50_fpn_1x_coco.py' model = dict( roi_head=dict( type='PISARoIHead', bbox_head=dict( loss_bbox=dict(type='SmoothL1Loss', beta=1.0, loss_weight=1.0))), train_cfg=dict( rpn_proposal=dict( nms_pre=2000, max_per_img=20...
Python
1
"""Checker for non snake case identifiers.""" from pglast import stream from pgrubic.core import linter from pgrubic.rules.naming import CheckIdentifier class NonSnakeCaseIdentifier(CheckIdentifier): """## **What it does** Check if identifier is not in snake case. ## **Why not?** PostgreSQL folds a...
Python
1
import os # 检查是否安装了 asar 命令 def check_asar_command(): return os.system("command -v asar > /dev/null 2>&1") == 0 if not check_asar_command(): print("草泥马,先安装asar。") exit(1) # 获取用户输入的用户名 username = input("请输入用户名: ") # 执行bash命令 bash_extract = """ cd /Applications/StarUML.app/Contents/Resources && asar extra...
Python
1
) assert state.agent_state == AgentState.FINISHED # all user messages appear in the history, so that after a replay (assuming # the trajectory doesn't end with `finish` action), LLM knows about all the # context and can continue user_messages = [ "what's 1+1?", "No, I mean by Go...
Python
1
struct Iter<'a, K: 'a, V: 'a> { iter: RawBuckets<'a, K, V>, } struct HashSetIter<'a, K: 'a> { iter: Keys<'a, K, ()>, } struct Keys<'a, K: 'a, V: 'a> { inner: Iter<'a, K, V>, } impl<K, V> Copy for RawBucket<K, V> {} impl<K, V> Clone for RawBucket<K, V> { fn clone(&self) -> RawBucket<K, V> { *s...
Rust
0
b"\t\t mct=%x\n\x00" as *const u8 as *const libc::c_char, (*l_default_tile).mct, ); /*end of default tile*/ compno = 0 as libc::c_int; /*end of component of default tile*/ while compno < numcomps { let mut l_tccp: *mut opj_tccp_t = &mut *(*l_default_tile).tccps.offset(compno as...
Rust
0
import os import sys import tempfile import types sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from src.common import get_http_session_with_backoff def test_http_backoff_uses_cache(monkeypatch, tmp_path): # prepare a fake cache dir and file from src.config import HTTP_CAC...
Python
1
from Lab_12_2.task2 import IceCreamStand from tkinter import Tk, Label, ttk, PhotoImage from datetime import datetime setattr(IceCreamStand, 'hours_is_open', (9, 21)) def is_open(self): now = datetime.now() open_hour, close_hour = self.hours_is_open open_time = open_hour <= now.hour < close_hour return 'открыто...
Python
1
# MOJIZA/engine/middleware.py from .sessions import session_manager class Middleware: def __init__(self): self.middlewares = [] def add(self, func): self.middlewares.append(func) def execute(self, request, response): for middleware in self.middlewares: middlew...
Python
1
togram!("boards_scan_duration", s.elapsed().as_millis() as f64); if let Some(added_jobs) = add_opt { if added_jobs == 0 { // No new changes tokio::time::sleep(Duration::from_secs(10)).await; } else { tokio::time::sle...
Rust
0
m_hocon(self).map_err(|err| crate::Error::Deserialization { message: err.message, })?, ) } } #[cfg(test)] mod tests { use super::*; #[test] fn access_on_string() { let val = Hocon::String(String::from("test")); assert_eq!(val.as_bool(), None); ...
Rust
0
name, opt), Base(b) => base_to_ast(b, opt), Domain(d) => domain_to_ast(d, &stripped_name, opt), Other(oid) => { if *oid == 2278 { let name_type = format_heck(&typ.name, opt, CamelCase); quote! { pub type #name_type = (); } } else { if opt.debug { println!("Couldn't convert type: {}, {}", ty...
Rust
0
readermode=readermode, timeout=timeout) if user or usenetrc: self.login(user, password, usenetrc) def _close(self): try: _NNTPBase._close(self) finally: self.sock.close() __all__.append("NNTP_SSL") # Test retrieval w...
Python
1
Неправильный ввод данных!") def place_scrollbar(self): self.scrollbar_frame_1 = ctk.CTkScrollableFrame(self, width=190, height=50,fg_color='#2b2b2b') # 171717 self.scrollbar_frame_1.place(x=390, y=220) self.scrollbar_frame_2 = ctk.CTkScrollableFrame(self, width=190, height=50, fg_color='#2...
Python
1
"""Colunas de local de partida e chegada criadas Revision ID: 8f41a43fd9f9 Revises: d6eb61b6064c Create Date: 2024-05-23 15:21:20.957352 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '8f41a43fd9f9' down_revision: Union...
Python
1
, buf: &[u8]) -> io::Result<usize> { self.0.write(buf) } fn flush(&mut self) -> io::Result<()> { self.0.flush() } } impl<F: io::Seek> io::Seek for FileDynamic<F> { fn seek(&mut self, seek: io::SeekFrom) -> io::Result<u64> { self.0.seek(seek) } } <reponame>deadshot465/demo_g...
Rust
0
class Solution: def calculate(self, s: str) -> int: curr = 0 res = 0 sign = 1 stack = [] for c in s: if c.isdigit(): curr *= 10 curr += int(c) elif c in ['+', '-']: res += curr * sign if ...
Python
1
:read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dcodefaultaddr](dcodefaul...
Rust
0
_point(|key| key.expansion.t <= t_); assert!(index > 0); let item = &self.items[index - 1]; let z = self.w * (t - item.t); let z_ = z.fp(); // z = O(ln(x) * radius), and exp(iz) has relative error O(|z|) // we here compute (z % 2π) using high precision let reduc...
Rust
0
let router_tx = router_tx.clone(); task::spawn(async { let connector = Connector::new(config, router_tx); // TODO Remove all max packet size hard codes let network = Network::new(stream, 10 * 1024); if let Err(e) = connector.new_connection(network).await...
Rust
0
from django.conf import settings from notification.factories.notification_factory import NotificationFactory class SMSNotificationFactory(NotificationFactory): """ Factory for creating an SMS Notification Service. """ def create_notification_service(self): from notification.services.sms_prov...
Python
1
te.clear() else: sent = await message.answer("Категория уже существует или достигнут лимит (50). Попробуйте другое название.") await state.update_data(last_message_id=sent.message_id) except Exception as e: logging.error(f"Ошибка в add_category_finish: {e}...
Python
1
{ #[doc = r"Writes `variant` to the field"] #[inline(always)] pub fn variant(self, variant: PLL3_SW_CLK_SEL_A) -> &'a mut W { { self.bit(variant.into()) } } #[doc = "pll3_main_clk"] #[inline(always)] pub fn pll3_sw_clk_sel_0(self) -> &'a mut W { self.vari...
Rust
0
default()) } } /// A `ChunkMapBuilder` for `Array` chunks. #[derive(Clone, Copy)] pub struct ChunkMapBuilderNxM<N, T, Chan> { pub chunk_shape: PointN<N>, pub ambient_value: T, marker: std::marker::PhantomData<Chan>, } impl<N, T, Chan> ChunkMapBuilderNxM<N, T, Chan> { pub const fn new(chunk_shape: ...
Rust
0
with a message. struct DropBomb(&'static str); impl DropBomb { fn with<T, F: FnOnce() -> T>(message: &'static str, f: F) -> T { let bomb = DropBomb(message); let ret = f(); mem::forget(bomb); ret } } impl Drop for DropBomb { fn drop(&mut self) { use std::io::Write;...
Rust
0
elem_1*meas_elem_1 + kept_elem_2*meas_elem_2) + (own_node_meas_fid * (1-remote_node_meas_fid) + (1-own_node_meas_fid) * remote_node_meas_fid)*(kept_elem_1*meas_elem_3 + kept_elem_2*meas_elem_4)) \ + (1 - own_node_gate_fid * remote_node_gate_fid) / 8 new_elem_2 = own_node_gate_fid * ...
Python
1
n" @property def mimetype(self) -> str: return str(self.response.headers.get("Content-Type", "application/json")) @property def headers(self) -> Headers: return Headers(dict(self.response.headers)) def validate_request(response: HTTPResponse) -> None: """Validate an API request""...
Python
1
actory.rs net.sf.jasperreports.export.PropertiesDefaultsConfigurationFactory net.sf.jasperreports.export.PropertiesDefaultsConfigurationFactory$PropertiesDefaultsInvocationHandler use crate::common::models::addresses::AddressEx; use crate::common::models::backend::transfers::{ Erc20Transfer as Erc20TransferDto, Tra...
Rust
0
.load_calculation_log(chain) .expect(&format!("No calculation log for chain {}", &chain)) { if log_details.calculating_start - log_details.newest_block_timestamp > Duration::days(1) { is_data_too_old = tr...
Rust
0
L _Bufl (FAT and DIR sectors buffer) // $4BA.L _Hz_200 (Raw 200 Hz timer tick) // $4BE.L The_env (Default environment string) // $4C2.L _Drvbits (32 bit vector of live block devices) // $4C6.L Dskbufp (Pointer to common disk buffer - 1 Kb) // $4CA.L _Autopath (Pointer to autoexec...
Rust
0
= nn.Conv1d(in_channels=d_ff, out_channels=d_model, kernel_size=1, bias=False) self.decomp1 = series_decomp(moving_avg) self.decomp2 = series_decomp(moving_avg) self.decomp3 = series_decomp(moving_avg) self.dropout = nn.Dropout(dropout) self.projection = nn.Conv1d(in_channels=d_...
Python
1
import ssl import urllib.request from typing import Dict, Any import xmltodict from Bio.Blast import NCBIWWW from api_models import BlastType def choose_dataset(program): if program in ["blastn", "tblastx", 'tblastn']: return "nt" elif program in ["blastp", "blastx"]: return "nr" raise V...
Python
1
-> bool { self.bit() } #[doc = r" Value of the field as raw bits"] #[inline] pub fn bit(&self) -> bool { match *self { ERSAREQR::_0 => false, ERSAREQR::_1 => true, } } #[allow(missing_docs)] #[doc(hidden)] #[inline] pub fn _from(value:...
Rust
0
a> fmt::Write for PadAdapter<'a, 'b> { fn write_str(&mut self, mut s: &str) -> fmt::Result { while !s.is_empty() { if self.on_newline { self.fmt.write_str(" ")?; } let split = match s.find('\n') { Some(pos) => { self...
Rust
0
-gui/"; pub const EXECUTABLE_NAME: &'static str = "express-vpn-gui"; pub const PATH_IMAGE_LOGO: &'static str = "express-vpn-gui/logo.png"; pub const PATH_IMAGE_ON: &'static str = "express-vpn-gui/on.png"; pub const PATH_IMAGE_OFF: &'static str = "express-vpn-gui/off.png"; pub const PATH_DESKTOP_ENTRY: &'static str...
Rust
0
ransform = datasets.modelfamily_to_transforms[modelfamily_oe]['train'] test_oe_transform = datasets.modelfamily_to_transforms[modelfamily_oe]['test'] trainset_oe = dataset_oe(train=True, transform=train_oe_transform,download=True) testset_oe = dataset_oe(train=False, transform=test_oe_transform,download=Tru...
Python
1
# -*- coding: utf-8 -*- from vsg import token from vsg.rules import ( align_tokens_in_region_between_tokens_unless_between_tokens as Rule, ) lAlign = [] lAlign.append(token.element_association.assignment) lUnless = [] oStartToken = token.constant_declaration.assignment_operator oEndToken = token.constant_declar...
Python
1
izer: S) -> Result<S::Ok, S::Error> where S: Serializer, { serializer.collect_seq(source.iter().map(|(k, v)| { ( SerializeAsWrap::<K, KAs>::new(k), SerializeAsWrap::<V, VAs>::new(v), ...
Rust
0
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries # # SPDX-License-Identifier: MIT """Definition for the AllWinner H618 chip"""
Python
1
def decorar_saludo(funcion): def otra_funcion(palabra): print('Hola') funcion(palabra) print('adios') return otra_funcion def mayusculas(texto): print(texto.upper()) def minusculas(texto): print(texto.lower()) mayuscula_decorada = decorar_saludo(mayusculas) mayuscula_decor...
Python
1
import re import csv from collections import Counter logFile="./sample.log" def countIpAddress(file_path): ip_pattern = r'\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b' # ip address regex from https://learn.microsoft.com/en-us/answers/questions/1633102/regex-validation-for-ip-address-fields-in-azure-wo with open(f...
Python
1
.return_const(dependency_directory); let mut mock_file_downloader = MockFileToStringDownloaderTrait::new(); mock_file_downloader .expect_download_file_then_parse_to_string() .withf(move |url, path| { url == "https://raw.githubusercontent.com/Solipath/Solipat...
Rust
0
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. import sys import pytest import os import networkx as nx import random import deepgnn.graph_engine.snark.preprocess.sampler.metric as metr @pytest.fixture def graph_choice_one(): random.seed(5) g = nx.scale_free_graph(1000, seed=100) ...
Python
1
txnPoolNodeSet, sdk_wallet_steward, sdk_pool_handle, send_revoc_reg_def_by_default): revoc_def_req, _ = send_revoc_reg_def_by_default rev_reg_entry = build_revoc_reg_entry_for_given_revoc_reg_def(revoc_...
Python
1
response.status_code == 200: print(f"서버 연결 성공: {url}") connected = True break except: continue if not connected: print("서버 연결 실패") print("\n내장 서버 사용:") print(" python main.py (자동으로 내장 서...
Python
1
:WM_MENUCOMMAND { WININFO_STASH.with(|stash| { let stash = stash.borrow(); let stash = stash.as_ref(); if let Some(stash) = stash { let menu_id = GetMenuItemID(stash.info.hmenu, w_param as i32) as i32; if menu_id != -1 { sta...
Rust
0
ru: [u32; 4], pub inp_fport: u32, pub inp_faddru: [u32; 4], pub unp_conn: u64, pub pipe_peer: u64, pub pipe_state: u32, pub kq_count: u32, pub kq_state: u32, __unused1: u32, pub p_pid: u32, pub fd_fd: i32, pub fd_ofileflags: u32, pub p_uid: u32, pub p_gid: u32, ...
Rust
0
} } Err(e) => file_results.error = Some(e.to_string()), } file_results.testing_time = start.elapsed().as_millis(); file_results } /// The main scanner process. /// /// Should be called with parsed options corresponding to the `scan` command. pub fn scan_main(opt: ScanOpt) -> Result<(), st...
Rust
0
from flask import Flask, request, jsonify from flask_cors import CORS from PIL import Image import pytesseract import io import base64 app = Flask(__name__) CORS(app) # <-- Add this line to allow requests from extensions pytesseract.pytesseract.tesseract_cmd = r"C:\Program Files\Tesseract-OCR\tesseract.exe" @app.ro...
Python
1
""" Program: Check if Array is Sorted (Ascending Order) GFG Link: https://www.geeksforgeeks.org/problems/check-if-an-array-is-sorted0701/1 Description: ------------ This program checks whether the given list of elements is sorted in non-decreasing (ascending) order. Logic: ------ - Iterate through the list from inde...
Python
1
vent = GPSEvent.from_kafka_message(gps_data) processed += 1 print(f"📍 Evento GPS #{processed}") print(f" 🚗 Motorista: {str(gps_event.driver_id)[:8]}...") print(f" 📍 Zona: {gps_event.zone_name} ({gps_event.zone_ty...
Python
1
from functools import wraps from logging import getLogger import orjson from redis import Redis from ordering.settings import REDIS_URL cache = Redis.from_url(REDIS_URL) logger = getLogger(__name__) def serialized_response(response): def handle_bytes(value): if isinstance(value, bytes): re...
Python
1
NAVAILABLE"; const BUSY_TENTATIVE = "BUSY-TENTATIVE" ); parameter!(Language, "LANGUAGE"); parameter!(Member, "MEMBER"); parameter_with_const!( /// [Format definitions of participation statuses of calendar users](https://tools.ietf.org/html/rfc5545#section-3.2.12) PartStat, "PARTSTAT", /// `PartStat` for...
Rust
0
import logging from typing import AsyncGenerator, Dict from fastapi import APIRouter, Depends, HTTPException from sqlalchemy.ext.asyncio import AsyncSession from sqlalchemy import delete from app.core.database import SessionLocal from app.core.models import Asset, Metric logging.basicConfig(level=logging.INFO) logger...
Python
1
rn crate libretro_backend; use libretro_backend::{CoreInfo, AudioVideoInfo, PixelFormat, GameData, LoadGameResult, Region, RuntimeHandle, JoypadButton}; use std::slice; use std::mem; struct UnicornCore { uc: unicorn::unicorn::Unicorn, framebuffer: [u32; 400 * 240], audio_buffer: Ve...
Rust
0
index]); slice_fill_unchecked!(zeros, b'0'); } end } /// Optimized implementation for radix-N numbers. /// /// # Safety /// /// Safe as long as the buffer is large enough to hold as many digits /// that can be in the largest value of `T`, in radix `N`. #[inline] pub unsafe fn algorithm<T>(value: T, ra...
Rust
0
), include_expired: None, }, ) .unwrap_err(); assert_eq!(err, numeric_id_error()); // owner_of looks up token ownership for numeric id let res = from_binary::<OwnerOfResponse>( &cw721_base_query( deps.as_ref(), ...
Rust
0
escalacao = [ R.Ceeni ]
Python
1
import FWCore.ParameterSet.Config as cms from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger from L1Trigger.L1TNtuples.l1CaloTowerTree_cfi import * from L1Trigger.L1TNtuples.l1CaloSummaryTree_cfi import * from L1Trigger.L1TNtuples.l1UpgradeTfMuonTree_cfi import * from L1Trigger.L1TNtuples.l1Upg...
Python
1
index = int(nodeTags[i]-1) nodes_coords[index, 0] = coord[int(3*i)] nodes_coords[index, 1] = coord[int(3*i+1)] nodes = np.zeros([len(nodes_coords), 3]) for i in range(len(nodes_coords)): nodes[i,0] = nodes_coords[i,0] nodes[i,1] = nodes_coords[i,1] nodes[i,...
Python
1
r, ALICE); assert_eq!(kitty.price, None); }); } #[test] fn breed_kitty_error_by_kitty_not_exist() { new_test_ext().execute_with(|| { assert_noop!( Kitties::breed_kitty(Origin::signed(ALICE), 0, 2), Error::<Test>::KittyNotExist ); }); } #[test] fn breed_kitty_error_by_kitty_not_owner() { new_test_...
Rust
0