text
string
label_name
string
labels
int64
(); cred_def.rotate_rev_reg(&revocation_details).unwrap(); } fn publish_revocation(institution: &mut Faber, rev_reg_id: String) { institution.activate().unwrap(); libindy::utils::anoncreds::publish_local_revocations(rev_reg_id.as_str()).unwrap(); } fn _create_address_schema() -...
Rust
0
with(args: Self::Parameters) -> Self::Strategy { ( 0_u8..9, any::<SType>(), option::of( any_with::<Expr>(ArbExprParams { tpe: SType::SColl(SType::SBoolean.into()), depth: args, ...
Rust
0
"""Funciones de manejo de archivos de texto.""" import os from pathlib import Path from typing import Union PathLike = Union[str, os.PathLike[str]] def _resolver_ruta(ruta: PathLike) -> Path: """Normaliza ``ruta`` dentro de un directorio permitido. Se utiliza ``COBRA_IO_BASE_DIR`` como directorio base si e...
Python
1
t, default='0.90', help="set global_model_Xb rate") parser.add_argument('--cifar10_rate_Xa', type=float, default='0.90', help="set global_model_Xa rate") parser.add_argument('--cifar10_rate_Xb', type=float, default='0.90', help="set global_model_Xb rate") args = parser.parse_args() # device de...
Python
1
de that uses the value in the Some variant. /// // `return` inside the "closure" returns from the function where this macro is called. /// option::and_then!(Some(3), |x| Some(x * 3)), /// option::and_then!(Some(3), |_| None), /// option::and_then!(None::<u32>, |_| loop{}), /// /// // You can also pa...
Rust
0
rted(); lm2 = combine(lm1, lm1_inv); lm3 = combine(lm1_inv, lm1); // Apply to a vector the resulting transformations. v2 = v1.mapped_by(lm2); v3 = v1.mapped_by(lm3); // Check that the resulting vectors are (almost) unchanged. EQUAL(x, v2.x()) EQUAL(y, v2.y()) EQUAL(z, v2.z()) ...
Rust
0
use_tqdm=True) # Make sure `auto` backend handling doesn't mess up sampling_params # and that we can reuse it without error. outputs.extend( llm.generate(prompts=prompts, sampling_params=sampling_params, use_tqdm=True)) assert outpu...
Python
1
from typing import List, Optional import pytest import torch.cuda from lettuce import Context, Simulation from lettuce.ext import NoCollision, BounceBackBoundary from tests.conftest import DummyFlow class MyBounceBackBoundary(BounceBackBoundary): def make_no_collision_mask(self, shape: List[int], context: 'Cont...
Python
1
ros_like(x).uniform_(-rand_minmax, rand_minmax) else: eta = torch.zeros_like(x) # Clip eta eta = clip_eta(eta, norm, eps) adv_x = x + eta if clip_min is not None or clip_max is not None: adv_x = torch.clamp(adv_x, clip_min, clip_max) if y is None: _, y = torch.max(mode...
Python
1
8, GpioHHead, GpioH8; Exti8, GpioIHead, GpioI8; ); #[cfg(any( stm32_mcu = "stm32f405", stm32_mcu = "stm32f407", stm32_mcu = "stm32f427", stm32_mcu = "stm32f429", stm32_mcu = "stm32f469", ))] exti_line!( Exti8, GpioJHead, GpioJ8; Exti8, GpioKHead, GpioK8; ); impl crate::ExtiMap for Exti9...
Rust
0
} ColumnType::Boolean => { match value { JsonValue::Boolean(v) => Ok(TableValue::Boolean(v)), JsonValue::Null => Ok(Tab...
Rust
0
请求""" command = get_command(command_id=command_id) if not command: return redirect('/admin/commands') request_forms = parse_utf8(request) name = ensure_utf8(request_forms.get('name')) description = ensure_utf8(request_forms.get('description')) trigger = ensur...
Python
1
import FWCore.ParameterSet.Config as cms from PhysicsTools.Utilities.pileupFilter_cfi import * pileupFilter.pileupInfoSummaryInputTag = cms.InputTag("addPileupInfo") pu20to25 = pileupFilter.clone() pu20to25.minPU = cms.double(20) pu20to25.maxPU = cms.double(25) pu25to30 = pileupFilter.clone() pu25to30.minPU = cms.d...
Python
1
@property def task_map(self): """Returns a dictionary mapping segment task to corresponding predictor and validator classes.""" return {'segment': {'predictor': FastSAMPredictor, 'validator': FastSAMValidator}}
Python
1
s_integer() @pytest.mark.parametrize( "code", np.typecodes["Float"] + np.typecodes["AllInteger"] ) def test_true(self, code: str) -> None: float_array = np.arange(-5, 5).astype(code) for value in float_array: assert value.is_integer() @pytest.mark.parametrize("code"...
Python
1
#!/usr/bin/env python # encoding: utf-8 ''' @author: Jiaxiang Shang @license: (C) Copyright 2013-2017, Node Supply Chain Manager Corporation Limited. @contact: jiaxiang.shang@gmail.com @time: 3/16/20 1:28 PM @desc: ''' import tensorflow as tf def mm_covisible_tri(h_lrgp, tri_ids_tar, tri_ids_src): batch_size = h_l...
Python
1
}; // https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecuteexw let success = unsafe { ShellExecuteExW(&mut sei) }; if success == 0 { let gle = unsafe { GetLastError() }; ...
Rust
0
from selenium.webdriver.common.by import By class CheckoutPage: FIRST_NAME_INPUT = (By.ID, "first-name") LAST_NAME_INPUT = (By.ID, "last-name") ZIP_CODE_INPUT = (By.ID, "postal-code") CONTINUE_BUTTON = (By.ID, "continue") FINISH_BUTTON = (By.ID, "finish") def __init__(self, driver): se...
Python
1
org/licenses/MIT>, at your option. This file may not be // copied, modified, or distributed except according to those terms. use arch::x86_64::mm::paging::{BasePageSize, PageSize}; use collections::Node; use mm; use mm::freelist::{FreeList, FreeListEntry}; use synch::spinlock::*; static KERNEL_FREE_LIST: SpinlockIrqS...
Rust
0
mask = 1 << bit_index; byte & mask == mask } #[inline] pub fn set_bit(&mut self, index: usize, val: bool) { debug_assert!(index / 8 < self.storage.as_ref().len()); let byte_index = index / 8; let byte = &mut self.storage.as_mut()[byte_index]; let bit_index = if cfg!(t...
Rust
0
同的列 # logger.warning(f'相同值特征: {constant_features}') # ['alpha019', 'alpha027', 'alpha039'] # x = x.loc[:, x.nunique() > 1] raw_df = raw_df.replace([np.inf, -np.inf, np.nan], 1) # 特征选择 categorical_features = [] numeric_features = list(set(features)-set(categorical_features)) raw_df[numeric_f...
Python
1
to_bits().get(); ColliderHandle::from_raw_parts(bits as u32, (bits >> 32) as u32) } } impl IntoEntity for ColliderHandle { #[inline] fn entity(self) -> Entity { self.0.entity() } } impl IntoHandle<JointHandle> for Entity { #[inline] fn handle(self) -> JointHandle { let ...
Rust
0
or::Disconnected.into()), } } } }) } async fn log_hashrate(hashes_tried: Arc<AtomicU64>) { let mut ticker = tokio::time::interval(LOG_RATE); ticker.set_missed_tick_behavior(MissedTickBehavior::Delay); let mut last_instant = ticker....
Rust
0
codebook_size] # 最近邻量化:选择距离最小的index predicted_indices = distances.argmin(dim=-1) # [batch_size, seq_length] return predicted_indices @torch.no_grad() def log_images(self, x: torch.Tensor): log = dict() batch_size = x.shape[0] if batch_size > 4: b...
Python
1
""" Created on Sun Oct 8 15:09:42 2023 @author: Administrator """ import numpy as np from osgeo import gdal import matplotlib.pyplot as plt # 以下为三种拉伸方式,如果不拉伸,图像太黑,拉伸完显示的图像更好看 def optimized_linear(arr): a, b = np.percentile(arr, (2.5, 99)) c = a - 0.1 * (b - a) d = b + 0.5 * (b - a) arr = (arr - c) ...
Python
1
class Solution(object): def setZeroes(self, matrix): m,n=len(matrix),len(matrix[0]) row,col=(),() row,col=set(row),set(col) for i in range(m): for j in range(n): if matrix[i][j]==0: row.add(i) ...
Python
1
, &head, batch)?; // Add the validated block to the db. // Note we do this in the outer batch, not the child batch from the extension // as we only commit the child batch if the extension increases total work. // We want to save the block to the db regardless. add_block(b, batch)?; // If we have no "tail" then ...
Rust
0
('鯎', "chéng"), ('鯏', "lí"), ('鯐', "zǒu"), ('鯑', "xī"), ('鯒', "yǒng"), ('鯓', "shēn"), ('鯔', "zī"), ('鯕', "qí"), ('鯖', "zhēng,qīng"), ('鯗', "xiǎng"), ('鯘', "něi"), ('鯙', "chún"), ('鯚', "jì"), ('鯛', "diāo"), ('鯜', "qiè"), ('鯝', "gù"), ('鯞', "zhǒu"), ('...
Rust
0
self, query: str, search_settings: Optional[dict | SearchSettings] = None, ) -> WrappedVectorSearchResponse: """Conduct a vector and/or graph search. Args: query (str): The query to search for. search_settings (Optional[dict, SearchSettings]]): Vector searc...
Python
1
# ---------------------------------------------------------------------------- # Authors: Bill Tatsis, Matt Seddon, Dan Mason, and Dan O'Donovan # Company: Healx # Date: August 17, 2023 # # Description: This script generates 3D conformers for a given Mol. # --------------------------------------------------------------...
Python
1
generate VK let auth_vec: AuthAddrs = load_state(&mut deps.storage, PERMITTED_VK)?; check_auth(deps, &env, &auth_vec)?; // Generated VK let config: PrngSeed = load_state(&mut deps.storage, PRNG_KEY)?; // changed this from CONFIG_KEY let prng_seed = config.prng_seed; let key = ViewingKey::ne...
Rust
0
e the session /// will select the first one that is compatible with the server's signature /// verification capabilities. Clients that want to support both ECDSA and /// RSA certificates will want the ECSDA to go first in the list. /// /// The built configuration will keep a reference to all certifi...
Rust
0
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved. # Copyright (c) 2021 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:...
Python
1
pub static mut match_: ::std::os::raw::c_int; } extern "C" { #[link_name = "mod"] pub static mut mod_: ::std::os::raw::c_int; } extern "C" { #[link_name = "move"] pub static mut move_: ::std::os::raw::c_int; } extern "C" { #[link_name = "mut"] pub static mut mut_: ::std::os::raw::c_int; } ex...
Rust
0
import os MyPC = os.path.basename(__file__) != "Main.py" if MyPC: from icecream import ic ic.disable() else: def ic(*args): return None ic.enable() if MyPC else None def main(): n = int(input()) # 5000固定 grid_list = [[0]*20 for _ in range(20)] # 座標を20*20で分割 # サバの座標を追加 for _ in range(n): x,...
Python
1
parse ' '@message \'\\"localPortDetails\\":{\\"port\\":*,\' as local_port | filter source = \'aws.guardduty\' or ' 'strlen(local_port) > 0 | filter (local_port = \'22\')", "startTime": 1569919390, "endTime": 1572432190}', '{"logType": "vpcflow", "limit": 10000, "queryString": "field...
Python
1
test_suite.test_feature_storage() test_suite.test_decision_engine() test_suite.test_feast_serving() # 3. 端到端工作流测试 test_suite.test_end_to_end_workflow() # 4. 生成报告 success = test_suite.generate_test_report() return success ...
Python
1
.Namespace, Whitespace), 'import'), (r'"(\\\\|\\[^\\]|[^"\\])*"', String.Double), (r"'(\\\\|\\[^\\]|[^'\\])*'", String.Single), (r'[a-zA-Z_]\w*:', Name.Label), (r'[a-zA-Z_$]\w*', Name), (r'[~^*!%&\[\](){}<>\|+=:;,./?-]', Operator), (r'[0-9][0-9]*\....
Python
1
_number ), YACCEntry::QUAD { sb_addr } => sb_addr == requested_sb_addr, YACCEntry::INVALID => false } { return Some(i); } } return None; } /// Returns the compressed size of a line. pub fn compress_bytes...
Rust
0
ency. /// /// ``` /// let hyperbusconfig = hyperbusconfig.read_write_recovery(4); /// ``` pub fn read_write_recovery(mut self, read_write_recovery: u8) -> Self { self.read_write_recovery = read_write_recovery; self } /// Initial access time t_ACC in clock cycles /// ...
Rust
0
to_u256!(pool_extend.acc_reward_per_share)) .ok_or(ArithmeticError::Overflow)? .checked_div(to_u256!(1e12 as u64)) .ok_or(ArithmeticError::Overflow)? .checked_sub(to_u256!(participant_extend.reward_debt)) .ok_or(ArithmeticError::Overflow)?)?; let module_account_id = Self::account_id(); if pe...
Rust
0
from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from agent.agentic_workflow import GraphBuilder from utils.save_to_document import save_document from starlette.responses import JSONResponse import os import datetime from dotenv import load_dotenv from pydantic import BaseModel load_dotenv...
Python
1
recorder_option_mutex_guard.deref_mut(); write_to_recorder_option!(recorder_option, $variable, $label, subtract_time_start); drop(recorder_option_mutex_guard); } }; } /* NOTE: Any functions that use this macro will need use std::time::{Instant, SystemTime, UNIX_EPOCH}; use thread_...
Rust
0
s (default -1, CPU) Returns: Id of the rank that joined last. """ output = torch.tensor(-1, dtype=torch.int, device=torch.device("cpu")) try: handle = mpi_lib.horovod_torch_join(output, device) except RuntimeError as e: raise HorovodInternalError(e) _handle_map[handle] ...
Python
1
self.video_thread = VideoThread.VideoThread(self.view_grayscale, self.view_rgb, hs_video, rgb_video, self.get_fps_from_lineedit(), self.signal_frame_changed) self.video_thread.start() def stop_play(self): self.video_thread.invert_pause() def update_channel(self): self.update_label()...
Python
1
v; Self { origin: look_from, horizontal: horizontal, vertical: vertical, lower_left_corner: look_from - horizontal / 2.0 - vertical / 2.0 - focus_dist * w, u: u, v: v, lens_radius: apreture / 2.0, time0: time0, ...
Rust
0
.synchronous(SqliteSynchronous::Off) .connect() .await?; let mut me = Self { conn }; me.create_tables().await?; Ok(me) } async fn create_tables(&mut self) -> RepoResult<()> { sqlx::query(r#" CREATE TABLE IF NOT EXISTS "repo_album" ( "album_id" BLO...
Rust
0
d776ab195a6feb1827980eb00abb0f75ea609" )); xts.decrypt_area(&mut buffer, 0x1000, 0, get_tweak_openssl); let reference = fs::read("test_files/random_with_remainder").expect("could not read reference"); assert_eq!(&buffer[..], &reference[..]); } // Copyright 2016 The Rust Project Developers. See the COP...
Rust
0
ask: EventMask) { return self.pipe.queue.EventRegister(task, e, mask); } fn EventUnregister(&self, task: &Task, e: &WaitEntry) { return self.pipe.queue.EventUnregister(task, e); } } impl SockOperations for Writer {} <reponame>jacobrosenthal/drv2605l-rs #![no_std] mod registers; use embedd...
Rust
0
fn parse(input: &str) -> Result<[RefCell<Moon>; MOON_COUNT], String> { let mut iter = input .trim() .split('\n') .map(|line| line.parse().map(|m| RefCell::new(m))); Ok([ iter.next() .ok_or_else(|| "Missing expected line.".to_string())??, iter.next() ...
Rust
0
from os import getenv from uvicorn.workers import UvicornWorker class Worker(UvicornWorker): CONFIG_KWARGS = { "proxy_headers": True, "forwarded_allow_ips": "*", "root_path": getenv("ROOT_PATH", ""), } def __init__(self, *args, **kwargs): self._set_proxy_headers = kwargs....
Python
1
from fastapi import APIRouter, HTTPException, Body from typing import List from models.reviews import Review from controllers.reviews import ( get_review_by_id, get_reviews_by_cart_id, get_all_reviews, create_review, update_review, delete_review ) router = APIRouter() @router.get("/reviews", r...
Python
1
gRange<i32>] { fn type_info() -> PgTypeInfo { PgTypeInfo::INT4_RANGE_ARRAY } } impl Type<Postgres> for [PgRange<i64>] { fn type_info() -> PgTypeInfo { PgTypeInfo::INT8_RANGE_ARRAY } } #[cfg(feature = "bigdecimal")] impl Type<Postgres> for [PgRange<bigdecimal::BigDecimal>] { fn type...
Rust
0
ge_num + 1, "Field Name": widget.field_name, "Original Text": ent.text, "Label": ent.label_, "Redacted": False }) widget.field_value = redacted_value widget.update() # Save and close PDF output_path = "reda...
Python
1
); } { let formula: FOF = "P(x) | (Q(x) | (R(y) & R(z)))".parse().unwrap(); assert_debug_string!( "((P(x) | Q(x)) | R(y)) & ((P(x) | Q(x)) | R(z))", cnf(&formula), ); } { let formula: FOF = "(P(x1) & P(x2)) |...
Rust
0
pcPayload within a RPC message. pub type RpcPayload<'a> = &'a [u8]; #[derive(Clone, Debug, Eq, PartialEq)] #[allow(clippy::len_without_is_empty)] /// Represents the SdPayload within a SD message. pub struct SdPayload { /// Flags pub flags: SdFlags, /// Entries pub entries: Vec<SdEntry>, /// Options...
Rust
0
# Copyright 2025 The Levanter Authors # SPDX-License-Identifier: Apache-2.0 import equinox as eqx import jax.numpy as jnp from jaxtyping import PRNGKeyArray import haliax as hax import haliax.nn as hnn from haliax import AxisSelector, NamedArray __all__ = ["Sampler"] class Sampler(eqx.Module): """Simple temper...
Python
1
# -*- coding: utf-8 -*- """ Created on Aug. 31st 2018 """ from __future__ import (absolute_import, division, print_function, unicode_literals) import pytest import numpy as np import pandas as pd import pygeopressure as ppp from pygeopressure.basic import Path def test__well_storage(tmpdir, p...
Python
1
# Copyright 2013 Donald Stufft and individual contributors # # 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 applicable law...
Python
1
i + byte_shift) % 16; let wrap_index_b = (i + byte_shift + 1) % 16; // note: the right shift would be UB for bit_shift = 0. // good thing is that the values we will use for rot won't cause this *o = (a[wrap_index_a] << bit_shift) | (a[wrap_index_b] >> (8 - bit_shift)); } out } f...
Rust
0
_led_index_t = uint32_t; #[repr(C)]#[derive(Copy, Clone)] pub struct wlr_keyboard_modifiers { pub depressed: xkb_mod_mask_t, pub latched: xkb_mod_mask_t, pub locked: xkb_mod_mask_t, pub group: xkb_mod_mask_t, } #[repr(C)]#[derive(Copy, Clone)] pub struct wlr_keyboard { pub impl_0: *const crate::sr...
Rust
0
fg(feature = "mkl")] use crate::ops::mkl_ffi::*; use crate::same_type; use crate::tensor::Tensor; use crate::Float; use crate::NdArrayView; use crate::{op, NdArrayViewMut}; use ndarray; #[cfg(feature = "mkl")] use ndarray::Dimension; use ndarray::{ArrayView2, ArrayViewMut2}; #[cfg(feature = "mkl")] use std::cmp; #[cfg(...
Rust
0
} <reponame>mastapegs/ji-cloud<gh_stars>1-10 use crate::base::state::Base; use std::rc::Rc; // pub const DEFAULT_SELECT_AMOUNT: usize = 3; pub struct State { pub base: Rc<Base>, } impl State { pub fn new(base: Rc<Base>) -> Self { /* let some_amount = RefCell::new( match base.play...
Rust
0
# Demonstrates fewer variables x = float(input("What's x? ")) y = float(input("What's y? ")) print(round(x + y))
Python
1
okens def interactive_mode(model, tokenizer): """Interactive text generation loop""" print(f"\n🎭 Interactive Shakespeare Generation Mode") print(f"{'='*60}") print(f"💡 Try prompts like:") print(f" - 'HAMLET:'") print(f" - 'First Citizen:'") print(f" - 'To be or'") print(f" - ...
Python
1
tegories).intersection(set(categories)) # if region == "bathroom": # print("Region: {}, Intersection: {}".format(region, intersection)) # print("Categories in NaN: {}".format(set(all_categories).intersection(set(categories_by_region["NaN"])))) # print("Regions: {}".format(se...
Python
1
ormal>(); proof.verify(&key1, &other_base, &key2) .expect("Failed to verify secp dleq proof"); } use raw::{Local, Isolate}; extern "system" { #[link_name = "NeonSys_Primitive_Undefined"] pub fn undefined(out: &mut Local); #[link_name = "NeonSys_Primitive_Null"] pub fn null(out: &mut Local); ...
Rust
0
[discord](https://discord.com)', '[riotgames](https://riotgames.com)', '[youtube](https://youtube.com)', '[instagram](https://instagram.com)', '[tiktok](https://tiktok.com)', '[twitter](https://twitter.com)', '[facebook](https://facebook.com)', '[epicgames](https://epicgames.com)', '[spotify](https://spotify.com)', '[y...
Python
1
frame --- let _sawPlaywrightActivity = false; window.addEventListener('message', function(ev){ try { const d = ev && ev.data; if (!_sawPlaywrightActivity && d && d.type === 'mcp_playwright_activity') { _sawPlaywrightActivity = true; openPlaywrightTab(); } } catch(_e) {} }...
Python
1
import os import numpy as np import pybop # Get the current directory location and convert to absolute path current_dir = os.path.dirname(os.path.abspath(__file__)) dataset_path = os.path.join( current_dir, "../../data/synthetic/dfn_charge_discharge_75.csv" ) # Define model parameter_set = pybop.ParameterSet("C...
Python
1
ode supported."] NV_ENC_CAPS_SUPPORT_MONOCHROME = 3, #[doc = " Indicates HW support for FMO."] #[doc = " \\n 0 : FMO not supported."] #[doc = " \\n 1 : FMO supported."] NV_ENC_CAPS_SUPPORT_FMO = 4, #[doc = " Indicates HW capability for Quarter pel motion estimation."] #[doc = " \\n 0 : Quart...
Rust
0
the same recognizer name in the account/ AWS Region.</p> /// - [`data_access_role_arn(impl Into<String>)`](crate::client::fluent_builders::CreateEntityRecognizer::data_access_role_arn) / [`set_data_access_role_arn(Option<String>)`](crate::client::fluent_builders::CreateEntityRecognizer::set_data_access_role_arn)...
Rust
0
println!("Please specify the python script"); return; } let py_script_path = args[1]; let py_script = fs::read(py_script_path).unwrap(); let request = base64::encode(&py_script); let mesatee = Mesatee::new(&info, USER_ID, USER_TOKEN, *TMS_ADDR, *TDFS_ADDR).unwrap(); let task = mesatee.c...
Rust
0
) -> Iter<ConstraintVariant> { self.constraints.iter() } } struct CapacitySoftRouteConstraint<T: Load + Add<Output = T> + Sub<Output = T> + 'static> { multi_trip: Arc<dyn MultiTrip<T> + Send + Sync>, } impl<T: Load + Add<Output = T> + Sub<Output = T> + 'static> SoftRouteConstraint for CapacitySoftRout...
Rust
0
#[inline(always)] pub fn variant(&self) -> FILTERCGF_CLKDIV_A { match self.bits { 0 => FILTERCGF_CLKDIV_A::FILTER_1CLK_PERIOD, 1 => FILTERCGF_CLKDIV_A::FILTER_2CLK_PERIOD, 2 => FILTERCGF_CLKDIV_A::FILTER_4CLK_PERIOD, 3 => FILTERCGF_CLKDIV_A::FILTER_8CLK_PERIOD...
Rust
0
import torch.nn as nn from typing import Sequence import dreams.utils.misc as utils class FeedForward(nn.Module): def __init__(self, in_dim, out_dim, hidden_dim, depth=None, act_last=True, act=nn.ReLU, bias=True, dropout=0): super().__init__() if isinstance(hidden_dim, int): assert d...
Python
1
s: PDOT11_AUTH_CIPHER_PAIR, uInfraNumSupportedMcastAlgoPairs: ULONG, pInfraSupportedMcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, uAdhocNumSupportedUcastAlgoPairs: ULONG, pAdhocSupportedUcastAlgoPairs: PDOT11_AUTH_CIPHER_PAIR, uAdhocNumSupportedMcastAlgoPairs: ULONG, pAdhocSupportedMcastAlgoPairs: PD...
Rust
0
_weights, bbox_targets, bbox_weights, pos_inds, neg_inds) def anchor_inside_flags(flat_anchors, valid_flags, img_shape, allowed_border=0): img_h, img_w = img_shape[:2] if allowed_border >= 0: inside_flags = valid_flags ...
Python
1
rspective(1.0, std::f32::consts::FRAC_PI_3, 0.1), transform, )); } /// Adds lights to the scene. fn initialize_lights(world: &mut World) { let light: Light = PointLight { intensity: 100.0, radius: 1.0, color: Srgb::new(1.0, 1.0, 1.0), ..Default::default() } .into...
Rust
0
Accumulate IoUs per class for c in range(num_classes): ious_per_class[c].append(ious[c]) total_images += 1 if total_images == 0: print("No valid image pairs processed.") return # Compute mean IoU per class mean_ious = [] for c in range(num_classes): ...
Python
1
root.tags.append(nbt.TAG_Byte(name='Y', value=self.y)) palette = self.palette() nbt_pal = nbt.TAG_List(name='Palette', type=nbt.TAG_Compound) for block in palette: tag = nbt.TAG_Compound() tag.tags.append(nbt.TAG_String(name='Name', value=block.name())) i...
Python
1
r_byte, 0, "must see 0"); }, env! { u8 => 0u8, } ); assert!(Env::get::<u8>().is_none()); } #[test] fn adding_to_and_removing_from_env() { assert!( Env::get::<u8>().is_none(), "test Env must not already have ...
Rust
0
# Copyright (c) 2019-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. # def f_gold ( n , k ) : dp = [ [ [ 0 , 0 ] for __ in range ( k + 1 ) ] for _ in range ( n + 1 ) ] dp [ 1 ] [ 0 ] [ 0 ] = ...
Python
1
null); let size = std::mem::size_of::<T>(); let result = sys::io_uring_enter( self.fd.as_raw_fd(), to_submit, min_complete, flag, arg, size, ); if result >= 0 { Ok(result as _) } else if result ==...
Rust
0
{"field": "meta.chapter", "operator": "==", "value": "intro"}, ], } where_clause, params = _convert_filters_to_where_clause_and_params(filters) assert where_clause == SQL(" WHERE ") + SQL("((meta->>'number')::integer = %s AND meta->>'chapter' = %s)") assert params == (100, "intro") de...
Python
1
min_value<D: Datum + tract_core::num_traits::Bounded>() -> Tensor { tensor0(D::min_value()) } let fact = target.outlet_fact(mapping[&node.inputs[0]])?; let min = dispatch_numbers!(min_value(fact.datum_type)()); let (wire, pool_spec) = pulsify(&op.pool_spec, source, node, target, mapping, Some(mi...
Rust
0
# the additional byte gets added to the length token_len = token_len + vlb dprint(f" token {xb(mask)}: {token_len} at -{offset}") #TODO: can we use this to validate "good" vs. bad offsets? if offset > len(window): raise Ind...
Python
1
togram")] pub use histogram::Histogram; #[cfg(feature = "line_series")] pub use line_series::LineSeries; #[cfg(feature = "point_series")] pub use point_series::PointSeries; #[cfg(feature = "surface_series")] pub use surface::SurfaceSeries; <filename>src/tools/clippy/tests/ui/atomic_ordering_uint.rs #![warn(clippy::inva...
Rust
0
(), 20) # ignores cumulative assert_equal(segment.end_late(), 30) # ignores cumulative def test_finalise_back_front_merge_same_thing(): """ Tests that finalising either the front or the back and then merging on the appropriate side results in segments with the same duration and time warp attribu...
Python
1
from tkinter import * from tkinter import ttk #import random root = Tk() root.title("Creation de Comptre") root.geometry("700x500") account_type_var = StringVar() account_type_var.set("courant Epargne") def desactive(): #Obtenez la valeur du bouton radio sélectionné account_type = account_type_var.get...
Python
1
, ()>>, } pub struct SpinlockIrqSaveContainer<'a> { lock: SpinlockIrqSave<()>, guard: Option<SpinlockIrqSaveGuard<'a, ()>>, } fn __sys_spinlock_init(lock: *mut *mut SpinlockContainer) -> i32 { if lock.is_null() { return -EINVAL; } let boxed_container = Box::new(SpinlockContainer { lock: Spinlock::new(()), ...
Rust
0
ry_get_value!("addslashes", "value", String, value); Ok(to_value(&s.replace("\\", "\\\\").replace("\"", "\\\"").replace("\'", "\\\'")).unwrap()) } /// Transform a string into a slug pub fn slugify(value: &Value, _: &HashMap<String, Value>) -> Result<Value> { let s = try_get_value!("slugify", "value", String, v...
Rust
0
orter<T> for StdSorter { fn sort(&self, slice: &mut [T]) where T: Ord, { slice.sort(); } } pub struct StdUnstableSorter; impl<T> Sorter<T> for StdUnstableSorter { fn sort(&self, slice: &mut [T]) where T: Ord, { slice.sort_unstable(); } } #[cfg(test)] mod...
Rust
0
mF17: c_int = iup_XkeyAlt(K_F17 ); pub const K_mF18: c_int = iup_XkeyAlt(K_F18 ); pub const K_mF19: c_int = iup_XkeyAlt(K_F19 ); pub const K_mF20: c_int = iup_XkeyAlt(K_F20 ); pub const K_mPrint: c_int = iup_XkeyAlt(K_Print ); pub const K_mMenu: c_int = iup_XkeyAlt(K_Menu ...
Rust
0
arr } fn pk_to_arr(s: &str)-> [u8; PK_SIZE]{ let mut arr = [0u8; PK_SIZE]; arr.copy_from_slice(&hex::decode(s).unwrap()[..]); arr } } /* * Copyright (c) 2021 The Sanctuary Authors (0xPoo, Asylum) * * Licensed under the Apache License, Version 2.0 (the "License"); * you ma...
Rust
0
query_pid = pids[:num_query] query_camid = camids[:num_query] gallery_feat = feats[num_query:] gallery_pid = pids[num_query:] gallery_camid = camids[num_query:] distmat = euclidean_dist(query_feat, gallery_feat) cmc, mAP, _ = eval_func(...
Python
1
call_times: LinkedList::new() } } } #[cfg(test)] mod tests { use super::*; use std::{thread, time}; #[test] fn test_rate_limiter() { const LIMIT: u32 = 10; let mut limiter = RateLimiter::new(1, LIMIT); for _ in 0..LIMIT { assert_eq!(limiter.a...
Rust
0
"scanner_active": True, "last_scan": autonomous_scanner.last_scan_time.isoformat() if autonomous_scanner.last_scan_time else None, "scan_interval_minutes": autonomous_scanner.scan_interval_minutes, "min_confluence_score": autonomous_scanner.min_confluence_score, "status"...
Python
1
shadowed definitions. #[repr(C)] #[derive(Clone, Copy, Default, Eq, PartialEq)] pub struct sg_partial_path_edge_list { /// The handle of the first element in the edge list, or SG_LIST_EMPTY_HANDLE if the list is /// empty, or 0 if the list is null. pub cells: sg_partial_path_edge_list_cell_handle, pub d...
Rust
0
'HS') # 7,7,160 -> 7,7,960 x = conv_block(x, 960, (1, 1), strides=(1, 1), activation='HS') # 7,7,960 -> 1,1,960 x = GlobalAveragePooling2D()(x) x = Reshape((1, 1, 960))(x) # 1,1,960 -> 1,1,1280 x = Conv2D(1280, (1, 1), padding='same')(x) x = return_activation(x, 'HS') # 1,1,1280 -...
Python
1