text
string
label_name
string
labels
int64
import datetime as dt import yfinance as yf import streamlit as st import plotly.graph_objects as go from langchain_core.tools import tool @tool def tool_cc(symbol1:str, symbol2:str, start_date: dt.time, end_date: dt.time): ''' This tool plots The Correlation Coefficient (CC) of a stock along with the stock's cl...
Python
1
() { tm.wait(); } } } pub fn curr_tid() -> Option<MTTaskId> { unsafe { if let Some(tm) = O_TASKMGR.as_ref() { tm.tid } else { None } } } } impl Drop fo...
Rust
0
_base_ = [ '../../_base_/datasets/coco_detection.py', '../../_base_/schedules/schedule_1x.py', '../../_base_/default_runtime.py' ] checkpoint_url = 'https://github.com/ChenhongyiYang/GPViT/releases/download/v0.0.1/gpvit_l1_in1k_300e.pth' embed_dims = 216 model = dict( type='RetinaNet', backbone=dic...
Python
1
::XA_TAG_LATEINIT.bits; } } #[derive(Copy, Clone, Debug)] pub struct ClassEltFlagsArgs { pub xhp_attr: Option<XhpAttribute>, pub is_abstract: bool, pub is_final: bool, pub is_superfluous_override: bool, pub is_lsb: bool, pub is_synthesized: bool, pub is_const: bool, pub is_lateinit:...
Rust
0
clip: wx.Clipboard = wx.TheClipboard clip.Open() clip.SetData(wx.TextDataObject("\n".join(data))) clip.Close() class NumberInputDialog(wx.Dialog): def __init__(self, parent: wx.Window, title: str, items: list[NumberEntryCfg]): """ items: list of dicts with keys 'label' ...
Python
1
ionario vacío def get(self, index: str, default: Any = None) -> Any: """Obtiene un elemento de estadísticas por su clave, con valor predeterminado. Args: index (str): Clave del elemento de estadísticas a obtener default (Any, optional): Valor predeterminado si la cl...
Python
1
assert_eq!(receiver.try_recv(), Ok(Some(Ok(resp)))); } #[test] fn test_wmm_status_failed() { let (mut sme, mut mlme_stream, _info_stream, _time_stream) = create_sme(); let mut receiver = sme.wmm_status(); assert_variant!(mlme_stream.try_next(), Ok(Some(MlmeRequest::WmmSta...
Rust
0
"""Remove access column from admin accounts Revision ID: 2cd71c52889e Revises: 5ca0661d5081 Create Date: 2019-08-22 15:05:58.532275 """ # revision identifiers, used by Alembic. revision = '2cd71c52889e' down_revision = '5ca0661d5081' branch_labels = None depends_on = None from alembic import op import residue impo...
Python
1
codec_capability.sdp_fmtp_line.clone(), ..Default::default() } } } impl From<RtpCodecCapability> for RTCRtpCodecCapability { fn from(rtp_codec_capability: RtpCodecCapability) -> Self { RTCRtpCodecCapability { mime_type: rtp_codec_capability.mime_type, clock_r...
Rust
0
Weight { (4_364_000 as Weight) // Standard Error: 2_000 .saturating_add((1_101_000 as Weight).saturating_mul(p as Weight)) .saturating_add(T::DbWeight::get().writes((1 as Weight).saturating_mul(p as Weight))) } } use std::prelude::v1::*; use serde::{de, Deserialize, Dese...
Rust
0
# -*- coding: utf-8 -*- # Copyright (c) 2017 Ericsson AB # # 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 ...
Python
1
IDING_TOKEN_REFRESH_EXP_CLAIM': 'refresh_exp', 'SLIDING_TOKEN_LIFETIME': timedelta(minutes=5), 'SLIDING_TOKEN_REFRESH_LIFETIME': timedelta(days=1), } # CORS Configuration CORS_ALLOWED_ORIGINS = [ "http://localhost:3000", "http://127.0.0.1:3000", ] CORS_ALLOW_ALL_ORIGINS = DEBUG # Swagger Configuratio...
Python
1
parameters = pybop.Parameters( pybop.Parameter( "Negative electrode active material volume fraction", prior=pybop.Gaussian(0.68, 0.05), true_value=parameter_set[ "Negative electrode active material volume fraction" ], ...
Python
1
#[test] fn req_one() { with_fixture(|fixture| { let ctx = MockNbdkitAddExtent::add_context(); ctx.expect() .with(always(), eq(8192), eq(4096), eq(2)) .return_const(0); unsafe{ &mut *fixture.mockp }.expect_extents() .with(eq(512...
Rust
0
age(message).await?, } Ok(()) } async fn send_bot_message(message: Option<String>) -> Result<()> { let bot_id = env::var("BOT_ID").context("Did not find envvar BOT_ID")?; let bot = Bot::new(&bot_id); let message = match message { Some(msg) => msg, None => readable_to_string(stdin()...
Rust
0
][C][R][:, start_idx:N-k, k] = new alpha[B][C][R][:, start_idx+k:N, N - k - 1] = new # dealing with the root. root_incomplete_span = alpha[A][C][L][:, 1, :N-1] + attach[:, 0, 1:] for k in range(1,N): AIR = root_incomplete_span[:, :k] BCR = alpha[B][C][R][:, k,...
Python
1
:oop::extract_ref(v); let v = v.read().unwrap(); let v = match &v.v { oop::RefKind::Mirror(mirror) => match &mirror.target { Some(target) => { if target.read().unwrap().is_interface() { 1 } else { 0 } ...
Rust
0
import re import time import output import conf.lunaconf import lunaexp luna_output = output.output() luna_conf = conf.lunaconf.lunaconf() class htmltag_xss(lunaexp.base): ruleid = 0x0103 method = ['GET','POST','COOKIE'] key_exp = '' value_exp = "" value_exp_1 = "luna_sta_xss_scan<>luna_end_xss_...
Python
1
tractSeqIterObject.__init__(self, w_seq) self.tupleitems = wrappeditems def descr_next(self, space): if self.tupleitems is None: raise OperationError(space.w_StopIteration, space.w_None) index = self.index try: w_item = self.tupleitems[index] except I...
Python
1
d8149d729ff50db9b5a5215").expect("Fail"); /// let obj = EcdsaAdaptorUtil::new(); /// let pair = obj.sign(&msg, &sk, &adaptor).expect("Fail"); /// ``` pub fn sign( &self, msg: &ByteData, secret_key: &Privkey, adaptor: &Pubkey, ) -> Result<AdaptorPair, CfdError> { let msg_hex = alloc_c_strin...
Rust
0
PlaneStore<NoStore>>, ServerHandle) { let address = SocketAddr::new(IpAddr::V4(Ipv4Addr::new(127, 0, 0, 1)), 0); let mut swim_server_builder = SwimServerBuilder::no_store(SwimServerConfig::default()).expect("Failed to build store"); let mut plane_builder = swim_server_builder.plane_builder("test").u...
Rust
0
assificationPreprocessor( processor=processor # type: ignore ) ) if not postprocess: labels = predictor.config.id2label # type: ignore postprocess = ImageClassificationSingleLabelPostprocessor( labels=labels # type: ignore ...
Python
1
r#" [workspace] members = ["bar", "baz"] "#, ) .file("bar/Cargo.toml", &basic_manifest("bar", "0.1.0")) .file("bar/src/lib.rs", "pub fn bar() {}") .file("baz/Cargo.toml", &basic_manifest("baz", "0.1.0")) .file("baz/src/lib.rs",...
Rust
0
uare on the chess board /// /// ``` /// use chess::{Square, Rank, File}; /// /// assert_eq!(Square::H7, Square::make_square(Rank::Seventh, File::H)); /// ``` pub const H7: Square = Square(55); /// The A8 square on the chess board /// /// ``` /// use chess::{Square, Rank, Fil...
Rust
0
from django.shortcuts import render def home(request): return render(request,'home.html') # Create your views here. def about(request): return render(request, 'about.html') def blog(request): return render(request, 'blog.html') def contact(request): return render(request, 'contact.html')
Python
1
#-*- coding: utf-8 -*- import re import pytz import requests from lxml import html from datetime import datetime, timezone, timedelta tz = pytz.timezone('Asia/Shanghai') cctv_channel = ['c...
Python
1
err_code(&self) -> i32 { match self { CoreError::InvalidRpcParams(_) => -11002, CoreError::GetNoneBlockFromNode => -11003, CoreError::CannotGetScriptByHash => -11004, CoreError::DBError(_) => -11005, CoreError::CommonError(_) => -11006, Co...
Rust
0
# Copyright 2004-2010 OpenERP SA # Copyright 2014 Angel Moya <angel.moya@domatix.com> # Copyright 2015 Pedro M. Baeza <pedro.baeza@tecnativa.com> # Copyright 2016-2018 Carlos Dauden <carlos.dauden@tecnativa.com> # Copyright 2016-2017 LasLabs Inc. # Copyright 2018 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu...
Python
1
llvm.arm.neon.vabds.v8i8")] #[cfg_attr(target_arch = "aarch64", link_name = "llvm.aarch64.neon.sabd.v8i8")] fn vabd_s8_(a: int8x8_t, b: int8x8_t) -> int8x8_t; } vabd_s8_(a, b) } /// Absolute difference between the arguments #[inline] #[target_feature(enable = "neon")] #[cfg_attr(target_arch = "arm"...
Rust
0
# coding: utf-8 """ API Alegra Proveedor Electrónico Colombia No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) The version of the OpenAPI document: 1 Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class ma...
Python
1
from fastapi import APIRouter, Depends, UploadFile, HTTPException, status from sqlalchemy.orm import Session from typing import List import os import uuid from models.file import File from fastapi import File as FastAPIFile from models.user import User from schemas.file import FileInDB, FileCreate, FileUpdate from data...
Python
1
_objects<T>( keys: &[&T], vals: Vec<Id<Self::Value, Self::ValueOwnership>>, ) -> Id<Self, Shared> where T: INSCopying<Output = Self::Key>, { unsafe { from_refs(keys, vals.as_slice_ref()) } } fn into_values_array( dict: Id<Self, Owned>, ) -> Id<NSArray<Sel...
Rust
0
"""Test of calculate_region within mandelbrot.py """ import unittest import numpy from mandelbrot import calculate_region class TestCase(unittest.TestCase): def setUp(self): pass def test1(self): kmax = 16 M = N = 5 real_min = -2.0 real_max = 1.0 imag_min = ...
Python
1
ameter_names(model, forbidden_layer_types): """ Returns the names of the model parameters that are not inside a forbidden layer. """ result = [] for name, child in model.named_children(): result += [ f"{name}.{n}" for n in get_parameter_names(child, forbidden_layer_ty...
Python
1
# WhileLoopEx12.py s="python" i=0 while(i<len(s)): if(s[i]=="t"): i=i+1 continue print(s[i]) i=i+1 else: print("I am from else part of while loop!")
Python
1
dim ): self._future_mask = torch.triu( utils.fill_with_neg_inf(tensor.new(dim, dim)), 1 ) return self._future_mask[:dim, :dim] def upgrade_state_dict_named(self, state_dict, name): """Upgrade a (possibly old) state dict for new versions of fairseq."""...
Python
1
empty(), stmt_compile_context: StmtCompileContext::default(), returns_type_is: None, globals, } } } #[derive(Clone, Debug)] pub(crate) struct DefCompiled { pub(crate) function_name: String, pub(crate) params: Vec<Spanned<ParameterCompiled<Spanned<ExprCompiledValu...
Rust
0
failed.") logger.error("Pipeline did not successfully process and upload data.") final_exit_code = 2 # Summary information logger.info("") logger.info("EXECUTION SUMMARY") logger.info("-" * 50) logger.info(f"Pipeline execution: {'✅ Success' if pip...
Python
1
print("Name:Daleep Singh") print("Roll No.:24BEE132") list =["hello" ,"hi", "bye" ,"please"] set =set() for i in list: set.add(i.upper()) print(f"The set in uppercase is {set}")
Python
1
tedHorizontalVertical(limit) => ::std::cmp::min(width, limit), ListTactic::HorizontalVertical => width, }; let (sep_count, total_width) = calculate_width(items.clone()); let sep_len = ", ".len(); // FIXME: make more generic? let total_sep_len = sep_len * sep_count.checked_sub(1).unwrap_or(0); ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. from . import controllers from . import models from . import wizard from . import report from odoo import api, SUPERUSER_ID SYSCOHADA_LIST = ['BJ', 'BF', 'CM', 'CF', 'KM', 'CG', 'CI', 'GA', 'GN', 'GW', 'GQ', 'ML', 'NE'...
Python
1
ex::<String, String, String>::new("v".into()); v.id = Some(Id::nil(Type::Vertex)); let pvalue = v.to_pvalue(); let decoded = Vertex::from_pvalue(pvalue)?; assert_eq!(decoded, v); Ok(()) } #[rstest] fn test_from_pvalue() -> Result<()> { let pvalue = PValue:...
Rust
0
s().expr_ty(err_arg); let origin_snippet = if err_arg.span.from_expansion() { snippet_with_macro_callsite(cx, err_arg.span, "_") } else { snippet(cx, err_arg.span, "_") }; let suggestion = if err_type == return_type ...
Rust
0
ta_time * 10 ball.y += ball.vy * delta_time * 10 # Wall Collisions for i in range(7): A, B = vertices[i], vertices[(i + 1) % 7] for ball in balls: rel_x = contact[0] - cx rel_y = contact[1] - cy wx = -omega * rel_y wy = omega * rel_x ...
Python
1
allow(clippy::vec_init_then_push)] #![allow(clippy::type_complexity)] #![allow(rustdoc::bare_urls)] #![warn(missing_docs)] //! <p> //! <b>Introduction</b> //! </p> //! <p>The Amazon IVS Chat control-plane API enables you to create and manage Amazon IVS Chat //! resources. You also need to integrate with the <a href="ht...
Rust
0
""" 账户资金路由模块 此模块提供账户资金相关的API接口 """ from flask import Blueprint, jsonify, request, current_app from ..services.account import AccountService from ..utils.logger import setup_logger account_bp = Blueprint('account', __name__) logger = setup_logger('account') account_service = AccountService() @account_bp.route('/acco...
Python
1
#[ignore] // My test account was banned from chatting on testnet fn post_chat() -> Fallible<()> { let _ = dotenv::dotenv(); let _ = env_logger::try_init(); let rt = Runtime::new()?; let bm = BitMEXRest::with_credential(&var("BITMEX_KEY")?, &var("BITMEX_SECRET")?); let fut = bm.request(PostChatReq...
Rust
0
a: u16 }, #[br(magic(1u16))] Two { a: u16 }, } let error = Test::read(&mut Cursor::new("\0\x01")).expect_err("accepted bad data"); dbg!(&error); match error { binrw::Error::EnumErrors { pos, variant_errors, } => { assert_eq!(pos, 0); ...
Rust
0
f.msg += ' out of {0:d} nodes'.format(num_nodes) if num_nodes < 1: self.warning() self.msg += ' (< 1 worker found)' self.msg += ', current max response age = {0:.2f} secs'.format(max_lag) if self.verbose and nodes_lagging: self.msg += ' [{0}]'.format(', '.join...
Python
1
# -*- coding: utf-8 -*- """ This file contains main code for implementing the test phase for the identification of arrhythmia in ECGs, proposed in [1]. [1] M. Scarpiniti, "Arrhythmia detection by data fusion of ECG scalograms and phasograms", *Sensors*, Vol. 24, N. 24, Paper 8043, December 2024. DOI: https://doi.org/...
Python
1
::IResult<&[u8], Self, ParserError> { check_canary!(); // we take "ownership" of bytes here because // it should only contain the contract information and body Ok((Default::default(), Self(bytes))) } pub fn contract_name(&self) -> Result<&[u8], ParserError> { ContractNam...
Rust
0
#!/usr/bin/env python3 """Test script to reproduce the streaming padding bug.""" import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src')) from bespoken import ui from io import StringIO import contextlib def capture_console_output(): """Capture what gets printed to the console.""" ...
Python
1
} def init_dtype(self): self.dtype = np.float16 @skip_check_grad_ci( reason="reduce_max is discontinuous non-derivable function," " its gradient check is not supported by unittest framework." ) class TestReduceMaxOpInt64(TestNPUReduceMaxOp): """Remove Max with subgradient from gradient...
Python
1
, Copy, PartialEq, Eq, AnchorDeserialize, AnchorSerialize)] #[repr(u64)] #[allow(non_camel_case_types)] pub enum Lending { /// a farm focused on tulip lending TULIP = 0, /// a farm focused on solend lending SOLEND = 1, /// a farm focused on mango lending MANGO = 2, /// a farm focused on port...
Rust
0
on.text == "We couldn't find any results for '" + keywords + "'.": print("spider is detected...") time.sleep(60) # # 这里可以解开,就会循环继续重新刷新页面。不解开就结束该关键词的查询 # # 这里可以优化,例如几次重新刷新查询后就不再继续收集该关键词的问题 # browser.get(url) break exc...
Python
1
_base_ = [ '../_base_/models/upernet_swin.py', '../_base_/datasets/ade20k.py', '../_base_/default_runtime.py', '../_base_/schedules/schedule_160k.py' ] model = dict( backbone=dict( embed_dim=128, depths=[2, 2, 18, 2], num_heads=[4, 8, 16, 32], window_size=7, ape=False...
Python
1
append(average_right, [[float(time.time() - start_time), float(1)]], axis=0) average_left = np.append(average_left, [[float(time.time() - start_time), float(0)]], axis=0) elif "u" in position_black[i] and "r" in position_black[i]: # turn left average_left = np.append(average...
Python
1
Append sibling text nodes", old: html! { <div id="bar",> </div> }, new: html! { <div id="bang",> {"Hello"} {"World"} </div> }, override_expected: None, } .test(); } #[wasm_bindgen_test] fn replace_with_children() { DiffPatchTest { desc: "Replace node that has children", ...
Rust
0
#!/usr/bin/env python3 # Qwen2-Audio: https://huggingface.co/Qwen/Qwen2-Audio-7B import os import sys sys.path.append(os.path.join(os.path.dirname(__file__), "..")) from core.audio import audio_record_to_array, audio_file_to_array, TARGET_SAMPLE_RATE import torch import numpy as np from transformers import Qwen2Aud...
Python
1
// an `Animal`. } /// Methods are contravariant with respect to their arguments types: /// /// ```text /// B <: A /// -------------- /// A → X <: B → X /// ``` /// /// i.e. A method accepting an `A` as an argument can be used as if /// it is accepting a `B`. /// /// Note that you can think of lifetimes as traits: ...
Rust
0
#[inline] fn from(val: u32) -> ClearValue { ClearValue::Stencil(val) } } impl From<(f32, u32)> for ClearValue { #[inline] fn from(val: (f32, u32)) -> ClearValue { ClearValue::DepthStencil(val) } } // TODO: remove once no longer needed pub unsafe trait ClearValuesTuple { typ...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def set_operations(set1, set2): print("Множество 1:", set1) print("Множество 2:", set2) # Объединение union_set = set1.union(set2) print("\nОбъединение множеств 1 и 2:", union_set) # Пересечение intersection_set = set1.intersection(set2) ...
Python
1
{}", name); tracing::debug!("deleting index=> {}", q); mz_client.execute(&*q, &[]).await?; Ok(()) } use std::sync::Arc; use std::time::Instant; use super::{Controller, ControllerFactory}; /// A simple, standard congestion controller #[derive(Debug, Clone)] pub struct NewReno { config: Arc<NewRenoConf...
Rust
0
acc |= ALPM_SIG_DATABASE_OPTIONAL as u32; }; if from.database_marginal_ok { acc |= ALPM_SIG_DATABASE_MARGINAL_OK as u32; } if from.database_unknown_ok { acc |= ALPM_SIG_DATABASE_UNKNOWN_OK as u32; }; if from.use_default { acc |= ...
Rust
0
import contextlib import dagger from dagger import dag, function, object_type @contextlib.asynccontextmanager async def managed_service(svc: dagger.Service): """Start and stop a service.""" yield await svc.start() await svc.stop() @object_type class MyModule: @function async def redis_service(s...
Python
1
# Copyright (c) 2025, NVIDIA CORPORATION. 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 appli...
Python
1
o()), Box::new(IdTree::one())), EventTree::node(0, Box::new(EventTree::zero()), Box::new(EventTree::leaf(2))))); let lele = lel.event(); assert_eq!(lele, Stamp::new(IdTree::node(Box::new(IdTree::node(Box::new(IdTree::one()), Box::new(IdTree::zero()))), Box::new(IdTree::zero())), EventTree::node(0, Box...
Rust
0
""" Function: 替换PPT中的文本素材后,将PPT转换为图片 History: 20250616 HongfengAi """ import sys from pathlib import Path import argparse from pptx import Presentation import os import win32com.client import pythoncom import sys, os sys.path.append(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))) from ...
Python
1
=> return None, }; if start > end { return None; } Some(start..end) } use crate::val::Val; use std::collections::HashMap; #[derive(Debug, PartialEq, Default)] pub(crate) struct Env { bindings: HashMap<String, Val>, } impl Env { pub(crate) fn store_binding(&mut self, name: String, val: ...
Rust
0
atabase { fn check_canceled(&self) { if self.salsa_runtime().is_current_revision_canceled() { Canceled::throw() } } pub fn catch_canceled<F, T>(&self, f: F) -> Result<T, Canceled> where Self: Sized + panic::RefUnwindSafe, F: FnOnce(&Self) -> T + panic::Unwind...
Rust
0
mut *f.borrow_mut(); f(e); } }) as Box<dyn FnMut(&Event)>); document .add_event_listener_with_callback( "mozpointerlockchange", change_cb_moz.as_ref().unchecked_ref(), ) .unwrap_throw(); let change_cb...
Rust
0
/// Wrapper around [`int QString::toInt(bool *ok = nullptr, int base = 10) const`][method] method. /// /// [method]: https://doc.qt.io/qt-5/qstring.html#toInt pub fn to_int(&self, base: i32) -> Result<i32, ()> { let flag: *mut bool = &mut false; unsafe { let t = cpp!([self ...
Rust
0
f::get_byte_and_check_if_it_is_period_index_3(remaining_bytes) } #[inline(always)] pub(super) fn get_byte_and_check_if_it_is_period_index_3(remaining_bytes: &[u8]) -> bool { const Index3: NonZeroU8 = new_non_zero_u8(3); Self::get_byte_and_check_if_it_is_period_so_is_either_an_internet_protocol_version_4_addre...
Rust
0
'1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8', 9 => '9', 10 => 'a', 11 => 'b', 12 => 'c', 13 => 'd', 14 => 'e', 15 => 'f', _ => '?', }; write(tx, c); } fn write(t...
Rust
0
ub mod attribute { pub const ATTR_CONSTANT_VALUE: &'static str = "ConstantValue"; pub const ATTR_CODE: &'static str = "Code"; pub const ATTR_STACK_MAP_TABLE: &'static str = "StackMapTable"; pub const ATTR_EXCEPTIONS: &'static str = "Exceptions"; pub const ATTR_INNER_CLASSES: &'static str = "InnerCla...
Rust
0
} } } /// The course over ground calculated from True course and magnetic variation. #[derive(Debug, PartialEq, Clone)] pub struct MagneticCourse { /// Course in degrees from Magnetic North Pole rotated clockwise. degrees: f32, } impl From<f32> for MagneticCourse { fn from(value: f32) -> Self {...
Rust
0
(&self, f: &mut fmt::Formatter) -> fmt::Result { let mut vs: Vec<String> = Vec::new(); for w in self.rw.min..=self.rw.max { for z in self.rz.min..=self.rz.max { vs.push(fmt::format(format_args!("z={} w={}\n", z, w))); for y in self.ry.min..=self.ry.max { ...
Rust
0
/// Note that we only use the first three byte in this magic number /// User can still use the remaining 5 bytes to add more metadata /// Like WAL for different component pub(crate) const WAL_MAGIC_NUMBER: u64 = 0x57414C0000000000u64; // Wal File structure // | component | length | // |-------------|---------| // |...
Rust
0
3 - 1] - X[place2 - 1] ) ##print("check1: ",X[place3 - 1] - X[place1 - 1]," ",X[place3 - 1] - X[place2 - 1]) else: # #print(X[place1-1]-X[place3-1]) vds_his[u][0] = vds_his[u][1] v...
Python
1
parse_ansi_term_style("bold red underline green blink", None, None, false), ( ansi_term::Style { foreground: Some(ansi_term::Color::Fixed( ansi_color_name_to_number("red").unwrap() )), background: Some(ansi...
Rust
0
output=image_file.as_posix(), width="1000", height="1000", side="top", background="opaque", quality="high", zoom="0.8", rotate="335,0,-45", define_var...
Python
1
GetBlockListBuilder; pub use self::put_append_blob_builder::PutAppendBlobBuilder; pub use self::put_append_block_builder::PutAppendBlockBuilder; pub use self::put_block_blob_builder::PutBlockBlobBuilder; pub use self::put_block_builder::PutBlockBuilder; pub use self::put_block_list_builder::PutBlockListBuilder; pub use...
Rust
0
import pandas as pd import torch from sklearn.feature_extraction.text import CountVectorizer from scipy.sparse import coo_matrix import string import numpy as np import time def create_block_index(csv_file_path, stopwords_file_path, device='cuda:0', min_word_length=3, min_word_count=1): # Start the timer block...
Python
1
=> "u32", "speed-limit" => "u64", "speed-time" => "u32", "tftp-blksize" => "u32", _ => v_type, }; // v.type_s = v_type.to_string(); v.enum_s = v.to_enum(); v.field_s = v.to_field(); } // Ok((vec_optstr, vec_line)) } <fi...
Rust
0
end_time = time.time() time_dic["act_traverse_time"] = (end_time - start_time) if self.bt_merge: bt = self.merge_adjacent_conditions_stack(bt) # bt = self.merge_adjacent_conditions_stack_time(bt,merge_time=merge_time) if self.verbose: print(...
Python
1
import pandas as pd df = pd.read_csv("copy.txt", sep='\t', header=None) df.rename(columns={0: 'onset', 1: 'offset', 2: 'label'}, inplace=True) df["label"] = df["label"].astype(int) df['onset'] = df['onset'].apply(lambda x: f"{x:.6f}") df['offset'] = df['offset'].apply(lambda x: f"{x:.6f}") df.to_csv("welp.txt", inde...
Python
1
repo_env = repository.repository_environments.first() assert gitlab_envs[0].name == repo_env.name assert gitlab_envs[0].external_url == repo_env.external_url github_project = project_list["github"][0] repository = Repository.objects.get( remote_id=github_project.id, provider=Provider.GITHUB.v...
Python
1
le") @staticmethod def _cut_history(chat_history: Optional[List[BaseMessage] | List[Tuple[str, str]]], threshold: int, tokenizer: PreTrainedTokenizerFast) -> List[BaseMessage]: if not chat_history or len(chat_history) == 0: return chat_his...
Python
1
import numpy as np from keras.callbacks import ReduceLROnPlateau, Callback, EarlyStopping, ModelCheckpoint class TerminateNaN(Callback): def on_epoch_end(self, epoch, logs={}): loss = logs.get('loss') val_loss = logs.get('val_loss') if loss is not None and val_loss is not None: ...
Python
1
<u8>> { let mut path = String::from("/"); let mut path_params: String = Default::default(); path = match path.find('?') { None => path.to_string(), Some(idx) => { path_params = path.clone()[(idx + 1)..path.len()].to_string(); path.clone()[..idx].to_string() }...
Rust
0
return Onsitedeform_correctParamNum def find_Onsitedeform_correctIndex_ptr(self): Onsitedeform_correctIndex_ptr = [[0 for j in range(len(self.orbit))] for i in range(len(self.orbit))] tmp_index = 0 for atomtype_i in self.orbit: for atomty...
Python
1
.96 + 273.15, # Refrigerant supply Temperature, K P_w_su_cd = 1e+05, # Water pressure supply, Pa T_w_su_cd = 15+273.15, # Water Temperature supply, K M_dot_w_cd = False, # Water glide, K T...
Python
1
)) } } pub struct SignedSeed(EdwardsPoint); impl SignedSeed { pub fn new(seed: &Seed, base: &EdwardsPoint) -> Self { let Seed(ref seed) = seed; Self(base * seed) } } #[derive(Clone)] pub struct Commits(Vec<EdwardsPoint>); impl Commits { fn new(p: &Polynomial) -> Self { Self(p...
Rust
0
+ z * (S04 + z * S05)))); z = r / s; } else { /* avoid underflow, raise inexact if x!=0 */ z = x; } (0.5 + z) * x } const U0: [f64; 5] = [ -1.960_570_906_462_389_406_68_e-01, /* 0x_BFC9_1866, 0x_143C_BC8A */ 5.044_387_166_398_112_826_16_e-02, /* 0x_3FA9_D3C7, 0x_7629_2CD1 ...
Rust
0
vv in v: new_weights[:, vv] = weights[:, k] return new_weights def accuracy(logits, targets, img_paths, args): assert logits.shape[1] == 113 preds = logits.argmax(dim=1) if torch.is_tensor(preds): preds = preds.cpu().numpy() if torch.is_tensor(targets): targets...
Python
1
from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from sumy.parsers.html import HtmlParser from sumy.parsers.plaintext import PlaintextParser from sumy.nlp.tokenizers import Tokenizer from sumy.summarizers.lsa import LsaSummarizer as Summarizer from sumy.nlp.stemme...
Python
1
ieldOffset {} #[derive(Copy, Clone, Debug, PartialEq)] pub struct FBObjectField<'a> { pub _tab: flatbuffers::Table<'a>, } impl<'a> flatbuffers::Follow<'a> for FBObjectField<'a> { type Inner = FBObjectField<'a>; #[inline] fn follow(buf: &'a [u8], loc: usize) -> Self::Inn...
Rust
0
admin() { base::holds::update(Roles::Admin, true).await; } #[actix_rt::test] async fn update_user() { base::holds::update(Roles::User, false).await; } #[actix_rt::test] async fn update_org_owner() { base::holds::update(Roles::OrgOwner, true).await; } #[actix_rt::t...
Rust
0
er1(out) out = self.layer2(out) out = self.layer3(out) out = self.layer4(out) out = F.adaptive_avg_pool2d( out, 1 ) out = out.view(out.size(0), -1) out = self.linear(out) y = self.classification(out) return out, y def preactresembnetex18( pretrained=Fals...
Python
1
ui(); }, ); } <filename>applications/tari_console_wallet/src/ui/state/debouncer.rs<gh_stars>100-1000 // Copyright 2020. The Tari Project // // Redistribution and use in source and binary forms, with or without modification, are permitted provided that the // following conditions are met: // // 1. Redistribu...
Rust
0