text
string
label_name
string
labels
int64
def eval_rows_cols( self, image, r1: Integer, r2: Integer, c1: Integer, c2: Integer, evaluation ): "ImageTake[image_Image, {r1_Integer, r2_Integer}, {c1_Integer, c2_Integer}]" first_row = r1.value last_row = r2.value first_col = c1.value last_col = c2.value ...
Python
1
e serde::de::{Deserialize, Deserializer}; use serde::ser::{Serialize, SerializeMap, Serializer}; use crate::grid::*; impl Serialize for Grid { fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where S: Serializer, { let mut map = serializer.serialize_map(Some(3))?; m...
Rust
0
"""Tests whether gptq models with quantized lm_head can be loaded. Run `pytest tests/quantization/test_quant_lm_head_true.py --forked`. """ from typing import Tuple import pytest import torch from vllm.model_executor.layers.linear import UnquantizedLinearMethod from vllm.model_executor.layers.quantization.gptq impor...
Python
1
feature = "stm32l4x6", ))] use crate::stm32::{UART4}; #[cfg(any( feature = "stm32l4x5", feature = "stm32l4x6", ))] use crate::stm32::{UART5}; use crate::gpio::gpioa::{PA2, PA3, PA9, PA10}; use crate::gpio::gpiob::{PB6, PB7}; use crate::gpio::gpiod::{PD5, PD6}; use crate::gpio::{AF7, Alternate, Input, Floating...
Rust
0
xx, bw5sb56n_4t, li68rdi7ydu: a2l444j7j_1): return '' '# shade_tissue_densities -> carbons_automobiles_juries' from h_3mf265xaj import mcdgwo9w49l, lyykvnqpvaf as kndaxbp3opr, np7ikg8i3r1 as lon9e38i33z, qvvryh5x878, yg6iihqi_h2 as buow03gebb7, f52x_afbsy1, j1c4jr_rm2y as w9eohfa7f7_, z4yex02gsl3 del at...
Python
1
StorageError::BadBlock } _ => StorageError::Other(err), } } } impl Drop for DeviceFile { fn drop(&mut self) { if self.handle != null_mut() { if self.is_locked { unsafe { let mut returned: DWORD = 0; ...
Rust
0
data # directly via the ZipInfo object and rewrite the content # (which unfortunately requires decompression and # recompression rather than a direct copy) basezip.writestr(info, subzip.open(info.filename).read()) # Remove repacked zip os.remove(name) ...
Python
1
ve them. Turn the vec into a boxed // slice so we won't inadvertently reallocate the vec. let mut addresses = vec![mem::MaybeUninit::uninit(); num_messages] .into_boxed_slice(); let results: Vec<_> = iter.enumerate().map(|(i, d)| { let (msg_controllen, mhdr) = unsafe { pack_mhd...
Rust
0
ess"); web_cat.insert("Restaurants", "Restaurants"); web_cat.insert("QuestionableLegality", "QuestionableLegality"); web_cat.insert("SearchEngines", "SearchEngines"); web_cat.insert("SexEducation", "SexEducation"); web_cat.insert("SexualExpression", "SexualExpression"); web_cat.insert("Shopping"...
Rust
0
table()) .field("is_read_closed", &self.is_read_closed()) .field("is_write_closed", &self.is_write_closed()) .finish() } } //! Program instruction processor use solana_program::{ account_info::{next_account_info, AccountInfo}, entrypoint::ProgramResult, msg, pubk...
Rust
0
elf): """关闭外网流程Id :rtype: int """ return self._FlowId @FlowId.setter def FlowId(self, FlowId): self._FlowId = FlowId @property def RequestId(self): """唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。 :rtype: ...
Python
1
ctivation: {act['activation']:.2f})") print(f"\nProcessing time: {result['processing_time']:.3f} seconds") except KeyboardInterrupt: print("\nExiting...") break except Exception as e: logging.error(f"Er...
Python
1
""" `context` command test module """ from tests.base import RemoteGefUnitTestGeneric class ContextCommand(RemoteGefUnitTestGeneric): """`context` command test module""" cmd = "context" # TODO See https://github.com/hugsy/gef/projects/10 def test_duplicate_pane_name(self): # Make sure w...
Python
1
buckets[idx] += local; } self.sum += sum; self.count += count; } } #[cfg(test)] mod tests { use super::Histogram; #[test] fn test_histogram() { // No buckets, can't do shit. let histogram = Histogram::new(&[]); assert!(histogram.is_none()); let ...
Rust
0
service_account.Credentials.from_service_account_file(key_path) # configure embedding model embed_model = VertexTextEmbedding(model_name=self.MODEL_NAME,project=self.PROJECT_ID,location=self.REGION,credentials=credentials) # initialize the embeddings model Settings.embed_...
Python
1
> CliOpts { use std::env::args; let mut cmd_args_tmp = args().collect::<Vec<String>>(); cmd_args_tmp.remove(0); let mut inputs = Vec::new(); let mut output_file = None; let mut abort_on_binary = false; let mut it = cmd_args_tmp.iter(); let mut opt_t: Option<String> = None; while let ...
Rust
0
127.0.0.1:6379/") { //! Ok(mut client) => { //! println!("Created Redis Client"); //! //! match client.set("my_key", "my_value") { //! Err(error) => println!("Unable to set value in Redis: {}", error), //! _ => println!("Value set in Redis") //! ...
Rust
0
from swagger.swagger_config import configure_swagger from config import Config, db from flask import Flask from flask_cors import CORS from alunos.alunos_routes import alunos_blueprint from turma.turma_routes import turmas_blueprint from professor.professor_routes import professores_blueprint app = Flask(__name__) app...
Python
1
*"] pub const UIA_MenuModeEndEventId: i32 = 20019i32; #[doc = "*Required features: 'Win32_UI_Accessibility'*"] pub const UIA_MenuModeStartEventId: i32 = 20018i32; #[doc = "*Required features: 'Win32_UI_Accessibility'*"] pub const UIA_MenuOpenedEventId: i32 = 20003i32; #[doc = "*Required features: 'Win32_UI_Accessibilit...
Rust
0
ks. /// /// Note that whether this function returns an error or not discloses secret /// information. If an attacker can cause this function to run repeatedly and /// learn whether each instance returned an error then they can decrypt and /// forge signatures as if they had the private key. See /// `decrypt_session_key...
Rust
0
############################################################################### # # OpenEduCat Inc # Copyright (C) 2009-TODAY OpenEduCat Inc(<https://www.openeducat.org>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License a...
Python
1
uplink_command_rate: command_rate, uplink_open_delta: open_delta, uplink_close_delta: close_delta, }; (pulse, profile) } } impl Add<WarpUplinkProfile> for WarpLaneProfile { type Output = WarpLaneProfile; fn add(self, rhs: WarpUplinkProfile) -> Self::Ou...
Rust
0
x00\xa8\x19\x10\x07\x01\x12g\x0d-\x00R_Q\xcc\x8f\ \xfc\xa7N\x06\x8b\x85\x8b\xc1o\xfe\x1b[\x00\x84j\x07\ \xac\xafb_\xb6\xf98\x05\x00.\xbb\xe4\x1c\xbc\xe5\x1d\ \x04\x00\xf6U\x03\x00\xa4\x01{\x10#\x0f\x9f\x81\xec\xf8\ *8\xec\x02x\xa2\x01\x80\x19\xbc\xa6k\xc5S\xbd\x86\ \x0a\x90i\x07J\x8b1z\xef0\xbc5\xc3\xc8\x8e\xe7\ \x90Ne...
Python
1
s_limit: u64, } fn parse_withdraw_fee_rate( fee_config: &FeeConfig, raw_withdraw: &gw_types::packed::RawWithdrawalRequest, ) -> Result<L2Fee> { let fee = raw_withdraw.fee(); let sudt_id: u32 = fee.sudt_id().unpack(); let cycles_limit: u64 = fee_config.withdraw_cycles_limit; let fee_rate_weight ...
Rust
0
#!/usr/bin/env python3 import dnslib from modules.export import export R = '\033[31m' # red G = '\033[32m' # green C = '\033[36m' # cyan W = '\033[0m' # white Y = '\033[33m' # yellow def dnsrec(domain, output, data): result = {} print(f'\n{Y}[!] Starting DNS Enumeration...{W}\n') types = ['A', 'AAAA', 'ANY...
Python
1
ize=1000) Plot.histogram(values) # %% [markdown] slideshow={"slide_type": "slide"} # ## Where: # - Jupyter / IPython # - Colab # - Marimo # - Quarto # - Jupytext / VS Code Python Interactive Window # %% [markdown] slideshow={"slide_type": "slide"} # ## Learn more: # - colight-dev/colight # - Observable Plot (observa...
Python
1
from enum import Enum from bs4 import BeautifulSoup from langchain_core.messages import HumanMessage, SystemMessage from src.tiny_agent.models import NotesMode from src.tiny_agent.sub_agents.sub_agent import SubAgent class NotesAgent(SubAgent): async def __call__( self, name: str, conte...
Python
1
import os from logging import info from langchain.chains import LLMChain from langchain.chains.sequential import SequentialChain from langchain.prompts import ChatPromptTemplate from langchain_google_genai import ChatGoogleGenerativeAI from pydantic import SecretStr class SeqChain: def learn(self): llm ...
Python
1
current_layers = &mut self.links_layers[point_id]; for (level, other_links) in layers.into_iter().enumerate() { if current_layers.len() <= level { current_layers.push(other_links); } else { visited_list.next_iteration(); ...
Rust
0
doc = " Indicates Reference Picture Invalidation Support."] #[doc = " Support added from NvEncodeAPI version 2.0."] #[doc = " \\n 0 : Reference Picture Invalidation not supported."] #[doc = " \\n 1 : Reference Picture Invalidation supported."] pub const _NV_ENC_CAPS_NV_ENC_CAPS_SUPPORT_REF_PIC_INVALIDATION: _NV_ENC_CAP...
Rust
0
import json import frappe from frappe.model.utils.user_settings import sync_user_settings, update_user_settings def execute(): users = frappe.db.sql("select distinct(user) from `__UserSettings`", as_dict=True) for user in users: user_settings = frappe.db.sql( """ select * from `__UserSettings` wher...
Python
1
import json import pytest import aleph.toolkit.json as aleph_json def test_loads(): """ A (simplistic) load test, as a sanity check. """ expected = {"1": {"a": "b", "c": "d"}, "2": ["x", "y", "z"], "3": "world"} serialized_json = json.dumps(expected) actual = aleph_json.loads(serialized_js...
Python
1
# Imports import random from hangman_dependencies import movie_list from hangman_dependencies import hangman_pics, hangman_logo print(hangman_logo) # TODO - Randomly choose a movie from the movie_list and assign it to a variable named chosen_movie. Then print it. chosen_movie = random.choice(movie_list) # TODO - Cre...
Python
1
nitor_metric == 'mae' else val_f1 is_best = (monitor_value < best_metric) if args.monitor_metric == 'mae' else (monitor_value > best_metric) if is_best: best_metric = monitor_value try: # 保存最佳模型 best_model_path = os.path.join(args.output_d...
Python
1
ize, usize), (_, __1, _): (usize, usize, usize), (_, _, _): (usize, Token<'input>, usize), ) -> Statement { Statement::Empty(Loc(__0, __1)) } #[allow(unused_variables)] fn __action149< 'input, >( input: &'input str, (_, __0, _): (usize, Statement, usize), ) -> Statement { __0 } #[allow(unu...
Rust
0
Xyz<'a, V>, other: &'t Xyz<'a, V>) -> bool where V: PartialEq { this.v == other.v } fn main() {} <gh_stars>0 mod instances; mod mixer; mod sequences; mod streams; use self::mixer::Mixer; use super::AudioManagerSettings; use crate::{ command::Command, frame::Frame, group::groups::Groups, metronome::Metr...
Rust
0
else { let release = if let Some(version) = self.version { Release::new(&mut cfg, version) } else { Release::load(&mut cfg, blockchain.jormungandr_version_req()) } .map_err(Error::NoCompatibleRelease)?; if release.asset_need_f...
Rust
0
import streamlit as st import altair as alt import pandas as pd # Load data df = pd.read_csv("ola.csv") st.set_page_config(page_title="OLA Ride Booking Analysis", layout="wide") st.title("OLA Ride Booking Analysis") # Display Raw Data st.header("Raw Data") st.dataframe(df) # Booking Status Distribution st.header(...
Python
1
from __future__ import annotations from .base import MutableTelegramObject class InputMessageContent(MutableTelegramObject): """ This object represents the content of a message to be sent as a result of an inline query. Telegram clients currently support the following 5 types: - :class:`aiogram.types.i...
Python
1
mmarizationData": """Load the :class:`~flash.text.seq2seq.summarization.data.SummarizationData` from lists of input text snippets and corresponding lists of target text snippets. To learn how to customize the transforms applied for each stage, read our :ref:`customizing transforms guide...
Python
1
from liggghts import liggghts # Try loading in liggghts lmp = liggghts() # Try reading in an input file lmp.file("in.simpExample") # Try performing a command print("") print("Attempting to run simulation another 500 steps") lmp.command("run 500") # Try extracting a global value print("") print("Attempting to get t...
Python
1
eq!(map2.get(&2), None); assert!(iter.next().is_none()); } #[test] fn test_iter_elem() { let env_base = Environment::<u8, char>::new(); assert!(env_base.iter_elems().next().is_none()); let mut env_base = Environment::new(); env_base.insert(1, 'a'); env_base....
Rust
0
ange(target_rep_points.shape[0]): q = target_rep_points[i] mq_vec = q - missile_pos mq_norm_sq = np.sum(mq_vec**2) if mq_norm_sq < 1e-9: return False ms_vec = smoke_center - missile_pos t = np.dot(ms_vec, mq_vec) / mq_norm_sq if not (0.0 <= t <= 1.0): return False...
Python
1
a is bad. wallet::load_loan_backup(backup)?; Ok(()) } ); impl_window!( window, async fn generateBip39SeedWords() -> Result<String> { let mnemonic = wallet::bip39_seed_words(Language::English); let words = mnemonic.phrase().to_owned(); ...
Rust
0
import cvxpy as cp import numpy as np from scipy.stats import norm, laplace, uniform from matplotlib import pyplot as plt # True weights for the underlying mixture true_mixture_weights = [.3, .5, .2] N = 100 k = 3 # This function generates N from the true mixture of distributions. # When you use this function to plo...
Python
1
# -*- encoding: utf-8 -*- # @Time : 2020/12/21 # @Author : Zhichao Feng # @email : fzcbupt@gmail.com # UPDATE: # @Time : 2021/7/1 # @Author : Xingyu Pan # @Email : xy_pan@foxmail.com import os import sys import unittest sys.path.append(os.getcwd()) import numpy as np from recbole.config import Config ...
Python
1
from .. import IconBase class IconTag(IconBase): class_name = "lucide lucide-tag" svg_data = { "attrs": { "width": "24", "height": "24", "view_box": "0 0 24 24", "fill": "none", "stroke": "currentColor", "stroke_width": "2", "stroke_linecap": "round"...
Python
1
ResponseBytes)?; let rsp_value: models::CloudError = serde_json::from_slice(&rsp_body).map_err(|source| Error::Deserialize(source, rsp_body.clone()))?; Err(Error::DefaultResponse { status_code, ...
Rust
0
Dst", (0, 0)), ("vartriang", (0, 0)), ("NotGreaterGreate", (0, 0)), ("cemptyv;", (10674, 0)), ("meas", (0, 0)), ("cudarrl;", (10552, 0)), ("Dcar", (0, 0)), ("vc", (0, 0)), ("bu", (0, 0)), ("NotGreaterSlantEqu", (0, 0)), ("blacksq", (0, 0)),...
Rust
0
if isinstance(ret_type, Instance): return type_id_for_fullname(ret_type.type.fullname) return None elif isinstance(callee.node, TypeAlias): target_type = get_proper_type(callee.node.target) if isinstance(target_type, Instance): r...
Python
1
{ sensor_states.insert(s.id.clone(), state); } } sensor_states } fn read_measurements(core: &mut Core, sensors: Vec<Sensor>) -> Result<Vec<Measurement>> { let client = luftpost::create_sensor_reader(core); let work = sensors.into_iter().map(|s| { let uri = s.data_uri.parse...
Rust
0
import json import csv import argparse import os # parser = argparse.ArgumentParser() # parser.add_argument("--data_input_dir", default = '') # parser.add_argument("--vocab_dir", default="") # parsed = vars(parser.parse_args()) # # dir = parsed['data_input_dir'] # vocab_dir = parsed['vocab_dir'] root_dir = '../../.....
Python
1
sd in e] yield entry else: async for entry in rendered_entries: yield entry # TODO: Search writable for application partitions too? async def writable( conn, otype: Literal["ALL", "OU", "USER", "COMPUTER", "GROUP", "DOMAIN", "GPO"] = "ALL", right: Literal["ALL", "WRITE...
Python
1
n clear(&mut self) { self.username.clear(); self.unknown_fields.clear(); } } impl ::std::fmt::Debug for ClusterUser_Token_Req { fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result { ::protobuf::text_format::fmt(self, f) } } impl ::protobuf::reflect::ProtobufValue...
Rust
0
alize))] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] #[derive(BinRead, Debug, SsbhWrite)] pub struct Unk3Data { pub name: SsbhString, pub unk1: f32, pub unk2: f32, pub unk3: f32, pub unk4: f32, } #[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] #[cfg_attr(feature ...
Rust
0
as_gc(), "example", "module"); builder.set_arity(Arity::Default(2, 2)); let closure = hooks.manage_obj(Closure::without_upvalues(hooks.manage_obj(builder.build()))); let result = closure_name.call(&mut hooks, Some(val!(closure)), &[]); assert_eq!(result.unwrap().to_num(), 2.0); let mut b...
Rust
0
Size.Broadcast512_UInt64), 8); /// ``` pub fn size(value: MemorySize) -> u32 { memory_size_to_iced(value).size() as u32 } /// Gets the size in bytes of the packed element. If it's not a packed data type, it's equal to [`MemorySizeExt.size()`]. /// /// # Arguments /// /// - `value`: A [`MemorySize`] enum valu...
Rust
0
from sklearn.datasets import load_iris from sklearn.linear_model import LogisticRegression import joblib import os # Load data X, y = load_iris(return_X_y=True) # Train model clf = LogisticRegression(max_iter=200) clf.fit(X, y) # Save model os.makedirs("model", exist_ok=True) joblib.dump(clf, "model/model.pkl") pri...
Python
1
# # python-rofi # # The MIT License # # Copyright (c) 2017 Blair Bonnett <blair.bonnett@gmail.com> # # 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 lim...
Python
1
p_c = 1 else: p_c = int(p_c[0]) elif 'P' not in string: p_c = 0 if 'S' in string: s_c = re.findall(r'S(\d\d?)',string) if len(s_c) == 0: s_c = 1 else: s_c = int(s_c[0]) elif 'S' not i...
Python
1
shortened string might be less than the size limit. pub value: Option<String>, } impl client::Part for TruncatableString {} // ################### // MethodBuilders ### // ################# /// A builder providing access to all methods supported on *project* resources. /// It is not used directly, but through...
Rust
0
import fire import numpy as np import torch import torch.nn as nn from tqdm import tqdm from torch.utils.data import DataLoader from models.pointnet2_cls import pointnet2_cls_ssg, pointnet2_cls_msg from models.pointnet2_seg import pointnet2_seg_ssg from data.ModelNet40 import ModelNet40 from data.ShapeNet import ShapeN...
Python
1
rde(untagged)] pub enum GetBgpNeighborDataError { Status401(), Status403(), Status404(), UnknownValue(serde_json::Value), } /// struct for typed errors of method `request_bgp_config` #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] pub enum RequestBgpConfigError { Status401(), ...
Rust
0
/// # Arguments /// /// * `labeled_text` - A partially annotated text. Each character boundary is annotated by the following rules: /// - If the boundary is a token boundary, a pipe symbol (`'|'`) is inserted. /// - If the boundary is not a token boundary, a dash symobl (`'-'`) is inserted. /// ...
Rust
0
shot, &mut process_entry as *mut tlhelp32::PROCESSENTRY32); while found_process != 0 { let does_match_query = match query { ProcessQuery::ProcId(pid) => { process_entry.th32ProcessID == pid } ProcessQuery::ProcName(process_name) => { let pr...
Rust
0
]; trees.into_iter().collect() } pub mod utility; pub mod input; pub mod memvis; pub mod vidram; use sdl2; use sdl2::keyboard::Keycode; use sdl2::pixels::PixelFormatEnum; use sdl2::rect::{Point, Rect}; use sdl2::surface::Surface; use sdl2::*; use self::input::*; use self::memvis::MemVisState; use self::utility::...
Rust
0
let root = logger(scenario, strategy(2), false); info!(root, "Failed message"); info!(root, "Successful message"); } <reponame>moshih/shane_tock use kernel::common::volatile_cell::VolatileCell; #[repr(C, packed)] struct BpmRegisters { interrupt_enable: VolatileCell<u32>, interrupt_disable: VolatileC...
Rust
0
可运行 `test_get_offical_stocks` 得知 pub async fn offical_stocks(set: Arc<StockList>) -> Result<usize> { let len = futures::try_join!(get_sh_stocks(set.clone(), "8", SH8), get_sh_stocks(set.clone(), "1", SH1), get_sz_stocks(set.clone()))?; dbg!(len);...
Rust
0
(last_line + (indexw * 4)) as usize] as i32 + color as i32) as u8; output[out as usize] = x; out += 4; indexw += 1; collen -= 1; } while replen > 0 { x = (output[(last_line + (indexw * 4))...
Rust
0
terRng, TimerError> { let mut state = JitterRng::new_with_timer(platform::get_nstime); let mut rounds = JITTER_ROUNDS.load(Ordering::Relaxed) as u8; if rounds == 0 { // No result yet: run test. // This allows the timer test to run multiple times; we don't care. ...
Rust
0
iplier. divisible_by: If provided will ensure that all layers # channels will be divisible by this number. **kwargs: passed directly to mobilenet.mobilenet: prediction_fn- what prediction function to use. reuse-: whether to reuse variables (if reuse set to true, scope must be given). Ret...
Python
1
R, #0xFFFF bx lr" : : : : "volatile" ); } // Mock implementation for tests on Travis-CI. #[cfg(not(any(target_arch = "arm", target_os = "none")))] pub unsafe extern "C" fn switch_to_user( _user_stack: *const u8, _process_regs: &mut [usize; 8], ) -> *const usize { unimplemented!() } #[cfg(all(targe...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ SPDX-License-Identifier: MIT SPDX-PackageName: DrumGizmo kits generator SPDX-PackageHomePage: https://github.com/e-picas/drumgizmo-kits-generator SPDX-FileCopyrightText: 2025 Pierre Cassat (Picas) Tests for the check_dependency function in utils.py """ from unittest....
Python
1
# Generated by Django 2.2.2 on 2020-03-04 20:01 import dillo.models.mixins import dillo.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('dillo', '0012_likes_for_shorts'), ] operations = [ migrations.RenameField( mo...
Python
1
as EFI_HANDLE, EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL)); // TODO: BY_HANDLE is used for applications. Drivers should use GET. Will we ever support drivers? let status = ((*stream.protocol).Configure)(stream.protocol, &config_data); if status == EFI_NO_MAPPING { // Wait u...
Rust
0
bboxes.shape[0])], dim=0) else: per_im_masks = torch.zeros((0, b_img_h, b_img_w)) pairwise_masks = torch.zeros( (0, self.pairwise_size**2 - 1, b_img_h, b_img_w)) # TODO: Support BitmapMasks with tens...
Python
1
# BSD 3-Clause License; see https://github.com/scikit-hep/uproot5/blob/main/LICENSE from __future__ import annotations import pytest import skhep_testdata import uproot ak = pytest.importorskip("awkward") cupy = pytest.importorskip("cupy") pytestmark = pytest.mark.skipif( cupy.cuda.runtime.driverGetVersion() == ...
Python
1
label(ERROR_COLOR, "Fatal error: failed to initialize background work thread."); ui.add_space(16.0); if ui.button("Exit").clicked() { std::process::exit(-1); } (self, false) } } ...
Rust
0
Local Services campaign. CANNOT_ADD_OR_REMOVE_LOCATION_FOR_LOCAL_SERVICES_CAMPAIGN (22): Local Services profile does not exist for a particular Local Services campaign. AT_LEAST_ONE_POSITIVE_LOCATION_REQUIRED_FOR_LOCAL_SERVICES_CAMPAIGN (23): ...
Python
1
r so if batch_size # is None, the request_batch_size will always be None regardless # of the value of limit. This doesn't generally strike me as the # correct behavior, but this change preserves the existing Py2 # behavior on Py3. if batch_size is None: ...
Python
1
ln!( "#define CKB_VM_ASM_ASM_CORE_MACHINE_OFFSET_CHAOS_SEED {}", (&m.chaos_seed as *const u32 as usize) - m_address ); println!( "#define CKB_VM_ASM_ASM_CORE_MACHINE_OFFSET_FLAGS {}", (&m.flags as *const u8 as usize) - m_address ); println!( "#define CKB_VM_ASM_AS...
Rust
0
UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. :param start_date: Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which wil...
Python
1
from typing import Any import pytest from pydantic import BaseModel from polyfactory import AsyncPersistenceProtocol, SyncPersistenceProtocol from polyfactory.factories.pydantic_factory import ModelFactory class MyModel(BaseModel): name: str class MySyncPersistenceHandler(SyncPersistenceProtocol): def sa...
Python
1
x00000000, HCTSIZ7: 0x00000000, }; #[cfg(not(feature = "nosync"))] #[allow(renamed_and_removed_lints)] #[allow(private_no_mangle_statics)] #[no_mangle] static mut OTG_FS_HOST_TAKEN: bool = false; /// Safe access to OTG_FS_HOST /// /// This function returns `Some(Instance)` ...
Rust
0
!(17, from_byte_idx(TEXT, 26)); assert_eq!(19, from_byte_idx(TEXT, 27)); assert_eq!(21, from_byte_idx(TEXT, 33)); assert_eq!(21, from_byte_idx(TEXT, 34)); assert_eq!(21, from_byte_idx(TEXT, 35)); assert_eq!(21, from_byte_idx(TEXT, 36)); assert_eq!(23, from_byte_idx(TEXT,...
Rust
0
e is granted by /// quorum(leader in original raft). /// /// In this way the leadership won't be lost when it sees a higher `vote` and needs upgrade its `vote`. /// /// - A follower will just receive replication from a leader. A follower that is one of the member will be able to /// become...
Rust
0
ut byte) { Ok(0) => { break; }, Ok( 1 ) => { if byte[0] == 0x0a { match String::from_utf8( buf.clone() ) { Ok( l ) => { // dbg!(&l); tx.send( l ); }, Err( e ) => { warn!("Received non utf-8 character"); tx.send("No...
Rust
0
# Import the os module, for the os.walk function import os import csv rootDir = '/usr/local/' for dirName, subdirList, fileList in os.walk(rootDir): if(os.path.isdir("/usr/local/cuda")): with open("envset.sh", "w") as fp: string1 = "export PATH=/usr/local/cuda/bin:$PATH\nexport LD_LIBRARY_PATH...
Python
1
test_name = m_test.group(2).strip() full_test_name = ( ":".join(stack[:-1] + [test_name]) if stack else test_name ) if status == "ok": passed_tests.add(full_test_name) else: failed_tests.add(...
Python
1
# coding=utf-8 from rest_framework import permissions from board.models import SettingBoard def getWikiPermission(): setting = SettingBoard.objects.filter(id=1) if len(setting) != 0: if setting[0].openwiki is False: return False else: return True else: return...
Python
1
import sys import numpy as np from frovedis.exrpc.server import * import frovedis.graph as fnx import networkx as nx # initializing the Frovedis server argvs = sys.argv argc = len(argvs) if (argc < 2): print ('Please give frovedis_server calling command as the first argument \n(e.g. "mpirun -np 2 /opt/nec/frovedis...
Python
1
import numpy as np import matplotlib.pyplot as plt from math import ceil, sqrt import pandas as pd # Parameters R_large = 500 # Radius of the large circle in meters R_small = 260 # Radius of the small circles in meters D_large = 2 * R_large # Diameter of the large circle # Overlap configuration overlap_factor = 0....
Python
1
for _ in 0..100 { /// root.step().unwrap(); /// } /// }); /// /// // Wait for all worker threads to terminate. /// hruntime.join().unwrap(); /// ``` pub fn run<F>(nworkers: usize, f: F) -> RuntimeHandle where F: FnOnce(&Runtime, usize) + Clone + Send + 'stati...
Rust
0
Null<Node<T>>>, key: &str, d: usize) -> Option<NonNull<Node<T>>> { x.and_then(|x| { if d == key.len() { Some(x) } else { let i = common::util::byte_at(key, d); let next = unsafe { x.as_ref().next[i] }; get_dth(next, key, d + 1) } }) } unsa...
Rust
0
import os from test_utils import run_query here = os.path.dirname(__file__) def test_makeellipse_success(): results = run_query( """ SELECT ST_ASGEOJSON(@@RS_SCHEMA@@.ST_MAKEELLIPSE( ST_POINT(-73.9385,40.6643), 5, 3, -30, 'miles', 20)), ST_ASGEOJSON(@@RS_SCHEMA@@.S...
Python
1
# Copyright 2018 Google Inc. # # 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 or agreed to in writing, ...
Python
1
reg_id: RegisterId) -> () { self.preserves.set(reg_id.to_usize(), false) } pub fn set_all_ignored(&mut self) -> () { self.ignores.set_range(.., true) } pub fn set_all_read(&mut self) -> () { self.ignores.set_range(.., false) } pub fn set_all_preserved(&mut self) -> () {...
Rust
0
None => "Not Configured".to_string(), Some(hc) => { format!( "Port {} HealthyThreshold {} UnhealthyThreshold {} FreqSecs {}", hc.port.unwrap_or(e.port), hc.consider_healthy_th...
Rust
0
# Copyright (c) OpenMMLab. All rights reserved. import cv2 import numpy as np def gaussian(x, sigma): """Gaussian function. Args: x (array_like): The independent variable. sigma (float): Standard deviation of the gaussian function. Return: ndarray or scalar: Gaussian value of `x`...
Python
1
; } else { // Load up the decoder for the next chunk let decoder = self.decoder.take().unwrap(); let (buf, _) = decoder.finish(); let file = buf.into_inner().file; let rec = self.active_file_index[self.ac...
Rust
0