text
string
label_name
string
labels
int64
.png") mid_overlay.save("mid_overlay.png") high_overlay.save("high_overlay.png") plt.figure() # 设置画布大小 # 显示原图 plt.subplot(1, 4, 1) plt.imshow(original_image) plt.title("Original Image") plt.axis("off") # 显示低频叠加 plt.subplot(1, 4, 2) plt.imshow(low_overlay) plt.title("L...
Python
1
import pandas as pd from sklearn.metrics.pairwise import cosine_similarity import logging def compute_cosine_similarity(normalized_vectors): # Check if the input is of the correct type if not isinstance(normalized_vectors, (list, pd.DataFrame)): raise TypeError("Input for cosine similarity must be a li...
Python
1
"""監控系統路由模組 此模組聚合所有監控相關的 API 路由,提供統一的入口點。 """ import logging from fastapi import APIRouter from .system import router as system_router from .alerts import router as alerts_router from .logs import router as logs_router from .reports import router as reports_router logger = logging.getLogger(__name__) # 創建主路由器 rout...
Python
1
for RArc<T> { fn clone(&self) -> Self { unsafe { (self.vtable().clone_())(self) } } } impl_into_rust_repr! { impl[T] Into<Arc<T>> for RArc<T> where[ T: Clone+StableAbi, ]{ fn(this){ RArc::into_arc(this) } } } impl<T> Drop for RArc<T> { fn drop(&...
Rust
0
GIONFD_RESP_OFFSET; let valid_bits = !(!0 << IOREGIONFD_RESP_LEN); i &= valid_bits; i == 0 } } // pub const IOREGIONFD_CMD_READ: usize = 0; // pub const IOREGIONFD_CMD_WRITE: usize = 1; #[derive(Debug, FromPrimitive)] pub enum Cmd { Read, Write, } //pub const IOREGIONFD_SIZE_8BIT: ...
Rust
0
''' self.i_range = numpy.arange(*i_mean) self.std_range = numpy.arange(*i_std) self.rate = numpy.zeros((self.i_range.size, self.std_range.size)) nest.set_verbosity('M_WARNING') for n, i in enumerate(self.i_range): print('I = {0}'.format(i)) for ...
Python
1
BindingDesc], dynamic_symbols_mapping: dict[IndexSymbol, Value], ): super().__init__(sig, entry_block) self.dynamic_symbols_mapping = dynamic_symbols_mapping self._abi_value_by_reference: dict[tuple[str, Any], Value] = { b.reference: value for value, b in zip(...
Python
1
import numpy as np import matplotlib.pyplot as plt import random import math from scipy.optimize import curve_fit kBT = 1 J_values = np.linspace(0, 0.9, 12) plot_interval = 1000 L_values = [10, 15, 20, 25, 50] steps_per_L = { 10: 100000, 15: 400000, 20: 900000, 25: 8000000,} def get_neighbors(s, i, j...
Python
1
"match_type": "keyword" }) logger.info(f"关键词搜索找到 {len(keyword_results)} 个结果") except Exception as e: logger.warning(f"关键词搜索失败: {e}") # 2. 进行向量搜索 ...
Python
1
Profile::Native => ExecutionStrategies { syncing: ExecutionStrategy::NativeElseWasm, importing: ExecutionStrategy::NativeElseWasm, block_construction: ExecutionStrategy::NativeElseWasm, offchain_worker: ExecutionStrategy::NativeElseWasm, ...
Rust
0
ta=paramsPost, files=paramsMultipart, headers=headers, cookies=cookies) informa("Uploading " + Color.END + webshell + Color.END) def subida_htaccess(url,la_cookie,token_logado): session = requests.Session() paramsPost = {"uuid":"../../tmp","tokenCSRF":token_logado} paramsMultipart = [('images[]', ('.ht...
Python
1
# This file is part of j-Wave. # # j-Wave is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation, either # version 3 of the License, or (at your option) any later version. # # j-Wave is distributed in the hope ...
Python
1
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
Python
1
encoding requirement and a buffer /// /// The buffer contains the actual mail and is normally a string. pub fn new(encoding_requirement: EncodingRequirement, buffer: impl Into<Bytes>) -> Self { Mail { encoding_requirement, mail: buffer.into(), } } /// true i...
Rust
0
commands, new_state, shared_state, } => TransitionResult::Ok { commands, new_state: new_state.into(), shared_state, }, TransitionResult::OkNoShare { commands, ...
Rust
0
def _getIndices(n_aligned, total_n): if n_aligned == -1: idxs = np.arange(0, total_n) else: assert n_aligned <= total_n and n_aligned >= 1 idxs = np.arange(0, n_aligned) return idxs
Python
1
, 0x6c, 0x76, 0x66, 0x66, 0xe6, 0x00, // 104 68 h 0x30, 0x00, 0x70, 0x30, 0x30, 0x30, 0x78, 0x00, // 105 69 i 0x0c, 0x00, 0x0c, 0x0c, 0x0c, 0xcc, 0xcc, 0x78, // 106 6A j 0xe0, 0x60, 0x66, 0x6c, 0x78, 0x6c, 0xe6, 0x00, // 107 6B k 0x70, 0x30, 0x30, 0x30, 0x30, 0x30, 0x78, 0x00, // 108 6C l ...
Rust
0
"number of inputs should be less than t" ); assert!(n_inputs > 0, "number of inputs should be positive nonzero"); let cs = inputs[0].get_cs(); let mut state = vec![CNum::from_const(cs, &Num::ZERO); params.t]; (&mut state[0..n_inputs]).clone_from_slice(inputs); perm(&mut state, params); sta...
Rust
0
ess = "success", Fail = "fail", Unknown = "unknown", } <filename>src/ir/mod.rs use std::{collections::HashMap, rc::Rc}; use std::convert::TryInto; use crate::{CompileSettings, common::{BinOp, UnaryOp}}; use crate::parser::{Expr, ParseItem, Statement}; use self::layout::{Grid, WireLink}; mod select_colors; mo...
Rust
0
ING); self.add_child(&entry.entry); entry } fn update_entry(logger:&Logger, entry:&DisplayedEntry<E>, id:entry::Id, model:&Option<E::Model>) { debug!(logger, "Setting new model {model:?} for entry {id}; \ old entry: {entry.id.get():?}."); entry.id.set(Some(id)); ...
Rust
0
""" siruri de caractere, imutabile, indexabile """ # var = str() """concatenare""" # var_1 = 'pro' # var_2 = 'gram' # var_3 = 'are' # print(var_1 + var_2 + var_3) """multiplicare""" # multip = 4 # print(multip * var_1) # print(-4 * var_1) # print(id(-4 * var_1)) # print(id("")) """ transformarea in string cu str...
Python
1
_command_receiver(&mut self) -> &mut Receiver<String> { &mut self.command_bridge.1 } } //! Describes the different kinds of operands an instruction can have. use std::borrow::Cow; use std::fmt; use std::sync::Arc; use self::Operand::*; use crate::ir::{self, DimMap, InstId, Instruction, Parameter, Type}; us...
Rust
0
"hiszen", "hogy", "hogyan", "i", "í", "igen", "így", "illetve", "ill.", "ill", "ilyen", "ilyenkor", "is", "ison", "ismét", "itt", "j", "jó", "jól", "jobban", "k", "kell", "kellett", "keresztül", "keressünk", "ki", "k...
Rust
0
class limit_trace_arguments: """ A decorator which causes the function execution logging to omit some fields """ def __init__(self, only=None, skip=None): """ only - if not None, contains a whitelist (tuple of names) of arguments that are safe to be logged. All ot...
Python
1
String>, Option<String>, Option<String>), Slack(ZuseChannelSlack), Debug, } type ZuseChannel = (usize, ZuseChannelType); type ZuseChannelMap = HashMap<String, ZuseChannel>; type ZuseNotifyGroup = Vec<String>; type ZuseNotifyGroupMap = HashMap<String, ZuseNotifyGroup>; const DEFAULT_SENDER_ID: &'static str = ...
Rust
0
* normal_counter, 4 + 24 * normal_counter, 5 + 24 * normal_counter, 6 + 24 * normal_counter, 6 + 24 * normal_counter, 5 + 24 * normal_counter, 7 + 24 * normal_counter, 8 + 24 * normal_counter, 9 + 24 * normal_counter, 10 + 24 * normal_counter, ...
Python
1
.index.code, self.index.scope, self.index.table); let pk_end = unsafe { ::eosio_sys::db_end_i64( self.index.code.into(), self.index.scope.into(), self.index.table.0.into(), ) }; SecondaryTableIterator { value: se...
Rust
0
# This file is a part of the RobustNeuralNetworks package. License is MIT: https://github.com/acfr/RobustNeuralNetworks/blob/main/LICENSE from robustnn.plnet_torch.bilipnet import BiLipNet from robustnn.plnet_torch.plnet import PLNet import torch import numpy as np # Set seeds for all RNGs seed = 42 torch.manual_see...
Python
1
self.starting_states, } } } <gh_stars>0 //! Kontakt, der über einen Anschluss ausgelesen werden kann. use serde::{Deserialize, Serialize}; use crate::anschluss::{ Anschlüsse, Error, InputAnschluss, InputSave, Level, Reserviere, ToSave, Trigger, }; /// Name eines Kontaktes. #[derive(Debug, Clone, Par...
Rust
0
#!/usr/bin/python # -*- coding: utf-8 -*- __doc__ = "For selected ADP componenets that have been placed. Run 'Repeat' Command for all of them. This saves you huge time on waiting for recalculating patterned placement." __title__ = "36_repeat ADP" # from pyrevit import forms # from pyrevit import script, revit # # fro...
Python
1
static IPPORT_FTP: ::libc::c_uint = 21; pub static IPPORT_TELNET: ::libc::c_uint = 23; pub static IPPORT_SMTP: ::libc::c_uint = 25; pub static IPPORT_TIMESERVER: ::libc::c_uint = 37; pub static IPPORT_NAMESERVER: ::libc::c_uint = 42; pub static IPPORT_WHOIS: ::libc::c_uint = 43; pub static IPPORT_MTP: ::libc::c_uint =...
Rust
0
D={'Hello':['We','are','smart',('Not',True)],'Bye':['no',[420,840],{'HaHa':'Block'}]} print(D) print(len(D)) print(D['Hello'][0][0]) print(D['Hello'][0][1]) print(D['Hello'][1][0]) print(D['Hello'][1][1]) print(D['Hello'][1][2]) print(D['Hello'][2][0]) print(D['Hello'][2][1]) print(D['Hello'][2][2]) print(D['Hello'][2]...
Python
1
8], ) -> Result<Vec<u8>, ErrorStack> { let key = derive_key(private_key, public_key).unwrap(); decrypt(&key, data) } <filename>tests/test_lib.rs<gh_stars>1-10 extern crate libcub; extern crate rusqlite; use libcub::{list_notes, Limit, SortOrder}; use rusqlite::{params, Connection}; /// Bootstraps a test db w...
Rust
0
Component liveptr is none, did you include the registry in the main DSL flow?\");};"); tb.add(" makepad_render::live_traits::from_ptr_impl(cx, reg_item.live_ptr.unwrap(),|cx, file_id, index, nodes| ret.apply(cx, ApplyFrom::NewFromDoc {file_id}, index, nodes));"); tb.add(" ...
Rust
0
(message, optional, tag = "12")] pub amp_record: ::core::option::Option<AmpRecord>, /// ///An optional set of key-value TLV records. This is useful within the context ///of the SendToRoute call as it allows callers to specify arbitrary K-V pairs ///to drop off at each hop within the onion. #[pro...
Rust
0
= CRLF 1*( SP / HTAB ) // > ; obsolete line folding // > ; see Section 3.2.4 // > // > The field-name token labels the corresponding field-value as having // > the semantics defined by that header field. For example, the Date // > header field is defined in Section 7.1.1.2 of [RFC...
Rust
0
GE_SIZE_LIMIT.bytes()).stream_to_vec().await.unwrap(); let client = reqwest::Client::new(); let res = client.post(&endpoint) .header("Content-Type", "application/octet-stream") .header("Ocp-Apim-Subscription-Key", key) .query(&params) .body(image_stream) ...
Rust
0
use anyhow::Result; use bls_signatures::{PrivateKey, PublicKey, Serialize as BlsSerialize}; use libp2p::{ identity::{self, ed25519::Keypair}, Multiaddr, PeerId, }; use serde::de::Deserializer; use serde::ser::Serializer; use serde::{Deserialize, Serialize}; /// The default threshold is calculated as floor(n * ...
Rust
0
import os from PIL import Image import numpy as np import cv2 from gmlDogRecordFilePath import file_path, file_pre_path # 从file_path 中读取全部.png 深度图 # 并去除所有大于3000的深度值,然后把单位从毫米转换为米 # 转化成格式为float32 的numpy 二维数组 # 并保存到store_path 中 def calculate_perspective_transform_matrix(K_depth, K_rgb): # Compute the perspective tra...
Python
1
orage, &reward_in_stable_denom)?; save_current_rebase_index(deps.storage, &new_rebase_index)?; Ok(()) } pub fn update_config( deps: DepsMut, info: MessageInfo, owner: Option<Addr>, liquidation_contract: Option<Addr>, ) -> Result<Response<TerraMsgWrapper>, ContractError> { let mut config: Co...
Rust
0
.data.sum() desired_cutout = smoothed_cutout.data.sum() assert_allclose(actual_cutout, desired_cutout, rtol=0.01) with pytest.raises(ValueError): m_nest.smooth(0.2 * u.deg, "box") @pytest.mark.parametrize("nest", [True, False]) def test_convolve_wcs(nest): energy = MapAxis.from_bounds(1, 100,...
Python
1
# Copyright 2024 The JAX Authors. # # 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 wri...
Python
1
# Write a Python program to remove all occurrences of a given element from a list def remove_element(lst, element): while element in lst: lst.remove(element) my_list = [1, 2, 3, 4, 2, 5, 2] print(my_list) remove = int(input("enter the element to remove : ")) remove_element(my_list, remove) print("List af...
Python
1
("Shouldn't expect None delimiters"), }, hints ), )) } /// Tries to parse a valid group with the given delimiter from the given token /// stream iterator, returning the group if successful. /// /// If the next token is not a valid group, issues an error, that indicates to /// the given span and adding the giv...
Rust
0
import asyncio from config import MK1, MK2, MK3, MK4, MK5, MK6, MK7, MK8, MK9, MK10, OWNER_ID, HEROKU_API_KEY, HEROKU_APP_NAME, CMD_HNDLR as hl from telethon import events from datetime import datetime import heroku3 Heroku = heroku3.from_key(HEROKU_API_KEY) @MK1.on(events.NewMessage(incoming=True, pattern=r"\%slog...
Python
1
import torch from ai.diffusion_process import DiffusionModel from ai.trainer import Trainer from ai.utils import parser from argparse import ArgumentParser, Namespace import os import json from ai.mapping import MODEL_NAME_MAPPING def parse_arguments(parser: ArgumentParser) -> ArgumentParser: parser.add_argument(...
Python
1
group; pub mod key; pub mod keypackage; pub mod message; pub mod secrets; pub mod tree; pub mod tree_math; pub mod utils; pub use ciphersuite::DefaultCipherSuite; pub use keypackage::{KeyPackage, KeyPackageSecret}; pub use rustls::internal::msgs::codec::{self, Codec, Reader}; use rspotify::client::SpotifyBuilder; use ...
Rust
0
0.8rem 1.5rem; # font-size: 1rem; # } # .conversation-header { # background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); # color: white; # padding: 1rem; # border-radius: 15px; # margin-bottom: 1rem; # text-align: center; # } # </style> # """, u...
Python
1
from stockfish import Stockfish import numpy as np def get_best_move_with_stockfish_fen(fen: str, engine_path: str, time_limit: float = 30.0) -> str: """ Uses Stockfish to return the best move given a FEN string using the stockfish library. Parameters: - fen (str): The FEN string representing th...
Python
1
[n, 11, c] elif self.only_coarse_graph: outs_ps = self.get_gcn_feat(outs_n, outs_ps_coarse, self.coarse_adj_npy, is_cuda, seqL) # [n, 5, c] elif self.combine_fine_coarse_graph: outs_fine = self.get_gcn_feat(outs_n, outs_ps_fine, self.fine_adj_npy, is_cuda, seqL) # [n, 11, c] ...
Python
1
*[{'type': 'number', 'name': i} for i in extract_names_number], *[{'type': 'notify', 'name': i} for i in extract_names_notify], ] ), notify_channels=json.dumps(notify_channels), is_pause=not status, ) elif type_run == 'ssh' and ta...
Python
1
from django.db import models class GroupChoices(models.TextChoices): ACTIVE = "ACTIVE", "Active" # active group BAN = "BAN", "Ban" # group is pending for approval PENDING = "PENDING", "Pending" # group is pending for approval REJECTED = "REJECTED", "Rejected" # group is rejected by this app owner ...
Python
1
opy => Some(WinitCursorIcon::Copy), ViziaCursorIcon::NoDrop => Some(WinitCursorIcon::NoDrop), ViziaCursorIcon::Grab => Some(WinitCursorIcon::Grab), ViziaCursorIcon::Grabbing => Some(WinitCursorIcon::Grabbing), ViziaCursorIcon::AllScroll => Some(WinitCursorIcon::AllScroll), ViziaC...
Rust
0
f, model: Model, rng: PRNGKeyArray) -> Carry: return Carry( actor_carry=jnp.zeros(shape=(2, self.config.depth, self.config.hidden_size)), critic_carry=jnp.zeros(shape=(2, self.config.depth, self.config.hidden_size)), lpf_params=ksim.LowPassFilterParams.initialize(len(ZEROS)),...
Python
1
testream, x, symbol_table), Data::Blob(x) => append_blob(bytestream, x), Data::Clob(x) => append_clob(bytestream, x), Data::Struct(x) => append_struct(bytestream, x, symbol_table), Data::List(x) => append_list(bytestream, x, symbol_table), Data::Sexp(x) => append_sexp(bytestream,...
Rust
0
("default".to_string()); let transaction_name = format!("{} {}", request.method(), route); let transaction_name = transaction_name.as_str(); root_span!(request, message = transaction_name) } fn on_request_end<B>(span: Span, outcome: &Result<ServiceResponse<B>, Error>) { DefaultR...
Rust
0
nst FINAL_ROUND_CONSTANTS: [u64; WIDTH * HALF_N_FULL_ROUNDS] = make_final_round_constants(); */ // ===================================== COMPILE-TIME CHECKS ====================================== /// The MDS matrix multiplication ASM is specific to the MDS matrix below. We want this file to /// fail to compile if it ...
Rust
0
ce(value, x509.CRLNumber): this_crl_values["crl_crlnumber"] = (ext.value.crl_number,) elif isinstance(value, x509.IssuingDistributionPoint): this_crl_values["crl_idp"] = ( optional(value.full_name, lambda v: "* ".join([format_general_name(n) for n in v]), ...
Python
1
rgb::<100, 252, 218>(), format_duration(time1).fg_rgb::<100, 252, 218>() ); println!( "part 2: {} in {}\n", part2.fg_rgb::<100, 252, 218>(), format_duration(time2).fg_rgb::<100, 252, 218>() ); } } pub fn get_solution(main_file: &str, day: u8) ...
Rust
0
#[inline] pub fn is_rts1(&self) -> bool { *self == P0_22R::RTS1 } #[doc = "Checks if the value of the field is `TD1`"] #[inline] pub fn is_td1(&self) -> bool { *self == P0_22R::TD1 } } #[doc = "Possible values of the field `P0_23`"] #[derive(Clone, Copy, Debug, PartialEq)] p...
Rust
0
r(e) = run(args) { eprintln!("{}", e); std::process::exit(1); } } fn run(args: Arguments) -> Result<()> { let address = match parse_address(args.address) { Ok(address) => address, Err(_) => return Err(GenDhtError::FailedToGetAddress.into()), }; let key = match parse_key...
Rust
0
nfts_indexs.len() { let nft_id = Self::nft_by_class_index( class_id.clone(), owned_nfts[i].nfts_indexs[j].clone(), ) .ok_or(Error::<T>::NFTNotExist)?; Self::_burn_nft(who.clone(), nft_id)?; ...
Rust
0
from PIL import Image def min_res(size, min_size): return 192 if size < 192 else size def up_down_bucket(m_size, in_size, direction): if direction == 'down': return abs(int(m_size - in_size)) if direction == 'up': return abs(int(m_size + in_size)) def get_bucket_sizes(size, direction: 'down', min_size): ...
Python
1
ction_sample(k, points.len(), &mut rng)?; approximate_neighbors.push(points.iter() .map(|&j| NeighborData{distance: f64::INFINITY, idx:j, state: NeighborState::New}) .collect()); } let mut done = false; let mut iters = 0; while !done { iters += 1; ...
Rust
0
import bpy import numpy as np from pyblend.lighting import config_world from pyblend.object import load_obj, create_plane from pyblend.material import random_mat, set_voronoi_texture from pyblend.utils import BlenderRemover, ArgumentParserForBlender, debug from pyblend.render import config_render, render_image, enable_...
Python
1
.index(2)); let matches = app.get_matches(); let scene_path = matches.value_of("scene").unwrap(); let scene_file = File::open(scene_path).expect("File not found"); let image_path = matches.value_of("image").unwrap(); let scene: Scene = serde_json::from_reader(scene_file).unwrap(); ...
Rust
0
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
Python
1
DRIVE_ERRNO_ETIME :i32 = 62; /* Stream ioctl timeout */ pub const NX_FATDRIVE_ERRNO_ENOSR :i32 = 63; /* No stream resources */ pub const NX_FATDRIVE_ERRNO_ENONET :i32 = 64; /* Machine is not on the network */ pub const NX_FATDRIVE_ERRNO_ENOPKG :i32 = 65; /* Package not installed */ pub const NX_...
Rust
0
"status" : 'in_progress', "role" : message['role'], "content" : message['content'], "tokens" : 0 }, 0 yield { "status" : 'completed', "r...
Python
1
Options}; use std::sync::Arc; /// Options passed clients to customer policies, telemetry, etc. #[derive(Clone, Debug, Default)] pub struct ClientOptions { // TODO: Expose retry options and transport overrides. pub per_call_policies: Vec<Arc<dyn Policy>>, pub per_retry_policies: Vec<Arc<dyn Policy>>, pu...
Rust
0
# JavaScript Libraries # SB_ADMIN_2_CSS_LIBRARY_URLS = [ "bower_components/bootstrap/dist/css/bootstrap.min.css", "bower_components/metisMenu/dist/metisMenu.min.css", "css/timeline.css", "css/sb-admin-2.css", "bower_components/morrisjs/morris.css", "bower_components/font-awesome/css/font-awesome...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from typing_extensions import Literal from ...._models import BaseModel __all__ = ["RefusalContentBlock"] class RefusalContentBlock(BaseModel): refusal: str type: Literal["refusal"] """Always `refusal`."""
Python
1
mt(&self, f: &mut fmt::Formatter) -> fmt::Result { write!( f, "{}", match self { Color::Black => "black", Color::Blue => "blue", Color::Green => "green", Color::Cyan => "cyan", Color::Red => "red"...
Rust
0
batch_velocity = varflow_factory.batch_calc_flow(I1=batch_I1, I2=batch_I2) velocity = batch_velocity[0] import matplotlib.pyplot as plt Q = plt.quiver(velocity[0, ::5, ::5], velocity[1, ::5, ::5]) qk = plt.quiverkey(Q, 0.5, 0.98, 2, r'$2 \frac{m}{s}$', labelpos='W', fontpropertie...
Python
1
: Res<SegmentMesh2dPipeline>, mut pipelines: ResMut<SpecializedPipelines<SegmentMesh2dPipeline>>, mut pipeline_cache: ResMut<RenderPipelineCache>, msaa: Res<Msaa>, render_meshes: Res<RenderAssets<Mesh>>, shader_handle: Res<SegmentShaderHandle>, colored_mesh2d: Query<(&Mesh2dHandle, &Mesh2dUnifor...
Rust
0
#kata #https://www.codewars.com/kata/58d3487a643a3f6aa20000ff/train/python def min_min_max(arr): for i in range(min(arr)+1,max(arr)): if i not in arr: minimumAbsent=i break return [min(arr),minimumAbsent,max(arr)] """def minMinMax(arr): s, mi, ma = set(arr), min(arr), max(ar...
Python
1
uffer = *mut VkCommandBuffer_T; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VkFence_T { _unused: [u8; 0], } pub type VkFence = *mut VkFence_T; #[repr(C)] #[derive(Debug, Copy, Clone)] pub struct VkDeviceMemory_T { _unused: [u8; 0], } pub type VkDeviceMemory = *mut VkDeviceMemory_T; #[repr(C)] #[derive(D...
Rust
0
_with("0.") { value = format!(".{}", value.trim_start_matches("0.")) } value .replace(" 0px", " 0") .replace(" 0rem", " 0") .replace(" 0.", " .") .replace(", ", ",") .replace(" !important", "!importan...
Rust
0
# -*- coding: utf-8 -*- from odoo.tests import common class TestSparseFields(common.TransactionCase): def test_sparse(self): """ test sparse fields. """ record = self.env['sparse_fields.test'].create({}) self.assertFalse(record.data) partner = self.env.ref('base.main_partner') ...
Python
1
es: 'Win32_Networking_WinInet', 'Win32_Foundation'*"] #[cfg(feature = "Win32_Foundation")] pub struct INTERNET_PER_CONN_OPTIONA { pub dwOption: INTERNET_PER_CONN, pub Value: INTERNET_PER_CONN_OPTIONA_0, } #[cfg(feature = "Win32_Foundation")] impl ::core::marker::Copy for INTERNET_PER_CONN_OPTIONA {} #[cfg(featu...
Rust
0
e not in filter: continue testnames.append(filename) # If we have no files to test, then skip this test if not testnames: InfoOut.Log('No files to test for version.') return 0 ast = ParseFiles(testnames) errs = FindVersionError(ast.releases, ast) if errs: ErrOut.Log("Failed version test.") ...
Python
1
f64const (I32) // stop unless inst_predicate_13 0x100d, // --> [Mp2f64imm_z#557] and stop 0x0123, 0x0557, // end of f64const (I32) // 0007cb: ceil.f64 (I32) // stop unless PredicateView(16) // 0007cb: floor.f64 (I32) // stop unless PredicateView(16) // 0007cb: nearest.f64 (I32) ...
Rust
0
f _lower_confidence_bound(self, NA: int, N: int, alpha: float) -> float: """Returns a (1 - alpha) lower confidence bound on a bernoulli proportion. This function uses the Clopper-Pearson method. :param NA: the number of "successes" :param N: the number of total draws :param alp...
Python
1
); let network_tx = network_tx.clone(); let handshake = NoiseHandshake::responder(&handshake_params); let connection_handler = handshake .listen(sock) .and_then(move |sock| { let (_, stream) = sock.split(); stre...
Rust
0
et("critical_incidents", 0) // 5) # Estimated return f"""<div class='bg-white rounded-3xl shadow-2xl p-8 fade-in-up' style='animation-delay: 0.1s'> <h2 class='text-3xl font-bold text-gray-900 mb-6'>Исполнительное резюме</h2> <div class='grid grid-cols-1 md:grid-cols-2 lg:grid-c...
Python
1
nt("debug"))?; let config_file = get_config_file(args.value_of("config"))?; let config = config::Config::load(&config_file)?; if args.is_present("setup") { setup::setup_mode(args, config, &config_file).await? } else if args.is_present("download") { } else if args.is_present("offer") { let args: ...
Rust
0
from config.messages import Messages as GlobalMessages class MessagesCZ(GlobalMessages): calculate_contribution_brief = "Spočítá počet hlasů a jejich celkovou váhu pro daný příspěvek" top_contributions_brief = "Zobrazí prvních N počet nejvíce oblíbených příspěvků" submit_brief = "Vloží příspěvek do soutěž...
Python
1
acets']['reformat']['time'], params = config['tools']['facets']['reformat']['params'] threads: config['tools']['facets']['reformat']['threads'] benchmark: FACETSOUT + '{tumor}_vs_{normal}.reformat.txt.benchmark' shell: ('{config[tools][facets][reformat][call]} ' + '{...
Python
1
_name}-{i['name']}-{i['url']}-请求超时,超时时间设置为{timeout}秒") except requests.exceptions.RequestException as ex: logger.error( f"{source_name}-出错-{i['name']}-{i['url']}{ex}") except Exception as ex: logger.error( f"{source_name}-出错-{i['name']}-{i['url']}{...
Python
1
64', 'Integer::divide_assign', 'no', [], ['ref', {'convert': // 'Integer'}]] impl DivAssign<u64> for Integer { fn div_assign(&mut self, rhs: u64) { Integer::divide_assign(self, &Integer::from(rhs)) } } // ['Integer', '&u64', 'Integer::divide_assign', 'no', [], ['ref', {'convert': // 'Integer'}, 'deref'...
Rust
0
str, priority: i8, title: Option<&str>, device: Option<&str>, sound: Option<&str>) -> Result<(), Vec<String>> { send_with_url(token, user, message, priority, title, device, sound, None, None) } pub fn send_gist(token: &str, user: &str, message: &str, priority: i8, title: Op...
Rust
0
from typing import Optional from llama_index.core.base.llms.types import ChatMessage, MessageRole from restai.brain import Brain from restai.database import DBWrapper from restai.llm import LLM from restai.project import Project class Guard: def __init__(self, projectName: str, brain: Brain, db: DBWrapper): ...
Python
1
r_width=True) with col2: fig_assists = px.bar( seasons_df, x='Season', y='Assists', title=f"{season_player} - Assists per Season" ) st.plotly_chart(fig_assists, use_container_width=True) ...
Python
1
} fn test_get_put<E: Engine>(engine: &E) { assert_none(engine, b"x"); must_put(engine, b"x", b"1"); assert_has(engine, b"x", b"1"); must_put(engine, b"x", b"2"); assert_has(engine, b"x", b"2"); } fn test_batch<E: Engine>(engine: &E) { engine .wri...
Rust
0
} else { let mut action = String::from("export const "); action.push_str(&func_name); action.push_str(" = () => {\n return {\n ident: '"); action.push_str(enum_name); action.push_str("',\n action: {\n"); action.push_str(" type: '"); action....
Rust
0
start.clone()); }); } /// Remove the action indicator arrows when they are no longer needed: /// the player is choosing a different action, or the turn is animating pub fn remove_action_arrows( mut commands: Commands, player_q: Query<(&TilePos, &EntityPendingAction), With<PlayerStatus>>, arrow_q: Query<(Enti...
Rust
0
tContractIsNotURef)); match mint_uref.access_rights() { Some(access_rights) if access_rights != expected_access_rights => { runtime::revert(Error::InvalidMintAccessRights) } Some(_) => {} None => runtime::revert(Error::MintHasNoAccessRights), } let pos_uref = pos...
Rust
0
} } None }); assert_eq!(value2, Some(tc.expected_value)); let value3 = used_mem.virtual_address(tc.element_index, |_register, _element_index, _element_size| None); assert_eq!(value3, None); let value4 = used_mem.try_virtual_address(tc.element_index, |_register, _element_index, _element_size| None...
Rust
0
render_pkg = render( viewpoint, self.gaussians, self.pipeline_params, self.background, visible_mask=opt_mask ) ( ...
Python
1
int) PK_DISTRO_UPGRADE_ENUM_LAST", "3"), ("(gint) PK_DISTRO_UPGRADE_ENUM_STABLE", "1"), ("(gint) PK_DISTRO_UPGRADE_ENUM_UNKNOWN", "0"), ("(gint) PK_DISTRO_UPGRADE_ENUM_UNSTABLE", "2"), ("(gint) PK_ERROR_ENUM_ALL_PACKAGES_ALREADY_INSTALLED", "41"), ("(gint) PK_ERROR_ENUM_BAD_GPG_SIGNATURE", "30"), ...
Rust
0