text
string
label_name
string
labels
int64
index: {}, generation: {}}}", self.index(), self.generation()) } } impl Animation { /// Creates a null animation id. /// /// A null animation can be used as a placeholder within a widget struct but cannot be used to /// get/set animation properties or control animation playback. pub fn null() -...
Rust
0
olitonids_to_assertions(&V1_solitonidS[..]), schema_attrs_to_assertions(embedded_SCHEMA_VERSION, V1_embedded_SCHEMA.as_ref()), ].concat()); let bootstrap_causets: Vec<Causets<edbn::ValueAndSpan>> = edbn::parse::causets(&bootstrap_assertions.to_string()).expect("bootstrap assertions"); return bootst...
Rust
0
""" Tool-specific initialization for Clang static analyzer There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ __revision__ = "tools/clang-analyze.py 2013-09-06 grissiom" import os import os.path import SCons.Ac...
Python
1
c = 0 for i in range(0,100): a = int(input()) c+=a print(c)
Python
1
"boss1_damage", "boss2_damage", "boss3_damage", "boss4_damage", "boss5_damage", "boss6_damage", ]: boss1_dict.replace_int(attr, int(boss1.attribute(attr))) level = boss1.child_value("level") ...
Python
1
import time, gc, os import neopixel from machine import Pin import tinys3 # Create a NeoPixel instance # Brightness of 0.3 is ample for the 1515 sized LED pixel = neopixel.NeoPixel(Pin(tinys3.RGB_DATA), 1) # Say hello print("\nHello from TinyS3!") print("------------------\n") # Show available memory print("Memory I...
Python
1
; } let fd = fs.lock().open_file(&path_str); if let Err(_) = fd { return -1_isize as usize; } else { return fd.unwrap(); } } pub unsafe fn sys_sleep(pm: &mut ProcessManager, delay: usize) -> usize { let running = pm.running; let pid = get_process!(pm.ptable_lock(), running)....
Rust
0
from matplotlib import projections import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn.metrics import silhouette_score from scipy.cluster.hierarchy import dendrogram from sklearn.preprocessing import StandardScaler from sklearn.cluster import AgglomerativeClustering # import data euro...
Python
1
{}, 'logit_scale': {} }, # type='SGD', # lr=1e-4, # momentum=0.9, # weight_decay=0.0005, type='AdamW', lr=1e-4, weight_decay=0.0005 ) # # # optimizer # optimizer = dict( # constructor='SubModelConstructor', # # sub_model='prompt_learner', # sub_model={'prompt_learner': {}, 'i...
Python
1
rings: A list of hint strings. preserve_filter: Whether to keep the current value of `self._filtertext`. """ self._read_config() self.bindings.update({keyutils.KeySequence.parse(s): s for s in strings}) if not preserv...
Python
1
device = accelerator.device with tqdm(initial = self.step, total = self.train_num_steps, disable = not accelerator.is_main_process) as pbar: while self.step < self.train_num_steps: total_loss = 0. for _ in range(self.gradient_accumulate_every): ...
Python
1
[ ("command", "returnChartData"), ("currencyPair", "USDT_ETH"), ("end", "9999999999"), ("period", "300"), ("start", start_date_str.as_ref()), ].as_ref(), ); let client = reqwest::Client::new(); let...
Rust
0
ba Inu is the latest meme-crypto to go viral and despite being down almost 60% from it's all-time high, the market cap still stands at an eye-watering $20 billion, making it the 12th biggest crypto in the world by valuation.", target_segment="Shiba Inu ist die neueste Meme-Krypto, die viral wird, und obwohl sie fast 60...
Python
1
lready paired. AlreadyPaired, /// Targets cannot be empty. EmptyTargets, /// Duplicate index. DuplicateIndex, /// Slash record index out of bounds. InvalidSlashIndex, /// Can not bond with value less than minimum required. InsufficientBond, ...
Rust
0
Interpreter, universe: &mut Universe) { const SIGNATURE: &str = "Class>>#name"; let frame = interpreter.current_frame().expect("no current frame"); expect_args!(SIGNATURE, frame, [ Value::Class(class) => class, ]); let sym = universe.intern_symbol(class.borrow().name()); frame.borrow...
Rust
0
#[test] fn new_model_should_be_serializable() -> Result<(), Box<dyn std::error::Error>> { let model = NewModel::new(SimpleData { name: "test".to_owned(), }); let serialize = serde_json::to_string(&model)?; let deserialize: NewModel<SimpleData> = serde_json::from_str(&ser...
Rust
0
#!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = "ipetrash" from bs4 import BeautifulSoup, Tag def get_sections_as_dict(root) -> tuple[dict[str, dict], dict[str, Tag]]: # Рекурсивная функция поиска <section> def _find_sections(root, root_dict: dict, title_by_section: dict): for section i...
Python
1
oin("experiments", prefix, args.tag) model_prefix = os.path.join(save_path, "checkpoint") tb_logger = Logger(save_path + "/test_tb") # reset dist torch.cuda.set_device(args.local_rank) torch.distributed.init_process_group(backend='nccl', init_method='env://') world_size = torch.distributed.get_...
Python
1
test_scope_from_str() { let tests = [ ("read", Scope::Read(None)), ("read:accounts", Scope::Read(Some(Read::Accounts))), ("read:blocks", Scope::Read(Some(Read::Blocks))), ("read:favourites", Scope::Read(Some(Read::Favourites))), ("read:filters", Scope...
Rust
0
from mitmproxy.tools.console import master __all__ = ["master"]
Python
1
thers " f"are not. Received arguments: {args}." ) return None return func(*args) map_func = func_skipping_none return torch_tree.tree_map(map_func, *structures) def map_structure_up_to(shallow_structure, func, *structures): if n...
Python
1
p, sequence::{delimited, pair}, IResult, }; use fp::prime::{BinomialIterator, BitflagIterator, ValidPrime}; use fp::vector::{FpVector, SliceMut}; use once::OnceVec; use crate::algebra::combinatorics::{self, MAX_XI_TAU}; use crate::algebra::{Algebra, Bialgebra, GeneratedAlgebra}; #[cfg(feature = "json")] use ...
Rust
0
""" Tests for yatsm.regression.robust_fit """ import numpy as np import pytest import yatsm.regression.robust_fit as rf @pytest.mark.parametrize(('array', 'ans', ), [ (np.array([1, 1, 2, 2, 4, 6, 9, ]), 1.4825796) # from Wikipedia example ]) def test_mad(array, ans): mad = rf.mad(array) assert (mad - an...
Python
1
# coding=utf-8 # 这是为 archive.org 配置文件 # # 使用方法: # 1. 复制本文件到 zmirror 根目录(wsgi.py所在目录), 并重命名为 config.py # 2. 修改 my_host_name 为你自己的域名 # # 各项设置选项的详细介绍请看 config_default.py 中对应的部分 # 本配置文件假定你的服务器本身在墙外 # 如果服务器本身在墙内(或者在本地环境下测试, 请修改`Proxy Settings`中的设置 # # 基本全功能完整 # Github: https://github.com/aploium/zmirror # ############...
Python
1
from .errors import ConnectionClosed # pragma: no cover class WebSocketASGI: # pragma: no cover def __init__(self, scope, receive, send, subprotocols=None): self._scope = scope self._receive = receive self._send = send self.subprotocols = subprotocols or [] self.subprotoc...
Python
1
Margin** ≥ 0. The default value is 0.5. bottomMargin A Float specifying the bottom margin of the paper in the currently selected units (inches or millimeters). Possible values are **bottomMargin** ≥ 0. The default value is 0.5. leftMargin A Float specifyin...
Python
1
.iter() .map(|(k, v)| format!(" {}=\"{}\"", k, v)) .collect::<String>(), nodes = self .nodes .iter() .flat_map(|(_, nodes)| nodes.iter()) .map(|node| node.to_string()) ...
Rust
0
import tkinter as tk ventana = tk.Tk() ventana.geometry("480x250+0+0") # Evento por comando def my_command(): texto.set("Adios") texto = tk.StringVar(value="Hola") etiqueta = tk.Label(textvariable=texto) # Existe un parametro llamado command que te permite introducir métodos # y activarlo cuando el usuario puls...
Python
1
, Clone)] pub struct StringError { pub error_msg: String, } impl Display for StringError { fn fmt(&self, f: &mut Formatter<'_>) -> Result { write!(f, "{}", self.error_msg) } } impl std::error::Error for StringError {} //================== Dir start ===================== #[derive(Debug, Clone)] pu...
Rust
0
let mut res = Response::with_body(StatusCode::OK, Body::Bytes(body.freeze())); let hdrs = res.headers_mut(); hdrs.insert(SERVER, h_srv); hdrs.insert(CONTENT_TYPE, h_ct); res }))) ...
Rust
0
""" LLM服务模块 提供统一的LLM接口和客户端管理 """ from .service import LLMService from .factory import LLMClientFactory from .base_client import BaseLLMClient __all__ = [ 'LLMService', 'LLMClientFactory', 'BaseLLMClient' ]
Python
1
if !times.insert(cnt) { return false; } } true } } #[cfg(test)] mod tests { use super::*; #[test] fn test_unique_occurrences() { assert_eq!(Solution::unique_occurrences(vec![1, 2, 2, 1, 1, 3]), true); assert_eq!(Solution::unique...
Rust
0
def SpectralConvolutionSet(spectrum): n = len(spectrum) convolution_set = [] for i, pep in enumerate(spectrum): for i in range(i+1,n,1): convolution_set.append(abs(pep-spectrum[i])) return convolution_set spectrum = [0,137,186,323] # print(SpectralConvolutionSet(spectrum)) def c...
Python
1
etadata", [ ("datetime", {b"ARROW:extension:name": b"google:sqlType:datetime"}), ( "geography", { b"ARROW:extension:name": b"google:sqlType:geography", b"ARROW:extension:metadata": b'{"encoding": "WKT"}', }, ), ], ) def ...
Python
1
.filter_map(|label| match glob::Pattern::new(label) { Ok(exclude_glob) => Some(exclude_glob), Err(error) => { log::error!("Invalid glob pattern: {}", error); None } ...
Rust
0
verLinkModel>, pub tags: Vec<ServerTagModel>, } impl ServerQuery { pub fn get_by_id(connection: PgPooledConnection, requested_server_id: &str) -> Result<Option<ServerQuery>, diesel::result::Error> { use crate::database::schema::servers::dsl::*; use crate::database::schema::servers_links::{ dsl ...
Rust
0
# Copyright (C) 2025 Robotec.AI # # 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 wr...
Python
1
Takeable::take(&mut raw_context); // Make sure it drops first return; } Event::WindowEvent { event, .. } => match event { WindowEvent::Resized(physical_size) => { raw_context.resize(physical_size); unsafe { ...
Rust
0
""" Management command to cache course apps status in the databse. """ from textwrap import dedent from django.core.management import BaseCommand from opaque_keys.edx.keys import CourseKey from openedx.core.djangoapps.content.course_overviews.models import CourseOverview from openedx.core.djangoapps.course_apps.task...
Python
1
""" Code verification for the case of a rod under uniformly distributed load. """ import numpy as np from fenics import Mesh from static import run_static from axes_world import one_by_two # ============================================================================= u0 = np.array([1., 0., 0.]) # Verification loo...
Python
1
column: IndexLabel | None = None, by=None, grid: bool = True, xlabelsize: int | None = None, xrot: float | None = None, ylabelsize: int | None = None, yrot: float | None = None, ax=None, sharex: bool = False, sharey: bool = False, figsi...
Python
1
# # This file is part of CasADi. # # CasADi -- A symbolic framework for dynamic optimization. # Copyright (C) 2010-2014 Joel Andersson, Joris Gillis, Moritz Diehl, # K.U. Leuven. All rights reserved. # Copyright (C) 2011-2014 Greg Horn # # CasADi is free software; you can...
Python
1
/spec/libsass-todo-issues/issue_2023/class-selector-id.hrx" // Ignoring "class_selector_id", error tests are not supported yet. // From "sass-spec/spec/libsass-todo-issues/issue_2023/class-selector-nr.hrx" // Ignoring "class_selector_nr", error tests are not supported yet. // From "sass-spec/spec/libsass-todo-issue...
Rust
0
SplitReadGenome::MS(MSAlignment { m: m, s: s, pos: pos, })) } else if regexes::M_REGEX.is_match(&cigar[..]) { Ok(SplitReadGenome::M(MAlignment { old_s: old_s, old_m: old_m, ...
Rust
0
ons(self, instructions: List[Dict], frequencies: List[Dict]) -> List[Dict]: """Structure instruction information""" structured = [] for instruction in instructions: inst_info = { 'instruction': instruction['text'], 'type': instruction.get('typ...
Python
1
from scipy.spatial import Voronoi, voronoi_plot_2d Create a set of points for the example: >>> rng = np.random.default_rng() >>> points = rng.random((10,2)) Generate the Voronoi diagram for the points: >>> vor = Voronoi(points) Use `voronoi_plot_2d` to plot the diagram: >>> fig = voron...
Python
1
# Copyright 2024 NXP # # This source code is licensed under the BSD-style license found in the # LICENSE file in the root directory of this source tree. import numpy as np import pytest import torch from executorch.backends.nxp.backend.edge_program_converter import ( EdgeProgramToIRConverter, ) from executorch.ba...
Python
1
value = self.value.to_string(); fragment() .child( div() .class("predict-field-wrapper") .child(div().child(NumberColumnToken)) .child( ui::TextField::new() .label(self.name.clone()) .name(self.name.clone()) .value(value), ), ) .child(Dehydrate::new( se...
Rust
0
# Update layout fig.update_layout( title=f"{self.symbol} - Comprehensive Technical Analysis", xaxis_rangeslider_visible=False, height=800, showlegend=True, template="plotly_white" ) # Save chart chart_file = f"output/...
Python
1
] #[should_panic] fn world_cell_double_mut() { let mut world = World::default(); world.insert_resource(1u32); let cell = world.cell(); let _value_a = cell.get_resource_mut::<u32>().unwrap(); let _value_b = cell.get_resource_mut::<u32>().unwrap(); } #[test] #[...
Rust
0
atic str { match color_coding { dc1394color_coding_t::DC1394_COLOR_CODING_MONO8 => "Mono 8-bit", dc1394color_coding_t::DC1394_COLOR_CODING_YUV411 => "YUV411", dc1394color_coding_t::DC1394_COLOR_CODING_YUV422 => "YUV422", dc1394color_coding_t::DC1394_COLOR_CODING_YUV444 => "YUV44...
Rust
0
import os from os.path import join as opj import cv2 import pickle import sys sys.path.append('../../../') from config import cfg def parse_pt(pt_file): with open(pt_file,'rb') as f: lines = pickle.load(f) img_rects = dict() for line in lines: fid = int(lines[line]['frame'][3:]) ...
Python
1
() }; let body = wrap_in_envelope_body!(header, message.into_inner()).to_encoded_bytes(); self.send_raw(params, body).await } /// Send a message without a domain header part pub async fn send_message_no_header<T>( &mut self, params: FinalSendMessageParams, me...
Rust
0
/// One greater than the minimum possible normal [`f16`](../struct.f16.html) power of 2 exponent. #[deprecated( since = "1.4.0", note = "moved to [`f16::MIN_EXP`](../struct.f16.html#associatedconstant.MIN_EXP)" )] pub const MIN_EXP: i32 = f16::MIN_EXP; /// Smallest positive normal [`f1...
Rust
0
0xe14dc39, 0x7a55cda, 0xb, ], [ 0x1a8f6aa8, 0x7c5a4e5, 0xc18100, 0xb853e9f, 0xa5c871a, 0xd9b731b, 0x18a43964, 0x7376c34, 0x1d9c6dd0, 0xd69488, 0x123c0428, 0x1d480b7a, 0xd2f259e, 0x2, ], [ 0x2561092, 0x1425a94f, 0x1faefaa5, 0x12d130de, 0x1913516f, 0xd446753, 0xb4a303e, 0x1...
Rust
0
#!/usr/bin/env python import os import sys import optparse import select sys.path.insert(0,os.path.join(os.path.dirname(__file__), "..")) from websockify.websocket import WebSocket, \ WebSocketWantReadError, WebSocketWantWriteError parser = optparse.OptionParser(usage="%prog URL") (opts, args) = parser.parse_arg...
Python
1
\CentOS 8 (64 ビット).vmx" pref.mruVM0.displayName = "CentOS 8 (64 ビット)" pref.mruVM0.index = "0" pref.vmplayer.deviceBarToplevel = "FALSE" vmWizard.isoLocationMRU1.location = "C:\vmware\ubuntu-ja-20.04.1-desktop-amd64.iso" pref.mruVM1.filename = "C:\Users\user\Documents\Virtual Machines\Ubuntu 64 ビット\Ubuntu 64 ビット.vm...
Rust
0
u64; MAX_HALF_WIDTH * 2 + 4]; let p0 = 0; let mut p1 = 0; let mut x = x1 << POLY_SUBPIXEL_SHIFT; let mut y = y1 << POLY_SUBPIXEL_SHIFT; let w = self.subpixel_width(); let mut di = DistanceInterpolator0::new(xc1, yc1, xc2, yc2, x, y); x += POLY_SUBPIXEL_SCALE/2; ...
Rust
0
# Generated by Django 5.1.5 on 2025-01-30 10:59 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('products', '0001_initial'), ] operations = [ migrations.AddField( model_name='product', name='updated_at', ...
Python
1
} } //! [Problem 21](https://projecteuler.net/problem=21) solver. #![warn(bad_style, unused, unused_extern_crates, unused_import_braces, unused_qualifications, unused_results)] #![feature(iter_arith)] #[macro_use(problem)] extern crate common; extern crate prime; use prime::{PrimeSet, Factorize...
Rust
0
: expr) => ({ let mut result: [u64; $n_words] = unsafe { ::std::mem::uninitialized() }; let self_t: &[u64; $n_words] = &$self_expr.0; let other_t: &[u64; $n_words] = &$other.0; let overflow: u8; unsafe { asm!(" add $15, $0 adc $16, $1 adc $17, $2 adc $18, $3 lodsq adc $11, %rax ...
Rust
0
# A development config to test a BinderHub deployment generally. It can be # combined with with the auth specific config. # Deployment assumptions: # - BinderHub: standalone local installation # - JupyterHub: standalone k8s installation import logging import os logger = logging.getLogger(__name__) # We need to fin...
Python
1
_ubig(input: u128) { let val = Value::from(input, 128); assert_eq!(val.as_unsigned(), input.into()) } #[test] fn ubig_roundtrip(input: u128, mul: u128) { let in_big: UBig = input.into(); let mul_big: UBig = mul.into(); let target: UBig...
Rust
0
the class. """ if PY2: if '__str__' not in klass.__dict__: raise ValueError("@python_2_unicode_compatible cannot be applied " "to %s because it doesn't define __str__()." % klass.__name__) klass.__unicode__ = klass.__str__ ...
Python
1
_MANAGER), OFFCHAIN_CERTIFICATE_SIGNER_1 )); assert_noop!( TestModule::revoke_slot( Origin::signed(OFFCHAIN_CERTIFICATE_SIGNER_1), OFFCHAIN_CERTIFICATE_SIGNER_1 ), Error::<Test>::NotTheOwner ); }) } #[test] fn ...
Rust
0
"""AWS configuration for ChessMate.""" import os import boto3 from botocore.config import Config # AWS Credentials AWS_ACCESS_KEY_ID = os.getenv('AWS_ACCESS_KEY') AWS_SECRET_ACCESS_KEY = os.getenv('AWS_SECRET_KEY') AWS_STORAGE_BUCKET_NAME = os.getenv('AWS_BACKUP_BUCKET') AWS_S3_REGION_NAME = os.getenv('AWS_REGION', 'u...
Python
1
mph16; #[doc = "MCU SEMAPHORE 17\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modif...
Rust
0
1,-2 -2,-2,0,1 0,2,1,3 -2,3,-2,1 0,2,3,-2 -1,-1,1,-2 0,-2,-1,0 -2,2,3,-1 1,2,2,0 -1,-2,0,-2"; assert_eq!(part1(&as_input(input)), 8); } }<reponame>mkroening/gdbstub mod common; mod console_ou...
Rust
0
iple energy # bins by supplying a list of ``energy_edges``. # # By default, the likelihood scan is computed from 0.2 to 5.0. # Here, we increase the max value to 10.0, because we are # dealing with a large flare. lc_maker_1d = LightCurveEstimator( energy_edges=[0.7, 1, 20] * u.TeV, source="pks2155", time_i...
Python
1
ription="Endpoint to get a specific Award object", responses={ 200: ("Success", "AwardDetailedSuccessResponse"), 400: ( "An error occured processing the provided or stored data", "APISimpleErrorResponse", ), }, ) def get(self, a...
Python
1
lowest. /// /// Note that `a` will be the highest 32 bits of the result, and `d` the /// lowest. This matches the standard way of writing bit patterns on x86: /// /// ```text /// bit 127 .. 96 95 .. 64 63 .. 32 31 .. 0 /// +---------+---------+---------+---------+ /// | a | b | c ...
Rust
0
mpty()); Some(lb) }, None => None, _ => unreachable!("iter for Finite interval with open lower bound"), } } } impl<T> DoubleEndedIterator for Iter<T> where T: Ord + Clone + Finite { fn next_back(&mut self) -> Option<Self::Item> { match sel...
Rust
0
); define_color!( DEEPORANGE_A400, 255, 61, 0, "Accent *deep orange* with a tint of A400" ); define_color!( DEEPORANGE_A700, 221, 44, 0, "Accent *deep orange* with a tint of A700" ); // brown define_color!(BROWN, 121, 85, 72, "*Brown*; same as [`BROWN_500`]"); define_color!(BROW...
Rust
0
n|rd|kr|j |dnx0tjdD]}t|j|jdqWtj||t|jjtjrht|jj|j_n|jjdk ryftjj|jj}t|}|jj|krtjd|jj|f||j_nWqtjjt fk rtjd |jjq...
Python
1
from qr_code.gui import run_app if __name__ == "__main__": run_app()
Python
1
in format string".into()); } // FIXME: This always allocates a `String`, so the `Cow` is useless. let literal = unescaped_literal.replace("{{", "{").replace("}}", "}"); frag.push(Fragment::Literal(literal.into())); Ok(()) } /// Returns `Some(smallest_bit_index, largest_bit_index)` contained in `pa...
Rust
0
lized_request.object_mut())?; }, _ => unreachable!() } Ok(serialized_request) } fn to_response(response: &generated::improbable::restricted::WorkerCommandResponse) -> Result<SchemaCommandResponse, String> { let mut serialized_response = SchemaCommandResponse::new...
Rust
0
__all__ = [ "CompletionPort", "Event", "accept", "connect", "get_accept_addrs", "have_connectex", "makesockaddr", "maxAddrLen", "recv", "recvfrom", "send", ] from twisted_iocpsupport.iocpsupport import ( # type: ignore[import-not-found] CompletionPort, Event, ac...
Python
1
usize, pub meta_fields: HashMap<FieldId, usize>, pub meta_pads: Vec<(u32, u32)>, pub vtable: LLVMValueRef, pub itable: LLVMValueRef } #[derive(Debug)] pub struct LLVMTypes { pub void: LLVMTypeRef, pub byte: LLVMTypeRef, pub short: LLVMTypeRef, pub int: LLVMTypeRef, pub long: LLVMTy...
Rust
0
a-subscription-plan-for-an-account-stubbed) /// /// --- pub async fn get_subscription_plan_for_account_stubbed_async(&self, account_id: i32) -> Result<MarketplacePurchase, AppsGetSubscriptionPlanForAccountStubbedError> { let request_uri = format!("{}/marketplace_listing/stubbed/accounts/{}", super:...
Rust
0
vec![], v) } build_module_from( vec![ c(gen_iops(100, &mut rng, &mut writer)), c(check_memory_size(&mut rng, &mut writer)), c(check_memory_ops(&mut rng, &mut writer)), c(check_global_ops(&mut rng, &mut writer)), check_local_ops(&mut rng, &mut...
Rust
0
bundle) class LogBundlesIdArchive(SecuredResource): @swagger.operation( nickname='downloadLogBundle', notes='Downloads log bundle as an archive.' ) @authorize('log_bundle_download') def get(self, log_bundle_id): bundle = get_storage_manager().get(models.LogBundle, log_bundle_i...
Python
1
# SPDX-License-Identifier: Apache-2.0 # SPDX-FileCopyrightText: Copyright contributors to the vLLM project """ This example shows how to run offline inference with a speculative decoding model on neuron. """ import os from vllm import LLM, SamplingParams # Sample prompts. prompts = [ "Hello, I am a language mode...
Python
1
# Ultralytics 🚀 AGPL-3.0 License - https://ultralytics.com/license from .predict import DetectionPredictor from .train import DetectionTrainer from .val import DetectionValidator __all__ = "DetectionPredictor", "DetectionTrainer", "DetectionValidator"
Python
1
`` /// use tinystr::{tinystr4, TinyStr4}; /// /// const S1: TinyStr4 = tinystr4!("abc"); /// let s2: TinyStr4 = "abc".parse().unwrap(); /// assert_eq!(S1, s2); /// ``` #[macro_export] macro_rules! tinystr4 { ($s:literal) => { unsafe { $crate::TinyStr4::new_unchecked($crate::raw_macros::u32_from_bytes!($s)) ...
Rust
0
&& tx_pool.contains(&tx_hash) { log::trace!("Transaction {} appeared in pool", tx_hash); times_to_pool.lock().unwrap().push(now - start); in_pool = true; } } delay_for(POLL_DELAY).await; } } #[tokio::main] async fn main() { exonum::c...
Rust
0
""" STL import and edit example name: benchy.py by: Gumyr date: July 9, 2023 desc: This example imports a STL model as a Solid object and changes it. The low-poly-benchy used in this example is by reddaugherty, see https://www.printables.com/model/151134-low-poly-benchy. license: Copyright 2023 Gu...
Python
1
#!/usr/bin/env python3 # Copyright (C) 2019 Checkmk GmbH - License: GNU General Public License v2 # This file is part of Checkmk (https://checkmk.com). It is subject to the terms and # conditions defined in the file COPYING, which is part of this source code package. # mypy: disable-error-code="no-untyped-call" # mypy...
Python
1
ost(string, tag = "4")] pub description: ::prost::alloc::string::String, /// Type of xDS-client connecting to Traffic Director #[prost(enumeration = "traffic_director_log_entry::ClientType", tag = "5")] pub client_type: i32, /// The version of xDS-client connecting to Traffic Director. #[prost(s...
Rust
0
.overrides_with("number-none-empty-lines") ) .arg( Arg::with_name("number-none-empty-lines").short("-b").help("number none-empty output lines").overrides_with("number-lines") ) .arg( Arg::with_name("files").multiple(true).index(1) ) } struct FullLines<B> {...
Rust
0
perties) -> usize { #[allow(clippy::identity_op)] let content_size = 0 + list.message_id.encoded_size() + list.user_id.encoded_size() + list.to.encoded_size() + list.subject.encoded_size() + list.reply_to.encoded_size() + list.correlation_id.encoded_size() ...
Rust
0
# Copyright (c) ONNX Project Contributors # SPDX-License-Identifier: Apache-2.0 import numpy as np from onnx.reference.ops._op import OpRunUnaryNum class Softsign(OpRunUnaryNum): def _run(self, X): # type: ignore tmp = np.abs(X) tmp += 1 np.divide(X, tmp, out=tmp) return (tmp,...
Python
1
""" Pydantic models for geographic data and GeoJSON structures. This module defines the schema models used for handling geographic data, GeoJSON structures, and map layer responses. """ from pydantic import BaseModel from typing import Any class GeoJSONGeometry(BaseModel): """GeoJSON geometry model. Repres...
Python
1
} unsafe fn _send_key_event(vk: u16, flags: u32) { let key_input = winuser::KEYBDINPUT { wVk: vk, wScan: 0, dwFlags: flags, time: 0, dwExtraInfo: 0, }; let mut input = winuser::INPUT { type_: INPUT_KEYBOARD, u: mem::zeroed(), }; *input.u.ki_...
Rust
0
# -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: streamlit/proto/SessionEvent.proto # Protobuf Python Version: 5.26.1 """Generated protocol buffer code.""" from google.protobuf import descriptor as _descriptor from google.protobuf import descriptor_pool as _descriptor_pool fr...
Python
1
# Mobile Verification Toolkit (MVT) # Copyright (c) 2021-2023 The MVT Authors. # Use of this software is governed by the MVT License 1.1 that can be found at # https://license.mvt.re/1.1/ from .dumpsys_accessibility import DumpsysAccessibility from .dumpsys_activities import DumpsysActivities from .dumpsys_appops im...
Python
1
# coding=utf8 import os import pickle import numpy as np import operate_data as od import ml_model as ml from news import ret_news # from supplier_news import supl_news import supplier_news as sp VECTOR_MODE = {'onehot': 0, 'wordfreq': 1, 'twovec': 2, 'tfidf': 3, 'outofdict': 4} def save_model(best_vector,best_model...
Python
1
e, temporal_scale)) w_len = window_size for j in range(temporal_scale): for k in range(w_len): m[j, min(max(j - w_len // 2 + k, 0), temporal_scale - 1)] = 1. # pdb.set_trace() m = m.repeat(bs, n_heads, 1, 1) a_tokens = torch.randn(2, 10, 1024) v_tokens = torch.randn(2, 10, 1...
Python
1
d_closest_face(&self) -> Option<(u16, Face)> { self.faces .iter() .enumerate() .filter(|(_, val)| val.distance.is_finite()) .min_by(|a, b| a.1.distance.partial_cmp(&b.1.distance).unwrap()) .map(|(a, b)| (a as u16, *b)) } // Adds a point to the...
Rust
0
ABLE_DICT) print("###" * 35) ############################################################################## def load_idlist(id_list_nm='id_list_dict', zero_pre_post='pre'): """ zero_pre_post: "pre"表示序列开头填充0,"post"表示序列尾部填充0 """ # id_list_dict: 包含padding后的序列特征字典以及词表 id_list_dict = Cache.reload_cach...
Python
1