text
string
label_name
string
labels
int64
""" module: models/generators/__init__ """ from .AES_cipher import AESCipher from .hash_generator import generate_login_hash from .password_generator import password_generator __all__ = [AESCipher, generate_login_hash, password_generator]
Python
1
0 0x00, 0x42, 0x7F, 0x40, 0x00, // 1 0x42, 0x61, 0x51, 0x49, 0x46, // 2 0x21, 0x41, 0x45, 0x4B, 0x31, // 3 0x18, 0x14, 0x12, 0x7F, 0x10, // 4 0x27, 0x45, 0x45, 0x45, 0x39, // 5 0x3C, 0x4A, 0x49, 0x49, 0x30, // 6 0x01, 0x71, 0x09, 0x05, 0x03, // 7 0x36, 0x49, 0x49, 0x49, 0x36, // 8 0x...
Rust
0
import torch import torch.nn as nn from torchvision import models import ssl ssl._create_default_https_context = ssl._create_unverified_context device = torch.device("cpu") class Vgg16(nn.Module): def __init__(self): super(Vgg16, self).__init__() device = torch.device("mps") features = mode...
Python
1
executor = WorkflowExecutor( name=self.workflow_id, steps=steps, max_retries=3, retry_delay=1.0, exponential_backoff=True, ) result = executor.execute() if result.get("success", False): logger.info(f"Fact finding co...
Python
1
import random import time import requests from lxml import etree import csv # 随机获得ua def get_ua(): first_num = random.randint(55, 62) third_num = random.randint(0, 3200) fourth_num = random.randint(0, 140) os_type = [ '(Windows NT 6.1; WOW64)', '(Windows NT 10.0; WOW64)', '(X11; Linux x86_64)'...
Python
1
elta * max_bars current_start = request.start while current_start < request.end: current_end = min(current_start + chunk_duration, request.end) chunk_bars = await self._fetch_candles( symbol, request.bar_type, ...
Python
1
b))/(cos(2a) + cosh(2b)) let (two_re, two_im) = (self.re + self.re, self.im + self.im); let (s, c) = two_re.sin_cos_p::<P>(); Self::new(s, two_im.sinh()).unscale(c + two_im.cosh_p::<P>()) } /// Computes the principal value of the inverse sine of `self`. /// /// This function has...
Rust
0
+1) inputfiles = [] for i in range(n): idx = offset + i # starts with 0. filepath = mc4_glob_pattern.format(idx) inputfiles.append(filepath) ### test #res = worker(inputfiles[0]) #print(res) #sys.exit(-1) def handler(signum, frame): global...
Python
1
lf>; fn open(&mut self, path: &CStr, flags: libc::c_int) -> RawFd; fn close(&mut self, fd: RawFd); fn activate_vt(&mut self, vt: libc::c_int) -> bool; fn get_vt(&mut self) -> libc::c_int; unsafe fn into_weston(self) -> *mut weston_launcher { let mut wrapper = Box::new(LauncherWrapper { ...
Rust
0
erValue: u64, pub notificationId: u32, } #[test] fn bindgen_test_layout_VREvent_Notification_t() { assert_eq!(::std::mem::size_of::<VREvent_Notification_t>() , 16usize); assert_eq!(::std::mem::align_of::<VREvent_Notification_t>() , 8usize); } impl Clone for VREvent_Notification_t { fn clone(&self) -> Se...
Rust
0
import numpy as np import matplotlib.pyplot as plt import pandas as pd # Load the Iris dataset file_path = "E:\MACHINE LEARNING\LAB ML\week8\iris.csv" iris_df = pd.read_csv(file_path) # Extract features and labels X = iris_df.iloc[:, :-1].values # Features y = iris_df.iloc[:, -1].values # Labels # Standardize the...
Python
1
cfg(any(feature = "v2_16", feature = "dox"))] pub fn is_opaque(&self) -> bool { unsafe { from_glib(ffi::webkit_security_origin_is_opaque(self.to_glib_none().0)) } } #[cfg(any(feature = "v2_16", feature = "dox"))] fn to_string(&self) -> String { unsafe { f...
Rust
0
.is_empty() { self.then_block.0.span } else { self.else_block.0.span }; self.if_span.join(last_span).unwrap_or(self.if_span) } } impl For { fn span(&self) -> Span { self.for_span.join(self.block.0.span).unwrap_or(self.for_span) } } impl Match { f...
Rust
0
# Licensed to the Software Freedom Conservancy (SFC) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The SFC licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
pu: &mut Cpu) { let addr = cpu.read_reg16(Reg16::WZ); let memval = cpu.read_word(addr); cpu.contend_read_no_mreq(addr); update_flags_bit(cpu, self.b, memval & (1 << self.b) != 0); update_xyflags_bit(cpu); cpu.inc_pc(2); } fn get_accessed_regs(&self) -> (Output...
Rust
0
####################### # Dennis MUD # # revoke_exit.py # # Copyright 2018-2020 # # Sei Satzparad # ####################### # ********** # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal i...
Python
1
from web3 import Web3 from argparse import ArgumentParser from encode_verification_data import encode_call def main(): parser = ArgumentParser() parser.add_argument('--rpc-url', default='https://ethereum-holesky-rpc.publicnode.com', help='RPC URL (default: https://ethereum-holesky-rpc....
Python
1
name, "foobadger"); assert_eq!(json.krate.max_version, "1.0.0"); let json = anon.show_crate("foobadger"); let badges = json.krate.badges.unwrap(); assert_eq!(badges.len(), 1); assert_eq!(badges[0].badge_type, "travis-ci"); assert_eq!( badges[0].attributes["repository"], Some(Str...
Rust
0
ting' in d: o.rating = d['rating'] if 'recommend' in d: o.recommend = d['recommend'] if 'scenarios' in d: o.scenarios = d['scenarios'] if 'shop_logo_photo' in d: o.shop_logo_photo = d['shop_logo_photo'] if 'shop_name' in d: o.sh...
Python
1
let mut descend = false; if show_deleted || entry.status != memo::FileStatus::Removed { let path = cursor.path().unwrap(); entries.push(Entry { file_type: entry.file_type, depth: entry.depth, name: entry....
Rust
0
yan => format!("{}", color::Fg(color::Cyan)), Color::Green => format!("{}", color::Fg(color::Green)), Color::LightBlack => format!("{}", color::Fg(color::LightBlack)), Color::LightBlue => format!("{}", color::Fg(color::LightBlue)), Color::LightCyan => format!("{}", color:...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayAssetPointPointprodBudgetlibCreateResponse(AlipayResponse): def __init__(self): super(AlipayAssetPointPointprodBudgetlibCreateResponse, self).__init__() self._b...
Python
1
elf.files.len() as u32, self.files.iter().map(|(_, size)| *size).sum(), ), |(num_files, size), tree| { let stats = tree.1.stats(); (num_files + stats.0, size + stats.1) }, ) } pub(crate) fn subtree(&self, path: &Path) -...
Rust
0
ident +)* $lf: lifetime) => { type Item = $source::Item; type Err = $source::Err; fn box_subscribe( self: Box<Self>, observer: Box< dyn Observer<Item=Self::Item,Err= Self::Err> + $($marker +)* $lf >, ) -> Box<dyn SubscriptionLike + $($marker +)*> { Bo...
Rust
0
from airflow.contrib.operators.slack_webhook_operator import SlackWebhookOperator from airflow.hooks.base_hook import BaseHook from airflow.models import Variable SLACK_CONN_ID = "slack_devops_notifications" def task_fail_slack_alert(context): """ Callback task that can be used in DAG to alert of failure ta...
Python
1
#========================================================================= # lui #========================================================================= import random from pymtl import * from tests.context import lizard from tests.core.inst_utils import * from lizard.config.general import * #---------------------...
Python
1
type: abitype::AbiType, ty_str: &'static str) { let poly = poly_for_str(ty_str); assert_eq!(abi_type, specific_abi_type_for_ty_ref(&poly)); } #[test] fn test_specific_abi_type_for_ty_ref() { assert_abi_type_for_str(abitype::AbiType::Bool, "true"); assert_abi_type_for_str(abi...
Rust
0
from flask import Flask from flask import request from models.DeeppavlovApp import DeeppavlovApp from deeppavlov import configs, build_model import json import logging logger = logging.getLogger(__name__) if (logger.hasHandlers()): logger.handlers.clear() logging.basicConfig(filename = "app.log", level = logging....
Python
1
w.value self.s3pw.value = self.s1pw.value self.pincw.value = (self.s2pw.value + self.s1pw.value) * 2 elif self.sym == SYM_2: self.s2pw.value = self.s4pw.value = 0 if is_pinc: self.s1pw.value = self.s3pw.value = self.pincw.value / 2 else...
Python
1
matchers) = match maybe_lpadded(label_matchers)(rest) { Ok((r, ms)) => (r, ms), Err(nom::Err::Error(_)) if metric.is_some() => (rest, vec![]), Err(e) => return Err(e), }; let (rest, duration) = match maybe_lpadded(range_duration)(rest) { Ok((r, d)) => (r, Some(d)), Err(...
Rust
0
import pandas as pd import matplotlib.pyplot as plt import matplotlib.animation as animation import tkinter as tk from tkinter import ttk, filedialog, messagebox from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg import tkinter.font as tkFont import argparse import threading import time import sys import o...
Python
1
mut self) -> usize { let mut hook_count: usize = 0; for config in &mut self.native_hookers { // 已经hook过的不再进行hook // 状态设置为关闭的不再进行hook if config.get_activate_status() || !config.get_activate_switch() { continue; } match config.get...
Rust
0
vertices.push(Point3::new(x, y, z)) } } } // Second, generate indices. for i in 0..nx { for j in 0..ny { for k in 0..nz { // See https://www.ics.uci.edu/~eppstein/projects/tetra/ // for the 5-eleme...
Rust
0
abc)") parser.add_argument("--interval", type=int, help="Data range index, only required for abc/deepcad") args = parser.parse_args() if args.option == 'deepcad': OUTPUT = 'deepcad_parsed' elif args.option == 'abc': OUTPUT = 'abc_parsed' else: OUTPUT = 'furniture_parse...
Python
1
&OthelloBoard) -> Action { print_prompt(); loop { let mut input = String::new(); io::stdin() .read_line(&mut input) .expect("Failed to read line"); let input = input.trim(); if input.to_lowercase() == "pass" { ...
Rust
0
# -*- coding: utf-8 -*- import re import typing as t from urllib.parse import urlencode import jsonpath_rw as jsonp from utils.processed_class import Url from utils.website import KaobeiUtils, KbBookInfo, Episode from .basecomicspider import BaseComicSpider, ComicspiderItem, conf pc_domain = "www.2025copy.com" domai...
Python
1
s.err()); counter = (counter + 1) % SAMPLES; }) }); } criterion_group!(sk_ops, bench_sk_update_leaf); criterion_group!(sk_ops_slow, bench_sk_update_seq); //! A Simple Query builder for the db library such as `postgres` mod error; pub mod postgres; pub use crate::postgres::PostgresBuilder; pub u...
Rust
0
''' 该程序作用是把连接 WiFi 的代码封装成函数,开机自连 WiFi 在线文档:https://docs.geeksman.com/esp32/MicroPython/17.esp32-micropython-wifi.html ''' from common.wifi import wifi_connect # 定义 WIFI 的账号密码 ssid = 'GeeksMan' password = '123456qq.' # 连接 WiFi wifi_connect(ssid, password)
Python
1
TOKEN = '7364851017:AAFWnabXd2hN8RZ7VKl-DWxLuAa_sXV2nPY'
Python
1
ning("Kafka producer is not initialized.") return for msg in messages: try: producer.produce(KAFKA_TOPIC, key=msg.get("site_code", "unknown"), value=json.dumps(msg), callback=delivery_report) except BufferError: logger.warning("Kafka buffer full, waiting...") ...
Python
1
csrs, doc(cfg(feature = "comctl")))] pub struct GetNextItemIndex<'a> { pub initial_item: &'a mut LVITEMINDEX, pub relationship: co::LVNI, } unsafe impl<'a> MsgSend for GetNextItemIndex<'a> { type RetType = bool; fn convert_ret(&self, v: isize) -> Self::RetType { v != 0 } fn as_generic_wm(&mut se...
Rust
0
dal input system with validation\n" "└ **Reward:** +1 point for correct solution" ) embed.add_field( name="🧠 Knowledge & Puzzle Games", value=knowledge_games, inline=False ) # 🚀 SPACE SIMULATION GAMES simulation_games = ( "🌌 **Galaxy Explorer** — `!galaxy...
Python
1
e::set(&mut root, "foo.action.bar", "list error"), Ok(false))); assert!(matches!(console::set(&mut root, "foo.action", "prop error"), Ok(false))); } mod _2103_rings_and_rods; // mod _2108_find_first_palindromic_string_in_the_array; // mod _2114_maximum_number_of_words_found_in_sentences; // mod _2119_a_number_after_a_...
Rust
0
fn from(other: i64) -> Self { Self::Integer(other) } } impl From<f64> for Numeric { fn from(other: f64) -> Self { Self::Float(other) } } #[cfg(test)] mod tests { use super::*; use serde_json::{from_str as from_json, to_string as to_json}; use std::collections::hash_map::Default...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ GEE utility functions Requires Python3 Author: Ayush Prasad """ import ee import geopandas as gpd def create_geo(geofile): """ creates a GEE geometry from the input file Parameters ---------- geofile (str) -- path to the file containing the n...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. import os.path as osp import subprocess def get_llama_gemm(): """get the executable binary llama_gemm.""" import os.path as osp import lmdeploy lmdeploy_dir = osp.split(lmdeploy.__file__)[0] bin_path = osp.join(lmdeploy_dir, 'bin', 'llama_gemm') ...
Python
1
d, None); Ok(Repo { name: self.name.clone(), root: RepoRoot::Local { path: checkout.clone(), branch: branch_name.as_ref().to_string().into(), }, clobber: false, commit: None, }) } pub fn merge_branch<T>(&self, checkout: &PathBuf, branch...
Rust
0
def choose_num(x, y): """This function takes two positive numbers x and y and returns the biggest even integer number that is in the range [x, y] inclusive. If there's no such number, then the function should return -1. For example: choose_num(12, 15) = 14 choose_num(13, 12) = -1 """ i...
Python
1
class Solution: def longestPalindrome(self, s: str) -> int: ans = 0 count = collections.Counter(s) for c in count.values(): ans += c if c % 2 == 0 else c - 1 hasOddCount = any(c % 2 == 1 for c in count.values()) return ans + hasOddCount
Python
1
rt_eq!(try_js_intern!("a") as *const _, js_intern!("a") as *const _); } */ }<gh_stars>1-10 use std::{fs, process::Command}; mod common; #[test] fn objects_dir_is_empty() { common::compare_git_and_rsgit(|cmd, path| { Command::new(cmd) .args(&["init", path.to_str().unwrap()]) .out...
Rust
0
ass), }) } /// Create a new Client. pub fn from_jsonrpc(client: jsonrpc::client::Client) -> Client { Client { client: client, } } /// Get the underlying JSONRPC client. pub fn get_jsonrpc_client(&self) -> &jsonrpc::client::Client { &self.client }...
Rust
0
_work_offset, global_work_size, &mut suggested_local_work_size, ) }; if CL_SUCCESS != status { Err(status) } else { Ok(suggested_local_work_size) } } #[cfg(feature = "cl_arm_import_memory")] pub fn import_memory_arm( context: cl_context, flags: cl...
Rust
0
&Options) -> Result<(), Box<dyn Error>> { let config = Config::from_file(Path::new("dot.toml"))?; let root = Path::new(""); if let Some(action) = &options.action { match action { Action::Apply => { if let Some(filter) = &options.filter { match filter...
Rust
0
Abi: # $rX & $fX regs can be interspersed in function args, unlike in the MIPS O32 ABI intptr_regs = [r for r in self.argument_regs if r.register_name[0] != "f"] float_regs = [r for r in self.argument_regs if r.register_name[0] == "f"] known_slots: List[AbiArgSlot] = [] candida...
Python
1
from dataclasses import dataclass from paddle_billing.Operation import Operation from paddle_billing.Undefined import Undefined from paddle_billing.Entities.DateTime import DateTime from paddle_billing.Entities.Shared import CollectionMode, CurrencyCode, CustomData from paddle_billing.Entities.Subscriptions import ( ...
Python
1
x`: Number to be split /// * `precision`: Number of decimals to be obtained. /// /// /// Return: /// /// (Y,Z) where Y represents the integer part and Z the decimal part. fn modf(x:f64,precision:f64)->(i64,i64){ let y= x as i64; let mut z=x-(y as f64); z=z*precision; z=(z*precision).round()/precision; ...
Rust
0
from django.contrib import admin from django.urls import path, include from django.urls import re_path from .views import RegisterUserView, UserSubscriptionsAPIView, UserBalanceAndLinkAPIView, ToggleAutoRenewAPIView # urls.py urlpatterns = [ path('api/register/', RegisterUserView.as_view()), path('user-subscr...
Python
1
"bbb".to_owned()), 3 ); assert_eq!( Solution::find_lu_slength("aaa".to_owned(), "aaa".to_owned()), -1 ); } } <reponame>DavidPartouche/nannou use self::ui::input::state::mouse::ButtonPosition; use crate::Model; use nannou::geom::rect::Rect; use nannou::pre...
Rust
0
ptions { options: vec![option], }, } } pub fn option( self, name: impl Into<String>, description: impl Into<String>, f: impl FnOnce(ApplicationCommandOptionBuilder<option_state::RegularIncomplete>) -> ApplicationCommandOptionBuilder<option_sta...
Rust
0
from nicegui import ui import sessioncontroller from internationalization import translate @ui.page('/login') async def loginpage(): if sessioncontroller.hasToken(): ui.navigate.to('/index') else: ui.label(translate('loginHeader')) ui.input(label=translate('loginServerIP'), placeholde...
Python
1
::{DlModule, Limits, MmapRegion, Region}; //! //! let module = DlModule::load("/my/lucet/module.so").unwrap(); //! let region = MmapRegion::create(1, &Limits::default()).unwrap(); //! #[repr(C)] //! struct MyForeignContext { x: u32 }; //! let mut foreign_ctx = Box::into_raw(Box::new(MyForeignContext{ x: 0 })); //! let ...
Rust
0
# print out the response sys.stdout.write("%s is at %s named %r\n" % (apdu.objectIdentifier[1], apdu.pduSource, device_name)) # do something with nothing? else: if _debug: DiscoveryApplication._debug(" - ioError or ioResponse expected") # # DiscoveryConsoleCmd # @bacp...
Python
1
ARA"); assert_eq!(format!("{}", LanguageCode::Arc), "ARC"); assert_eq!(format!("{}", LanguageCode::Arg), "ARG"); assert_eq!(format!("{}", LanguageCode::Arm), "ARM"); assert_eq!(format!("{}", LanguageCode::Arn), "ARN"); assert_eq!(format!("{}", LanguageCode::Arp), "ARP"); assert_eq!(format!("{}",...
Rust
0
afka::config::{ClientConfig, TopicConfig}; use rdkafka::consumer::stream_consumer::StreamConsumer; use rdkafka::consumer::{Consumer, EmptyConsumerContext}; use rdkafka::error::KafkaError; use rdkafka::message::{BorrowedMessage, Message, OwnedMessage}; use rdkafka::producer::FutureProducer; use rdkafka::util::{duration_...
Rust
0
shentsize : u16, e_shnum : u16, e_shstrndx : u16 } #[repr(C)] #[derive(Debug)] struct Elf64_Phdr { p_type : u32, p_flags : u32, p_offset : u64, p_vaddr : u64, p_paddr : u64, p_filesz : u64, p_memsz : u64, p_align : u64 } #[repr(C)] #[derive(Debug,Clone)] struct Elf64_Shdr { ...
Rust
0
from ...utils import get_graphql_content CHECKOUT_LINES_ADD_MUTATION = """ mutation checkoutLinesAdd($checkoutId: ID!, $lines: [CheckoutLineInput!]!) { checkoutLinesAdd(id: $checkoutId, lines: $lines) { checkout { lines { quantity totalPrice { gross { amount ...
Python
1
return {'status': 'error', 'error': str(e)} async def test_anthropic_detailed(): """Test détaillé Anthropic Claude""" print("\n\n🤖 TEST ANTHROPIC CLAUDE - Comparaison des capacités") print("-" * 80) try: from anthropic import Anthropic api_key = os.getenv('ANTHROPIC_API_...
Python
1
PlanarLayout { pub num_planes: usize, horizontal_subsampling: [u32; 3], vertical_subsampling: [u32; 3], bytes_per_pixel: [u32; 3], } static PACKED_1BPP: PlanarLayout = PlanarLayout { num_planes: 1, horizontal_subsampling: [1, 0, 0], vertical_subsampling: [1, 0, 0], bytes_per_pixel: [1,...
Rust
0
CII character is allowed to appear in `userinfo` #[inline] #[must_use] pub(crate) const fn is_ascii_userinfo_ipvfutureaddr(c: u8) -> bool { (TABLE[c as usize] & MASK_USERINFO_IPVFUTUREADDR) != 0 } /// Returns `true` if the given non-ASCII character is allowed to appear in `iuserinfo`. #[inline] #[must_use] pub(cra...
Rust
0
({a:1, a:2}).a", "var x = 2"); fold("var x = ({a:1, a:foo()}).a", "var x = foo()"); fold("var x = ({a:foo()}).a", "var x = foo()"); fold( "function f() { return {a:1, b:2}.a; }", "function f() { return 1; }", ); // GETELEM is handled the same way. fold("var x = ({'a':1})['a']"...
Rust
0
{ return Ok(ipaddr); } Err(Error::PlatformNotSupported(env::consts::OS.to_string())) } #[cfg(target_os = "windows")] { use std::env; let ifas = crate::windows::list_afinet_netifas()?; if let Some((_, ipaddr)) = find_ifa(ifas, "Ethernet") { ...
Rust
0
() sha256_pattern = re.compile( r"([a-fA-F0-9]{64})\s+\d+\s+([^/\s]+/[^/\s]+)/(Packages|Sources)(?:\s|\n)" ) matches = sha256_pattern.findall(sha256_section) sha256_dict = {path: sha for sha, path, _ in matches} # Verify that all by-hash files are available for path, sha256 in sha256_di...
Python
1
ve.\n"; wr += "Use Quick + Update mode. All features available there\n\n\n\n\n"; wr += "Information on default setup\n"; wr += "1. Desgined for manually setting hyper-parameters\n"; wr += "2. Only few modifiable parameters.\n\n"; wr += "Use Case\n"; wr += "1. Manual setti...
Python
1
6, 8, 4, 5, 6, 3, 7, 4, 5, 6, 3, 7, 4, 5, 6, 3, 7, 4, 5, 6, 9, 4, 5, 6, 3, 7, 4, 5, 6, 3, 7, 4, 5, 6, 8, 4, 5, 6, 3, 7, 4, 5, 6, 3, 7, 4, 5, 6, 8, 4, 5, 6, 3, 7, 4, 5, 6, 3, 7, 4, 5, 6, 3, 7, 4, 5, 6, 10, 4, 5, 6, 11, 4, 5, 6, ]; fn get_pvk_from_bytes_254() -> Result< ark_groth...
Rust
0
from Cocoa import * from Quartz import * import math def doAlphaRects(context): # ***** Part 1 ***** ourRect = CGRectMake(0.0, 0.0, 130.0, 100.0) numRects = 6 rotateAngle = 2 * math.pi / numRects tintAdjust = 1./numRects # ***** Part 2 ***** CGContextTranslateCTM(context, 2*ourRect.size....
Python
1
][Self::to_simd()] into account. /// /// Returns `false` if `sample_index` is out of bounds. #[cfg(feature = "simd")] #[allow(clippy::wrong_self_convention)] #[inline] pub fn from_channel_simd<const LANES: usize>( &mut self, sample_index: usize, vector: Simd<f32, LANES>, ...
Rust
0
lot_clock::scrape_for_metrics::<T::EthSpec, T::SlotClock>(&beacon_chain.slot_clock); beacon_chain::scrape_for_metrics(beacon_chain); } if let (Some(db_path), Some(freezer_db_path)) = (ctx.db_path.as_ref(), ctx.freezer_db_path.as_ref()) { store::scrape_for_metrics(db_path, freezer_db...
Rust
0
, types::{ Image, ImageList, }, }; pub use url::Url; /// Nekos lib error #[derive(Debug, thiserror::Error)] pub enum Error { /// Reqwest HTTP Error #[error(transparent)] Reqwest(#[from] reqwest::Error), /// Invalid URL #[error(transparent)] InvalidUrl(#[from] url::ParseE...
Rust
0
_random(); let int = i.to_big_int(); let j: Secp256r1Scalar = ECScalar::from(&int); assert_eq!(i.to_big_int(), j.to_big_int()); } #[test] fn pk_to_hex() { let secret = BigInt::from_hex("79196b247effbe3192763a5c37b18f5d89e7d0a8c83d246917add0a842d5af8b"); l...
Rust
0
t.suptitle('Superancillary v. Extended Precision') plt.tight_layout(pad=0.2, rect=(0,0,1,0.95)) plt.savefig('{fluid:s}.png', dpi = 300) plt.savefig('{fluid:s}.pdf') plt.close() """ if not os.path.exists(plots_path): os.makedirs(plots_path) from pathlib import Path for fluid in CoolProp.__fluids__: print('flui...
Python
1
278., 278.), object: object::LinearMove { motion: Vec3(0., 100., 0.), object: object::Sphere { radius: 65., material: rtiow::material::Material::Lambertian { albedo: rtiow::texture::constant(Vec3::from(0.73)), }, ...
Rust
0
")), 10804); sol_test!(p1_r5: part1(generator(" ####### #..E#G# #.....# #G#...# ####### ")), 10620); sol_test!(p1_r6: part1(generator(" ######### #......G# #G.G...E# ######### ")), 16932); sol_test!(p1_r7: part1(generator(" ###### #.G..# #...E# #E...# ###### ")), 10234); sol_test!(p1_r8: part1(generator(" ###### #...
Rust
0
assert_eq!(sparse_mat.ncols(), shape.1); assert_eq!(sparse_mat.nnz(), 0); } } #[test] #[rustfmt::skip] fn test_matrixmarket_dense_real_general_empty() { // Test several valid zero-shapes of a dense matrix let shapes = vec![ (0, 0), (1, 0), (0, 1) ]; let strings: Vec<String> = shapes .it...
Rust
0
''' Primeiro dia no curso do Luiz Otávio!!! Oque aprendemos?: *#comentarios(Consigo colocar comentarios no meio do codigo, sem aparecer na tela, usando a "#"e logo ápos da hashtag eu escrevo comentario. Ex:#Marcos é gay) *Docstring(Colocando três aspas em cima e três aspas embaixo você cria uma docstring do tamanh...
Python
1
from fabric.api import env, execute, hide, sudo, task from time import sleep import re @task def status(): """Output the RabbitMQ cluster status""" sudo('rabbitmqctl cluster_status', warn_only=True) def cluster_is_ok(): """Check if the cluster is okay. Returns True if so. Prints a message and retu...
Python
1
e_status, break_iter.get_rule_status()); assert_eq!( vec![test.rule_status], break_iter.get_rule_status_vec().unwrap() ); } break_iter.first(); let word_iter = Words::new(&mut break_iter); assert_eq!( vec![ ...
Rust
0
S_GRXSTSR_PERIPHERAL = crate::Reg<u32, _OTG_HS_GRXSTSR_PERIPHERAL>; #[allow(missing_docs)] #[doc(hidden)] pub struct _OTG_HS_GRXSTSR_PERIPHERAL; #[doc = "`read()` method returns [otg_hs_grxstsr_peripheral::R](otg_hs_grxstsr_peripheral::R) reader structure"] impl crate::Readable for OTG_HS_GRXSTSR_PERIPHERAL {} #[doc = ...
Rust
0
from app.generators.pages_generate.pages import READING_LEVEL from app.models.course import load_course from app.models.lessons import load_lesson, save_lesson_quiz from app.utils.chatgpt import open_ai_submit_json from app.models.units import load_unit from app.utils.flatten import list_to_text, unit_standards_to_text...
Python
1
r = utils.get_function(model_or_function) explanation = self.explainer.explain_instance( input_tabular, runner, labels=labels, top_labels=sys.maxsize, num_features=self.num_features, num_samples=num_samples, **explain_instance_...
Python
1
new_state: usize, }, GotAwoken { worker: usize, }, FellAsleep { worker: usize, }, GotInterrupted { worker: usize, }, FoundWork { worker: usize, yields: usize, }, DidNotFindWork { worker: usize, yields: usize, }, St...
Rust
0
E => Point(self.0 + 1, self.1), } } } #[derive(Clone)] struct SearchState { inst: Instant, loc: Point, depth: usize, } fn q1(prog: &Program) -> Result<SearchState> { let mut visited: HashSet<Point> = HashSet::new(); visited.insert(Point(0, 0)); let mut queue: VecDeque<SearchState> ...
Rust
0
value, b.into()); } } #[cfg(test)] mod tests { use super::*; use crate::mock::{new_test_ext, Test}; use frame_support::assert_ok; #[test] fn test_benchmarks() { new_test_ext().execute_with(|| { assert_ok!(test_benchmark_do_something::<Test>()); }); } }<reponame>emi...
Rust
0
from os import getenv from dotenv import load_dotenv load_dotenv() DISCORD_API_TOKEN = getenv("DISCORD_API_TOKEN") Gemini_API_Key = getenv("Gemini_API_Key")
Python
1
import matplotlib.pyplot as pyplot # Create data riding = ((17, 18, 21, 22, 19, 21, 25, 22, 25, 24), (3, 6, 3.5, 4, 5, 6.3, 4.5, 5, 4.5, 4)) swimming = ((17, 18, 20, 19, 22, 21, 23, 19, 21, 24), (8, 9, 7, 10, 7.5, 9, 8, 7, 8.5, 9)) sailing = ((31, 28, 29, 36, 27, 32, 34, 35, 33, 39), (...
Python
1
{ let mut all: HashMap<String, Option<Link>> = HashMap::new(); for (key, value) in &self.other { all.insert(key.into(), Some(value.clone())); } all.insert("self".into(), self.self_.clone()); all.insert("related".into(), self.related.clone()); all.insert("...
Rust
0
) = (*self).into(); let (a, b, c) = (a.point2(), b.point2(), c.point2()); let v = (*v).point2(); fn sign<S>(a: Point2<S>, b: Point2<S>, c: Point2<S>) -> S where S: BaseNum, { (a[0] - c[0]) * (b[1] - c[1]) - (b[0] - c[0]) * (a[1] - c[1]) } ...
Rust
0
import unittest import io import os import tempfile from kivy import setupconfig class ImageTestCase(unittest.TestCase): def setUp(self): from kivy.core.window import Window from kivy.core.image import Image import os self.cls = Image self.image = os.path.join(os.path.dirn...
Python
1
tMaxAccess("read-create") if mibBuilder.loadTexts: rlMirVlanBaseLogicalPortsVlanTag.setStatus("current") _RlMirVlanBaseLogicalPortsStatus_Type = RowStatus _RlMirVlanBaseLogicalPortsStatus_Object = MibTableColumn rlMirVlanBaseLogicalPortsStatus = _RlMirVlanBaseLogicalPortsStatus_Object( (1, 3, 6, 1, 4, 1, 9, 6, ...
Python
1
of bits. use std::ops::Index; static TRUE: bool = true; static FALSE: bool = false; const BITS: usize = 32; type Block = u32; #[inline] fn div_rem(x: usize, d: usize) -> (usize, usize) { (x / d, x % d) } /// **FixedBitSet** is a simple fixed size set of bits that can /// be enabled (1 / **true**) or disabled ...
Rust
0
ccess"] pub fn lockdownd_get_device_name( client: lockdownd_client_t, device_name: *mut *mut ::std::os::raw::c_char, ) -> lockdownd_error_t; } extern "C" { #[doc = " Calculates and returns the data classes the device supports from lockdownd."] #[doc = ""] #[doc = " @param client An i...
Rust
0