text
string
label_name
string
labels
int64
// The opcode for `Input::GetSelectedExtensionEvents` requests. /// /// If this value appears in [`xcb_protocol_request_t::opcode`], and /// [`xcb_protocol_request_t::ext`] is [`XcbXinput::xcb_input_id()`], then the type of the request is /// [`xcb_input_get_selected_extension_events_request_t`]. pub const XCB_INPUT_GE...
Rust
0
""" Copyright (c) 2013-present Matic Kukovec. Released under the GNU GPL3 license. For more information check the 'LICENSE.txt' file. For complete license information of the dependencies, check the 'additional_licenses' directory. """ import data import functions import time # Relative imports from typing import * f...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- # # rce-core/rce/monitor/common.py # # This file is part of the RoboEarth Cloud Engine framework. # # This file was originally created for RoboEearth # http://www.roboearth.org/ # # The research leading to these results has received funding from # th...
Python
1
import torch.nn as nn class ModelDiscriminate(nn.Module): # 由5个卷基层+4个relu构成 def __init__(self, num_classes, ndf=64): # num_classes=1 super(ModelDiscriminate, self).__init__() self.conv1 = nn.Conv2d( num_classes, ndf, kernel_size=4, stride=2, padding=1) # Conv2d(in_cha...
Python
1
import streamlit as st import PIL.Image import google.generativeai as genai import os from dotenv import load_dotenv # Load environment variables load_dotenv() gemini_api_key = os.getenv("GEMINI_API_KEY") genai.configure(api_key=gemini_api_key) # Load Gemini model model = genai.GenerativeModel("models/gemini-1.5-flas...
Python
1
try: #Somecode pass except: #Somecode pass else: #Somecode #This is executed only if try was successful pass
Python
1
K_h: current_tool = TOOL_RHOMBUS elif event.key == pygame.K_1: current_color = COLOR_BLACK elif event.key == pygame.K_2: current_color = COLOR_RED elif event.key == pygame.K_3: current_color =...
Python
1
# -*- coding: utf-8 -*- import datetime from django.utils.translation import gettext_lazy as _ from mongoengine.document import Document from mongoengine.fields import DateTimeField, IntField, StringField from mongoengine.queryset import QuerySetManager from django_extensions.mongodb.fields import AutoSlugField, Crea...
Python
1
0, IEC104_IO_NAMES), BitEnumField('sq', IEC104_I_Message.SQ_FLAG_SINGLE, 1, IEC104_I_Message.SQ_FLAGS), BitFieldLenField('num_io', None, 7, count_of='io'), BitEnumField('test', 0, 1, IEC104_I_Message.TEST_FLAGS), BitEnumField('ack', 0, 1, IEC104_I_Message.ACK_FLAG...
Python
1
) try: await message.answer_document( document=FSInputFile(out_path), caption=f"👥 Foydalanuvchilar ro‘yxati (CSV) — {len(rows)} ta" ) except Exception as e: await message.reply(f"❌ CSV yuborilmadi: {e}") # ================== POLLING ================== async def...
Python
1
dmarks vis_path = os.path.join(gt_lmk_dir, f"{idx}_overlay.jpg") image = cv2.imread(gt_img_path) image_point = plot_kpts(image, gt_kpt) cv2.imwrite(vis_path, np.concatenate([image_point, gt_lmk_image], axis=1)) def landmark_comparison(val_dataset, lmk_di...
Python
1
super::ehal::spi::Phase as ClockPhase; /*pub enum ClockPhase { Edge1,//CaptureOnFirstTransition = 0, Edge2///CaptureOnSecondTransition = 1 }*/ /// SPI_Slave_Select_management #[derive(Clone, Copy, PartialEq)] pub enum SlaveSelect { Soft, // = 1, Hard, // = 0 } /** @defgroup SPI_BaudRate_Presca...
Rust
0
/// Creates an APK which is suitable for inclusion in a system image from an /// already uploaded Android App Bundle. /// /// A builder for the *variants.create* method supported by a *systemapk* resource. /// It is not used directly, but through a `SystemapkMethods` instance. /// /// # Example /// /// Instantiate a...
Rust
0
lector::SubGraph(ref mut sub) => { iter.for_each(|v| sub.add_id(v.id())); sub.handle(graph).map(|v| R::from(v.data())).collect() } } } } pub mod language; pub mod phrase; pub mod time; pub mod word; pub mod word_grid; use ::libc; extern "C" { pub type _IO_wide...
Rust
0
mestep size: {timestep.shape}") if not torch.is_tensor(timesteps): # TODO: this requires sync between CPU and GPU. So try to pass timesteps as tensors if you can timesteps = torch.tensor([timesteps], dtype=torch.long, device=sample.device) elif torch.is_tensor(timesteps) and len(...
Python
1
idx += 1; } map } async fn load_dots_for_user(id: i32) -> Result<JsValue, JsValue>{ let mut opts = RequestInit::new(); opts.method("GET"); let url = format!("http://localhost:8000/users/{}", id); let request = Request::new_with_str_and_init(&url, &opts)?...
Rust
0
inputs) # expand dimensionality for depthwise_conv2d # to [memory_size, 1, feature_dim, 1] time_kernel_exp = tf.expand_dims(tf.expand_dims(self.time_kernel, 1), -1) # run convolution depthwise_conv1d = tf.nn.depthwise_conv2d( tf.expand_dims(inputs_pad, -2), time_kernel_exp, ...
Python
1
from decimal import Decimal, InvalidOperation from django.utils.translation import gettext as _ from dcim.choices import CableLengthUnitChoices from netbox.choices import WeightUnitChoices __all__ = ( 'to_grams', 'to_meters', ) def to_grams(weight, unit) -> int: """ Convert the given weight to inte...
Python
1
import numpy as np def pagerank(links, damping_factor=0.85, max_iterations=100, tol=1e-6): """ 計算網頁的 PageRank 值 參數: links : 矩陣,表示網頁之間的鏈接 damping_factor : 阻尼因子 max_iterations : 最大迭代次數 tol : 收斂容差 返回: pagerank_values : 每個網頁的 PageRank 值 """ n = links.shape[0] # 初始化...
Python
1
IDEO_HEVC_I_FRAME_QP: u32 = 10029914; pub const V4L2_CID_MPEG_VIDEO_HEVC_P_FRAME_QP: u32 = 10029915; pub const V4L2_CID_MPEG_VIDEO_HEVC_B_FRAME_QP: u32 = 10029916; pub const V4L2_CID_MPEG_VIDEO_HEVC_HIER_QP: u32 = 10029917; pub const V4L2_CID_MPEG_VIDEO_HEVC_HIER_CODING_TYPE: u32 = 10029918; pub const V4L2_CID_MPEG_VID...
Rust
0
} log::warn!("shutting down reload connection"); if let Err(e) = out.shutdown() { log::error!("failed to shut down reload connection: {:?}", e); } }); Ok(()) } fn on_close(&mut self, code: ws::CloseCode, reason: &str) { log...
Rust
0
from .bert import BERTTrainer from .dae import DAETrainer from .vae import VAETrainer TRAINERS = { BERTTrainer.code(): BERTTrainer, DAETrainer.code(): DAETrainer, VAETrainer.code(): VAETrainer }
Python
1
import os os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'FakerModel.settings') import django django.setup() from testapp.models import Student from faker import Faker from random import * from random import randrange fake = Faker() def phone(): d = randrange(6,9) num = '+91'+str(d) for i in range(9): ...
Python
1
Area { v.iter() .map(|s| parse_claim(s)) .map(|coord| claim_coord_vec(coord)) .flatten() .collect() } #[test] fn all_the_coords_test() { let data = vec!["#1 @ 1,3: 4x4", "#2 @ 3,1: 4x4", "#3 @ 5,5: 2x2"]; assert_eq!(all_the_coords(data)...
Rust
0
class Solution: def countSubarrays(self, nums: List[int], minK: int, maxK: int) -> int: total = 0 last_invalid = last_min = last_max = -1 for i, num in enumerate(nums): if num < minK or num > maxK: last_invalid = i if num == minK: last...
Python
1
, 7, 7], kernels=[5, 5, 5, 5] ) return _create_efficientvit_msra('efficientvit_m3', pretrained=pretrained, **dict(model_args, **kwargs)) @register_model def efficientvit_m4(pretrained=False, **kwargs): model_args = dict( img_size=224, embed_dim=[128, 256, 384], depth=[1, 2,...
Python
1
et === null || target === void 0 ? void 0 : target.getAttribute('data-madv-render'); const isDirectTGOBanner = target === null || target === void 0 ? void 0 : target.getAttribute('data-madv-pixel-direct'); const directParentId = target === null || target === void 0 ? void 0 : target.getAttribute('data-madv-parent-i...
Python
1
_TO_HTTPS_ON_REDIR: HRESULT = 0x80072F07; pub const WININET_E_HTTPS_TO_HTTP_ON_REDIR: HRESULT = 0x80072F08; pub const WININET_E_MIXED_SECURITY: HRESULT = 0x80072F09; pub const WININET_E_CHG_POST_IS_NON_SECURE: HRESULT = 0x80072F0A; pub const WININET_E_POST_IS_NON_SECURE: HRESULT = 0x80072F0B; pub const WININET_E_CLIENT...
Rust
0
:tt) => { ::runtime::eval::Value::Cons(Rc::new(val!($a)), Rc::new(val! $d )) }; (f $body:tt, $params:expr, $env:tt) => { ::runtime::eval::Value::Function( Rc::new(::runtime::eval::Closure(ast!($body), $params, assoc_n! $env))) }; (bif $f:expr) => { ::runtime::eval::Value::BuiltIn...
Rust
0
# Copyright (c) Facebook, Inc. and its affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # import numbers import numpy as np import PIL def crop_clip(clip, min_h, min_w, h, w): if isinstance(clip[0], np.nd...
Python
1
import torch import torch.nn.functional as F from models.wrapper import CASPWrapper, CASP import torch_tools import os import json import warnings warnings.filterwarnings("ignore", category=UserWarning, module='librosa') import torch import matplotlib.pyplot as plt import seaborn as sns import random import torch impor...
Python
1
= "Option::is_none")] pub event_key: Option<String>, #[serde(rename = "messageParams", skip_serializing_if = "Option::is_none")] pub message_params: Option<Vec<serde_json::Value>>, #[serde(rename = "id", skip_serializing_if = "Option::is_none")] pub id: Option<String>, #[serde(rename = "userId"...
Rust
0
rray([0.05, 0.025, 0.025, 0.25]), 0.5, 1230, "Initial values array", ], # unbroadcastable shapes [ jnp.array([[50.0, 49.9], [48.2, 0.035]]), jnp.array([[0.05, 0.025], [0.025, 0.25]]), jnp.array([0.5, 0.25, 0.3]), ...
Python
1
TypeDeanonymizer::new(&syntax); let syntax_options = SpecOptions { root: &fake_root, null: &null, }; let new_syntax = deanonymizer.into_spec(syntax_options); let rules_source_path = matches.value_of("INPUT.yaml").unwrap(); println!("...generating rules"); let data = fs::read_to_...
Rust
0
supported_dists_x86_64 = {'redhat' : ['7', '8', '9'], # Rhel 'rhel' : ['7', '8', '9'], # Rhel 'centos' : ['7', '8'], # CentOS 'red hat' : ['7', '8', '9'], # Oracle, RHEL 'oracle' : ['7', '8', '9'], # Oracle ...
Python
1
import ast import glob import json import os from collections import OrderedDict I18N_JSON_DIR : os.PathLike = os.path.join(os.path.dirname(os.path.relpath(__file__)), 'locale') DEFAULT_LANGUAGE: str = "zh_CN" # 默认语言 TITLE_LEN : int = 60 # 标题显示长度 KEY_LEN : int = 30 # 键...
Python
1
# Replace relative image paths in Markdown image references with GitHub URLs. line = replace_relative_image_paths(line, root_dir, input_filepath) # Look for the first non-empty line that starts with a Markdown header. if not header_replaced and line.strip(): match = header_...
Python
1
""" test_simple.py - test the basic feature of lcdi2c.py driver (LiquidCrystal_I2C portage to MicroPython). * Author(s): Meurisse D. from MCHobby (shop.mchobby.be). Products: ---> https://shop.mchobby.be/fr/afficheur-lcd-tft-oled/882-lcd-backpack-i2c-3232100008823.html ---> https://shop.mchobby.be/fr/nouveaute/1807-a...
Python
1
UCE_KIND", "mismatch"); } } let start_time = Instant::now(); if !cmd.status()?.success() { return Err(eyre!("reducer process did not exit successfully")); } let end_time = Instant::now(); let duration = end_time - start_time; println!("> reducer completed in {}s", duratio...
Rust
0
import streamlit as st import xml.etree.ElementTree as ET from lxml import etree def parse_xml(xml_content): return ET.fromstring(xml_content) def combine_xml_roots(root1, root2): rule_collections = {rc.get('Type'): rc for rc in root1.findall('RuleCollection')} for rc in root2.findall('RuleCollection'...
Python
1
ler"]: scaler.step(opt) scaler.update() else: opt.step() sch.step() opt.zero_grad(set_to_none=True) ema = (ema * (i - 1) + loss.item()) / i pbar.set_postfix(loss=f"{ema:.4f}", lr=f"{op...
Python
1
%80%D0%B8%D1%82%D0%BC_%D0%92%D0%B0%D0%B3%D0%BD%D0%B5%D1%80%D0%B0-%D0%A4%D0%B8%D1%88%D0%B5%D1%80%D0%B0 fn main() { let s1 = String::from("Hello"); let s2 = String::from("wor"); println!("Hello, wor = {}", levenstein(s1, s2)); } fn levenstein(s1: String, s2: String) -> u32 { let mut vec = vec![vec![0, ...
Rust
0
# -*- coding: utf-8 -*- ''' Verification test based on example 1 of section 6-8 of TM 5-809-3 manual. ''' from __future__ import division from __future__ import print_function from materials.aci import ACI_materials from materials.tm5_809_3 import tm5_809_3_materials from misc_utils import units_utils __auth...
Python
1
pc is {:#x}, vst i {:#b}",pc,vst); trace!("[RVM] hst is {:#x}, sst i {:#x}",hst,sst); trace!("[RVM] guest_hst is {:#b}, guest_sst i {:#b}",guest_state.hstatus,guest_state.sstatus); } } _ => { debug!("[RVM] trap_handler...guest_state {:#x?}",guest_...
Rust
0
.collect::<Vec<String>>() .join(", ") )), Self::Record(record) => Ok(format!( "#{{{}}}", record .iter() .map(|(k, v)| format!("\"{}\": {}", k, v)) .collect::<Vec<String>>() .join(", ") )), Self::Number(num) => Ok(format...
Rust
0
PROC = ::std::option::Option< unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, value: *const GLfloat), >; pub type PFNGLCLEARBUFFERFIPROC = ::std::option::Option< unsafe extern "C" fn(buffer: GLenum, drawbuffer: GLint, depth: GLfloat, stencil: GLint), >; pub type PFNGLGETSTRINGIPROC = ::std::option::...
Rust
0
), Err(e) => panic!("wrong error type: {}", e), _ => panic!("error expected"), } } #[test] fn negotiation_failure_in_response_results_in_error() { #[rustfmt::skip] let buffer = [ // tpkt header 0x3, // version 0x0, // reserved 0x00, 0x13, // lenght in BE ...
Rust
0
) if property_id in ALIAS_PROPERTIES: out_data["aliases"].append( { "qid": id, "alias": value, } ) # get qualifiers if "qualifiers"...
Python
1
we used it as-is, no code that includes this /// constant could be used as a firmware image, as it contains the magic string /// halfway through. pub const MAGIC_STRING: &str = "HSc7c2ptydZH2QkqZWPcJgG3JtnJ6VuA"; pub fn magic_string_inverted() -> Vec<u8> { MAGIC_STRING.as_bytes().iter().map(|b| !b).collect() } pub fn...
Rust
0
rial('stainless steel') assert_close(k, 17.0) rho = rho_material('Mineral fiber') assert_close(rho, 30.0) rho = rho_material('stainless steel') assert_close(rho, 7900.0) rho = rho_material('Board, Asbestos/cement') assert_close(rho, 1900.0) Cp = Cp_material('Mineral fiber') asse...
Python
1
class OutOfStockError(Exception): # DEFINITON OF THE CUSTOME EXCEPTIONS def __init_(self,name): self.name = name def __str__(self): print(f"{self.name} is empty") class InsufficientAmountExcepiton(Exception): def __init_(self,name): self.name = name de...
Python
1
import re import sys def main(): print(convert(input("Hours: "))) def convert(s): if matches := re.search(r"^([1-9]|1[0-2])(?::)?(0[0-9]|[1-5][0-9])? (AM|PM) to ([1-9]|1[0-2])(?::)?(0[0-9]|[1-5][0-9])? (AM|PM)$",s): start_hour = int(matches.group(1)) start_minutes = matches.group(2) ...
Python
1
vec.sort_by_cached_key(|x| format!("{:?}", x)) } fn is_fn_ty(&self, tcx: &TyCtxt, ty: &Type) -> bool { match &ty { &&Type::ResolvedPath { ref did, .. } => { *did == tcx.require_lang_item(lang_items::FnTraitLangItem) || *did == tcx.require_lang_item(lang_i...
Rust
0
j)?; assert!(obj.is_nil(), "{:?}", obj); Ok(()) } #[test] fn can_evaluate_if() -> Result<(), Error> { let mut bel = Bel::new(); let parse_obj = parser::parse("(if t 'a 'b)")?; let obj = bel.eval(&new_object_map(), &parse_obj)?; assert!(obj.is_symbol("a")); ...
Rust
0
ame class will be # merged here, and stuff share the instance_id 0. panoptic_seg[mask] = pred_class else: panoptic_seg[mask] = ( pred_class + instance_id * INSTANCE_OFFSET) ins...
Python
1
data_sorted_unique(fuzz_to_data(data)); data } fn input2(seed: u64, len: usize, value_length: usize) -> Vec<(Vec<u8>, Vec<u8>)> { use rand::SeedableRng; use rand::RngCore; let mut rng = rand::rngs::SmallRng::seed_from_u64(seed); let mut data = vec![0u8; len]; rng.fill_bytes(&mut data[..]); let data = data_sort...
Rust
0
91: rewrite!("neg-to-xor"; "(neg ?x)" => "(xor ?x const_-1)"), // Abs rule on 1541 // Line 1790: -- possibly useful? // ========= // Floating Point Rules. // Note that for FP rules, we generally assume -ffast-math or // equivlanet. Otherwise, very limited rules apply, so not worthwhile. // Line 539: ...
Rust
0
}), ), )?; check_nodes.push(read_node); } // Connects all `Find Connected Model` nodes with execution order dependency from the example in the docs. check_nodes.into_iter().fold1(|prev, next| { graph .crea...
Rust
0
from __future__ import annotations from typing import Any, Dict, Optional, Type, TYPE_CHECKING from functools import partial from taproot.util import PretrainedModelMixin if TYPE_CHECKING: from .model import Generator, UNetGenerator __all__ = [ "PretrainedLineartDetector", "PretrainedCoarseLineartDetect...
Python
1
/// Registers interest of a task in opening a new outbound substream. fn register(&mut self, waker: &Waker) { if self.pending.iter().all(|w| !w.will_wake(waker)) { self.pending.push(waker.clone()); } } fn wake_all(&mut self) { let wakers = mem::take(&mut self.pending); ...
Rust
0
.map(|v| v.index) .collect::<Vec<usize>>(); indices.sort(); assert_eq!(indices, vec![0]); let mut indices = index .find_nearest_neighbors_radius(10, 1.1, &arr![f32; 2, 0, 0]) .map(|v| v.index) .collect::<Vec<usize>>(); indices.sort(); assert_eq!(indices, vec!...
Rust
0
USB_TXCSRL3_ERRORR { bits } } #[doc = "Bit 3 - Flush FIFO"] #[inline(always)] pub fn usb_txcsrl3_flush(&self) -> USB_TXCSRL3_FLUSHR { let bits = ((self.bits >> 3) & 1) != 0; USB_TXCSRL3_FLUSHR { bits } } #[doc = "Bit 4 - Setup Packet"] #[inline(always)] pub fn usb_txcsrl3...
Rust
0
eturn flax.traverse_util.unflatten_dict(jax_flat_dict) transformer_config_dicts = { 'small': { 'emb_dim': 384, 'dec_emb_dim': 512, 'depth': 12, 'dec_depth': 8, 'num_heads': 6, 'dec_num_heads': 16, 'mlp_ratio': 4, }, 'base': { 'emb_dim': 768,...
Python
1
.to_string() }); Ok(()) } pub fn fetch(&self) -> Result<()> { if ! self.version_file.exists() { ensure!(! self.source_dir.exists(), error::CorruptedSourceDir{ dir: self.source_dir.clone(), version_file: self.version_file.clone(), }); ...
Rust
0
next row for i in 0..WIDTH { let next_state = v_cells.query_advice(state[i], Rotation::next()); exprs[i] = s_cells.clone() * (exprs[i].clone() - next_state); } exprs }); meta.create_gate("partial_round", |v_cells| { let mut exprs = [(); WIDTH].map(|_| Expression::Constant(F::zero())); // Ad...
Rust
0
(Read more from {}...)", self.author_summary()) } } #[derive(Debug)] struct NewsArticle { headline: String, location: String, author: String, content: String, } // 只实现没有默认实现的方法就可以了 impl Summarizable for NewsArticle { fn author_summary(&self) -> String { format!("{}, by {} ({})", self.headline, se...
Rust
0
slice(256))) .collect(); Ok(PL2Palette { base_palette, light_level_variations, inv_color_variations, select_uint_shift, alpha_blend, additive_blend, multiplicative_blend, hue_variations, red_tones, green_tones, blue_ton...
Rust
0
self.grid[self.cursor.point.line]; for cell in &mut row[..=col] { cell.reset(&self.cursor.template); } }, ansi::LineClearMode::All => { let row = &mut self.grid[self.cursor.point.line]; for cell in &mut row[..] ...
Rust
0
g()) .with_stderr_contains("[..]reusing existing rustc info cache[..]") .with_stderr_contains(hit) .with_stderr_does_not_contain(miss) .with_stderr_does_not_contain(update) .run(); } use std::path::Path; use std::sync::Arc; use crossbeam_channel::Sender; use heed::types::{OwnedT...
Rust
0
; count = if (*m).m_hdr.mh_len - off > len { len } else { ((*m).m_hdr.mh_len) - off } as uint32_t; memcpy( ptr as *mut libc::c_void, (*m).m_hdr.mh_data.offset(off as isize) as *const libc::c_void, ...
Rust
0
from apiflask import APIFlask, Schema from apiflask.fields import Integer, String from apiflask.validators import Length, OneOf from flask_sqlalchemy import SQLAlchemy app = APIFlask(__name__) app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///:memory:' app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlc...
Python
1
res.push(elem); } Ok(Intermediate::Array(res)) } fn visit_map<A>(self, mut map: A) -> Result<Self::Value, A::Error> where A: MapAccess<'a>, { let mut res = Map::new(); if let Some(size) = m...
Rust
0
ut_printer: OutputPrinter, ) -> SqlExecutors: assert ( self.flag_configuration_pair is not None ), "Flag configuration is not initialized" assert self.mz2_connection is not None, "Second connection is not initialized" assert ( self.mz2_system_connection is not...
Python
1
ggerFromFlags(self, args): """Parses command line arguments into a build trigger. Args: args: An argparse arguments object. Returns: A build trigger object. Raises: RequiredArgumentException: If comment_control is defined but pull_request_pattern isn't. """ project = p...
Python
1
&self, program: &glium::Program, uniforms: &U, draw_params: &glium::DrawParameters, target: &mut S, ) -> Result<(), DrawError> where U: ToUniforms, S: glium::Surface, { for i in 0..NUM_TYPES { (self.0).0[i].as_drawable(&self.1.meshes[i...
Rust
0
ional[List[int]] = None reft_rank: int = 4 reft_intervention_type: Literal['NoreftIntervention', 'LoreftIntervention', 'ConsreftIntervention', 'LobireftIntervention', 'DireftIntervention', 'NodireftIntervention'] = 'LoreftIntervention' ...
Python
1
#[inline] fn invert(&self) -> Option<AffineMatrix3<S>> { self.mat.invert().map(|m| AffineMatrix3{ mat: m }) } } impl<S: BaseNum> ToMatrix4<S> for AffineMatrix3<S> { #[inline] fn to_matrix4(&self) -> Matrix4<S> { self.mat.clone() } } impl<S: BaseFloat> Transform3<S> for AffineMatrix3<S> {} us...
Rust
0
███╗ ███████╗ ██║ ███████╗ // ██║ ██╔══╝ ╚════██║ ██║ ╚════██║ // ██║ ███████╗███████║ ██║ ███████║ // ╚═╝ ╚══════╝╚══════╝ ╚═╝ ╚══════╝ #[cfg(test)] mod test { use super::*; use crate::{fill_extent, test_util::assert_elements_eq, VecLatticeMap, YLevelsIndexer}; #[derive(C...
Rust
0
.unwrap(); let res: Option<AccountId> = call_lockup(&r, "get_staking_pool_account_id", ""); assert_eq!(res, Some(staking_pool_account_id.clone())); let res: U128 = call_lockup(&r, "get_known_deposited_balance", ""); assert_eq!(res.0, 0); // Depositing and staking on the staking pool let...
Rust
0
oauth2.auth.schema.get("flow") === "accessCode" || oauth2.auth.schema.get("flow") === "authorizationCode" || oauth2.auth.schema.get("flow") === "authorization_code" ) && !oauth2.auth.code) { if (!isValid) { oauth2.errCb({ ...
Python
1
(), ::static_xml::ser::Error> { #(#write_namespaces)* Ok(()) } fn write_children(&self, writer: &mut ::static_xml::ser::ElementWriter) -> Result<(), ::static_xml::ser::Error> { match self { #(#match_arms,)* } ...
Rust
0
(oid)?; let parent = { let head = repo.head()?; head.peel_to_commit()? }; repo.commit(Some("HEAD"), &signature, &signature, msg, &tree, &[&parent])?; let mut remote = repo.find_remote("origin")?; remote.push::<&'static str>(&[], None)?; Ok(()) ...
Rust
0
red=True, help="path to UMR gold dir or file") argparser.add_argument("--ancast_home", help="path to UMR Inference Toolkit home") main(script_setup(add_args_fn=add_args)) ### MODAL BASELINE # [2024-03-27 03:32:06,280][__main__][INFO]### MACRO F1 ### # [2024-03-27 03:32:06,280][__main__][INFO] Sent: 66.71 # [202...
Python
1
ntoIterator for &'a mut Matrix { type Item = &'a mut [String]; type IntoIter = self::iter::RowIterMut<'a>; fn into_iter(self) -> Self::IntoIter { Self::IntoIter::new(self) } } impl IntoIterator for Matrix { type Item = Vec<String>; type IntoIter = std::vec::IntoIter<Vec<String>>; ...
Rust
0
) { download_trie( client, url, engine_state, genesis_block.header.state_root_hash, ) .await?; } Ok(()) } pub mod offline { use super::*; pub fn get_lowest_block_downloaded( chain_download_path: impl AsRef<Path>, ) ...
Rust
0
::{ docker_compose::DockerComposeReport, dockerfile::DockerfileReport, UpdateLevel, }; use uptag::tag_fetcher::{DockerHubTagFetcher, TagFetcher}; use uptag::version::extractor::VersionExtractor; use uptag::FindUpdateError; /// Check Docker image tags for updates. #[derive(Debug, StructOpt)] #[structopt(after_help ...
Rust
0
differences less than 8000h are /// saturated to 8000h. /// /// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#text=_mm_hsubs_epi16) #[inline] #[target_feature(enable = "ssse3")] #[cfg_attr(test, assert_instr(phsubsw))] #[stable(feature = "simd_x86", since = "1.27.0")] pub unsafe...
Rust
0
_ => return_error!("mask element type is `{}`, expected `i_`", m_elem_ty), } // truncate the mask to a vector of i1s let i1 = bx.type_i1(); let i1xn = bx.type_vector(i1, m_len as u64); let m_i1s = bx.trunc(args[0].immediate(), i1xn); return Ok(bx.select(m_i1s, args[1].imm...
Rust
0
a { writes.push( memflow_daemon::memflow_rpc::WritePhysicalMemoryEntryRequest { addr: write.0.as_u64(), data: write.1.into(), }, ); } let request = memflow_daemon::memflow_rpc::WritePhysicalMemoryRequest { ...
Rust
0
test function for more information about the definition of the statistic and meaning of the confidence interval. Attributes ---------- statistic : float or array The t-statistic of the sample. pvalue : float or array The p-value associated with the given alternative. df : float or array The number of degre...
Python
1
import pandas as pd import matplotlib.pyplot as plt # Function to load and process data def load_data(file): df = pd.read_csv(file, sep=';') df['Timestamp'] = pd.to_datetime(df[['YEAR', 'MONTH', 'DAY', 'HOUR', 'MINUTE', 'SECOND']]) df = df.sort_values('Timestamp') return df # Load data df_level = load...
Python
1
Key::Checklist, ManifestKey::Class, ManifestKey::Collectible, ManifestKey::DamageType, ManifestKey::Destination, ManifestKey::EnergyType, ManifestKey::EquipmentSlot, ManifestKey::Faction, ManifestKey::Gender, // TODO: this one appears to not use h...
Rust
0
::{ arenas::{AllocMethods, Arenas}, utils::PrintDurationOnDrop, }; #[cfg(test)] pub(crate) fn derive_stable_abi_from_str(s: &str) -> Result<TokenStream2,syn::Error> { syn::parse_str(s) .and_then(stable_abi::derive) } #[cfg(test)] pub(crate) fn derive_sabi_trait_str(item: &str) -> Result<TokenStre...
Rust
0
from django.http import JsonResponse from .models import Payment from .tasks import process_payment def initiate_payment(request): payment = Payment.objects.create(amount=100.00) # Example amount process_payment.delay(payment.id) # Run task in background return JsonResponse({"message": "Payment initiated...
Python
1
":"registry-testing.svc.lan/busybox"},"image":{"docker-manifest-digest":"sha256:f3cfc9d0dbf931d3db4685ec659b7ac68e2a578219da4aae65427886e649b06b"},"type":"cosign container image signature"},"optional":null}"#; let outcome = verify_signature(&verification_key, &signature, &msg.as_bytes()); assert!(outco...
Rust
0
def execute(self, hw_response: bytes) -> bytes: """Interprets the client command requested by the hardware wallet, returning the appropriet response and updating the client interpreter's internal state if appropriate. Parameters ---------- hw_response : bytes T...
Python
1
score_list = [] ipt_score_dic = {} for n in self.exp_avg_ipt: #print(f"name is {n}") #ipt_name_list.append(n) if metric == "ipt": # Combine the senstivity and uncertainty ipt_score = self.exp_avg_ipt[n] * self.exp_avg_unc[n] ...
Python
1
Template::render("errors/oauth/500", ()) } <filename>src/metrics/non_public.rs use super::media::MediaPlaybackMetrics; use serde::Deserialize; /// Non-public metrics are metrics’ totals that are not available for anyone to view on Twitter, such as number of impressions and video view quartiles. /// /// This requir...
Rust
0
friends = ["Apple", "Orange", 5, 345.06, False, "Aakash", "Rohan"] print(friends) friends.append("Aakarshit") print(friends) l1 = [1, 34,62, 2, 6, 11] # l1.sort() # l1.reverse() # l1.insert(2, 333333) # Insert 333333 such that its index in the list # is 3 value = l1.pop(3) print(value) print(l1)
Python
1
/ niceSpacing) * niceSpacing + 1 else: niceVal = math.floor(dVal / niceSpacing) * niceSpacing if unit == DtUnit.YEARS and niceVal <= dt.MINYEAR: niceVal = max(1, niceSpacing) _logger.debug(f"StartValue: dVal = {dVal}, niceVal: {niceVal} ({unit.name})") startDate = roundToElement(dMin,...
Python
1