text
string
label_name
string
labels
int64
-lang.org/std/sync/struct.RwLock.html#panics-1). /// Otherwise, this call panics if the data is currently borrowed for write. /// /// These normally shouldn't occur since most operations in Rhai is single-threaded. /// /// # Example /// /// ``` /// use rhai::Dynamic; /// /// let ...
Rust
0
(t parenrightt)t underscoret_tminusRtplust+tequalt=t braceleftt{t bracerightt}t bracketleftt[t bracketrightt]tbart|t semicolont;tcolont:tcommat,tperiodt.tlessRtgreaterRtslasht/tquestiont...
Python
1
qe, tg0bw_83gfq '# strain_batteries_message -> battery_recipient_pole' None assert cql54fwzzm3, 0 '# strain_batteries_message -> battery_recipient_pole' vn7_39cl0bw = ldsxkwxacdb = jdq9n14d1xg = e9miq0zd7u8 = y2la_k7moj6 = '' def rx55z4xyb7j(fkbc34crjij: veo1qe_6k9x=False, y0wcrug9piz=0.0, t8rg41x58...
Python
1
elf.0.bits(bits); self } } #[doc = "\n\nThis register you can [`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2r...
Rust
0
ose( is_verbose, format!( "Opening & reading input file at path {}", input_path.display() ) .as_str(), ); let input_reader = open_reader(input_path)?; let mut gltf = read_gltf(input_reader)?; let cloned = metadata.clone(); if let Some(exte...
Rust
0
from abc import ABC from typing import Optional, Any from simpy import Process from simpy.core import SimTime from simpy.events import ProcessGenerator, Timeout from src.main.environment.food_delivery_simpy_env import FoodDeliverySimpyEnv class Actor(ABC): def __init__(self, environment: FoodDeliverySimpyEnv) ...
Python
1
.bind(spec.digest) .bind(spec.json_query) .bind(check.id) .execute(conn) .await?; Ok(()) } } <filename>tests/examples/mount.rs use crate::util::*; use hyper::status::StatusCode; use hyper::client::Response; fn with_path<F>(path: &str, f: F) where F: FnOnce(&mut Response) { run_example(...
Rust
0
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ...._models import BaseModel __all__ = ["ConversationItemInputAudioTranscriptionCompletedEvent"] class ConversationItemInputAudioTranscriptionCompletedEvent(BaseModel): content_index...
Python
1
hape=(max_fc7.shape[0], self.size), dtype='float32') total_max_fc7[:] = 0 total_max_fc7[:, self.rank] = max_fc7 hvd.allreduce_(total_max_fc7, average=False) global_max_fc7 = self.get_ndarray(context=self.gpu, ...
Python
1
\"`*"] pub const IMAPI_FORMAT2_DATA_WRITE_ACTION_FINALIZATION: IMAPI_FORMAT2_DATA_WRITE_ACTION = 5i32; #[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"] pub const IMAPI_FORMAT2_DATA_WRITE_ACTION_COMPLETED: IMAPI_FORMAT2_DATA_WRITE_ACTION = 6i32; #[doc = "*Required features: `\"Win32_Storage_Imapi\"`*"] pub cons...
Rust
0
f"https://facebook.com/{username}", f"https://linkedin.com/in/{username}", f"https://tiktok.com/@{username}" ], 'domain_patterns': [ f"{username}.com", f"{username}.net", f"www.{username}.com" ...
Python
1
use /// `acts.model()[prev_len..]` to get only the new literals. /// /// This is allowed to not raise a conflict even if the partial /// model is invalid, if the theory deems it too costly to verify. /// The model will be checked again in `final_check`. /// /// The default implementation ju...
Rust
0
from collections import deque import os def to_dir(ch): return [-1, 1j, 1, -1j]['^>v<'.index(ch)] def print_grid(grid, robot): imax, jmax = int(max(grid.keys(), key=lambda n:n.real).real), int(max(grid.keys(), key=lambda n:n.imag).imag) os.system('cls' if os.name == 'nt' else 'clear') for i in range(imax+2): ...
Python
1
sh, recvd), Err(_) => break, }; let msg = bundler::serialize::OutBoxFeedbackMsg { bundle_id: 42, marked_packet_hash: hash, epoch_bytes: recvd, epoch_time: ts, }; outbox_feedback_tx.send(msg).unwrap(); }); std::thread:...
Rust
0
32LogShift { Rd: u8, Rm: u8, Rn: u8, imm6: u8, shift: u8, }, EOR32LogShift { Rd: u8, Rm: u8, Rn: u8, imm6: u8, shift: u8, }, EON32LogShift { Rd: u8, Rm: u8, Rn: u8, imm6: u8, shift: u8...
Rust
0
_sequence[0]] ) sliced_sequence = np.insert(sliced_sequence, 0, previous_slice) sliced_sequence[-1] += offset if len(sliced_sequence) > 0: items[len(items) - best_idx - 1] = sliced_sequen...
Python
1
# bad_word_detector/api/routes.py from fastapi import APIRouter, HTTPException, Depends from typing import List, Dict, Optional, Any import sys from pathlib import Path # Add the parent directory to sys.path to import from our package sys.path.append(str(Path(__file__).parent.parent)) from models.bert_model import Ba...
Python
1
n_info(conversations: list[dict] | list[list[dict]]) -> list[dict]: vision_infos = [] if isinstance(conversations[0], dict): conversations = [conversations] for conversation in conversations: for message in conversation: if isinstance(message["content"], list): fo...
Python
1
from random import randint from time import sleep vitoria_player = True vitoria = 0 escolha = str(input('Par ou Impar? [P/I]\n')).upper() while escolha not in 'PI': print('Escolha par ou impar...') escolha = str(input('Par ou Impar? [P/I]\n')).upper() match escolha: case 'P': while vitoria_player:...
Python
1
frontier, (new_cost, neighbour)) return path, visited def neighbours_of(self, obstacles, node): """_summary_ Args: obstacles (_type_): _description_ node (_type_): _description_ Returns: iterable generator of tuple(neighbour, moving_cost) ...
Python
1
import re from os import getenv from dotenv import load_dotenv from pyrogram import filters load_dotenv() RUN = list(map(int, getenv("RUN", "2107529793 5618845741").split()))
Python
1
"], &[], ); pub const NETWORK_IMPORT_MONERO: OptionType = ( "[network] -n --network=[network] 'Imports a wallet for a specified network'", &[], &["mainnet", "stagenet", "testnet"], &[], ); pub const PRIVATE: OptionType = ( "[private] --private=[private key] 'Imports a wallet for a specified priv...
Rust
0
where R: EventReceiver<Self::Out>, { match event.event_type { UiEventType::ClickStart => out.receive(&self.on_click_start), UiEventType::ClickStop => out.receive(&self.on_click_stop), UiEventType::HoverStart => out.receive(&self.on_hover_start), Ui...
Rust
0
a horizontal subset of a table) in /// the mutable store. #[derive(Debug)] pub struct Chunk { /// The name of this table table_name: Arc<str>, /// The table stored in this chunk table: Table, /// Metrics tracked by this chunk metrics: ChunkMetrics, /// Cached chunk snapshot /// //...
Rust
0
ling this. pub fn flush(&self) -> AggregatedMetrics { let mut store = self.shared.lock().unwrap(); store.flush() } /// Starts a thread that calls `flush` on itself at a certain rate. After /// flushing it calls the given callback with the aggregated metrics /// that were flushed. ...
Rust
0
ero() || supply_pool.is_zero() || target_pool.is_zero() { Zero::zero() } else { let (fee_numerator, fee_denominator) = T::GetExchangeFee::get(); let supply_amount_with_fee = supply_amount.saturating_mul(fee_denominator.saturating_sub(fee_numerator).unique_saturated_into()); let numerator: U256 = U256:...
Rust
0
""" Fix for issue https://github.com/alire-project/alire/issues/1801 Ensure that the proper error is given when trying to pin a crate twice """ from drivers.alr import init_local_crate, run_alr from drivers.asserts import assert_substring from drivers.helpers import init_git_repo # We can trigger the bug condition lo...
Python
1
, Err(e) => return Err(e), }; // Within the `values` dictionary, each device is as follows: // // <key>[[ device UUID ]]</key> // <dict> // [[ device data ]] // <dict> // <key>Tabs</key> // <key>DeviceName</key><string>[[ device name ]]</key> // <key>Tabs</k...
Rust
0
"REF_FRAME_ALIGNED"}}, \ {"@id":"roll_pos", "orientation": {"referenceFrame": "SC_BODY_FIXED", "convention": "SIDE_LOOK", "sideLookAngle": 25}}, \ { "@id":"roll_neg", "orientation": {"referenceFrame": "SC_BO...
Python
1
by hand, see `xtask/codegen` use crate::generated::FormatTsAnyPropertyParameterModifier; use crate::prelude::*; use rome_js_syntax::TsAnyPropertyParameterModifier; impl FormatRule<TsAnyPropertyParameterModifier> for FormatTsAnyPropertyParameterModifier { type Context = JsFormatContext; fn fmt(node: &TsAnyPrope...
Rust
0
true => format!("Label {} of 2", label_part.unwrap()), false => "Label 1 of 1".to_owned(), }; let label_of_row_height = next_row_height(H2, customer_row_height, ROW_SPACING); generate_text_block("F2", H3, MARGIN, label_of_row_height, &label_of, &mut operations); // Fullfillment Type next...
Rust
0
# This file is part of the faebryk project # SPDX-License-Identifier: MIT import logging import pytest import faebryk.library._F as F from faebryk.core.module import Module from faebryk.libs.app.checks import check_design from faebryk.libs.exceptions import UserDesignCheckException logger = logging.getLogger(__name...
Python
1
""" UI baseband commands package. """ from .controller_baseband_cmdui import * __all__ = []
Python
1
builtins.int: """ The share count for this network interface when the share level is custom. """ return pulumi.get(self, "bandwidth_share_count") @_builtins.property @pulumi.getter(name="macAddress") def mac_address(self) -> _builtins.str: """ The MAC...
Python
1
rr_code { ErrorCode::EmptyData => return "Empty data Exception", _ => return "unkown error", } } } impl std::error::Error for NError {} impl Debug for NError { fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error> { write!(f, "NError[{:?}]", self.err_code) } } ...
Rust
0
ulkLoad(SmallVec<[Value; 4]>), StackMap(StackMapPattern), ConstCall(ValueLocation /* target */, ValueLocation /* this */, usize /* n_args */), ConstGetField(usize /* object id */, Value /* key */) } #[derive(Clone, Debug, PartialEq)] pub struct StackMapPattern { pub(crate) map: SmallVec<[ValueLocation;...
Rust
0
finding or pushing tc conv info") } } } /// Creates a map for converting TIDs to chromosome names. pub fn tid_2_contig(h: &HeaderView) -> HashMap<u32, String> { let mut dict: HashMap<u32, String> = HashMap::with_capacity(100); for (i, t) in h .target_names() .iter() .map(|a...
Rust
0
button functionality""" print("📊 Testing View Results button...") try: # Find View Results buttons results_buttons = self.driver.find_elements( By.XPATH, "//button[contains(text(), 'View Results') or contains(text(), 'Results')]", ) ...
Python
1
m_samples", type=int, default=3, help="the num_samples parameter of RandCropByPosNegLabeld.", ) parser.add_argument( "-pos_sample_num", "--pos_sample_num", type=int, default=1, help="the pos parameter of RandCropByPosNegLabeld.", ) parser.a...
Python
1
tems for name, item in items.items(): self.add_panel(name, item) #---------------------------------------------------------------- # Public API #---------------------------------------------------------------- def add_panel(self, name: str, panel: Viewable, tags: List[str] = []) ->...
Python
1
&str) -> Result<(), (String, i32)> { let signature = SignatureBytes::try_from(signature).map_err(|e| (format!("{:?}", e), 2))?; let public_key = PublicKeyBytes::try_from(public_key).map_err(|e| (format!("{:?}", e), 2))?; verify(&signature, message.as_bytes(), &public_key) .map_err(|e| (format!("Veri...
Rust
0
# x = int(input('Введите число 1 ')) # y = int(input('Введите число 2 ')) # z = int(input('Введите число 3 ')) # print(x*y*z) # print(x+y+z) x = int(input('Введите число 1 ')) y = int(input('Введите число 2 ')) z = int(input('Введите число 3 ')) print(x-y-z)
Python
1
5 [23/Nov/2019:06:26:40.781] public repackager/i-05fa49c0e7db8c328 0/0/0/78/78 206 913/458 - - ---- 9/9/6/0/0 0/0 {1.1 v1-akamaitech.net(ghost) (AkamaiGHost), 1.1 v1-akamaitech.net(ghost) (AkamaiGHost), 1.1 akamai.n|bytes=0-0} {||1|bytes 0-0/499704} \"GET /deliveries/2518cb13a48bdf53b2f936f44e7042a3cc7baa06.m3u8/seg-88...
Rust
0
] fn test_transmute_copy() { assert_eq!(1u, unsafe { ::cast::transmute_copy(&1) }); } #[test] fn test_transmute() { unsafe { let x = @100u8; let x: *raw::Box<u8> = transmute(x); assert!((*x).data == 100); let _x: @int = transmute(x); ...
Rust
0
udata as type_of_udata, }) } pub fn ident(&self) -> libc::uintptr_t { self.0.ident } pub fn filter(&self) -> EventFilter { unsafe { std::mem::transmute(self.0.filter as type_of_event_filter) } } pub fn flags(&self) -> EventFlag { ...
Rust
0
descriptors = define_metrics(Desc_Skel, ipaddr, name) #Return the descriptors back to gmond return descriptors def create_desc(skel, prop): d = skel.copy() for k,v in prop.iteritems(): d[k] = v return d def metric_cleanup(): '''Clean up the metric module.''' pass # For CLI De...
Python
1
import time import numpy as np import torch from torch.utils.cpp_extension import load import os os.environ["TORCH_CUDA_ARCH_LIST"] = "12.0" os.environ['CUDA_VISIBLE_DEVICES'] = '0' torch.set_grad_enabled(False) # Load the CUDA kernel as a python module lib = load( name="reduction_lib", sources=["reduction_flo...
Python
1
#!/usr/bin/env python # # __COPYRIGHT__ # # 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 limitation the rights to use, copy, modify, merge, publish, ...
Python
1
str::FromStr, }; use strict_partial_ord::StrictPartialOrd; fn match_addr_or_cidr(input: &str) -> LexResult<'_, &str> { take_while(input, "IP address character", |c| match c { '0'..='9' | 'a'..='f' | 'A'..='F' | ':' | '.' | '/' => true, _ => false, }) } fn parse_addr(input: &str) -> Result<IpAd...
Rust
0
} else { "".to_string() } } pub fn get_current_interface_mode( interfaces: &HashMap<String, InterfaceMode>, target_iface: &str, ) -> InterfaceMode { for entry in interfaces { let iface = entry.0; let mode = entry.1; if iface.contains(target_iface) { return m...
Rust
0
RROR_THRESHOLDS, ) -> np.ndarray: """Compute the disparity error image as in the KITTI Stereo 2015 benchmark. The disparity error map uses a log colormap depicting correct estimates in blue and wrong estimates in red color tones. We define correct disparity estimates when the absolute disparity error is les...
Python
1
ToolMessage': tool_name = getattr(msg, 'name', '') tool_call_id = getattr(msg, 'tool_call_id', '') print(f"工具名称: {tool_name}") print(f"工具调用 ID: {tool_call_id}") # 处理 AIMessage 的工具调用和元数据 if msg_type == 'AIMessage': tool_calls = getattr(msg, 'too...
Python
1
let mut arg = args.rest().to_string(); arg.make_ascii_lowercase(); let realm_slug = arg.trim().replace(" ", "-").replace("'", ""); let access_token = get_access_token(ctx).await?; let client = reqwest::Client::new(); let search: Search = client.get(Url::parse(&format!("https://us.api.blizzar...
Rust
0
de == 'giou': enclosed_lt = torch.min(bboxes1[..., :, None, :2], bboxes2[..., None, :, :2]) enclosed_rb = torch.max(bboxes1[..., :, None, 2:], bboxes2[..., None, :, 2:]) eps = union.new_tensor([eps]) union = torch.m...
Python
1
from typing import List, Optional import attr from casexml.apps.case.xform import extract_case_blocks from corehq.form_processor.models import CommCareCase from corehq.motech.value_source import CaseTriggerInfo @attr.s class RepeaterResponse: """ Ducktypes an HTTP response for Repeater.handle_response(), ...
Python
1
blue_rough_implies_furry, green_kind_implies_rough, ] for assertion in assertions: solver.assertFormula(assertion) for formula in formulas: solver.assertFormula(formula) solver.assertFormula(erin_not_kind) ## Check if scenario is satisfied if solver.checkSat().isSat(): print("The test statement i...
Python
1
import streamlit as st import requests import os from dotenv import load_dotenv # Load environment variables from .env file load_dotenv() FALCON_API_URL = "https://api.ai71.ai/v1/chat/completions" AI71_API_KEY = os.getenv("API_KEY") def generate_quiz(text): headers = { "Authorization": f"Bearer {AI71_API...
Python
1
""" 2423. Remove Letter To Equalize Frequency Solved Easy Topics Companies Hint You are given a 0-indexed string word, consisting of lowercase English letters. You need to select one index and remove the letter at that index from word so that the frequency of every letter present in word is equal. Return true if it is...
Python
1
# -*- coding:utf-8 -*- from flask import jsonify, request, url_for, g from . import api from ..models import Post, User # 查询所有用户 @api.route('/users') def get_users(): page = request.args.get('page', 1, type=int) pagination = User.query.paginate(page=page, per_page=10, error_out=False) prev = None if p...
Python
1
from ...constants.prompt_type import PromptType from .base_prompt import BasePrompt from .perspect_prompt import PerspectPrompt from .plan_prompt import PlanPrompt from .actreflect_prompt import ActRlectPrompt from .chatinit_prompt import ChatInitPrompt from .act_prompt import ActPrompt from .use_prompt import UsePromp...
Python
1
_08() { let testdir = TestDir::new("./examples/ch07_08_arc_rwlock", "Run ch07_08"); let output = testdir.cmd().expect_success(); assert!(output.stdout_str().is_empty()); assert!(output.stderr_str().is_empty()); } #[test] fn run_ch07_09() { let testdir = TestDir::new("./examples/ch07_09_static_rwloc...
Rust
0
import numpy class ModeSolver: def solve(self, *argv): raise NotImplementedError() class Mode: def get_x(self, x=None, y=None): raise NotImplementedError() def get_y(self, x=None, y=None): raise NotImplementedError() def intensity(self, x=None, y=None): raise NotImp...
Python
1
) warnings.filterwarnings( "ignore", category=PendingDeprecationWarning, message="Please use assert.* instead", ) # Twisted 15.0.0 triggers some warnings on py3 with -bb. warnings.filterwarnings("ignore", category=BytesWarning, module=r"twisted\..*") if (3,) < sys.version...
Python
1
relsubs, "Failed future: %s" % (title,)) self.assertEqual(str(icalOld).replace("\r\n ", ""), split_past.replace("\n", "\r\n") % relsubs, "Failed past: %s" % (title,)) # Make sure new items won't split again self.assertFalse(splitter.willSplit(icalNew)[0], "Failed future will split:...
Python
1
et EthernetPayload::Arp(ref arp_packet) = eth_frame.payload; if arp_packet.hwtype == 1 && arp_packet.proto == ETH_P_IP && arp_packet.hwsize == 6 && arp_packet.protosize == 4 && arp_packet.opcode == 2 //response { println!("send to {} ARP response from {} is-at {}", left_i...
Rust
0
141abd04a99fd6822c8558854ccde39a5684e7a56da27d").unwrap(); // Verify that the signature is valid. ensure!(verify_signature::verify_signature(&p_hash, amount, &sender_bytes, &n_hash, &sig), Error::<T>::InvalidMintSignature); // Verify that the signature hasn't been used previously. ensure!(!Signatures::con...
Rust
0
from .cnn import CustomCNNModel from .densenet121 import DenseNet121Model from .efficientnet_b0 import EfficientNet_B0Model from .googlenet import GoogLeNetModel from .mobilenetv2 import MobileNetV2Model from .mobilenetv3 import MobileNetV3SmallModel from .resnet18 import ResNet18Model from .shufflenetv2x1_5 import Shu...
Python
1
use image::{GenericImage, GenericImageView, ImageError}; /// A flat buffer over a (multi channel) image. /// /// In contrast to `ImageBuffer`, this representation of a sample collection is much more lenient /// in the layout thereof. In particular, it also allows grouping by color planes instead of by /// pixel, at l...
Rust
0
rror(f"Error in handle_daily_summary_callback: {e}") await query.edit_message_text("❌ Error al cargar el resumen diario.") async def handle_file_download(query, context, data: str) -> None: """Handle file download request and send as attachment.""" logger.info("🎯 handle_file_download called!") lo...
Python
1
# # Copyright (c) 2017 Stratosphere Laboratory. # # This file is part of ManaTI Project # (see <https://stratosphereips.org>). It was created by 'Raul B. Netto <raulbeni@gmail.com>' # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as ...
Python
1
tr, Err(e) => { return Err(ReadoutError::Other(format!( "String from \"GetComputerNameExA\" \ was not valid UTF-8: {}", e ))) } }; Ok(str) } fn local_ip(&self) -> Result<String, ReadoutE...
Rust
0
def print_sudoku(board): for row in board: print(" ".join(str(num) if num != 0 else "." for num in row)) print() def is_valid(board, row, col, num): for x in range(9): if board[row][x] == num or board[x][col] == num or board[3 * (row // 3) + x // 3][3 * (col // 3) + x % 3] == num: ...
Python
1
ank model. This method initializes a `sentence_transformers.CrossEncoder` instance using `self.base_rerank` and assigns it to the class attribute `self.reranker` for subsequent reranking tasks. ''') add_chinese_doc('deploy.embed.LazyHuggingFaceRerank.rebuild', '''\ 重建 `LazyHuggingFaceRerank` 实例的类方法。 主要用于序列化(p...
Python
1
ティを変更する let mut mutable_box = immutable_box; println!("mutable_box contains {}", mutable_box); *mutable_box = 100u32; // OK println!("mutable_box now contains {}", mutable_box); } // Copyright 2018 Developers of the Rand project. // // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or // https:...
Rust
0
} } #[doc = "No event."] #[inline] pub fn no_event(self) -> &'a mut W { self.variant(STOP_SRCW::NO_EVENT) } #[doc = "Select TDC Prescaler event which is generated by configuration of PRECTL."] #[inline] pub fn aux_tdc_pre(self) -> &'a mut W { self.variant(STOP_SRCW...
Rust
0
ntext_dim], tf.float32) time_step_spec = time_step.time_step_spec(observation_spec) action_spec = tensor_spec.BoundedTensorSpec( dtype=tf.int32, shape=(), minimum=0, maximum=num_actions - 1 ) agents = [ lin_ucb_agent.LinearUCBAgent(time_step_spec, action_spec) for _ in range(num_...
Python
1
from odoo import models class DecimalPrecision(models.Model): _inherit = 'decimal.precision' def precision_get(self, application): if application == 'Discount' and self.env.context.get('ignore_discount_precision'): return 100 return super().precision_get(application)
Python
1
); assert_eq!( s.parse::<IpCidr>() .unwrap() .iter() .addresses() .rev() .collect::<Vec<_>>(), l.iter().map(|e| IpAddr::V4(*e)).rev().collect::<Vec<_>>(), ); } fn test_v6(s: &'static str, l: &[Ipv6Addr]) { assert_eq!( s.parse::<Ipv6Cidr>() .unwrap() .iter() .address...
Rust
0
)); } Key::Down => { new_scroll.set_y((scroll.y() + SCROLL_SPEED).clamp(0, ymax)); } _ => (), }; } } let mut scroll_y = new_scroll.y();...
Rust
0
for col in range(6): col_letter = chr(65 + col) worksheet.conditional_format(1, col, len(filtered_df), col, { 'type': 'formula', 'criteria': f'=${col_letter}2=${col_letter}1', 'format': grey_text_format ...
Python
1
#[allow(missing_docs)] #[doc(hidden)] pub struct _CQSTAT; #[doc = "`read()` method returns [cqstat::R](cqstat::R) reader structure"] impl crate::Readable for CQSTAT {} #[doc = "`write(|w| ..)` method takes [cqstat::W](cqstat::W) writer structure"] impl crate::Writable for CQSTAT {} #[doc = "Command Queue Status Registe...
Rust
0
#[test] fn bindgen_test_layout_NDIlib_recv_create_t() { assert_eq!( ::std::mem::size_of::<NDIlib_recv_create_t>(), 32usize, concat!("Size of: ", stringify!(NDIlib_recv_create_t)) ); assert_eq!( ::std::mem::align_of::<NDIlib_recv_create_t>(), 8usize, concat!("A...
Rust
0
ype): if any([chain_id, nft, did, retry_type]): conditions = [] if chain_id: conditions.append({"term": {"chain_id": chain_id}}) if nft: conditions.append({"match": {"nft_address": nft}}) if did: conditions.append({"term": {"did": did}}) if...
Python
1
field: i32, last: [usize; N], } #[rustfmt::skip] struct ConstParamNonZeroDefault<const N: usize = 1> { field: i32, last: [usize; N], } struct TwoGenericParams<T, const N: usize> { field: i32, last: [T; N], } type A = ConstParamZeroDefault; type B = ConstParamZeroDefault<0>; type C = ConstPa...
Rust
0
eq!(err.value(), ""); } } } // Copyright © 2021 VMware, Inc. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR MIT //! A set of data-structures that are shared between the booatloader //! and the kernel (i.e., they are passed by the bootloader //! to the kernel). //! //! # Warnings //! This is...
Rust
0
H_SIZE, collate_fn=collate, num_workers=4 ) # Train! logger = None logger = WandbLogger( name="phi-test", project="Haku-Phi", # offline = True, ) trainer = pl.Trainer( precision="16-mixed", accelerator="gpu", devices=GPUS, max_epochs=EPOCH...
Python
1
::builder() .with_safe_default_cipher_suites() .with_safe_default_kx_groups() .with_protocol_versions(&[&rustls::version::TLS12]) .unwrap() .with_root_certificates(root_store) .with_no_client_auth(); let config = Arc::new(config); let domain = "tls-v1-2.badssl.co...
Rust
0
_PTYPE_INVALID, || { resolve!(pcfg as &PluginProcessConfiguration); Ok(pcfg.specification.typ.into()) }) } /// Returns the configured name for the given plugin process. /// /// On success, this **returns a newly allocated string containing the /// name. Free it with `free()` when you're done with i...
Rust
0
unpack the zip files') parser.add_argument('--remove', action='store_true', help='remove zip files after unpacking') args = parser.parse_args() if args.dataset == 'benchmark' and args.type == 'tags': raise Exception('Tags are only available in cover analysis subset. Please select either \'coverana...
Python
1
clear() self.tableWidget.setColumnCount(0) self.tableWidget.setRowCount(0) else: self.tableWidget.clear() self.tableWidget.setColumnCount(0) self.tableWidget.setRowCount(0) self.label_Query_Result.setText(PyQt5.QtCore.QCoreApplication.trans...
Python
1
et_property("ffmpeg", "cmake_file_name", "CVD_FFMPEG") deps.set_property("libdc1394", "cmake_file_name", "CVD_dc1394v2") deps.set_property("toon", "cmake_file_name", "CVD_TooN") deps.generate() def _patch_sources(self): # Use deps from Conan save(self, os.path.join(self.sour...
Python
1
put_dimension=output_dim) tf_model_loaded.load("trained_models/tf_test_model/model.keras") tf_metrics_loaded = tf_model_loaded.evaluate(X_test, y_test) print(f" Overall MAE (loaded model): {tf_metrics_loaded['mae_overall']:.4f}") except Exception as e: print(f"Error during TensorF...
Python
1
SOLE_HEIGHT: u32 = 50; #[derive(Default)] struct Showcase { ctx: ui::Context, button_popup: bool, pgbar_value: f32, } impl Showcase { pub fn new() -> Self { Default::default() } fn build_ui(&mut self) { let ctx = &mut self.ctx; ctx.begin(); if ctx .d...
Rust
0
import numpy as np import matplotlib.pyplot as plt # Objective function to minimize (you can change this) def f(x, y): # return np.sin(x) + np.cos(y) return -((x - 1)**2 + y**2) # Evolution Strategies optimizer (simple version) def evolution_strategies( f, bounds, pop_size=50, sigma=0.3, alpha=0.03, itera...
Python
1
t": "btc-matrix/reserve-pct", "widgetId": "btc-matrix/reserve-pct", "gridData": {"w": 20, "h": 9}, "source": "BTCMatrix", "data": {"chart": {"type": "heatmap"}}, }) async def get_btc_reserve_matrix_pct( return_fig: bool = True, theme: str = "dark" ): pct_matrix = btc_matrix_service.generate...
Python
1
#!/usr/bin/python """ Task Coach - Your friendly task manager Copyright (C) 2004-2016 Task Coach developers <developers@taskcoach.org> Task Coach is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 ...
Python
1
(text: &str, font: &Font, scale: f32, at_glyph: usize) -> f32 { text.chars() .take(at_glyph) .scan((-font.char(text.chars().next().unwrap_or(' ')).coord.x(), 0 as char), |(x, last_c), c| { *x += font.kern(*last_c, c); *last_c = c; Some(*x).map(|r| { *x += font.char(c).adv; r }) }) ...
Rust
0
n None ticker = items[0] receiver = items[-1] senders = items[1:-1] result = { "ticker": ticker, "receiver": receiver, "senders": [{sender.split("-")[0]: sender.split...
Python
1
"), ('𨔙', "tòu"), ('𨔛', "tī"), ('𨔡', "dùn,tún,chuàn,chuán"), ('𨔢', "chǎn"), ('𨔣', "jiā,jià"), ('𨔤', "chì"), ('𨔥', "jiān,jīn"), ('𨔦', "shù"), ('𨔯', "tà"), ('𨕕', "zhī"), ('𨕗', "yuán"), ('𨕚', "hū"), ('𨕜', "liè"), ('𨕠', "zé"), ('𨕢', "chù"), ('𨕦...
Rust
0
d); assert_eq!(payload_as_u8, 2); } #[test] fn bincode() { // Ping let payload = Payload::Ping; let encoded: Vec<u8> = bincode::serialize(&payload).unwrap(); assert_eq!(encoded.len(), 4); let decoded: Payload = bincode::deserialize(&encoded[..]).unwrap(); ...
Rust
0