text
string
label_name
string
labels
int64
ressionConfig, messages::channel_config::{ChannelConfig, ChannelIndex, DefaultChannels}, Channel, }; /// Contains Config properties which will be shared by Server and Client #[derive(Clone)] pub struct SharedConfig<C: ChannelIndex> { /// Used to configure the underlying socket pub socket: SocketConfig,...
Rust
0
i).\n\nFor information about available fields see [apb_ctrl_peri_backup_int_ena](apb_ctrl_peri_backup_int_ena) module"] pub type APB_CTRL_PERI_BACKUP_INT_ENA = crate::Reg<u32, _APB_CTRL_PERI_BACKUP_INT_ENA>; #[allow(missing_docs)] #[doc(hidden)] pub struct _APB_CTRL_PERI_BACKUP_INT_ENA; #[doc = "`read()` method returns...
Rust
0
# bedup - Btrfs deduplication # Copyright (C) 2012 Gabriel de Perthuis <g2p.code+bedup@gmail.com> # # This file is part of bedup. # # bedup is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of t...
Python
1
[2][3]], ] } } impl AESSide for AESDecrypt { fn lookup_sbox(b: u8) -> u8 { INV_SBOX[usize::from(b)] } fn mix_column(col: [u8; 4]) -> [u8; 4] { [ mul(col[0], 0x0e) ^ mul(col[1], 0x0b) ^ mul(col[2], 0x0d) ^ mul(col[3], 0x09), mul(col[1], 0x0e) ^ mul(col[2]...
Rust
0
methods.get(&v2::HttpMethod::Put).cloned(), post: methods.get(&v2::HttpMethod::Post).cloned(), delete: methods.get(&v2::HttpMethod::Delete).cloned(), options: methods.get(&v2::HttpMethod::Options).cloned(), head: methods.get(&v2::HttpMethod::Head).cloned(), p...
Rust
0
.to_string(), " 229 871 3".to_string(), " 237 956 841".to_string(), ]), 3, "part 2 sample" ); } fn main() { let lines = aoc::input_lines(); aoc::benchme(|bench: bool| { let p1 = part1(&lines); let p2 = part2(&lines); if !bench ...
Rust
0
import gensim import logging # imports used only for doctests from topik.tokenizers._registry import register def _simple_document(text, min_length=1, stopwords=None): """A text tokenizer that simply lowercases, matches alphabetic characters and removes stopwords. For use on individual text documents. P...
Python
1
PyFr{ fr: Fr::one() }; let anycel = &any.downcast::<PyCell<PyFr>>(); if anycel.is_err(){ let bi: BigInt = any.extract()?; let mypyfr = bigint_to_pyfr(&bi); out.fr = mypyfr.fr; } else{ let mypyfr: &PyFr = &anycel.as_ref().unwrap().borrow(); out.fr.clone...
Rust
0
#[inline(always)] pub fn dtimeoutie(&mut self) -> _DtimeoutieW { _DtimeoutieW { w: self } } #[doc = "Bit 2 - Command timeout interrupt enable"] #[inline(always)] pub fn ctimeoutie(&mut self) -> _CtimeoutieW { _CtimeoutieW { w: self } } #[doc = "Bit 1 - Data CRC fail inte...
Rust
0
as ISC_CPrf; use SyllabicCategory::ConsonantSubjoined as ISC_CS; use SyllabicCategory::ConsonantSucceedingRepha as ISC_CSR; use SyllabicCategory::ConsonantWithStacker as ISC_CWS; use SyllabicCategory::GeminationMark as ISC_GM; use SyllabicCategory::InvisibleStacker as ISC_IS; use Syl...
Rust
0
# SPDX-FileCopyrightText: 2025 Qoro Quantum Ltd <divi@qoroquantum.de> # # SPDX-License-Identifier: Apache-2.0 from typing import Any from cirq import ops from cirq.protocols.qasm import QasmArgs def patched_format_field(self, value: Any, spec: str) -> str: """Method of string.Formatter that specifies the output...
Python
1
, 0xb2, 0x66, 0x45, 0xdf, 0x4c, 0x2f, 0x87, 0xeb, 0xc0, 0x99, 0x2a, 0xb1, 0x77, 0xfb, 0xa5, 0x1d, 0xb9, 0x2c, 0x2a, ]; let nonce: u64 = 0; let ad = [0x00, 0x00, 0x00, 0x0C]; let ct_and_tag = chapoly_encrypt(&key, nonce, &ad, pt); println!("{}", hex::enco...
Rust
0
inline(always)] pub fn prince_region1_iv_header1( &self, ) -> &crate::Reg<prince_region1_iv_header1::PRINCE_REGION1_IV_HEADER1_SPEC> { unsafe { &*(((self as *const Self) as *const u8).add(108usize) as *const crate::Reg<prince_region1_iv_header1::PRINCE_REGION1_IV_HEAD...
Rust
0
st_all_mask, list_all_total_charge, list_all_shift_combs, list_orth_matrices, list_all_body_2_neigh_list, list_all_dist_mat, ...
Python
1
u8>), { setup::START.call_once(|| { printer::hook(); }); let bs = arg_data(); f(bs); } pub fn over_async_bytes<F, Fut>(f: F) where F: FnOnce(Vec<u8>) -> Fut, Fut: Future<Output = Vec<u8>> + 'static, { setup::START.call_once(|| { printer::hook(); }); let bs = arg_data...
Rust
0
ct = {} temp_dict['кол-во строк'] = len(d_df) temp_dict['тип значений'] = d_df.dtype temp_dict['кол-во значений'] = temp_describe[0] temp_dict['кол-во NaN'] = (d_df.isna()).sum() temp_dict['среднее'] = temp_describe[1] temp_dict['медиана'] = temp_describe[5] temp_dict['мин'] = temp_describe[...
Python
1
thuận khác.", ), LegalPassage( domain="CIVIL", source="Bộ luật dân sự 2015", grounded_content="Người có nghĩa vụ trả tiền thuê nhà phải trả tiền thuê đúng hạn, trừ trường hợp có thoả thuận khác.", ), ] outputs: list[LegalQueries] = generate_batch( ...
Python
1
with_string_kind(address: u64, text: String, color: FormatterTextKind) -> Self { Self { address, text: SymResTextInfo::with_string(text, color), flags: SymbolFlags::NONE, symbol_size: None } } /// Constructor /// /// # Arguments /// /// - `address`: The address of the symbol /// - `text`: Symbol /// - `colo...
Rust
0
from MSPyBentley import * from MSPyBentleyGeom import * from MSPyECObjects import * from MSPyDgnPlatform import * from MSPyDgnView import * from MSPyMstnPlatform import * from MSPyBentley import * from MSPyECObjects import * from MSPyBentleyGeom import * from MSPyDgnPlatform import * from MSPyDgnView import * from MSPy...
Python
1
> OrbitalHandle { let mut handle = OrbitalHandle::empty(); handle.window = self.window as *mut c_void; handle } } impl From<OrbitalHandle> for SerdeOrbitalHandle { fn from(handle: OrbitalHandle) -> Self { Self { window: handle.window as usize, } } } impl...
Rust
0
""" Cenário 1: Login bem-sucedido após tentativa com senha incorreta Dado que o usuário possui uma conta válida no sistema e está na página de login do "Automation Practice". Quando o usuário inserir o e-mail correto e uma senha incorreta na primeira tentativa, e após isso inserir a senha correta em uma segunda tenta...
Python
1
&Data::B(ref tri) => { for &i in tri.iter() { mesh.tri_intersect_and_update(i, ry, &mut ans); } break; } } } } ...
Rust
0
_row) .field("resort", &self.resort) .field("row_added", &self.row_added) .field("row_removed", &self.row_removed) .field("row_changed", &self.row_changed) .field("sort_changed", &self.sort_changed) .field("filter_changed", &self.filter_changed) ...
Rust
0
if restraints and res_id in restraints: try: parsed_restraints[res_id].append(atom_index) except: parsed_restraints[res_id] = [atom_index] try: return DockingModel( pisa_objects, ...
Python
1
nager: self.checkpoint_manager.close() if self.progress_tracker: self.progress_tracker.complete() logging.info("Pipeline resources cleaned up") except Exception as e: logging.error(f"Error during cleanup: {e}") def create_pipeline( input...
Python
1
jpath = findBestAmongJobPattern(jobPattern, key=key) os.symlink(jpath, bestpath) def findBestAmongJobPattern(jobPattern, key='initname', prefixfilepath='', **kwargs): ''' Identify single best run among all jobs/tasks matching given pattern. Re...
Python
1
se_clang": True, "has_brew": False, "CC": "/usr/local/bin/clang --target=aarch64-none-elf- -pipe -Wall -march=armv8.4-a", "LD": "/usr/local/bin/ld.lld -maarch64elf --pie", "OBJCOPY": "/usr/local/bin/llvm-objcopy", "OBJDU...
Python
1
(feature = "screen")] pub use self::crossterm_screen::{AlternateScreen, IntoRawMode, RawScreen}; #[cfg(feature = "style")] pub use self::crossterm_style::{ color, style, Attribute, Color, Colored, Colorize, ObjectStyle, StyledObject, Styler, TerminalColor, }; #[cfg(feature = "terminal")] pub use self::crossterm...
Rust
0
user.", method: PUT, name: "set_presence", r0_path: "/_matrix/client/r0/presence/:user_id/status", stable_path: "/_matrix/client/v3/presence/:user_id/status", rate_limited: true, authentication: AccessToken, added: 1.0, } ...
Rust
0
from haystack import indexes from .models import Product class ProductIndex(indexes.SearchIndex, indexes.Indexable): text = indexes.CharField(document=True, use_template=True) created = indexes.DateTimeField(model_attr='created') def get_model(self): return Product def index_queryset(self, u...
Python
1
he `LoadCommand`. /// /// This is one of the `LC_` constants. pub fn cmd(&self) -> u32 { self.cmd } /// Return the `cmdsize` field of the `LoadCommand`. pub fn cmdsize(&self) -> u32 { self.data.len() as u32 } /// Parse the data as the given type. #[inline] pub f...
Rust
0
okenizer = get_model_tokenizer_with_flash_attn( model_dir, model_info, model_kwargs, load_model, model_config=model_config, **kwargs) model_ori = model if model is not None: if not hasattr(model, 'lm_head'): # fix awq model = model.model new_forward = MethodType(patch_baichu...
Python
1
key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. /// * *prettyPrint* (query-boolean) - Returns response with indentations and line breaks. /// * *userIp* (query-string) - IP address of the site where the request orig...
Rust
0
: pass label('loc_32D') Return() # id: 0x0001 offset: 0x32E @scena.Code('func_01_32E') def func_01_32E(): If( ( (Expr.TestScenaFlags, ScenaFlag(0x0042, 3, 0x213)), Expr.Return, ), 'loc_338', ) Jump('loc_33F') def _loc_338(): pass label('l...
Python
1
from pypdf import PdfReader import google.generativeai as genai import json import google.ai.generativelanguage as glm import os from dotenv import load_dotenv from io import BytesIO from passlib.context import CryptContext import typing_extensions as typing class Card(typing.TypedDict): question: str answer:...
Python
1
except Exception as e: QMessageBox.critical(self, "Error", f"An error occurred: {str(e)}") raise # Re-raise for debugging def edit_resource(self): """Edit an existing resource""" try: button = self.sender() resource_json = button.property("reso...
Python
1
ovl, opt, dsm, stm, wine) = options_exist(&config_map, &m_game); load_game(&config, &m_game, gm, ovl, opt, dsm, stm, wine); } else { optimus(m_optimus); dlsym(m_dlsym); game_launch(m_g...
Rust
0
w.pllmul() .variant(pll_config.mul) .pllsrc() .variant(pll_config.src) }); if let Some(pll_div) = pll_config.div { rcc.cfgr2.modify(|_, w| w.prediv().variant(pll_div)); }; rcc.cr.modify(|_, w...
Rust
0
', '𐓺', 'ج', '𞤦', 'ি', '𜽓', '㏳', '🟁', '\u{11c96}', '\u{fe27}', '𑅟', '\u{16af3}', '㊙', '𐒾', 'Ⱬ', 'ꖛ', 'ꔪ', '🛃', '𖽘', 'ꗨ', '⸲', '𝛋', '𜽮', '𑄥', '𐃀', 'ᆚ', 'ߠ', '𘰳', '𘮮', '𑵺', 'ᚕ', '𒂒', 'ቃ', '𝣦', '𑘥', '᭒', '﵍', '拓', '𐩐', '𝐯', '\u{11a3b}', 'ﮜ', '⭛', '\u{10a0c}', '𐓦', 'ꭒ', '𝡥', 'ꐚ', '...
Rust
0
import streamlit as st import requests import io import os from PIL import Image import json from datetime import datetime import time import cv2 import numpy as np # Page configuration st.set_page_config( page_title="AI Facial Recognition System", page_icon="👤", layout="wide", initial_sidebar_state="...
Python
1
e = event_pump.mouse_state(); let mouse_down = [ self.mouse_press[0] || mouse_state.left(), self.mouse_press[1] || mouse_state.right(), self.mouse_press[2] || mouse_state.middle(), self.mouse_press[3] || mouse_state.x1(), self.mouse_press[4] || mouse_state.x2(), ]; imgui.set_mo...
Rust
0
def test_no_pytorch_download_when_doing_safetensors(self): with tempfile.TemporaryDirectory() as tmpdirname: _ = StableDiffusionPipeline.from_pretrained( 'hf-internal-testing/diffusers-stable-diffusion-tiny-all', cache_dir=tmpdirname) path = os.path.join(tmpdirname, ...
Python
1
# # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License"); you may not us...
Python
1
# -*- coding: utf-8 -*- from operator import * def op_deny(target, value): if not isinstance(value, (set, dict, list, str)): return False return target not in value def op_allow(target, value): if not isinstance(value, (set, dict, list, str)): return False return target in value de...
Python
1
t`] decoder. #[derive(Debug, Default)] pub struct RequestedTransportDecoder(U32beDecoder); impl RequestedTransportDecoder { /// Makes a new `RequestedTransportDecoder` instance. pub fn new() -> Self { Self::default() } } impl_decode!(RequestedTransportDecoder, RequestedTransport, |item| Ok( Requ...
Rust
0
rvices), source, last_success, last_sampled, last_attempt, last_active, }) } } /// Source of peer addresses. pub trait AddressSource { /// Sample a random peer address. Returns `None` if there are no addresses left. fn sample(&mut self, se...
Rust
0
e std::path::Path; use shm_ring::{self, control::Cmd, ShmRingId}; fn main() { let client = shm_ring::OpenOptions::new() .open(Path::new("server")) .unwrap(); println!("[.] Allowed methods: {}", client.raw_join_methods()); println!("[.] Members (now, max): {:?}", client.members()); let...
Rust
0
import numpy as np def movie_two_music(movie_beat_list, music_beat_list, TIME_UP=True): # 为所有 动作节奏 匹配 音乐节奏 # 如果有多个 动作节奏 的最近都指向同一个 音乐节奏,那么只有一个动作节奏生效,其他失效 two_list = [] # 最左匹配 LEFT_UP 时间最优 TIME_UP if TIME_UP: mus_i = 1 sub = 0 for i, movie_beat in enumerate(movie_beat_list): ...
Python
1
import netCDF4 import numpy as np def read_etopo1_netcdf(etopo_file,lon_min): ''' -Utpal Kumar etopo_file: str Topography or other data file lon_min: float The mininum longitude indicates its range, either [-180,-180] for negative lon_min or [0,360] for positive lon_min ''' ...
Python
1
pub trait Resugar<T> { fn resugar(&self) -> T; } impl Resugar<concrete::Module> for core::Module { fn resugar(&self) -> concrete::Module { let mut items = Vec::with_capacity(self.items.len() * 2); for item in &self.items { match item { core::Item::Declaration { ...
Rust
0
hape)) final_rewards = (final_rewards+1)/2 if clean_data: human_dataset.clear_data() clean_data = False ### Ground truth human reward ### (for query everything) # final_rewards = human_rewards - 19.2 ai_indices = np.setdiff1d(np.arange(sd_fe...
Python
1
::str; use std::slice; #[cfg(feature = "color")] macro_rules! colour { ($c:ident: $str:expr) => (colorify!($c: $str)) } #[cfg(not(feature = "color"))] macro_rules! colour { ($c:ident: $str:expr) => ($str) } macro_rules! bracket { ($c:ident: $str:expr) => ( concat!(colour!(white_bold2: ...
Rust
0
tput, threshold=threshold, target_sizes=model_output["target_size"] )[0] for index in outputs["scores"].nonzero(): score = outputs["scores"][index].item() box = self._get_bounding_box(outputs["boxes"][index][0]) result = {"score": score, "label":...
Python
1
return true; }; false } /// Extracts the value contained in a variant of `Type`. /// /// # Examples /// /// ``` /// # use stdmath::core::Type; /// # /// let val = Type::Normal(21); /// assert_eq!(val.unwrap(), 21); /// /// let val = Type::Inverse("h...
Rust
0
self._render_single_assignment_progress(assignment_id) elif class_id: # 班级所有作业的批改进度 self._render_class_grading_progress(class_id) else: # 全局批改进度 self._render_global_grading_progress() except Exception ...
Python
1
may occupy a large amount of video memory # if the garbage collection is not triggered in time # when there is plenty of video memory left. Set # `eval.count_flops = False` to avoid this. if not isinstance(ctx.monitor, Monitor): logger.warning( f"The trainer {...
Python
1
if not d: return None o = AlipayCloudHoloinsightMicroappMetricQueryModel() if 'aggregator' in d: o.aggregator = d['aggregator'] if 'downsample' in d: o.downsample = d['downsample'] if 'end' in d: o.end = d['end'] if 'fillpo...
Python
1
cell with two or three live neighbours lives on to the next // generation. assert_eq!(next_state(State::Alive, 2), State::Alive); assert_eq!(next_state(State::Alive, 3), State::Alive); } #[test] fn test_crowding() { // Any live cell with more than three live neighbours dies, as if by // over-popul...
Rust
0
.col, self.vt.row); for i in 0 .. mat.row.min(mat.col) { mat[(i, i)] = self.s[i]; } mat } /// Generated Truncated SVD /// /// ```rust /// extern crate peroxide; /// use peroxide::fuga::*; /// /// fn main() { /// let x = ml_matrix("1 2 3;4 5 6"...
Rust
0
32>, backend: &mut B, varmap: &mut VarMap<V>, ) -> i32 { let repr = repr.unwrap_or_else(|| varmap.new_var()); let var = varmap.add_var(self); backend.add_clause(clause![-var, repr]); repr } fn encode_constraint_equals_repr<B: Backend>( self, ...
Rust
0
get_hosts} for target_host in target_hosts: host_groups[target_host.config.platform][sanitize_host_name(target_host.config.name)] = target_host.get_inventory_variables() inventory = Inventory( host_groups=host_groups, # The `net` group was added to support platform agnostic testing. It...
Python
1
pub use cli::Cli; pub use error::{Error, Result}; use common::ui::UI; use hcore::channel; use hcore::url as hurl; use hcore::package::{PackageIdent, PackageInstall}; use tar::Builder; use std::str::FromStr; use flate2::Compression; use flate2::write::GzEncoder; pub use build::BuildSpec; /// The version of this libra...
Rust
0
l accepted. // This is because warp::filters::query::raw() does not allow empty query strings // but warp::query::<T>() does. fn raw_query() -> impl Filter<Extract = (String,), Error = std::convert::Infallible> + Copy { warp::filters::query::raw() .or(warp::any().map(String::default)) .unify() } <fi...
Rust
0
# Copyright (c) Open-MMLab. All rights reserved. from itertools import chain from torch.nn.parallel import DataParallel from .scatter_gather import scatter_kwargs class MMDataParallel(DataParallel): def scatter(self, inputs, kwargs, device_ids): return scatter_kwargs(inputs, kwargs, device_ids, dim=sel...
Python
1
reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PCSSE_A { #[doc = "0: PCS5/ PCSS is used as the Peripheral Chip Select\\[5\\] signal."] _0 = 0, #[doc = "1: PCS5/ PCSS is used as an active-low PCS Strobe signal."] _1 = 1, } impl From<PCSSE_A> for bool { #[inline(always)] fn from(var...
Rust
0
label to filter the results by Returns: Dict[str, Any]: The analysis results """ # Get analysis results with combined structure result = self.analyze_search_results(query) # Split them back for storage suggested_results = { "news": [item f...
Python
1
global = unsafe { LLVMAddGlobal(self.module.as_ref(), ty, cstr.as_ptr()) }; if let Some(init) = initializer { self.set_initializer(global, init); } global } pub fn set_initializer(&self, global: LLVMValueRef, constant: LLVMValueRef) { use llvm_sys::core::LLVMSetInit...
Rust
0
optimizer_emasc.step() lr_scheduler.step() optimizer_emasc.zero_grad() # Checks if the accelerator has performed an optimization step behind the scenes if accelerator.sync_gradients: progress_bar.update(1) global_step += ...
Python
1
CONFIG.common.taskid.clone(), ); loop { if let Ok(data) = db_rx.recv() { qatrade.sync(data); }; } }); } pub fn wait(&mut self) { match self.s_c.1.try_recv() { ...
Rust
0
_cookie_url(url: &str) -> Result<()> { if url.starts_with("data:") { Err(CdpError::msg("Data URL page can not have cookie")) } else if url == "about:blank" { Ok(()) } else { Err(CdpError::msg("Blank page can not have cookie")) } } <filename>src/attributes.rs use std::os::raw::c_v...
Rust
0
ize(to_u32_arr(offset.into())) as usize] } } impl MutChunk for PaletteIdChunk { type Voxel = PaletteVoxel; fn set(&mut self, offset: Index, value: Self::Voxel) { self.0[ChunkShape::linearize(to_u32_arr(offset.into())) as usize] = value; } } impl IterableSpace for PaletteIdChunk { fn v...
Rust
0
""" --- title: Generalized Advantage Estimation (GAE) summary: A PyTorch implementation/tutorial of Generalized Advantage Estimation (GAE). --- # Generalized Advantage Estimation (GAE) This is a [PyTorch](https://pytorch.org) implementation of paper [Generalized Advantage Estimation](https://arxiv.org/abs/1506.02438)...
Python
1
] impl<T: Config> GenesisBuild<T> for GenesisConfig<T> { fn build(&self) { Pallet::<T>::initialize_validators(&self.validators); } } #[pallet::call] impl<T: Config> Pallet<T> { /// Add a new validator using elevated privileges. /// /// New validator's...
Rust
0
#!/usr/bin/env python # 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, software...
Python
1
} #[test] fn test_tpb() { let url = "magnet:?xt=urn:btih:\ d9be6909325d28912f400fcb324005dd5861e49f&dn=Crunchbang+GNU%2FLinux+-+AMD64+ISO&tr=udp%3A%2F%2Ftracker.\ openbittorrent.com%3A80&tr=udp%3A%2F%2Fopen.demonii.\ com%3A1337&tr=udp%3A%2F%...
Rust
0
is not a border port on cell {}", func_name, port_no, cell_id)] Border { func_name: &'static str, cell_id: CellID, port_no: u8 }, // #[fail(display = "CellAgentError::BorderMsgType {}: Message type {} is not accepted from a border port on cell {}", func_name, msg_type, cell_id)] // BorderMsgType { func_name:...
Rust
0
<Self::Item> { self.current = self.current * self.factor % 2_147_483_647; Some(self.current) } } fn part1(a: usize, b: usize) -> usize { let gen_a = Generator { current: a, factor: 16_807, }; let gen_b = Generator { current: b, factor: 48_271, }; ...
Rust
0
view_size, Size::new(20., 20.)); assert!(!viewport.pan_to_visible(Rect::from_origin_size((10., 10.,), (50., 50.)))); assert_eq!(viewport.view_origin, Point::new(10., 10.)); assert!(viewport.pan_to_visible(Rect::from_origin_size((30., 10.,), (5., 5.)))); assert_eq!(viewport.view_origin, ...
Rust
0
# Copyright 2024 Google LLC # # 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 # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, s...
Python
1
yConfig( output_format="svg", clustering_enabled=False, quiet=True ) result = create_overlay(input_files, output_path, config) mock_combined.save_svg.assert_called_once_with(str(output_path)) assert result == output_path @patch("flatprot.utils.overlay_utils.logger") ...
Python
1
import pudgy from .components import UIComponent import flask # https://stackoverflow.com/questions/1094841/reusable-library-to-get-human-readable-version-of-file-size def sizeof_fmt(num, suffix='B'): for unit in ['','Ki','Mi','Gi','Ti','Pi','Ei','Zi']: if abs(num) < 1024.0: return "%3.1f%s%...
Python
1
# Copyright (c) Alibaba, Inc. and its affiliates. import unittest from modelscope.hub.snapshot_download import snapshot_download from modelscope.models import Model from modelscope.models.nlp import ModelForMachineReadingComprehension from modelscope.pipelines import pipeline from modelscope.pipelines.nlp import Machi...
Python
1
UU5GHbn[AURB[RD5(a"[FR]SURB5 MOURBRJnUR6nUUn[AU[R^[N45(...
Python
1
msg) IS40 = bds40.is40(msg) IS50 = bds50.is50(msg) IS60 = bds60.is60(msg) IS44 = bds44.is44(msg) IS45 = bds45.is45(msg) if mrar: allbds = np.array( [ "BDS10", "BDS17", "BDS20", "BDS30", "BDS40", ...
Python
1
adic_error(tcx.sess, arg.span, arg_ty, "c_double"); } ty::Int(ty::IntTy::I8 | ty::IntTy::I16) | ty::Bool => { variadic_error(tcx.sess, arg.span, arg_ty, "c_int"); } ty::Uint(ty::UintTy::U8 | ty::UintTy::U16) => { ...
Rust
0
import enum import typing import pymongo class Order(int, enum.Enum): ASCENDING = pymongo.ASCENDING DESCENDING = pymongo.DESCENDING class IndexType(str, enum.Enum): GEO2D = pymongo.GEO2D GEOSPHERE = pymongo.GEOSPHERE HASHED = pymongo.HASHED TEXT = pymongo.TEXT class Index(pymongo.IndexMod...
Python
1
215), # 深蓝色 QColor(200, 0, 0), # 深红色 QColor(0, 150, 0), # 深绿色 QColor(200, 120, 0), # 深橙色 QColor(130, 0, 200), # 深紫色 QColor(0, 150, 150), # 深青色 QColor(200, 100, 100), # 深粉色 ...
Python
1
ter().any(|x| { (x.targets() & origin_bb != Bitboard::EMPTY) && (Self::sliding_piece_targets(x, occupancy_after_move) & target_bb) != Bitboard::EMPTY }); !king_in_check_after_move } } } /...
Rust
0
#!/usr/bin/env python # -*- encoding: utf-8 -*- # @Author: https://github.com/Evil0ctal/ # @Time: 2021/11/06 # @Update: 2023/09/25 # @Version: 3.1.8 # @Note: # Core code, valued at 1 bucks (๑•̀ㅂ•́)و✧ # For scraping Douyin/TikTok/Bilibili data and returning it in dictionary form. # If this project is helpful to you, ple...
Python
1
# Tag: Math, Dynamic Programming, Sliding Window, Probability and Statistics # Time: O(N) # Space: O(N) # Ref: - # Note: - # Video: https://youtu.be/o8EYRHd-D_U # Alice plays the following game, loosely based on the card game "21". # Alice starts with 0 points and draws numbers while she has less than k points...
Python
1
i, manifold in enumerate(self.manifolds): x_ = self.take_submanifold_value(x, i) res.append( manifold.mobius_fn_apply( fn, x_, *args, dim=-1, project=project, **kwargs ) ) return self.pack_point(*res) def mobius_fn_appl...
Python
1
""" test case for read account for service""" def test_get_account(self): """It should Read a single Account""" account = self._create_accounts(1)[0] resp = self.client.get( f"{BASE_URL}/{account.id}", content_type="application/json" ) self.assertEqual(resp.stat...
Python
1
#-*-coding:utf-8 -*- ''' 여러분의 시크릿 키와 엑세스 키를 ende_key.py에 있는 키를 활용해서 암호화한 값을 넣으세요 마찬가지 방법으로 아래 로직을 실행하시면 됩니다.. (ende_key.py 참조) from cryptography.fernet import Fernet class SimpleEnDecrypt: def __init__(self, key=None): if key is None: # 키가 없다면 key = Fernet.generate_key() # 키를 생성한다 s...
Python
1
ned. /// /// To be more explicit, it is the ID of each asset object that maps the response to the request. So /// if a request for a title object is sent with id 1, then the response containing the title should /// have an id of 1. /// /// Since version 1.1 of the spec, there are recommended sizes/lengths/etc with some...
Rust
0
ences"), Document::from(Series::from(library::rite2::OPENING_SENTENCES.clone()))), ] }; } #![cfg_attr(not(feature = "std"), no_std)] #[cfg(test)] mod tests; use serde::Serialize; use codec::{Decode, Encode}; use core::convert::TryInto; use frame_support::traits::Currency; use pallet_timestamp as timestamp...
Rust
0
if prediction[0] != "" and prediction[0] != None: return prediction except Exception as e: if "Rate limit" not in str(e): print(e) if "Please reduce the length of the messages" in str(e): print("!!Reduce promot size") ...
Python
1
lf, f: &mut fmt::Formatter) -> fmt::Result { write!(f, "\n\t\tAllocInfo\n\t\t locals: {:?}\n\t\t unspillables: {:?}]\n\t\t spills: {:?}\n\t\t framecs: {:?}\n\t\t regs: {:?}\n", self.locals, self.unspillables, self.spills, self.frame_conflicts, self.register_conflicts) } } #[derive(Debug,Clon...
Rust
0
::Add => Self::Add { op1: Operand::new(param1_mode, machine.read_mem(ip + 1)), op2: Operand::new(param2_mode, machine.read_mem(ip + 2)), address: Operand::new(param3_mode, machine.read_mem(ip + 3)), }, OpCodeType::AdjustBase => Self::Adjust...
Rust
0
!= 0 } /// Synchronizes a subset of threads in a warp then performs a reduce-and-broadcast operation, returning /// an integer where every Nth bit is set only if the predicate from the Nth thread is `true`. Inactive threads will /// be counted as a `0` in the mask for that bit. Mask is usually [`u32::MAX`]. /// /// # ...
Rust
0
Display : {}s / {}s\n\n", sec_printer_bsy, sec_printer_all), ); } exit(0, &mut console); } use std::fmt; use crate::iam::{repos::user_repo::UserRepository, services::auth_service}; pub struct GenerateAuthTokensDTO { pub username: String, pub password: String, } pub struct GenerateAuthTokensD...
Rust
0