text
string
label_name
string
labels
int64
es of applications like Splunk Enterprise Security. Do not define extractions for this fields when writing add-ons. src_priority: String, /// The "remote" port connected to the listening port (if applicable). src_port: u64, /// This field is automatically provided by asset and identity correlation featu...
Rust
0
def get_max_triples_original(n): """ You are given a positive integer n. You have to create an integer array a of length n. For each i (1 ≤ i ≤ n), the value of a[i] = i * i - i + 1. Return the number of triples (a[i], a[j], a[k]) of a where i < j < k, and a[i] + a[j] + a[k] is a multiple o...
Python
1
: 0244211a4d2a067f7a61ed88dff6764856d347465f330d 0e15502700afd1865911025b95a6add1f2f3d038811b5ad3494bed73b1e2500d8dade c592d88406e25c2f2 registration_upload: 0286913c9cdffc7a71c54cc5b32a3faa62cfba0180f0b763 51096409c9e19cd72e2dd8b5c51a4689c469f067e2766b987fa6c4ee4353b19f2974f 2407e2dc07fd92527e48c983deeb54c9c6337fdd9e1...
Rust
0
'xml': str(xml), 'attrs': str(' ').join(attrs), 'value': smart_encode(value), 'attrs_sp': attrs_sp}) elif isinstance(root[key], list): for item in root[key]: attrs, value = attribute_check(item) if value is None: ...
Python
1
telegram @KingVJ01 EXTRAMOD_TXT = """ʜᴇʟᴘ: Exᴛʀᴀ Mᴏᴅᴜʟᴇs <b>ɴᴏᴛᴇ:</b> my features Stay here new features coming soon... <b>✯ Maintained by : <a href=https://t.me/rishu1286>☢Rishu☢</a></b> <b>✯ Join here : <a href=https://t.me/ur_rishu_143>☢Join my updateds☢</a></b> ./id - <code>ɢᴇᴛ ɪᴅ ᴏꜰ ᴀ ꜱᴘᴇᴄɪꜰɪᴇᴅ ᴜꜱ...
Python
1
r is distinct from the OS's process id. #[derive(Serialize, Deserialize, Default, Debug, Clone, Copy, Hash, PartialEq, Eq, PartialOrd, Ord)] pub struct PluginPid(usize); /// A running plugin. pub struct Plugin { peer: PluginPeer, /// The plugin's process process: Child, description: PluginDescription, ...
Rust
0
1: npyscreen.wrapper(myTUI().run()) elif len(sys.argv) > 3: print("One argument at a time") sys.exit() elif sys.argv[1] == "-c": for line in analyze(sys.argv[2]): print(str(line)) sys.exit() elif sys.argv[1] == "-eq": print(solveEq(sys....
Python
1
from typing import Dict, List, Tuple, Union from TTS.tts.layers.xtts.trainer.gpt_trainer import GPTTrainer class GPTDecode(GPTTrainer): def generate(self, text_inputs, text_lengths, audio_codes, wav_lengths, cond_mels, cond_idxs, cond_lens): """ Forward pass that uses both text and voice in either...
Python
1
--sync-safekeepers failed"); if !sync_output.status.success() { anyhow::bail!( "sync-safekeepers failed: '{}'", String::from_utf8_lossy(&sync_output.stderr) ); } let lsn = Lsn::from_str(std::str::from_utf8(&sync_output.stdout)?.trim())?; ...
Rust
0
_match { () => { concat!(r"\A(?:", at_signs!(), "|[", latin_accents!(), "]|://)") }; } ///Regex matching a valid user or list mention. macro_rules! valid_mention_or_list { () => { concat!("(", valid_mention_preceding_chars!(), ")", "(", at_signs!(), ")", "([a...
Rust
0
ti_publish(self): """ This test makes sure the PublisherConsistencyListener is working even with a huge message buffer""" topic = "/test_immediate_multi_publish" msg_class = Int32 msgs = [] for i in range(100): msg = Int32() msg.data = i ...
Python
1
a line segment (utm_start -> utm_end) :param utm_start: The starting point of the line segment. :type utm_start: geodesy.utm.UTMPoint :param utm_end: The ending point of the line segment. :type utm_end: geodesy.utm.UTMPoint :param utm_p: The point. :type utm_p: geodesy....
Python
1
al QPoint if isinstance(target_pos_qpointf, QPoint): # Convert QPoint back to QPointF if necessary target_pos = QPointF(target_pos_qpointf) else: target_pos = target_pos_qpointf # Already QPointF or None (use canvas_pos) if target_...
Python
1
from mitmproxy import http from mitmproxy import tls from mitmproxy import ctx import requests import re import subprocess import base64 HEADER = "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0" def response(flow: http.HTTPFlow): # check if initial request doesn't establish tls ...
Python
1
fn get_static(string: &str) -> Option<Sym> { Self::STATIC_STRINGS .into_iter() .enumerate() .find(|&(_i, s)| string == s) .map(|(i, _str)| { let raw = NonZeroUsize::new(i.wrapping_add(1)).expect("static array too big"); Sym::from_ra...
Rust
0
import numpy as np from test_utils import change_cwd_to_tests_dir, add_project_root_to_path change_cwd_to_tests_dir() add_project_root_to_path() from cvvideoplayer import TestingFrameReader, create_video_player from cvvideoplayer.utils.ui_utils import SingleInput, InputType def test_video_navigation(): frame_r...
Python
1
Bit YUV Formats for Video Rendering.][1] /// /// **Direct3D 11.1:** This value is not supported until Windows 8. /// /// [1]: https://msdn.microsoft.com/en-us/library/windows/desktop/dd206750(v=vs.85).aspx Ai44 = 111, /// 4-bit palletized YUV format that is commonly used for DVD subpicture. ...
Rust
0
else: class_map[mask] = 1 return instance_map, class_map @classmethod def rle_decode(cls, filename, one_hot=False, center=False): df = pd.read_csv(filename, header=None) df_numpy = df.to_numpy() d = {} if one_hot: mask_decoded...
Python
1
LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations und...
Rust
0
import asyncio import fastapi # noinspection PyPackageRequirements import pytest import fastapi_chameleon as fc # setup_global_template - needed as pytest mix-in. # noinspection PyUnusedLocal def test_cannot_decorate_missing_template(setup_global_template): with pytest.raises(ValueError): @fc.template(...
Python
1
pub texels: Vec<u8>, } #[derive(Clone, Copy, Debug)] pub struct FillObjectPrimitive { pub px: LineSegmentU4, pub subpx: LineSegmentU8, pub tile_x: i16, pub tile_y: i16, } #[derive(Clone, Copy, Debug)] #[repr(C)] pub struct TileObjectPrimitive { /// If `u16::MAX`, then this is a solid tile. ...
Rust
0
| b.iter(all_mpst)); } criterion_group! { name = logging; config = Criterion::default().significance_level(0.1).sample_size(10100); targets = logging_main } criterion_main!(logging); <filename>protocol/src/test/map_tests.rs use hal::{ProtocolBuffer,new_protocol_buffer}; use crate::map::*; use crate::proto...
Rust
0
Implementation of Node impl<K, V> Node<K, V> { fn create(parent: Link<K, V>, key: K, value: V) -> NodePtr<K, V> { let boxed = Box::new(Node { parent, left: None, right: None, height: 0, key, value, }); unsafe { NodePtr::...
Rust
0
from pyspark import SparkContext # Initialize Spark context sc = SparkContext(appName="WordCount") # Read the text file into an RDD text_file = sc.textFile("file:///mnt/data/sample.txt") # Split the lines into words and count occurrences counts = text_file.flatMap(lambda line: line.split(" ")) \ .m...
Python
1
// - `input` is the input audio /// - `dt` is the time that's elapsed since the previous round of /// processing (in seconds) /// - `parameters` contains information about the current value of /// parameters. This is an opaque type that's only useful for updating /// `CachedValue`s. fn process(&mut self, input: F...
Rust
0
llback <https://optuna-integration.readthedocs.io/en/stable/reference/generated/optuna_integration.LightGBMPruningCallback.html>`__ introduces pruning without directly changing the logic of training iteration. # (See also `example <https://github.com/optuna/optuna-examples/blob/main/lightgbm/lightgbm_integration.py>`__...
Python
1
al_overlap += overlap s_forward += t_forward s_backward += t_backward epoch = "0" * (len(str(args.n_epochs)) - len(str(i))) iteration = "0" * (len(str(n_iterations)) - len(str(j))) if args.verbose: print( "[epoch %s%d iteration %s%d]loss %.3f | overla...
Python
1
], split ); assert_eq!( vec![true, false, true, false], split .into_iter() .map(|s| Passport::from_str(&s)) .map(|p| p.valid_1()) .collect::<Vec<_>>() ) } #[test] fn validators() { ...
Rust
0
ger.info("decoding test set") results = self.decode(TEST, batch_size, f"{model_fp}.decode", decode_fn) if results: for result in results: self.logger.info( f"TEST {result.long_desc} is {result.res} at epoch -1" ) ...
Python
1
ated_at`, `goods_id`, `order_id`, `user_id`) VALUES (74, '七子白面膜粉使用后肌肤保湿效果显著,但敏感肌肤需要小心使用', 2, 3, NULL, NULL, '2024-05-02 15:06:40.000000', '2024-05-10 15:08:16.333419', 14, 6, 34); INSERT INTO `comments` (`id`, `content`, `rate`, `star`, `reply`, `pics`, `created_at`, `updated_at`, `goods_id`, `order_id`, `user_id`) VAL...
Python
1
, "CAP_SYS_MODULE" => Ok(capabilities::Capability::CAP_SYS_MODULE), "CAP_SYS_RAWIO" => Ok(capabilities::Capability::CAP_SYS_RAWIO), "CAP_SYS_CHROOT" => Ok(capabilities::Capability::CAP_SYS_CHROOT), "CAP_SYS_PTRACE" => Ok(capabilities::Capability::CAP_SYS_PTRACE), "CAP_SYS_PACCT" ...
Rust
0
from torch import nn class EmotionNet(nn.Module): """ 记忆分析网络,负责管理对话记忆 """ short_term_memory: list long_term_memory: list all_memory: None def add_long_term_memory(self, long_term_memory): """ 添加长记忆 :param long_term_memory: 长记忆 :return: """ p...
Python
1
: &str) { let mut stdout = stdout.into_raw_mode().unwrap(); // init Tui struct let mut tui = Tui::new(init_query); // set options if args.is_present("t") { tui.set_print_trinomes(true); } // if query; process and return if args.is_present("QUERY") { tui.print_results(ve...
Rust
0
import subprocess from typing import Any from astronverse.actionlib.types import WinPick from astronverse.window import ControlInfo, WindowSizeType from astronverse.window.core import IWindowsCore class WindowsCore(IWindowsCore): @staticmethod def info(handler: Any) -> ControlInfo: assert isinstance(...
Python
1
nction. symbol : :py:class:`~.Symbol` The variable for maximum value needs to be determined. domain : :py:class:`~.Interval` The domain over which the maximum have to be checked. If unspecified, then the global maximum is returned. Returns ======= number Maximum val...
Python
1
:os::raw::c_int; pub fn GetGestureHoldDuration() -> f32; pub fn GetGestureDragVector() -> Vector2; pub fn GetGestureDragAngle() -> f32; pub fn GetGesturePinchVector() -> Vector2; pub fn GetGesturePinchAngle() -> f32; pub fn SetCameraMode(camera: Camera3D, mode: ::std::os::raw::c_int); ...
Rust
0
sh)] #[repr(C)] pub enum GGIndexFormat { IFMT_UNDEFINED = 0, IFMT_SOUP_16U, IFMT_SOUP_32U, IFMT_STRIP_16U, IFMT_STRIP_32U, } #[allow(non_camel_case_types)] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] #[repr(C)] pub enum GGDistanceFormat { DFMT_UNDEFINED = 0, DFMT_EXACT_DISTANCE_8, DFMT_EXACT_DISTANCE_32...
Rust
0
} else if self.value == PMPADDR52 { unsafe { asm!("csrw {csr}, {rs}", rs = in(reg) val_to_set, csr = const PMPADDR52); } } else if self.value == PMPADDR53 { unsafe { asm!("csrw {csr}, {rs}", rs = in(reg) val_to_set, csr = const PMPADDR...
Rust
0
}; // exact match assert_eq!(cfg.roles_for_path("/vendor/chip/1/good"), Some(&[Client][..])); // exact match, same length as /* assert_eq!(cfg.roles_for_path("/vendor/chip/1/g"), Some(&[Ap, Ap][..])); // prefix matches assert_eq!(cfg.roles_for_path("/vendor/chip/1/better...
Rust
0
.pad_properties(pad_props) .body(body_width, body_height); let mut drawing = Drawing::new(); two_pin.draw(&mut drawing, lib_cfg); Ok(drawing) } fn draw_model(&self, _comp_cfg: &Config, _lib_cfg: &Config) -> Result<Drawing> { debug!("draw chip model"); ...
Rust
0
{31}\u{2c}\u{3a}\u{61}", &["\u{61}\u{5f}\u{31}", "\u{2c}", "\u{3a}", "\u{61}"]), ("\u{61}\u{5f}\u{61}\u{2c}\u{3a}\u{61}", &["\u{61}\u{5f}\u{61}", "\u{2c}", "\u{3a}", "\u{61}"]), ("\u{61}\u{2c}\u{2e}\u{31}", &["\u{61}", "\u{2c}", "\u{2e}", "\u{31}"]), ("\u{61}\u{5f}\u{31}\u{2c}\u{2e}\u{31}", &["\...
Rust
0
# coding = utf-8 ''' @author = super_fazai @File : youyuan.py @Time : 2017/9/6 21:18 @connect : superonesfazai@gmail.com ''' """ 运行程序: 1. Master端打开 Redis: redis-server 2. Slave端直接运行爬虫: scrapy crawl youyuan1 3. 多个Slave端运行爬虫顺序没有限制 将项目修改成 RedisCrawlSpider 类的分布式爬虫,并尝试在多个Slave端运行 """ from scrapy.li...
Python
1
from selenium.webdriver.common.by import By add_new_company_locator = (By.XPATH, "//span[normalize-space()='Add New Company']") company_name_locator = (By.XPATH, "//div[@class='BottomCollapseBox']//div//div[@class='ant-row css-16v3ahg']//div[" "@class='ant-col ant-col-24 css-16v3ahg']...
Python
1
ɵ1UՌ [$I2ʺV{٬A݊2Q]]`ZlNcQmkľlf{h pײ%}xF늵=7lHU3XY~FYG!jx ZTmH\o,6_Da$TShvRl`4 j[I{< f#Ф24n: 6ֶf1t a\ 3?q'J˵΢3>a!I{ Gߐ}#o60|\n[mI{.k2|r2!NC!ZkwJkg':+rc&YCuL|23ˊ-w4q_"۷U'O|eCd6ov+On-A#Pg,fC@S lJA@Dܯ{[;P~çɁl;.]@kJa?cV68k(BeDAy÷"ϧɤAV3, Bʂ~},z x}޾4HΗxZT{/5 r0dFvIDIH'...
Python
1
ag(false); assert_eq!(cpu.r[R_PSW], F_V | F_Z | F_N); cpu.set_v_flag(false); assert_eq!(cpu.r[R_PSW], F_Z | F_N); cpu.set_z_flag(false); assert_eq!(cpu.r[R_PSW], F_N); cpu.set_n_flag(false); assert_eq!(cpu.r[R_PSW], 0); } #[test] fn can_set_isc_flag()...
Rust
0
::from_translation((1.0, 0.5, -2.0).into()); let object_to_world = translate * rotate * translate.invert().unwrap(); let object = object.transform(object_to_world); objects.push(object); // Create a mirror sphere let mirror = MaterialType::Reflective; let phong = MaterialType::new_phong(0.4, 0....
Rust
0
# Copyright 2021 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 # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, ...
Python
1
otdisk: &Path) -> Result<MountUnit> { if let Some(what) = &root.root { if what.starts_with("LABEL=") { Ok(MountUnit { unit_section: UnitSection { ..Default::default() }, mount_section: MountSection { what: wh...
Rust
0
import numpy as np import cv2 as cv from matplotlib import pyplot as plt MIN_MATCH_COUNT = 10 img1 = cv.imread('images/Vildkatten/VildkattenKarte02.png', cv.IMREAD_GRAYSCALE)# queryImage img2 = cv.imread('images/Vildkatten/Vildkatten.jpg', cv.IMREAD_GRAYSCALE) # trainImage # Initiate SIFT detector sift = cv.SIFT_...
Python
1
from user import * class UserManager: def __init__(self): self.users = [] def add_user(self, user_id, user_name, user_email): user = User(user_id, user_name, user_email) self.users.append(user) print("User added successfully!") def view_user(self): if not self.users...
Python
1
we sort nodes in each BDD in the //! DFS post-order (taking low edge first and high edge second, although this decision is arbitrary) //! of the graph and this way, we can easily save them as a sequence in an array. The only //! exception are the two terminal nodes which we always place on positions 0 and 1 //! (empty...
Rust
0
> DerefMut for SimplePosition<N> { fn deref_mut(&mut self) -> &mut Self::Target { &mut self.0 } } <gh_stars>0 use necsim_core::{ cogs::{Backup, Habitat, TurnoverRate}, landscape::Location, }; use necsim_core_bond::{NonNegativeF64, PositiveF64}; #[derive(Debug)] #[cfg_attr(feature = "cuda", deri...
Rust
0
import json import pytest from pytest_httpx import HTTPXMock from users.models import Follow, FollowStates, Identity, InboxMessage from users.services import IdentityService @pytest.mark.django_db @pytest.mark.parametrize("ref_only", [True, False]) def test_follow( identity: Identity, remote_identity: Ident...
Python
1
::<Vec<&str>>(); let ip_addr2 = key2_split[0]; if let (Ok(ip_addr1), Ok(ip_addr2)) = (key1.parse::<IpAddr>(), ip_addr2.parse::<IpAddr>()) { if key2_split.len() == 2 { match key2_split[1].parse::<u8>() { Ok(ip_netmask) => match IpNetwork::new_truncate(ip_addr2, ip_netmask) { ...
Rust
0
ut_Protocol( pVal: BSTR, ) -> HRESULT, fn get_Descr( pVal: *mut BSTR, ) -> HRESULT, fn put_Descr( pVal: BSTR, ) -> HRESULT, }} pub type LPSECURITYPROFILEINTERNETRESOURCE = *mut ISecurityProfileInternetResource; RIDL! {#[uuid(0x915d5ba9, 0x08ba, 0x40d4, 0xbc, 0x8c, 0x9b, 0x79...
Rust
0
insert_leaf_response([0; 32], [1; 32], vec![0, 1, 2, 3]) .add_try_auth_success_response([0; 32], vec![0, 1, 2, 3], [1; 32]) // Fail authentication to the account, assuming a bad passphrase. .add_try_auth_failed_response([0; 32], vec![0, 1, 2, 3], [1; 32]) .build(); let env = TestEnv:...
Rust
0
from datetime import datetime from sqlalchemy import (MetaData, Column, ForeignKey, DateTime, Integer, PickleType, Table) metadata = MetaData() selection_table = Table( 'selection', metadata, Column('id', Integer, primary_key=True), Column('create_time', DateTime, default=datetim...
Python
1
""" 1. cd into your Marqo repo 2. Run Marqo with your desired env vars: ```bash docker rm -f marqo && DOCKER_BUILDKIT=1 docker build . -t marqo_docker_0 && docker run --name marqo --privileged -p 8882:8882 --add-host host.docker.internal:host-gateway \ -e "MARQO_MAX_DOC_BYTES=12345" -e "MARQO_MAX_RETRIEVABLE_DOCS...
Python
1
_NAME, MarketType::InverseSwap, raw_msg).unwrap() ); assert_eq!( 1654232431449, extract_timestamp(EXCHANGE_NAME, MarketType::InverseSwap, raw_msg) .unwrap() .unwrap() ); } #[test] fn linear_swap() { let raw_msg = r#"{"...
Rust
0
): nn.init.constant_(m.weight, 1.0) nn.init.constant_(m.bias, 0) elif isinstance(m, nn.Linear): trunc_normal_(m.weight, std=.02) if hasattr(m, 'bias') and m.bias is not None: nn.init.constant_(m.bias, 0) elif isi...
Python
1
command(SubCommand::with_name("open") .about("Open a todo list") .arg(Arg::with_name("FILE") .help("The file to open") .default_value("list.todo") .required(true))) .subcommand(SubCommand::with_name("init") .about("Create a new ...
Rust
0
mut a = [0; ffi::SUPERVISOR_NUMBER_OF_ADC_CHANNELS]; for i in 0..a.len() { // 15 is the offset to locate the adc data // in the housekeeping data a[i] = (raw.0[15 + 2 * i] as u16) | (raw.0[15 + 2 * i + 1] as u16) << 8; } a }, ...
Rust
0
""" 检测指标计算模块 提供目标检测相关的评估指标计算功能 """ import numpy as np from typing import List, Dict, Any def calculate_metrics(targets: List[Dict[str, Any]], predictions: List[Dict[str, Any]]) -> Dict[str, float]: """计算检测指标 Args: targets: 目标标注列表,每个元素包含bbox和class_id predictions: 预测结果列表,每个元素包含bbox、class_i...
Python
1
_window_title( ctx, &format!( "{} v{} - {:.2} fps - {}", TITLE, VERSION, fps, format_clock_rate(fps * CYCLES_PER_FRAME) ), )...
Rust
0
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license """Run a Flask REST API exposing one or more YOLOv5s models.""" import argparse import io import torch from flask import Flask, request from PIL import Image app = Flask(__name__) models = {} DETECTION_URL = "/v1/object-detection/<model>" @app.route(DETECTION_URL, meth...
Python
1
from sample_efficiency_evaluation.fact_matcher import FactMatcherSimple from sample_efficiency_evaluation.knowledge_prober import KnowledgeProber
Python
1
_end().pollee().register_observer(observer, mask); Ok(()) } fn unregister_observer(&self, observer: &Arc<dyn Observer>) -> Result<Arc<dyn Observer>> { self.this_end() .pollee() .unregister_observer(observer) .ok_or_else(|| errno!(ENOENT, "the observer is not ...
Rust
0
log::logger(); core::run(); } use crate::{ downloader::{ headers::{ header_slices, header_slices::{HeaderSlice, HeaderSliceStatus, HeaderSlices}, }, messages::{BlockHeadersMessage, EthMessageId, Message}, sentry_client_reactor::SentryClientReactor, }...
Rust
0
ures::Stream; use std::error::Error; use tokio_core::reactor::Core; fn main() { code().unwrap(); } fn code() -> Result<(), Box<dyn Error>> { let account = std::env::var("STORAGE_ACCOUNT").expect("Set env variable STORAGE_ACCOUNT first!"); let master_key = std::env::var("STORAGE_MASTER_KEY").expect("Set en...
Rust
0
)] pub struct Module { pub guild: i64, pub module: ModuleKind, pub enabled: bool, } #[derive(Queryable, Debug)] pub struct Action { pub id: i32, pub guild: i64, pub module: ModuleKind, pub action: ActionKind, pub in_channel: Option<i64>, pub message: Option<String>, } #[derive(Inse...
Rust
0
a medicine and ensuring cache is cleared medicine = MedicineDetail.objects.get(name="Ibuprofen Tablet") medicine.price = Decimal("11.99") medicine.save() # Check cache for the "Ibuprofen" query after the update to ensure invalidation assert RedisCache().get(cache_key) is None, "Cache should be inva...
Python
1
groupings. common::assert_matched_contents(matched, json!( [ { "charter": { "name": "Advanced Lua Scripts", "version": 1637208553000u64, "file": charter.canonicalize().unwrap().to_string_lossy() }, "job_id": FIXED_JOB_I...
Rust
0
created_ms: 1554130814854, payload, }); let template = "type: ${event.type} - body: ${event.payload.body}"; let interpolator = StringInterpolator::build(template, "rule", &Default::default()).unwrap(); PROFILER.lock().unwrap().start("./target/interpolator.profile").unwrap(); c.bench_funct...
Rust
0
#함수 : 최소한의 기능을 하는 코드의 집합 #print type int float str # 5 + 3의 타입을 확인하십시오 print(type("5+3")) #최대값 구하기 a = max(3,5,312) print(a) #최소값 구하기 b = min(10,20) print(b) #합 구하기 iterable (반복가능하게) 값을 넣어야함 c = sum([10, 30]) print(c) #3,7,10 중 가장 큰 값을 출력 print(max([3,7,10])) #3과 7 중큰값을 10에 더해 합계를출력 print(sum([10, max(3,7)])) #1 ...
Python
1
rogress) button_container.setLayout(button_layout) layout.addWidget(button_container) # 状态标签 self.easytier_status_label = QLabel("准备就绪") self.easytier_status_label.setStyleSheet(""" QLabel { color: #a6e3a1; font-size: 12px; ...
Python
1
class Solution: def searchInsert(self, nums: List[int], target: int) -> int: for i in range(len(nums)): if nums[i] == target or nums[i] > target: return i return len(nums)
Python
1
l_ip2: if st.button("⏹️ Stop IP Camera"): if 'ip_camera_active' in st.session_state: del st.session_state['ip_camera_active'] st.info("⏹️ IP camera analysis stopped!") ...
Python
1
) { self.location.y += PLAYER_MOVEMENT_SPEED; } pub fn left(&mut self) { self.location.x -= PLAYER_MOVEMENT_SPEED; } pub fn right(&mut self) { self.location.x += PLAYER_MOVEMENT_SPEED; } pub fn get_dimensions(&self) -> (f32, f32) { (self.width, self.height) ...
Rust
0
c * 2.0 / c2d2e_2)); let dg = wg * -b + xg * a + yg * (b / c2d2e - (a * c + b * d) * (d * 2.0 / c2d2e_2)) + zg * (-a / c2d2e - (b * c - a * d) * (d * 2.0 / c2d2e_2)); *ui::get_unchecked_mut(input_grad, i * 4) += ag; *ui::get_unchecked_mut(input_grad, i * 4 + 1) += bg; *ui::get_unc...
Rust
0
d_pos = hit_info['world_pos'] self._last_hit_triangle_idx = hit_info['triangle_idx'] self._last_hit_barycentric = hit_info['barycentric'] self._show_brush_cursor(event.pos()) try: if hasattr(self._canvas, 'update'): ...
Python
1
o(self.device) for k, v in global_cond.items(): if type(v) is torch.Tensor: global_cond[k] = v.to(self.device) batch_size = len(x) t = torch.randint(0, self.n_timesteps, (batch_size,), device=x.device).long() x1 = x.to(self.device) # x0 = torc...
Python
1
dimensions. /// Only values 0 or 1 are ever returned. /// The plane dimensions must also be rounded up to accommodate odd luma plane /// sizes. /// Cs400 returns None, as there are no chroma planes. pub(crate) fn get_decimation(self) -> Option<(usize, usize)> { use self::ChromaSampling::*;...
Rust
0
pair8::g1mul(&d, &sc).tobytes(sig, true); BLS_OK } /* Verify signature given message m, the signature sig, and the public key w */ pub fn core_verify(sig: &[u8], m: &[u8], w: &[u8]) -> isize { let hm = bls_hash_to_point(m); let mut d = ECP::frombytes(&sig); if !pair8::g1member(&d) { return B...
Rust
0
非固定IP,默认: FALSE 固定IP。 :type IsNonStaticIpMode: bool :param _DeletionProtection: 是否启用集群删除保护 :type DeletionProtection: bool :param _KubeProxyMode: 集群的网络代理模型,目前tke集群支持的网络代理模式有三种:iptables,ipvs,ipvs-bpf,此参数仅在使用ipvs-bpf模式时使用,三种网络模式的参数设置关系如下: iptables模式:IPVS和KubeProxyMode都不设置 ipvs模式: 设置IPVS为tru...
Python
1
t}\n") textctc_fp.write(f"{u.utt_id} {u.asr_text}\n") utt2spk_fp.write(f"{u.utt_id} {u.utt_id}\n") wavscp_fp.close() segments_fp.close() text_fp.close() textprev_fp.close() textctc_fp.close() utt2spk_fp.close() special_tokens = [ ...
Python
1
.split(',') .map(str::parse) .collect::<Result<_, _>>()?; Ok(code.into()) } } #[cfg(test)] mod tests { use super::*; #[test] fn test_examples() { macro_rules! test_intcode { ($input: expr, $expected: expr) => { let mut i...
Rust
0
mount drive" ONTAP_STORAGE_CAPACITY_RANGE = (1024, 196608) PROJECT_ID_REGEX = "^[a-z0-9-]{3,18}$" PROJECT_ID_ERROR_MESSAGE = "Only use lowercase alphabets, numbers, and hyphens (-) for project id. " +\ "Must be between 3 and 18 characters long." SOFTWARE_STACK_NAME_REGEX = SESSION_NAME_REGEX = "^.{3,50}$" SOFTWA...
Python
1
"(?mx) ^ Differential[\ ]Revision:[\ ] (.+ /)? (?P<diff>D[0-9]+) $", ) .expect("Failed to compile DifferentialRevisionProvider regex"); } let captures = RE.captures(message)?; let diff_number = &captures["diff"]; // HACK: not sure why the matched string doesn't live as long as `...
Rust
0
orian::{fixed_from_gregorian, Gregorian}; pub mod coptic; pub mod ethiopic; #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct CopticEthiopic { pub year: i32, pub month: i32, pub day: i32 } fn is_leap_year(year: i32) -> bool { divide(year, 4).1 == 3 } fn fixed_from_date(date: CopticEthiopic, ep...
Rust
0
wrap(); if let Some(_document) = exist_document { println!("MongoDB document is exist!"); } else { let slug = slugify(&article_new.subject).await; let user = users::services::user_by_id(db.clone(), article_new.user_id) .await?; let uri = format!("/{}/{}", &user.usern...
Rust
0
anchor7_prob_isin = group_mask_gen_8stage(anchor7_prob) anchor7_prob = self.model.mask_sparse_tensor(anchor7_prob,anchor7_prob_isin[6]) sym7 = self.decode_label_according_to_F(file_name, anchor7_prob) anchor7_label = self.model_input_ME(anc...
Python
1
"""initial migration Revision ID: 587201e1b5b2 Revises: Create Date: 2024-11-27 06:41:58.953209 """ from typing import Sequence, Union from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision: str = '587201e1b5b2' down_revision: Union[str, None] = None branch_labels: Union[...
Python
1
shard_id) for expert_id in range(num_physical_experts) for shard_id, weight_name in [ ("w1", ckpt_gate_proj_name), ("w2", ckpt_down_proj_name), ("w3", ckpt_up_proj_name), ] ] def extra_repr(self) -> str: s = ( f"g...
Python
1
import pickle import matplotlib.pyplot as plt import numpy as np model_name = 'plastic' file_path = f'./processed_data/model_update_random_value_all_tasks_{model_name}.pkl' if model_name == 'plastic': threshold = 0.9 else: threshold = 0.7 with open(file_path, 'rb') as file: data = pickle.load(file) do...
Python
1
aderName": "SG ARG", "field": "sg_arg", "sortable": True, "width": 100}, {"headerName": "SG PUTT", "field": "sg_putt", "sortable": True, "width": 100}, {"headerName": "SG T2G", "field": "sg_t2g", "sortable": True, "width": 100}, {"headerName": "SG Total", "field": "sg_tot...
Python
1
in32::System::Diagnostics::ToolHelp::*; use windows::Win32::Networking::WebSocket::*; use windows::Win32::Devices::PortableDevices::DMProcessConfigXMLFiltered; use windows::Win32::System::ApplicationVerifier::*; use windows::Win32::Graphics::DXCore::*; use windows::Win32::Graphics::Direct3D12::*; use windows::Win32::G...
Rust
0
mut Context<Self::Ctx>) { self.end += 1; } } struct NullRbspNalReader { decoder: RbspDecoder<NullNalHandler>, decoder_started: bool, } impl NalReader for NullRbspNalReader { type Ctx = (); fn start(&mut self, _ctx: &mut Context<Self::Ctx>) { assert!(!self.decoder_started); } ...
Rust
0
_delay: u8, pub phys_port_cnt: u8, pub comp_mask: u32, pub calc_cap: ibv_exp_device_calc_cap, pub timestamp_mask: u64, pub hca_core_clock: u64, pub exp_device_cap_flags: u64, pub max_dc_req_rd_atom: c_int, pub max_dc_res_rd_atom: c_int, pub inline_recv_sz: c_int, pub max_rss_tbl_sz: u32, pub ext_atom: ibv_ex...
Rust
0
and no option to change it. # Try to convert the UTF-8 encoding data back to original, but fails in some case. # Besides, don't know how to detect the input encoding of the running tmux version. # See LC_CTYPE in tmux manual: https://man7.org/linux/man-pages/man1/tmux.1.html # ...
Python
1
:PhantomData; use core::mem::{self, MaybeUninit}; use core::num::{ NonZeroI128, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI8, NonZeroIsize, NonZeroU128, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU8, NonZeroUsize, Wrapping, }; use core::ops::{Deref, DerefMut}; use core::ptr; use core::slice; // This is a hack...
Rust
0