text
string
label_name
string
labels
int64
ments_by_xpath('//tr[@class="sf-global-component sf-table-row"]')[5:10]] inbound_links = [('Backlink = {}'.format(i.text.split('\n')[0]), 'Domain Organic Clicks = {}'.format(i.text.split('\n')[1]), 'Page Organic Clicks = {}'.format(i.text.split('\n')[2]), 'Domain Strength = {}'.format(i.text.split('\n')[3]), 'Ranked ...
Python
1
users` ( `id` INTEGER PRIMARY KEY AUTOINCREMENT, `username` TEXT, `password` TEXT, `login_ip` TEXT, `login_time` TEXT, `phone` TEXT, `email` TEXT ); INSERT INTO users VALUES(1,'admin','21232f297a57a5a743894a0e4a801fc3','192.168.0.10','2016-12-10 15:12:56','0','aaa@qq.com'); CREATE TABLE `tasks` ( `id` I...
Python
1
'a str, Self> { use nom::{ bytes::complete::tag, combinator::{map, opt}, multi::many0, }; let (s, components) = many0(component)(s)?; // The trailing slash is only required if no components were found (i.e. if no components // are found, then...
Rust
0
pell_speller_error(self.__speller) != 0: msg = self.__lib.aspell_speller_error_message(self.__speller) raise AspellSpellerError(_from_bytes(msg)) #class Aspell = AspellLinux if __name__ == '__main__': # TODO: more test cases a = Aspell(("lang", "en")) print("when" in a) print(a.check("when")) print(a.sugg...
Python
1
ds_list, axis=0) # [agent, intersection] self.metric.update(rewards) r_step.append(self.metric.rewards()) if all(dones): break self.logger.info("Final Travel Time is %.4f, mean rewards: %.4f, queue: %.4f, delay: %.4f, throughput: %d" % (self.metric.re...
Python
1
urns: The fetched values of `final_ops` or `None` if `final_ops` is `None`. """ eval_step = _get_or_create_eval_step() # Prepare the run hooks. hooks = list(hooks or []) if eval_ops is not None: if any(isinstance(h, _MultiStepStopAfterNEvalsHook) for h in hooks): steps_per_run_variable = \ ...
Python
1
from __future__ import annotations from typing import TYPE_CHECKING, TypedDict, cast import torch from mjlab.entity import Entity from mjlab.managers.scene_entity_config import SceneEntityCfg from .velocity_command import UniformVelocityCommandCfg if TYPE_CHECKING: from mjlab.envs import ManagerBasedRlEnv _DEFA...
Python
1
>>) -> Point<1> { Point { coords: self.vector_to_line_coords(point.into() - self.origin), } } /// Convert a `D`-dimensional vector to line coordinates pub fn vector_to_line_coords( &self, vector: impl Into<Vector<D>>, ) -> Vector<1> { let t = vector.i...
Rust
0
sted if reraise_on_final_failure and last_exception: raise last_exception else: logger.warning(f"⚠️ {func.__name__} failed after all retries, returning None") return None return wrapper return decorator def retry_api...
Python
1
t, info: MessageInfo, mix_node: MixNode, ) -> Result<HandleResponse, ContractError> { let minimum_bond = query_state_params(deps.as_ref()).minimum_mixnode_bond; validate_mixnode_bond(&info.sent_funds, minimum_bond)?; let bond = MixNodeBond::new(info.sent_funds, info.sender.clone(), mix_node); ...
Rust
0
. # - Then combine the results together to get a fully labeled MR image. # # The output of our model will be a 4D array with 3 probability values for each voxel in our data. # - We then can use a threshold (which you can find by a calibration process) to decide whether or not to report a label for each voxel. # # ...
Python
1
::gen::models::WorkflowTransitionRulesUpdateErrorDetails>, ) -> WorkflowTransitionRulesUpdateErrors { WorkflowTransitionRulesUpdateErrors { update_results } } } <filename>src/ast/bind.rs<gh_stars>0 use super::*; use crate::layout; use crate::primitives::{self, Atom, AtomContent}; use serde::Serialize; ...
Rust
0
# Part of Odoo. See LICENSE file for full copyright and licensing details. { "name": "Indian - Check GST Number Status", 'countries': ['in'], "category": "Accounting/Localizations", "depends": [ "l10n_in", ], "data": [ "views/account_move_views.xml", "views/res_partner_vi...
Python
1
import pgzrun, random WIDTH = 600 HEIGHT = 600 bobo = Actor('波波') bobo.x = 300 bobo.y = 300 ball = Actor('能量球') ball.x = random.randint(ball.width // 2, WIDTH - ball.width // 2) # 为能量球设置初始y坐标 ball.y = random.randint(ball.height // 2, HEIGHT - ball.height // 2) direction = '' def draw(): screen.blit('奇妙岛', (0, ...
Python
1
"name": "highlights", "option_instruction": """ set responsetype for highlights Empty string is consider to be 'highlights' """, "default": data.get_highlights_responsetype(), "message": "highlight responsetype mapping: ", }, { ...
Python
1
= [] if distfn.shapes is None else distfn.shapes.split(", ") kwd_shapes = dict(zip(shapes, arg or [])) # dictionary of shape kwds alpha = kwd_shapes.pop('alpha', None) def my_interval(*args, **kwds): return (distfn.ppf(0.25, *args, **kwds), distfn.ppf(0.75, *args, **kwds)) mes...
Python
1
= "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"] #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"] pub type WakeLockSentinel; #[cfg(web_sys_unstable_apis)] # [wasm_bindgen (structural , m...
Rust
0
int ) -> JNIResult<()> { let pixel_wand = env.get_handle::<PixelWand>(pixel_wand)?; let width = bytemuck::cast::<jlong, u64>(width); let height = bytemuck::cast::<jlong, u64>(height); #[cfg(target_os="android")] let compose = compose as u32; res_to_jniresult!(self.b...
Rust
0
"emotional_needs": { "subcategory_name": "情感需求", "active_tags": [], "dominant_tag": None, "dimension_weight": 0.0, "stability_score": 0.0, "conflict_history":...
Python
1
(datums, temp_storage)? == Datum::False).into()) } fn output_type(&self, _input_type: ColumnType) -> ColumnType { ScalarType::Bool.nullable(false) } fn propagates_nulls(&self) -> bool { false } fn introduces_nulls(&self) -> bool { false } fn preserves_uniquene...
Rust
0
if type(pixel_group) is not tuple: pixels[pixel_group] = backprocess_sequence(pixels[pixel_group]) if type(pixels[pixel_group]) is int: adds = [pixels[pixel_group]] else: adds = pixels[pixel_group].split("...
Python
1
xecute_into_value(wsv), FindAssetById(query) => query.execute_into_value(wsv), FindAssetsByName(query) => query.execute_into_value(wsv), FindAssetsByAccountId(query) => query.execute_into_value(wsv), FindAssetsByAssetDefinitionId(query) => query.execute_into_value(wsv), ...
Rust
0
S credentials AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY_ID_ENV') AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_ACCESS_KEY_ENV') AWS_STORAGE_BUCKET_NAME = 'track-finance' AWS_S3_REGION_NAME = 'us-east-1' # Set AWS S3 custom domain (optional) AWS_S3_CUSTOM_DOMAIN = f'{AWS_STORAGE_BUCKET_NAME}.s3.amazonaws.com' STAT...
Python
1
PartialOrd, Ord)] enum Outcome { InFlight(isize, isize), Miss(isize, isize), Kaboom, } impl Outcome { fn in_flight(&self) -> bool { matches!(self, Outcome::InFlight(_, _)) } } #[derive(Debug, Clone)] struct War { x: isize, y: isize, dx: isize, dy: isize, x_range: Range...
Rust
0
from tkinter import * from tkinter import messagebox def check_strength(): password = password_entry.get() length = len(password) if length <= 5: strength = "Weak" color = "red" elif 6 <= length <= 8: strength = "Medium" color = "yellow" elif 9 <= length <= 12: ...
Python
1
be unstable :( fn test_current_idle() { let mut cpu = TestCpuEnv::mock_busy(2); let total_after_busy = cpu.current_idle(); cpu.metrics.stop_busy(); let total = cpu.current_idle(); assert!( (total - total_after_busy - 2f64).abs() < 0.5f64, "total and t...
Rust
0
if match == Match.narrow: # return predicate in self.predicates["narrow"] or predicate in self.predicates[Match.exact] return False if match == Match.broad: # return predicate in self.predicates["broad"] or predicate in self.predicates[Match.exact] return False...
Python
1
manipulation impl crate::Cpu { pub fn set_flags(&mut self, (n, z, c, v): Flags) { self.cpsr.n = n; self.cpsr.z = z; self.cpsr.c = c; self.cpsr.v = v; } } #[inline] pub fn with_flags(result: u32, c: bool, v: bool) -> (u32, Flags) { (result, (result.bit(31), result == 0, c, v...
Rust
0
import asyncio import os import threading import requests from PyQt5.QtGui import QPixmap from Barrage import Tiktok from Model.TikTok import BarrageMessage import sys from PyQt5 import QtWidgets from Windows import MainWindowUI from GPT import Chat from Utils import Config, Common MAIN_WINDOW = MainWindowUI() LIVE...
Python
1
, KPJPComma, KPEnter, KPSlash, Macro, Mute, VolumeDown, VolumeUp, Power, /* SC System Power Down */ KPEqual, KPPlusMinus, Pause, Scale, /* AL Compiz Scale : c_int = Expose */ KPComma, Hangeul, Hanja, Yen, Compose, Stop, /* AC Stop */ Again, Props, /* AC Properties */ Undo, /* AC Undo */ Front, Co...
Rust
0
: 1.5, }); } world.objects.push(Box::new(Sphere { center, radius: 0.2, material, })); } } } world.objects.push(Box::new(Sphere { center: Point::new(0.0, 1...
Rust
0
header.block_hash(), short_channel_id: 2, timestamp: 2, flags: 0, cltv_expiry_delta: 0, htlc_minimum_msat: 35_000, htlc_maximum_msat: OptionalField::Present(40_000), fee_base_msat: 0, fee_proportional_millionths: 0, excess_data: Vec::new() }); update_channel(&net_graph_msg_handler, &secp_...
Rust
0
rica do Sul', 'SOUTH KOREA': 'Coréia do Sul', 'SPAIN': 'Espanha', 'SRI LANKA': 'Sri Lanka', 'SUDAN': 'Sudão', 'SURINAME': 'Suriname', 'SWAZILAND': 'Suazilândia', 'SWEDEN': 'Suécia', 'SWITZERLAND': 'Suíça', 'SYRIA': 'Síria', 'TAIWAN': 'Taiwan', 'TANZANIA': 'Tanzânia', 'THAILAND': 'Tailândia', 'TOGO': 'Togo'...
Python
1
ync, /// CA repository URI. #[structopt(long="ca-repository")] ca_repository: uri::Rsync, /// RPKI manifest URI. #[structopt(long="rpki-manifest")] rpki_manifest: uri::Rsync, /// Optional RPKI notify URI. #[structopt(long="rpki-notify")] rpki_notify: Option<uri::Https>, /// I...
Rust
0
#!/usr/bin/env python3 """ Test to verify that the stream parameter is correctly passed through the agent.chat() method. This tests the fix for the issue where stream=self.stream was being used instead of the passed parameter. """ import os from praisonaiagents import Agent # Use a simple model for testing os.environ...
Python
1
("ZA", "South Africa"), ("GS", "South Georgia and the South Sandwich Islands"), ("KR", "South Korea"), ("SS", "South Sudan"), ("ES", "Spain"), ("LK", "Sri Lanka"), ("SD", "Sudan"), ...
Python
1
rx } /*pub fn stream2(&mut self) -> tokio::sync::mpsc::UnboundedReceiver<CanMessage> { // foreach network, // spawn a listener task // pass in the tx // return the rx // -- spawning the listener task doesn't work here because it wants to clone the sock...
Rust
0
string(), }; let subnet_id_to_recover = subnet_test_id(1000); let subnet_id_to_request_key_from = subnet_test_id(1003); let (mut registry, subnet_id_holding_key) = setup_registry_with_subnet_holding_key(&key_id); assert_ne!(subnet_id_holding_key, subnet_id_to_request_key_from); ...
Rust
0
sequence: ['-', ':'], character: '\u{00f7}', description: "DIVISION SIGN", }, Digraph { sequence: ['o', '/'], character: '\u{00f8}', description: "LATIN SMALL LETTER O WITH STROKE", }, Digraph { sequence: ['u', '!'], ...
Rust
0
x05,// Normal_3 0x04,// 4 = "add" 0x71,// 'q' 0x01,// 0x1 = MnemonicSuffixIfMem // Or_rm16_imm8 0x05,// Normal_3 0x07,// 7 = "or" 0x77,// 'w' 0x01,// 0x1 = MnemonicSuffixIfMem // Or_rm32_imm8 0x05,// Normal_3 0x07,// 7 = "or" 0x6C,// 'l' 0x01,// 0x1 = MnemonicSuffixIfMem // Or_rm64_imm8 0x05,// Normal...
Rust
0
x!(atto) * prefix!(atto); "am²", "square attometer", "square attometers"; @square_zeptometer: prefix!(zepto) * prefix!(zepto); "zm²", "square zeptometer", "square zeptometers"; @square_yoctometer: prefix!(yocto) * prefix!(yocto); "ym²", "square yoctometer", "square yo...
Rust
0
out; } pub const MAX_CHARACTERS: u32 = 500; pub struct FontTextureCache { images: HashMap<Handle<KayakFont>, GpuImage>, pub(crate) bind_groups: HashMap<Handle<KayakFont>, BindGroup>, fonts: HashMap<Handle<KayakFont>, KayakFont>, new_fonts: Vec<Handle<KayakFont>>, updated_fonts: Vec<Handle<KayakFon...
Rust
0
), GreaterThan(GreaterThan), Minus(Minus), Bang(Bang), JumpNotTruthy(JumpNotTruthy), Jump(Jump), Null(Null), GetGlobal(GetGlobal), SetGlobal(SetGlobal), Array(Array), Hash(Hash), Index(Index), Call(Call), ReturnValue(ReturnValue), Return(Return), GetLocal(GetL...
Rust
0
def get_replacement_mapper(prompts, tokenizer, max_len=77): x_seq = prompts[0] mappers = [] for i in range(1, len(prompts)): mapper = get_replacement_mapper_(x_seq, prompts[i], tokenizer, max_len) mappers.append(mapper) return torch.stack(mappers)
Python
1
plt.figure(figsize=(8, 5)) plt.plot(xs, ys, marker="o", label="Subset AUC") plt.axhline(auc_full, color="gray", linestyle="--", label="Full AUC") plt.axhline(target_coverage * auc_full, color="green", linestyle=":", label=f"{int(target_coverage*100)}% target") plt.xlabe...
Python
1
t_address, tls, &auth_type).and_then( |config_filename| { Some(super::config_from_filename(&config_filename)).transpose() }, ) } fn touch_config_file() -> Result<()> { let config_filename = crate::dirs::Dirs::new() .config_file(super::CONFIG_FILENAME, false) .unwrap(...
Rust
0
assert_eq!(get_malloc_walk(&e.memory, beg_ptr, end_ptr), &[(false, 256), (true, 256), (false, 256), (true, 4096)]); assert_eq!(e.execute_cycles(u64::MAX).1, StopReason::ForfeitTimeslot); let fin = e.cpu.get_rax(); assert!(big + 4096 <= fin); assert_eq!(fin % MALLOC_ALIGN, 0); assert_eq!(get_mal...
Rust
0
`IsNegative` for `i8`, but don't want the same for `i16` and `i32`. We could //! do the following: //! //! ``` //! # trait IsNegative { fn is_negative(&self) -> bool;} //! # use duplicate::duplicate_item; //! #[duplicate_item( //! int_type implementation; //! duplicate!{ //! [ ...
Rust
0
gs::from_args(); debug!("Options: {:#?}", opt); let mut provider = Leetcode::new(); match opt.command { Command::Pick(pick) => { provider.pick_problem(pick)?; } Command::List(list) => { provider.list_problems(list)?; } Command::User(user) => {...
Rust
0
dicator) -> *const gchar; } extern "C" { pub fn app_indicator_get_icon_desc(self_: *mut AppIndicator) -> *const gchar; } extern "C" { pub fn app_indicator_get_icon_theme_path(self_: *mut AppIndicator) -> *const gchar; } extern "C" { pub fn app_indicator_get_attention_icon(self_: *mut AppIndicator) -> *const gchar...
Rust
0
#!/usr/bin/env python """ Install wagtail-metadata using setuptools """ from setuptools import find_packages, setup with open("README.rst", "r") as f: readme = f.read() setup( name="wagtail-metadata", version="5.0.0", description="A tool to assist with metadata for social media.", long_descriptio...
Python
1
mut desmos_string = String::from("\\left["); for i in obj .data .objects .iter() .flat_map(|o| &o.groups) .map(|g| &g.polys) { for poly in i.iter().map(|p| &p.0) { desmos_string.push_str("\\operatorname{polygon}\\left("); for point_idx in p...
Rust
0
ation_body, if is_async { InstrSeq::gather(vec![ instr::memoget_eager(notfound.clone(), suspended_get.clone(), None), instr::retc(), instr::label(suspended_get), instr::retc_suspended(), ]) } else { Instr...
Rust
0
able,and the trait. #[derive(Debug, Clone, Default)] pub(crate) struct OwnedDeriveAndOtherAttrs { /// The attributes used in the vtable. pub(crate) derive_attrs: Vec<Meta>, /// The attributes used in the trait. pub(crate) other_attrs: Vec<Meta>, } ///////////////////////////////////////////////////////...
Rust
0
self.watched_paths.discard(path_str) info_logger(f"Stopped watching for code changes in: {path_str}") return {"message": f"Stopped watching {path_str}."} def list_watched_paths(self) -> list: """Returns a list of all currently watched directory paths.""" return list(self.watch...
Python
1
pl Version { pub const fn new(number: u64) -> Self { Self { number } } pub const fn into_sled_key(self) -> [u8; 8] { self.number.to_be_bytes() } } #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub enum AbortReason { /// Failed to find a path from the one parent version to another. ...
Rust
0
ionCheckpointer(model, save_dir=cfg.OUTPUT_DIR).resume_or_load( cfg.MODEL.WEIGHTS, resume=args.resume ) res = Trainer.test(cfg, model) if comm.is_main_process(): verify_results(cfg, res) return res trainer = Trainer(cfg) trainer.resume_or_load(resume=args...
Python
1
nsearch.opensearch_service_domains_not_publicly_accessible.opensearch_service_domains_not_publicly_accessible import ( opensearch_service_domains_not_publicly_accessible, ) check = opensearch_service_domains_not_publicly_accessible() result = check.execute() ...
Python
1
__m128i::zeroed(), mid: __m128i::zeroed(), lo: __m128i::zeroed(), power, } } #[inline(always)] // This implementation is written to closely follow the original code #[allow(unknown_lints, clippy::needless_late_init)] fn update<P: Powers>(&self, powers: &...
Rust
0
::{BufReader, AsyncBufReadExt}; use winapi::um::winbase::{CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, DETACHED_PROCESS}; use crate::window::Command; #[tokio::main] pub async fn execute(commands: Command) { for command in commands.file { std::process::Command::new(command) .creation_flags(DETACHED_P...
Rust
0
} if let Some(rest) = &record.rest { write!(fmt, "*{}", rest)?; } write!(fmt, ")")?; Ok(()) } Self::Tuple(tuple) => { write!(fmt, "(")?; match tuple { O...
Rust
0
0 //|| registers.program_counter == 0x6d // { // emulator_loop = false; // println!("Location: {:04X}\tOpcode: 0x{:02X} {:08b}", address, opcode, opcode); // } //Cleanup? } pub struct App { gl: GlGraphics } impl App { fn render(&mut self, img: &RgbaImage, args:...
Rust
0
test)] extern crate test; use self::test::Bencher; use std::iter; use super::MerkleTree; #[bench] fn build(b: &mut Bencher) { let block = "Hello World"; let blocks: Vec<&str> = iter::repeat(block).take(100).collect(); b.iter(|| { let n = test::black_box(100); for _i in 0..n { ...
Rust
0
e_save_url is %s, the output file will be uploaded to here.", remote_save_url) set_remote_save_url(remote_save_url) config.remote_save_url = remote_save_url if run_mode in ['train', 'finetune']: config.model.model_config.use_past = False if seq_length is not None: config.model....
Python
1
from ..extensions import db class Vault(db.Model): __tablename__ = 'vaults' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String, nullable=False) # Relations credentials = db.relationship('Credential', back_populates='vault', cascade='all, delete-orphan') tags = db.relation...
Python
1
verz.wett.decr.besl.", "vgl.", "vid.", "viss.w.", "vl.parl.", "vl.r.", "vl.t.gez.", "vl.w.reg.", "vl.w.succ.", "vlg.", "vn.", "vnl.", "vnw.", "vo.", "vo.bl.", "voegw.", "vol.", "volg.", "volt.", "deelw.", "voorl.", "voorz.", "vord.w...
Python
1
__global float* dst_buf) { uint i = get_global_id(0); dst_buf[i] = src_buf[i] * coeff; } "; fn init_kernel() { let (device, ctx, queue) = opencl::util::create_compute_context() .expect("Could not initialise OpenCL"); const COEFF: f32 ...
Rust
0
repare(&conn); let people: Result<Vec<_>, _> = stmt.query()?.collect(); assert_eq!(people?, vec![SelectPersonRow { id: 1, name: "Steven".into(), data: Some(vec![1u8, 2u8]) }, SelectPersonRow { id: 2, name: "John".into(), data: None }, Sel...
Rust
0
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5...
Rust
0
twalk; pub mod utils; pub use super::utils::{HasElement, HasLen, InitFromLen, ItemSwapable, Resizeable}; //pub use self::utils::shuffle; pub use self::init_ensemble::get_one_init_realization; impl<T> HasLen for Vec<T> { fn len(&self) -> usize { Vec::len(self) } } impl<T: Default + Clone> InitFromLen...
Rust
0
f, "READ "); flags = flags | mem::mmu::PageTableEntryFlags::readable() | mem::mmu::PageTableEntryFlags::accessed(); } kdebugln!(Elf, "{} bytes", header.memsz); if header.flags & 1 > 0 { text_size += (header.memsz + mem::PAGE_SIZE - 1) / mem::PAGE_SIZE; } ...
Rust
0
m: Option<String>, new_xb: Option<String>, new_csrq: Option<NaiveDateTime>, new_jg: Option<String>, new_sjhm: Option<String>, new_yxh: Option<String>, pool: web::Data<Pool>, ) -> ServiceResult<()> { let conn = &db_connection(&pool)?; diesel::update(student::table.filter(student::xh.eq(x...
Rust
0
gs.append(f"{note}") output_strings=process_report_observations( primary_observations=path_report_components.primary_observations, resources_by_fullUrl=resources_by_fullUrl, ) text_report_strings.append("") text_report_strings.append(f"RESULTS") for output_string in output_s...
Python
1
) args = parser.parse_args() trained_model_folder = get_output_folder(args.dataset_name_or_id, args.tr, args.p, args.c) if args.o is None: merged_output_folder = join(trained_model_folder, f'crossval_results_folds_{folds_tuple_to_string(args.f)}') else: merged_output_folder = args.o ...
Python
1
# -*- coding: utf-8 -*- from vsg.token.psl import fairness_statement as token from vsg.vhdlFile import utils def detect(iToken, lObjects): """ [ label : ] Fairness_Statement Cover_Directive ::= fairness Boolean ; | strong fairness Boolean, Boolean ; """ if ( utils.are_next...
Python
1
op_name: name.to_string(), op_names: self.op_names.clone(), } } /// Return a unique name, using default_name if an op name has not been /// specified. pub fn get_unique_name_for_op(&self, default_name: &str) -> String { let name = if self.op_name == "" { ...
Rust
0
.dist((ra_orig[a], dec_orig[a]), (ra_nearby, dec_nearby)) b_nearest = numpy.argsort(d) dmask = d[b_nearest] * 60 * 60 > radius #d = d[dmask] b_nearest = b_nearest[dmask] assert len(b_nearest) > 0, "Method failed: No sources found nearby, could not interpolate a fake source." #print('have %d neighbors' % len(b_n...
Python
1
s_ck } /// Returns the input frequency to the SCGU - ALIAS pub fn sysclk(&self) -> Hertz { self.sys_ck } /// Returns the CK_INT frequency for timers on APB1 pub fn timx_ker_ck(&self) -> Hertz { self.timx_ker_ck } /// Returns the CK_INT frequency for timers on APB2 ...
Rust
0
) mock_script.has_mutation.return_value = False mock_script.statements = [Mock(), Mock()] # Two statements mock_sqlscript_class.return_value = mock_script with pytest.raises(SupersetSecurityException) as exc_info: get_virtual_table_metadata(mock_dataset) assert ( ...
Python
1
df) def _mover_pdf_e_atualizar_planilha(self, cnpj, texto, caminho_pdf): logging.info(f"Movendo PDF e atualizando planilha para o CNPJ: {cnpj}") if "NEGATIVA" in texto.upper() and "POSITIVA COM EFEITO DE NEGATIVA" not in texto.upper(): novo_dir = self.dirs['negativos'] statu...
Python
1
, &request); } RequestType::PostFile => { let base = request.get_base(); let files = &base.files; let resp = HttpTool::post_file(self.url, all_params, files, headers); struct_obj = self.parse_response(resp, &...
Rust
0
2), (3, 3), (4, 4), (5, 5), (6, 6)]; let mut map: HashMap<_, _> = xs.iter().cloned().collect(); let mut iter = map.iter_mut(); for _ in iter.by_ref().take(3) {} assert_eq!(iter.len(), 3); } #[test] fn test_index() { let mut map = HashMap::new(); map.insert(1, 2); map.insert(2, 1...
Rust
0
emove all punctuation from the given Pandas Series and replace it with a single space. It considers as punctuation characters all :data:`string.punctuation` symbols `!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~).` See also :meth:`replace_punctuation` to replace punctuation with a custom symbol. Examples ...
Python
1
u8 { match self { Value::Double(..) => 1, Value::Float(..) => 5, Value::Int32(..) => 0, Value::Int64(..) => 0, Value::UInt32(..) => 0, Value::UInt64(..) => 0, Value::SInt32(..) => 0, Value::SInt64(..) ...
Rust
0
# backend/model_evaluator.py import os import pandas as pd import numpy as np from sklearn.metrics import classification_report, confusion_matrix, accuracy_score, roc_curve, auc import tensorflow as tf from tensorflow.keras.models import load_model import matplotlib.pyplot as plt import logging # Set up logging logge...
Python
1
""" An (almost) infinite cable with pulse injection in the middle. """ from brian2 import * defaultclock.dt = 0.001*ms # Morphology diameter = 1*um Cm = 1*uF/cm**2 Ri = 100*ohm*cm N = 500 morpho = Cylinder(diameter=diameter, length=3*mm, n=N) # Passive channels gL = 1e-4*siemens/cm**2 EL = -70*mV eqs = ''' Im = gL *...
Python
1
king_memory : int or float, default=None The number of rows to fit inside this number of MiB will be returned. When None (default), the value of ``sklearn.get_config()['working_memory']`` is used. Returns ------- int The number of rows which can be processed within `working_...
Python
1
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
Python
1
# Copyright 2019 Huawei Technologies Co., Ltd # # 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...
Python
1
lts { /// Any errors encountered by the request pub errors: String, /// Request completion success or failure pub success: bool, /// Nominal telemetry pub telemetry_nominal: StdTelem, /// Debug telemetry pub telemetry_debug: TelemetryDebug, } /// Response fields for 'testHardware(test: ...
Rust
0
from PyQt5 import QtCore, QtGui, QtWidgets import sys from PyQt5.QtWidgets import * from subwindow import SubWindow class MyWindow(QWidget): def __init__(self): super(MyWindow,self).__init__() # 总体界面 self.setWindowTitle("相机标定程序") self.resize(525,425) # 元素 # 两个按钮 ...
Python
1
d": scan_id, "vuln_id": vuln_id}, ) self.assertEqual(response.status_code, 302) self.assertRedirects(response, "/networkscanners/list_scans/") vuln_id = NetworkScanResultsDb.objects.filter(vuln_id=vuln_id).values() self.assertEqual(str(vuln_id), "<QuerySet []>") # from a...
Python
1
.save() revisions = await thingy.get_revisions().to_list(length=10) assert revisions[1].operation == "update" await thingy.delete() revisions = await thingy.get_revisions().to_list(length=10) assert revisions[2].operation == "delete" def test_versioned_versioned(TestVersionedThingy): thingy =...
Python
1
import os import torch import yaml, time from collections import defaultdict from diffusion.score_model import TensorProductScoreModel def get_model(args): return TensorProductScoreModel(in_node_features=args.in_node_features, in_edge_features=args.in_edge_features, ns=args.ns,...
Python
1
#[deprecated] pub fn onNewPicture<'env>(&'env self, arg0: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::webkit::WebView>>, arg1: impl __jni_bindgen::std::convert::Into<__jni_bindgen::std::option::Option<&'env crate::android::graphics::Picture>>) -> __jni_bindgen::st...
Rust
0
shape, and [serde](https://serde.rs/) serializers and deserializers for both the [human-readable encoding](https://github.com/AljoschaMeyer/valuable-value#human-readable-encoding) and the [compact encoding](https://github.com/AljoschaMeyer/valuable-value#compact-encoding). //! //! There is no support for the [canonic ...
Rust
0
ntManager::distribute_supplier_mnt(underlying_asset, who, false)?; T::MultiCurrency::withdraw(wrapped_id, &who, wrapped_amount)?; T::MultiCurrency::transfer( underlying_asset, &T::ManagerLiquidityPools::pools_account_id(), &who, underlying_amount, )?; Ok((underlying_amount, wrapped_id, wrapped_am...
Rust
0
#!/usr/bin/env python3 """ Simulate monkeys """ import copy import math import re def read_monkey(input): first_line = next(input) while not first_line.strip(): first_line = next(input) m = re.match('Monkey\\s+(\\d+):', first_line) r = dict(i=0, id=int(m[1])) m = re.match('\\s*Starting ...
Python
1
>, /// Module patterns #[darling(rename = "pattern", multiple)] pub patterns: Vec<String>, /// Module names to embed #[darling(rename = "name", multiple)] pub names: Vec<String>, #[cfg(feature = "phf")] /// Use perfect hash for module map #[darling(rename = "perfect")] pub phf_ma...
Rust
0
rmission NoPermission, /// Quantity is invalid. need >= 1 InvalidQuantity, /// Property of class don't support transfer NonTransferable, /// Property of class don't support burn NonBurnable, /// Can not destroy class /// Total issuance is not 0 CannotDestroyClass, } } pub trait Trait...
Rust
0