text
string
label_name
string
labels
int64
", str(e.exception)) def test_with_wrong_tag(self): data = b"\x20\x02\xff\xaa" with self.assertRaises(UnexpectedDER) as e: remove_sequence(data) self.assertIn("wanted type 'sequence'", str(e.exception)) def test_with_wrong_length(self): data = b"\x30\x03\xff\xaa" ...
Python
1
ntext: *mut GPContext, data: *mut c_void) -> GPContextFeedback; pub type GPContextProgressStartFunc = extern "C" fn (context: *mut GPContext, target: c_float, text: *const c_char, data: *mut c_void) -> c_uint; pub type GPContextProgressUpdateFunc = extern "C" fn (context: *mut GPContext, id: c_uint, current: c_float, ...
Rust
0
(day % 10), f)?; // Time designator. // // Input: 2021-01-01T01:01:01.010000+00:00 // |-| f.write_str("T")?; // Hours. // // Input: 2021-01-01T01:01:01.010000+00:00 // |--| Display::fmt(&(seconds / u64::fr...
Rust
0
class Player: Team = "India" def __init__(self, name, age): self.name = name self.age = age def get_details(self): print(f"Name is {self.name}\nAge is {self.age}") ply1 = Player("Virat", 36) ply1.get_details() print("-" * 60) ply2 = Player("Rohit", 38) ply2.get_details() print(...
Python
1
_data.unwrap()) { eprintln!("An error has occured in the callback function {}", e); } } else { eprintln!("{}", clipboard_data.unwrap_err()); } } } } } } impl Drop ...
Rust
0
.display()))), |t| Ok(t.to_string()), )?, source: info["source"].as_str().map(|s| s.to_string()), metadata, }) } // TODO: better name static MY_SET: &percent_encoding::AsciiSet = &NON_ALPHANUMERIC.remove(b'.').remove(b'-'); fn path_to_asset_url(asset_dir: &Path, path: &...
Rust
0
# This example shows you a simple, non-interrupt way of reading Tufty 2040's buttons with a loop that checks to see if buttons are pressed. import time from pimoroni import Button from picographics import PicoGraphics, DISPLAY_TUFTY_2040 display = PicoGraphics(display=DISPLAY_TUFTY_2040) display.set_backlight(1.0) d...
Python
1
orrow().val); } if let Some(left_node) = node.borrow_mut().left.take() { queue.push_back(NodeInfo(left_node, level+1)); }; if let Some(right_node) = node.borrow_mut().right.take() { queue.push_back(NodeInfo(right_node, level+1)); ...
Rust
0
ata: {e}") def log_activity(self, user_id, detail, process_type, table_name): """ Belirli bir işlemi loglama işlevi. Args: user_id (int): İşlemi gerçekleştiren kullanıcının ID'si. detail (str): İşlemle ilgili detaylı bilgi. process_type (i...
Python
1
reader.searcher(); let qp = QueryParser::for_index(&self.index, vec![self.schema.content()]); let q = qp.parse_query(search).ok()?; let top_docs: Vec<(Score, DocAddress)> = searcher.search(&q, &TopDocs::with_limit(10)).ok()?; let mut snippet_generator = SnippetGenerator::cr...
Rust
0
performance. pub struct StageStash { pub trait_name: Ident, pub vtable_name: Ident, pub repr_name: Ident, pub trait_object_name: Ident, pub vtable_items: Vec<VtableItem>, } fn path_to_box() -> Path { let mut segments = Punctuated::new(); let mut push_segment = |name| { segments.pus...
Rust
0
AssetClosed { feed: F, asset: A }, AssetPriceUpdated { feed: F, asset: A, price: P }, Stopped { feed: F }, } /// The feed identifiers. #[derive(PartialEq, Eq, Copy, Clone, Hash, Debug)] pub enum FeedIdentifier { Pyth, Binance, } /// The possible errors hapenning while feeds are running. #[derive(PartialEq, Eq, C...
Rust
0
_str(&input).unwrap(); assert_eq!(s.0, ARR); let output = serde_json::to_string(&s).unwrap(); assert_eq!(output, input); } } <reponame>tanium/octobot<gh_stars>10-100 use std::fs; use std::io::{Read, Write}; use std::path::PathBuf; use std::sync::{RwLock, RwLockReadGuard, RwLockWriteGuard}; ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- import json import os import pytest try: from pymarketcap import AsyncPymarketcap except ImportError: pass from pymarketcap import Pymarketcap from pymarketcap.test.consts import asyncparms from pymarketcap.test.historical import (assert_consistence, assert_type...
Python
1
println!("Usage: {} [OPTION]... FILE...", NAME); println!(""); println!("{}", getopts::usage("Update the access and modification times of \ each FILE to the current time.", &opts)); if matches.free.is_empty() { return 1; } ...
Rust
0
rch.isnan(scale)] = 1 distr = self.distribution_class(loc=loc, scale=scale) return distr class SkewNormDistributionLoss(DistributionLoss): # TODO pass class InverseGaussDistributionLoss(DistributionLoss): distribution_class = distributions.Gamma # need for discrete of 'scale' rate is...
Python
1
on about available fields see [pcr](index.html) module"] pub struct PCR_SPEC; impl crate::RegisterSpec for PCR_SPEC { type Ux = u32; } #[doc = "`read()` method returns [pcr::R](R) reader structure"] impl crate::Readable for PCR_SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [pcr::W](W) writer s...
Rust
0
from flet import * def main(page: Page): page.bgcolor = colors.BLACK54 page.vertical_alignment = MainAxisAlignment.CENTER images = [ 'img/imagem-1.jpeg', 'img/imagem-2.jpeg', 'img/imagem-3.jpeg', 'img/imagem-4.jpeg', 'img/imagem-5.jpeg', 'img/imagem-...
Python
1
// TODO: write in terms of insert, to prevent the requirement of recursion? // typemap!(Type = val, Type2 = val2, ... , ..rest) /// Helper for creating a value of a typemap. /// /// Takes a comma separated list of expressions of the form `Type = expr`, /// optionally followed by a single expr representing the rest of...
Rust
0
from fastapi import APIRouter, Response import s2sphere from geopy.geocoders import Nominatim from app.routes.day21.utils.country import get_country_from_country_code from app.routes.day21.utils.dms import CoordinateType, print_dms day_21_router = APIRouter(prefix="/21") @day_21_router.get("/coords/{cell_id_str}") ...
Python
1
println!("--- Helpers ---"); for hel in app_data.helpers.values() { println!("{}", hel.name); for method in &hel.methods { println!("- {}", method.name); } println!(); } println!("--- Concerns ---"); for con in ap...
Rust
0
count": 7858, "_formatted": { "id": 299537, "popularity": 44.726, "vote_average": 7.0, "title": "<em>Captain</em> Marvel", "tagline": "Higher. Further. Faster.", "overview": "The story follows Carol Danvers as she becomes one of the universe’s most pow...
Rust
0
#!/usr/bin/env python3 """ 🧪 机器人API测试脚本 - Windows版本 用于测试机器人与服务器的各种API交互 使用方法: 1. 安装依赖: pip install requests 2. 运行脚本: python robot_test_script_windows.py 3. 选择要测试的功能 """ import requests import json import time class RobotAPITester: def __init__(self, server_ip="192.168.110.148", robot_id=1): self.server_...
Python
1
Bits: vks::vk::VkPipelineStageFlagBits; max_enum: vks::vk::VK_PIPELINE_STAGE_FLAG_BITS_MAX_ENUM; flags { const TOP_OF_PIPE [TopOfPipe] = vks::vk::VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT; const DRAW_INDIRECT [DrawIndirect] = vks::vk::VK_PIPELINE_STAGE_DRAW_INDIRECT_BIT; const VERTEX_INPUT [Ver...
Rust
0
→ %02C - %F → %010F - %G → %04G - %Y → %04Y See https://bugs.python.org/issue13305 for more details. """ if datetime.date(1, 1, 1).strftime("%Y") == "0001": return fmt mapping = {"C": 2, "F": 10, "G": 4, "Y": 4} return re.sub( r"((?:^|[^%])(?:%%)*)%([CFGY])", lam...
Python
1
from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from modificar_torre import actualizar_torre from modificar_pantalla import actualizar_pantalla def nav(seriales, wait, failed_serials): for serial in seriales: try: search_field = ...
Python
1
import numpy as np import pandas as pd from sklearn.linear_model import LinearRegression import matplotlib.pyplot as plt def generate_graph(): # Read data from Excel file def read_data_from_excel(file_path): df = pd.read_excel(file_path) years = df['Year'].values cases = df['Cases_India...
Python
1
ed_color(pixel_color, samples_per_pixel); } } } <gh_stars>0 //! Avahi implementation for cross-platform TXT record. use super::string_list::{AvahiStringListNode, ManagedAvahiStringList}; use crate::txt_record::TTxtRecord; use crate::Result; use libc::c_char; use std::cell::UnsafeCell; #[derive(Debug)] pub...
Rust
0
elif int(players_hp-(players_max_hp*0.05)) <= 0: await function_in.sql_update("rpg_players", "players", "hp", 1, "user_id", user.id) else: await function_in.sql_update("rpg_players", "players", "hp", int(players_hp-(players_max_hp*0.05)),...
Python
1
on; use frame_support::{assert_ok, assert_noop, parameter_types, ord_parameter_types}; use frame_system::EnsureSignedBy; use sp_core::H256; use sp_runtime::{traits::{BlakeTwo256, IdentityLookup, BadOrigin}, testing::Header}; type UncheckedExtrinsic = frame_system::mocking::MockUncheckedExtrinsic<Test>; type Blo...
Rust
0
erson ; # in the context of the Marvel universe rel:enemyOf <#spiderman> ; foaf:name \"<NAME>\" . <#spiderman> rel:enemyOf <#green-goblin> ; a foaf:Person ; foaf:name \"Spiderman\", \"Человек-паук\"@ru ."; eprintln!("{:?}", parse_turtle(data).unwrap()); } } //! # Naive Bayes //! //! ...
Rust
0
list1 = [(4, 5), (4, ), (8, 6, 7), (1, ), (3, 4, 6, 7)] K = 1 res1 = [ele for ele in list1 if len(ele) != K] res2 = list(filter(lambda x: len(x) != K, list1)) print('Filtered list:\n', res1, '\n', res2) ''' # Python3 code to remove tuples of length K using list comprehension list1 = [(4, 5), (4, ), (8, 6, 7), (1, ...
Python
1
nem_attr!(MEAN, REGENERATE,), defense: Defense(4), exp: Exp(120), gold: ItemNum(50), level: Level(6), name: "troll", rarelity: 16, tile: b'T', }, StaticStatus { attack: &[hp_dice!(1, 9), hp_dice!(1, 9), hp_dice!(2, 9)], attr: enem_attr!(MEA...
Rust
0
# Copyright (c) 2021, Wahni Green Technologies Pvt. Ltd. and contributors # For license information, please see license.txt import frappe from frappe import _ from frappe.model.document import Document from frappe.utils.background_jobs import is_job_enqueued from erpnext.accounts.doctype.account.account import merge_...
Python
1
::bytes::Container::UNIT)?; } } }; quote::quote! { #variant_ident => { #handler }, } } fn enum_variant_name(ident: &syn::Ident, data_enum: &syn::DataEnum) -> proc_macro2::TokenStream { let variant_idents = data_enum.variants.iter().map(|variant| &variant.ident); let var...
Rust
0
.insert(subj, &skos::broader, &gnd_id).unwrap(); } } else if !args.is_present("no-related") { graph.insert(subj, &skos::related, &gnd_id).unwrap(); } } } } } <gh_stars>1-10 use itertools::Itertools; fn parse_input(s: &str) ...
Rust
0
clingo_ast_theory_atom_definition_type_clingo_ast_theory_atom_definition_type_any as isize, Directive = clingo_ast_theory_atom_definition_type_clingo_ast_theory_atom_definition_type_directive as isize, } #[derive(Copy, Clone)] pub struct TheoryAtomDefinition<'a> { data: clingo_ast_t...
Rust
0
was created by call of `new_unchecked` pub fn check_correctness(&self) { Self::check_size(self.frame_size) } fn check_size(frame_size: usize) { assert!(frame_size <= MAX_FRAME_SIZE); assert!(frame_size >= MIN_FRAME_SIZE); assert!(frame_size % 8 == 0); } fn allocate...
Rust
0
e(name): C64 = general_conv(input_disc,filters=64,kernel=4,stride=2,padding="SAME",name="c1",norm=False,relu=True,alpha=0.2) C128 = general_conv(C64,filters=128,kernel=4,stride=2,padding="SAME",name="c2",norm=True,stddev=0.02,relu=True,alpha=0.2) C256 = general_conv(C128,filters=256,ker...
Python
1
] = asic.matrix_rot90(k) # validate the quadrants all have the same number of sections, with matching asics for p in range(num_sections): if not 'section_len' in locals(): section_len = len(sections[p]) else: assert section_len == len(sections[p]) for s in range...
Python
1
from django import forms from django.contrib import messages from django.utils.translation import gettext_lazy as _ from ralph.admin.helpers import get_content_type_for_model from ralph.attachments.models import Attachment, AttachmentItem from ralph.lib.mixins.forms import RequestModelForm class ChangeAttachmentWidg...
Python
1
from models import ResNet18 from utils import load_dataset, train, evaluate, prune_and_evaluate, save_model, compute_score import torch import torch.optim as optim from torch.optim.lr_scheduler import StepLR if __name__ == "__main__": device = torch.device('cuda' if torch.cuda.is_available() else 'cpu') net = ...
Python
1
le_mutation_rate=False, ) c_v = ls_viterbi_tree(s[0, :], ts_check, r, mu) ll_tree = np.sum(np.log10(c_v.normalisation_factor)) # Attempt to get the path path_tree_dict = c_v.traceback() # Work out the likelihood of the proposed path p...
Python
1
# -*- coding: utf-8 -*- # @Time : 2025/6/9 17:47 # @Author : 蔍鸣霸霸 # @FileName: prompt_pipeline.py.py # @Software: PyCharm # @Blog :只因你太美 # prompts/prompt_pipeline.py import os from jinja2 import Template class PromptPipeline: def __init__(self, template_dir=None): if template_dir is None: ...
Python
1
use tempfile::TempDir; #[test] fn single_checkpoint() { let table_size: u64 = 1 << 14; let log_size: u64 = 1073741824; let tmp_dir = TempDir::new().unwrap(); let dir_path = tmp_dir.path().to_string_lossy().into_owned(); let mut builder = FasterKvBuilder::new(table_size, log_size); builder.with_...
Rust
0
sts/elfs/noop.so").expect("file open failed"); let mut elf_bytes = Vec::new(); file.read_to_end(&mut elf_bytes) .expect("failed to read elf file"); let mut elf = EBpfElf::load(&elf_bytes).expect("validation failed"); elf.elf.header.entry = 1; elf.get_entrypoint_instr...
Rust
0
(pigeon: TTYPigeon | None): cloudlog.warning("Storing almanac in ublox flash") if pigeon is not None: # controlled GNSS stop pigeon.send(b"\xB5\x62\x06\x04\x04\x00\x00\x00\x08\x00\x16\x74") # store almanac in flash pigeon.send(b"\xB5\x62\x09\x14\x04\x00\x00\x00\x00\x00\x21\xEC") try: if ...
Python
1
-= villanos[nivel].daño # Manejo de los disparos if tanda_disparos > 0: tanda_disparos += 1 if tanda_disparos > 2: tanda_disparos = 0 # Contacto de disparo con el perro cyborg for bala in balas: if villanos[nivel].se_encuentra_con(bala): bala.impacta_a(villanos[nivel]) balas.pop(balas.in...
Python
1
body: Vec<Token>, accepts_content_block: bool, declared_at_root: bool, ) -> Self { Self { args, body, accepts_content_block, declared_at_root, } } } #[derive(Debug, Clone)] pub(crate) struct Content { /// The literal block, ser...
Rust
0
= Vec3::zero(); // lookfrom = Vec3::new(278.0, 278.0, -800.0); // lookat = Vec3::new(278.0, 278.0, 0.0); // vfov = 40.0; } let cam: Camera = Camera::new( lookfrom, lookat, vup, vfov, aspect_ratio, aperture, dist_to_focus, 0...
Rust
0
upply_data_year(start_date=None, end_date=None): """ 货币供应量(年底余额) 方法说明:通过API接口获取货币供应量(年底余额),可以通过参数设置获取对应起止日期的数据。 返回类型:pandas的DataFrame类型。 参数含义: start_date:开始日期,格式XXXX,发布日期在这个范围内,可以为空; end_date:结束日期,格式XXXX,发布日期在这个范围内,可以为空。 """ lg = bs.login() ...
Python
1
# Definition for a binary tree node. # class TreeNode: # def __init__(self, val=0, left=None, right=None): # self.val = val # self.left = left # self.right = right ''' 1740. Find Distance in a Binary Tree URL := https://leetcode.com/problems/find-distance-in-a-binary-tree/description/ N := ...
Python
1
t(); let mut ndp_configs = NdpConfigurations::default(); ndp_configs.set_dup_addr_detect_transmits(None); ndp_configs.set_max_router_solicitations(None); stack_builder.device_builder().set_default_ndp_configs(ndp_configs); stack_builder.ipv6_builder().forward(true); let m...
Rust
0
art the enhanced bot""" print("🤖 Enhanced ProfileBot is starting...") print("✨ Features: Multiple entries, Bold formatting, Clean bullets") try: print("🔍 Testing Gemini API connection...") test_response = model.generate_content("Hello") if test_response and test_response.text:...
Python
1
[allow(missing_docs)] #[doc(hidden)] pub struct _PRICTRL; #[doc = "`read()` method returns [prictrl::R](prictrl::R) reader structure"] impl crate::Readable for PRICTRL {} #[doc = "`write(|w| ..)` method takes [prictrl::W](prictrl::W) writer structure"] impl crate::Writable for PRICTRL {} #[doc = "Priority Control"] pub...
Rust
0
("no keys in this YubiHSM (#{})", serial_number); process::exit(0); } println!("Listing keys in YubiHSM #{}:", serial_number); for key in &keys { display_key_info(&*hsm, &key, &key_formatters); } } } /// Load information about configured YubiHSM keys fn loa...
Rust
0
pEnum.vl_api_memif_mode_t.MEMIF_MODE_API_ETHERNET, socket_id=1, ) memif.add_vpp_config() memif.config_ip4() memif.admin_up() remote_memif.add_vpp_config() remote_memif.config_ip4() remote_memif.admin_up() self.assertTrue(memif.wait_for_link_...
Python
1
USER_TROPHY_ENTRY, self.language(), offset, online_id ) } fn trophy_set_encode(&self, online_id: &str, np_communication_id: &str) -> String { format!( "https://{}{}{}/trophyGroups/all/trophies?fields=%40default,trophyRare,trophyEarnedRa...
Rust
0
import string from hashlib import md5 from Crypto.Hash import Poly1305 from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad import os def sign_token(token): try: key = os.environ.get('TOKEN_KEY', 'AAAAAAAAAAAAAAAA') auth_nonce = os.urandom(16) if isinstance(key, str): ...
Python
1
is_all or metric_type == "stability": m = FeaturesStability() results[m.name] = {"Value": m(X, y_pred, surrogate), "Reference": m.reference} m = FeatureImportancesStability() results[m.name] = {"Value": m(X, y_pred, surrogate), "Reference": m.reference} m = FeatureImportanceSp...
Python
1
err(|_| "IRI parsing failed") } else { Err("Prefix not found") } } //[138] rule BlankNode() -> BlankNode = b:BLANK_NODE_LABEL() {? match BlankNode::new(b) { Ok(node) => if state.used_bnodes.contains(&node) { ...
Rust
0
ngt startswithtgetcwdtseptlen(R5((sc/private/var/folders/vy/31wknkcs30l6xb2fzgwnrkh80000gn/T/pip-build-VQoj4y/pip/pip/utils/__init__.pyRxss.bakcC@sKd}|}x4tjj||rB|d7}|t|}qW||S(s\Figure out...
Python
1
b: &mut Bencher) { b.iter(|| { let mut args = Args::new( "1,2 @3@4 5,1,2 @3@4 5,1,2 @3@4 5,1,2 @3@4 5,1,2 @3@4 5,1,2 @3@4 5,", &[ Delimiter::Single(','), Delimiter::Single(' '), Delimiter::Single('@'), ...
Rust
0
# Copyright 2020 Division of Medical Image Computing, German Cancer Research Center (DKFZ), Heidelberg, Germany # # 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://w...
Python
1
('fecha_fin', models.DateField()), ('sede', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='calendarios', to='sedes.sede')), ], ), migrations.CreateModel( name='SemanaAcademica', fields=[ ('id', mod...
Python
1
""" q = Query(template) return q def testmod(): import doctest global testXml # From http://www.opensearch.org/Specifications/OpenSearch/1.1 testXml = """<?xml version="1.0" encoding="UTF-8"?> <OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/"> <ShortNa...
Python
1
art + mid, end, right_bounding_box); KDBTreeNode { bounding_box: bounding_box, children: Some((Rc::new(left_node), Rc::new(right_node))), start, end, sample_buffer: util::sample_from(points, KDB_SAMPLE_BUFFER_SIZE), ...
Rust
0
feature = "mysql")] fn u64_from_sql() { assert_eq!(0, query_single_value::<Unsigned<BigInt>, u64>("0")); assert_eq!( 18446744073709551615, query_single_value::<Unsigned<BigInt>, u64>("18446744073709551615") ); assert_ne!( 18446744073709551614, query_single_value::<Unsigne...
Rust
0
'\u{1f567}', 2, 2), ('\u{1f57a}', '\u{1f57a}', 2, 2), ('\u{1f595}', '\u{1f596}', 2, 2), ('\u{1f5a4}', '\u{1f5a4}', 2, 2), ('\u{1f5fb}', '\u{1f64f}', 2, 2), ('\u{1f680}', '\u{1f6c5}', 2, 2), ('\u{1f6cc}', '\u{1f6cc}', 2, 2), ('\u{1f6d0}', '\u{1f6d2}', 2, 2), ('\u{1f6d5}', '\u{1f6d7}', 2, 2), ('\u...
Rust
0
return search_results async def get_rule(db: Any, rule_id: str) -> Optional[Rule]: """ Get a rule by its ID or rule number. Args: db: Database connection rule_id: Rule ID, number, title, or description Returns: Rule object if found, None otherwise """ # Tr...
Python
1
nd(rq_changes) last_rq_depth[cpu] = num_runnable # closure for cpu, task in next_task_by_cpu.iteritems(): if task: task_interval = TaskInterval(task=task, cpu=cpu, # what's cpu. interval=Interval(last_seen_timestamps[cpu][task...
Python
1
elf.seq_len) # Compute negative scoring rule as proxy for log probability score = self.scoring_loss(generated_samples, x) log_probs.append(-score) # Average over time samples return torch.stack(log_probs).mean(dim=0) def create_...
Python
1
True) for idx in top_10_min_sam_idx: evaluate_and_plot(model, df_test_input, df_test_output, bands=bands,cmap="Greys_r", resize=resize, device=device, index=idx, verbose=False, save=True, output_path=output_best_sam_path) # Evaluate and plot for best SSIM predictions output...
Python
1
# Copyright 2025 DeepMind Technologies Limited. All Rights Reserved. # # 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 ...
Python
1
( WAYLAND_SERVER_HANDLE, wl_display_set_global_filter, display, global_filter::<D>, std::ptr::null_mut() ); } Ok(InnerBackend { handle: Handle { handle: InnerHandle { ...
Rust
0
# Python built-in module import os import time import json # Python installed module import tiktoken import langchain from spacy.lang.en import English class SentencizerSplitter(object): def __init__(self, config_dict): self.total_tokens = config_dict["embedding"]["total_tokens"] self.approx_tota...
Python
1
} } } impl<T, S> From<(T, Option<S>)> for Auth where T: Into<String>, S: Into<String>, { fn from(from: (T, Option<S>)) -> Self { Self { user: from.0.into(), password: from.1.map(|p| p.into()), } } } impl<'a> std::convert::TryFrom<tokenizer::Tokenizer<'a, ...
Rust
0
struct Hero { // xpos: i32, // ypos: i32, // id: u32, // name: String, // level: u8, // alive: bool, // respawn_seconds: u32, // buyback_cost: u32, // buyback_cooldown: u32, // health: u32, // max_health: u32, // health_percent: u8, // mana: u32, // max_mana: u32...
Rust
0
else: # If there is no mask, flatten the entire dataset ground_truth_flat = ground_truth.flatten() predicted_flat = predicted.flatten() # Calculate the values of the confusion matrix confusion_img_matrix = confusion_matrix(ground_truth_flat, predicted_flat, labels=[0, pos_label]) ...
Python
1
implemented on non-wasm32 targets")] fn invalid_char() { assert_eq!( RgbColour::from_hex("F43C8X"), Err(JsValue::from_str(&String::from( ErrorCode::InvalidHexCharacter("F43C8X".to_string()) ))) ); } #[test] #[should_panic(expected = "function not implement...
Rust
0
s=Some(vkey)); }; }, SimpleLoopCommand::SendTo(ad, content, bufsize) => { let (_, ref mut c) = cache.iter_mut().find(|&(_, ref e)|e.peer.as_ref() == Some(&ad) && match e.state { SlabEntryState::WriteStream(_,_) | SlabEntryState::WriteSpawned(_) => true, _ => false, ...
Rust
0
""" Dendrogram of a substitution matrix =================================== In this example a dendrogram is created, that displays the similarity of amino acids in the *BLOSUM62* substitution matrix. The amino acids are clustered with the UPGMA method. """ # Code source: Patrick Kunzmann # License: BSD 3 clause impo...
Python
1
($a:expr, $b:expr) => { match (imm8 >> 2) & 0b11 { 0b00 => blend2!($a, $b, 2, 3), 0b01 => blend2!($a, $b, 10, 3), 0b10 => blend2!($a, $b, 2, 11), _ => blend2!($a, $b, 10, 11), } }; } let r: i32x8 = match imm8 & ...
Rust
0
x = 15 print(10 < x < 20) # True print(10 < x and x < 20) # True x = 0 print(10 < x < 20) # False print(10 < x and x < 20) # False x = 15 y = 25 print(10 < x < 20 < y < 30) # True print(10 < x and x < 20 and 20 < y and y < 30) # True x = 15 y = 40 print(10 < x < 20 < y < 30) # False print(10 < x and x < 20 and...
Python
1
video_url}: {e}") return False def process_videos(videos, save_path): """ Processes a list of videos: creates a sanitized file name for each video, checks if a note already exists, and calls Fabric to process the video. Retries up to MAX_RETRIES if processing fails. """ for video in videos:...
Python
1
g there. let w = w.res().bits(self.precision as u8); w.align().bit(self.align == Align::Left) }); self.write_smpr(); self.rb.chselr.write(|w| // Safe, as long as there are no `Channel` implementations that // define invalid values. un...
Rust
0
.hclk = Some(Hertz(48_000_000).into()); // Note that pclk* automatically follow because we try lower // prescalers first. } } } #[derive(Clone)] pub struct Frequencies { pub pllp: f64, pub pllq: f64, pub pllr: f64, pub sysclk: f64, pub hclk: f64, pub pclk1: ...
Rust
0
class__.__name__} init method, but this class does " "not inherit from `ConfigMixin`." ) # Ignore private kwargs in the init. Retrieve all passed attributes init_kwargs = {k: v for k, v in kwargs.items()} # Retrieve default values fields = dataclasses.fields...
Python
1
=None, fields=[ _descriptor.FieldDescriptor( name='node', full_name='tensorflow.CostGraphDef.node', index=0, number=1, type=11, cpp_type=10, label=3, has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scop...
Python
1
# a/HW.py # 简单脚本:打印 "hollow world" def main(): print("hollow world") if __name__ == "__main__": main()
Python
1
# Databricks notebook source # MAGIC %run ./_databricks-academy-helper $lesson="3.2" # COMMAND ---------- # MAGIC %run ./_utility-functions # COMMAND ---------- DA.cleanup() DA.init() # Create the user datasets create_date_lookup() # Create static copy of date_lookup print() init_source_daily() ...
Python
1
(Debug, Clone)] struct Ticket(Vec<i64>); #[cfg(test)] mod tests { use super::*; const INPUT: &str = include_str!("../../../input/day16"); const EX: &str = include_str!("../../../input/day16_ex"); #[test] fn verify_p1() { assert_eq!(format!("{}", part1(INPUT).unwrap()), "27870") } #...
Rust
0
""" Задача 3. Модуль для нахождения уникальных для обоих списков элементов Создайте модуль с функцией, которая принимает два списка и возвращает список, содержащий только элементы, которые уникальны для обоих списков """ def unique_of_two(first_list, second_list) -> list: first_set, second_set = set(first_list), ...
Python
1
from collections import deque class Solution: def maxSlidingWindow(self, nums, k): dq = deque() result = [] for i in range(len(nums)): # Remove elements not within the sliding window if dq and dq[0] < i - k + 1: dq.popleft() ...
Python
1
} seattle_traffic_signals::PhaseType::Adaptive(d) => { PhaseType::Adaptive(Duration::seconds(d as f64)) } }, }); } else { return Err(format!( ...
Rust
0
from dojo.models import Test from dojo.tools.qualys_webapp.parser import QualysWebAppParser from unittests.dojo_test_case import DojoTestCase, get_unit_tests_scans_path class TestQualysWebAppParser(DojoTestCase): def test_qualys_webapp_parser_with_no_vuln_has_no_findings(self): testfile = (get_unit_tests...
Python
1
th, height).permute(0, 2, 1, 3, 4) # call the callback, if provided if i == len(timesteps) - 1 or ((i + 1) > num_warmup_steps and (i + 1) % self.scheduler.order == 0): progress_bar.update() if callback is not None and i % callback_steps == 0: ...
Python
1
f<idddddddddd d d d d ddddddddddddddddddd d!id"d#d$d%d&d'd(d)d*d+d,d-d.d/d0d1d2d3d4d5d6d7d8d9d:d;d<d=d>d?d@dAdBdCidDdEdFdGdHdIdJdKdLdMdNdOdPdQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcZyd)ei)1s)...
Python
1
names, tablefmt="outline")) break else: conn.rollback() print("Transaksi dibatalkan.") break cur.close() conn.close() def menuPasien(): os.system("cls") nama = input("Masukkan nama pasien: ") add_pasien(nama) while True: print...
Python
1
_generating_vcu): map hasher(blake2_128_concat) u32 => Vec<u8>; /// Bundle Asset AVG Data AssetAVGBundle get(fn asset_avg_bundle): double_map hasher(blake2_128_concat) T::AccountId, hasher(blake2_128_concat) u32 => u32; } } decl_event!( pub enum Event<T> where AccountId = <T as frame_system::Config>::AccountId ...
Rust
0