text
string
label_name
string
labels
int64
[Self::Yes] are allowed. /// /// The device's metered state at runtime is determined by the profile /// which is currently active. If the profile explicitly specifies [`No`][Self::No] /// or [`Yes`][Self::Yes], then the device's metered state is as such. /// If the connection profile leaves it undecided at [`Unknown`][...
Rust
0
import glob import os import shutil from tests import get_device_id, get_tests_output_path, run_cli from TTS.vocoder.configs import HifiganConfig config_path = os.path.join(get_tests_output_path(), "test_vocoder_config.json") output_path = os.path.join(get_tests_output_path(), "train_outputs") config = HifiganConfi...
Python
1
3 }), NonZeroUsize::new(3).unwrap(), second_start, second_end, ); time.set(write_t2); w.add_range( Some(&Sequence { id: 1, number: 5 }), NonZeroUsize::new(2).unwrap(), third_start, third_end, ); ...
Rust
0
split2[:-1]: while st and st[-1] != '[[': now2 = st.pop() + now2 if st and st[-1] == '[[': st.pop() now2 = func(now2) st.append(now2) st.append(split2[-1]) return ''.join([s if s != '[[' else ' ' for s in st]) def makeInternalLink(ti...
Python
1
Ok(who), r => Err(O::from(r)), }) } #[cfg(feature = "runtime-benchmarks")] fn successful_origin() -> O { O::from(RoomRawOrigin::Member(Default::default(), Default::default())) } } pub struct EnsureMembers<N: U32, AccountId, I=DefaultInstance>(sp_std::marker::PhantomData<(N, AccountId, I)>); impl< O: Into<...
Rust
0
from behave import when from features.steps.files import when_i_create_file_with_content from features.steps.shell import when_i_run_command from features.util import SUT @when("I disable access to {website}") def block_access_to_address(context, website): when_i_run_command( context, "sed -i '1i...
Python
1
== mbkm.batch_size: log.info("Partial fit with batch size %d", len(k_deque)) log.info("- collecting vectors") vectors = get_vectors(k_deque) log.info("- fitting model") mbkm.partial_fit(vectors) log.info("- cleaning") d_fitted += len(k_...
Python
1
owned()).collect::<Vec<Vec<u8>>>()); remove_file(output).ok(); } #[test] fn interlacing_1_to_0() { let input = PathBuf::from("tests/files/interlacing_1_to_0.png"); let mut opts = get_opts(&input); opts.interlace = Some(0); let output = opts.out_file.clone(); let png = png::PngData::new(&input...
Rust
0
from datetime import datetime import json import inspect import os import subprocess from typing import Any R = '\033[31m' G = '\033[32m' Y = '\033[33m' B = '\033[34m' RE = '\033[0m' URSUS : dict = { "Гум" : "Gummy", "Зима" : "Zima", "Исти...
Python
1
10) .map(|ang| ang as f64) .collect::<Vec<f64>>(), ); ldt.set_g_angles(vec![0.0]); ldt.set_n_luminous_intensities_per_cplane(1 as usize); ldt.set_intensities( (90..280) .step_by(10) .map(|ang| ang as f64) .collect::<Vec<f64>>(), ); ...
Rust
0
0x60, 0x38, 0x1b, 0xe5] ,[0x72, 0x45, 0x06, 0xeb, 0x4c, 0x32, 0x8a, 0x95]]; let k = Key([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]); for i in 0usize..maxlen { let Digest(h) = shorthash(&m[..i], &k); assert!(h == h_expecteds[i]); } ...
Rust
0
buf| bufs.get(buf.index()).map(|data| &*data.0)) .read_positions() .expect("Unable to read mesh positions") .count() <= u16::MAX as _ }) }); let idx_ty = if tiny_idx { IndexType::U16 } else { IndexTyp...
Rust
0
opy)] pub struct Rect { pub x: u32, pub y: u32, pub width: u32, pub height: u32, } impl Rect { pub const fn new(x: u32, y: u32, width: u32, height: u32) -> Self { Self { x, y, width, height } } } #[repr(C)] struct DisplayOne { r: Rect, enabled: u32, flags: u32, } #[repr(C)] struct RespDisplayInfo { h...
Rust
0
// // let mut x = None; // ----- borrowed data cannot be stored into here... // with_int(|y| x = Some(y)); // --- ^ cannot be stored outside of its closure // | // ...because it cannot outlive this closure // // // origin.contains(&sup_sp): // // let mut f: Option<&u32> = None; ...
Rust
0
RepositoryKey::Ed25519(hex::decode(ROOT_KEY_2).unwrap())) .add_mirror(MirrorConfigBuilder::new("http://example.com/b")) .build(), ] ); // disabling any source clears all rewrite rules. assert_eq!(env.rewrite_engine_list_rules().await, vec![]); } #[fasync::run_singlet...
Rust
0
import json from pathlib import Path from typing import Union def load_json(path: Union[Path, str], encoding: str = 'utf-8') -> dict: """ 说明: 读取本地json文件,返回json字典。 参数: :param path: 文件路径 :param encoding: 编码,默认为utf-8 :return: json字典 """ if isinstance(path, str): ...
Python
1
#!/usr/bin/env python3 """ Script de execução do Analisador Global de Ações """ import streamlit as st import subprocess import sys import os # Adicionar diretório atual ao path sys.path.append(os.path.dirname(os.path.abspath(__file__))) if __name__ == "__main__": # Executar aplicação Streamlit subprocess.ru...
Python
1
heduler.CosineAnnealingLR( self.optimizer, cfg.nepoch - cfg.warmup_epoch, eta_min=1e-6 ) self.scheduler = GradualWarmupScheduler( self.optimizer, multiplier=1, total_epoch=cfg.warmup_epoch, after_scheduler=scheduler_cosine ) self.scheduler....
Python
1
av_front_vehicle, _ = self.road.neighbour_vehicles(self.vehicle, self.vehicle.lane_index) # 计算车辆与障碍车辆的距离 dis_av_with_bv = np.linalg.norm(self.vehicle.position - ob_vehicle.position) # 如果障碍车辆前方的车辆是自车,并且与障碍车辆的距离小于8,则奖励值加0.5 if bv_front_vehi...
Python
1
const _, stops.as_ref().len(), m.map_or(ptr::null_mut(), |m| m as *const _ as *const _), ) }; this } /// Creates a new gradient from an iterator of [`GradientStop`]s and an /// optional transformation [`Matrix2D`]. pub fn new_from_iter<I: Into...
Rust
0
new_segment_text, new_segment[0].position) new_subs.append(concatenated_item) new_segment_index += 1 new_segment = [sub] new_segment_duration = self.get_duration_in_seconds(str(sub.start), str(sub.end)) or 0.0 new_segment...
Python
1
# # Copyright (c) 2023 Airbyte, Inc., all rights reserved. # from typing import Any, Callable, Dict, Iterable, Optional import dpath from airbyte_cdk.models import AirbyteStream def get_first(iterable: Iterable[Any], predicate: Callable[[Any], bool] = lambda m: True) -> Optional[Any]: return next(filter(predica...
Python
1
#Supondo que a população de um país A seja da ordem de 80000 habitantes com uma taxa anual # de crescimento de 3% e que a população de B seja 200000 habitantes com uma taxa de crescimento # de 1.5%. Faça um programa que calcule e escreva o número de anos necessários para que a # população do país A ultrapasse ou iguale...
Python
1
value of the field is `XXX1`"] #[inline] pub fn is_xxx1(&self) -> bool { *self == ADC_INTERLEAVE_ENR::XXX1 } } #[doc = "Possible values of the field `CLKOUTSEL`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum CLKOUTSELR { #[doc = "SCG CLKOUT"] _0000, #[doc = "SOSC DIV2 CLK"] _001...
Rust
0
from flask import Flask, jsonify, request, render_template #criando aplicação em flask app = Flask(__name__) # GET > Buscar algo @app.route('/helloworld', methods=['GET']) def helloworld(): return jsonify({ "mgs":" Ola mundo como estao voces " }) """ JavaScript (front) = fetch reactJS (front...
Python
1
serde_json::Value>(&output) { Ok(value) => { if let Some(status) = value.get("status") { if let Some(conditions) = status.get("conditions") { if let Some(conditions) = conditions.as_array() { ...
Rust
0
fn do_join(cond: bool) { let mut a = [1]; let mut b = [2]; { let mut c = if cond { &mut a } else { &mut b }; (&mut c)[0] = 3; verify!(c[0] == 3); } verify!(a[0] == if cond { 3 } else { 1 }); verify!(b[0] == if cond { 2 } else { 3 }); verify!(if cond { a[0] == 3 } els...
Rust
0
# -*- coding: utf-8 -*- # Copyright (C) 2018-2025 Intel Corporation # SPDX-License-Identifier: Apache-2.0 from typing import Any, Union from collections.abc import Callable import logging from openvino import Model class PreprocessConverter(): def __init__(self, model: Model): self._model = model @...
Python
1
odel.fit( train_ds, # 训练数据集 validation_data=val_ds, # 验证数据集 epochs=50, # 最大训练轮次 callbacks=[early_stop], # 回调函数(此处为早停) verbose=1 # 日志输出模式 ) # 执行训练(保持不变) history = compile_and_train(model) # %% [7] 模型评估与保存(更新模型保存逻辑) # 保存最佳模型(而非最后一个epoch的模型) best_mode...
Python
1
from .iq_picture import PictureIqProtocolEntity from ....structs import ProtocolTreeNode import time class SetPictureIqProtocolEntity(PictureIqProtocolEntity): ''' <iq type="set" id="{{id}}" xmlns="w:profile:picture", to={{jid}}"> <picture type="image" id="{{another_id}}"> {{Binary bytes of the ...
Python
1
# dirnames.append(filePath[len(sitePath):]) # get_sub_path(filePath, num-1) # except: # pass # get_sub_path(sitePath, 1) # 优化目录的获取速度 dirnames = [] if os.path.exists(sitePath): dirnames = ['/'...
Python
1
# Copyright (C) 2021 - 2025 ANSYS, Inc. and/or its affiliates. # SPDX-License-Identifier: MIT # # # 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 without restriction, including without limita...
Python
1
s read successfully /// - `Some(Err(_))` - on error /// - `None` - if there is nothing left to read, or a previous call resulted in error /// /// # Examples /// /// ```rust /// # use rsdns::{ /// # message::reader::MessageIterator, /// # Result, /// # }; /// # /// # fn print_questions(buf: &[u8]) -> Result<()> ...
Rust
0
from datasets import load_dataset class DatasetLoader: def __init__(self, hugging_face_df: str, device: str): """Loads Huggings Face dataset and formats it to pytorch with text and labels Args: hugging_face_df (str): Hugging Face dataset string """ self.df = load_data...
Python
1
option::Some(md) => return md, option::None => () } let loc = cx.sess.codemap.lookup_char_pos(sp.lo); let file_node = create_file(cx, copy loc.file.name).node; let ty_node = if cx.sess.opts.extra_debuginfo { match ret_ty.node { ast::ty_nil => llnull(), _ => create_ty(c...
Rust
0
usize { let before = seat_ids.iter().nth(0).unwrap(); let mut seat = seat_ids.iter().nth(1).unwrap(); if before != &(seat - 1) { // edge case, only have to check 'seat + 1' with 'after' return seat - 1; } for after in seat_ids[2..].iter() { if after != &(seat + 1) { ...
Rust
0
_sp[k], classes_expected[k]) assert_array_almost_equal(n_classes_sp[k], n_classes_expected[k]) assert_array_almost_equal(class_prior_sp[k], class_prior_expected[k]) def test_safe_split_with_precomputed_kernel(): clf = SVC() clfp = SVC(kernel="precomputed") iris = datasets.load_iris() ...
Python
1
| | | |\r\n\\/ \\/\\/ \\/ \\__,_|\\__\\___|_| |_|\r\n \r\n"); info!("Copyright <NAME> 2019"); info!("Clocks: {:#?}", clocks); let mut gpioa = cx.device.GPIOA.split(&mut rcc.ahb2); let mut gpiob = cx.device.GPIOB.split(&mut rcc.ahb2); let mut ...
Rust
0
n stream: {}", err); let (return_sender, return_receiver) = crossbeam_channel::bounded(1); let (event_sender, event_receiver) = crossbeam_channel::bounded(1); let mut result = Ok(()); take_mut::take(patch, |patch| { let mut cpal_patch = CpalPatch { patch: M...
Rust
0
# Stop the ForkServer process if it's running from multiprocessing import forkserver forkserver._forkserver._stop() # Stop the ResourceTracker process if it's running from multiprocessing import resource_tracker resource_tracker._resource_tracker._stop() # bpo-37421: Explicitly call _run_fi...
Python
1
import os from dotenv import load_dotenv BASE_DIR = os.path.dirname(os.path.abspath(__file__)) load_dotenv(os.path.join(BASE_DIR, ".env")) class BaseConfig: """Base configuration.""" BOT_TOKEN = os.environ.get("TOKEN") DB_URL = "" class DevelopmentConfig: """Development configuration.""" confi...
Python
1
accounts: &[AccountInfo], ) -> ProgramResult { let account_info_iter = &mut accounts.iter(); let realm_info = next_account_info(account_info_iter)?; // 0 let governing_token_holding_info = next_account_info(account_info_iter)?; // 1 let governing_token_source_info = next_account_info(account_info_iter)...
Rust
0
destroy: Option<unsafe extern "C" fn(_: *mut wlr_output) -> ()>, pub attach_render: Option<unsafe extern "C" fn(_: *mut wlr_output, _: *mut libc::c_int) -> bool>, pub commit: Option<unsafe extern "C" fn(_: *mut wlr_output) -> ...
Rust
0
these values should not be cached user_permissions = get_user_permissions() for df in frappe.get_meta(doc["doctype"]).get("fields"): if df.get("default"): if cstr(df.default).startswith(":"): default_value = get_default_based_on_another_field(df, user_permissions, parent_doc) if default_value is not No...
Python
1
# Print the program to even numbers from 0 to 50 even=[] for number in range(50): if number%2==0: even.append(number) print(even) # Write same program using comprehensions mynum=[number for number in range(50) if number%2==0] print(mynum) # write a program strings that starts with 'a' and ends with ...
Python
1
egg(path)?, python_version.to_string()) } DistributionType::Wheel => { let parts: Vec<&str> = path .file_stem() .unwrap() .to_str() .unwrap() .split...
Rust
0
ents without checking for /// completion /// /// Ending the transaction prematurely could leave the [`Spi`] in an /// inconsistent state. It is not safe to call this function unless the /// transaction is complete. /// /// [`Spi`]: super::spi::Spi #[inline] pub unsafe fn free_uncheck...
Rust
0
data_opt::<D>() .ok_or_else(|| format!("Data `{}` does not exist.", std::any::type_name::<D>()).into()) } /// Gets the global data defined in the `Context` or `Schema`. /// /// # Panics /// /// It will panic if the specified data type does not exist. pub fn data_unchecked<D: Any...
Rust
0
box: ErgoBox, } /// SpecifiedBox impl impl SpecifiedBox for ErgsBox { /// A simple `BoxSpec` that just checks the value of nanoErgs is /// above `1000000` fn box_spec() -> BoxSpec { BoxSpec::new(None, Some(1000000..u64::MAX), vec![], vec![]) } } /// Rust ErgsBox Methods impl ErgsBox { /// Co...
Rust
0
"""ADD CONTACT PAGE""" from selenium.webdriver.common.by import By from homework_24.pages.base_page import BasePage first_name_field = (By.ID, "firstName") last_name_field = (By.ID, "lastName") birthdate_field = (By.ID, "birthdate") email_address_field = (By.ID, "email") phone_field = (By.ID, "phone") street1_field =...
Python
1
) # noqa: E501 history = [ EvmEvent( identifier=1, tx_hash=tx_hash, sequence_index=0, timestamp=TimestampMS(1569924574000), location=Location.OPTIMISM, location_label=make_evm_address(), asset=A_ETH, amount=FVal...
Python
1
STIONS_LIST: [question_json], C.REVIEWS_LIST: []} full_json[line_num] = product_json line_num += 1 df = pd.DataFrame.from_dict(full_json, orient='index') pickle_filepath = "%s/%s-%s.pickle" % (C.INPUT_DATA_PATH, split, category) with open(pickle_filepath, 'wb') as f: df.to_pickle(f) def load...
Python
1
&Self::Prng, Self::Error> { let state = self.state.as_deref().ok_or_else(InterpreterExtractError::new)?; Ok(&state.prng) } fn prng_mut(&mut self) -> Result<&mut Self::Prng, Self::Error> { let state = self.state.as_deref_mut().ok_or_else(InterpreterExtractError::new)?; Ok(&mut st...
Rust
0
image[self.ys[i],self.xs[i],:] = self.convert_color(i,128) else: image[self.ys[i],self.xs[i],:] = 127,127,127 image = Image.fromarray(image) image = image.transpose(Image.FLIP_TOP_BOTTOM) for trans_type in range(4): trans_image = self.__transpose...
Python
1
..ETHERNET_MAX_PENDING_FRAMES { assert!(state.add_pending_frame(ip, Buf::new(vec![i as u8], ..)).is_none()); } // Check that adding more than capacity will drop the older buffers as // a proper FIFO queue. assert_eq!(0, state.add_pending_frame(ip, Buf::new(vec![255], ..)).unw...
Rust
0
from click import argument from flask.cli import AppGroup from sqlalchemy.orm.exc import NoResultFound manager = AppGroup(help="Queries management commands.") @manager.command(name="rehash") def rehash(): from redash import models for q in models.Query.query.all(): old_hash = q.query_hash q....
Python
1
// we can just call .unwrap() to assert this was a success let res = instantiate(deps.as_mut(), mock_env(), info, msg).unwrap(); assert_eq!(0, res.messages.len()); // it worked, let's query the state let res = query(deps.as_ref(), mock_env(), QueryMsg::GetPetStatus {}).unwrap(); ...
Rust
0
let top_left = CharacterVertex { pos: [min_x, min_y], uv: glyph_layout.min_uv, color: text.color.into(), }; let bottom_left = CharacterVertex { pos: [min_x, max_y], uv: [ glyph_layout.min_uv[...
Rust
0
} if let Some(appearance) = appearance { cm.insert_comp(*addr, ent, appearance.clone()); } if let Some(item) = item { cm.insert_comp(*addr, ent, item.clone()); } if let Some(animate) = animate { ...
Rust
0
mizer self.grad = C.GradOperation(get_by_list=True, sens_param=True) self.sens = Tensor((np.ones((1,)) * sens).astype(np.float32)) self.reduce_flag = reduce_flag if reduce_flag: self.grad_reducer = DistributedGradReducer(optimizer.parameter...
Python
1
from math import log from Kyber_failure import p2_cyclotomic_error_probability from MLWE_security import MLWE_summarize_attacks, MLWEParameterSet from proba_util import build_mod_switching_error_law class KyberParameterSet: def __init__(self, n, m, ks, ke, q, rqk, rqc, rq2, ke_ct=None): if ke_ct is None: ...
Python
1
DataType::Struct(_) => panic!("struct array conversion not yet supported"), DataType::List(inner) => ColumnType::Array(*inner.clone()), _ => ColumnType::Scalar(dtype.clone()), } } } impl From<ColumnType> for DataType { fn from(from: ColumnType) -> Self { match from {...
Rust
0
.all(&token, &crate::param::Notification::default()) .await; assert!(notifications.is_ok()); } #[tokio::test] async fn read() { let (api, token) = crate::test::api().await; let status = api.me.notifications.read(&token, &[1]).await; assert!(status.is_ok()); ...
Rust
0
from translation.term_manager import TermManager import traceback def main(): print("开始测试术语替换...") term_manager = TermManager() # 测试用的替换字典 replacements = { "__TERM_0__": "QRZ(谁在呼叫我)", "__TERM_1__": "呼叫" } # 测试用例 test_cases = [ "__ term_0__?谁是__TERM_1_?...
Python
1
s::xiapi::XI_TS_RST_SRC_GPI_1_INV, GPI_2_INV = xiapi_sys::xiapi::XI_TS_RST_SRC_GPI_2_INV, GPI_3_INV = xiapi_sys::xiapi::XI_TS_RST_SRC_GPI_3_INV, GPI_4_INV = xiapi_sys::xiapi::XI_TS_RST_SRC_GPI_4_INV, GPO_1 = xiapi_sys::xiapi::XI_TS_RST_SRC_GPO_1, GPO_2 = xiapi_sys::xiapi::XI_TS_RST_SRC_GPO_2, GPO_3 = xiapi_...
Rust
0
assert!( matches!(res, Err(git_discover::upwards::Error::NoMatchingCeilingDir)), "the canonicalized ceiling dir doesn't have the same root as the git dir candidate, and can never match." ); Ok(()) } #[test] fn ceilings_are_adjusted_to_match_search_dir() -> crate::Result { let relative_w...
Rust
0
(); match cla[0] { "dummy" => dummy::DummyConvergenceLayer::new().into(), "mtcp" => mtcp::MtcpConvergenceLayer::new(port).into(), "http" => http::HttpConvergenceLayer::new(port).into(), _ => panic!("Unknown convergence layer agent agent {}", cla[0]), } } #[doc = "Register `TOUCH_...
Rust
0
texto = input("Introduce un texto: ") letras = [] texto = texto.lower() letras.append(input("Ingres la primera letra favorita: ").lower()) letras.append(input("Ingres la segunda letra favorita: ").lower()) letras.append(input("Ingres la tercera letra favorita: ").lower()) print() print("CANTIDAD DE LETRAS REPETIDAS"...
Python
1
import bpy import bmesh from mathutils import Vector # Find a mesh that contains UV mesh shape keys def find_uv_mesh(objects, insideModifiers=True): for obj in objects: # Requires mesh & UV channel if obj and obj.type == 'MESH': # Contains shape keys? if obj.data.shape_keys and len(obj.data.shape_keys....
Python
1
TERNOBJECT) -> ::windows_sys::core::HRESULT; #[doc = "*Required features: 'Win32_UI_Accessibility', 'Win32_System_Com'*"] #[cfg(feature = "Win32_System_Com")] pub fn LegacyIAccessiblePattern_GetIAccessible(hobj: HUIAPATTERNOBJECT, paccessible: *mut IAccessible) -> ::windows_sys::core::HRESULT; #[doc = "...
Rust
0
focal loss (Eq.4) cfg.flitplus.lambdavat = 0.5 # lambda in phi (Eq.10) cfg.flitplus.factor_ema = 0.8 # beta in omega (Eq.12) cfg.flitplus.weightReg = 1.0 # balance lossLocalLabel and lossLocalVAT # --------------- register corresponding check function ---------- cfg.register_cfg_check_fun(assert...
Python
1
ror occurred trying to create an HTTP request #[error(transparent)] Http(#[from] http::Error), } //! Filters a stream by a predicate. use Data; use dataflow::channels::pact::Pipeline; use dataflow::{Stream, Scope}; use dataflow::operators::generic::operator::Operator; /// Extension trait for filtering. pub tr...
Rust
0
color_to_rgb(x) }; init_with_provider(mmio, color_provider); } /// Init the 24-bit (R8G8B8) format bitmap display /// Note: this format is word-aligned, which means every color takes up /// 32 bits in memory, but only 24 are actually used #[cfg(not(feature = "8-bit-display"))] pub fn init(mmio: Arc...
Rust
0
clone()); } else { break; } } else { break; } } Ok(clips) } use std::collections::BTreeMap; use uuid::Uuid; use chrono::datetime::DateTime; use std::fmt; use query::ColumnName; use rustc_serialize::{Encodable, Encoder, Decodable, Decoder}; use rustc_serialize::json::Json; use rustc_serialize::base64...
Rust
0
print(''' , //\ / | ; | /_| .-"` `"-. /` `\ / \ .-.,_| .-""""-. | ...
Python
1
}, FnType{ args:a2, return_type:r2 }) => a1 == a2 && r1 == r2, ( SimpleType{ name: n1, modifiers: m1, generics: g1, traits: t1, ...
Rust
0
elp.autodesk.com/view/FBX/2016/ENU/?guid=__cpp_ref_class_fbx_mesh_html#details). #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum MappingMode { /// The mapping is undetermined. None, /// One mapping coordinate for each "control point". // vertices[i] => map_elem[i] ByControlPoint, /// One m...
Rust
0
from dotenv import load_dotenv load_dotenv() import os import logging from llama_index.vector_stores import MongoDBAtlasVectorSearch from app.engine.constants import DATA_DIR from app.engine.context import create_service_context from llama_index import ( SimpleDirectoryReader, VectorStoreIndex, StorageC...
Python
1
""" ========================= Train error vs Test error ========================= Illustration of how the performance of an estimator on unseen data (test data) is not the same as the performance on training data. As the regularization increases the performance on train decreases while the performance on test is optim...
Python
1
from BitDogLib import * # está linha nos da acesso a funções para interagir com o BitDogLab AZUL = [0, 0, 1] jogador_x = 2 jogador_y = 0 ligar_led(jogador_x, jogador_y, AZUL) VERDE = [0, 1, 0] arvore_x = 0 arvore_y = 4.999999 # agora aqui também precisamos mudar arvore_y para int ligar_led(arvore_x, int(arvore_y), V...
Python
1
pub const P92000L: &str = "9P2000.L"; /* * 9P magic numbers */ /// Special tag which `Tversion`/`Rversion` must use as `tag` pub const NOTAG: u16 = !0; /// Special value which `Tattach` with no auth must use as `afid` /// /// If the client does not wish to authenticate the connection, or knows that authentication i...
Rust
0
import os import shutil import pyNastran def main(): PKG_PATH = pyNastran.__path__[0] BASE = os.path.join(PKG_PATH, '..') test_filename = os.path.join(BASE, 'dev', 'test_files.txt') assert os.path.exists(test_filename), test_filename with open(test_filename, 'r') as test_file: lines = test...
Python
1
date_channel(Side::Left as u8, false)?; self.update_channel(Side::Right as u8, false)?; Ok(()) } pub fn has_new_data(&self) -> bool { self.new_data } pub fn get_value(&self, side: Side) -> u16 { self.values[side as usize] } } pub struct MyoParser { reader: Myo...
Rust
0
::Assign(name, variable) => visitor.visit_assign(name, variable), // _ => panic!() // } // } // } //// The abstract visitor //pub trait Visitor<T> { // fn visit_name(&mut self, n: &Name) -> T; // fn visit_stmt(&mut self, s: &Stmt) -> T; // fn visit_expr(&mut self, e: &Expr) -> T; //} ...
Rust
0
ounts.proper_pair, PercentageFormat(qc_pass_counts.proper_pair, qc_pass_counts.paired), PercentageFormat(qc_fail_counts.proper_pair, qc_fail_counts.paired) ); println!( "{} + {} with itself and mate mapped", qc_pass_counts.mate_mapped, qc_fail_counts.mate_mapped ); printl...
Rust
0
: *const c_char); pub fn nvgText(ctx: *mut NVGcontext, x: c_float, y: c_float, string: *const c_char, end: *const c_char) -> c_float; pub fn nvgTextBox(ctx: *mut NVGcontext, x: c_float, y: c_float, breakRowWidth: c_float, string: *const c_char, end: *const c_char); pub fn nvgTextBounds(ctx: *mut NVGcontext,...
Rust
0
#!/usr/bin/env python3 """ Convert /depth (mil_msgs/DepthStamped) to /depth/pose (geometry_msgs/PoseWithCovarianceStamped) so the EKF can fuse an absolute Z measurement in simulation. """ import rclpy from geometry_msgs.msg import PoseWithCovarianceStamped from mil_msgs.msg import DepthStamped from rclpy.node import No...
Python
1
FAULTSA { pDataType: LPSTR, pDevMode: LPDEVMODEA, DesiredAccess: ACCESS_MASK, }} pub type PPRINTER_DEFAULTSA = *mut PRINTER_DEFAULTSA; pub type LPPRINTER_DEFAULTSA = *mut PRINTER_DEFAULTSA; STRUCT!{struct PRINTER_DEFAULTSW { pDataType: LPWSTR, pDevMode: LPDEVMODEW, DesiredAccess: ACCESS_MASK, }}...
Rust
0
Ok(x509_module .call1("IssuerAlternativeName", (ians,))? .to_object(py)) } else if oid == *TLS_FEATURE_OID { let tls_feature_type_to_enum = py .import("cryptography.x509.extensions")? .getattr("_TLS_FEATURE_TYPE_TO_ENUM")?; let features = pyo3:...
Rust
0
free beer for your health :-) //! [Na zdravje](https://translate.google.com/?hl=en&sl=sl&tl=en&text=Na%20zdravje&op=translate) ! //! // endregion: auto_md_to_doc_comments include README.md A //! mod local_mod; mod remote_mod; mod utils_mod; use std::fs; pub use local_mod::*; pub use remote_mod::*; pub use utils_m...
Rust
0
3)) != 0, is_lvscp_enabled=(n & (1 << 4)) != 0, ) @main.command(SERVICE.SET_PORT_COMPATIBILITY_SETTINGS.command) @click.option("--tfcp", is_flag=True, default=False) @click.option("--fcp", is_flag=True, default=False) @click.option("--ufcs", is_flag=True, default=False) @click.option("--hvscp", i...
Python
1
06-02T12:12:13+10:00".to_owned(), "2030-06-02T12:12:13+10:00".to_owned() ], rrule_result.get_all_iter_dates_iso8601("", "") ) } #[test] fn test_monthly_rrule_4() { // test we get the right next date let rrule_result = convert_to_rrule("FREQ=MO...
Rust
0
}, ) filename = path.join(tmp, "apples.beancount") entries, errors, options_map = loader.load_file(filename) self.assertEqual({"apples.beancount"}, set(os.listdir(tmp))) class TestOptionsAggregation(unittest.TestCase): def test_agg...
Python
1
s u32) } pub fn set_nonblocking(&self, _nonblocking: bool) -> Result<()> { Err(Error::new(ErrorKind::Other, "TcpListener::set_nonblocking not implemented")) } pub fn set_only_v6(&self, _only_v6: bool) -> Result<()> { Err(Error::new(ErrorKind::Other, "TcpListener::set_only_v6 not implem...
Rust
0
in.x, source_rect.origin.y, op as DWORD, ) } == 0 { Err(crate::win32_error(crate::Win32Function::BitBlt)) } else { Ok(()) } } /// Move this DC to a coordinate point. pub fn move_to(&self, p: Point2D<c_int>) ...
Rust
0
from get_input import get_input, get_test_input def apply(wire, d): if wire.isdigit(): return int(wire) if wire.isalpha() and type(d[wire]) != list: return apply(d[wire], d) operation = d[wire] op = operation[-2] if op == "AND": result = apply(operation[0], d) & apply(ope...
Python
1
Color { type Raw = (); } impl From<Color16> for VGA16Color { fn from(color: Color16) -> Self { Self(color) } } impl Deref for VGA16Color { type Target = Color16; fn deref(&self) -> &Self::Target { &self.0 } } impl DrawTarget for VGAHiResTarget { type Color = VGA16Color; ...
Rust
0
ile("nghttp2/lib/nghttp2_outbound_item.c") .file("nghttp2/lib/nghttp2_pq.c") .file("nghttp2/lib/nghttp2_priority_spec.c") .file("nghttp2/lib/nghttp2_queue.c") .file("nghttp2/lib/nghttp2_rcbuf.c") .file("nghttp2/lib/nghttp2_session.c") .file("nghttp2/lib/nghttp2_stream.c")...
Rust
0
rade})") # Timing cycle_time = time.time() - cycle_start self.logger.info(f"✅ Ciclo ultra-aggressivo completato in {cycle_time:.2f}s") except Exception as e: self.logger.error(f"❌ Errore ciclo ultra-aggressivo: {e}") async def main(): ...
Python
1
fn reset_value() -> Self::Ux { 0 } } <reponame>RustyThingy/ratchet<filename>ratchet_deflate/src/handshake.rs<gh_stars>1-10 // Copyright 2015-2021 Swim Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You ma...
Rust
0