text
string
label_name
string
labels
int64
# f-string person = "Karthik" coins = 3 ########################### # Concatenating string print("\n" + person + " has " + str(coins) + " coins left.") ########################### # Previous %s formatting message = "\n%s has %s coins left." % (person,coins) print(message) ########################### # Previous ...
Python
1
ic=doFigOperatios(name, numGraphs,graphOrder, margins) # fieldList=[dicOfSeries, dicOfListSeriesOrder,xLim,yLim,\ # labelX, labelY,tickFrequence, xLogScale, \ # yLogScale,alpha, \ # xScalar, yScalar, axesDic] # for graphName in graphOrder: # seriesDic, seri...
Python
1
-> Option<PstObj> { if inbuf.len() <= 2 { return None; } else { if inbuf[0] == b'(' { return pst_string_parse_literal(inbuf).map(PstObj::String); } else { if inbuf[0] == b'<' && inbuf[1] == b'~' { panic!("ASCII85 string not supported yet."); ...
Rust
0
beExt<V> for SumJoinOp { default fn maybe_build(xs_: Vec<Val<V>>) -> Option<Val<V>> { //println!("DEBUG: SumJoinOpMaybeExt: maybe build: none"); None } default fn maybe_build_inplace(xs_: Vec<Val<V>>) -> Option<(Val<V>, Vec<Val<V>>)> { //println!("DEBUG: SumJoinOpMaybeExt: maybe build inplace: none")...
Rust
0
| /* padding */ 0b11; // '7' 56 => (0b011110 << 2) | /* padding */ 0b11; // '8' 57 => (0b011111 << 2) | /* padding */ 0b11; // '9' 61 => (0b100000 << 2) | /* padding */ 0b11; // '=' 65 => (0b100001 << 2) | /* padding */ 0b11; // 'A' 95 => (0b100010 << 2) | /* padding */ 0b11; //...
Rust
0
"\\bib" : "𝒃", "\\bic" : "𝒄", "\\bid" : "𝒅", "\\bie" : "𝒆", "\\bif" : "𝒇", "\\big" : "𝒈", "\\bih" : "𝒉", "\\bii" : "𝒊", "\\bij" : "𝒋", "\\bik" : "𝒌", "\\bil" : "𝒍", "\\bim" : "𝒎", "\\bin" : "𝒏", "\\bio" : "𝒐", "\\bip" : "𝒑", "\\biq" : "𝒒", ...
Python
1
TryInto, }, }; use nom::{IResult, IResult::*, Needed::{Size, Unknown}, *}; use failure::Error; use error::RustepErrorKind; use format::executable::Executable; use num::FromPrimitive; use enumflags::BitFlags; /// Elf types, refer to `ELF`'s `e_type` #[derive(FromPrimitive, ToPrimitive, Eq, PartialEq, Clone,...
Rust
0
# tensorize将计算作为整体,编译为一个tensor_intrin函数中。这是因为很多计算属于常用计算, # 针对这些计算已经有了很好的built-in的schedule,通过tensorize可以直接调用这些内置的in # trinsic,其实这也就是intrinsic在计算机科学中的本意[https://en.wikipedia.org/wiki/Intrinsic_function]。 import tvm from tvm import te N, M, L = 1024, 512, 64 A = te.placeholder((N, L), name='A') B = te.placeholder((M, L)...
Python
1
this key. pub fn name(&self) -> &NameParts { &self.name_parts } /// Labels of this key, if they exist. pub fn labels(&self) -> Iter<Label> { self.labels.iter() } /// Appends a part to the name, pub fn append_name<S: Into<SharedString>>(self, part: S) -> Self { let ...
Rust
0
{}", input_file)); output.add_metadata_entry(format!("Elapsed Time (excluding I/O): {}", elapsed_time)); if verbose { println!("Saving data...") }; let _ = match output.write() { Ok(_) => { if verbose { println!("Output file w...
Rust
0
# Copyright 2020 ACSONE SA/NV # License LGPL-3.0 or later (http://www.gnu.org/licenses/lgpl). from odoo import fields, models from odoo.tools.safe_eval import safe_eval help_message = [ "Compute the result from 'value' by setting the variable 'result'.", "\n" "For fields resolvers:", ":param record: the r...
Python
1
""" This module contains features related to outputs generated by a model. The main responsibilities are data structures for holding such outputs, and code to translate outputs into readable strings. """ from typing import List, Union from xnmt.persistence import Serializable, serializable_init class OutputProcesso...
Python
1
il.length = "LONG" # high, AUTO summarize_text_detail.temperature = .25 # [0,1] if "<compartment_ocid>" in compartment_id: print("ERROR:Please update your compartment id in target python file") quit() summarize_text_response = generative_ai_inference_client.summarize_text(summarize_text_de...
Python
1
################################## # Create Utilities Menu utilitiesMenu = m.addMenu('Utilities', icon = 'Modify.png', index = 150) utilitiesMenu.addCommand('GUI Switch TL', "nuke.createNode('{}GUI_Switch')".format(prefixNST), icon="Switch.png") utilitiesMenu.addCommand('NAN INF Killer TL', "nuke.createNode('{}NAN_I...
Python
1
(max) = enm { if index < *max { rc.set_uniform_by_name(&format!("{}[{}]", param, index), value); } } } } pub fn matrix4_uniform(rc: &mut RenderContext, params: &HashMap<String, UniformParameter>, param: &str, value: [[f32; 4]; 4]) { ...
Rust
0
of edges among nodes. def optimize_pairs(G,scenes,heights,i,temp_thres,perp_thres): scenes2 = [x for j,x in enumerate(scenes) if (j!=i)] heights2 = [x for j,x in enumerate(heights) if (j!=i)] temp = 50 # days perp = 100 # meter d = G.degree(scenes[i]) iter = 0 while (d < 4) ...
Python
1
{:?}", &name, &location); let mut peer = persons.iter_mut().find(|p| p.get_pgp_id() == &pgp_id); if peer.is_none() { persons.push(Arc::new(Peer::new(name, pgp.clone(), pgp_id))); ...
Rust
0
let loader = IconLoader::init_ui(); Ok(LifeBar { lifebar_frame: loader.get(render_context, "life_frame.png")?, lifebar: loader.get(render_context, "life_bar.png")?, absorb: loader.get(render_context, "absorb_bar.png")?, }) } pub fn render(&self, frame: SDLR...
Rust
0
INT_SCOPES: &[ConstraintScope] = &[ConstraintScope::ModelPrimaryKeyKeyIndexForeignKey]; const CAPABILITIES: &[ConnectorCapability] = &[ ConnectorCapability::AdvancedJsonNullability, ConnectorCapability::AnyId, ConnectorCapability::AutoIncrement, ConnectorCapability::AutoIncrementAllowedOnNonId, Con...
Rust
0
= "Invalid seed provided."; /// INVALID_SECURITY_LEVEL_INPUT_ERROR pub const INVALID_SECURITY_LEVEL_INPUT_ERROR: &str = "Invalid security level provided."; /// INVALID_ATTACHED_TRYTES_INPUT_ERROR pub const INVALID_ATTACHED_TRYTES_INPUT_ERROR: &str = "Invalid attached trytes provided."; /// INVALID_TRANSFERS_INPUT_ERRO...
Rust
0
import vtk def main(): colors = vtk.vtkNamedColors() # Set the background color. colors.SetColor("bkg", [0.2, 0.3, 0.4, 1.0]) # Create a sphere to deform sphere = vtk.vtkSphereSource() sphere.SetThetaResolution(51) sphere.SetPhiResolution(17) sphere.Update() bounds = sphere.G...
Python
1
from flask import Blueprint, request from models import model_professores professores_bp = Blueprint('professores', __name__) # GET /api/professores - Lista todos os professores @professores_bp.route('/api/professores', methods=['GET']) def consulta_professores(): return model_professores.professores() # GET /a...
Python
1
ite(line) controllers = [] controller_guids = {} for line in input: if parsing_controllers: if (line.startswith("{")): output.write(line) elif (line.startswith(" NULL")): parsing_controllers = False write_controllers() output.write(line) ...
Python
1
mal number of infer requests infer_queue = ov.AsyncInferQueue(compiled_model) infer_queue.set_callback(completion_callback) # --------------------------- Step 7. Do inference -------------------------------------------------------------------- for i, input_tensor in enumerate(input_tensors): infer_...
Python
1
_base_ = [ 'datasets/ov_coco.py', 'models/oadp_faster_rcnn_r50_fpn.py', 'schedules/40k.py', 'base.py', ] model = dict( global_head=dict( classifier=dict( type='Classifier', prompts='data/prompts/ml_coco.pth', out_features=65, ), ), roi_hea...
Python
1
from: BB, occupied: BB) -> BB { let mut attacks = EMPTY; for (sq, _) in from.iter() { attacks |= bishop_attacks_from_sq(sq, occupied); } attacks } #[cfg(not(target_feature = "sse3"))] pub fn bishop_attacks_from_sq(from: Square, occupied: BB) -> BB { let source = BB::new(from); let diag...
Rust
0
} } #[no_mangle] pub unsafe extern "C" fn str_eq_buf(mut s: str_number, mut k: i32) -> bool { let mut j: pool_pointer = 0; j = *str_start.offset((s as i64 - 65536) as isize); while j < *str_start.offset(((s + 1i32) as i64 - 65536) as isize) { if *buffer.offset(k as isize) as i64 >= 65536 { ...
Rust
0
llapse_vars": true, "hoist_props": true, "reduce_vars": true, "toplevel": true, "unused": true }"###; run_exec_test(src, config, false); } #[test] fn terser_identity_inline_identity_extra_params() { let src = r###"const id = (x) => x; console.log(id(1, console.log(2)), id(3, 4));"###; let ...
Rust
0
rting date for activity generation for all students. Returns: pd.DataFrame: A DataFrame containing all generated activity events. """ all_activities = [] for _, student in student_profiles.iterrows(): student_id = student['STUDENT_ID'] student_activities = generate_student_activ...
Python
1
module) > indx parent_module = model.get_submodule(name.rpartition(".")[0]) setattr(parent_module, "_original_" + name.rpartition(".")[-1], module) setattr(parent_module, name.rpartition(".")[-1], module[indx]) yield for name, module in list(model.named_...
Python
1
, # weight_step_min = 0., # start_step = 0.5, # learn_max = 1.2, # learn_min = 0.5, # save_trained_network = False # Whether to write the trained weights to disk # ) # Print a network test print_test( network, training_data, cost_functi...
Python
1
="needs ilp64 fitpack") def test_ilp64_bisplrep(self): check_free_memory(28000) # VM size, doesn't actually use the pages x = np.linspace(0, 1, 400) y = np.linspace(0, 1, 400) x, y = np.meshgrid(x, y) z = np.zeros_like(x) tck = bisplrep(x, y, z, kx=3, ky=3, s=0) ...
Python
1
# TRY0xx - Exceptions RAISE_VANILLA_CLASS = ("TRY002", "Create your own exception") RAISE_VANILLA_ARGS = ( "TRY003", "Avoid specifying long messages outside the exception class", ) PREFER_TYPE_ERROR = ("TRY004", "Prefer TypeError exception for invalid type") NON_PICKABLE_CLASS = ("TRY005", "Define __reduce__ to...
Python
1
A tuple (cd_h, cd_w, cd_d) representing the center distances for height, width, and depth. Raises ------ ValueError If an unknown packing strategy is provided. """ if packing_strategy == 'sparse_square': cd_h, cd_w, cd_d =...
Python
1
uantize_tensor_list(args[1], qtype) out_tensors = _quantize_tensor_list(tensors, qtype) dist.all_to_all(out_tensors, input_tensors, group=group, async_op=async_op) for i, t in enumerate( _dequantize_tensor_list(out_tensors, qtype, quant_loss=quant_loss) ):...
Python
1
d_GetIPInfo(ctx: *mut _Unwind_Context, ip_before_insn: *mut libc::c_int) -> libc::uintptr_t; #[cfg(all(not(target_os = "android"), not(all(target_os = "linux", target_arch = "arm"))))] pub fn _Unwind_FindEnclosingFunction(pc: *mut l...
Rust
0
32` is an object-safe trait. const _: [&mut dyn Gen32; 0] = []; /// Converts the `usize` into a `u16`, or gives `u16::MAX` if that wouldn't fit. #[inline(always)] const fn saturating_usize_as_u16(val: usize) -> u16 { if val <= u16::MAX as usize { val as u16 } else { u16::MAX } } <reponame>chadeLin/chubao...
Rust
0
sounds.you_win.play() draw_background() draw_ground() screen.draw.text("VOCE VENCEU!", center=(WIDTH//2, HEIGHT//2 - 50), fontsize=100, color="white") screen.draw.text("Pressione ENTER para voltar ao Menu", center=(WIDTH//2, HEIGHT//2 + 50), fontsize=40, color="white") scr...
Python
1
ayer3(x) if self.extra_layer: x = self.layer4(x) x = self.avgpool(x) x = x.view(x.size(0), -1) return x def resnet50_baseline(pretrained=False, extra_block=False): """Constructs a Modified ResNet-50 model. Args: pretrained (bool): If True, returns a model pr...
Python
1
# -*- coding: utf-8 -*- """Global configuration variables. The approach is adapted from Numba's config.py """ import os FFT_CACHE_NB = 32 """ Number of VkFFTApp to cache through the pyvkfft.fft interface This must be modified *before* importing pyvkfft.fft. """ USE_LUT = None """ Force using a LUT for single-precisi...
Python
1
//! .unwrap(); //! context.state().add_source(source) //! } //! //! ``` use crate::{ buffer::{streaming::StreamingBuffer, SoundBuffer}, error::SoundError, source::{SoundSource, Status}, }; use rg3d_core::visitor::{Visit, VisitResult, Visitor}; use std::{ sync::{Arc, Mutex}, time::Durati...
Rust
0
rator. type Error; /// Concrete type for the interpreter pseudorandom number generator. type Prng; /// Return a shared reference to the interpreter pseudorandom number /// generator. /// /// # Errors /// /// If the PRNG is inaccessible, an error is returned. fn prng(&self) -> R...
Rust
0
(&log_config_path, Default::default()) { Ok(_) => (), Err(e) => { eprintln!("could not initialize logging with init_file: {}", e); let log_path = home_dir.join(".chipmunk").join("chipmunk.indexer.log"); let appender_name = "indexer-root"; let logfile = Fil...
Rust
0
assert_eq!(GCB::CR.abbr_name(), "CR"); } #[test] fn test_long_name() { assert_eq!(GCB::CR.long_name(), "CR"); } #[test] fn test_human_name() { assert_eq!(GCB::CR.human_name(), "Carriage Return"); } } <gh_stars>0 extern crate chronicle_common; pub mod cluster; pub m...
Rust
0
import logging from talon import Module, actions, imgui mod = Module() # list of recent phrases, most recent first phrase_history = [] phrase_history_length = 40 phrase_history_display_length = 40 @mod.action_class class Actions: def get_last_phrase() -> str: """Gets the last phrase""" return p...
Python
1
ilename>sheeit/src/dependency/nodes.rs<gh_stars>10-100 use crate::storage::size_check::NonNegativeIsize; use crate::storage::{CoreDocument, Sequence, StorageErrorKind}; use rstar::{RTreeObject, AABB}; use crate::storage::location::{ CellRange, CellRangeIterator, Coordinate, IntoIteratorWith, SheetCoordinate, Shee...
Rust
0
from flask_restful import reqparse from terrareg.models import ModuleProviderRedirect from terrareg.server.error_catching_resource import ErrorCatchingResource import terrareg.auth_wrapper import terrareg.user_group_namespace_permission_type import terrareg.csrf class ApiTerraregModuleProviderRedirectDelete(ErrorCa...
Python
1
ValueError("themes".to_string())), _ => Err(ConfigError::TypeError("themes".to_string())), }, Err(e) => Err(ConfigError::LuaError(e)), }?; let coordinates = match config.get("coordinates") { Ok(v) => match v { Value::Table(t) => Ok(t),...
Rust
0
sanitized = f"t_{sanitized}" return sanitized def build_where_clause(conditions: Dict[str, Any]) -> str: """Build a WHERE clause from a dictionary of conditions.""" if not conditions: return "" clauses = [] for key, value in conditions.items(): sanitized_key = sa...
Python
1
import flet as ft def main(page: ft.Page): page.title = "Ejemplo TextField Deshabilitado" texto_deshabilitado = ft.TextField( label="Este campo está deshabilitado", value="No puedes editar esto", disabled=True ) page.add(texto_deshabilitado) ft.app(target=main)
Python
1
ent _cls field is only set if child of concrete embedded document """ concrete_not_children = [ name for name, ed in self._embedded_lookup.items() if not ed.opts.is_child and not ed.opts.abstract ] for doc_cls in self._doc_lookup.values(): ...
Python
1
S e # INNER JOIN DEPARTAMENTOS d ON e.departamento_id = d.id # INNER JOIN CARGOS c ON e.cargo_id = c.id # INNER JOIN SALARIOS s ON e.id = s.empleado_id # """) #for row in cursor: # print(row) #cursor.execute( # """ # UPDATE EMPLEADOS # SET CARGO_id= 3 # WHERE id = 2 # """ #) #cursor.execute(...
Python
1
nnect(resource, proto=protocol, name=name, auth=auth, **kwargs) return NgrokTunnelSchema().dump(tunnel) @action def close_tunnel(self, tunnel: str): """ Close an ``ngrok`` tunnel. :param tunnel: Name or public URL of the tunnel to be closed. """ from pyngrok imp...
Python
1
mod fs; mod io_async_read; mod io_chain; mod io_copy; mod io_driver_drop; mod io_driver; mod io_lines; mod io_read_exact; mod io_read_line; mod io_read; mod io_read_to_end; mod io_read_to_string; mod io_read_until; mod io_split; mod io_take; mod io_write_all; mod io_write_int; mod io_write; mod macros_join; mod macros...
Rust
0
import random from data_structures.node import Node functions = ['+', '-', '*', '/'] terminals = ['x', 1.0, 2.0, 3.0] def generate_random_tree(depth, functions, terminals): if depth == 0 or (depth > 1 and random.random() < 0.3): return Node(random.choice(terminals)) else: funct = random.choic...
Python
1
: u32 = ::std::mem::transmute(val); self._bitfield_1.set(24usize, 8u8, val as u64) } } #[inline] pub fn new_bitfield_1(ele_id: u32, rr: u32, rw: u32, rma_id: u32) -> __BindgenBitfieldUnit<[u8; 4usize]> { let mut __bindgen_bitfield_unit: __BindgenBitfieldUnit<[u8; 4usize]> = Defau...
Rust
0
# Example 1 for understanding class and init method class Dog: def __init__(self, name, age):# -----> This is called an __init__() method. This method has two leading underscores and two trailing underscores. # ---> We defined init method to have three parameters: self, name, age. The self paramater is req...
Python
1
, has_odd, value )); if value % 2 != 0 { if is_even || has_odd { return false; } else { has_odd = true; } } } true } #[cfg(test)] mod tests { use super::*; #[test] fn test_palindrome_permutation() { ...
Rust
0
s_row, tasks), total=len(tasks), desc="Generating Final Responses with RAG"): if result: results.append(result) time_now = time.strftime("%Y%m%d-%H%M%S") final_output_path = f'{args.output_path}/final_pipeline_output_rag_{time_now}.csv' final_df = pd.DataFrame(results) final...
Python
1
0x94, 0x93, 0x36, 0xcf, 0xbd, 0x59, 0xea, 0x57} DEFINE_GUID! {GUID_MetadataFormatGps, 0x7134ab8a, 0x9351, 0x44ad, 0xaf, 0x62, 0x44, 0x8d, 0xb6, 0xb5, 0x02, 0xec} DEFINE_GUID! {GUID_MetadataFormatInterop, 0xed686f8e, 0x681f, 0x4c8b, 0xbd, 0x41, 0xa8, 0xad, 0xdb, 0xf6, 0xb3, 0xfc} DEFINE_GUID! {GUID_MetadataFormatApp0, 0...
Rust
0
------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'sphinx_rtd_theme' # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the bu...
Python
1
for k, v in EDDYSTONE_URL_SCHEMES.items(): if url.startswith(v): scheme = k url = url[len(v):] break else: raise Exception("URLs must start with EDDYSTONE_URL_SCHEMES") return Eddystone_Frame() / Eddystone_URL( u...
Python
1
i_stable ensures that //! vtables and modules are consistent across dynamic libraries. //! //! ### Failure //! //! Loading many libraries that contain ExtraChecks trait objects that need //! to be combined can fail if the representative version of the trait objects //! are incompatible with those of the library, //! ev...
Rust
0
#!/usr/bin/env python # -*- coding: utf-8 -*- import json from alipay.aop.api.response.AlipayResponse import AlipayResponse class AlipayEbppIndustrySupervisionPayCancelResponse(AlipayResponse): def __init__(self): super(AlipayEbppIndustrySupervisionPayCancelResponse, self).__init__() self._biz_s...
Python
1
::Else(Else { body: CodeBlock { stmts: vec![Stmt::Expr(Expr::Number { n: 3.0 })] } }))) } }))) }) ) } #[test] fn lower_else() { let...
Rust
0
ld not arrive here!") return None qubit_error_index = np.where(qubit_vector == 1)[0][0] if qubit_error_index > 3: print("Qubit is in E,R,M. Should not arrive here!") return None # Get the updated error index from the multiplication table updated_error_index = multiplication_tab...
Python
1
test)] mod tests; use codec::{Decode, Encode, EncodeLike}; use frame_support::{ dispatch::{DispatchError, DispatchResult}, traits::Get, }; use primitives::{BalanceToFixedPoint, TruncateFixedPointToInt, VaultCurrencyPair, VaultId}; use scale_info::TypeInfo; use sp_arithmetic::{FixedPointNumber, FixedPointOperan...
Rust
0
# Copyright (c) Meta Platforms, Inc. and affiliates. # All rights reserved. # # This source code is licensed under the license found in the # LICENSE file in the root directory of this source tree. import logging import os import sys from controlnet_aux.depth_anything.torchhub.facebookresearch_dinov2_main.dinov2.eval...
Python
1
# --------------------------------------------------------------------- # Copyright (c) 2025 Qualcomm Technologies, Inc. and/or its subsidiaries. # SPDX-License-Identifier: BSD-3-Clause # --------------------------------------------------------------------- # flake8: noqa: E402 # (module level import not at top of fil...
Python
1
if name.lower() != dataset.name.lower() \ and len(KnowledgebaseService.query(name=name, tenant_id=current_user.id, status=StatusEnum.VALID.value)) > 1: return construct_json_result(code=RetCode.DATA_ERROR, message=f"The name:...
Python
1
processors::template::Template::try_from(s); std::result::Result::Ok(RTemplate(template.unwrap())) } else if let Some(s) = robj.as_str_vector() { let template = tokenizers::processors::template::Template::try_from(s); std::result::Result::Ok(RTemplate(template.unwrap())) ...
Rust
0
0x88, 0xcf, 0xc7, 0x98, 0x25, 0xdf, 0x56, 0x6d, 0xc5, 0x43, 0x0b, 0x9a, 0x04, 0x5a, 0x12, 0x00, 0x13, 0x01, 0x00, 0x00, 0x2e, 0x00, 0x33, 0x00, 0x24, 0x00, 0x1d, 0x00, 0x20, 0x9d, 0x3c, 0x94, 0x0d, 0x89, 0x69, 0x0b, 0x84, 0xd0, 0x8a, 0x60, 0x99, 0x3c, 0x14, 0x4e, 0xca, 0x...
Rust
0
inline] fn command(&self) -> &Command { unsafe { (*self.command).command() } } #[inline] fn id(&self) -> u32 { unsafe { (*self.command).id() } } #[inline] fn kill(&mut self) -> Result<(), Error> { unsafe { (*self.command).kill() } } } impl<'a, C, D, Item> Stand...
Rust
0
ond_lb pdata.loc[grps[True],"pargp"] = "rcond" wf_base = 100.0 grps = pdata.groupby(pdata.parnme.apply(lambda x:'wf' in x and x.endswith("_1"))).groups pdata.loc[grps[True],"parval1"] = -1.0 * wf_base pdata.loc[grps[True],"parubnd"] = -1.0 * wf_base * 1.1 pdata.loc[grps[True],"parlbnd"] = -1.0...
Python
1
ected_encryptor, _), (_, mut remote_decryptor)) = setup_peers(); let message: Vec<u8> = vec![]; let encrypted_message = connected_encryptor.encrypt_buf(&message); assert_eq!(encrypted_message.len(), 2 + 16 + 16); remote_decryptor.read(&encrypted_message[..]).unwrap(); let decrypted_message = remote_decrypto...
Rust
0
import sys, os, io, atexit input = lambda : sys.stdin.readline().rstrip('\r\n') stdout = io.BytesIO() sys.stdout.write = lambda s : stdout.write(s.encode("ascii")) atexit.register(lambda : os.write(1, stdout.getvalue())) import heapq INF = int(1e9) def digkstra(start): q = [] #시작 노드로 가기 위한 최단 경로는 0으로 설정하여 큐에 ...
Python
1
# Percorremos os goal point todos for goal in self.robot_goals: #Para garantir que analisamos o mesmo goal point x_diff = goal[1] - possible_goal_point.point.x y_diff = goal[2] - possible_goal_point.point.y distance_actual = goal[3] same_goal_c...
Python
1
with_args((#(#args,)*)) })) } } expr => darling::Error::custom("faux::when! only accepts arguments in the format of: `when!(receiver.method)` or `receiver.method(args...)`") .with_span(&expr) .write_errors() .into(), } } use quote::ToTokens; fn re...
Rust
0
:].reindex(index).fillna(method="backfill") expected[:3] = np.nan tm.assert_series_equal(result, expected) def test_series_pad_backfill_limit(self): index = np.arange(10) s = Series(np.random.randn(10), index=index) result = s[:2].reindex(index, method="pad", limit=5) ...
Python
1
.create(SceneDescriptor { gravity: PxVec3::new(0.0, -9.81, 0.0), on_advance: Some(OnAdvance), ..SceneDescriptor::new(()) }) .unwrap(); Self { foundation, scene, resources: Default::default(), ...
Rust
0
=> hash_bytes(state, socket_address), #[cfg(any(target_os = "ios", target_os = "macos"))] SysControl(ref socket_address) => hash_bytes(state, socket_address), #[cfg(any(target_os = "android", target_os = "linux"))] DataLink(ref socket_address) => hash_bytes(state, socket_address), #[cfg(any(target_...
Rust
0
#!/usr/bin/python3 # coding=utf-8 """ Author: Xe time: 2024/2/14 cron: 0 25 * * * * new Env('监控AkileCloud'); """ from re import A import requests import json import os import time from pprint import pprint from notify import send title = os.getenv('TITLE') or '监控_AkileCloud' debug = os.getenv('DEBUG') or False AkileCl...
Python
1
class Solution: """ Finds the count of interesting subarrays using prefix sums and a frequency map. An interesting subarray nums[l..r] has cnt % modulo == k, where cnt is the number of elements nums[i] (l <= i <= r) such that nums[i] % modulo == k. """ def countInterestingSubarrays(self, nums: l...
Python
1
Unknown, format!("failed to start OpenTask: {}", e))), }; // register task with TaskHandler let task_id = { let mut task_manager = self.task_manager.write().unwrap(); match task_manager.register(task_handle, request.task_id) { Ok(task_id) ...
Rust
0
rate generation Input: None Output: rate (int) : sample rate in Hz ''' logging.debug(__name__ + ' : Get spc samplerate') return self._get_param(_spcm_regs.SPC_SAMPLERATE) def do_set_reference_clock(self, freq): ''' Programs the exter...
Python
1
from airflow.providers.postgres.hooks.postgres import PostgresHook from airflow.providers.postgres.operators.postgres import PostgresOperator class PostgresViewManagerOperator(PostgresOperator): def __init__(self, view_name, postgres_conn_id, database, schema, *args, **kwargs): super(PostgresViewManagerOp...
Python
1
# Copyright (C) 2015 Optiv, Inc. (brad.spengler@optiv.com) # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This pr...
Python
1
import os,shutil import subprocess,argparse # paths = os.walk('/home/data/newpoc/je/2023-03-02') # outpath = '/home/data/badpoc/je' # shell={"jsc":"/home/data/WebKit/gcov/Debug/bin/jsc","v8":"/home/ubuntu/v8/v8/out/cov/d8","je":"/home/data/jerryscript/build/bin/jerry","sp":"/home/data/gecko-dev/obj-cov-x86_64-pc-linu...
Python
1
targets = [ self._unique_sentinel_target(example, noise_mask) for example, noise_mask in zip(examples, noise_masks) ] # make labels and input_ids batch = { "input_ids": _torch_collate_batch( inputs, tokenizer=self.tokenizer, ...
Python
1
o_database() if not db_connection: print("Không thể kết nối đến database") return try: user_id = None while not user_id: # Yêu cầu user_id input_user_id = input("Nhập user_id (hoặc để trống để mặc định là 1): ").strip() or "1" # K...
Python
1
def check_winnings(columns,lines,bet,value): winnings=0 winning_lines=[] for line in range(lines): symbol=columns[0][lines] for column in columns: symbol_to_check =column[lines] if symbol != symbol_to_check: break else: winnings+= v...
Python
1
from bs4 import BeautifulSoup import csv # Let's bundle everything we did previously into a function. Let's call it 'ParseMyAddresses'. We'll pass it one variable, # the HTML file that we want parsed. def ParseMyAddresses(html_file): # Because indentation controls how Python reads our code, we need to tab all the co...
Python
1
; varying lowp vec2 v_tex_coords; void main() { gl_Position = matrix * vec4(position, 0.0, 1.0); v_tex_coords = tex_coords; } ", fragment: " #version 100 uniform lowp sampler2...
Rust
0
查询应用包导入状态 --- parameters: - name: tenantName description: 团队名称 required: true type: string paramType: path - name: event_id description: 事件ID required: true type: string ...
Python
1
ing guarantees an instance of `T` can expect: /// the referent of the pointer should not be modified without a unique path to /// its owning Unique. /// /// If you're uncertain of whether it's correct to use `Unique` for your purposes, /// consider using `NonNull`, which has weaker semantics. /// /// Unlike `*mut T`, t...
Rust
0
_chars)) return s # Convert to full-with characters def toFullWidthClipboardText(): s = getClipboardText() s = s.translate(str.maketrans(half_width_chars,full_width_chars)) return s # Save the clipboard contents as a file in Desktop directory ...
Python
1
se small problem size test_psize = "small" M = psize["correlation"][test_psize]["M"] N = psize["correlation"][test_psize]["N"] N_float = float(N) epsilon = 1e-5 concrete_type = float32 sch = correlation(concrete_type, M, N, N_float, epsilon) mod = sch.build() data = np.random.rand(N,...
Python
1
t(Any, response.is_closed) is True @parametrize async def test_path_params_retrieve(self, async_client: AsyncLithic) -> None: with pytest.raises(ValueError, match=r"Expected a non-empty value for `auth_rule_token` but received ''"): await async_client.auth_rules.v2.backtests.with_raw_respon...
Python
1
+ 2 * self.env.rnn_size)) for rollout_idx in range(data['obses'].shape[0]): data['obses'][rollout_idx] = np.concatenate( (rollout_data['obses'][rollout_idx], hidden_states[rollout_idx, :-1]), axis=1) data['next_obses'][rollout_idx] = np.concatenate( (rollout_data['next_ob...
Python
1
the link to learn more about many assumptions this module was built upon: //! https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texImage2D pub mod class; pub mod storage; pub mod types; pub use class::*; pub use storage::*; pub use types::*; /// Provides smart scope for item types. pub mod item...
Rust
0