text
string
label_name
string
labels
int64
t<C>(&mut self, enode: &VecLang, mut costs: C) -> Self::Cost where C: FnMut(Id) -> Self::Cost, { const LITERAL: f64 = 0.001; const STRUCTURE: f64 = 0.1; const VEC_OP: f64 = 1.; const OP: f64 = 1.; const BIG: f64 = 100.0; let op_cost = match enode { ...
Rust
0
import sys import pandas as pd import os os.chdir(os.path.dirname(__file__)) def loseg(): print("Unfortunately, you have lost... The word was "+word) #sys.exit() def wing(): print("\nYou have won, congratulations!") #sys.exit() def getchar(): global attempt attempt = input("Guess a characte...
Python
1
ntact_phone_number = args.value_of("contact_phone_number").unwrap(); let contact_language_code = args.value_of("contact_language_code").unwrap(); let street = args.value_of("street_address"); let city = args.value_of("city"); let country = args.value_of("country"); let key = args.value_of("key"); ...
Rust
0
e of `params` (as specified by `splits`) `repeats` times. Let the `i`th range of `params` be defined as `params[splits[i]:splits[i + 1]]`. Then this function returns a tensor containing range 0 repeated `repeats[0]` times, followed by range 1 repeated `repeats[1]`, ..., followed by the last range repeated `re...
Python
1
Gerenciamento de Compras de Produtos Você foi contratado para desenvolver um programa simples para auxiliar em um processo de compra de produtos. O programa deve permitir ao usuário inserir o nome e o preço de vários produtos, perguntando se deseja continuar inserindo mais produtos após cada entrada. Ao final, o progra...
Python
1
# Copyright 2016-present CERN – European Organization for Nuclear Research # # 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...
Python
1
pixels_updated = true; } } Err(_) => { if pixels_updated { window.request_redraw(); } break; } ...
Rust
0
from langchain_community.chat_models import ChatOllama from langchain_community.agent_toolkits.load_tools import load_tools from langchain.agents import create_react_agent, AgentExecutor from langchain.chains import LLMChain from langchain_core.runnables.history import RunnableWithMessageHistory from .prompts import re...
Python
1
PMS_1` reader - dma_apbperi_lc_pms_constrain_sram_world_0_pms_1"] pub struct DMA_APBPERI_LC_PMS_CONSTRAIN_SRAM_WORLD_0_PMS_1_R(crate::FieldReader<u8, u8>); impl DMA_APBPERI_LC_PMS_CONSTRAIN_SRAM_WORLD_0_PMS_1_R { #[inline(always)] pub(crate) fn new(bits: u8) -> Self { DMA_APBPERI_LC_PMS_CONSTRAIN_SRAM_W...
Rust
0
rsed.media_descriptions { if &media.media_name.media == section { assert_eq!(extract_ssrc_list(media).len(), 2); } } } } let apc = api .new_peer_connection(RTCConfiguration { sdp_sema...
Rust
0
#tuple questions #1 emptuple=() print(len(emptuple)) #2 fruits = ('banana', 'orange', 'mango', 'lemon') print(len(fruits)) print(fruits[-3:-1]) print(fruits[-4:-1]) print(fruits[-4: ]) fruits=list(fruits) print(list(fruits)) del fruits # invALID SYNTAX #level 1 #1 EMP_TUP=() print(EMP_TUP) print(type(EMP_TUP)) pri...
Python
1
import streamlit as st def render_backtesting_metrics(summary_results, title="Backtesting Metrics"): net_pnl = summary_results.get('net_pnl', 0) net_pnl_quote = summary_results.get('net_pnl_quote', 0) total_volume = summary_results.get('total_volume', 0) total_executors_with_position = summary_results...
Python
1
{"query": {"function_score": {"query": { "bool": {"should": [{"multi_match": {"query": "python", "fields": ["nickname^2", "username^4"]}}], "filter": {"range": {"follower_count": {"gte": "50000", "lte": "100000"}}}}}, "field_value_factor": {"field": "follower_count", "modifier": "log1p", "missing":...
Python
1
# Copyright 2025 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, s...
Python
1
} } <reponame>zephraph/paperclip use crate::base::ast::ExprSource; use crate::css::runtime::virt as css_virt; use crate::js::runtime::virt as js_virt; use serde::Serialize; use std::collections::BTreeMap; use std::fmt; #[derive(Debug, PartialEq, Serialize, Clone)] pub struct Fragment { pub source: ExprSource, pub ...
Rust
0
let mut global = GLOBAL.write().await; if let Some(p) = global.peers.remove(&peer_addr) { if let Some(mgmt_tx) = &p.mgmt_tx { let _ = mgmt_tx.send(PeerMgmtMsg::Notification(bgp::Message::Notification { code: 6, su...
Rust
0
from typing import cast import pytest import polars as pl def test_collect_all_type_coercion_21805() -> None: df = pl.LazyFrame({"A": [1.0, 2.0]}) df = df.with_columns(pl.col("A").shift().fill_null(2)) assert pl.collect_all([df])[0]["A"].to_list() == [2.0, 1.0] @pytest.mark.parametrize("no_optimizatio...
Python
1
from taichi_glsl import * from pytest import approx def mean_approx_test(x, xmin, xmax, rel=1e-2): if not isinstance(x, np.ndarray): x = x.to_numpy() x = (x - xmin) / (xmax - xmin) for i in range(1, 4): assert (x**i).mean() == approx(1 / (i + 1), rel=rel) @ti.host_arch_only def test_rand...
Python
1
# NEON AI (TM) SOFTWARE, Software Development Kit & Application Framework # All trademark and other rights reserved by their respective owners # Copyright 2008-2025 Neongecko.com Inc. # Contributors: Daniel McKnight, Guy Daniels, Elon Gasper, Richard Leeds, # Regina Bloomstine, Casimiro Ferreira, Andrii Pernatii, Kiril...
Python
1
200 types. Occasionally it can //! come up that you need to implement some behavior across them all. //! //! - For example [the Rust integration for AST Explorer][astexplorer] wants to //! turn a syntax tree from Syn into a JavaScript value understood by the //! platform's existing cross-language syntax tree visua...
Rust
0
_vertices(&[2], 0., &converter), ]; let cofaces = vec![ RichSimplex::from_vertices(&[0, 2], 2., &converter), RichSimplex::from_vertices(&[1, 2], 1.5, &converter), RichSimplex::from_vertices(&[0, 1], 1., &converter), ]; (faces, cofaces, converter) }...
Rust
0
]); impl AffinePoint { /// Constructs the neutral element `(0, 1)`. pub const fn identity() -> Self { AffinePoint { u: Fq::zero(), v: Fq::one(), } } /// Multiplies this point by the cofactor, producing an /// `ExtendedPoint` pub fn mul_by_cofactor(&self)...
Rust
0
Params<'a> { line1: &'a Line, line2: &'a Line, le1: LinearEquation, le2: LinearEquation, /// Determinant, used to solve linear equations using Cramer's rule. denominator: i32, } impl<'a> IntersectionParams<'a> { pub fn from_lines(line1: &'a Line, line2: &'a Line) -> Self { let le1 ...
Rust
0
section = ".boot2"] #[used] // Adafruit Feather uses this boot loader (may be different for different boards) pub static BOOT2: [u8; 256] = rp2040_boot2::BOOT_LOADER_GD25Q64CS; // Adafruit Feather uses this frequency (may be different for different boards) const XTAL_FREQ_HZ: u32 = 12_000_000; #[entry] fn main() -> ...
Rust
0
= (1..6).map(|x| (f64::from(x), 1.0)).collect(); let b = serde_json::to_string(&a).unwrap(); assert_eq!(&b, "{\"weight_sum_sq\":5.0,\"weighted_avg\":{\"weight_sum\":5.0,\"weighted_avg\":3.0},\"unweighted_avg\":{\"avg\":{\"avg\":3.0,\"n\":5},\"sum_2\":10.0}}"); let c: WeightedMeanWithError = serde_json::fro...
Rust
0
VK_F9 => Key::F9, VK_F10 => Key::F10, VK_F11 => Key::F11, VK_F12 => Key::F12, VK_F13 => Key::F13, VK_F14 => Key::F14, VK_F15 => Key::F15, VK_F16 => Key::F16, VK_F17 => Key::F17, VK_F18 => Key::F18, VK_F19 => Key::F19, VK_F20 => K...
Rust
0
import seaborn as sns import numpy as np from torchvision.models import resnet18 import matplotlib.pyplot as plt from Optimization.automl_binary_search import automl_bs_find_pruning_ratio from utils import read_df_from_csv, marker_styles, get_all_profile_files from ResNetTrain.Hyperparameters import get_hp_formal_cifa...
Python
1
[ONE, "-n", "4"], "tests/expected/one.txt.n4.out") } #[test] fn one_n_minus_4() -> TestResult { run(&[ONE, "-n=-4"], "tests/expected/one.txt.n4.out") } #[test] fn one_n200() -> TestResult { run(&[ONE, "-n", "200"], "tests/expected/one.txt.n200.out") } #[test] fn one_n_minus_200() -> TestResult { run(&[ON...
Rust
0
0 / 3.0), mix( mix(mix(p0, p1, 1.0 / 3.0), mix(p1, p2, 1.0 / 3.0), 1.0 / 3.0), mix(mix(p1, p2, 1.0 / 3.0), mix(p2, p3, 1.0 / 3.0), 1.0 / 3.0), 2.0 / 3.0, ), mix( mix(mix(p0, p1, 2.0 / 3.0), mix(p1, p2, 2.0 / 3.0), 2.0 / ...
Rust
0
dify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [in_peri_sel_ch1](index.html) module"] pub struct IN_PERI_SEL_CH1_SPEC; impl crate::RegisterSpec for IN_PERI_SEL_CH1_SPEC { type Ux = u32; } #[doc = "`read()` method returns [in_peri_sel_ch1::R](R) rea...
Rust
0
# 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 u...
Python
1
import os import time import logging import ConfigSpace as CS from datetime import datetime def merge_dict(dict1, dict2): for key, value in dict2.items(): if key not in dict1: if isinstance(value, dict): dict1[key] = merge_dict({}, value) else: dict...
Python
1
ter().map(Into::into).map(verifier::Transaction::Local).collect() } fn retracted(self) -> Self::Out { self.into_iter().map(Into::into).map(verifier::Transaction::Retracted).collect() } fn unverified(self) -> Self::Out { self.into_iter().map(Into::into).map(verifier::Transaction::Unverified).collect() } fn ...
Rust
0
import streamlit as st def page1(): st.title('2024 KHUTHON') st.subheader('- 지능형 교통 시스템을 통한 미래 계획 도시 구현') def page2(): st.title('교통혼잡도') st.subheader("- 교통혼잡도 확인") def page3(): st.title('교통상황') st.subheader('- 교통상황 simulation') # 페이지의 기본 설정 변경 st.set_page_config(page_title="멀티페이지 애플리케이션", p...
Python
1
ing::from_utf8(decrypted).unwrap() } fn main() { let message = "AES is fast for large amounts of data"; // Generate random key and initialization vector: let key = rand::thread_rng().gen::<[u8; 16]>(); let iv = rand::thread_rng().gen::<[u8; 16]>(); // Encrypt the message: let encrypted = encr...
Rust
0
import os import random from contextlib import contextmanager # useful utility to change cwd to current directory @contextmanager def in_dir(directory): """Change current working directory to `directory`, run some code, and then change back.""" # store the original directory original_dir = os.getcwd() # cha...
Python
1
= [] remaining_budget = budget remaining_slots = size # Sortuj typy według wagi (od najważniejszych) sorted_types = sorted(self.unit_templates.items(), key=lambda x: x[1]['weight'], reverse=True) for unit_type, template in sorted_t...
Python
1
borrow::Cow; use sysinfo::{Process, ProcessExt, System, SystemExt}; use users::{get_current_uid, get_user_by_uid, User}; use std::net; use std::process::{Command, ExitStatus}; use clap::Arg; use libproc::libproc::proc_pid::{listpids, ProcType}; use netstat2::{AddressFamilyFlags, get_sockets_info, ProtocolFlags, Protoco...
Rust
0
'c, F>(&self, f: F) where F: FnMut() -> char + 'c, { unsafe{(&mut *(csound_sys::csoundGetHostData(self.engine.csound) as *mut CallbackHandler)).callbacks.keyboard_cb = Some(Box::new(f));} self.enable_callback(KEYBOARD_CB); }*/ /// Sets the function which will be called whenever ...
Rust
0
# Crea un programa que calcule quien gana más partidas al piedra, # papel, tijera, lagarto, spock. # - El resultado puede ser: "Player 1", "Player 2", "Tie" (empate) # - La función recibe un listado que contiene pares, representando cada jugada. # - El par puede contener combinaciones de "🗿" (piedra), "📄" (papel), #...
Python
1
rs while training. /// /// special_tokens (:obj:`List[Union[str, AddedToken]]`, `optional`): /// A list of special tokens the model should know of. /// /// limit_alphabet (:obj:`int`, `optional`): /// The maximum different characters to keep in the alphabet. /// /// initial_alphabet (:obj:`L...
Rust
0
t { trie_entry: trie_entry, data_ptr: storage, data_size: storage_size, _pd: PhantomData } } //FIXME pub unsafe fn prep_append_at(&mut self, key: TrieIndex) -> *mut ValEdge { if key >= self.root.next_entry { self.root.next_entry = key + 1 } ...
Rust
0
"\\1 year ago": [ "(\\d+[.,]?\\d*) г таму", "(\\d+[.,]?\\d*) год таму", "(\\d+[.,]?\\d*) года таму" ], "in \\1 day": [ "праз (\\d+[.,]?\\d*) д", "праз (\\d+[.,]?\\d*) дзень", "праз (\\d+[.,]?\\d*) дня" ], "in ...
Python
1
::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("WSSTransport").finish() } } <gh_stars>1-10 //! Core content addressable storage abstractions. use std::fmt; use std::io::prelude::*; use std::marker::PhantomData; use std::str::{self, FromStr}; use derivative::Derivative; use hex::FromHexError; u...
Rust
0
d<Name>, Positioned<Value>)>, } impl Directive { /// Attempt to convert this `Directive` into a `ConstDirective`. #[must_use] pub fn into_const(self) -> Option<ConstDirective> { Some(ConstDirective { name: self.name, arguments: self .arguments ...
Rust
0
import pytest from core.test.api_client import DRFClient @pytest.fixture(autouse=True) def _credentials(settings): settings.DOLYAME_LOGIN = "root" settings.DOLYAME_PASSWORD = "l0ve" settings.DOLYAME_CERTIFICATE_PATH = "apps/tinkoff/tests/tinkoff/.fixtures/testing.pem" @pytest.fixture def api(): ret...
Python
1
rs.broadcast_to_users") def test_permissions_updated_signal_role_team_restored( mock_broadcast_to_users, data_fixture, enterprise_data_fixture ): user = data_fixture.create_user() workspace = data_fixture.create_workspace(user=user) team = enterprise_data_fixture.create_team(workspace=workspace) en...
Python
1
target: 7_u8.into(), value: 1_u8.into(), span: 0..0, }], span: 0..0, }, ], span: 0..0, }], }; println!("{}", prog); let pro...
Rust
0
//! //! * Linux //! * macOS //! //! If a platform is not supported then a fallback implementation is used that //! does nothing. To see if your platform does something at runtime the //! `TARGET_SUPPORTED` constant can be used. //! //! Is your OS missing here? Send us a pull request! //! //! ## Addresses //! //! Share...
Rust
0
(path, data_tournament) id_tournament = await self.extract_last_tournament_id() all_matches = tournament_result["matchs"] await self.save_tournament_matches(all_matches, id_tournament) async def match_players_update(self, match_update): match = next( (m for m in self.matchs if m.get('matchId') ...
Python
1
from sqlalchemy import create_engine, event from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.schema import DDL # Assuming the database `AgentSims2` has already been created manually or through another process # Database connection information env_names = ...
Python
1
def get_dummy_components(self): torch.manual_seed(0) unet = AudioLDM2UNet2DConditionModel(block_out_channels=(32, 64), layers_per_block=2, sample_size=32, in_channels=4, out_channels=4, down_block_types=('DownBlock2D', 'CrossAttnDownBlock2D'), up_block_types=('CrossAttnUpBlock2D', 'UpBlo...
Python
1
COUNT: IntCounter = register_int_counter!( "dmbc_transaction_exchange_execute_count", "Transactions executed." ).unwrap(); static ref EXECUTE_SUCCESS_COUNT: IntCounter = register_int_counter!( "dmbc_transaction_exchange_execute_success_count", "Times transaction execution reporte...
Rust
0
ShaderStageCreateFlags = VkFlags; pub const VK_SHADER_STAGE_VERTEX_BIT: VkShaderStageFlagBits = 1; pub const VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT: VkShaderStageFlagBits = 2; pub const VK_SHADER_STAGE_TESSELLATION_EVALUATION_BIT: VkShaderStageFlagBits = 4; pub const VK_SHADER_STAGE_GEOMETRY_BIT: VkShaderStageFlagBit...
Rust
0
`\"Win32_Media_Audio_DirectMusic\"`*"] pub struct POOLTABLE { pub cbSize: u32, pub cCues: u32, } impl ::core::marker::Copy for POOLTABLE {} impl ::core::clone::Clone for POOLTABLE { fn clone(&self) -> Self { *self } } #[doc = "*Required features: `\"Win32_Media_Audio_DirectMusic\"`*"] pub const...
Rust
0
verser::Traverser; use crate::structure::codec::pb_chain_to_filter; use crate::structure::{ without_tag, Filter, IsSimple, TraverserFilter, TraverserFilterChain, ValueFilter, }; use crate::{str_to_dyn_error, DynResult, FromPb}; use pegasus::api::function::{FilterFunction, FnResult}; use std::sync::Arc; struct HasT...
Rust
0
C.value_of(1).scaling(), epoch_block_count: DEFAULT_BASE_BLOCK_DIFF_WINDOW * 10, base_block_difficulty_window: DEFAULT_BASE_BLOCK_DIFF_WINDOW, base_reward_per_uncle_percent: BASE_REWARD_PER_UNCLE_PERCENT, min_block_time_target: MIN_BLOCK_TIME_TARGET, max_block...
Rust
0
um::winuser::ShowWindow; use winapi::um::winuser::SW_HIDE; use winapi::um::winuser::SW_SHOW; /// Check if we're attached to an existing Windows console pub fn is_attached() -> bool { unsafe { !GetConsoleWindow().is_null() } } /// Try to attach to an existing Windows console, if necessary. /// /// It's normally a ...
Rust
0
i32; #[doc = "*Required features: 'Win32_Storage_Vss'*"] pub const VSS_E_VOLUME_NOT_SUPPORTED: ::windows_sys::core::HRESULT = -2147212532i32; #[doc = "*Required features: 'Win32_Storage_Vss'*"] pub const VSS_E_VOLUME_NOT_SUPPORTED_BY_PROVIDER: ::windows_sys::core::HRESULT = -2147212530i32; #[doc = "*Required features: ...
Rust
0
import json import os import mysql.connector from dotenv import load_dotenv from flask import Flask, request from flask_cors import CORS import config from game import Game load_dotenv() app = Flask(__name__) cors = CORS(app) app.config['CORS_HEADERS'] = 'Content-Type' config.conn = mysql.connector.connect( ...
Python
1
"""SCons.Tool.tar Tool-specific initialization for tar. There normally shouldn't be any need to import this module directly. It will usually be imported through the generic SCons.Tool.Tool() selection method. """ # # Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 The SCons Foundation # # P...
Python
1
)) } } } impl glib::value::ValueType for DeviceType { type Type = Self; } unsafe impl<'a> FromValue<'a> for DeviceType { type Checker = glib::value::GenericValueTypeChecker<Self>; unsafe fn from_value(value: &'a glib::Value) -> Self { from_glib(glib::gobject_ffi::g_value_get_enum(value.to_gli...
Rust
0
0x09), handle(0x10) 0x2E, 0x09, 0x10, 0x00, // string_property_id: (0x0001 - StringPropertyId::UefiDevicePath), string_property_value(1), parent_handle(0x0008) 0x01, 0x00, 0x01, 0x08, 0x00, //string_property_value: "Abcd" b'A', b'b', b'c', b'd', 0x00, 0x00, ]; ...
Rust
0
ight/res152_merge_other/EIGHT_1_9958_googlenet_v1.score', '../eight/res152_merge_other/EIGHT_1_9958_res101.score', '../eight/res152_merge_other/EIGHT_1_9958_vgg19.score'] OUT_PATH = '../EIGHT_1_9958_res152.merge' """ all_shot = Load_ALL(BASE_SCORE) score_shot = [...
Python
1
, c) in enumerate(line.chars()) { let a = match c { 'A' => Amphi::A, 'B' => Amphi::B, 'C' => Amphi::C, 'D' => Amphi::D, _ => continue, }; state[i - 1][j - 1] = Some(a); } } Ok(Rc::new(st...
Rust
0
PartialEq, Serialize, Deserialize, Default)] pub struct SourceUploadDefinition { #[doc = "The URL where the client can upload the source."] #[serde(rename = "uploadUrl", default, skip_serializing_if = "Option::is_none")] pub upload_url: Option<String>, #[doc = "The relative path to the source. This is ...
Rust
0
let result = search_contents_with_regex( &limit_files, kind, &loaded_file, regex, ); tx.send(Ok(result)).expect("Could not send() res...
Rust
0
if cv2.waitKey(1)==27: # break # # 释放资源 # cap.release() # cv2.destroyAllWindows() url = r"C:\Users\admin\Desktop\x-anythinglaebl\guliao\1.jpg" model_url = "http://192.168.2.16:8999/guliao" # 读取单张图片 frame = cv2.imread(url) if frame is None: print("Failed to read im...
Python
1
# db.py import mysql.connector from mysql.connector import Error, pooling # Database configuration dbconfig = { "user": "root", "password": "", "host": "localhost", "database": "LittleLemonDB" } # Initialize connection pool try: connection_pool = pooling.MySQLConnectionPool( pool_name="lit...
Python
1
7.3.0"; assert_eq!(parse_java_version(java_8), Some("8".to_string())); } #[test] fn test_parse_java_version_amazon_corretto() { let java_8 = "OpenJDK 64-Bit Server VM (25.222-b10) for linux-amd64 JRE (1.8.0_222-b10), built on Jul 11 2019 20:48:53 by \"root\" with gcc 7.3.1 20180303 (Red Ha...
Rust
0
()} } } #[derive(Debug, Eq)] pub enum CommentOrNewLines<'a> { Comment(CommentNewLines<'a>), NewLines(Cow<'a, str>), } impl<'a> PartialEq for CommentOrNewLines<'a> { fn eq(&self, other: &CommentOrNewLines<'a>) -> bool { match (self, other) { (&CommentOrNewLines::Comment(ref i), &CommentOrNewLines::Comment(...
Rust
0
ST], #SUM(orders.qty), #MIN(orders.qty) ORDER BY [#orders.order_id ASC NULLS LAST, #orders.qty ASC NULLS LAST]\ \n WindowAggr: windowExpr=[[SUM(#orders.qty)]]\ \n WindowAggr: windowExpr=[[MAX(#orders.qty) ORDER BY [#orders.qty ASC NULLS LAST, #orders.order_id ASC NULLS LAST]]]\ \n Windo...
Rust
0
= 32, HB_BUFFER_DIFF_FLAG_GLYPH_FLAGS_MISMATCH = 64, HB_BUFFER_DIFF_FLAG_POSITION_MISMATCH = 128, } extern "C" { pub fn hb_buffer_diff( buffer: *mut hb_buffer_t, reference: *mut hb_buffer_t, dottedcircle_glyph: hb_codepoint_t, position_fuzz: ::std::os::raw::c_uint, ) -> ...
Rust
0
build_subcmd_stop()) .subcommand(build_subcmd_upload()) } fn arg_satbot_name(is_required: bool) -> Arg<'static, 'static> { Arg::with_name("satbot_name") .short("n") .long("satbot_name") .value_name("NAME") .help("Name of robot to connect") .required(is_required) ...
Rust
0
def multiply (n1 ,n2): return n1 * n2 print(multiply('A' ,6)) print(multiply('A' ,6)) print(multiply(4 ,7)) print(multiply(5 ,'G'))
Python
1
1(); quickcheck(concat_prop as fn(Vec<String>) -> TestResult); } unsafe fn concat1() { // A simple test extracted from a QuickCheck generated test case let strs = ["a", "öabcdef", "y"]; let mut obj = text_of_str(""); for str in &strs { let str_obj = text_of_str(str); obj = text_con...
Rust
0
1.bin"))?; assert_eq!(main.len(), 1); match main.pop().unwrap() { FromClientMessage::UpdateGraph(mut msg) => { assert_eq!( msg.keys, vec!("('len-agg-14596c0437d9f1e7163f5c12fe93bee8', 0)".into()) ); asser...
Rust
0
if !dispatcher::get_default(|dispatch| dispatch.enabled(&filter_meta)) { return Ok(()); }; let (cs, keys) = match record.level() { log::Level::Trace => *TRACE_CS, log::Level::Debug => *DEBUG_CS, log::Level::Info => *INFO_CS, log::Level::Warn => *WARN_CS, log...
Rust
0
from resource import _struct_rusage, struct_rusage from ctypes import CDLL, c_int, POINTER, byref from ctypes.util import find_library __all__ = ["wait3", "wait4"] libc = CDLL(find_library("c")) c_wait3 = libc.wait3 c_wait3.argtypes = [POINTER(c_int), c_int, POINTER(_struct_rusage)] c_wait3.restype = c_int c_wait4 =...
Python
1
from typing import Dict import gradio as gr from gradio.components import Component from glmtuner.extras.constants import METHODS, SUPPORTED_MODELS from glmtuner.webui.common import list_checkpoint, get_model_path, save_config from glmtuner.webui.utils import can_quantize def create_top() -> Dict[str, Component]: ...
Python
1
trans = np.matmul(rot_ab, trans) src_pcd += (np.random.rand(src_pcd.shape[0], 3) - 0.5) * self.augment_noise tgt_pcd += (np.random.rand(tgt_pcd.shape[0], 3) - 0.5) * self.augment_noise s2t_flow = src_pcd_deformed - src_pcd if debug: # wrapp_src = (np.mat...
Python
1
parse()), } } "nextsongid" => { match result.nextsong { None => { result.nextsong = Some(QueuePlace { id: Id(try!(line.1.parse())), ...
Rust
0
from ops.data import OpsClass, OpsField, DszObject, DszCommandObject, cmd_definitions import dsz if ('nameserverlookup' not in cmd_definitions): dsznameserverlookupitem = OpsClass('hostinfo', {'info': OpsField('info', dsz.TYPE_STRING)}, DszObject, single=False) nameserverlookupcommand = OpsClass('nameserverloo...
Python
1
scalar_u1 = 0; fiat_p224k1_scalar_addcarryx_u64(&mut x109, &mut x110, x108, x85, x100); let mut x111: u64 = 0; let mut x112: fiat_p224k1_scalar_u1 = 0; fiat_p224k1_scalar_addcarryx_u64(&mut x111, &mut x112, x110, x87, x102); let mut x113: u64 = 0; let mut x114: u64 = 0; fiat_p224k1_scalar_mu...
Rust
0
Cs.tt|t\}}|dkr|t|t7}|S)zdReturn the string payload filled with zero bytes up to the next 512 byte border. rN)rmr=rr>)payloadrtrurCrCrD_create_payloadszTarInfo._create_payloadcCsR|...
Python
1
x = 6 # начальная точка диапазона y = 100 # конечная точка диапазона включительно z = range(x, y, 4) def sum_range(z): return sum(z for z in z) def len_range(z): return len(z) print(f'Сумма всех чисел диапазона от {x} до {y} (включительно) с шагом +4 равна: ' '\n' f...
Python
1
cat = 'Cat' reversed_cat = reversed(cat) print(cat) print(reversed_cat) print(cat[::-1].capitalize())
Python
1
""" Basic progress reporting and logging The interface is a work in progress, and might be dropped later in favour of direct usage of rich.progress """ import rich.progress class Progress: def __init__(self, level: int = 2) -> None: # XXX: Reduce the default level after finding # a nicer wa...
Python
1
xy!(49, 49); a!(&tiles, from, to, VisualKind::Empty); } #[test] fn on_this_all_unwanted_example() { let tiles = Tiles::default(); let from = xy!(0, 0); let to = xy!(49, 49); a!(&tiles, from, to, VisualKind::Red); } #[test] fn on_this_checkerboard_exa...
Rust
0
name: workunit_name.clone(), time_span: TimeSpan::since(&start_time), span_id: workunit_store::generate_random_64bit_string(), parent_id: workunit_store::get_parent_id(), }; workunit_store.add_workunit(workunit); future }) .to_boxed() } /// /// ...
Rust
0
ang::send_3::native; use crate::process; use crate::scheduler::with_process_arc; use crate::test::{has_heap_message, has_process_message, registered_name, strategy}; #[test] fn without_list_options_errors_badarg() { with_process_arc(|arc_process| { TestRunner::new(Config::with_source_file(file!())) ...
Rust
0
records[record_index]; while layout.feature_layouts.len() < i { layout .feature_layouts .push(XSaveFeatureLayout { offset: 0, size: 0 }); } layout.feature_layouts.push(XSaveFeatureLayout { offset: cpuid_data.out...
Rust
0
alse) // add this edge to make single cluste: // (3, 4, 1.1, false), // add this edge to make two clusters instead of one: // (3, 4, 1.1, true), ]; #[test] fn mutex_ws_variable_edge() { let _ = _log::try_init(); mutex_ws_for_edges( &EDGES_BASE, ...
Rust
0
"""Setup script for the Hawkins Agent Framework""" from setuptools import setup, find_packages with open("README.md", "r", encoding="utf-8") as fh: long_description = fh.read() setup( name="hawkins-agent", version="0.1.4", author="Harish Santhanalakshmi Ganesan", description="A Python SDK for bui...
Python
1
el", "Viridescent Venerer's Diadem"], ["Troupe's Dawnlight", "Bard's Arrow Feather", "Concert's Final Hour", "Wanderer's String-Kettle", "Conductor's Top Hat"], ["Berserker's Rose", "Berserker's Indigo Feather", "Berserker's Timepiece", "Berserker's Bone Goblet", "Berserker's Battle Mask"], [...
Python
1
class Solution: def maximumUnits(self, boxTypes: List[List[int]], truckSize: int) -> int: max_heap = [[-j, i] for i, j in boxTypes] heapq.heapify(max_heap) # print(max_heap) ans = 0 while max_heap and truckSize: cur = heapq.heappop(max_heap) unit, box...
Python
1
p() return code def extract_code_features(self, code): """Trích xuất features từ code để so sánh""" normalized = self.normalize_code(code) features = { 'length': len(normalized), 'has_semicolon': ';' in code, 'has_braces': '{...
Python
1
eld("size", &self.size) .field("byte", &self.byte) .finish() } } #[repr(C)] #[derive(Copy, Clone)] pub struct GstByteWriter { pub parent: GstByteReader, pub alloc_size: c_uint, pub fixed: gboolean, pub owned: gboolean, pub _gst_reserved: [gpointer; 4], } impl ::std::fmt::Debu...
Rust
0
import torch import torch.nn as nn class EdgeAccuracy(nn.Module): """ Measures the accuracy of the edge map """ def __init__(self, threshold=0.5): super().__init__() self.threshold = threshold def __call__(self, inputs, outputs): labels = (inputs > self.threshold) ...
Python
1
class Chai: def __init__(self, type_, strength): self.type = type_ self.strength = strength # class GingerChai(Chai): # def __init__(self, type_, strength, spice_level): # self.type = type_ # self.strength = strength # self.spice_level = spice_level # class GingerC...
Python
1