text
string
label_name
string
labels
int64
highest_profit=0 profit_th=get_profit_threshold(highest_profit) continue elif status == -1: # 持有空,等待临时避险,或永久平仓(大周期反转) #计算收益率,最高收益,止盈止损阈值 profit, highest_profit, profit_th=calculate_cur_profit(row,trade_price,highest_profit,profit_th,dir=-1)...
Python
1
# # Copyright 2024 The InfiniFlow 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...
Python
1
HREAD_COUNT: i64 = 1; pub const LOOP_COUNT: i64 = 250_000_000_000; pub const STEPS: i64 = 10; fn actions(thread: i64, nb_threads: i64) { println!("Thread {} start", thread); let start = SystemTime::now(); let mut _j = 0; let mut loop_by_thread = LOOP_COUNT / nb_threads; let loop_by_step = loop_by_t...
Rust
0
the `v64`. /// Upon success, the reference is updated to begin at the byte immediately /// after the encoded `v64`. #[inline] pub fn decode(bytes: &[u8]) -> Result<u64, Error> { if bytes.is_empty() { return Err(Error::Truncated); } let length = decoded_len(bytes[0]); let result = decode_with_le...
Rust
0
""" Sistema de auto-configuración completa para servidores Crea automáticamente canales, categorías, roles y configuraciones según el tipo de servidor Incluye: reglas automáticas, sistema de niveles, moderación integrada Por: Davito """ import logging import nextcord from nextcord.ext import commands from typing impor...
Python
1
def post_process_sample(pred_bbox): pred_coor = cxcywh2xyxy(pred_bbox[:, :4]) pred_conf = pred_bbox[:, 4] pred_prob = pred_bbox[:, 5:] classes = np.argmax(pred_prob, axis=-1) scores = pred_conf * pred_prob[np.arange(len(pred_coor)), classes] return np.concatenate([pred_coor, scores[:, np.newaxis...
Python
1
let i_buf = gpu_resources.buffer_arena.insert(i_buf); chunk_mesh.update_vertex_buffers(v_buf, i_buf, num_indices, num_vertices); return num_vertices != 0; } false } fn process_voxel( voxel: &Voxel, voxel_pos: cgmath::Vector3<f32>, left: &Voxel, down: &Voxel, back: &Voxel, ...
Rust
0
MOG2 { #[inline] fn as_raw_mut_CUDA_BackgroundSubtractorMOG2(&mut self) -> *mut c_void { self.inner_as_raw_mut() } } impl core::AlgorithmTraitConst for PtrOfCUDA_BackgroundSubtractorMOG2 { #[inline] fn as_raw_Algorithm(&self) -> *const c_void { self.inner_as_raw() } } impl core::AlgorithmTrait for PtrOfCUDA...
Rust
0
loss_score += self.multilabel_loss(head_logits, head_gt, **kwargs) return loss_score @torch.no_grad() def _forward_explain(self, images: torch.Tensor) -> dict[str, torch.Tensor | list[torch.Tensor]]: from otx.backend.native.tools.explain.explain_algo import feature_vector_fn x = s...
Python
1
, -1, -1, // 0x00-0x0f -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0x10-0x1f 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, // 0x20-0x2f 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, // 0x30-0x3f -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, ...
Rust
0
s type. Note that the /// stream must be encoded using the correct protobuf3 protocols. #[deprecated(since = "1.0.0", note = "please use `TryFrom` instead")] pub fn from_bytes(input: &[u8]) -> Result<Self, Error> { use websocket_message::FspComm; let tmp: FspComm = input.try_into()?; ...
Rust
0
# huge inspiration from i_have_no_biscuits on the AoC subreddit # I couldn't understand any of the other solutions but this one made a lot of sense to me # my initial thought would've been to simply create 8 different methods for checking each direction and then simply go through each element in the grid and do that. #...
Python
1
(author: "<NAME> <<EMAIL>>") ) (@subcommand init => (about: "Initialize password store") (version: "1.0") (author: "<NAME> <<EMAIL>>") ) (@subcommand backup => (about: "Backup password store, set PASSWORD_STORE_BACKUP to change backup di...
Rust
0
rontiers frontiers = [f for f in frontiers if f.prob_feasible != 0] distances = { 'frontier': frontier_distances, 'robot': robot_distances, 'goal': goal_distances, } stime = time.time() if do_correct_low_prob: old_probs = [f.prob_feasible for f in frontiers] ...
Python
1
'n_stores': 150, 'min_transport_cost': 200, 'max_transport_cost': 300, 'min_warehouse_cost': 1000, 'max_warehouse_cost': 5000, 'min_warehouse_capacity': 2000, 'max_warehouse_capacity': 3000, 'max_transport_capacity': 2000, 'demand_mean': 3000, '...
Python
1
) => { warn!(system.log(), "Connection to peer failed"; "incoming" => true, "reason" => format!("{}", &err), "ip" => &msg.address); failed_bootstrap_peer(err, msg.address, network_channel); }, } }); } else { ...
Rust
0
#!/usr/bin/env python # Motherstarter setup file from setuptools import setup, find_packages from motherstarter import __version__, __author__ # Open and read README file with open("README.md", "r", encoding="utf-8") as f: README = f.read() # Setup requirements to be installed requirements = [] with open("requi...
Python
1
######################################################################## # File name: __init__.py # This file is part of: aioxmpp # # LICENSE # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as # published by the Free Software Foundat...
Python
1
config_with_deps(&["a"])); config.topological_sort(); } } use crate::error::CosmosGrpcError; use crate::{Coin, Contact, Msg, PrivateKey}; use cosmos_sdk_proto::cosmos::base::abci::v1beta1::TxResponse; use cosmos_sdk_proto::cosmos::crisis::v1beta1::MsgVerifyInvariant; use cosmos_sdk_proto::cosmos::tx::v1beta...
Rust
0
se } fn clone_screen(&self) -> Box<dyn Screen>; } impl Clone for Box<dyn Screen> { fn clone(&self) -> Box<dyn Screen> { self.clone_screen() } } #[derive(Clone)] struct ScreenInfo { screen: Arc<Mutex<Box<dyn Screen>>>, init: bool, active: bool, last_width: i32, last_height:...
Rust
0
f"/saved_replay_buffer_1000000_seed{seed}.pkl" with open(path, "rb") as f: load_dataset = pkl.load(f) if "humanoid" in env_name: for key in load_dataset.keys(): load_dataset[key] = load_dataset[key][ 200000 : int(config.data_quality * 100_000...
Python
1
is not expected to change. pub const STORE: &str = "config.json"; /// Calculate the location of the `config.json` store file. /// If `config.json` is found in the current directory, use it for backward /// compatibility. Otherwise, return a path inside the project directory /// (~/.config/rrss2imap/ on Linux, s...
Rust
0
device_index(device, True) return torch._C._accelerator_getStream(device_index) def set_stream(stream: torch.Stream) -> None: r"""Set the current stream to a given stream. Args: stream (torch.Stream): a given stream that must match the current :ref:`accelerator<accelerators>` device type. .....
Python
1
C" fn HmdDriverFactory( interface_name: *const c_char, return_code: *mut i32, ) -> *mut c_void { static INIT_ONCE: Once = Once::new(); INIT_ONCE.call_once(init); FRAME_RENDER_VS_CSO_PTR = FRAME_RENDER_VS_CSO.as_ptr(); FRAME_RENDER_VS_CSO_LEN = FRAME_RENDER_VS_CSO.len() as _; FRAME_RENDER_PS...
Rust
0
#This file is part of ElectricEye. #SPDX-License-Identifier: Apache-2.0 #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 un...
Python
1
int(f"Fold {fold + 1} AUC: {fold_auc:.4f}") print(f"Fold {fold + 1} Kappa: {fold_kappa:.4f}") all_pred_probs = np.concatenate(all_pred_probs, axis=0) results_df = pd.DataFrame({ 'True_Label': all_true_labels, 'Predicted_Label': all_pred_labels }) for cls in range(n_classes): ...
Python
1
from fastapi import FastAPI from uvicorn import run from app.endpoints import api_router app = FastAPI( title="Very top cool best api", description="Система мониторинга для сбора и анализа качества воспроизведения в реальном времени", version="1.0.0", ) app.include_router(api_router) if __name__ == "__mai...
Python
1
22 xm\ p:CreatorTool=\x22A\ dobe Photoshop 2\ 1.0 (Windows)\x22 x\ mp:CreateDate=\x222\ 020-03-03T09:50:\ 41-03:00\x22 xmp:Mo\ difyDate=\x222020-0\ 5-02T17:59:27-03\ :00\x22 xmp:Metadat\ aDate=\x222020-05-0\ 2T17:59:27-03:00\ \x22 dc:format=\x22ima\ ge/png\x22 photosho\ p:ColorMode=\x223\x22 \ photoshop:ICCPro\ file=\x...
Python
1
import streamlit as st if st.session_state.get('connected', False): pages = [ st.Page("pages/home.py", title="Home", icon="🏠"), st.Page("pages/explore.py", title="Explore", icon="🕵️‍♀️"), st.Page("pages/monitoringExecution.py", title="Monitor Execution", icon="📈"), st.Page("pages...
Python
1
= _Class("CNDelayCancelationToken") CNConcatenateCancelationToken = _Class("CNConcatenateCancelationToken") CNOperationQueueSchedulerCancelationToken = _Class( "CNOperationQueueSchedulerCancelationToken" ) CNImmediateSchedulerCancelationToken = _Class("CNImmediateSchedulerCancelationToken") SynchronousQueueSchedul...
Python
1
SAMESITE # SESSION_COOKIE_HTTPONLY # Production web server # gunicorn/waitress/apache mod wsgi/uwsgi # Sessions http://flask.pocoo.org/docs/1.0/quickstart/#sessions # Streaming data back # Does not require a ton of memory to pass back something large (or infinite) # from flask import Response # @app.route('/large....
Python
1
(Orbital Angular Momentum) beams, please cite: `K. Klementiev & R. Chernikov, "New Features of xrt: Bent Crystals, Coherent Modes, Waves with OAM" Synchrotron Radiation News (2023) 36:5, 23-27; doi:10.1080/08940886.2023.2274735 <https://doi.org/10.1080/08940886.2023.2274735>`_. Acknowledgments --------------- * Jose...
Python
1
decode_identity<'de, I, E>(data: Bytes) -> Result<Option<I>, E> where I: Decode<'de> + 'static, E: Error + 'static, { let mut cpf = CommonPacketIter::new(LittleEndianDecoder::<E>::new(data))?; if let Some(item) = cpf.next_typed() { let item: CommonPacketItem<I> = item?; item.ensure_type...
Rust
0
[derive(Clone, Debug)] pub struct Tree<V, S, T, const CHILDREN: usize> { /// 2x2 square in 2D or 2x2x2 cube in 3D. branch_shape: PhantomData<S>, /// Every node at the highest LOD is a root. root_nodes: SmallKeyHashMap<NodeKey<V>, RootNode>, /// An allocator for each level. allocators: Vec...
Rust
0
)), tos!("last") ); assert_eq!(unit!(last, Value::Array(vec![])), tos!("")); } #[test] fn unit_lstrip() { let input = &tos!(" \n \r test"); let args = &[]; let desired_result = tos!("test"); assert_eq!(unit!(lstrip, input, args), desired_result)...
Rust
0
price_token_btc = PriceKey::create_on_vec(to_test_vec("btc")); let price_token_eth = PriceKey::create_on_vec(to_test_vec("eth")); let price_token_dot = PriceKey::create_on_vec(to_test_vec("dot")); let price_token_xrp = PriceKey::create_on_vec(to_test_vec("xrp")); const PHRASE: &str = "news slush supreme milk cha...
Rust
0
if days_passed >= 15 and profit_rate >= 5: return True, f"단기 투자 목표 달성 (보유일: {days_passed}일, 수익률: {profit_rate:.2f}%)" # 단기 투자 손실 방어 (10일 이상 + 3% 이상 손실) if days_passed >= 10 and profit_rate <= -3: return True, f"단기 투자 손실 방어 (보유일: {days_passed}일,...
Python
1
def missing_char(str, n): return str[:n] + str[n + 1:]
Python
1
'http://www.viki.com/tv/50c-boys-over-flowers', 'info_dict': { 'id': '50c', 'title': 'Boys Over Flowers', 'description': 'md5:804ce6e7837e1fd527ad2f25420f4d59', }, 'playlist_mincount': 71, }, { 'url': 'http://www.viki.com/tv/1354c-poor-nastya-comp...
Python
1
& 0x01) << 5); self.w } } #[doc = "Pull Up Resistor for GPIO14.\n\nValue on reset: 0"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum REG_GPIO_14_PU_A { #[doc = "0: `0`"] DISABLED = 0, #[doc = "1: `1`"] ENABLED = 1, } impl From<REG_GPIO_14_PU_A> for bool { #[inline(always)] fn fr...
Rust
0
mask_body = (patch_body[:, :, 3] > 0).astype(np.uint8) R = cfg.final_crop_radi extension = R padded = np.pad(src, pad_width=extension, mode="edge") cx_pad, cy_pad = cx + extension, cy + extension img2show = padded[cy_pad - R : cy_pa...
Python
1
may_list_lines.append(line) else: break # 如果这些行的缩进是相等的,那么连到上一个layout的最后一个段落上。 if len(may_list_lines) > 0 and len(set([x['bbox'][0] for x in may_list_lines])) == 1: # pre_page_paras[-1].append(may_list_lines) # 下一页合并到上一页最后一段,打一个cross_pa...
Python
1
(); // let mut b = (); // let ref c = (); // let ref mut d = (); // let e @ _ = (); // let ref mut f @ g @ _ = (); // } fn ident_pat(p: &mut Parser, with_at: bool) -> CompletedMarker { let m = p.start(); p.eat(T![ref]); p.eat(T![mut]); name(p); if with_at && p.eat(T![@]) { ...
Rust
0
AJOR, 7); const_assert_eq!(cudnn_minor; self::cudnn::CUDNN_MINOR, 4); const_assert_eq!(cudnn_patch; self::cudnn::CUDNN_PATCHLEVEL, 2); const_assert_eq!(cudnn_version; self::cudnn::CUDNN_VERSION, 7402); } use std::{collections::VecDeque, fmt::Debug, ops::Range, ptr::NonNull}; use relevant::Relevant; use allo...
Rust
0
dest_test_yml_path = git_root / f".github/workflows/{PROJECT}-test.yaml" if allow_write(dest_deploy_yml_path, overwrite): fill_in_and_write_action( src_yml_path=TEMPLATE_DEPLOY_YML, dest_yml_path=dest_deploy_yml_path, sub_prefix=PROJECT.split("-")[0], sub_p...
Python
1
ner_label_single = ner_label[:, :, :, i] ner_pred_num = ner_pred_single.sum().item() ner_gold_num = ner_label_single.sum().item() ner_right = ner_pred_single * ner_label_single ner_right_num = ner_right.sum().item() entity_num_list += [ner_pred_num, ne...
Python
1
"public-key-sha3-384": (get_sample_key("default")["sha3-384"]), } ], } result = self.run_command( [self.command_name], input="user@example.com\nsecret\n" ) self.assertThat(result.exit_code, Equals(0)) def test_list_keys_w...
Python
1
raise TypeError("Input array must be a NumPy array of Dual objects.") #Check the function the user wants to apply if ufunc == np.sin: return np.array([x.sin() for x in array]) elif ufunc == np.arcsin: return np.array([x.arcsin() for x in arr...
Python
1
let mut len_now = 0usize; let mut rest_zero = false; for desc in recv_buff.as_mut_slice() { len_now += desc.len; if len_now >= new_len && !rest_zero { desc.len -= len_now - new_len; // As u32 is save here as all buffers length is restricted by u32::M...
Rust
0
ya, j87c93ctfr6 as yyivbgxujsn, vuujn08lxuc, wup61_o_g8d as u593a5acata pass '# shade_tissue_densities -> carbons_automobiles_juries' 0 .r73d3yo094w /= eab_fq5yyrj b'' return '# shade_tissue_densities -> carbons_automobiles_juries' assert r3fjvpgjwr4, wp18d7f2c83 def a726mk9f9hk(isnm6he2ttv,...
Python
1
""" Multi-Stage Field Area Analysis Pipeline Optimized for GitHub Actions with massive parallelization and proper DuckDB spatial joins. """ from typing import Any, Dict, Optional from unified_pipeline.common.base import BaseJobConfig, BaseSource, GoldJobInterface from unified_pipeline.util.log_util import Logger fr...
Python
1
()) } pub fn id(&self) -> Hash { self.ledger.id() } /// access the shared key (associated to the public key given in parameter) with /// the master key and passphrase. /// /// This function will go through every entries of every block and will attempt to /// decode any keys tha...
Rust
0
it_variants_colours_primary_colour_r", "unit_variants_colours_primary_colour_g", "unit_variants_colours_primary_colour_b"); self.tool.load_fields_to_detailed_view_editor_combo_color_split(&data, &self.unit_variants_colours_secondary_colour_combobox, "unit_variants_colours_secondary_colour_r", "unit_variants_col...
Rust
0
import socket import time import ipaddress import argparse from scapy.all import IP, TCP, send, Ether # List of common port knock sequences COMMON_SEQUENCES = [ [7000, 8000, 9000], [12345, 23456, 34567], [22, 80, 443], [1111, 2222, 3333], [8080, 9090, 10000], [21, 22, 23], [1194, 500, 1701]...
Python
1
from django.db.models import Q from django.shortcuts import render from products.models import Product, Category from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage # Create your views here. def index(request): query = Product.objects.all() categories = Category.objects.all() selecte...
Python
1
_Shape.FACE, [23]) model.testNbSubShapes(Chamfer_7, GeomAPI_Shape.EDGE, [94]) model.testNbSubShapes(Chamfer_7, GeomAPI_Shape.VERTEX, [188]) model.testResultsVolumes(Chamfer_7, [2955.33333333]) refPoint = GeomAPI_Pnt(-20.9807621135, 42.5, 5) midPoint = Chamfer_7.defaultResult().shape().middlePoint() assert(midPoint.dist...
Python
1
u': 'Samoa', 'ee': 'Samoa nutome', 'el': 'Σαμόα', 'el-polyton': 'Σαμόα', 'en': 'Samoa', 'en-Dsrt': '𐐝𐐲𐑋𐐬𐐲', 'eo': 'Samoo', 'es': 'Samoa', 'et': 'Samoa', 'eu': 'Samoa', 'ewo': 'Samoá', 'fa': 'ساموآ', 'ff': 'Samowaa', 'ff-Adlm': '𞤅𞤢𞤥𞤵𞤱𞤢', 'ff-Latn': 'Samowaa', 'fi': 'Samoa', 'fil': 'Samoa', 'fo': 'Samoa', 'fr'...
Python
1
""" This rdflib plugin (based on Ed's https://github.com/edsu/rdflib-microdata/) lets you parse CSV files that use Schema.org column headers into an RDF graph. You shouldn't have to use this module directly, since it's a plugin. You'll just want to: >>> import rdflib >>> import rdflib_schemaorg_csv >>> g = rdflib.Grap...
Python
1
# -*- coding: utf-8 -*- # @Author: guomaoqiu # @File Name: webhook.py # @Date: 2019-03-21 20:41:23 # @Last Modified by: guomaoqiu # @Last Modified time: 2019-03-22 18:38:18 ''' 该脚本用于启动一个小web服务用于接收触发本地开发环境的代码push请求; 当本地代码提交后,通过设置的webhook功能触发该脚本 从而触发服务器仓库上面的代码执行git pull操作 以此达到自动热部署的目的 ps:服务端开启了debug功能功能所以可以热加载本地提交的变...
Python
1
import os,sys #grid_rows=['40'] #grid_rows= ['5'] grid_rows= ['50'] grid_cols = grid_rows grids_ll = [x+'x'+y for (x,y) in zip(grid_rows,grid_cols)] print(grids_ll) htc_ll = ['0.01'] #htc_ll = ['1e5'] chiplabel='M3D' folder = '../M3D/' lcf = folder + 'lcf_files/'+chiplabel modelParams = folder+'modelParams_files/mode...
Python
1
import cv2 import mediapipe import pyautogui from PIL import Image face_mesh_landmarks = mediapipe.solutions.face_mesh.FaceMesh(refine_landmarks = True) cap = cv2.VideoCapture(0) screen_w, screen_h = pyautogui.size() ratio = 0.15 right_eye_up_x_tmp, right_eye_up_y_tmp = 0, 0 while True: _, image = cap.read() ...
Python
1
], ), End( '10-JUL-2045 23:56:47.103736421 ET' ), ] # ====================================================================== # Run Cosmic # ====================================================================== # These commands will run automatically in non-interactive mode def runCosmic()...
Python
1
import os import unittest import json from typing import Dict import jc.parsers.proc_loadavg THIS_DIR = os.path.dirname(os.path.abspath(__file__)) class MyTests(unittest.TestCase): f_in: Dict = {} f_json: Dict = {} @classmethod def setUpClass(cls): fixtures = { 'proc_loadavg': ( ...
Python
1
izing_if = "String::is_empty")] pub sender_ip: String, #[serde(default, skip_serializing_if = "String::is_empty")] pub spam_report: String, #[serde(default, skip_serializing_if = "String::is_empty")] pub envelope: String, #[serde(default, skip_serializing_if = "String::is_empty")] pub attach...
Rust
0
ChronoDateTimeAdapter { column, dst_type } } } impl ColumnFrom for Vec<DateTime<Tz>> { fn column_from<W: ColumnWrapper>(data: Self) -> W::Wrapper { let tz = if data.is_empty() { Tz::Zulu } else { data[0].timezone() }; W::wrap(ChronoDateTimeColumnD...
Rust
0
[p[1, 0], p[0, 0], -p[3, 0], p[2, 0]], [p[2, 0], p[3, 0], p[0, 0], -p[1, 0]], [p[3, 0], -p[2, 0], p[1, 0], p[0, 0]]]) return H_plus elif isinstance(p, cs.MX): H_plus = cs.vertcat(cs.horzcat(p[0, 0], -p[1,...
Python
1
d `Ok(())` will be returned. fn set_dummy(#[compact] new_value: T::Balance) { // Put the new value into storage. <Dummy<T>>::put(new_value); } // The signature could also look like: `fn on_initialize()` fn on_initialize(_n: T::BlockNumber) { // Anything that needs to be done at the start of the block....
Rust
0
} impl KeyType for Ed25519PrivateKey { const KEY_TYPE: &'static str = "ssh-ed25519"; } impl KeyType for EcDsaPrivateKey { const KEY_TYPE: &'static str = "ecdsa-sha2"; fn key_type(&self) -> String { format!("{}-{}", Self::KEY_TYPE, self.identifier) } } impl_key_type_enum_ser_de!( Private...
Rust
0
pub const TESS_CONTROL_SUBROUTINE: types::GLenum = 0x92E9; #[allow(dead_code, non_upper_case_globals)] pub const TESS_CONTROL_SUBROUTINE_UNIFORM: types::GLenum = 0x92EF; #[allow(dead_code, non_upper_case_globals)] pub const TESS_CONTROL_TEXTURE: types::GLenum = 0x829C; #[allow(dead_code, non_upper_case_globals)] pub c...
Rust
0
`` /// # use serde_derive::{Deserialize, Serialize}; /// # /// #[derive(Debug, Deserialize, Serialize, Default)] /// struct S { /// #[serde(with = "serde_with::rust::tuple_list_as_map")] /// s: Vec<(Wrapper<i32>, Wrapper<String>)>, /// } /// /// #[derive(Clone, Debug, Serialize, Deserialize)] /// #[serde(transp...
Rust
0
delete type_register_static() call: yield self.make_patch('') # append TYPE_REGISTER(...) after variable declaration: yield var.append(f'TYPE_INFO({self.name})\n') class TypeRegisterCall(FileMatch): """type_register_static() call""" regexp = S(r'^[ \t]*', NAMED('func_name', 'type_regist...
Python
1
from solution import * from typing import List from solution import count_valid_sequences def build_bst(from_list: List[int]) -> TreeNode: if not from_list: return None import math def build_tree(nodes: List[TreeNode], index: int) -> TreeNode: if index < len(nodes) and nodes[index]: ...
Python
1
# Copyright (c) 2024. # ProrokLab (https://www.proroklab.org/) # All rights reserved. # Configuration file for the Sphinx documentation builder. import os.path as osp import sys import benchmarl_sphinx_theme import vmas # -- Project information project = "VMAS" copyright = "ProrokLab" author = "Matteo Bettini" ...
Python
1
# Copyright 2018 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, ...
Python
1
def set_template(args): # Set the templates here if args.template.find('mst') >= 0: args.input_setting = 'H' args.input_mask = 'Phi' if args.template.find('gap_net') >= 0 or args.template.find('admm_net') >= 0 or args.template.find('dnu')>= 0 \ or args.template.find('dauhst')>= ...
Python
1
ub cmd: ::std::vec::Vec<std::string::String>, /// Timeout in seconds to stop the command. Default: 0 (run forever). #[prost(int64, tag = "3")] pub timeout: i64, } #[derive(Clone, PartialEq, ::prost::Message)] pub struct ExecSyncResponse { /// Captured command stdout output. #[prost(bytes, tag = "1")...
Rust
0
#### # required class boiler code # ############################## def __getitem__(self, item): return getattr(self, item) def __setitem__(self, item, value): return setattr(self, item, value) # for testing without editor: def main(): import sys from PyQt5.QtWidgets import QApp...
Python
1
![]), ] } fn virtio_vhost_block_thread_rules() -> Vec<(i64, Vec<SeccompRule>)> { vec![] } fn create_vsock_ioctl_seccomp_rule() -> Vec<SeccompRule> { or![and![Cond::new(1, ArgLen::Dword, Eq, FIONBIO,).unwrap()],] } fn virtio_vsock_thread_rules() -> Vec<(i64, Vec<SeccompRule>)> { vec![ (libc::S...
Rust
0
acher::new(|a: &str| -> usize { a.len() }); c.value(&a1[..]) }; assert_eq!(v1, 4 as usize); // Switch to Copy to Clone and add clone basically every time arg and v are used //let mut c = Cacher::new(|a: String| -> usize { a.len() }); //let v1 = c.value(String::from(...
Rust
0
> Result<(), Error> { instr_branch_cond(cpu, cycle_count, BranchCondition::COrZSet) } pub fn instr_branch_cond_vus <T: VAXBus> (cpu: &mut VAXCPU<T>, cycle_count: &mut Cycles) -> Result<(), Error> { instr_branch_cond(cpu, cycle_count, BranchCondition::VUnset) } pub fn instr_branch_cond_vs <T: V...
Rust
0
def read_as_coord_array(fp, fix_coords=True): """ Read binary binvox format as coordinates. Returns binvox model with voxels in a "coordinate" representation, i.e. an 3 x N array where N is the number of nonzero voxels. Each column corresponds to a nonzero voxel and the 3 rows are the (x, z, y) coordi...
Python
1
_exception_syndrome(ExceptionLevel::EL2); loop {} } use actix::prelude::Message; use serde::{Deserialize, Serialize}; use chrono::{DateTime, Utc}; #[derive(Message)] #[rtype(result = "()")] #[derive(Debug, Serialize, Deserialize)] pub struct BroadcastMessageRequest { pub sender_id: usize, pub message: St...
Rust
0
"""Test Extremes.""" # standard from typing import Any # external import pytest # local from validators._extremes import AbsMax, AbsMin abs_max = AbsMax() abs_min = AbsMin() @pytest.mark.parametrize( ("value",), [(None,), ("",), (12,), (abs_min,)], ) def test_abs_max_is_greater_than_every_other_value(valu...
Python
1
color: white; font-size: 16px; border: none; } QPushButton:hover { background-color: #1ABC9C; } QPushButton:pressed { background-color: cyan; } """) self.grab_button.clicked.connec...
Python
1
#Con los conocimientos adquiridos, intenta desarrollar el juego de Piedra, papel, tijera from random import randint as azar continua="s" while(continua=="s" or continua=="S"): print("Elige una opcion:") print("1. Piedra") print("2. Papel") print("3. Tijera") opcion_usuario = int(input("Selecciona tu...
Python
1
class MyCircularQueue: def __init__(self, k: int): self.size = 0 self.capacity = k self.start = 0 self.store = [None for _ in range(k)] def enQueue(self, value: int) -> bool: if self.isFull(): return False self.store[(self.start + self.size)...
Python
1
ret.append(&mut "\t".to_string().into_bytes()); } ret.append(&mut inst.code.clone().into_bytes()); ret } fn trace_mc(&self) { trace!(""); trace!("code for {}: \n", self.name); let n_insts = self.code.len(); for i in 0..n_insts { self.trace...
Rust
0
from .base_sensor import AirflowSensorDecorator from ..airflow_utils import SensorNames from ..exception import AirflowException class S3KeySensorDecorator(AirflowSensorDecorator): """ The `@airflow_s3_key_sensor` decorator attaches a Airflow [S3KeySensor](https://airflow.apache.org/docs/apache-airflow-provid...
Python
1
ration with the # window based USE comparison might be more involved)." # # Finally, since the BAE code is based on the TextFooler code, we need to # adjust the threshold to account for the missing / pi in the cosine # similarity comparison. So the final threshold is 1 - (1 - 0.8...
Python
1
from langchain_community.document_loaders import SeleniumURLLoader from langchain_community.document_loaders import PlaywrightURLLoader from langchain_community.document_loaders import WebBaseLoader import bs4 import asyncio import sys def web_search(): urls = [ "https://github.com/scrapy-plugins/scrapy-...
Python
1
ue class ABI_Bytes(ABIType): def __init__(self, bytes_bound): if not bytes_bound >= 0: raise InvalidABIType("Negative bytes_bound provided to ABI_Bytes") self.bytes_bound = bytes_bound def is_dynamic(self): return True # note that static_size for dynamic types is alw...
Python
1
l, reminder_last_cron_run: Option<String>, // "activerss_interval": "day1", activerss_interval: String, // "activerss_url": null, activerss_url: Option<String>, // "activerss_items": "10", activerss_items: String, // "ip4": "643992596", ip4: String, // "laststep": "designer", ...
Rust
0
, .., mid, .., cons] = (); } use crate::{ ds::{InvalidFieldName, InvalidId}, Kserd, Value, }; use std::{error, fmt}; /// _Convert_ something into a `Kserd`. /// /// This differs to [_encoding_](crate::encode::Encoder) in that the object is _consumed_. This trait /// allows for less copying as data can be _move...
Rust
0
pub name: String, pub picture_url: String, pub profile: String, } <filename>eldiro-part-1/crates/eldiro/src/utils.rs pub(crate) fn take_while(accept: impl Fn(char) -> bool, s: &str) -> (&str, &str) { let extracted_end = s .char_indices() .find_map(|(idx, c)| if accept(c) {None} else {Some(idx)})...
Rust
0
#!/usr/bin/env python3 """ Test script to verify the fixes for the Content Planning Dashboard. """ import requests import json import sys def test_backend_health(): """Test if the backend is responding.""" try: response = requests.get("http://localhost:8000/health", timeout=5) if response.stat...
Python
1
from kivy.app import App from kivy.factory import Factory from pyobjus import autoclass from pyobjus.dylib_manager import load_framework, INCLUDE from plyer.facades import UniqueID load_framework(INCLUDE.Foundation) UIDevice = autoclass('UIDevice') NSProcessInfo = autoclass('NSProcessInfo') processInfo = NSProcessInfo...
Python
1
); impl OUTLINK_DSCR_ADDR_CH0_R { #[inline(always)] pub(crate) fn new(bits: u32) -> Self { OUTLINK_DSCR_ADDR_CH0_R(crate::FieldReader::new(bits)) } } impl core::ops::Deref for OUTLINK_DSCR_ADDR_CH0_R { type Target = crate::FieldReader<u32, u32>; #[inline(always)] fn deref(&self) -> &Self...
Rust
0
# Filenames : <tahm1d> # Python bytecode : 2.7 # Time decompiled : Fri Sep 11 20:14:51 2020 # Selector <module> in line 1 file <tahm1d> # Timestamp in code: 2020-09-02 17:33:14 import os, sys, fileinput R = '\x1b[1;31m' G = '\x1b[1;32m' Y = '\x1b[1;33m' C = '\x1b[1;36m' W = '\x1b[1;37m' logo = "\n \x1b[1;33m _____ ...
Python
1
# src/schedule_backup.py """ Scheduler for Airtable Backup Tool. Handles automated backup scheduling. """ import schedule import time from datetime import datetime import logging from backup import backup_airtable_to_csv, print_status, setup_logging from config import BACKUP_CONFIG def run_backup(): """Wrapper fu...
Python
1
), Key(57, "Num9Key"), Key(58, "ColonKey"), Key(59, "SemicolonKey"), Key(60, "LessKey"), Key(61, "EqualsKey"), Key(62, "GreaterKey"), Key(63, "QuestionKey"), Key(64, "AtKey"), Key(91, "LeftBracketKey"), Key(92, "BackslashKey"), Key(...
Rust
0