text
string
label_name
string
labels
int64
heck: [1] : 0x14 [Type: unsigned int] // cdb-command: dx t2 // cdb-check:t2 : (0x1e, 0x28) [Type: tuple$<u64,u64>] // cdb-check: [0] : 0x1e [Type: unsigned __int64] // cdb-check: [1] : 0x28 [Type: unsigned __int64] // cdb-command: g // cdb-command: dx s //...
Rust
0
== 0x9C: # : result += ":" elif b == 0x9D: # ; result += ";" elif b == 0x9E: # [ result += "[" elif b == 0x9F: # ] result += "]" # Special characters elif b == 0x7F: # Space ...
Python
1
t.clone()).expect("I know this won't panic because the frequencies are hardcoded to be the same"); /// /// let (recovered_cos, recovered_sin) = combined.to_orthogonal_components(); /// /// //there is a small loss of precision when going back and forth between split components and one sinusoid. /// a...
Rust
0
ed deposit. //! - `reject_proposal` - Reject a proposal, slashing the deposit. //! - `approve_proposal` - Accept the proposal, returning the deposit. //! //! ## GenesisConfig //! //! The Treasury pallet depends on the [`GenesisConfig`]. #![cfg_attr(not(feature = "std"), no_std)] mod benchmarking; #[cfg(test)] mod tes...
Rust
0
unsqueeze(2) # Add back time dimension else: latent_out = latent_out.view(B, C, T, int(H * upscale), int(W * upscale)) elif len(original_shape) == 3: latent_out = latent_out.squeeze(0) # Convert to float32 if needed if self.dtype != torch.float32: ...
Python
1
" setup_file.write_text( """ from setuptools import setup setup( name="test-package", install_requires=["requests>=2.25.0"] ) """ ) # Mock universal parser to fail, forcing fallback to line 145 with patch.object( updater.universal_parser, "parse_file", si...
Python
1
let mut value = BytesMut::new(); encode_string("measurement name", &mut value); assert_eq!(value, "measurement\\ name"); let mut value = BytesMut::new(); encode_string("measurement=name", &mut value); assert_eq!(value, "measurement\\=name"); let mut value = BytesMut::ne...
Rust
0
241, 1.001310, 1.055563, 1.004187, 1.006212, 1.050846, 1.050423, 1.048931, 1.047128, 1.045364, 1.044571, 1.042123, 1.036002, 1.031195, 1.028148, 1.023533, 1.021181, 1.015756, 1.013636, 1.014241, 1.148380, 1.193790, 1.004262, 1.022560, 1.001873, 1.000048, 1.006319, 1.008273, 1.010241, 1.001310, 1.05556...
Python
1
. #[serde(skip_serializing_if = "Option::is_none")] pub parameters: Option<Vec<EvgParameter>>, } impl Default for EvgProject { fn default() -> Self { EvgProject { buildvariants: vec![], tasks: vec![], task_groups: None, functions: Default::default(), ...
Rust
0
(&self) -> String { return format!("{}/{}", self.namespace, self.name); } } <filename>crates/bounded/src/bounded_map.rs use super::{ BoundedArray, Index, OutOfBoundsAccess, }; use core::{ iter::IntoIterator, marker::PhantomData, ops, }; /// A map with a bounded size for index-like k...
Rust
0
# -*- coding: utf-8 -*- # 版权所有 2019 深圳米筐科技有限公司(下称“米筐科技”) # # 除非遵守当前许可,否则不得使用本软件。 # # * 非商业用途(非商业用途指个人出于非商业目的使用本软件,或者高校、研究所等非营利机构出于教育、科研等目的使用本软件): # 遵守 Apache License 2.0(下称“Apache 2.0 许可”), # 您可以在以下位置获得 Apache 2.0 许可的副本:http://www.apache.org/licenses/LICENSE-2.0。 # 除非法律有要求或以书面形式达成协议,否则本软件分发时...
Python
1
import json import math import os import pickle import sys import pandas as pd from sklearn import metrics from sklearn import tree from dvclive import Live from matplotlib import pyplot as plt EVAL_PATH = "eval" if len(sys.argv) != 3: sys.stderr.write("Arguments error. Usage:\n") sys.stderr.write("\tpytho...
Python
1
counter_copy.0.fetch_add(1, Ordering::Relaxed); }) { println!("!!!> spawn singale task failed, reason: {:?}", e); } } println!("!!!!!!spawn single task ok, time: {:?}", Instant::now() - start); }); thread::sleep(Duration::from_millis(100...
Rust
0
) response.raise_for_status() except requests.exceptions.HTTPError as err: raise (err) return json.loads(response.text) def setChargerSchedules(self, chargerId, newSchedules): try: # Enforce chargerId for schedule in newSchedules.get('schedu...
Python
1
der.wait_for_connection()) { Ok(event_data) => { use hci::events::LEConnectionAddressType; println!("Device Connected! (use ctrl-c to disconnect and exit)"); // Start the server block_on(bonder.clone().abortable_server_loop( advertise_address.clo...
Rust
0
_is_valid_unquoted_identifier_start(character: char) -> bool { return character == '_' || character.is_alphabetic(); } #[cfg(test)] mod tests { use super::*; #[test] fn identifier_basic_unquoted() { assert_eq!( parse_identifier_token_value(&String::from("firstname")), S...
Rust
0
dvbt2_freqinterleaver = dvbt2.freqinterleaver_cc(carrier_mode, fft_size, pilot_pattern, guard_interval, data_symbols, papr_mode, version, mode) dvbt2_pilotgenerator = dvbt2.pilotgenerator_cc(carrier_mode, fft_size, pilot_pattern, guard_interval, data_symbols, papr_mode, version, mode, dvbt2.MISO_TX1, dvbt2.EQUA...
Python
1
st HID_USAGE_PAGE_UNDEFINED: USAGE = 0x00; pub const HID_USAGE_PAGE_GENERIC: USAGE = 0x01; pub const HID_USAGE_PAGE_SIMULATION: USAGE = 0x02; pub const HID_USAGE_PAGE_VR: USAGE = 0x03; pub const HID_USAGE_PAGE_SPORT: USAGE = 0x04; pub const HID_USAGE_PAGE_GAME: USAGE = 0x05; pub const HID_USAGE_PAGE_KEYBOARD: USAGE = 0...
Rust
0
cluster.minio_port}/{bucket}/test_cache4.jsonl', {auth})" ).strip() ) def test_no_sign_named_collections(started_cluster): instance = started_cluster.instances["s3_with_invalid_environment_credentials"] bucket = started_cluster.minio_bucket instance.query( f"insert into funct...
Python
1
curobo.rollout.rollout_base.Goal` Goal containing desired and current joint configuration. current_state : :class:`~curobo.types.robot.JointState`, optional Current robot state. When ``None``, :attr:`Goal.current_state` is used. Returns ------- :clas...
Python
1
django.contrib.auth.password_validation.MinimumLengthValidator', }, { 'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator', }, { 'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator', }, ] # Internationalization # https://docs.djangoproject...
Python
1
( &self, request: BitcoinAdapterRequestWrapper, opts: Options, ) -> RpcResult<BitcoinAdapterResponseWrapper>; } <filename>src/test/ui/methods/method-not-found-generic-arg-elision.rs // Test for issue 81576 // Remove generic arguments if no method is found for all possible generic argument u...
Rust
0
import os import config import random import colorsys import numpy as np import tensorflow as tf from model.yolo3_model import yolo class yolo_predictor: def __init__(self, obj_threshold, nms_threshold, classes_file, anchors_file): """ Introduction ------------ 初始化函数 Pa...
Python
1
t_property('Allow', doc=''' The Allow entity-header field lists the set of methods supported by the resource identified by the Request-URI. The purpose of this field is strictly to inform the recipient of valid methods associated with the resource. An Allow header field MUST be p...
Python
1
StorageType Delete tests */ /** positive tests */ #[test] fn sqlite_storage_type_create_check_metadata() { _prepare_path(); let storage_type = SQLiteStorageType::new(); let test_metadata = _get_test_keys(); storage_type.create_storage("test_wallet", None, &"", &test_me...
Rust
0
ame} → metric_T0.7_scaled.pt") logger.info(f"✅ All components updated! Backup in: {backup_dir}") def verify_stage2_can_load_components(self) -> bool: """Verify that Stage 2 can successfully load the corrected components.""" logger.info("🧪 Testing Stage 2 compatibility with cor...
Python
1
res //! //! * Apply simple transforms (using JMESPath queries or well known properties) to JSON before writing to Delta //! * Write bad messages to a dead letter queue //! * Send metrics to a Statsd endpoint //! * Control the characteristics of output files written to Delta Lake by tuning buffer latency and file size p...
Rust
0
, Tune(2.0)] ]))) ); assert!(single_parse(synthesize, "@(CE)").is_err()); assert!(single_parse(synthesize, "@(@0").is_err()); assert!(single_parse(synthesize, "@").unwrap().is_none()); assert!(single_parse(synthesize, "94").unwrap().is_none()); } use cosmwasm_std::{Addr, Uint128}; use cw_sto...
Rust
0
from transformers import pipeline import pandas as pd def readData(content_path): df = pd.read_csv(content_path, encoding='ANSI') return df def split_string(text, chunk_size=200): chunks = [] for i in range(0, len(text), chunk_size): chunks.append(text[i:i+chunk_size]) return chunks def e...
Python
1
# ckwg +29 # Copyright 2020 by Kitware, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
Python
1
read_u8()?; let num_bones = reader.read_u8()?; for _ in 0..num_frames { frm.frames .push(Frame::from_reader(&mut reader, num_bones as u16)?); } frm } else { let mut frm = Self::new(FrmVersion::V1_1); le...
Rust
0
import sys def caesar_cipher(text, shift, mode): if mode not in ("encode", "decode"): raise ValueError("Not mode 'encode' or 'decode'.") if mode == "decode": shift = -shift result = [] for char in text: if "a" <= char <= "z": new_char = chr((ord(char) - ord("a") +...
Python
1
Some(unsafe { &mut *oldset_ptr }) } else { None } }; super::do_sigprocmask::do_rt_sigprocmask(op_and_set, old_set)?; Ok(0) } pub fn do_rt_sigpending(buf_ptr: *mut sigset_t, buf_size: usize) -> Result<isize> { let buf: &mut sigset_t = { if buf_size < std::m...
Rust
0
import pandas as pd from pathlib import Path import pytest from covsirphy import ODEScenario, SIRFModel, ScenarioNotFoundError, SubsetNotFoundError, Term @pytest.fixture(scope="module") def jsonpath(): dirpath = Path("input") dirpath.mkdir(exist_ok=True) jsonpath = dirpath.joinpath("test.json") yield ...
Python
1
#!/usr/bin/env python3 import argparse import bisect import select import sys import termios import time import tty from collections import defaultdict import cereal.messaging as messaging from openpilot.tools.lib.framereader import FrameReader from openpilot.tools.lib.logreader import LogReader from openpilot.tools....
Python
1
t_cfg.fp8_amax_history_length = 0 quantized_dot_general_layer: QuantizedDotGeneral = q_dot_cfg.instantiate(parent=None) params = quantized_dot_general_layer.initialize_parameters_recursively( prng_key=jax.random.PRNGKey(123) ) inputs = [ "b...
Python
1
lass CompleteCommit: """Commit with complete metadata.""" hash: str date: str summary: str line_num: int @dataclass(frozen=True, kw_only=True) class ParsedLine: """Line information parsed from git.""" hash: str date: str summary: str line_num: int content: str def _form...
Python
1
use clap::Arg; use crate::args::{hexagram, trigram}; pub const HELP: &str = "(A 6 digit number){n}Cast your own coins and enter the sequence as a series of digits.{n} "; pub const LONG_HELP: &str = "\ For each line, cast 3 coins. Heads count for 3 and tails count for 2. Add up the \ result of casting 3 coins to g...
Rust
0
""" The :mod:`dynamic_obstacle_avoidance` module implements mixture modeling algorithms. """ # Various modulation functions # from .utils import * # Added this to avoid 'circular'-error from .modulation import obs_avoidance_interpolation_moving from .repulsion_modulation import obs_avoidance_nonlinear_hirarchy from ...
Python
1
from deeplite_torch_zoo.src.object_detection.yolo.config_parser import YOLO
Python
1
} } bail!("Invalid size argument provided.") } fn column_time(&self, stat: &FileStat) -> Result<String> { let mtime = Local.timestamp(stat.mtime.with_context(|| "File has no mtime.")? as i64, 0); Ok(format!( "{mtime}{sep}", mtime = mtime.form...
Rust
0
# coding: utf-8 """ merged spec merged spec The version of the OpenAPI document: 1.0.0 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. """ # noqa: E501 import unittest from kubernetes_asyncio_pydantic.api.apiextensions_v1_api import Apiextensio...
Python
1
# Copyright (c) 2022, NVIDIA CORPORATION. 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 appli...
Python
1
# Fluster - testing framework for decoders conformance # Copyright (C) 2021, Fluendo, S.A. # Author: Manuel Jimeno Martínez <mjimeno@fluendo.com>, Fluendo, S.A. # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License # as published by the F...
Python
1
platform. In practice, this //! means that 64-bit targets should not send messages with slices containing `(1 << 32) - 1` items //! to 32-bit targets, which is uncommon in practice. Enum discriminants already have a fixed //! maximum value of `(1 << 32) - 1` as currently defined in Rust. Varints larger than the current...
Rust
0
# Create table in BQ with historical practice data in same format as hscic.practice_details. # # New table will be at research.practices_yyyy_mm # # Run with ./manage.py runscript create_historical_practice_table --script-args yyyy_mm. import csv import sys from google.cloud import bigquery as gcbq from google.cloud...
Python
1
(); for i in self.pos..data.len() { ptr::drop_in_place(&mut data[i]); } } } } impl<L: Arrayify<T>, T> Iterator for ArrayIter<L, T> { type Item = T; fn next(&mut self) -> Option<T> { unsafe { let data = self.data.as_ref().unwrap_unchecked(...
Rust
0
.use_program(); let radius_location = compute_program.get_uniform_location("radius"); unsafe { // TODO: Make the radius vary for each frame. gl::Uniform1f(radius_location, 0.5 as GLfloat); } // Bind the VBO onto the SSBO, which is going to be filled within the c...
Rust
0
jj_|jjj_|jjj_|jjj_|jjj_|j_|}|d7}tj |||!\}|}||7}tr|||!jd|j_n|||!|j_|SWn%tjk r}tj|nXdS(s unpack serialized message in str into this message instance using numpy...
Python
1
logger.error(f"Failed to upload folder {in_folder}: {e}") continue continue for split in splits: for country in countries: all_folders = f"/data/rsulzer/PixelsPointsPolygons/data/224/{modality}/{split}/{co...
Python
1
failover_provider_input::RecoveryPointType) -> Self { Self { planned_failover_provider_specific_failover_input: PlannedFailoverProviderSpecificFailoverInput::default(), recovery_point_type, } } } pub mod in_mage_rcm_failback_planned_failover_provider_input { use super::*;...
Rust
0
xt_elt(&self) -> Option<Mode::Elt> { // Kind of a HACK; users might set the context_elt in a positive mode before a mode switch. self.env.find(&negative_ret_val()).map(Clone::clone) } /// Change the context (by editing the environment). Only sensible for negative walks. /// Don't do `.with_...
Rust
0
}, ) .map_err(|e| format!("{}", e))?; Ok((answer_id, json!({ "valid": result.valid }))) } fn hdkey_xprv_from_mnemonic(&self, args: &Value) -> InterfaceResult { let answer_id = decode_answer_id(args)?; let phrase = get_string_arg(args, "phrase")?; let ...
Rust
0
DLL. * Another application is to make all functions global for use with debuggers * or code profilers that require it. */ /* a function called through method pointers: */ /* a function used only in its module: */ /* a function referenced thru EXTERNs: */ /* a reference to a GLOBAL functi...
Rust
0
path, x: path, spec)) if set(nested_paths) != set(spec_paths): print("The nest does not match the spec!", file=sys.stderr) not_in_spec = set(nested_paths) - set(spec_paths) not_in_obs = set(spec_paths) - set(nested_paths) if not_in_spec: print("Not in spec: ", not_in_spec...
Python
1
p11; p20 += p22; p20 += p02; p20 += 0.5f; p20 = clamp(p20, 0.f, 255.f); return convert_uchar3(p20); } uchar2 __attribute__((kernel)) convolve_U2(uint32_t x, uint32_t y) { uint32_t x1 = min((int32_t)x+1, gWidth-1); uint32_t x2 = max((int32_t)x-1, 0); uint32_t y1 = min((int32_t)y+1, gH...
Rust
0
let identifier = children.find_node(Nodes::Identifier).map(get_id); let item_id = children.find_node(Nodes::ArticleItemId).map(get_id); let strukt = children.find_node(Nodes::Struct).map(get_id); let body = children.find_node(Nodes::ArticleBody).map(get_id); Some(Self { ...
Rust
0
e::String) .with_string_value("This is a new mfg_batch description".into()) .build() .unwrap(); let property_value_counter = PropertyValueBuilder::new() .with_name("counter".into()) .with_data_type(DataType::Number) .with_number_value(4) ...
Rust
0
MODEL_PATH = "C:\\DeepSeekAINonGit\\models\\small_models\\initializer.gguf" DB_PATH = "C:\\DeepSeekAINonGit\\ai-git-developer-memory\\ai_memory.db"
Python
1
"""Module for finding a path from an initial pal to a target pal""" import fileparsers as parse def breedingpathfinder(initial, target): """Function returns array of path from initial to target""" exceptdict = parse.parse_exceptions('exceptions.txt') valuesdict = parse.parse_values('palvalues.txt') p...
Python
1
s(base, len, len); } } #[no_mangle] pub extern "C" fn rust_associative_merge_operator_drop(op: *mut ()) { assert!(!op.is_null()); unsafe { let operator = op as *mut Box<dyn AssociativeMergeOperator>; Box::from_raw(operator); } } } #[cfg(test)] mo...
Rust
0
from flask import Flask, request from flask_cors import CORS from engine import AlphaBeta, Minimax, MonteCarloTreeSearch app = Flask(__name__) CORS(app) @app.route('/', methods=['GET']) def welcome(): return { "message": "API Chess Engine" } @app.route('/alphabeta', methods=['POST']) def get_move_b...
Python
1
eakdown.reasoning_tokens, cached_tokens=data.prompt_breakdown.cached_tokens, total_calls=data.usage.total_calls, total_tokens=data.usage.total_tokens, cost_estimate=0, # Placeholder for cost estimate ) return usa...
Python
1
n=int(input()) a=list(map(int,input().split())) d,m=map(int,input().split()) k=0 for i in range (n-m+1): if sum (a [i:i+m])== d: k+=1 print(k)
Python
1
_curve(current_line, tol, abs, x1, y1, x2, y2, x, y)?; } Some(_) | None => { // The previous segment was not a curve. Use the current // point as reference. match current_line.last_pair() { Some(pair) => ...
Rust
0
dentifier, href: Option<CallbackUrl>, direction: Direction, #[serde(rename = "type")] payload_type: PayloadType, originator: Option<Originator>, #[serde(rename = "body")] payload: Payload, reference: Option<String>, #[serde(flatten)] report_url: Option<CallbackUrl>, validity:...
Rust
0
elf.dup as u8) << 3; fixed_header |= (self.qos_level as u8) << 1; fixed_header |= self.retain as u8; fixed_header.encode(buffer); remaining_len += self.topic_name.encoded_size(); remaining_len += self.packet_id.encoded_size(); remaining_len += VariableByteInteger(self.pr...
Rust
0
.0.read_vectored(bufs) } */ #[inline] pub fn is_read_vectored(&self) -> bool { // TODO: In principle this is possible but is not hooked up yet return false; } fn recv_from_with_flags( &self, buf: &mut [u8], flags: c_int, ) -> io::Result<(usize, So...
Rust
0
ion_key_hash_sha256, encryption_key=new_encryption_key) api_client.copy_object( existing_object_resource, self._object_resource, request_config_with_encryption, should_deep_copy_metadata=True) if task_status_queue: progress_callbacks.increment_count_callback(task_...
Python
1
::Other, res.message)); }, _ => return Err(std::io::Error::new(std::io::ErrorKind::Other, "malformed HTTP response")), }; Ok(res) } <gh_stars>0 use html5ever::local_name; use kuchiki::*; use crate::html; /// Remove all script tags in this Kuchiki node and all children pub fn purge_scripts(node: NodeRef) { ...
Rust
0
expected_output = { 'frr_db_summary': { 'protected_intfs_num': 3, 'protected_lsps_num': 3, 'backup_tunnels_num': 3, 'active_intfs_num': 0, 'frr_active_tunnels_num': 0 }, 'p2p_lsps': { 'Tunnel13': { 'lsp2': { 'src_ip': '1.1.1.1', ...
Python
1
} Ok((rest, xref)) } Err(err) => Err(err), } } fn recognize_pdf_old_style_trailer(i: &[u8]) -> IResult<&[u8], PdfObject> { match preceded( tuple((tag(b"trailer"), pdf_whitespace)), tuple((recognize_pdf_dictionary, opt(pdf_whitespace))), )(i) { ...
Rust
0
#pylint:disable=no-member import cv2 as cv # Read in an image img = cv.imread('../Resources/Photos/park.jpg') cv.imshow('Park', img) # Converting to grayscale gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) cv.imshow('Gray', gray) # Blur blur = cv.GaussianBlur(img, (7,7), cv.BORDER_DEFAULT) cv.imshow('Blur', blur) # E...
Python
1
return aliases; } // place = after[*ptr] let (ptr, after) = *place.refs_in_projection().last().unwrap(); // ptr : &'region orig_ty let ptr_ty = ptr.ty(self.body.local_decls(), self.tcx).ty; let (region, orig_ty) = match ptr_ty.kind() { _ if ptr_ty.is_box() => (UNKNOWN_REGIO...
Rust
0
filename=new_filename, file=file.file, headers=Headers( {"content-disposition": f'form-data; name="ssh_private_key"; filename="{new_filename}"'} ) ) data["ssh_private_key"] = renamed_...
Python
1
def _sigmoid_cross_entropy_with_logits(logits, labels): loss = torch.clamp(logits, min=0) - logits * labels.type_as(logits) loss += torch.log1p(torch.exp(-torch.abs(logits))) return loss
Python
1
SSKJr S/rg) LinearReLUrN8torch.nn.intrinsic.quantized.dynamic.modules.linear_relur__all__8torch\nn\intrinsic\quantized\dynamic\modules\__init__.py<module>r O r
Python
1
import psutil import time def close_process(process_name): found = False for process in psutil.process_iter(['pid', 'name', 'username']): if process.info['name'] == process_name: try: print(f"Terminating {process_name} (PID: {process.info['pid']}, User: {process.info['userna...
Python
1
'Grek senni', 'sg': 'Gerêki', 'shi': 'ⵜⴰⴳⵔⵉⴳⵉⵜ', 'shi-Latn': 'Tagrigit', 'shi-Tfng': 'ⵜⴰⴳⵔⵉⴳⵉⵜ', 'si': 'ග්\u200dරීක', 'sk': 'gréčtina', 'sl': 'grščina', 'smn': 'kreikakielâ', 'sn': 'chiGreek', 'so': 'Giriik', 'sq': 'greqisht', 'sr': 'грчки', 'sr-Cyrl': 'грчки', 'sr-Latn': 'grčki', 'sv': 'grekiska', 'sw': 'Kigiriki', 's...
Python
1
pub mod device; pub mod event; pub mod kernel; pub mod memory; pub mod platform; pub mod program; #[cfg(feature = "CL_VERSION_2_0")] pub mod svm; pub mod error_codes { pub use cl3::error_codes::*; } pub mod types { pub use cl3::types::*; } use std::result; /// Custom Result type to output OpenCL error text. p...
Rust
0
except Exception as e: print("exception while reading details from csv files") print(repr(e)) t = (name, id, spreadsheet_name) answer.append(t) print("CSV file: ", repr(t)) mainWindow._csv_files.append({"id":id, "name":spreadsheet_name,"csv_name...
Python
1
.copy_from_slice(&from[..size]); from.drain(..size); Ok(into) } } impl Decode for Vec<u8> { fn decode(from: &mut Vec<u8>) -> Result<Self, String> { let mut into = Vec::new(); let len = from.len(); into.extend(&from[..len]); from.clear(); Ok(into) } } impl Decode for u8 { fn decode(from: &mut Vec<u8>...
Rust
0
(id) calculator.process_builder(cst, displacements) strains = calculator.strains() stresses = calculator.stresses() self.results.set_cst_strains(id, strains) self.results.set_cst_stresses(id, stresses) def post_process_for_membrane_q3dof(self) -> None: ...
Python
1
2; // Performance Counter Mapping 8 pub const V3D_PCTR9 : usize =0x6c8>>2; // Performance Counter Count 9 pub const V3D_PCTRS9 : usize =0x6cc>>2; // Performance Counter Mapping 9 pub const V3D_PCTR10 : usize =0x6d0>>2; // Performance Counter Count 10 pub const V3D_PCTRS10 : usize =0x6d4>>2; // Performance Counter M...
Rust
0
pending_farm_reward: Uint128::from(2498u128), pending_spec_reward: Uint128::from(3899u128), bond_amount: Uint128::from(11000u128), auto_bond_amount: Uint128::from(8000u128), stake_bond_amount: Uint128::from(3000u128), }, ] ); ...
Rust
0
from .data import get_dataloaders, get_datasets, get_dataloaders,get_datasetssingle from .utils import train_model, test_model, get_optimizer, get_scheduler, set_requires_grad, OursTrainer, create_pad_mask
Python
1
#!/usr/bin/env python3 # Copyright (C) 2021 The Android Open Source Project # # 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 requ...
Python
1
be negative") } if alpha <= T::zero() || T::one() <= alpha { return fallible!(InvalidDistance, "alpha ({:?}) must be in (0, 1)") } Ok(accuracy / alpha.recip().ln()) } pub fn gaussian_scale_to_accuracy<T>(scale: T, alpha: T) -> Fallible<T> where f64: InfCast<T>, T: InfCast<f64> { let sc...
Rust
0
# Now let's make a side-scrolling platformer. game.spawnFloor("mountain") game.spawnTopBorder("desert") # Make sure the platforms don't fall off the map! game.setPropertyFor("forest", "ignoreGravity", True) game.setPropertyFor("gold-coin", "ignoreGravity", True) # We don't want the platforms to scroll too fast! game...
Python
1
zing_if = "Option::is_none")] pub email: Option<&'a str>, #[serde(skip_serializing_if = "Option::is_none")] pub items: Option<OrderItem>, #[serde(skip_serializing_if = "Option::is_none")] pub metadata: Option<HashMap<&'a str, &'a str>>, #[serde(skip_serializing_if = "Option::is_none")] pub s...
Rust
0
#[doc = "`write(|w| ..)` method takes [pio1_30::W](pio1_30::W) writer structure"] impl crate::Writable for PIO1_30 {} #[doc = "Digital I/O control for port 1 pins PIO1_30"] pub mod pio1_30; #[doc = "Digital I/O control for port 1 pins PIO1_31\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate...
Rust
0
from typing import Dict, Type from marie.core.llms.llm import LLM from marie.core.llms.mock import MockLLM RECOGNIZED_LLMS: Dict[str, Type[LLM]] = { MockLLM.class_name(): MockLLM, } # Conditionals for llama-cloud support try: from llama_index.llms.openai import OpenAI # pants: no-infer-dep RECOGNIZED_L...
Python
1
def desenhar(aventureiro, tesouro): for y in range(10): for x in range(10): if aventureiro.posicao == [x, y]: print("@", end=" ") elif tesouro.posicao == [x, y]: print("X", end=" ") else: print(".", end=" ") print() ...
Python
1
") else if $chr_code.get() == kern_node as chr_code_repr { print_esc($globals, crate::strpool_str!("unkern")); } // else print_esc("unpenalty"); else { print_esc($globals, crate::strpool_str!("unpenalty")); } use crate::section_0149::glue_node; ...
Rust
0
} else { let mut hasher = ahash::AHasher::default(); self.op.hash(&mut hasher); let h = hasher.finish(); h.hash(state); self.hash.set(Some(h)); } } } //All the available operations #[derive(Debug, Clone, Eq, PartialEq, Hash)] pub enum ExprOperation...
Rust
0
log_field!(claims_parameter_supported); log_field!(request_parameter_supported); log_field!(request_uri_parameter_supported); log_field!(require_request_uri_registration); log_field!(op_policy_uri); log_field!(op_tos_uri); log_debug!("Provider metadata: {:?}", provider_metadata); log_i...
Rust
0
cuda:0") args = parser.parse_args() process_video_in_chunks(args, [[607.75244140625, 126.3901596069336, 791.4397583007812, 356.09332275390625], [612.8888549804688, 284.82171630859375, 692.8299560546875, 362.6283874511719], [638.74560546875, 598.923095703125, 6...
Python
1
ta(minutes=1) # Было hours=12 ) context.job_queue.run_once( lambda ctx: send_reminder(ctx, chat_id, 2), timedelta(minutes=2) # Было hours=24 ) async def handle_faq(update: Update, context: ContextTypes.DEFAULT_TYPE): """Обработчик нажатия на кнопку FAQ""" query = update.callback_q...
Python
1
# Standard library imports # Remote library imports from flask import Flask from flask_cors import CORS from flask_migrate import Migrate from flask_restful import Api from flask_sqlalchemy import SQLAlchemy from sqlalchemy import MetaData # from flask_bcrypt import Bcrypt # Local imports # Instantiate app, set attr...
Python
1
, interpolation=cv2.INTER_CUBIC) img_matlab = img.copy() tmp = img_matlab[:, :, 2].copy() img_matlab[:, :, 2] = img_matlab[:, :, 0] img_matlab[:, :, 0] = tmp boundingboxes, points = detect_face(img_matlab, minsize, PNet, RNet...
Python
1