text
string
label_name
string
labels
int64
u2190 Home", command=lambda: root_app.show_page("StartupPage")).pack(side="left", padx=6, pady=6) ttk.Label(hdr, text="Comparative Reporting", font=("Arial", 15)).pack(side="left", padx=4, pady=6) body = ttk.Frame(self) body.pack(expand=True, fill="both") # Body containing two side pan...
Python
1
Tip(QCoreApplication.translate("SortPlaylistDialog", u"Rearrange the order of this list to change the sorting priority", None)) #endif // QT_CONFIG(tooltip) self.addButton.setText(QCoreApplication.translate("SortPlaylistDialog", u"->", None)) self.removeButton.setText(QCoreApplication.translate("SortPla...
Python
1
(k_twist_frac, [*orbital_features[0].shape[:-1], 1])) if tao_config.twist_encoding is not None and "periodic" in tao_config.twist_encoding: R = np.array(R) periodic_twist = np.concatenate( [jnp.sin(R @ k_twist_frac)[..., None], jnp.cos(R @ k_twist_frac)[.....
Python
1
Cone> where F: Fn(&mut T) -> &mut Vec<KeyCone>, { let mut rng = rand::thread_rng(); let mut key_cones = vec![]; let high_bound = pre_sum.last().unwrap(); for _num in 0..sample_num { let d = rng.gen_cone(0, *high_bound) as usize; let i = match pre_sum.binary_search(&d) { O...
Rust
0
import os import polib base_dir = r"c:\code\era\erArk" old_po_path = os.path.join(base_dir, "data", "po", "ko_KR", "LC_MESSAGES", "erArk_py.po") new_po_path = os.path.join(base_dir, "data", "po", "zh_CN", "LC_MESSAGES", "erArk_py.po") # 读取PO文件 po = polib.pofile(old_po_path) # 创建一个字典来存储msgid和msgstr的对应关系 old_msgid_msg...
Python
1
We use a number of specific type wrappers to differentiate //! between the many different keys we need to manage over the //! course of the key exchange and double ratchet. These //! semantic keys ultimately wrap either a signing key or a //! key exchange key, but it's easier to keep them all straight //! this way. ...
Rust
0
to 8"] #[inline(always)] pub fn dcorsel_2(self) -> &'a mut W { self.variant(DCORSEL_A::DCORSEL_2) } #[doc = "Nominal DCO Frequency Range (MHz): 8 to 16"] #[inline(always)] pub fn dcorsel_3(self) -> &'a mut W { self.variant(DCORSEL_A::DCORSEL_3) } #[doc = "Nominal DCO Fre...
Rust
0
int_amount, Error::<T>::RequiredAmountNotReached); T::Assets::transfer(pool.pair.base, who, &pool_account, base_amount, keep_alive)?; T::Assets::transfer(pool.pair.quote, who, &pool_account, quote_amount, keep_alive)?; // owner's fee is transferred upfront. T::Assets::transfer( pool.pair.base, &poo...
Rust
0
s usize] [(((coord[0] - 1) & 0b0110) >> 1) as usize], ((coord[0] - 1) & 1) != 0, piece, ); Ok(()) } pub fn make_move(&mut self, move_from: &[u8], move_to: &[u8]) -> Result<(), ChessErr> { // Go ahead and perform the move for now. ...
Rust
0
ents = 'NaN' power_value = 0 u_modules = set() if len(data) > 0: recipe_ingredients = dict() for num, om_name, rec, power in data: outpost_module_count += int(num) u_modules.add(om_name) power_value += int(power) * int(num) try: ...
Python
1
} else { year % 400 == 0 } } #[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] pub enum DayOfWeek { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday, } impl DayOfWeek { pub fn from_days_since_epoch(days: u32) -> DayOfWeek { use self...
Rust
0
preference = input("Do you want vegetarian or non-vegetarian? ") if preference == "vegetarian": dish = input("Do you want 'Salad' or 'Pasta'? ") elif preference == "non-vegetarian": dish = input("Do you want 'Chicken' or 'Fish'? ") else: dish = "Invalid choice" print(f"You selected: {dish}")
Python
1
#!/usr/bin/env python """ Conway's game of life, final version. Rules: * Any cell with fewer than two neighbors dies (underpopulation) * Any cell with more than three neighbors dies (overpopulation) * Any empty spot with three neighbors becomes a live cell (reproduction) Check out the wikipedia article for more in...
Python
1
"[..])); } #[test] fn test_leaves_floats() { let mut json = br#"9999999999999999999999999999.99999"#.to_vec(); let old_json = json.clone(); translate_slice(&mut json[..]); assert_eq!(str::from_utf8(&json[..]), str::from_utf8(&old_json[..])); } #[test] fn test_leaves_floats2() { ...
Rust
0
"") blender_classes = [ SPREADSHEET_UL_data_fields, DataFieldPropertiesGroup, ImportSpreadsheetData, SPREADSHEET_PT_field_names, SPREADSHEET_PT_json_options, SPREADSHEET_PT_csv_options, AddDataFieldOperator, RemoveDataFieldOperator, ] # Only needed if you want to add into a dyn...
Python
1
} } }; // Load content let mut content = Vec::new(); file.read_to_end(&mut content)?; // Store the file descriptor for writable files let file = if readonly { None } else { Some(file) }; if content.le...
Rust
0
) -> xcb_dri2_copy_region_cookie_t { sym!(self, xcb_dri2_copy_region_unchecked)(c, drawable, region, dest, src) } /// Returns `true` iff the symbol `xcb_dri2_copy_region_unchecked` could be loaded. #[cfg(feature = "has_symbol")] pub fn has_xcb_dri2_copy_region_unchecked(&self) -> bool { ...
Rust
0
buf: &[u8]) -> Result<usize, io::Error> { self.write.write(buf) } #[inline(always)] fn write_all(&mut self, buf: &[u8]) -> Result<(), io::Error> { self.write.write_all(buf) } #[inline(always)] fn write_fmt(&mut self, fmt: fmt::Arguments) -> Result<(), io::Error> { self.write.write_fmt(fmt) } #[inl...
Rust
0
#!/usr/bin/env python3 # -*- encoding: utf-8 -*- # vim: tabstop=2 shiftwidth=2 softtabstop=2 expandtab import os from cdk_stacks import ( VpcStack, OpsAdminIAMUserStack, OpssVpcEndpointStack, OpsServerlessInVPCStack, OpsClientEC2InstanceStack, OpenSearchSecurityGroupStack ) import aws_cdk as cdk AWS_EN...
Python
1
price=limit_price) await self.exchange_manager_instance.trader.create_order(current_order) async def subscribe_personal_channels(self): await exchanges_channel.get_chan(channels_name.OctoBotTradingChannelsName.BALANCE_CHANNEL.value, self.exchange_manager_...
Python
1
.marker(Marker::Braille) .style(Style::default().fg(Color::Cyan)) .graph_type(GraphType::Line) .data(&ema_data), ); } Indicator::SimpleMovingAverage(n) => { let indicator_prices_data =...
Rust
0
e_confirm(sink, &confirm), frame::ParseSuccess::AntiCloggingToken(_act) => { warn!("Anti-clogging tokens not yet supported"); } }, Err(e) => warn!("Failed to parse SAE auth frame: {}", e), } } } /// Creates a new SAE handshake for ...
Rust
0
import subprocess import re import os # Fungsi: Cek apakah user adalah root def check_root(): if os.geteuid() != 0: print("[!] Jalankan dengan sudo!") exit(1) # Fungsi: Deteksi interface wireless def detect_wireless_interface(): result = subprocess.run(["iwconfig"], stdout=subprocess.PIPE, std...
Python
1
urnald")] mod journald; #[cfg(feature = "journald")] pub use crate::journald::JournaldTarget; #[cfg(feature = "network")] mod network; #[cfg(feature = "network")] pub use crate::network::NetworkTarget; #[cfg(feature = "socket")] mod socket; #[cfg(feature = "socket")] pub use crate::socket::SocketTarget; #[cfg(featur...
Rust
0
T> ToDXR for Vec<T> where T: ToDXR, { fn to_dxr(&self) -> Result<Value, DxrError> { ToDXR::to_dxr(&self.as_slice()) } } impl<T, const N: usize> ToDXR for [T; N] where T: ToDXR, { fn to_dxr(&self) -> Result<Value, DxrError> { ToDXR::to_dxr(&self.as_slice()) } } impl<T> ToDXR for...
Rust
0
a>], } impl<'a> HScroller<'a> { pub fn new(screens: &'a [Bagl<'a>]) -> Self { HScroller { screens } } pub fn event_loop(&self) { let mut buttons = ButtonsState::new(); let mut cur_idx = 0; RIGHT_ARROW.display(); self.screens[cur_idx].paint(); loop { ...
Rust
0
"map_Ks" => curr_material.specular_texture = Some(parse_name(l, words)), // specular texture map "map_d" | "map_opacity" => curr_material.opacity_map = Some(parse_name(l, words)), _ => { ...
Rust
0
Display.printMsg("Path exists: skipping "+newimagepath) continue imagearray = self.prepareImageForUpload(tif_file) cmd = ['tif2mrc','-s',tif_file, newimagepath] p = subprocess.Popen(cmd) p.communicate() cmd = 'clip flipx '+newimagepath+" "+newi...
Python
1
heif_chroma_undefined = 99 heif_chroma_monochrome = 0 heif_chroma_420 = 1 heif_chroma_422 = 2 heif_chroma_444 = 3 heif_chroma_interleaved_RGB = 10 heif_chroma_interleaved_RGBA = 11 heif_chroma_interleaved_RRGGBB_BE = 12 heif_chroma_interleaved_RRGGBBAA_BE = 13 heif_colorspace_undefined = 99 heif_colorspace_YCbCr = 0 h...
Python
1
"""Code for testing the constructors of graphs, nodes, edges, policies, and groups""" # Copyright (c) NCC Group and Erik Steringer 2019. This file is part of Principal Mapper. # # Principal Mapper is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public ...
Python
1
instance as _) } #[no_mangle] pub unsafe extern "system" fn Java_com_polygraphene_alvr_ServerConnection_interruptNative( _: JNIEnv, _: JObject, ) { interruptNative() } #[no_mangle] pub unsafe extern "system" fn Java_com_polygraphene_alvr_ServerConnection_isConnectedNative( _: JNIEnv, _: JObject, )...
Rust
0
use common::*; use insta::assert_snapshot; mod common; /// Tests that a session can be established, and terminated by the shell. /// Covers connection, stdin/stdout, and pty shutdown/propagation. #[tokio::test] async fn session() -> anyhow::Result<()> { let mut session = TestSession::new()?; for i in 0..10 ...
Rust
0
, 0, 0], [0, 1, 0], ]); // a primitive structure that is sensitive to any permutations of the axes let fracs = vec![[1., 2., 3.]].envee(); assert_eq!(xy.then(&zx), xyzx); assert_eq!(zx.of(&xy), xyzx); assert_eq!( zx.transform_fracs(&xy.transform_fr...
Rust
0
{ .. } => {} WindowEvent::MouseWheel { .. } => {} WindowEvent::MouseInput { .. } => {} WindowEvent::TouchpadPressure { .. } => {} WindowEvent::AxisMotion { .. } => {} WindowEvent::Touch(_) => {} WindowEvent::ScaleFactorChanged { new...
Rust
0
import hvac import os from dotenv import load_dotenv from hvac.exceptions import InvalidPath load_dotenv() client = hvac.Client( url=os.environ.get("VAULT_URL"), token=os.environ.get('VAULT_TOKEN'), ) try: token = client.secrets.kv.v2.read_secret_version( path="Bot_token", # Имя секрета ...
Python
1
GraphQLInputObjectType, type_map_name: str ) -> ast.Call: return generate_call( func=generate_name("GraphQLInputObjectType"), keywords=[ generate_keyword(value=generate_constant(type_.name), arg="name"), generate_keyword( value=generate_constant(type_.descrip...
Python
1
enues[i+1] - 1) for i in range(len(revenues)-1)] avg_growth = sum(growth_rates) / len(growth_rates) growth_volatility = sum(abs(r - avg_growth) for r in growth_rates) / len(growth_rates) if avg_growth > 0.05 and growth_volatility < 0.1: score += 3 detail...
Python
1
m| len + elem.encoded_len()?) } fn encode_value(&self, encoder: &mut Encoder<'_>) -> Result<()> { for elem in self.iter() { elem.encode(encoder)?; } Ok(()) } } impl<'a, T, const N: usize> Tagged for SequenceOf<T, N> { const TAG: Tag = Tag::Sequence; } /// Iterator...
Rust
0
from enum import Enum import pulumi_aws as aws class Connections(): class Ingress(): SSH = aws.ec2.SecurityGroupIngressArgs( protocol='tcp', from_port=22, to_port=22, cidr_blocks=['0.0.0.0/0'], description='SSH' ) ...
Python
1
ate_kernel_thread( process: Arc<Process>, entry_point: usize, arguments: Option<&[usize]>, priority: usize, ) -> Arc<Thread> { // 创建线程 let thread = Thread::new(process, entry_point, arguments, priority).unwrap(); // 设置线程的返回地址为 kernel_thread_exit thread .as_ref() .inner() ...
Rust
0
_input shape", latent_model_input.shape, "for chunk", chunk_idx, "current denoising step", t_idx) # add the cleaned latent to the list cleaned_latents_list.append(latent_model_input) latents = torch.cat(cleaned_latents_list, dim=1) # [c, total_f, h, w] x0 = laten...
Python
1
from .policy import *
Python
1
> NumericLeafParam { let size = set.len(); let truth = set.iter().fold(0, |sum, &(_, t)| match *t { NumericTruth::InClass => sum + 1, _ => sum, }); let prob = (truth as f64) / (size as f64); return NumericLeafParam { probability: prob }; } /// St...
Rust
0
2, .. }) = (ty1.kind(), ty2.kind()) { self.constrain_two_way(return_type_1, return_type_2); for (param1, param2) in params_1.iter().zip(params_2) { self.constrain_two_way(param1, param2); ...
Rust
0
q, Eq, Hash, Serialize, Deserialize)] pub enum Key { Backspace, Left, Right, Up, Down, Home, End, PageUp, PageDown, BackTab, Delete, Insert, F(u8), Char(char), Alt(char), Ctrl(char), Null, Esc, } // TODO: use same struct from main crate? #[derive(...
Rust
0
.prune_transaction_by_account(&candidate_transactions, &mut db_batch)?; self.transaction_store.prune_transaction_schema( self.least_readable_version(), current_target_version, &mut db_batch, )?; self.transaction_store.prune_transaction_info_schema( ...
Rust
0
apCode440::new(), disk_signature, copy_protected: [0x00, 0x00], partition_1: MBRPartitionEntry::empty(), partition_2: MBRPartitionEntry::empty(), partition_3: MBRPartitionEntry::empty(), partition_4: MBRPartitionEntry::empty(), boot_sig...
Rust
0
2, -1, -4, -1, -1, -4, -3, 2, -2, -3, 3, -3, 0, 0, -1, 0, 1, 6, 0, -1, -1, -2, 2, -4, 0, -1, -8, 1, 0, 0, 0, 0, -3, 1, -1, -1, -2, 0, -3, -2, 1, 0, 1, -1, 0, 2, 1, 0, -1, -2, -3, 0, 0, -8, 1, 0, -2, 0, 0, -3, 0, -1, 0, -1, 0, -2, -1, 0, 0, 0, -1, -1, 1, 3, 0, 0, -5, -3, -1, ...
Rust
0
import subprocess import platform from config.system.log_config import setup_logging logger = setup_logging() def setup_ssh_config(): """SSH 설정을 초기화하고 iDRAC 서버에 대한 설정을 추가합니다.""" try: import os from pathlib import Path # SSH 설정 디렉토리 및 파일 경로 ssh_dir = Path.home() / '.ssh...
Python
1
it. */ pub unsafe fn chan_from_global_ptr<T: Owned>( global: GlobalPtr, task_fn: fn() -> task::TaskBuilder, f: fn~(oldcomm::Port<T>) ) -> oldcomm::Chan<T> { enum Msg { Proceed, Abort } log(debug,~"ENTERING chan_from_global_ptr, before is_prob_zero check"); let is_probably...
Rust
0
request.session.profile_params = {} elif profile is not None: request.session.profile_session = None if collectors is not None: request.session.profile_collectors = collectors if params is not None: request.session.profile_params = params retu...
Python
1
torage}, Index, Moments, Order, Point, Scalar, SupportedIndex, SupportedOrder, }; /// The raw, spatial moments of an image or contour. #[derive(Debug, Clone, PartialEq)] pub struct Spatial<T: Scalar, const ORDER: usize>( pub(crate) <Order<ORDER> as SealedSupportedOrder<T>>::Storage, ) where Order<ORDER>: S...
Rust
0
## embeddings/embedding_generator.py import os import re import pdfplumber from langchain.schema import Document def get_filenames_in_folder(folder_path): """ Get a list of all filenames in the specified folder. Args: folder_path (str): Path to the folder containing files. Returns: ...
Python
1
: ax.bar(v, c, color=colors[v - 1]) x_labels = [f"k={vi}" for vi in v] ax.spines["top"].set_visible(False) ax.spines["right"].set_visible(False) ax.set_xticks(v) ax.set_xticklabels(x_labels) else: ...
Python
1
#[doc = "ENET_RX_CLK"] ENET_RX_CLK, #[doc = "ENET_TX_CLK"] ENET_TX_CLK, #[doc = "GP_CLKIN"] GP_CLKIN, #[doc = "Crystal oscillator"] CRYSTAL_OSCILLATOR, #[doc = "PLL0USB"] PLL0USB, #[doc = "PLL0AUDIO"] PLL0AUDIO, #[doc = "IDIVA"] IDIVA, #[doc = "IDIVB"] IDIVB, ...
Rust
0
inline(always)] pub fn is_tbclgrp_1(&self) -> bool { **self == TBCLGRP_A::TBCLGRP_1 } #[doc = "Checks if the value of the field is `TBCLGRP_2`"] #[inline(always)] pub fn is_tbclgrp_2(&self) -> bool { **self == TBCLGRP_A::TBCLGRP_2 } #[doc = "Checks if the value of the field i...
Rust
0
tputs_dr_successors_gt, upscale_factor=(4, 4)): T, S = outputs_dr_successors_preds.shape cols = [] for t in range(T): col = (outputs_dr_successors_preds[t][np.newaxis, :].transpose((1, 0)) * 255).astype(np.uint8) col = np.tile(col[:, :, np.newaxis], (1, 1, 3)) correct_bin_idx = np.ar...
Python
1
", "44", "45", "46", "47", "48", "49", "50", ]; struct SeqAccess<'a, 'de> { deserializer: &'a mut IndexedDeserializer<'de>, index: usize, } impl<'a, 'de> de::SeqAccess<'de> for SeqAccess<'a, 'de> { type Error = Error<'de>; fn next_element_seed<T>(&mut self, seed: T) -> Result<Option<T::Value>, Er...
Rust
0
::new().get_position((1, 0)); let expected = ChessPiece::WhiteKnight; assert_eq!(actual, expected, "Get low nibble"); } #[test] fn set_position() { #[rustfmt::skip] let expected = Bitboard::from_bytes([ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, ...
Rust
0
on_start_date), TaskAssignments(authenticator=auth, replication_start_date=replication_start_date), Projects(authenticator=auth, replication_start_date=replication_start_date), Roles(authenticator=auth, replication_start_date=replication_start_date), Users(authenticator=a...
Python
1
togramVec = register_histogram_vec!( "tikv_snapshot_cf_size", "Total size of each cf file of snapshot", &["type"], exponential_buckets(1024.0, 2.0, 31).unwrap() ).unwrap(); pub static ref SNAPSHOT_CF_SIZE: SnapCfSize = auto_flush_from!(SNAPSHOT...
Rust
0
ta"); }); } // The thing that changed in the version bump from 2 -> 12 was the // toolchain format. Check that on the upgrade all the toolchains. // are deleted. #[test] fn upgrade_v2_metadata_to_v12() { setup(&|config| { expect_ok(config, &["multirust", "default", "nightly"]); // Replace the m...
Rust
0
); } for x in execs { x.join().unwrap(); } println!( "cost of mesh message shared channel: {:#?}, peers {}, capacity {}", t.elapsed() / runs * peers as u32, peers, capacity, ); } fn main() { test_rust_std(1024); test_rust_std(1); test_sp...
Rust
0
import os class Config: SECRET_KEY = os.getenv('SECRET_KEY', 'defaultsecretkey') MONGODB_URI = os.getenv('MONGODB_URI', 'mongodb://localhost:27017/') DB_NAME = os.getenv('trending_topics', 'twitter_automation') COLLECTION_NAME = 'trends' PROXY_USERNAME = os.getenv('PROXY_USERNAME') PROXY_PASSWO...
Python
1
cremented by 1. Otherwise, the address will be /// incremented by the step size. /// /// [`get_step_selection()`]: #method.get_step_selection pub fn get_src_addr_increment(&self) -> bool { self.btctrl.intersects(RawBlockTransferCtrl::SRCINC) } /// Set whether the source address is inc...
Rust
0
ion, f: &mut JsFormatter) -> FormatResult<()> { write![f, [node.tag().format()]] } } <reponame>henninglive/logitech-lcd<gh_stars>1-10 //! FFI bindings and loader for the Logitech LCD SDK //! //! [LogitechLcd](struct.LogitechLcd.html) will try to locate and load //! `LogitechLcd.dll` at Runtime for dynamic l...
Rust
0
se. // 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, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. /...
Rust
0
Error::from) } else { Ok(()) } } pub fn has_batch(&self, batch_id: &str) -> Result<bool, BatchQueueError> { Ok(self .ids .read() .expect("RwLock was poisoned during a write lock") .contains(batch_id)) } } #[derive(Debug)] ...
Rust
0
# Copyright 2022 Ant Group Co., Ltd. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # https://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
Python
1
from django.urls import path, include from rest_framework.routers import DefaultRouter from . import views router = DefaultRouter() router.register(r'products', views.ProductViewSet) app_name = 'product' urlpatterns = [ path('', include(router.urls)), # path('products/', views.products), path('db/', view...
Python
1
# Copyright (c) Open-MMLab. All rights reserved. import functools import os import torch import torch.distributed as dist import torch.multiprocessing as mp def init_dist(launcher, backend='nccl', **kwargs): if mp.get_start_method(allow_none=True) is None: mp.set_start_method('spawn') if launcher == '...
Python
1
// This is the directed graph we're going to use. //! // The node numbers correspond to the different states, //! // and the edge weights symbolize the cost of moving //! // from one node to another. //! // Note that the edges are one-way. //! // //! // 7 //! // ...
Rust
0
from .rnn_cell_impl import DropoutWrapper from .dropout import dropout
Python
1
nction converts a `CertificationMessage` into an advert for a /// `CertificationArtifact`. fn to_advert(msg: &CertificationMessage) -> Advert<CertificationArtifact> { use CertificationMessage::*; let (attribute, id) = match msg { Certification(cert) => ( Certification...
Rust
0
r(""), // GENERATOR-BEGIN: FormatterConstantsInit // ⚠️This was generated by GENERATOR!🦹‍♂️ b1to16: FormatterString::new_str("1to16"), b1to2: FormatterString::new_str("1to2"), b1to4: FormatterString::new_str("1to4"), b1to8: FormatterString::new_str("1to8"), bcst: FormatterString::new_str("bcst"), ...
Rust
0
tern crate panic_halt; extern crate stm32f042_hal as hal; use hal::gpio::*; use hal::prelude::*; use hal::stm32; use cortex_m::interrupt::Mutex; use cortex_m::peripheral::syst::SystClkSource::Core; use cortex_m::peripheral::Peripherals; use cortex_m_rt::{entry, exception}; use core::cell::RefCell; use core::ops::De...
Rust
0
#[macro_use] extern crate log; #[macro_use] extern crate serde_derive; extern crate crossbeam; extern crate csv; extern crate indexmap; extern crate levenshtein; extern crate rand; extern crate regex; extern crate serde; extern crate serde_json; extern crate serde_yaml; extern crate yaml_rust; use crate::engine::{Fac...
Rust
0
#TIPOS DE DATOS #Tipos de datos básicos float() str() int() #Tipos de datos estructurados list() set() dict() tuple() #Tipos de datos estructurados compuestos enumerate() range() #ejemplo enumerate meses=["enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembr...
Python
1
28, /// Eeffictive storage size pub used: u128, } /// Information round rewards #[derive(Clone, Encode, Decode, Eq, PartialEq, RuntimeDebug, Default, TypeInfo)] pub struct OldRewardInfo<Balance> { /// Reward for node power pub mine_reward: Balance, /// Reward for node store file pub store_reward: Balan...
Rust
0
ize, } #[cfg(feature = "Win32_Foundation")] impl ::core::marker::Copy for CERT_SELECT_STRUCT_A {} #[cfg(feature = "Win32_Foundation")] impl ::core::clone::Clone for CERT_SELECT_STRUCT_A { fn clone(&self) -> Self { *self } } #[doc = "*Required features: 'Win32_Security_Cryptography_UI'*"] pub type CERT_S...
Rust
0
# Copyright (c) 2022 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. import os from typing import Optional from PyQt6.QtCore import QObject from UM.Qt.QtApplication import QtApplication from UM.Signal import Signal from .SubscribedPackagesModel import SubscribedPackagesModel class Discre...
Python
1
from functools import wraps from flask import current_app, g, request from flask_principal import Identity, identity_changed from flask_unchained import unchained from ..utils import current_user from .roles_accepted import roles_accepted from .roles_required import roles_required security = unchained.get_local_pr...
Python
1
pub header: Ospfv2PacketHeader, pub if_mtu: u16, pub options: u8, pub flags: u8, pub dd_sequence_number: u32, pub lsa_headers: Vec<OspfLinkStateAdvertisementHeader>, } /// The Link State Request packet /// /// Link State Request packets are OSPF packet type 3. After exchanging /// Database Desc...
Rust
0
import re suricata_passlist = ( "agenttesla", "medusahttp", "vjworm", ) suricata_blocklist = ( "abuse", "agent", "base64", "backdoor", "common", "confidence", "custom", "dropper", "downloader", "evil", "executable", "f-av", "fake", "family", "fil...
Python
1
} /* * Copyright 2020 Fluence Labs Limited * * 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...
Rust
0
self.write(|w| w) } } #[doc = "Possible values of the field `PARTNUM`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum PARTNUMR { #[doc = "Apollo3 part number is 0x06xxxxxx. value."] APOLLO3, #[doc = "Apollo2 part number is 0x03xxxxxx. value."] APOLLO2, #[doc = "Apollo part number is 0x01xxx...
Rust
0
AuthenticationCallback", java.flags == PUBLIC, .name == "onAuthenticationHelp", .descriptor == "(ILjava/lang/CharSequence;)V" unsafe { let __jni_args = [__jni_bindgen::AsJValue::as_jvalue(&arg0), __jni_bindgen::AsJValue::as_jvalue(&arg1.into())]; let __jni_env = __jni_bindgen...
Rust
0
.get_hostfirmware, device.get_version, device.get_label, device.get_group, ], DEFAULT_ATTEMPTS, OVERALL_TIMEOUT, ) except asyncio.TimeoutError: return None finally: ...
Python
1
input, protocol_family)) } pub fn skip_body(total_bytes: u16) -> impl Fn(&[u8]) -> IResult<&[u8], &[u8]> { let bytes_to_skip = total_bytes as usize - PDU_HEADER_LEN_BYTES; move |input| { take(bytes_to_skip)(input) } } #[cfg(test)] mod tests { use crate::common::entity_state::model::{Country, E...
Rust
0
s255w223 {} /// /// # fn main() -> Result<(), my_rs255w223::Error> { /// // encode /// let mut buf = b"Hello World!".to_vec(); /// buf.resize(buf.len()+32, 0u8); /// my_rs255w223::encode(&mut buf); /// /// // corrupt /// buf[0..16].fill(b'x'); /// /// // correct /// my_rs255w223::correct_errors(&mut buf)?; /// assert...
Rust
0
x), max(max_x, *x + 1), min(min_y, *y), max(max_y, *y + 1))); // closure to check whether tile at coordinate is black // check whether it is in range first let is_black = |(x, y)| x >= min_x && x < max_x && y >= min_y && y < max_x && blacks.contains(&(x, y)); // valid coordi...
Rust
0
from service.database.models import creat_table,drop_table,AdminUser from service.config.config import init_db from service.api.db import db # print(os.getenv('MYSQL_HOST')) # print(os.getenv('MYSQL_PORT')) # print(os.getenv('MYSQL_PASSWORD')) # 初始化数据 import re import random import string def new_table(): # 清空表 ...
Python
1
from ..utils import common_annotator_call, INPUT, define_preprocessor_inputs import comfy.model_management as model_management class DensePose_Preprocessor: @classmethod def INPUT_TYPES(s): return define_preprocessor_inputs( model=INPUT.COMBO(["densepose_r50_fpn_dl.torchscript", "densepose_...
Python
1
import random def main(): level = get_level() score = simulate_game(level) print("Score: ", score) def get_level(): while True: try: level = int(input("Level: ")) if level in [1,2,3]: break except: pass return level def gener...
Python
1
kage = load_shader_packages( &processed_shaders_base_path, "shader.vert.metal", "shader.vert.spv", "shader.vert.gles2", "shader.vert.gles3", )?; let frag_shader_package = load_shader_packages( &processed_shaders_base_path, "shader.frag.metal", "sh...
Rust
0
use zstd_sys::ZSTD_dParameter::*; use DParameter::*; let (param, value) = match param { #[cfg(feature = "experimental")] Format(FrameFormat::One) => { (ZSTD_d_format, ZSTD_format_e::ZSTD_f_zstd1 as c_int) } #[cfg(feature = "experimental")] Format(FrameFor...
Rust
0
class Solution: def nextClosestTime(self, time: str) -> str: ans = list(time) digits = sorted(ans) def nextClosest(digit: chr, limit: chr) -> chr: next = bisect_right(digits, digit) return digits[0] if next == 4 or digits[next] > limit else digits[next] ans[4] = nextClosest(ans[4], '9') ...
Python
1
r showing the usage of `flags` //! rw FLAGS: 13..16 = flags CpuFlags [ //! A = 0b0001, //! B = 0b0010, //! C = 0b0100, //! D = 0b1000, //! ], //! } //! } //! //! // the generated api then can be used like this. //! // to explore the full api generated by this macro, check the `example_...
Rust
0
print 'make a couple more changes:' del jd['x'] jd['y'] = 15 print jd.base print jd.changes print 'and wipe the journal:' jd.wipe() print jd.base print jd.changes print print print 'Mixin Example:' print '--------------' jp = JournalledPosition(1,2) print 'a fresh...
Python
1
tus == offerers_models.NoticeStatus.CLOSED assert notice.motivation == motivation assert len(mails_testing.outbox) == 1 assert mails_testing.outbox[0]["template"] == dataclasses.asdict(expected_template.value) assert mails_testing.outbox[0]["To"] == notice.emitterEmail assert ma...
Python
1