text
string
label_name
string
labels
int64
this method as the /// [`ContextOf::current_context()`] /// (../struct.ContextOf.html#method.current_context) method. pub unsafe fn current() -> Self { Texture2dBinder { _phantom: PhantomData } } /// Bind a texture to the `GL_TEXTURE_2D` target, /// returning a bind...
Rust
0
isable stripping newlines from stdin" ) parser.add_argument( "--no-add-newlines", dest="add_newlines", action="store_false", default=True, help="Disable adding newlines to stdout" ) parser.add_argument( "local", help="JID to bind to", typ...
Python
1
visible`: /// Render if occlusion query is visible. pub fn set_condition(&self, visible: bool) { unsafe { bgfx_sys::bgfx_set_condition(self.handle, visible); } } } impl Drop for OcclusionQuery { fn drop(&mut self) { unsafe { bgfx_sys::bgfx_destroy_occlusi...
Rust
0
import os from shutil import rmtree import distutils.cmd import distutils.log from setuptools import find_packages, setup class CleanAllCommand(distutils.cmd.Command): """Docstring for public class.""" description = "remove extra build files" user_options = [] dirname = os.path.dirname(os.path.realp...
Python
1
tures, bias=False, init_method=init_method_const(0.0)) else: raise NotImplementedError("row_init_method should be zero, normal or xavier") if norm_type == 'mixedfusedlayernorm': self.layer_norm = MixedFusedLayerNorm(in_features, 1e-5, sequence_parallel_enbaled=False) eli...
Python
1
} " f"is None" ) if not all( self._constraint_converter.convert(constraint)(event) for constraint in constraints ): continue yield event def _select_index(self, target: Scannable) -> EventPositio...
Python
1
, E, GSharp], Augmented), case(vec![C, DSharp, FSharp], Diminished), case(vec![C, E, G, ASharp], DominantSeventh), case(vec![C, DSharp, G, ASharp], MinorSeventh), case(vec![C, E, G, B], MajorSeventh), case(vec![C, DSharp, G, B], MinorMajorSeventh), case(vec![C, E, GSharp,...
Rust
0
# -*- coding: utf-8 -*- # ----------------------------------------------------------------------- # Copyright (C) 2012 by Brown University # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software wi...
Python
1
import sys import re import matplotlib.pyplot as plt from matplotlib.widgets import Slider def plot_signal(file_name, sig_name, raw_time_deltas, baudrate, bits_per_char): fig, ax = plt.subplots() plt.gcf().canvas.manager.set_window_title(f"IR signal plot ('{file_name}')") plt.subplots_adjust(bottom=0.25) ...
Python
1
* np.fft.fft( (-1)**steps * cf(-L + h * steps + h * indices / (n - 1)) ) * np.exp( 1j * np.pi * indices / (n - 1) - 2 * 1j * np.pi * indices * steps / (N * (n - 1)) ), axis=0 ) else: s1 = (-1) ** ste...
Python
1
config: &DeviceConfig, config: &FfxConfigWrapper, ) -> Result<GuestConfig> { let mut updated_guest = guest_config.clone(); // Create the data directory if needed. let mut instance_root: PathBuf = config.file(config::EMU_INSTANCE_ROOT_DIR).await?; instance_root.push(instance_...
Rust
0
vidx = np.ceil((pts - coordmin) / res) vidx = vidx[:, 0] + vidx[:, 1] * nvox[0] + vidx[:, 2] * nvox[0] * nvox[1] uvidx, vpidx = np.unique(vidx, return_index=True) # compute voxel label uvlabel = np.array(label)[vpidx] # compute voxel pred (follow pointnet++ majority voting...
Python
1
_ecx: &mut EvalContext<'a, 'mir, 'tcx, Self>, _dest: PlaceTy<'tcx>, ) -> EvalResult<'tcx> { Err( ConstEvalError::NeedsRfc("heap allocations via `box` keyword".to_string()).into(), ) } fn global_item_with_linkage<'a>( _ecx: &mut EvalContext<'a, 'mir, 'tcx...
Rust
0
(instruction.len() - (2 + 2)) as u8; constant_offsets.immediate_size = 2; constant_offsets.immediate_offset2 = (instruction.len() - 2) as u8; constant_offsets.immediate_size2 = 2; } OpKind::FarBranch32 => { constant_offsets.immediate_offset = (instruction.len() - (4 + 2)) as u8; ...
Rust
0
(); state.layout = settings.layout; if state.width != settings.width || state.height != settings.height { state.width = settings.width; state.height = settings.height; state .renderer .render(&state.state, [state.width, state.height]); let mut arr = [stat...
Rust
0
pub const STARSHIP_TRANSPORTER: u16 = 6392; pub const STARSHIP_TRANSPORTER_SEED: u16 = 6393; pub const STARSHIP_CONSOLE_PANEL: u16 = 6394; pub const STARSHIP_CONSOLE_PANEL_SEED: u16 = 6395; pub const STARSHIP_PORTHOLE: u16 = 6396; pub const STARSHIP_PORTHOLE_SEED: u16 = 6397; pub const STARSHIP_AIRLOCK: u16 = 6398; pub...
Rust
0
ap_chain_texture = if let Some(texture) = &window.swap_chain_texture { texture } else { continue; }; let sampled_target = if msaa.samples > 1 { let sampled_texture = texture_cache.get( &render_device, TextureDescriptor { ...
Rust
0
ipboardText>, managing_clipboard: &mut bool) { if *managing_clipboard { clipboard_stack.pop(); trace!("Popped element off clipboard stack") } *managing_clipboard = true; win::remove_clipboard_format_listener(window).unwrap(); { let clipboard = win::open_clipboard(window).unwrap(); ...
Rust
0
import pandas as pd # Load the CSV file into a DataFrame file_path = 'path_to_your_file.csv' df = pd.read_csv('data/validation.csv') df = df.drop('ID', axis=1) # Display the DataFrame (optional) print("DataFrame:") print(df) # Check for duplicate rows duplicates = df.duplicated() # Display the duplicates if duplica...
Python
1
} } Ok(()) } pub fn list_overrides(cfg: &Cfg) -> Result<()> { let mut overrides = try!(cfg.override_db.list()); overrides.sort(); if overrides.is_empty() { println!("no overrides"); } else { for o in overrides { split_override::<String>(&o, ';').map(|li| ...
Rust
0
# 실전 문제 2: 도시 분할 계획 (이거 사실 백준 1647번) # 집의 갯수 N, 길의 갯수 M (2 <= N <= 10만 / 1 <= M <= 100만) # --> 주어진 입력에 대해서.. 2개의 "최소 신장 트리"를 만들어라 (크루스칼 알고리즘을 써야 함) # --> 일단, 전체 정보에 관해서 1개의 "최소 신장 트리"를 만들고, 거기에서 가장 비용이 큰 경로를 짤라내면, 그게 최솟값! import sys input = sys.stdin.readline def find_parent(parent, x): if parent[x] != x: parent...
Python
1
ignored if they were set. /// /// ```rust /// # bonsaidb_core::__doctest_prelude!(); /// # use bonsaidb_core::connection::Connection; /// # fn test_fn<C: Connection>(db: &C) -> Result<(), Error> { /// println!( /// "Number of documents with id 42 or larger: {}", /// db.collectio...
Rust
0
# -*- coding: utf-8 -*- """ @desc: 龙虎榜单 https://data.eastmoney.com/stock/tradedetail.html @author: 1nchaos @time: 2024/5/29 @log: change log """ import datetime import json import pandas as pd from adata.common.base.base_ths import BaseThs from adata.common.utils import requests class AList(BaseThs): """龙虎榜单...
Python
1
new_down_block_res_samples = new_down_block_res_samples + (down_block_res_sample,) down_block_res_samples = new_down_block_res_samples # 4. mid sample = self.mid_block( hidden_states=sample, temb=emb, encoder_hidden_states=encoder_hidden...
Python
1
#faça um programa que leia nome e peso de varias #pessoas,guardando tudo em uma lista.no final,mostre: #a)quantas pessoas foram cadastradas. #b)uma lista com as pessoas mais pesadas. #c)uma listagem com as pessoas mais leves nome_peso =[] pessoas_max=[] pessoas_min=[] while True: nome= input("digite o nome: ") p...
Python
1
opescx".to_string(), ExpertType::NiScope5170 => "niscope5170".to_string(), ExpertType::NiScope5164 => "niscope5164".to_string(), ExpertType::NiScope5110 => "niscope5110".to_string(), ExpertType::Serial => "serial".to_string(), ExpertType::SLSC => "slsc".to_str...
Rust
0
# Defining a class in Python. A class is a blueprint for creating objects. It defines a set of attributes that will characterize any object that is instantiated from this class. Attributes are data members (class variables and instance variables) and methods, accessed via dot notation. A class is a logical entity that ...
Python
1
e command_index = -1 for i, v in enumerate(argv): if not v: continue if v[0] == '-' or v[0] == '/': global _LOG_USE_COLOR if v == '--no-color': _LOG_USE_COLOR = False elif v == '--color': _LOG_USE_COLOR = True continue if v in Commands.commands: if command is not None: log...
Python
1
from analysis import frequency from proc_item import process_item from datetime import datetime, timedelta proc_item_list = [ ["rings", "Prismatic_Ring", "全抗戒指"], ["spears", "Seaglass_Spear", "矛"], # ["amulets", "Solar Amulet", "精魂项链"], # ["body_armour", "Vile_Robe", "专家护盾衣服"], # ["body_armour", "...
Python
1
existent.txt" result = runner.invoke(hayhooks_cli, ["pipeline", "run", "test_pipeline", "--file", str(nonexistent_file)]) assert result.exit_code != 0 assert "does not exist" in result.stdout def test_run_with_directory(runner, tmp_path, monkeypatch): files = create_test_files( tmp_path, ...
Python
1
y': True} if args.accel else {} train_loader = torch.utils.data.DataLoader( datasets.MNIST('../data', train=True, download=True, transform=transforms.Compose([ transforms.ToTensor(), transforms.Normalize((0.1307,), (0.3081,)) ...
Python
1
) -> Weight; fn dissolve() -> Weight; fn edit() -> Weight; fn add_memo() -> Weight; fn on_initialize(n: u32, ) -> Weight; fn poke() -> Weight; } pub struct TestWeightInfo; impl WeightInfo for TestWeightInfo { fn create() -> Weight { 0 } fn contribute() -> Weight { 0 } fn withdraw() -> Weight { 0 } fn refund(...
Rust
0
let Some(apply) = apply { url.query_pairs_mut().append_pair("$apply", apply); } if let Some(skiptoken) = skiptoken { url.query_pairs_mut().append_pair("$skiptoken", skiptoken); } let req_body = bytes::Bytes::from_static(azure_core::EMPTY_BODY); req_builde...
Rust
0
# Copyright (C) 2018, 2019, 2020 Dominic O'Kane import add_fp_to_path from financepy.utils.frequency import FrequencyTypes from financepy.utils.day_count import DayCount, DayCountTypes from financepy.utils.date import Date from FinTestCases import FinTestCases, global_test_case_mode test_cases = FinTestCases(__file...
Python
1
from dependency_injector import containers, providers from .database import init_firestore_client, init_redis_pool from .repository.bit_repository import BitRepository from .repository.comparison_bit_repository import ComparisonBitRepository from .repository.pi_notation_score_repository import PiNotationScoreRepositor...
Python
1
min_major_version: u16, max_major_version: u16, } impl UsnJournalDataV1 { fn new(buffer: &[u8]) -> UsnJournalDataV1 { let usn_jounral_id = LittleEndian::read_u64(&buffer[0..8]); let first_usn = LittleEndian::read_u64(&buffer[8..16]); let next_usn = LittleEndian::read_u64(&buffer[16..2...
Rust
0
price, fill.maker_timestamp, fill.timestamp, fill.quantity, )?; if fill.maker_out { self.remove_order(fill.maker_slot as usize, base_change.abs()) } else { match side { Side::Bid => { pa.bids_quantit...
Rust
0
# backend/models/course.py from typing import Dict, List, Any, Optional from pydantic import BaseModel class CourseSubsection(BaseModel): title: str description: Optional[str] = "" class CourseSection(BaseModel): title: str description: Optional[str] = "" subsections: Optional[List[CourseSubsect...
Python
1
::ptr::null::<update_args>())).learning_rate as *const _ as usize }, 4usize, concat!( "Offset of field: ", stringify!(update_args), "::", stringify!(learning_rate) ) ); assert_eq!( unsafe { &(*(::std::ptr::null::<update_args>())).mo...
Rust
0
me(2012, 3, 11, 5, 0, 0, tzinfo=off) end = datetime(2012, 6, 11, 5, 0, 0, tzinfo=off) rng = date_range(start=start, end=end) assert off == rng.tz idx = Index([start, end]) assert off == idx.tz @pytest.mark.parametrize('tzstr', ['US/Eastern', 'dateutil/US/Eastern']) def ...
Python
1
panel( ctx, app, Tab::PersonTrips(id, BTreeMap::new()), &mut actions, ); } })), ])); } ...
Rust
0
from fastapi import APIRouter from app.endpoints import student api_router = APIRouter() api_router.include_router(student.router, prefix="/students", tags=["students"])
Python
1
answer); } #[test] fn test_triangle_is_valid() { let data:Triangle = Triangle(775, 785, 361); assert!(data.is_valid()); } #[test] #[should_panic] fn test_triangle_is_not_valid() { let data: Triangle = Triangle(622, 375, 125); assert!(data.is_valid()); ...
Rust
0
peer_id) } fn inject_disconnected(&mut self, peer_id: &PeerId) { self.behaviour.inject_disconnected(peer_id) } fn inject_event( &mut self, peer_id: PeerId, connection: ConnectionId, event: <<Self::ProtocolsHandler as IntoProtocolsHandler>::Handler as ProtocolsHandler>::OutEvent, ) { self.behaviour.in...
Rust
0
""" Test for sampler.py API adapted from https://github.com/criteo-research/pytorch-ada/blob/master/tests/datasets/test_sampler.py """ import itertools import os from collections import Counter import numpy as np from kale.loaddata.sampler import BalancedBatchSampler, get_auto_num_workers, ReweightedBatchSampler c...
Python
1
* tf.log(c_real_probs + 1e-10), 1)) c_fake_loss = - tf.reduce_mean( tf.reduce_sum(rotate_labels_onehot * tf.log(c_fake_probs + 1e-10), 1)) if self._self_supervision == "rotation_only": self.d_loss *= 0.0 self.g_loss *= 0.0 self.d_loss += c_real_loss * self._weight_rotation_lo...
Python
1
.unnamed .iter() .enumerate() .filter_map(|(i, f)| { if !is_ignore(&f.attrs) { let i = syn::Index::from(i); Some(quote_spanned! {f.span() => starlark::values::Trace::trace(&mut self.#i, t...
Rust
0
for (key, value) in &distance { if *value == distance_winner.1 { if let Some(x) = points.get_mut(key) { *x += 1; } } } } points } fn calculate_flight_distance(time : u32, flight_data : HashMap<String, ReindeerFlight>) -...
Rust
0
# -*- coding: utf-8 -*- from rest_framework import filters class OrderingFilter(filters.OrderingFilter): def filter_queryset(self, request, queryset, view): orderings = self.get_ordering(request, queryset, view) if orderings: custom_ordering = self.get_custom_ordering(request, view, ...
Python
1
要按照已有步骤的思路,输出下一个解答步骤。 输出格式限定为: ”下一步:...“ 其中...表示省略的输出信息,这是你应该填充的下一步解答。你的输出应为一个完整的步骤,包括计算、推理、选择答案等。 下面是输入,请你按照规定格式进行输出。 题目: ''' zero_single_proposal_prompt_gpt = ''' 给定一个理科题目,你需要基于你的已有知识解答这个题目。输入中可能包括了一些已有的解答步骤,请你在这些步骤的基础上继续完成解答。 如果输入中没有提供任何已有步骤,你需要分析题目然后给出解决或计算这道题目的第一步。如果提供了部分解题步骤,你需要按照已有步骤的思路,输出下一个步骤。 输出格式限定为: ”下一步...
Python
1
ush( Text::new(s) ) .into() } } } }/// Representation of possible authentication methods for the GitHub API. #[derive(Debug, PartialEq)] pub enum AuthMethod<'a> { /// Basic access authentication BasicAuth { username: &'a str, token: &'a str }...
Rust
0
7f\xa1\x04\x00\xa9\xbb_\xbc\ \xefa\x18\x00p\xb1x\xff\x98\xfa\x0d\x10\x08\xaa\x0a\x1f\ 2\x15\x1e(l\xcf?=\x8a\xb5\xef6\xe7\xb3\x0b\xa6\ \x22\xce\x87\xfcu\xe7\xadB]\x1d\xb6\xab\xc4\xf6\x04\x09\ \xc0.D#\xe4\xfc\x02f\xe0`\xbba\x00\x00\xd8\x96\ \x17\xc0\x1f\xaf\xaa\xf8\x9c\x00\x90nc\xab\xcd2\xeb\xba\ B\x01\x00\xfd\x00\x01\x9...
Python
1
the lock *z = false; ret } // 'step 1' and 'step 2' is not atomic in multi-threads scene, // so we use a `Mutex` lock for thread safe. fn alloc_branch_id(&self) -> BranchID { static LK: Lazy<Mutex<bool>> = Lazy::new(|| Mutex::new(false)); let mut z = LK.lock(); ...
Rust
0
Minus(_) | TokomakLogicalPlan::Multiply(_) | TokomakLogicalPlan::Divide(_) | TokomakLogicalPlan::Modulus(_) | TokomakLogicalPlan::Or(_) | TokomakLogicalPlan::And(_) | TokomakLogicalPlan::Eq(_) | TokomakLogicalPlan::NotEq(_) ...
Rust
0
研-机构调研详细 返回 JSON 格式的数据。 参数: date: str - 查询的开始日期,格式为 "YYYYMMDD"。默认值为 "20241211"。 返回: JSON格式数据,包含机构调研详细信息,具有以下字段: - 序号: 序号 - 代码: 股票代码 - 名称: 股票名称 - 最新价: 最新价 - 涨跌幅: 涨跌幅百分比 (%) - 调研机构: 调研机构 - 机构类型: 机构类型 - 调研人员: 调研人员 - 接待方式: 接待方式 - 接待人员: 接待人员 - 接待...
Python
1
here the descriptors to inherit were already stdio descriptors. // This test checks to avoid that regression. #![cfg_attr(unix, feature(libc))] #![cfg_attr(windows, allow(unused_imports))] #[cfg(unix)] extern crate libc; use std::fs::File; use std::io::{Read, Write}; use std::io::{stdout, stderr}; use std::process::...
Rust
0
[235.90 us 241.36 us 247.52 us] // day16 part 1 time: [52.535 us 53.690 us 55.173 us] // day16 part 2 time: [266.19 us 270.68 us 275.73 us] use super::*; use std::collections::{BTreeMap, BTreeSet}; use std::ops::RangeInclusive; type Input = String; pub fn part1( _my_ticket: &Vec<usiz...
Rust
0
{total_scores[1]:.1f}/100)") print(f"📈 Winner for Scaling: MongoDB ({total_scores[0]:.1f}/100)") def generate_all_charts(self): """Generate all 7 accurate analysis charts.""" print("🚀 Generating Accurate Database Analysis Charts...") print("📊 Based on real-world performance w...
Python
1
debug_println!("if (V{:X} != V{:X})", x, y); if self.v[x as usize] != self.v[y as usize] { self.advance(); } } // Idx = nnn (0xA, n2, n1, n0) => { let n = (n2 << 8) | (n1 << 4) | n0; debug_prin...
Rust
0
shared, guard) = #shared::from_mut(self); Ok((#value::from(shared), guard)) } } }) } #![deny(warnings)] fn main() { let i = 0i64; change_value(); assert_eq!(i, 1); } // // Implement this function to run a successful `cargo run --release`. // // **NOTE** // - do NOT ...
Rust
0
) -> HFILE { self.hfile } /// Returns the current offset of the internal pointer. #[must_use] pub fn pointer_offset(&self) -> WinResult<usize> { self.hfile.SetFilePointerEx(0, co::FILE_STARTING_POINT::CURRENT) // https://stackoverflow.com/a/17707021/6923555 .map(|off| off as _) } /// Reads byt...
Rust
0
# Define your item pipelines here # # Don't forget to add your pipeline to the ITEM_PIPELINES setting # See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html # useful for handling different item types with a single interface from itemadapter import ItemAdapter class ScrapyfilmsPipeline: def process_i...
Python
1
em = oracle_data['mem'] pga_size = oracle_mem['pga size'] sga_size = oracle_mem['sga size'] mem_pct = oracle_mem['mem pct'] oracle_stat = oracle_data['stat'] oracle_time = oracle_data['time'] oracle_sess = oracle_data['sess'] oracle_wait = oracle_data['wait'] ...
Python
1
#!/usr/bin/python3 from binascii import unhexlify import click from tqdm import trange from common import contains_newkeys, run_tcp_mitm ##################################################################################### ## Proof of Concept for the RcvIncrease technique ## ## ...
Python
1
from abc import ABC, abstractmethod import time from copy import deepcopy import json class Metaheuristik(ABC): def __init__(self, instanz_daten, konfiguration, durchlauf_verzeichnis): self.loesung = None self.zwischenergebnisse = [] self.durchlauf_verzeichnis = durchlauf_verzeichnis ...
Python
1
<T> From<rusttype::Rect<T>> for Rectangle<T> { fn from(rect: Rect<T>) -> Self { Rectangle::new(Vector2::from(rect.min), Vector2::from(rect.max)) } } impl<T: num_traits::AsPrimitive<f32>> Rectangle<T> { /// Returns a new rectangle where the coordinates have been cast to `f32` /// values, usi...
Rust
0
register you can [`read`](crate::generic::Reg::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 ...
Rust
0
(`APPCOMMAND_UNDO`) Undo, /// The Accept (Commit, OK) key. Accept current option or input method /// sequence conversion. Accept, /// Redo or repeat an action. Again, /// The Attention (Attn) key. Attn, Cancel, /// Show the application’s context menu. /// This key is commonly found between the right `Super`...
Rust
0
p>64</sup> bytes/2<sup>64</sup> inodes. QFMT_VFS_V1, } } libc_bitflags!( /// Indicates the quota fields that are valid to read from. #[derive(Default)] pub struct QuotaValidFlags: u32 { /// The block hard & soft limit fields. QIF_BLIMITS; /// The current space field. ...
Rust
0
}, Params { streams: 100, messages: 10 } ]; let data0 = Bytes(Arc::new(vec![0x42; 4096])); let data1 = data0.clone(); let data2 = data0.clone(); c.bench_function_over_inputs("one by one", move |b, &&params| { let data = data1.clone(); b.iter(move || { ...
Rust
0
import streamlit as st import time # Define the exam levels and their corresponding questions exam_levels = { 'Beginner': [ {'text': 'What is the capital of France?', 'options': ['Paris', 'London', 'Berlin']}, {'text': 'What is the largest planet in our solar system?', 'options': ['Earth', 'Saturn'...
Python
1
# Este archivo contiene las funciones que se encargan de interactuar con los modelos de transformers para generar texto, resumir texto y clasificar texto. from transformers import AutoModelForTokenClassification, AutoTokenizer,pipeline import torch from transformers import pipeline from transformers import AutoTokenize...
Python
1
else: bound = base if base >= maxval or bound >= maxval: err.append(f'The range values in warl \ string "{legalstr} for csr {csrname} are out of bounds wrt the indices used \ in that string') if base > bound: ...
Python
1
o::ErrorKind::UnexpectedEof, "No first line", )), } } use crate::synchronizer::{BlockStatus, Synchronizer}; use crate::types::HeaderView; use crate::{ BLOCK_DOWNLOAD_TIMEOUT, BLOCK_DOWNLOAD_WINDOW, MAX_BLOCKS_IN_TRANSIT_PER_PEER, PER_FETCH_BLOCK_LIMIT, }; use ckb_core::header::Header; use ckb_networ...
Rust
0
T\x16\xde(\xf2\xa6o\x9a\xaaQ\xeca\x0cDy\ \xed-\x8fW\xbf\xd6b\x8a%\xfb\xd5oK\xf1lV\ \xb6\x0d\xe7\xb7\xca\xbfww\xf0\xfd+\xc8n\xbcy\xfb\ \xa6Vo\x99k\x13T\xf8\x83-\xfc^R\xca\xca\xbf\ \xde\xa3\xeb\x11\x84yJ\xaf\x8c\x82g\xa1\xfcA\xf8\xbe\ \xfen\xdby\x99\x99[\xfe\xf9\xad\x0f\x87\xdf\x12\xe5\x96\ [Vi[k6\xd9\x17\xfb\xbf_j\xf0\x...
Python
1
u() for text, output, probs in zip(text_batch, output_batch, probs_batch): seq_len = _get_len_util_stop(output, self.phoneme_tokenizer.end_index) predictions[text] = ( output[:seq_len].tolist(), probs[:seq_len].tolist(), ...
Python
1
"price_list": retail_price_list, "batch_no": batch_no, }, fields=["name"] ) if item_price: item_price_doc = frappe.get_doc("Item Price", item_price[0].name) item_price_doc.price_list_rate = retail_rate ...
Python
1
ahl an Usern wurde erreicht."), 3029 => format!("Messages: Ungültiges/Fehlendes Thema."), 3030 => format!("Messages: Es muss mindestens ein Benutzer in einer Konferenz hinzugefügt werden."), 3031 => format!("Chat: Ungültiger Raum."), 3032 => format!("Chat: Keine Berechtig...
Rust
0
local_x: x, local_y: y, local_z: z, width, height, tab_order, global_x: x, global_y: y, global_z: z, scale_mode: ScaleMode::Pixel, opaque: true, pd: PhantomData, } } ...
Rust
0
is monolithic, but the underlying data and the way it works is not. /// It gives a set of default data to work with, but also allow you to go beyond that and work as low level as you wish to. /// /// You can also use the Engine to build you own custom structure the way you wish for it to be. Possibilities are endle...
Rust
0
n(datafile), delimiter='\t'))) data = [[float(y) for y in x] for x in data if x[col] != "0"] data = np.asarray(data).transpose() # Try different models print("TARGET %s" % fit) for i in range(0, 5): sys.stdout.write("func%d: " % i) (m, p) = fitFunc(i,data) means.append(m) results.append(p) best = np.arg...
Python
1
eight v.iter().all(|(_, w)| w == &0) || // or the total weight overflows a u64 v.iter().map(|(_, w)| *w as u128).sum::<u128>() > u64::max_value() as u128 ); } } quickcheck(prop as fn(_)) } #[test] fn total_weight() { fn prop(v: Vec<(usize, u64)>) { let total_weight = v.iter().map(|(_...
Rust
0
# Copyright (c) 2010 Guilherme Gondim. All rights reserved. # Copyright (c) 2009 Simon Willison. All rights reserved. # Copyright (c) 2002 Drew Perttula. All rights reserved. # # License: # Python Software Foundation License version 2 # # See the file "LICENSE" for terms & conditions for usage, and a DISCLAIMER OF # ...
Python
1
print(f"采样时间范围: {start_sample_time} 到 {end_sample_time}, 步长: {step}") print(f"采样时间点数量: {len(sample_time_points)}") # 4. 对每个卫星在每个采样时间点,统计可见目标和可见卫星 result = [] # 如果指定了输出文件,初始化文件 if output_file: # 如果文件已存在,先读取已有数据 if os.path.exists(output_file): try: with op...
Python
1
import time from press_key import InputKey from key_input import Mouse, Keyboard # 用于测试这个包中press_key.py的每一个功能 if __name__ == '__main__': time.sleep(4) test_key = [Keyboard.W, Keyboard.A, Keyboard.S, Keyboard.D] for mode in range(2,3): print('mode:', mode) input_key = InputKey(mode) ...
Python
1
from django.db import models class Form(models.Model): first_name = models.CharField(max_length=80) last_name = models.CharField(max_length=80) email = models.EmailField() date = models.DateField() occupation = models.CharField(max_length=80) def __str__(self): return f"{self.first_nam...
Python
1
serializes_with_correct_word_position() { let seed = 30; let mut rng = StoryRng::with_seed(seed); let mut buffer = vec![0; 64]; rng.gen.fill_bytes(&mut buffer); // Get and sanity check current position, it should not be zero right now let positio...
Rust
0
r: u8, g: u8, b: u8, a: u8, } pub fn parse_aspect(joined: &str) -> Option<f64> { let both: Vec<&str> = joined.split('x').collect(); if let Ok(x) = both[0].parse::<u32>() { if let Ok(y) = both[1].parse::<u32>() { return Some(x as f64 / y as f64); } } None } i...
Rust
0
#3151 stored_utxos.push((outpoint, stored_utxo)); } } } // By definition, all of these lists should be in chain order. assert!( is_sorted(&stored_block_hashes), "unsorted: {:?}", stored_block_hashes ); ...
Rust
0
seed_from_u64(12345))); let mut presets = Vec::new(); presets.push(exact(3, 10)); presets.push(exact(1, 20)); presets.push(exact(1, 30)); presets.push(rand(1, 1..50, rng)); presets.push(exact(3, 11)); presets.push(exact(1, 21)); presets.push(exact(1, 31)); presets.push(rand(1, 1..60...
Rust
0
"name": "bar", "required": False, "returned": "default", "type": "string", "uniqueness": "none", }, ], "description": "Bar", "id": "urn:ietf:params:scim:schemas:core:2.0:Foo", "name": "Bar", ...
Python
1
:x}, size: 0x{:x}, flags: 0x{:x} }}", section.addr, section.size, section.flags) } println!("kernel_start = 0x{:x}, kernel_end = 0x{:x}", kernel_start, kernel_end); println!("multiboot_start = 0x{:x}, multiboot_end = 0x{:x}", multiboot_start, multiboot_end); let mut frame_allocator = memory::AreaFrame...
Rust
0
def sub(num1, num2): ans = num1 - num2 return ans def multi(num1, num2): ans = num1 * num2 return ans def get_name(name): print("give me your name.") name = input("> ") return name name = "" get_name(name) print(f"so, {name}, what will you do now?") print("<=1: Subtract Numbers") print("...
Python
1
he agent (visit its documentation to see all the options) # https://skrl.readthedocs.io/en/latest/api/agents/sac.html#configuration-and-hyperparameters cfg = SAC_DEFAULT_CONFIG.copy() cfg["discount_factor"] = 0.98 cfg["batch_size"] = 100 cfg["random_timesteps"] = 0 cfg["learning_starts"] = 1000 cfg["learn_entropy"] = T...
Python
1
#!/usr/bin/env python3 """ Main file """ from auth import _hash_password print(_hash_password("Hello Holberton"))
Python
1
RefType::FuncRef => 112, RefType::ExternRef => 111, } } } /// Defines WasmEdge value types. #[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum ValType { /// 32-bit integer. /// /// Integers are not inherently signed or unsigned, their interpretation is determined by i...
Rust
0
data_path=os.path.join(args.data_path, "test.csv"), kmer=args.kmer) data_collator = DataCollatorForSupervisedDataset(tokenizer=tokenizer) dataloader = DataLoader( train_dataset, batch_size=args.batch_size, collate_fn=da...
Python
1
enai_api(content_prompt) # Создание резюме summary_prompt = self.prompts['summary_generation'].format(content=content) summary = await self.call_openai_api(summary_prompt) # Извлечение ключевых слов keywords_prompt = self.prompts['keyword_extraction'].format(con...
Python
1
C-AUC={roc_auc:.4f}, Time={elapsed_time:.2f} 秒") # 计算均值 accuracy_mean = np.mean(accuracy_list) precision_mean = np.mean(precision_list) recall_mean = np.mean(recall_list) f1_mean = np.mean(f1_list) roc_auc_mean = np.mean(roc_auc_list) time_mean = np.mean(time_list) # 输出最终均值结果 print("\n===== 10 次实验的平均结果 =====") print(...
Python
1
) .map(|x| x * self.consts.Cu) .collect::<Vec<f64>>() ); unsafe { A_file.write(std::slice::from_raw_parts(A.as_ptr() as *const u8, A.len() * 8)); u_file.write(std::slice::from...
Rust
0