text
string
label_name
string
labels
int64
file = open('txt/26_14625.txt').readlines() K, R, M = map(int, file[1].split()) M = M * 2**20 files = [] for i in file[2:]: t, s, e = i.split() p = 1 if e == 'mb': p = 2 ** 20 elif e == 'kb': p = 2 ** 10 s = int(s) * p files.append([int(t), s]) files = sorted(files, key=lambda x...
Python
1
_item("api_owner")).unwrap_or(empty1); let api_uid = unwrap!(ls.get_item("api_uid")).unwrap_or(empty2); let api_key = unwrap!(ls.get_item("api_key")).unwrap_or(empty3); //return (api_owner, api_uid, api_key) }use geom::{Circle, Distance, FindClosest, Polygon}; use sim::TripEndpoint; use widgetry::{ ...
Rust
0
@nightyScript( name="Simple Notes", author="AutoGPT", description="Store and manage short notes.", usage="<p>addnote <text> | <p>notes | <p>delnote <index>" ) def script_function(): """ DATA MANAGER TEMPLATE --------------------- Saves small pieces of text to a JSON file. COMMANDS:...
Python
1
_fn!(py, create_executor(args: String)))?; m.add(py, "destroy_executor", py_fn!(py, destroy_executor(ptr: usize)))?; m.add(py, "get_exec_plan", py_fn!(py, get_exec_plan(ptr: usize)))?; m.add(py, "complete_description", py_fn!(py, complete_description(args: String)))?; m.add(py, "run_executor", py_fn!(py, run_ex...
Rust
0
3.7.0.9.5.5.1.6.1.5"); }) } use crate::{AuthProvider, User}; #[test] fn integration_test() { let mut provider: AuthProvider<Vec<User>> = AuthProvider::default(); let uid = provider.create_user("hunter42").unwrap(); assert!(provider.exists(&uid)); assert!(provider.verify(&uid, "hunter42")); asse...
Rust
0
thing) }; } } let mut fns = HashMap::with_capacity(funcs.len()); for (k, v) in funcs.drain() { fns.insert(k, backend::to_ops(v)); } Ok(Compiled { schemas: HashMap::new(), stores, fns }) }use std::env::args; use std::time::Instant; f...
Rust
0
# Copyright (c) 2021, InterDigital R&D France. All rights reserved. # # This source code is made available under the license found in the # LICENSE.txt in the root directory of this source tree. import os import numpy as np import torch import torch.nn as nn import torch.nn.functional as F import torch.utils.data as ...
Python
1
import os import json import evaluate import sys # Check if sufficient arguments have been provided if len(sys.argv) < 3: print("Usage: python evaluate_toxicity.py <file_path> <log_path>") sys.exit(1) toxicity = evaluate.load("../../../Models/toxicity") total_toxicity_ratio_avg = 0 total_max_toxicity_avg = ...
Python
1
}) } #[no_mangle] pub extern "C" fn wasmtime_store_context(store: &mut wasmtime_store_t) -> CStoreContextMut<'_> { store.store.as_context_mut() } #[no_mangle] pub extern "C" fn wasmtime_context_get_data(store: CStoreContext<'_>) -> *mut c_void { store.data().foreign.data } #[no_mangle] pub extern "C" fn ...
Rust
0
= plt.subplot(4, 1, 4, sharex=ax2) ax4.plot(gen_xaxis_times(argmins, duration), argmins, ":x") ax4.set_title("Index of minimums of CMND") ax4.set_ylabel("Frequency (Hz)") ax4.set_xlabel("Time (seconds)") plt.grid() plt.show() """ # Init tau...
Python
1
import matplotlib import matplotlib.pyplot as plt import matplotlib matplotlib.use('TkAgg') import matplotlib.pyplot as plt import matplotlib.ticker as ticker matplotlib.use('TkAgg') """ Helper script for displaying evaluation data for trained models. """ matplotlib.rcParams.update({'font.size': 12}) eval_losses = [...
Python
1
# # This file is part of pyasn1-modules software. # # Copyright (c) 2005-2017, Ilya Etingof <etingof@gmail.com> # License: http://pyasn1.sf.net/license.html # # PKCS#8 syntax # # ASN.1 source from: # http://tools.ietf.org/html/rfc5208 # # Sample captures could be obtained with "openssl pkcs8 -topk8" command # from pyas...
Python
1
cted register class!"), } } fn get_caller_saves(call_conv: CallConv) -> Vec<Writable<Reg>> { let mut caller_saved = Vec::new(); // Systemv calling convention: // - GPR: all except RBX, RBP, R12 to R15 (which are callee-saved). caller_saved.push(Writable::from_reg(regs::rsi())); caller_saved.pu...
Rust
0
# Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the...
Python
1
dst[1].y = (self.points[0].y + self.points[1].y) / 2.0; dst[2].x = (self.points[0].x + 2.0 * self.points[1].x + self.points[2].x) / 4.0; dst[2].y = (self.points[0].y + 2.0 * self.points[1].y + self.points[2].y) / 4.0; dst[3].x = (self.points[0].x + 3.0 * (self.points[1].x...
Rust
0
s[myid] = asyncio.create_task(trans.run_trans(values, rand_values)) # outputs = await gather_outputs(acss_list) # print(f"outputs: {outputs}") # shares = [output[2][0] for output in outputs] async def tutorial_1(): # Create a test network of 4 nodes (no sockets, just asyncio tasks) n, t = 4,...
Python
1
of numerical features: {total_features}") print(f"Number of features to remove: {len(features_to_remove)}") print(f"Final number of features to keep: {len(indices_to_keep)}") if features_to_remove: print("\nFeatures marked for removal:") for feature in sorted(list(features_to_remove)): ...
Python
1
}).collect(); prop_assert_eq!(patch.hunks, expected_hunks); } #[test] fn test_patch_checksum_err(patch in patches(), checksum in file_checksums()) { let mut serialized = patch.serialize(); // Overwrite patch checksum let offset = seri...
Rust
0
n main_tables_with_aliases]) all_alias_column_pairs.extend([('Main_SQL', alias, column) for alias, column in main_alias_column_pairs]) all_alias_column_pairs.extend([("Main_SQL", None, column) for column in main_col_without_alias]) # # Create DataFrames # df_tables_with_aliases = pd.DataFrame(all_tables...
Python
1
.value_of("arrow") .expect("must provide path to arrow file"); let json_file = matches .value_of("json") .expect("must provide path to json file"); let mode = matches.value_of("mode").unwrap(); let verbose = true; //matches.value_of("verbose").is_some(); match mode { "JS...
Rust
0
primapalooza::is_triangular_number; /// /// println!("{}", primapalooza::is_triangular_number(5)); pub fn is_triangular_number(n: usize) -> bool { perfect_number(n) } <reponame>vtta/rust-pmem<gh_stars>1-10 //! The functions in this section provide optimized copying to persistent memory _without_ draining //! //! ...
Rust
0
# maps/EOTN/_4_gunnars_to_sifhalla.py from Py4GWCoreLib.enums import outpost_name_to_id, explorable_name_to_id # 1) IDs _4_gunnars_to_sifhalla_ids = { # Teleport to Gunnar’s Hold (644) "outpost_id": outpost_name_to_id["Gunnar's Hold"], } # 2) Exit path from outpost 644 _4_gunnars_to_sifhalla_outpost_path = [...
Python
1
if self.editor.foldFlagsAt(line) & \ QsciScintilla.SC_FOLDLEVELHEADERFLAG: f.write('''<span id="hd%d" onclick="toggle('%d')">''' % \ (line, line + 1)) f.wri...
Python
1
oc = "`write(|w| ..)` method takes [rf_reg16::W](rf_reg16::W) writer structure"] impl crate::Writable for RF_REG16 {} #[doc = "REG16"] pub mod rf_reg16; #[doc = "REG17\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with...
Rust
0
r) -> Fallible<(&str, String)> { let (key, secret) = self.check_key()?; // Signature: hex(HMAC_SHA256(queries + data)) let mut mac = Hmac::<Sha256>::new_varkey(secret.as_bytes()).unwrap(); let sign_message = format!("{}{}", url.query().unwrap_or(""), body); trace!("Sign message: ...
Rust
0
# import libraries import numpy as np # define routines def newton(f,fp,p0,tol,Nmax): """ Newton iteration. Inputs: f,fp - function and derivative p0 - initial guess for root tol - iteration stops when p_n,p_{n+1} are within tol Nmax - max number of iterations Returns: p -...
Python
1
#!/usr/bin/env python import math from scipy.odr import Model, Data, ODR from scipy.stats import linregress import numpy def orthoganalDistanceRegression(x, y): ''' Orthoganal Distance Regression ''' beta, res_var, is_successful = _orthoganalDistanceRegression(x, y) if not is_successful: # Regression fails if s...
Python
1
_data_); ::core::mem::transmute(raw.offset(0)) } pub unsafe fn __align(&mut self) -> *mut ::libc::c_long { let raw: *mut u8 = ::core::mem::transmute(&self._bindgen_data_); ::core::mem::transmute(raw.offset(0)) } } impl ::core::default::Default for pthread_barrier_t { fn default()...
Rust
0
m -a 256 -p | awk '{ print $1 }' // c4b0c693eb7c30dffc5b8c037342850b95746687a636dc95ecd9d75129277002 assert_eq!( hexString, "c4b0c693eb7c30dffc5b8c037342850b95746687a636dc95ecd9d75129277002" ); } #[test] #[serial] fn ctx_digest_key() { let (ctx, sh, _, secOh) = fixture_token_and_secret_...
Rust
0
11_101, 0x3f, 0b11_001_010], "vpmaxud ymm9, ymm8, ymm10"); test_instr(&[0xc4, 0b000_00010, 0b0_0111_001, 0x40, 0b11_001_010], "vpmulld xmm9, xmm8, xmm10"); test_avx2(&[0xc4, 0b000_00010, 0b0_0111_101, 0x40, 0b11_001_010], "vpmulld ymm9, ymm8, ymm10"); test_instr(&[0xc4, 0b000_00010, 0b0_1111_001, 0x41, 0b11...
Rust
0
fn remove_die(&mut self, die: &Die) -> Fallible<()> { let die_ix = self .dice .iter() .position(|d| d == die) .ok_or_else(|| format_err!("remove_die: no die {} found in player's stock", &die))?; self.dice.remove(die_ix); Ok(()) } } impl f...
Rust
0
import networkx as nx from ge import Struc2Vec def test_Struc2Vec(): G = nx.read_edgelist('./tests/Wiki_edgelist.txt', create_using=nx.DiGraph(), nodetype=None, data=[('weight', int)]) model = Struc2Vec(G, 3, 1, workers=1, verbose=40, ) model.train() embeddings = model.get_e...
Python
1
ta register for the regular channel pub DFSDM_FLT2RDATAR: RORegister<u32>, /// analog watchdog high threshold register pub DFSDM_FLT2AWHTR: RWRegister<u32>, /// analog watchdog low threshold register pub DFSDM_FLT2AWLTR: RWRegister<u32>, /// analog watchdog status register pub DFSDM_FLT2A...
Rust
0
p" { Some(Mode::Mphp) } else if is_hhi { Some(Mode::Mdecl) } else { let skip_length = skip_length + name.width(); let s = text.sub_as_st...
Rust
0
', 0x2CE88: 'yǐ', 0x2CE93: 'chǔ', 0x2D11B: 'jiǎn', 0x2D546: 'suǒ', 0x2D613: 'hū', 0x2D6A6: 'guō', 0x2D8C7: 'diān', 0x2D930: 'yú', 0x2DA86: 'zhuā', 0x2DC4A: 'hòng', 0x2DE5C: 'luó', 0x2E18F: 'lán', 0x2E261: 'lú', 0x2E262: 'zhì', 0x2E264: 'guà', 0x2E267: 'liǎ...
Python
1
), vec![fun_anon, arg_anon]), MetaTerm::Ctor(pos, vec![fun_meta, arg_meta]), ) } Self::Ann(pos, terms) => { let (val_anon, val_meta) = terms.0.clone().embed(); let (typ_anon, typ_meta) = terms.1.clone().embed(); ( AnonTerm::Ctor(String::from("ann"), vec![v...
Rust
0
from tuote import Tuote from kirjanpito import kirjanpito as default_kirjanpito class Varasto: def __init__(self, kirjanpito=default_kirjanpito): self._kirjanpito = kirjanpito self._saldot = {} self._alusta_tuotteet() def hae_tuote(self, id): tuotteet = self._saldot.keys() ...
Python
1
(Box::new(expr1), Box::new(expr2)), '/' => EDiv(Box::new(expr1), Box::new(expr2)), '^' => EExp(Box::new(expr1), Box::new(expr2)), _ => panic!("Unknown Operation"), } } fn parse_enum(parsed_num: &str) -> Expr { let num = f32::from_str(parsed_num).unwrap(); ENum(num) } fn parse_numbe...
Rust
0
, PartialEq, Default)] pub struct Point(euclid::Point2D<Scalar, Scalar>); #[repr(transparent)] #[derive(Debug, Clone, Hash, Eq, PartialEq, Default)] pub struct Radius((Scalar, Scalar)); #[derive(Debug, Clone, Hash, Eq, PartialEq)] pub struct RoundedRectangle { rectangle: Rectangle, top_left_radius: Radius, ...
Rust
0
x: Range<f64>, samples: (i32, i32), max_iter: usize, ) -> js_sys::Array { let arr_x = js_sys::Array::new(); let arr_y = js_sys::Array::new(); let arr_c = js_sys::Array::new(); // for (x, y, c) in [ // (-0.5 as f64, 0.5 as f64, 100 as usize), // (-1.0 as f64, 0.5 as f64, 100 as u...
Rust
0
odel.pth") # If just finished training a model if config.learner_config.local_rank in [0, -1]: scores = model.score(dataloaders[1:]) # Save metrics and models log_rank_0_info(logger, f"Saving metrics to {emmental.Meta.log_path}") log_rank_0_info(logger, f"Metrics: {scores}") ...
Python
1
db.crate_def_map(krate); }); assert!(format!("{:?}", events).contains("crate_def_map"), "{:#?}", events) } db.set_file_text(pos.file_id, Arc::new(ra_fixture_change.to_string())); { let events = db.log_executed(|| { db.crate_def_map(krate); }); assert!(!...
Rust
0
# 3rd party dependencies import tensorflow as tf # package dependencies from deepface.commons.logger import Logger logger = Logger(module="commons.package_utils") def get_tf_major_version() -> int: """ Find tensorflow's major version Returns major_version (int) """ return int(tf.__versio...
Python
1
: &tt::Subtree, ) -> ExpandResult<tt::Subtree> { ExpandResult::ok(quote! {}) } fn trace_macros_expand( _db: &dyn AstDatabase, _id: MacroCallId, _tt: &tt::Subtree, ) -> ExpandResult<tt::Subtree> { ExpandResult::ok(quote! {}) } fn stringify_expand( _db: &dyn AstDatabase, _id: MacroCallId, ...
Rust
0
n_qubits = None if n_qubits is None: raise TypeError("circuit must be a parameterized QuantumCircuit with 'num_qubits'") # 3) 生成哈密顿量项列表并实例化 HEA # 若电路与我们的 RY ansatz 等价(如 RealAmplitudes),优先直接映射 reps→layers,避免额外模板路径 layers = int(getattr(circuit, "reps", 1)) if hasat...
Python
1
} } #![allow(dead_code)] #![allow(unused_imports)] use itertools::Itertools; use nalgebra::DimAdd; use proconio::marker::{Bytes, Chars, Usize1}; use proconio::*; use std::cmp::*; use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque}; use std::io; use std::mem::*; #[fastout] fn main() { ...
Rust
0
eout: Some(conf.timeout), message_processing_timeout_grow_factor: Some(1.5), wait_for_timeout: None, access_key: None, }) .map_err(|e| format!("failed to create tonclient: {}", e.to_string())) } fn prepare_message( ton: &TonClient, addr: &TonAddress, abi: &str, method: &...
Rust
0
from enum import Enum class UserRole(str, Enum): ADMIN = "ADMIN" USER = "USER"
Python
1
import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("maasserver", "0131_update_event_model_for_audit_logs")] operations = [ migrations.AlterField( model_name="fabric", name="class_type", fie...
Python
1
1, }, TestCase { party_share_counts: KeygenPartyShareCounts::from_vec(vec![5]).unwrap(), threshold: 0, sign_share_count: 5, }, TestCase { party_share_counts: KeygenPartyShareCounts::from_vec(vec![1, 1, 1]).unwrap(), threshold: ...
Rust
0
def __init__(self): self._books = [] self._members = [] def add_book(self, book:Book): self._books.append(book) Libreria._total_books += 1 def remove_book(self, book:Book): if book in self.books: self._books.remove(book) Libreria._total...
Python
1
1 c = max(1, c) Base.log("D", F"历史记录中的{uuid}的成就模板保存完成,耗时{time.time() - t}秒,共{c}个,速率{c / (time.time() - t if (time.time() - t) > 0 else 1): .3f}个/秒", "Chunk.save") t = time.time() c = 0 for record in day_records: DataObj...
Python
1
#[inline(always)] pub fn apb_saradc_timer_en(&self) -> APB_SARADC_TIMER_EN_R { APB_SARADC_TIMER_EN_R::new(((self.bits >> 24) & 0x01) != 0) } #[doc = "Bits 12:23"] #[inline(always)] pub fn apb_saradc_timer_target(&self) -> APB_SARADC_TIMER_TARGET_R { APB_SARADC_TIMER_TARGET_R::new...
Rust
0
.set(task_metrics.mean_idle_duration().as_millis() as i64); MEAN_POLL_DURATION .with(&label) .set(task_metrics.mean_poll_duration().as_millis() as i64); MEAN_SCHEDULED_DURATION .with(&label) .set(task...
Rust
0
from prowler.lib.check.models import Check, Check_Report_AWS from prowler.providers.aws.services.cloudtrail.cloudtrail_client import ( cloudtrail_client, ) from prowler.providers.aws.services.cloudwatch.cloudwatch_client import ( cloudwatch_client, ) from prowler.providers.aws.services.cloudwatch.lib.metric_fil...
Python
1
# -*- codeing = utf-8 -*- import os from itertools import combinations from typing import Any, Text, Dict from rasa.nlu.extractors.extractor import EntityExtractor class MatchEntityExtractor(EntityExtractor): """绝对匹配提取实体""" provides = ["entities"] defaults = { "dictionary_path": None, "t...
Python
1
bool_data = [True, False] assert ( as_json_table_type(np.array(bool_data, dtype=bool_type).dtype) == "boolean" ) @pytest.mark.parametrize( "date_data", [ pd.to_datetime(["2016"]), pd.to_datetime(["2016"], utc=True), pd.Series(pd.t...
Python
1
# Variables we will use train_mass = 22680 train_acceleration = 10 train_distance = 100 bomb_mass = 1 # Farenheit to celcius def f_to_c(f_temp): c_temp = (f_temp - 32) * 5/9 return round(c_temp, 2) f100_in_celsius = f_to_c(100) print(f100_in_celsius) # Celcius to farenheit def c_to_f(c_temp): f_temp = (c_temp *...
Python
1
date = chrono::Utc::now().to_rfc2822(); let md5 = md5_lines.join("\n"); let sha1 = sha1_lines.join("\n"); let sha256 = sha256_lines.join("\n"); let release_file = formatdoc!( r#" Codename: {distribution_version} Architectures: amd64 arm64 Components: main Date: {date} Descripti...
Rust
0
Ok(()) } else { self.raw_set_mem(m, sizecode, res) } } /* [4: reg][2: size][2: mode] mode = 0: reg mode = 1: h reg (AH, BH, CH, or DH) mode = 2: [size: imm] imm mode = 3: [address] M[address] */ fn read_value_op(&mut self) -> Result<(u8, u64...
Rust
0
::new(register)); id } /// Remove a register from the registry. /// This function ensure that the register is removed from the registry, /// but not the destruction of the resource itself. /// Because the resource is shared, the destruction will be delayed until the last reference. pub ...
Rust
0
{ StartDecodeStatus::Fini(d) => Poll::Ready(Some(d)), StartDecodeStatus::Pending(dec) => { *state = State::Pending(dec); Poll::Pending } StartDecodeStatus::Error(_) => { *state = State::Error; ...
Rust
0
""" Сервис для экспорта и импорта EMR данных """ import json import zipfile import io from datetime import datetime from typing import Dict, List, Any, Optional, Union from pathlib import Path from app.schemas.emr import EMRBase, EMRUpdate from app.schemas.emr_template import EMRTemplateBase from app.schemas.emr_versi...
Python
1
et, QuerySet[CrewMember]]: return self.filter(crew=crew) def user(self, user: User) -> Union[CrewMemberQuerySet, QuerySet[CrewMember]]: return self.filter(user=user) class CrewMemberManager(Manager): def exists(self, crew: Crew, user: User) -> bool: return self.filter(crew=crew, user=...
Python
1
# problem 1 # write a program to print twinkle twinkle litte star poem in python print('''Twinkle, twinkle, little star, How I wonder what you are! Up above the world so high, Like a diamond in the sky. When the blazing sun is gone, When he nothing shines upon, Then you show your little light, Twinkle, twinkle, all th...
Python
1
} //! Simple HTTP client use crate::error::invalid_input_error; use http::{Request, Response}; use std::io; use std::io::BufRead; pub struct Client {} impl Client { pub fn new() -> Self { Self {} } pub fn request( &self, _request: &Request<Option<Vec<u8>>>, ) -> io::Result<Re...
Rust
0
h, "rb") as f: cache = pickle.load(f) if not should_scan("radarr") and not should_scan("sonarr"): print("Usage: pairarr.py <sonarr/radarr>") sys.exit(1) movies = {} if should_scan("radarr"): print(color("▶ Querying Radarr\n", "cyan")) movies["radarr"] = requests...
Python
1
"...,", doc, if newline.1 == arena.space().1 { arena.text(",") } else { arena.nil() }, newline.clone(), ...
Rust
0
#------------------------------------------------------------------ # This script searches XML files, extracts specific tags and values, # and saves the results in a human-readable text file. #------------------------------------------------------------------ import xml.etree.ElementTree as ET from pathlib import Path...
Python
1
------------- # Chapter 9: Fingering def test_example09_1(self): self.methodArgs = {'showFirstMeasureNumber': False} bm = converter.parse('tinynotation: 2/4 a4 g f4. c8').flatten() bm.insert(0, key.KeySignature(-1)) bm.makeNotation(inPlace=True, cautionaryNotImmediateRepeat=False) ...
Python
1
for line in reader.lines() { let line = line?; if line == "END WIDTH" { for cr in ranges.drain(..) { writeln!(writer, "{}", cr)?; } } writeln!(writer, "{}", line)?; } Ok(()) } <filename>src/progress.rs use anyhow::{Context, Result}; ...
Rust
0
This function takes /// care of that special treatment. fn address_type_for_fn_call(old_ty: &Type) -> proc_macro2::TokenStream { if let Type::Reference(_) = old_ty { return quote!(<(#old_ty)>); } let mut ty = old_ty.clone(); if let Type::Path(ref mut p) = &mut ty { p.path.segments.pair...
Rust
0
), ) CloseMessageWindow() Jump('loc_6529') def _loc_6433(): pass label('loc_6433') SetScenaFlags(ScenaFlag(0x0000, 6, 0x6)) ChrTalk( 0x00FE, ( '能够担任开发『埃尔赛尤号』的\n', '新型引擎研究员……吗。', TxtCtl.Enter, ), ) CloseMessageWin...
Python
1
def __init__(self, vae: AutoencoderKL, text_encoder: ClapModel, text_encoder_2: Union[T5EncoderModel, VitsModel], projection_model: AudioLDM2ProjectionModel, language_model: GPT2Model, tokenizer: Union[ RobertaTokenizer, RobertaTokenizerFast], tokenizer_2: Union[T5Tokenizer, T5TokenizerFast, VitsTokeniz...
Python
1
# camera lib import time from ultralytics import YOLO import cv2 import numpy as np # 同じディレクトリに重みを置く pt_path = "./SC-25_yolo_ver2.pt" class Camera: def yolo_detect(self, frame): yolo_xylist = 0 center_x = 0 # YOLOv10nモデルをロード model = YOLO(pt_path) # 推論 yol...
Python
1
plt.ylabel('f(x)') # plt.title('Bisection Method Iterations') # plt.legend() # plt.grid(True) # # Add text annotations for key points # for i in range(len(midpoints)): # plt.annotate(f'{midpoints[i]:.2f}', (midpoints[i], f(midpoints[i])), textcoords="offset points", xytext=(0,10), ha=...
Python
1
problem = [ [0, 6, 9, 8, 7, 3, 6, 2, 3, 2, 6, 6, 4, 4, 5, 9, 7], [6, 0, 8, 3, 2, 6, 8, 4, 8, 8, 13, 7, 5, 8, 12, 10, 14], [9, 8, 0, 11, 10, 6, 3, 9, 5, 8, 4, 15, 14, 13, 9, 18, 9], [8, 3, 11, 0, 1, 7, 10, 6, 10, 10, 14, 6, 7, 9, 14, 6, 16], [7, 2, 10, 1, 0, 6,...
Python
1
number: ') check_input = re.findall(pattern, selection) if selection == '6': exit_game() else: option_graphic(selection) vs = (r'__ __ _____ ' + '\n' + r'\ \ / // ____| ' + '\n' + r' \ \ / /| (___ ' + '\n' + r' \ \/ / \___ ...
Python
1
current_workspace, manifest_file_path); } if command_name == "stats" { let db = fpm_core::db::Database::get_database(); println!("{}", db.get_stats()); return 0; } log::debug!("Finishing..."); return 0; } fn run_build(manifest_path: &str) -> Result<(), String> { let o...
Rust
0
Endian::read_int(&value, mem::size_of::<libc::c_int>()) as libc::c_int, )), Type::S64 => Ok(Value::S64(LittleEndian::read_i64(&value))), Type::Uint => Ok(Value::Uint( LittleEndian::read_uint(&value, mem::size_of::<libc::c_uint>()) as libc::c_uint, )), Type::Long => Ok...
Rust
0
def main(): animal = input("What's your favorite animal? ") print("My favorite animal is also " + animal + "!") if __name__ == '__main__': main()
Python
1
40, 237195364063, 237749792274, 238304221574, 238858651963, 239413083440, 239967516005, 240521949659, 241076384401, 241630820232, 242185257151, 242739695159, 243294134255, 243848574440, 244403015713, 244957458074, 245511901524, 246066346062, 246620791689, 247175238404, 247729686208, 248284135100...
Rust
0
le except in compliance with the License. * You may obtain a copy of the License at * http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY...
Rust
0
if let Ok(a) = receiver.try_recv() { println!("writer {}", a); } else { sleep(Duration::from_millis(10)); } }) } } fn main() { let program = Program::new(); let (send, recv): (BroadcastSender<String>, BroadcastReceiver<String>) = ...
Rust
0
inferred_scalar_type = _infer_scalar_type(data) if type_inference else scalar_type # NB: Don't need to avoid tracing, as we aren't going to do any manual # pointer filling tricks if _isStorage(data): return NotImplemented else: if torch.device(device).type == "meta": retu...
Python
1
# -*- coding: utf-8 -*- """ fetch """ import random import pandas as pd from collections import defaultdict from conf import settings from .env import * from .file import * from .db import is_null from .dt import * from .batch import batch_list from . import instance __author__ = 'jx' def all_logs(): """服务器日志路径"...
Python
1
str()); } if let Some(var_226) = &input.transfer_mode { object.key("TransferMode").string(var_226.as_str()); } if let Some(var_227) = &input.security_descriptor_copy_flags { object .key("SecurityDescriptorCopyFlags") .string(var_227.as_str()); } Ok(()) } ...
Rust
0
!("parsing headers"); let parsed = headers.parse()?; println!("{:?}", parsed); println!("code: {}, message: {}", parsed.code, parsed.message); println!("bleep: {:?}", parsed.headers[0]) } Err(e) => { failure_count +=...
Rust
0
|store, ($($args,)*)| (*data)(store, $($args),*), )) } } fn into_host_func(self) -> Arc<HostFunc> { let entrypoint = <Self as IntoComponentFunc<T, (StoreContextMut<'_, T>, $($args,)*), R>>::entrypoint; H...
Rust
0
ze: stack_size, output: Arc::new(temp), }) } pub async fn start(&mut self) -> anyhow::Result<ContainerHandle<Runtime, LogHandleFactory>> { let temp = self.output.clone(); let output_write = tokio::task::spawn_blocking(move || -> anyhow::Result<std::fs::File> { Ok...
Rust
0
always)] pub fn exti4(&mut self) -> _Exti4W { _Exti4W { w: self } } } pub use ecdsa_core::signature::{self, Error}; use super::NistP256; #[cfg(feature = "ecdsa")] use { crate::{AffinePoint, Scalar}, ecdsa_core::hazmat::{SignPrimitive, VerifyPrimitive}, }; pub type Signature = ecdsa_core::Sign...
Rust
0
// Spin for 2 seconds. cube.go(100, 5, Some(Duration::from_secs(2))).await.unwrap(); delay_for(Duration::from_secs(3)).await; } use std::error::Error; use std::fmt; use dsp_python_parser::ast; pub mod types; pub use crate::types::LLVMCompileErrorType; pub mod macros; pub use crate::macros::*; // These ...
Rust
0
from . import yolo from . import yolov2 from . import vanilla from os import sep class framework(object): constructor = vanilla.constructor loss = vanilla.train.loss def __init__(self, meta, FLAGS): model = meta['model'].split(sep)[-1] model = '.'.join(model.split('.')[:-1]) me...
Python
1
; let content = config.content.unwrap_or("http://127.0.0.1:8003".into()); let state = State { users: Arc::new(users), content: Arc::new(content), }; let address = config.address.unwrap_or("127.0.0.1:8080".into()); server::new(move || { App::with_state(state.clone()) ...
Rust
0
from matplotlib import pyplot as plt import numpy as np from scipy.signal import hilbert import pandas as pd from sklearn.preprocessing import MinMaxScaler #vmd分解类 class VMD: def __init__(self, K, alpha, tau, tol=1e-7, maxIters=200, eps=1e-9): """ :param K: 模态数 :param alpha: 每个模态初始中心约束强度 ...
Python
1
lang_clears.json") } pub fn encounter_english_name(encounter: &RaidEncounter) -> String { fn capitalize(str: &str) -> String { let capitalized = str.chars().enumerate().map(|(i, char)| { if i == 0 { char.to_uppercase().next().unwrap() } else { char ...
Rust
0
p.scale.1).0 = buffer.get(); (comp.scale.1).1 = buffer.get(); } // Flags comp.round_xy_to_grid = flags % Self::ROUND_XY_TO_GRID != 0; comp.use_my_metrics = flags & Self::USE_MY_METRICS != 0; comp.overlap_compound = flags & Self::OVERLAP_COMPOU...
Rust
0
try: with ( patch.object(formatter, "pause_live_updates") as mock_pause, patch.object(formatter, "resume_live_updates") as mock_resume, patch( "builtins.input", side_effect=KeyboardInterrupt("Test exception") ), ...
Python
1
from opencompass.openicl.icl_prompt_template import PromptTemplate from opencompass.openicl.icl_retriever import ZeroRetriever from opencompass.openicl.icl_inferencer import PPLInferencer from opencompass.openicl.icl_evaluator import AccEvaluator from opencompass.datasets import HFDataset bustm_reader_cfg = dict( ...
Python
1
fn advance_char(cursor : &mut Cursor, n : usize) { cursor.index += n; cursor.column += n; } // Advances the cursor 1 line down. pub fn advance_line(cursor : &mut Cursor) { cursor.index += 1; cursor.line += 1; cursor.column = 0; } // Returns true if a valid name character. pub fn is_name_char(chr ...
Rust
0