text
string
label_name
string
labels
int64
_true', help="Give a file path to store the history in. This file is used to undo changes", default=f"history_{datetime.now()}.json") parser.add_argument('--small', type=int, default=10 ** 6, help="Upper limit for small files in bytes") parser.add_argument('--medi...
Python
1
pub fn bits(&self) -> u8 { match *self { ADC_DCCTL1_CICR::ADC_DCCTL1_CIC_LOW => 0, ADC_DCCTL1_CICR::ADC_DCCTL1_CIC_MID => 1, ADC_DCCTL1_CICR::ADC_DCCTL1_CIC_HIGH => 3, ADC_DCCTL1_CICR::_Reserved(bits) => bits, } } #[allow(missing_docs)] #[doc(h...
Rust
0
dable version of a card, in the form: <type>: value value """ return f'{self.value} {self.value}' class Triple(Card): # init只用输入一张 type = '三同张' def __repr__(self): """ Returns a string which is a readable version of a card, in the form: <type...
Python
1
from helm.benchmark.adaptation.adapters.adapter_factory import ADAPT_MULTIPLE_CHOICE_JOINT from helm.benchmark.adaptation.common_adapter_specs import get_multiple_choice_adapter_spec from helm.benchmark.metrics.common_metric_specs import get_exact_match_metric_specs from helm.benchmark.run_spec import RunSpec, run_spec...
Python
1
TestNet::reset(); let para_a_location: MultiLocation = MultiLocation { parents: 1, interior: X1(Parachain(1)), }; let para_a_asset: pallet_assets_wrapper::XTransferAsset = para_a_location.try_into().unwrap(); ParaB::execute_with(|| { // ParaB register the native asset of paraA assert_ok!(ParaA...
Rust
0
#[cfg(unix)] use std::os::unix::fs::symlink as symlink_dir; #[cfg(windows)] use std::os::windows::fs::symlink_dir; fn is_enable(env_var: &str, default: bool) -> bool { match std::env::var(env_var).ok().as_deref() { Some("0") => false, Some(_) => true, None =>...
Rust
0
Variable(boundary_bb.type(Tensor)) # Sample noise as generator input layouts_imgs_tensor = [] # plot images # np.random.seed(100) z = Variable(Tensor(np.random.normal(0, 1, (real_room_bb.shape[0], opt.latent_dim)))) gen_room_bb = generator(z, [nodes, triples], room_to_sample, boundary=boundary_bb) nodes = node...
Python
1
class Solution: def minAddToMakeValid(self, s: str) -> int: ans = 0 chars = list(s) openCount = 0 closedCount = 0 for idx, c in enumerate(chars): if c == '(': openCount += 1 elif c == ')': if openCount == 0: ...
Python
1
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ File: jd_dpcj.py(店铺抽奖-JK) Author: HarbourJ Date: 2022/10/15 23:00 TG: https://t.me/HarbourToulu TgChat: https://t.me/HarbourChat cron: 1 1 1 1 1 1 new Env('店铺抽奖-JK'); ActivityEntry:https://shop.m.jd.com/shop/lottery?shopId=xxxxx&venderId=xxxxx Description: 变量:export D...
Python
1
eponame>wasml/linalg pub mod basic; pub mod interop; pub mod math; pub mod sampling; <filename>src/torrent/mod.rs use ansi_term::Colour::{Green, Red}; use std::cmp::Ordering; #[derive(Debug)] pub struct Torrent { pub name: String, pub magnet_link: String, pub seeders: Option<u32>, pub leechers: Option<...
Rust
0
master_key, branch_seed, primary_key_index, digest_type: PhantomData, }), Err(e) => Err(KeyManagerError::from(e)), } } /// Creates a KeyManager from the provided sequence of mnemonic words, the language of the mnemo...
Rust
0
roe(net_income: float, shareholders_equity: float) -> float: """ROE (자기자본이익률) 계산""" if shareholders_equity == 0: return 0.0 return net_income / shareholders_equity @staticmethod def calculate_roa(net_income: float, total_assets: float) -> float: """ROA (총자산이익률) 계...
Python
1
import matplotlib.pyplot as plt import numpy as np from numpy import pi, exp, log import sys import json import scipy.stats, scipy.special methods = {} for filename in sys.argv[1:]: info = json.load(open(filename)) ncall = info['ncall'] logz = info['logz'] logzerr = info['logzerr'] ndim = len(info[...
Python
1
import sys from collections import deque def turn(c): global d if c == 'L': d = (d - 1) % 4 else: d = (d + 1) % 4 def game(head_x, head_y): time = 0 snake = deque([(head_x, head_y)]) board[head_x][head_y] = -1 while True: time += 1 head_x += dx[d] ...
Python
1
default_initial_settings = { "name": "Kingroon Base Printer", "manufacturer": "Kingroon", "start_gcode": "G28 ; home all axes\n M117 Purge extruder\n G92 E0 ; reset extruder\n G1 Z1.0 F3000 ; move z up little to prevent scratching of surface\n G1 X2 Y20 Z0.3 F5000.0 ; move to start-line position\n G1 X2 Y17...
Python
1
sum([x.val for x in bar]) min([x.val for x in bar]) max([x.val for x in bar]) # Ok sum(x.val for x in bar) min(x.val for x in bar) max(x.val for x in bar)
Python
1
.os_id.is_none() { debug!("Open called with no file link or unique id..."); return Err(ShmemError::NoLinkOrOsId); } // Get the os_id from the flink if let Some(ref flink_path) = self.flink_path { debug!( "Open shared memory from file link {}",...
Rust
0
insert(*treenode, nodecost); } // Now that we've calculated all the costs, we can extract the cheapest one extract_from_nodecosts(root, &inv, &nodecost_of_treenode, egraph) } fn extract_from_nodecosts( root: Id, inv: &PtrInvention, nodecost_of_treenode: &AHashMap<Id,NodeCost>, egraph: &cra...
Rust
0
from bandstatisticsapp.bandstatisticsdialog import BandStatisticsDialog from enmapbox.gui.applications import EnMAPBoxApplication from enmapbox.typeguard import typechecked from qgis.PyQt.QtGui import QIcon from qgis.PyQt.QtWidgets import QMenu def enmapboxApplicationFactory(enmapBox): return [BandStatisticsApp(e...
Python
1
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab import aws_cdk as cdk from aws_cdk import ( Stack, aws_lakeformation ) from constructs import Construct class DataLakePermissionsStack(Stack): def __init__(self, scope: Construct, construct_id: str, glue_jo...
Python
1
assert!(a < b); } #[test] fn test_ord() { let mut a = Flags::empty(); let mut b = Flags::empty(); assert!(a <= b && a >= b); a = Flags::A; assert!(a > b && a >= b); assert!(b < a && b <= a); b = Flags::B; assert!(b > a && b >= a); ...
Rust
0
h"); bindgen::Builder::default() .clang_arg("-I./vendor/xxhash/") .header("src/xxhash_bindings.h") // Tell cargo to invalidate the built crate whenever any of the // included header files changed. .parse_callbacks(Box::new(bindgen::CargoCallbacks)) .rustfmt_bindings(t...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """usage: blobtools map2cov -i FASTA [-b BAM...] [-a CAS...] [-o PREFIX] [-c] [-h|--help] Options: -h --help show this -i, --infile FASTA FASTA ...
Python
1
import random, time def solve(eggs): redactedscript = """ █ █ █████████ ██ █ ██ ███ █ ██ █████████ ██████████████ █ ██ ████████ █ ██████████ ███ █ ██ █████████ ███ █ ██ █████████ ██ █ ██ █ ███ █ ██ ██ ████████ ██ █ ██ ██ ...
Python
1
, Deg, Quaternion}; use nice_engine::{camera::Camera, mesh_group::MeshGroup, transform::Transform, window::Window, Context, GpuFuture}; use simplelog::{LevelFilter, SimpleLogger}; use std::{collections::HashSet, time::Instant}; use winit::{ dpi::LogicalSize, DeviceEvent, ElementState, Event, EventsLoop, KeyboardInput,...
Rust
0
e(always)] pub fn ctoesen(&mut self) -> CTOESEN_W { CTOESEN_W { w: self } } #[doc = "Bit 17 - Command CRC Error Status Enable"] #[inline(always)] pub fn ccesen(&mut self) -> CCESEN_W { CCESEN_W { w: self } } #[doc = "Bit 18 - Command End Bit Error Status Enable"] #[inline...
Rust
0
audioldm_tts_pipe = AudioLDM2Pipeline.from_pretrained("anhnct/audioldm2_gigaspeech") audioldm_tts_pipe = audioldm_tts_pipe.to(torch_device) audioldm_tts_pipe.set_progress_bar_config(disable=None) inputs = self.get_inputs_tts(torch_device) audio = audioldm_tts_pipe(**inputs).audios...
Python
1
.collect::<Vec<_>>(); let oxygen_rating = get_reading(&input, 11, true); let co2_rating = get_reading(&input, 11, false); (oxygen_rating * co2_rating) as u32 } <reponame>csixteen/AdventOfCode<filename>2020/Rust/Day20/src/img.rs pub mod tile; pub mod image; // Copyright 2018 (c) rust-themis develo...
Rust
0
test] fn decode1() { const ENCODED: &str = "TWFu"; const EXPECTED: &str = "Man"; let decoder = Base64::new(); assert_eq!( str::from_utf8(&decoder.decode(ENCODED.as_bytes()).expect("Decoding error")[..]).unwrap(), EXPECTED ); } #[test] fn decode2() { const ENCODED: &str = "TWFuI...
Rust
0
if full_response: return LLMFullResponse( generated_text=data["content"][0]["text"], model=model_name, process_time=time.time() - start_time, llm_provider_response=data, ...
Python
1
(); let mut parser = Parser::new(&tokens); let root = parser.parse().unwrap(); let node = if let NodeType::Root(_) = &root.ntype { &root } else { panic!("Parse result should always be a Root node"); }; let mut ctx = EvalContext::populated(); ...
Rust
0
import streamlit as st import requests import pandas as pd from requests.auth import HTTPBasicAuth import streamlit_shadcn_ui as ui from os import environ from dotenv import load_dotenv import os # Cargar las variables de entorno desde el archivo .env load_dotenv() st.title("Projects") SEARCH_ISSUE_FROM_JQL_MESSAGE_...
Python
1
# Copyright 2015 The TensorFlow Authors. 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 applica...
Python
1
rc::{Rc, Weak} }; use crate::libc::c_void; use wlroots_sys::{ wlr_surface, wlr_xdg_popup_v6, wlr_xdg_surface_v6, wlr_xdg_surface_v6_for_each_surface, wlr_xdg_surface_v6_ping, wlr_xdg_surface_v6_role, wlr_xdg_surface_v6_send_close, wlr_xdg_surface_v6_surface_at, wlr_xdg_toplevel_v6, wlr_xdg_toplevel_v6_s...
Rust
0
fn execute_deposit_check_funds() { let mut deps = mock_dependencies(&[]); let (mut env, mut info) = utils::initialize(&mut deps); // zero amount env.block.time = Timestamp::from_seconds(5); let resp = contract::execute( deps.as_mut(), env.clone(), info.clone(), Execu...
Rust
0
file2.write(&cypher2.get_cypher_header()).unwrap(); write_striple_with_enc(&cypher2,&ts.0,None,&mut datafile2, &public_enc).unwrap(); write_striple_with_enc(&cypher2,&personalts.0,Some(&personalts.1),&mut datafile2, &private_enc).unwrap(); write_striple_with_enc(&cypher2,&hashstamp.0,Some(&hashstamp.1),&mut dataf...
Rust
0
ates&      !cC`s|j|j|_tS(N(RBRNRR5(R((sp/private/var/folders/vy/31wknkcs30l6xb2fzgwnrkh80000gn/T/pip-build-VQoj4y/pip/pip/_vendor/html5lib/_tokenizer.pyRL1s  cC`s|jj}...
Python
1
#!/usr/bin/env python #! ASSUME the current pwd is "./user" import os from sys import platform base_address = 0x8040_0000 step = 0x2_0000 linker_file = "src/linker.ld" target_dir = "../target/riscv64gc-unknown-none-elf/release/" objcopy = "objcopy" cargo_command = "cargo build --bin {} --release" objcopy_bin = "" if ...
Python
1
# 给定一个整数数组 # nums # 和一个整数目标值 # target,请你在该数组中找出 # 和为目标值 # target # 的那 # 两个 # 整数,并返回它们的数组下标。 # 你可以假设每种输入只会对应一个答案,并且你不能使用两次相同的元素。 # 你可以按任意顺序返回答案。 # 示例 # 1: # 输入:nums = [2, 7, 11, 15], target = 9 # 输出:[0, 1] # 解释:因为 # nums[0] + nums[1] == 9 ,返回[0, 1] 。 # 示例 # 2: # # 输入:nums = [3, 2, 4], target = 6 # 输出:[1, 2] # 示例 # 3: # ...
Python
1
aset.classes) base_generator = utils.scan_to_scan_generator_sa(train_dataset, batch_size=args.batch_size) # gives back seg map as y_true[1] val_base_generator = utils.scan_to_scan_generator_sa(val_dataset, batch_size=args.batch_size) # gives back seg map as y_true[1] train_generator = utils.hyp_generator_elastic_sa_vec...
Python
1
eq!(slice.into_vec().capacity(), 3); /// ``` /// /// [`Box<u8>`]: alloc::boxed::Box #[inline] #[must_use] pub fn into_boxed_slice(self) -> Box<[u8]> { self.buf.into_boxed_slice() } /// Returns the number of bytes the string can hold without reallocating. /// /// # Exampl...
Rust
0
from rclpy._rclpy_pybind11 import RCLError from rclpy.node import Node from rclpy.qos import qos_profile_sensor_data from resource_monitoring_interfaces.msg import Field, Resource from telegraf_resource_monitor.sensor_message import SensorMessage class SensorMessagePublisher: def __init__(self, node: Node, messa...
Python
1
ernames[randint(0, len(usernames) - 1)] # Tanlangan foydalanuvchi nomi binary search yordamida qidiriladi findUser(user, users) toc = time.time() # Qidiruv tugash vaqti # O'rtacha qidiruv vaqtini chiqarish print('Binary search vaqti: ', (toc - tic) / n) # 2. Hash jadvali orqali qidiruv tic = time.time() # Ha...
Python
1
host_exists_statement: None, add_place_for_plant_statement: None, create_place_statement: None, select_place_by_name_statement: None, create_place_place_statement: None, select_all_plants_statement: None, select_places_by_type_statement: None, ...
Rust
0
# Write a Python program that takes a student's marks in three subjects as input. # If the average is greater than or equal to 90, print "Grade: A". # If the average is between 80 and 89, print "Grade: B". # If the average is between 70 and 79, print "Grade: C". # Otherwise, print "Grade: Fail". s1 = int(input("Enter m...
Python
1
#!/usr/bin/python3 for x in range(97, 123): if chr(x) == 'e' or chr(x) == 'q': continue print('{}'.format(chr(x)), end='')
Python
1
the License. extern crate bindgen; use cmake::Config; use std::env; use std::path::PathBuf; #[derive(PartialEq)] enum HostType { Linux, MacOS, Windows, Unknown, } fn main() { let host_type = if cfg!(target_os = "linux") { HostType::Linux } else if cfg!(windows) { HostType::W...
Rust
0
""" Facebook Messenger messages Uses the output of [[https://github.com/karlicoss/fbmessengerexport][fbmessengerexport]] """ REQUIRES = [ 'fbmessengerexport @ git+https://github.com/karlicoss/fbmessengerexport', ] from collections.abc import Iterator from contextlib import ExitStack, contextmanager from dataclass...
Python
1
ub fn get_activities_file_name() -> PathBuf { let mut path = dirs::home_dir().expect("Cannot figure out your home directory. What's wrong with you?"); path.push(".tt"); path.push("activities"); path } pub fn get_logfile_name(date: &NaiveDate) -> PathBuf { let mut path = dirs::home_d...
Rust
0
.builder(MessyJsonSettings::default()) .deserialize(&mut deserializer) .unwrap(); assert_eq!( parsed.inner().eq(&parsed_value), false, "obj comparaison problem" ); } #[test] fn mismatch_obj() { let parser = gen_parser(); let mut deserializer = serde_json::Deser...
Rust
0
'key': key }, **kwargs) return self._search_json('', response, 'api response', folder_id, **kwargs) or {} def _get_folder_items(self, folder_id, key): page_token = '' while page_token is not None: request = self._REQUEST.format(folder_id=folder_id, page_...
Python
1
erent console //! implementation if necessary - it is an abstraction over tcod. pub use tcod::input::{self, Event, EventFlags, Key, KeyCode}; use crate::constants; use crate::defs::*; use crate::util::convert::color_code_to_rgb; use crate::{GameError, GameResult}; use over::Obj; use std::cell::RefCell; use std::fmt; ...
Rust
0
MYR MZM = MZM MZN = MZN NAD = NAD NGN = NGN NIC = NIC NIO = NIO NIS = NIS NLG = NLG NOK = NOK NPR = NPR NTD = NTD NZD = NZD OMR = OMR PAB = PAB PEH = PEH PEI = PEI PEN = PEN PGK = PGK PHP = PHP PKR = PKR PLN = PLN PLZ = PLZ PRB...
Python
1
""" Optimal Transfer With Time Trigger ================================== """ from time import perf_counter import matplotlib.pyplot as plt import numpy as np from _sgm_test_util import LTI_plot import condor as co # either include time as state or increase tolerances to ensure sufficient ODE solver # accuracy with...
Python
1
() == "yes" { confirmed = true; break; } if input.as_str() == "n" || input.as_str() == "no" { break; } } confirmed } /// Get the web application URL for the `API_KEY_PAGE` fn get_api_access_url(api_url: &str) -> Result<String> { // remove the any ...
Rust
0
import itertools import numpy as np import torch import torch.nn as nn class Anchors(nn.Module): def __init__(self, anchor_scale=4., pyramid_levels=[3, 4, 5, 6, 7]): super().__init__() self.anchor_scale = anchor_scale self.pyramid_levels = pyramid_levels # strides步长为[8, 16, 32, 64...
Python
1
See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about avaliable fields see [usb1_chrg_det_stat](usb1_chrg_det_stat) module"] pub type USB1_CHRG_DET_STAT = crate::Reg<u32, _USB1_CHRG_DET_STAT>; #[allow(missing_docs)] #[doc(hidden)] pub struct _USB1_CHRG_DET_STAT; #[doc = "`read()` metho...
Rust
0
). /// - M12 geodesic scale of point 2 relative to point 1 (dimensionless). /// - M21 geodesic scale of point 1 relative to point 2 (dimensionless). /// - a12 arc length of between point 1 and point 2 (degrees). fn inverse( &self, lat1: f64, lon1: f64, lat2: f64, ...
Rust
0
#[serde(default)] vertices: Vec<PhysicsVertex>, normalization: Option<PhysicsNormalization>, } #[derive(Clone, Debug, Deserialize, Serialize)] #[serde(rename_all = "PascalCase")] pub struct PhysicsInput { source: PhysicsTarget, weight: f32, #[serde(rename = "Type")] ty: String, reflect:...
Rust
0
`` passed in ``fit``/``update``. For nameless formats, column index will be a RangeIndex. Row index is fh. Entries are variance forecasts, for var in col index. If cov=True: Column index is a multiindex: 1st level is variable names (as above) ...
Python
1
wlr_input_device_type = 4; pub const WLR_INPUT_DEVICE_TABLET_TOOL: wlr_input_device_type = 3; pub const WLR_INPUT_DEVICE_TOUCH: wlr_input_device_type = 2; pub const WLR_INPUT_DEVICE_POINTER: wlr_input_device_type = 1; pub const WLR_INPUT_DEVICE_KEYBOARD: wlr_input_device_type = 0; #[repr(C)]#[derive(Copy, Clone)] pub...
Rust
0
import pandas as pd from pandas.testing import assert_series_equal import pytest from pvanalytics.features import shading @pytest.fixture(scope='module') def times(): return pd.date_range( start='1/1/2020', end='12/31/2020 23:59', freq='1min', tz='MST' ) @pytest.fixture(scope...
Python
1
import os # กำหนดเส้นทางของฟอนต์ BASE_DIR = os.path.dirname(os.path.abspath(__file__)) # ชื่อฟอนต์ FONT_REGULAR = os.path.join(BASE_DIR, "THSarabunNew.ttf") FONT_BOLD = os.path.join(BASE_DIR, "THSarabunNew_Bold.ttf") FONT_ITALIC = os.path.join(BASE_DIR, "THSarabunNew_Italic.ttf") FONT_BOLD_ITALIC = os.path.join(BASE_...
Python
1
from __future__ import annotations from importlib.machinery import ModuleSpec import importlib.util import sys from types import ModuleType from typing import Iterable, Sequence class VendorImporter: """ A PEP 302 meta path importer for finding optionally-vendored or otherwise naturally-installed packages...
Python
1
# -*- coding: utf-8 -*- """ Created on Sat Aug 05 23:55:12 2017 @author: Kazushige Okayasu, Hirokatsu Kataoka """ import math import random import numpy as np from PIL import Image class ifs_function(): def __init__(self, prev_x, prev_y): # previous (x, y) self.prev_x,self.prev_y = prev_x,prev_y # IFS function ...
Python
1
= ViewType.VULCANO_PLOT: return "Vulcano plot" elif self == ViewType.LINE_PLOT_2D: return "Line plot 2D" elif self == ViewType.BAR_PLOT: return "Bar plot" elif self == ViewType.STACKED_BAR_PLOT: return "Stacked bar plot" elif self == ViewTy...
Python
1
def is_even(number): return number % 2 == 0 is_even()
Python
1
_files.music, &base_path).await?, sounds: load_sounds(&asset_files.audio, &base_path).await?, fonts: load_fonts(&asset_files.fonts, &base_path).await?, }; Ok(assets) } fn stop_sounds(&self) { self.music.stop(); for sound in self.sounds.values() { ...
Rust
0
n_1_s = set() n_2_s = set() print('Первый лист: ') while True: n = input() if n == "": break n_1_s.add(n) input('Достаём 2 лист (нажмите enter)') print('Второй лист:') while True: n = input() if n == "": break n_2_s.add(n) n_double = n_1_s & n_2_s if not n_double: print('EMPT...
Python
1
(always)] pub fn group4_1(self) -> &'a mut W { self.variant(GROUP4_A::GROUP4_1) } #[doc = "no description available"] #[inline(always)] pub fn group4_2(self) -> &'a mut W { self.variant(GROUP4_A::GROUP4_2) } #[doc = r"Writes raw bits to the field"] #[inline(always)] pub unsafe fn bits(self, va...
Rust
0
print(response) a = response.replace('*','') return a #----Выполнение комманды ant---# """ Если вы вписали свою команду в анализатор, то ваша функция должна выглядеть так: а = слово которое должен вывести анализатор на вашу комманду eli...
Python
1
assert_eq!(space(""), Ok(("", ""))); assert_eq!(space("a"), Ok(("a", ""))); } #[test] fn test_ids() { assert_eq!(ids("id"), Ok(("", vec!["id"]))); assert_eq!(ids("id, abr"), Ok(("", vec!["id", "abr"]))); // assert_eq!( // ids("id, "), // Err(NomErr::...
Rust
0
connect_raw( self.as_ptr() as *mut _, b"launched\0".as_ptr() as *const _, Some(transmute(launched_trampoline::<Self, F> as usize)), Box_::into_raw(f), ) } } } impl fmt::Display for AppLaunchContext { fn fmt(&self, ...
Rust
0
param code: 服务唯一代号 :type code: str :param version: 服务版本 :type version: str :return: 服务对象实例 :rtype: Service """ @abstractmethod def get_executable_end_event(self, code: str) -> ExecutableEvent: """ 根据代号获取特定可执行结束事件实例 :param code: 可执行结束事件唯一代...
Python
1
"", [ Ref(p.deployment_id), "-", Ref(p.pipeline_id), "-changeset", ...
Python
1
elf): self.f32_scalar_2 = NumpyArrayF32(2.0) self.s32_scalar_2 = NumpyArrayS32(2) def testInvokeWithWrongElementType(self): c = self._NewComputation() c.SetOpMetadata(xla_client.CurrentSourceInfoMetadata()) c.ParameterFromNumpy(self.s32_scalar_2) c.ClearOpMetadata() self.assertRaisesRegex...
Python
1
= ::std::mem::MaybeUninit::<Self>::uninit(); unsafe { ::std::ptr::write_bytes(s.as_mut_ptr(), 0, 1); s.assume_init() } } } #[repr(C)] #[derive(Copy, Clone)] pub struct HashIdToIdT { _unused: [u8; 0], } #[repr(C)] #[derive(Copy, Clone)] pub struct SetT { _unused: [u8; ...
Rust
0
=DefaultValue(389), ) ), "ssl": DictElement( parameter_form=FixedValue( value=True, label=Label("Use SSL"), title=Title("Use LDAPS (SSL)"), help_text=Help( "Use...
Python
1
"nitrogen", "feh", ] # d["4"] = ["Gimp", "gimp" ] # d["5"] = ["Meld", "meld", "org.gnome.meld" "org.gnome.Meld" ] # d["6"] = ["Vlc","vlc", "Mpv", "mpv" ] # d["7"] = ["VirtualBox Manager", "VirtualBox Machine", "Vmplayer", # "virtualbox manager", "virtualbox machine", "vmplayer", ] # d[...
Python
1
t::new(1)))); dom_product = 1; continue; } dom_product *= dom_size; pending.push(top); heap.pop(); } let mut sum = LinearSum::constant(lit.sum.constant); for &(_, var, coef) in &pending { sum.add_coef(var, coef); } ret.push(LinearLit::...
Rust
0
# Add any form classes for Flask-WTF here from flask_wtf import FlaskForm from wtforms import StringField, PasswordField, TextAreaField, BooleanField, EmailField,IntegerField,FloatField from wtforms.validators import InputRequired, Email from flask_wtf.file import FileField, FileRequired, FileAllowed class Signup(Fla...
Python
1
#[strum(serialize = "Num_Lock")] XK_Num_Lock, /// XK_KP_Space #[strum(serialize = "KP_Space")] XK_KP_Space, /// XK_KP_Tab #[strum(serialize = "KP_Tab")] XK_KP_Tab, /// XK_KP_Enter #[strum(serialize = "KP_Enter")] XK_KP_Enter, /// XK_KP_F1 #[strum(serialize = "KP_F1")...
Rust
0
{pos}/{len} ({eta_precise})", )); pb.set_message("Generating image pixels"); let pixels: Vec<Vec<_>> = (0..self.height) .into_par_iter() .rev() .progress_with(pb) .map(|j| { (0..self.width) .into_par_iter() ...
Rust
0
lsm.init().unwrap(); lsm.set_mag_odr(MagOutputDataRate::Hz10).unwrap(); let lsm303agr = lsm.into_mag_continuous().ok().unwrap(); let delay = Delay::new(cp.SYST, clocks); (leds, lsm303agr, delay, cp.ITM) } use std::{collections::BTreeMap, fmt, sync::Arc, time}; use chrono::{DateTime, Utc}; use tokio::...
Rust
0
q!(iter.next(), Some(2)); assert_eq!(iter.next(), Some(1)); assert_eq!(iter.next(), None); } #[test] fn ll_take2_test() { let mut list: List<f32> = List::new(); list.push(10.0); list.push(11.0); list.pop(); assert_eq!(list.peek_with_ref(), Some(&10.0))...
Rust
0
ING_BIG5. Deprecated."] #[doc = ""] #[doc = " FT_ENCODING_MS_WANSUNG ::"] #[doc = " Same as FT_ENCODING_WANSUNG. Deprecated."] #[doc = ""] #[doc = " FT_ENCODING_MS_JOHAB ::"] #[doc = " Same as FT_ENCODING_JOHAB. Deprecated."] #[doc = ""] #[doc = " @note:"] #[doc = " By default, FreeType enables a Unico...
Rust
0
import tkinter as tk from tkinter import ttk def calculate_inverse(): n = int(n_entry.get()) b = int(b_entry.get()) n0, b0, t0, t = n, b, 0, 1 q, r = divmod(n0, b0) while r > 0: temp = t0 - q * t if temp >= 0: temp = temp % n else: temp = n - (-temp...
Python
1
for NEB_mutant in NEB_models: NEB_model = NEB_mutant.get_model() NEB_model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy']) mutated_models.append(NEB_mutant) if 'NAI...
Python
1
############################################################################### ## ## Copyright (c) typedef int GmbH ## ## 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
_base_ = 'mmdet::mask_rcnn/mask-rcnn_r50-caffe-c4_1x_coco.py' # https://github.com/open-mmlab/mmdetection/blob/dev-3.x/configs/mask_rcnn/mask-rcnn_r50-caffe-c4_1x_coco.py data_preprocessor = dict( type='DetDataPreprocessor', mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], bgr_to_rgb=True, ...
Python
1
""" Central configuration module for API keys and settings Loads configuration from environment variables with secure fallback handling """ import os from typing import Optional from dotenv import load_dotenv from pathlib import Path # Get the directory of this config file config_dir = Path(__file__).parent env_file ...
Python
1
let min_deposit: u128 = min_deposit.unwrap_or(U128(MIN_SEED_DEPOSIT)).0; let farm_id = self.internal_add_farm(&terms, min_deposit); farm_id } /// force clean, only those farm_expire_sec after ended can be clean pub fn force_clean_farm(&mut self, farm_id: String) { assert!...
Rust
0
import tkinter from tkinter.messagebox import showinfo as alert from tkinter.messagebox import askyesno as question from tkinter.simpledialog import askstring as prompt import customtkinter ''' nombre: Agustin apellido: Navarro --- Ejercicio: Match_02 --- Enunciado: Al presionar el botón ‘Informar’ mostrar mediante ...
Python
1
u8 along with an address resolution function. /// (Memory is cheap and there isn't a practical reason to just not use a [u8; 1024] and /// ignore the high bits, but this feels a little better in an emulator that is supposed /// to mimic the hardware as closely as possible.) memory: [u8; 512], } impl I...
Rust
0
c[1]); if app_state.current_widget.widget_id == widget_id { f.render_widget( Block::default() .borders(*SIDE_BORDERS) .border_style(self.colours.highlighted_border_style), draw_loc, ); } let rx_labe...
Rust
0
oo"], index=[0])) expected = DataFrame({"a": [1, 3], "b": [np.nan, 2], "c": ["foo", np.nan]}) tm.assert_frame_equal(df, expected) @td.skip_array_manager_invalid_test def test_update_modify_view(self): # GH#47188 df = DataFrame({"A": ["1", np.nan], "B": ["100", np.nan]}) ...
Python
1
} Ok(()) } } //! Functions to support processing request/response bodies use std::path::Path; use bytes::Bytes; use log::*; use maplit::*; use serde_json::{Map, Value}; use pact_matching::models::{Request, Response}; use pact_matching::models::generators::{Generator, GeneratorCategory, Generators};...
Rust
0
loop=None, service_manager=cls.service_manager, integ_test=False, ) cls.thread = start_ryu_app_thread(test_setup) cls.enforcement_controller = enforcement_controller_reference.result() cls.testing_controller = testing_controller_reference.result() ...
Python
1
W_OFLAG_COPIED) cur_offset += cluster_size else: struct.pack_into(">Q", cluster, idx * 8, (l2_idx * cluster_size) | QCOW_OFLAG_COPIED) sys.stdout.buffer.write(cluster) ### Write data clusters if data_file_name is None: for ...
Python
1
_size) middle_layer = nn.Linear(hidden_size, hidden_size) self.layers = get_clones(middle_layer, num_layers - 1) def forward(self, x): """forward. Args: x: """ output = x output = self.input_layer(x) output = self.dropout_layer(output) ...
Python
1