text
string
label_name
string
labels
int64
from lxml import etree import requests import math import re from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.edge.options import Options from checkUrl import addGotted from checkUrl import findGotted def work(insertInfo): dict = { 'url': [], 'title': [], ...
Python
1
} } impl core::ops::Deref for TXDEFRD_R { type Target = crate::FieldReader<u32, u32>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl R { #[doc = "Bits 0:31 - This field indicates the number of successfully transmitted frames after a deferral in the half-duplex mode."] ...
Rust
0
import argparse import json import os import numpy as np if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "--datadir", default=".", type=str, help="path to the directory" ) args = parser.parse_args() scenes = os.listdir(args.datadir) print(f"Total {le...
Python
1
from django.urls import path from . import views urlpatterns = [ path("create/", views.CreateMessageView.as_view(), name="create_message"), path( "<uuid:receiver_id>", views.MessageListView.as_view(), name="message_list", ), path( "<uuid:message_id>/delete", vie...
Python
1
i-Tenant inicializado") # Registra diferentes tenants tenants = [ ("advocacia_silva", TenantConfig( tenant_id="advocacia_silva", isolation_level=TenantIsolationLevel.NAMESPACE, retention_policy_days=1825, # 5 anos lgpd_compliant=True )), ...
Python
1
_bitpositions(position) { return Some(err); } if let Some(err) = test_piece_counts(position) { return Some(err); } if let Some(err) = test_castling_rights(position) { return Some(err); } if let Some(err) = test_pawn_invalid_rows(position) { return Some(err); ...
Rust
0
from torch_geometric.graphgym.register import register_config from yacs.config import CfgNode as CN @register_config("cfg_hash_feat") def set_cfg_hash_feat(cfg): """Feature hashing GNN configuration.""" cfg.hash_feat = CN() # Enable feature hashing cfg.hash_feat.enable = False # Name of the node...
Python
1
_mul"), cstr!("__div"), cstr!("__mod"), cstr!("__pow"), cstr!("__unm"), #[cfg(any(feature = "lua54", feature = "lua53"))] cstr!("__idiv"), #[cfg(any(feature = "lua54", feature = "lua53"))] cstr!("__band"), #[cfg(any(feature = "lua54", feature = "lu...
Rust
0
can_rx, can_rx_queue, can_rx_count])] fn can_rx0(cx: can_rx0::Context) { let rx = cx.resources.can_rx; let rx_queue = cx.resources.can_rx_queue; loop { match rx.receive() { Ok(frame) => { rx_queue.enqueue(frame).unwrap(); *...
Rust
0
T = int(input()) for tc in range (T): N, M, K = map(int, input().split()) board = [list(map(int, input().split())) for _ in range (N)] cell_dict = {} dx = [-1, 0, 1, 0] dy = [0, -1, 0, 1] # 줄기세포 정보 딕셔너리에 입력 [활성되기까지 시간, 사망까지 시간, 고유] for i in range (N): for j in range (...
Python
1
lding the step counter. By defaults, it uses sv.global_step. """ super(SVStepCounterThread, self).__init__(sv.coord, sv.save_summaries_secs) self._sv = sv self._sess = sess self._last_time = 0.0 self._last_step = 0 step_counter = sv.global_step if step_counter is None else step_count...
Python
1
returns [isi_wpmr::R](isi_wpmr::R) reader structure"] impl crate::Readable for ISI_WPMR {} #[doc = "`write(|w| ..)` method takes [isi_wpmr::W](isi_wpmr::W) writer structure"] impl crate::Writable for ISI_WPMR {} #[doc = "Write Protection Mode Register"] pub mod isi_wpmr; #[doc = "Write Protection Status Register\n\nThi...
Rust
0
"0123456789abcdefghijklmnopqrstuv", translate_from: "ABCDEFGHIJKLMNOPQRSTUV", translate_to: "abcdefghijklmnopqrstuv", padding: '=', }; /// Base32hex, rfc4648 with padding (alphabet: 0123456789ABCDEFGHIJKLMNOPQRSTUV). pub const BASE32HEX_PAD_UPPER: Encoding = new_encoding! { symbols: "0123456789ABCDEFG...
Rust
0
struct GlfwContextComponent { pub glfw: glfw::Glfw, pub window: glfw::Window, pub events: Receiver<(f64, glfw::WindowEvent)>, pub last_esc: u128, cursor: Cursor, } impl GlfwContextComponent { pub fn new(opts: &cmd_opts::CmdOptions) -> Result<GlfwContextComponent, glfw::InitError> { let mut glfw = glfw::init(g...
Rust
0
_main__': import argparse parser = argparse.ArgumentParser(description='labelme2yolo') parser.add_argument('--i', type=str, default='data/labels', help='json文件所在文件夹') parser.add_argument('--o', type=str, default='data/labels_txt', help='保存txt文件所在文件夹') parser.add_argument('--d', action='store_true',...
Python
1
macro2::TokenStream; use quote::{quote, quote_spanned}; use syn::{parse_macro_input, spanned::Spanned, Data, DeriveInput, Error, Field, Fields, Result}; #[proc_macro_derive(IndexEntry, attributes(key))] pub fn derive_entity(input: proc_macro::TokenStream) -> proc_macro::TokenStream { let input = parse_macro_input!(in...
Rust
0
Some(VirtualHydrogen::H1)) } }, _ => Ok(None) } } fn read_isotope(scanner: &mut Scanner) -> Result<Option<Number>, Error> { let mut digits = String::new(); for _ in 0..3 { match scanner.peek() { Some('0'..='9') => digits.push(*scanner.pop().expect("digit")),...
Rust
0
versions(x)), "Section" => blank_to_null(val, |x| builder.set_section(x)), "Source" => blank_to_null(val, |x| builder.set_source(x)), "Status" => blank_to_null(val, |x| builder.set_status(x)), "Subarchitecture" => blank_to_null(val, |x| builder.set_subarchitecture(x)), "Supported...
Rust
0
ls; mod tables; mod functions; mod union; mod value; mod slot; mod seq; mod tag; /// Anonymous, unifiable type variables generated by `TypeContext`. #[derive(Copy, Clone, PartialEq, Eq, Hash)] pub struct TVar(pub u32); /// In the debugging output the type variable is denoted <code>&lt;#<i>tvar</i>&gt;</code>. impl fm...
Rust
0
bcc/table.py does.) let mut readers: Vec<*mut libbpf::perf_reader> = Vec::with_capacity(cpus.len()); let mut context = PerfReaderCallbackContext { options: &options.display, initial_timestamp: 0, }; for (i, cpu) in cpus.iter().enumerate() { let reader = unsafe { bpf_open_perf_buffer( ...
Rust
0
er(inputBatch ) albedoPred = 0.5 * (albedoDecoder(imBatch, x1, x2, x3, x4, x5, x6) + 1) normalPred = normalDecoder(imBatch, x1, x2, x3, x4, x5, x6) roughPred = roughDecoder(imBatch, x1, x2, x3, x4, x5, x6) depthPred = 0.5 * (depthDecoder(imBatch, x1, x2, x3, x4, x5, x6) + 1) albedoBatch = segBRDFBa...
Python
1
_249) = &input.capacity { object.key("Capacity").string(var_249.as_str()); } Ok(()) } pub fn serialize_structure_crate_model_workspace_request( object: &mut aws_smithy_json::serialize::JsonObjectWriter, input: &crate::model::WorkspaceRequest, ) -> Result<(), aws_smithy_http::operation::Serializ...
Rust
0
ot None: sparse_graph.attr_matrix = sparse_graph.attr_matrix[nodes_to_keep] if sparse_graph.labels is not None: sparse_graph.labels = sparse_graph.labels[nodes_to_keep] if sparse_graph.node_names is not None: sparse_graph.node_names = sparse_graph.node_names[nodes_to_keep] return spa...
Python
1
) { unsafe { ::libctru::gfxSwapBuffers() }; } pub fn swap_buffers_gpu(&self) { unsafe { ::libctru::gfxSwapBuffersGpu() }; } pub fn get_framebuffer_format(&self, screen: Screen) -> FramebufferFormat { unsafe { ::libctru::gfxGetScreenFormat(screen.into()).into() } } pub ...
Rust
0
155, 154, 249, 14, 29, 183, 167, 0, 82, 74, 74, 221, 214, 250, 222, ]; const INVALID_DATA_SIGNATURE: [u8; SIGNATURE_LENGTH] = [0; SIGNATURE_LENGTH]; const DATA_SHA256_HASH: [u8; SHA256_HASH_LENGTH] = [ 31, 130, 90, 162, 240, 2, 14, 247, 207, 145, 223, 163, 13, 164, 102, 141, 121, 28, 93, 72, 36, 252, 142, 65, 5...
Rust
0
w = SystemTime::now(); date.render(now); b.bytes = date.buffer().len() as u64; b.iter(|| { date.render(now); test::black_box(&date); }); } } use crate::internal::{ base::{ Protocol, Session, }, protocol::ReceiveChannel, session::{ channel:...
Rust
0
collapse_loss = tf.norm(cluster_sizes) / number_of_nodes * tf.sqrt( float(self.n_clusters)) - 1 self.add_loss(self.collapse_regularization * collapse_loss) # Calculate MSE loss between the features and reconstructions mse_loss = tf.reduce_mean(tf.square(input_features - recon)) self.add_los...
Python
1
> "B", Self::C => "C", Self::N => "N", Self::O => "O", Self::S => "S", Self::P => "P", Self::F => "F", Self::Cl => "Cl", Self::Br => "Br", Self::I => "I", Self::At => "At", Self::Ts => "Ts...
Rust
0
"""Element classes. This is an auto-generated file. Do not edit. See ../generate.py.""" from typing import Union from reflex.vars import Var as Var from .base import BaseHTML class Blockquote(BaseHTML): """Display the blockquote element.""" tag = "blockquote" # Define the title of a work. cite: Va...
Python
1
#[test] fn initialize_new_addresses() { empty().execute_with(|| { // The init relay block gets inserted roll_to(2); // Insert contributors let pairs = get_ed25519_pairs(3); let init_block = Crowdloan::init_vesting_block(); assert_ok!(Crowdloan::initialize_reward_vec( Origin::root(), vec![ ([1u8;...
Rust
0
#[doc(hidden)] fn extra(&self) -> Option<&str> { self.extra.as_deref() } #[doc(hidden)] fn client_id(&self) -> Option<i32> { self.client_id } } impl RFunction for SetChatDescription {} impl SetChatDescription { pub fn from_json<S: AsRef<str>>(json: S) -> RTDResult<Self> { ...
Rust
0
BTreeMap::new(); let mut builder = Biscuit::builder(&root); builder.add_authority_check(rule( "check1", &[s("test")], &[pred("resource", &[s("ambient"), s("hello")])], )); let biscuit1 = builder.build_with_rng(rng).unwrap(); //println!("biscuit1 (authority): {}", biscuit...
Rust
0
::ast::*; use swc_ecmascript::parser::token::TokenAndSpan; pub fn serialize_program( w: &mut impl Write, f: &mut impl JsonFormatter, file_text: &str, node: &Program, ) -> Result<(), Error> { let mut serializer = FileSerializer::new(w, f, file_text); match node { Program::Module(module) => serializer.se...
Rust
0
import logging import threading import time import pkg.chat.manager import pkg.database.database import pkg.qzone.publisher import pkg.qzone.model import pkg.routines.post_routines import pkg.funcmgr.control as funcmgr from mirai import Image def qzone_cookie_invalidated_callback(): chat_bot = pkg.chat.manager...
Python
1
outputs[FieldHeadNames.PRED_NORMALS] = self.field_head_pred_normals(x) h = torch.cat( [ d, density_embedding.view(-1, self.geo_feat_dim), embedded_appearance.view(-1, self.appearance_embedding_dim), ], dim=-1, ) ...
Python
1
e('file_download_record') op.drop_table('file') op.drop_table('feature_model') op.drop_table('ds_view_record') op.drop_table('ds_download_record') op.drop_table('data_set') op.drop_table('author') op.drop_table('user_profile') op.drop_table('notepad') op.drop_table('fm_meta_data') ...
Python
1
""" Utility Functions For Byte Strings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ .. contents:: Table of Contents :backlinks: none :local: Introduction ------------ Byte specific utility functions used in this specification. """ from ethereum_types.bytes import Bytes from ethereum_types.numeric import FixedUnsigned,...
Python
1
play, "Temperature:", (20, 130)); draw_mid_text(&mut display, "Humidity:", (20, 170)); display } pub fn draw_numbers( value: f32, unit: &str, position: (i32, i32), mut display: Display4in2, ) -> Display4in2 { let mut buf = ArrayString::<[_; 12]>::new(); write!(&mut buf, "{:.2} {}", va...
Rust
0
use libinput, nor * tablet-unstable-v2 headers, so we can't include them */ /* * A generic pen */ /* * Eraser */ /* * A paintbrush-like tool */ /* * Physical drawing tool, e.g. Wacom Inking Pen */ /* * An airbrush-like tool */ /* * A mouse bound to the tablet */ /* * A mouse tool with a lens */ /* * A rotary device ...
Rust
0
from django.contrib import admin from catalog.models import Product, Category @admin.register(Product) class ProductAdmin(admin.ModelAdmin): list_display = ('id', 'name', 'price', 'category') list_filter = ('category', ) search_fields = ('name', 'description') @admin.register(Category) class CategoryAdm...
Python
1
Array(vec![token_string, token_array]); let new_array_ptr = module.asc_new(&token_array_nested).unwrap(); let new_array_obj: AscEnumArray<EthereumValueKind> = module.invoke_export("token_to_array", new_array_ptr); let new_token_ptr = module.invoke_export("token_from_array", new_array_obj); let...
Rust
0
3(&key, false, false, false, None, &mut [ (15787, SocketAddr::new(IpAddr::from(Ipv4Addr::new(127,0,0,1)), 15787)), ].iter()).await.unwrap(); println!("Added onion service v3!"); println!("Now after enabling network clients should be able to connect to this port"); println!("Deleting created on...
Rust
0
#--depends-on ircv3_server_time from src import ModuleManager, utils CAP = utils.irc.Capability(None, "draft/resume-0.5", alias="resume") class Module(ModuleManager.BaseModule): def _setting(self, new): return "resume-token%s" % ("-new" if new else "") def _get_token(self, server, new=False): ...
Python
1
de. 0: Disable. Can be configured in CONF state."] #[inline(always)] pub fn lcd_mode_en(&mut self) -> LCD_MODE_EN_W { LCD_MODE_EN_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bit...
Rust
0
DST_COLOR: u32 = 774u64 as u32; #[doc = "The `WebGL2RenderingContext.ONE_MINUS_DST_COLOR` const."] #[doc = ""] #[doc = "*This API requires the following crate features to be activated: `WebGl2RenderingContext`*"] pub const ONE_MINUS_DST_COLOR: u32 = 775u64 as u32; #[doc = "The `WebGL2RenderingConte...
Rust
0
import pytest from app.news import NewsAPIsTool @pytest.mark.tools @pytest.mark.news @pytest.mark.api class TestNewsAPITool: def test_news_api_tool(self): tool = NewsAPIsTool() assert tool is not None def test_news_api_tool_get_top(self): tool = NewsAPIsTool() result = tool.wr...
Python
1
[A::Item] { panic!() } } pub struct ArrayVec<A: Array> { xs: MaybeUninit<A>, len: usize, } impl<A: Array> ArrayVec<A> { pub fn new() -> ArrayVec<A> { panic!() } } fn main() { let mut buffer = ArrayVec::new(); let x = buffer.last().unwrap().0.clone(); //~^ ERROR type an...
Rust
0
) async def _reset(self, ctx): data = getVC(ctx.guild.id) if ctx.author == ctx.guild.owner or ctx.author.top_role.position > ctx.guild.me.top_role.position: if data["vcrole"]["humans"] == "" and data["vcrole"]["bots"] == "": embed = discord.Embed( desc...
Python
1
сание 23', 'Ночь живых мертвецов, Рассвет мертвецов', 'Война миров, Машина времени'), (24, 'M', 1, 'Описание 24', 'Семь самураев, Сансет бульвар', 'Гордость и предубеждение, Джейн Эйр'), (25, 'M', 1, 'Описание 25', 'Король Лев, Алиса в Стране чудес', 'Алиса в стране чудес, Сквозь зеркало'), (26, 'M', 1, 'Оп...
Python
1
are ignored //! except as described below. //! //! Whitespace is defined as a sequence of zero or more space characters //! (U+0020). Newline sequences (either U+000A or U+000D followed by U+000A) //! are _not_ considered whitespace but are ignored as such in certain contexts. //! //! Horizontal tab characters (U+0009...
Rust
0
*) => {{ let mut dict = $crate::Dictionary::new(); $( dict.set($key, $value); )* dict }} } impl fmt::Debug for Dictionary { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { let entries = self .into_iter() .map(|(key, value)| format!("/{} {:?}", String::from_utf...
Rust
0
let start = Instant::now(); if param.inst { w.push(start); } } }) .parse::<MacHeader>() .parse::<IpHeader>() .metadata(box move |p| { let f = p.get_header().flow(); match f { ...
Rust
0
fn is_stateful() -> bool; fn init() -> Self; fn name() -> &'static str; } #[derive(Debug, Clone)] pub struct ServiceClient { inner: reqwest::Client, } impl ServiceClient { pub async fn request<T: Serialize>( &self, params: &T, url: &str, ) -> Result<String, ServiceError> { ...
Rust
0
let mut nickname = msg.author_nick(&ctx.http).await.unwrap_or("".to_string()); if nickname == "" { nickname = msg.author.name.to_string() } let map = HashMap::from([ ("{uid}", msg.author.id.to_string()), ("{nickname}", nickname), ]); for (key, ...
Rust
0
from unittest import IsolatedAsyncioTestCase from ..indy import V20CredExRecordIndy class TestV20CredExRecordIndy(IsolatedAsyncioTestCase): async def test_record(self): same = [ V20CredExRecordIndy( cred_ex_indy_id="dummy-0", cred_ex_id="abc", c...
Python
1
("000001.15")); } #[test] fn decimal_with_minus_and_leading_zeros() { insta::assert_debug_snapshot!(lex("-00000012.23")); } #[test] fn decimal_with_alphabetical_char() { insta::assert_debug_snapshot!(lex("00001.as244")); } #[test] fn please_keyword() { insta::assert_debug_snapshot!(lex("please")); } #[t...
Rust
0
## Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. ## ## NVIDIA CORPORATION and its licensors retain all intellectual property ## and proprietary rights in and to this software, related documentation ## and any modifications thereto. Any use, reproduction, disclosure or ## distribution of this software a...
Python
1
pass(test_item): return test_item _IN_CI = eval_env("CI", default=False) def _skipIf(condition, reason, key): if not condition: return _pass # In CI, default to fail, so as to prevent accidental skip. # In other env, default to skip var = f"TORCHAUDIO_TEST_ALLOW_SKIP_IF_{key}" skip_...
Python
1
earch_range(self._get_current() + 1, len(self._get_content())) else: assert self._direction == 'backward' self._set_search_range(self._get_current() - 1, 0) self._set_index(self._find_next_match()) def find_previous(self): if self._direction is None: self...
Python
1
import os import time import numpy as np import pandapower as pp from rl_adn.utility.grid import GridTensor from rl_adn.utility.utils import create_pandapower_net ROOT_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), '../rl_adn', 'data_sources')) CONFIG = { 'branch_info_file': os.path.join(ROOT_DIR,...
Python
1
optimize_memory_usage=False, ent_coef="auto" if cfg.train.ent_coef == -1 else cfg.train.ent_coef, # Automatic entropy tuning target_update_interval=1, # Update target network every interval target_entropy="auto" if cfg.train.target_ent == -1 else cfg.train.target_ent, # Automatic target entropy...
Python
1
import json import numpy as np label_map = {"contradiction": '0', "entailment": '1', "neutral": '2'} def format(path=None): np.random.seed(2021) raw_data = open(path, 'r', encoding='utf-8').readlines() num_samples = len(raw_data) idx = np.random.permutation(num_samples) num_train, num_val = int(...
Python
1
import numpy as np from hyperion.model import AnalyticalYSOModel from hyperion.util.constants import rsun, au, msun, sigma # Initalize the model m = AnalyticalYSOModel() # Set the stellar parameters m.star.radius = 2. * rsun m.star.temperature = 4000. m.star.luminosity = 4 * (2. * rsun) ** 2 * sigma * 4000 ** 4 # A...
Python
1
e")] #[serde(deserialize_with = "fix_common::workarounds::from_opt_str")]// https://github.com/serde-rs/serde/issues/1183 #[serde(default)] #[serde(rename = "2236")] pub leg_complex_event_fixed_fx_rate: Option<f64>, /// LegComplexEventDeterminationMethod #[serde(skip_serializing_if = "Option::is_none")] #[serde(...
Rust
0
import matplotlib.pyplot as plt from scipy.interpolate import interp1d import numpy as np temps = [30 * k for k in range(13)] # Temps avec un pas de 30 jours # Extraction des données def extract(f): yy = [] with open('data/' + f, 'r') as file: for line in file: data = line.strip().split(...
Python
1
# Copyright (C) 2020 U S Σ R Δ T O R # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed i...
Python
1
8] = b"1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"; const HASH_KEY_NAME: &str = "contract_package"; const CONTRACT_KEY_NAME: &str = "contract"; const ADD_SMALL_VALUE: u64 = 1; const ADD_LARGE_VALUE: u64 = u64::max_value(); const NEW_UREF_FUNCTION: &str = "new_ur...
Rust
0
Ok(("LATIN", ""))), ("LATIN123", Ok(("LATIN123", ""))), ("123", Ok(("123", ""))), ("erfüllen", Ok(("erfüllen", ""))), ("erfüllen123", Ok(("erfüllen123", ""))), ("조선글", Ok(("조선글", ""))), ("조선글123", Ok(("조선글123", ""))), (" \t\n\x08", Ok(...
Rust
0
""" ThaiParser tests. """ import pytest # pylint: disable=wrong-import-order from lute.models.term import Term from lute.parse.base import ParsedToken from lute_thai_parser.parser import ThaiParser def test_token_count(thai): """ token_count checks. """ cases = [ ("สวัสดี", 1), ("ล...
Python
1
= "*This API requires the following crate features to be activated: `PerformanceNavigationTiming`*"] pub fn to_json(this: &PerformanceNavigationTiming) -> ::js_sys::Object; } use std::collections::HashMap; use std::error::Error; use std::fs::File; use std::io::prelude::*; use std::io::BufReader; use std::io::SeekF...
Rust
0
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1 import typing, winrt import enum _ns_module = winrt._import_ns_module("Windows.Security.Authentication.Web.Core") try: import winrt.windows.foundation except: pass try: import winrt.windows.foundation.collections exce...
Python
1
().gid.eq(&stat_t.gid) { if let Some(group) = hosts_group_map.get(&stat_t.gid) { // 名称不变,换组了,更新组配置 & last in/out let mut inst = group.inst_host(&stat_t.name); if let Some(o) = host { ...
Rust
0
from flask import abort, session from alchemyClasses.Categoria import Categoria from alchemyClasses.CategoriasPredefinidas import CategoriasPredefinidas from alchemyClasses import db from controllers import productoController def agregar_categoria_a_producto(id_producto, categoria): nueva_categoria = Categoria(i...
Python
1
"""" SETS - CONJUNTOS 1 - NÃO TEM ÍNDICE 2 - NÃO ACEITA CONTEÚDO DUPLICADOS 3 - É CONSTRUIDO COM {} ou set() # SET É UM CONJUNTO QUE QUEBRA O # STRING EM VÁRIOS CARACTERES DIFERENTES # SET - NÃO ACEITA CONJUNTO REPETIDO # EX : a = set("LORENA","LORENA","LORENA") # print(a) # DICIONARIO E SETS SÃO BEM SEMELHANTES...
Python
1
from __future__ import annotations from enum import Enum class MetricUnit(Enum): Seconds = "Seconds" Microseconds = "Microseconds" Milliseconds = "Milliseconds" Bytes = "Bytes" Kilobytes = "Kilobytes" Megabytes = "Megabytes" Gigabytes = "Gigabytes" Terabytes = "Terabytes" Bits = "...
Python
1
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries # SPDX-License-Identifier: MIT import time import board import busio import adafruit_is31fl3731 i2c = busio.I2C(board.SCL, board.SDA) # initial display if you are using Pimoroni LED SHIM display = adafruit_is31fl3731.LedShim(i2c) # This list 28 colors f...
Python
1
struct sctpnetlisthead { pub tqh_first: *mut sctp_nets, pub tqh_last: *mut *mut sctp_nets, } #[repr(C)] #[derive(Copy, Clone)] pub struct sctp_asconf_addrhead { pub tqh_first: *mut sctp_asconf_addr, pub tqh_last: *mut *mut sctp_asconf_addr, } /*- * SPDX-License-Identifier: BSD-3-Clause * * Copyright...
Rust
0
<Environment>>>, ) -> Environment { Environment { records: records, parent: Rc::clone(parent), } } pub fn new_global() -> Environment { let mut records: HashMap<String, Object> = HashMap::new(); records.insert( "add".to_string(), ...
Rust
0
from abc import ABC, abstractmethod from imagebaker.core.defs import LayerState from imagebaker import logger class BasePlugin(ABC): def __init__(self, layer_state: LayerState, final_step: int = -1): self.initial_layer_state = layer_state self.final_step = final_step self.current_step = 0...
Python
1
_FILTER_NEAREST: CoglPipelineFilter = 9728; pub const COGL_PIPELINE_FILTER_LINEAR: CoglPipelineFilter = 9729; pub const COGL_PIPELINE_FILTER_NEAREST_MIPMAP_NEAREST: CoglPipelineFilter = 9984; pub const COGL_PIPELINE_FILTER_LINEAR_MIPMAP_NEAREST: CoglPipelineFilter = 9985; pub const COGL_PIPELINE_FILTER_NEAREST_MIPMAP_L...
Rust
0
_path = result_path.clone(); result_path.push("Contents.json"); serde_json::to_writer_pretty( std::fs::File::create(result_path).unwrap(), &Folder { info: Info { ...
Rust
0
from bars import * draw_bar_chart( "scatter_chart.png", ["数量", "百分比"], ["DNS协议", "Pop3邮件协议", "Imap邮件协议", "Smtp邮件协议", "Windows共享", "Ftp文件传输", "tftp文件传输", "文件信息"], [ [109963.99,109963.99], [258.0,60000.0], [5220.0,552.0], [7895.0,3.0], [167.99,80.00], [405....
Python
1
h::check(&auth_rules.0.webhooks.set, auth::RW::Full, &auth)?; match serde_json::to_value(webhooks::create(&*conn.get()?, webhook.into_inner())?) { Ok(webhook) => Ok(Json(webhook)), Err(err) => Err(HecateError::new(500, String::from("Failed to create webhook"), Some(err.to_string()))) } } fn we...
Rust
0
"Sports Match Results", "Weather Forecast Update", "Political News Today", "Technology Breakthrough" ] for i in range(1000): base_idx = i % len(base_titles) variation = i // len(base_titles) article...
Python
1
// “a project developed by MuratAlpTR” import time from steam.client import SteamClient from steam.enums import EResult # Steam oturumu oluştur client = SteamClient() # Giriş bilgilerinizi ve shared secret'ınızı buraya girin username = 'YOUR_USERNAME' password = 'YOUR_PASSWORD' shared_secret = 'YOUR_SHARED_SECRE...
Python
1
est)] mod tests { use super::*; use core::{cell::UnsafeCell, ops::Range}; use test_macros::kernel_test; /// Check alignment of the kernel's virtual memory layout sections. #[kernel_test] fn virt_mem_layout_sections_are_64KiB_aligned() { for i in [ virt_boot_core_stack_region...
Rust
0
shots_allowed = models.FloatField(blank=True, null=True) win_score_first = models.FloatField(blank=True, null=True) win_opp_score_first = models.FloatField(blank=True, null=True) win_lead_first_per = models.FloatField(blank=True, null=True) win_lead_second_per = models.FloatField(blank=True, null=True) ...
Python
1
8}']), (0x2f97c, &['\u{26523}']), (0xfa49, &['\u{722B}']), (0x1eb1, &['\u{0061}', '\u{0306}', '\u{0300}']), (0x2f998, &['\u{82E5}']), (0x304e, &['\u{304D}', '\u{3099}']), (0x1f0d, &['\u{0391}', '\u{0314}', '\u{0301}']), (0xd4a, &['\u{0D46}', '\u{0D3E}']), (0xfb39, &['\u{05D9}', '\u{05BC}...
Rust
0
import numpy as np import pandas as pd from woodwork.column_schema import ColumnSchema from woodwork.logical_types import Boolean, Datetime, Double from featuretools.primitives.base import TransformPrimitive class CumulativeTimeSinceLastFalse(TransformPrimitive): """Determines the time since last `False` value. ...
Python
1
, 26, 26, 26, 26, 26, 26, //! 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, //! 26, 26, 26, 26, 26] //! //! Example-2 (worst case, all strings equal, need check all chars): //! ["aaaaa", ... "aaaaa"] //! //! The benchmark data of best and worst cases: //! test MSD_best_case ... bench: ...
Rust
0
impl<'a, T: ?Sized> Copy for Atom<'a, T> {} impl<'a, T: ?Sized> Clone for Atom<'a, T> { fn clone(&self) -> Self { *self } } // ORDERING AND HASHING impl<'a, T: 'a + ?Sized> PartialEq for Atom<'a, T> { fn eq(&self, other: &Self) -> bool { (self.ptr as *const _) == (other.ptr as *const _) ...
Rust
0
U } mod borrow { use super::*; pub(super) fn encode<W: Write>(x: &str, e: &mut Encoder<W>) -> Result<(), encode::Error<W::Error>> { e.str(x)?.ok() } pub(super) fn decode<'a>(d: &mut Decoder<'a>) -> Result<&'a str, decode::Error> { d.str() } } #[derive(Encode, Decode)] struct Bor...
Rust
0
DIR, c, "Projection", "REST-SEG.png"), # Precomputed Points in the viewpoint (scripts/dataset_generator.py) "pts": os.path.join(cfg.DIR, c, "Points", "%010d.pkl" % f), } for c, v in view_idx.items() # c: city, v: views for f in v ] if ...
Python
1
''' URL := https://leetcode.com/problems/ count-submatrices-with-equal-frequency-of-x-and-y/ 3212. Count Submatrices With Equal Frequency of X and Y Compelxity T = O(MN) S = O(MN) ( Explicit ) O(1) ( Implicit ) ''' class Solution: def numberOfSubmatrices(self, grid: List[List[str]]) -> int: numMatrices = ...
Python
1
ate((self.dic[user], tail), axis=0) self.dic[user] = result print('Generating size factors...') if(size_command == 'max'): for user in all_users: sizes[user] = 1/np.sqrt(sizes[user]) self.size_factor = sizes else...
Python
1
import matplotlib.pyplot as plt # 准备存储提取数据的列表 train_loss = [] test_loss =[] #打开文本文件并读取每一行 with open(r'D:\kechenye\resnet18.txt', 'r') as file: for line in file: # 找到"Time=&"和"&mS"之间的字符串 start_index = line.find("train loss is: ") end_index = line.find(" train correct", start_index) ...
Python
1
_2.clone(), }, ) .build(); let delegator_3_validator_1_delegate_request = ExecuteRequestBuilder::standard( *DELEGATOR_3_ADDR, CONTRACT_DELEGATE, runtime_args! { ARG_AMOUNT => U512::from(DELEGATOR_1_STAKE), ARG_VALIDATOR => VALIDATOR_1.clone(), ...
Rust
0
ax2.grid(True) self.figure.subplots_adjust(hspace=0.6) self.canvas.draw() except ValueError as e: QMessageBox.warning(self, "Ошибка", f"Некорректный ввод: {e}") def calculate_characteristics(self): if not hasattr(self, 'signal'): QMessa...
Python
1
""" models.py ######### Contains the LLM and embedding model names to be used in the application, as well as instantiates the models so that they can be imported and used in other parts of the application. Also contains the model options. """ # Imports from langchain_google_genai import GoogleGenerativeAIEmbeddings...
Python
1
ctor_alphabet::Vector], offset: usize) -> Vec<Vec<usize>> { if remaining_depth == 0 { if remainder.norm == 0 { return vec![vec![]]; } return vec![]; } word_vectors.iter() .enumerate() .skip(offset) .take_while(|(_, vector)| vector.norm * remaining...
Rust
0