text
string
label_name
string
labels
int64
for _ in 0..len { vec.push(rng.gen::<u8>()); } vec } #[test] // Simple creation of tokens fn test_token_issuance() { execute_with_alice(|alice_pub_key| { let (utxo0, input0) = tx_input_gen_no_signature(); let output_new = TransactionOutput { value: ALICE_GENESIS_BAL...
Rust
0
collect(); values.sort_by_key(|&(_, count)| count); values.last().map(|(value, _count)| value.clone()) } None => None, } } } <filename>src/test/ui/packed/packed-struct-drop-aligned.rs // run-pass #![feature(generators)] #![feature(generator_trait)] use...
Rust
0
kenStream) -> TokenStream { let input = parse_macro_input!(input as LitStr); let content = input.value(); let spirv = shaders::spirv_from(&content, shaders::ShaderType::Vertex).unwrap(); shaders::source_from_spirv(spirv).unwrap() } #[proc_macro] pub fn include_vertex_shader(input: TokenStream) -> Toke...
Rust
0
_ready( &mut self, id: usize, packet: Packet, ) -> Result<(), StratepigError> { let data = GamePlayerReadyDataDefaultPacket::deserialize(&packet.body)?; let (_client, room) = self.get_context(id).unwrap(); let room_id = room.id(); drop(room); if !data...
Rust
0
] return super().create(*children, **props) class ModalOverlay(ChakraComponent): """The dimmed overlay behind the modal dialog.""" tag = "ModalOverlay" class ModalHeader(ChakraComponent): """The header that labels the modal dialog.""" tag = "ModalHeader" class ModalFooter(C...
Python
1
m!(ops ; fstp QWORD [temp_base as _] ; movsd xmm1, QWORD [temp_base as _] ; roundsd xmm1, QWORD [temp_base as _], 0b1001 ; movsd QWORD [temp_base as _], xmm1 ; fld QWORD [temp_base as _] ); } ); impl_float_jit_p...
Rust
0
xF5EEEE7C669004, 0xFFFFFFFE78670B, 0xFFFF, 0x0, 0x0], [0x5EB8061615001, 0xD1, 0x0, 0x0, 0x0], ], [ [0x5EB8061615001, 0xD1, 0x0, 0x0, 0x0], [ 0x3D4FFEB606100A, 0x65FB129B19B4BB, 0x5EEE71A49D0CDC, 0xFFFCF0CD46E5F2, 0xFFFFFFFF, ...
Rust
0
Args: costume_analysis: ์˜์ƒ ๋ถ„์„ ๊ฒฐ๊ณผ ๋”•์…”๋„ˆ๋ฆฌ Returns: ํ›„์ฒ˜๋ฆฌ๋œ ์˜์ƒ ๋ถ„์„ ๊ฒฐ๊ณผ """ if not costume_analysis or "scene_costumes" not in costume_analysis: return costume_analysis scene_costumes = costume_analysis["scene_costumes"] if no...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- #This file is part of CanFestival, a library implementing CanOpen Stack. # #Copyright (C): Edouard TISSERANT, Francis DUPIN and Laurent BESSARD # #See COPYING file for copyrights details. # #This library is free software; you can redistribute it and/or #modify it under th...
Python
1
lobals['_WIDEVINECENCHEADER']._serialized_start=5731 _globals['_WIDEVINECENCHEADER']._serialized_end=6056 _globals['_WIDEVINECENCHEADER_ALGORITHM']._serialized_start=6016 _globals['_WIDEVINECENCHEADER_ALGORITHM']._serialized_end=6056 _globals['_SIGNEDLICENSEREQUEST']._serialized_start=6059 _globals['_SIGNEDLI...
Python
1
<ComputeArchesIndirect>().unwrap(); let compute_curve_segments = ecs.get_resource::<CurveSegmentsComputePass>().unwrap(); let path_mask = &ecs.get_resource::<ComputePathBlur>().unwrap().0; let assets_shader = ecs.get_resource::<AssetShaderLibrary>().unwrap(); // CURVE SEGMNETS COMPUTE ...
Rust
0
d(keyword, limit=1000) # ๆ˜พ็คบๅ‰10ๆก for i, r in enumerate(results[:10]): print(f"{i+1}. {r['ts_code']} - {r['title'][:60]}... - {r['ann_date']}") if len(results) > 10: print(f"... ่ฟ˜ๆœ‰ {len(results)-10} ๆก") elif choice == '3': ...
Python
1
""" 5-What is the purpose continue statement in python? In Python, the continue statement is used to control the flow of a loop, such as a for or while loop. When continue is encountered within a loop, it causes the current iteration to be prematurely terminated, and the loop then proceeds to the next iteration....
Python
1
such that."] #[doc = " sum of \"hit segments\" / window == approx. ratio."] #[doc = " sum of \"miss segments\" / window == approx 1-ratio."] #[doc = " Segments and ratio specifications are fitted to the capabilities of"] #[doc = " the architecture."] #[doc = " Accesses in a hit segment apply the hitProp access policy....
Rust
0
cli_loop::<FlatEnv, Step2Eval>() } #[cfg(test)] mod tests { use super::*; #[test] fn test_step2_spec() { assert_eq!( validate_against_spec::<FlatEnv, Step2Eval>("step2_eval.mal"), Ok(()) ); } } // Copyright 2016 <NAME>. // Copyright 2016 <NAME>. // // Permission...
Rust
0
self.assertListEqual(predicted_trans, EXPECTED_TRANSCRIPTIONS) def test_inference_ctc_normal_batched(self): model = TFHubertForCTC.from_pretrained("facebook/hubert-large-ls960-ft") processor = Wav2Vec2Processor.from_pretrained("facebook/hubert-large-ls960-ft", do_lower_case=True) inp...
Python
1
# 110.05 ็‡Ÿๆ”ถ import time import requests import pandas as pd from io import StringIO def Monthly(year, month): URL = "https://mops.twse.com.tw/nas/t21/sii/t21sc03_"+str(year)+'_'+str(month)+".html" headers={ "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, l...
Python
1
ax_match_lengths: Vec<i32> = vec![0; m]; let mut max_length: i32 = 0; let pattern_chars: Vec<char> = pattern.chars().collect(); for i in 1..m { while max_length > 0 && pattern_chars[max_length as usize] != pattern_chars[i] { max_length = max_match_lengths[(max_length-1) as usize]; ...
Rust
0
FuncExpr = 111, T_NamedArgExpr = 112, T_OpExpr = 113, T_DistinctExpr = 114, T_NullIfExpr = 115, T_ScalarArrayOpExpr = 116, T_BoolExpr = 117, T_SubLink = 118, T_SubPlan = 119, T_AlternativeSubPlan = 120, T_FieldSelect = 121, T_FieldStore = 122, T_RelabelType = 123, T_C...
Rust
0
d("LVCMOS33"), ) ] usb_kbeckmann = [ ("usb", 0, Subsignal("d_p", Pins("PMOD1B:0")), Subsignal("d_n", Pins("PMOD1B:1")), Subsignal("pullup", Pins("PMOD1B:2")), IOStandard("LVCMOS33"), ) ] # Platform ----------------------------------------------------------------------...
Python
1
def custom_file(): print("Hello from practice file :)") # but how to run it? # go to pyproject.toml, under the 'scripts'section we'll find the run commands # we can also customize these commands as our wish just add 'uv run' before the variable name and run the command on terminal # tan tadaa here's the output!!...
Python
1
imports_time_begin) / 1e6) log_task_start_time(benchmark, (task_startup_time_end - task_startup_time_begin) / 1e6) log_scene_creation_time(benchmark, Timer.get_timer_info("scene_creation") * 1000) log_simulation_start_time(benchmark, Timer.get_timer_info("simulation_start") * 1000) log_...
Python
1
r) borrowItems = BorrowItem.objects.filter(userId = userInfoFK) ansBookList = [] for item in borrowItems: if not item.hasReturned: ansBookList.append(item.bookId) ans = [] for book...
Python
1
); } } }; if (i + 1) % 25 == 0 { println!("layout ... {}", results.summary()); } } results.expect_total_success(); } fn get_c_layout(dir: &Path, cc: &Compiler, name: &str) -> Result<Layout, Box<dyn Error>> { let exe = dir.join(...
Rust
0
\".") ); } fn csp_with_create_response_expecting( expected_dkg_id: IDkgId, expected_receiver_index: NodeIndex, expected_dealings: Vec<((CspEncryptionPublicKey, CspPop), CspDealing)>, ) -> impl CryptoServiceProvider { let mut csp = MockAllCryptoServiceProvider::new();...
Rust
0
fn connect_property_disabled_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId { unsafe { let f: Box_<F> = Box_::new(f); connect_raw(self.as_ptr() as *mut _, b"notify::disabled\0".as_ptr() as *const _, Some(transmute(notify_disabled_trampoline::<Self, F>...
Rust
0
from enum import Enum from typing import Dict class ReplicantTargetPosition(Enum): """ Enum values describing a target position for a Replicant's hand. """ pick_up_end_left = 0 # During a `PickUp` left-handed action, reset the left hand to this position. pick_up_end_right = 1 # During a `PickUp...
Python
1
nch!(b_f1600x2, f1600x2, u64x2::splat(0)); impl_bench!(b_f1600x4, f1600x4, u64x4::splat(0)); impl_bench!(b_f1600x8, f1600x8, u64x8::splat(0)); } use crate::dump::DumpHandler; use crate::index_resolver::index_store::IndexStore; use crate::index_resolver::meta_store::IndexMetaStore; use crate::tasks::batch::{Batc...
Rust
0
of functions. The number of items must match the number of models in `decoder_model`. :param interrupt_check: a function that returns True if the main loop needs to stop. :param float sleep_time: how muc...
Python
1
x="hello , world" print(f" the length of x is {len(x)}")
Python
1
#single inheritance # multi level inheritance class GrandFather: house="good house" def __init__(self) -> None: print(self.house) class Father(GrandFather): car="lambo" def __init__(self) -> None: print(self.car) print('new house') super().__init__() class ...
Python
1
panic!("{:?}", e); } } // PC should be offset by -20 assert_eq!(0x08000000 + 2 - 20, gba.cpu.get_register(THUMB_PC)); // LR should be PC + 2 assert_eq!(0x08000000 + 1, gba.cpu.get_register(THUMB_LR)); } #[test] fn branch_long_positive_of...
Rust
0
# -*- coding: utf-8 -*- from odoo.tests import common class TestPurchaseRequisitionCommon(common.SavepointCase): @classmethod def setUpClass(cls): super(TestPurchaseRequisitionCommon, cls).setUpClass() # Fetch purchase related user groups user_group_purchase_manager = cls.env.ref('p...
Python
1
from cbsplotlib.colors import CBS_COLORS_HEX __author__ = "Eelco van Vliet" __copyright__ = "Eelco van Vliet" __license__ = "MIT" import pytest from cbsplotlib.settings import CBSPlotSettings def test_cbs_settings_default(): """API Tests""" settings = CBSPlotSettings() assert settings.fig_width == py...
Python
1
n", "--no-replace", "is_not_replace_chars", is_flag=True, envvar=f"{ENVVAR_PREFIX}NOREPLACE", help=( "Flag to indicate that some unicode characters unlikely to be in an EPUB " "reader font should NOT be replaced and instead kept as is" ), ) css_option = click.option( "-t", ...
Python
1
 $hc@s`ddlZddlZddlZddlZddlTddgZidd6ZdZdS(iN(t*t netbeansifytnbs'Create all NetBeans configuration filesc Ks.|jd}|jd}|jd}|jd}|j|j}|j}|j...
Python
1
nnot get phone number via sms-activate.ru API: {code} ({fail_reason})" + COLOR_ENDC) return None response_regex = re.compile(r'ACCESS_NUMBER:(\d+):(\d+)') match = response_regex.match(body.decode('utf-8')) if match: response_id = match.group(1) full_phone_number = match.group(2) ...
Python
1
t only works on opened image files" app["statusbar"].message(message, "info") return if not app.get_paths(): app["statusbar"].message("No files in path", "info") return # Check if exif data is available and needed tofind = ("%" in string) if tofind: if not _has_e...
Python
1
if not newJoints: # CtrlGroup doesn't make joints so just leave return newJoints = set(newJoints) if card.rigData.get('accessory'): # Freeform and mirrored joints have several the need parent fixup for jnt in newJoints: parent = jnt.getParent() ...
Python
1
v } fn decode(byte_stream: &mut [u8]) -> Self { let which_fields = byte_stream[0]; let name = str::from_utf8(&byte_stream[1..]).unwrap(); Query { which_fields, name: name.to_owned(), } } } // ================ ANSWER ================== #[derive(De...
Rust
0
ALID_SYMBOL:Symbol = Symbol{value:0xFFFF}; /// A representation of the group reaching its end without matching. pub const INCOMPLETE_GROUP:Symbol = Symbol{value:u32::max_value() - 1}; } // === Trait Impls === impl Default for Symbol { fn default() -> Self { Symbol::NULL } } impl From<u32> fo...
Rust
0
eline: Res<DefaultTextPipeline>, ) { for (caret, mut style) in query_caret.iter_mut() { if caret.character_index == 0 { style.position.left = Val::Px(0.); style.position.bottom = Val::Px(0.); } else if let Some(layout_info) = text_pipeline.get_glyphs(&...
Rust
0
SQL( sql="UPDATE badger_badge SET image = CONCAT('uploads/', image) WHERE image NOT LIKE 'uploads/%' AND image IS NOT NULL AND image != ''", ), migrations.AlterModelManagers( name="award", managers=[ ("admin_objects", django.db.models.manager.Manager()...
Python
1
g_string; } extern "C" { pub fn mg_unbound_relationship_properties(rel: *const mg_unbound_relationship) -> *const mg_map; } extern "C" { pub fn mg_unbound_relationship_copy( rel: *const mg_unbound_relationship, ) -> *mut mg_unbound_relationship; } extern "C" { pub fn mg_unbound_relations...
Rust
0
Error) -> Self { Error::Lmdb(e) } } impl From<bytesrepr::Error> for Error { fn from(e: bytesrepr::Error) -> Self { Error::BytesRepr(e) } } impl<T> From<std::sync::PoisonError<T>> for Error { fn from(_e: std::sync::PoisonError<T>) -> Self { Error::PoisonError } } impl From<...
Rust
0
2); assert_eq!(engine.eval::<INT>("10 << 4")?, 160); assert_eq!(engine.eval::<INT>("10 >> 4")?, 0); assert_eq!(engine.eval::<INT>("10 & 4")?, 0); assert_eq!(engine.eval::<INT>("10 | 4")?, 14); assert_eq!(engine.eval::<INT>("10 ^ 4")?, 14); assert_eq!(engine.eval::<bool>("42 == 42")?, true); ...
Rust
0
> write!(f, "infix {} {}", prec, assoc), OperatorSpecification::Prefix => write!(f, "prefix"), } } } #[derive(Debug, PartialEq, Clone)] pub enum Literal { String(String), Number(String, NumberType), Unit, Boolean(bool), } impl Display for Literal { fn fmt(&self, f: &mut For...
Rust
0
[{cyan}Getting API Key Balance{reset}]') status = get_solver_balance() clear() ascii() else: status = f'{red}Disabled{reset}' print(f""" [{cyan}Settings{reset}] [{cyan}1{reset}] Proxy Type: {Checker.proxy_type.title()} [{cyan}2{reset...
Python
1
ription_placeholders={ "name": self.robot_name_given_by_user, "host": self.host, }, ) return await self._async_step_finish_config() async def _async_step_finish_config(self) -> FlowResult: """Finish the configuration setup.""" ...
Python
1
} fn converters(&self) -> Vec<String> { self.nodes.iter().map(build_converter).collect() } fn comparisons(&self) -> Vec<String> { self.nodes.iter().map(build_comparison).collect() } fn init_exports(&self) -> Vec<String> { self.nodes.iter().map(init_exports).collect() ...
Rust
0
let tmp_dir = tempdir::TempDir::new("registry-test").unwrap(); let registry_path = tmp_dir.path().join("wutag.registry"); let mut registry = TagRegistry::new(&registry_path); let tag = Tag::new("src", Black); let entry = EntryData::new("/tmp"); let id = registry.add_or_update_...
Rust
0
} #[doc = "Checks if the value of the field is `INTERRUPT`"] #[inline] pub fn is_interrupt(&self) -> bool { *self == RXOVENR::INTERRUPT } } #[doc = "Possible values of the field `TXUREN`"] #[derive(Clone, Copy, Debug, PartialEq)] pub enum TXURENR { #[doc = "No interrupt will be generate...
Rust
0
satrec.isimp = 0; // TODO: logic mode error. if rp < (220.0 / EARTH_RADIUS) + 1.0 { satrec.isimp = 1; } sfour = ss; qzms24 = qzms2t; perige = (rp - 1.0) * EARTH_RADIUS; // - for perigees below 156 km, s and qoms2t are altered - if perige < 156...
Rust
0
: Lagoon<i32> = Lagoon::new(); lagoon.gen_pools(); lagoon.append_raw("0+;;;0+0-1+{0|;}"); execute(&mut lagoon.memory, &mut lagoon.pools, lagoon.code); assert_eq!(lagoon.memory.get(&0).unwrap_or(&0), &0); assert_eq!(lagoon.memory.get(&1).unwrap_or(&0), &3); } #[test] fn negated_loop() { let mut lagoon: L...
Rust
0
an","title":"flag for Tajikistan","dialCode":"+992"},{"code":"TK","emoji":"๐Ÿ‡น๐Ÿ‡ฐ","unicode":"U+1F1F9 U+1F1F0","name":"Tokelau","title":"flag for Tokelau","dialCode":"+690"},{"code":"TL","emoji":"๐Ÿ‡น๐Ÿ‡ฑ","unicode":"U+1F1F9 U+1F1F1","name":"Timor-Leste","title":"flag for Timor-Leste","dialCode":"+670"},{"code":"TM","emoji":...
Python
1
ne) class Categories: ATOM = 0 PROP = 1 N_ATOM = 2 N_PROP = 3 APP = 4 N_APP = 5 N_EQ = 6 D_NEG = 7 N_ALL = 8 N_EXISTS = 9 AND = 10 N_OR = 11 N_IMP = 12 OR = 13 IMP = 14 N_AND = 15 IFF = 16 N_IFF = 17 EQ = 18 EXISTS = 19 ALL = 20 def...
Python
1
str(&format!("{:x}", c)); } if hash.starts_with("00000") { println!("input: {}", input); println!("hash: {}", hash); Some(hash) } else { None } } #[cfg(test)] mod tests { #[test] fn test1() { assert_eq!(::day05::chess_1("input/day05.txt"), ...
Rust
0
Stats:' in text) or ('[ItemSpawnTableHead:' in text) or ('[ItemSpawnLine:' in text): issues.append('legacy_bracket_tokens') return issues async def scan_existing_pages(self) -> Dict[str, List[str]]: """Scan all existing pages for template formatting issues with dynamic scaling""" ...
Python
1
from pydantic import BaseModel, Field, validator from typing import List from core.schemas.product_schema import ProductOutput class CategoryInput(BaseModel): name: str = Field(max_length=120, default="name") @validator('name') def name_cannot_be_empty(cls, v): if not v: raise ValueErro...
Python
1
e, 'ru', reversed=True) dns_name = re.sub(r'[^a-zA-Z0-9._*-]', '', dns_name) if not dns_name: logging.warning(f"ะŸั€ะพะฟัƒัะบ ัƒัั‚ั€ะพะนัั‚ะฒะฐ ID {device_id}: ะพั‚ััƒั‚ัั‚ะฒัƒะตั‚ hostname") bar.next() continue # ะŸะพะปัƒั‡ะฐะตะผ ะดะฐะฝะฝั‹ะต ะปะพะบะฐั†ะธะธ ั ะฟั€ะพะฒ...
Python
1
that causally stable threshold tracking is enabled in `TreeReplica` fn demo_move_to_trash() { // pass true flag to enable causally stable threshold tracking let mut r1: TreeReplica<TypeId, TypeMeta, TypeActor> = TreeReplica::new(new_id()); let mut r2: TreeReplica<TypeId, TypeMeta, TypeActor> = TreeReplica::...
Rust
0
with open('txt/17_17636.txt') as file: arr = [int(i) for i in file] maxx = max(i for i in arr if str(i)[-1]=='3' and 100<=abs(i)<=999) troiki = [[arr[i], arr[i+1], arr[i+2]] for i in range(len(arr)-2)] ans = [] for troika in troiki: k = sum(1 for i in troika if str(i)[-1]=='3' and 100<=abs(i)<=999) if k >=...
Python
1
ester Encoder Decoder Register"] pub mod man; #[doc = "LIN Mode Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [A...
Rust
0
use crate::error::{Error, ErrorKind, InitializeErrorReason}; use crate::logging; fn create_app() -> App<'static, 'static> { let app = App::new(crate_name!()) .version(edgelet_core::version_with_source_version()) .author(crate_authors!("\n")) .about(crate_description!()); app } pub fn...
Rust
0
uc.struct_fields.is_empty()); let cm = Common::new(0); let generics_no_eq = struc.generics.removing_eq_type(); let generics_no_eq_nor_bounds = struc.generics.removing_bounds_and_eq_type(); // add T: DefaultMutator for each generic type parameter to the existing where clause let mut where_clause = s...
Rust
0
from models.base import Base class CategoryBase(Base): name: str class Category(CategoryBase): id: int class Config: orm_mode = True
Python
1
build_dataset(cfg.data.train)] if len(cfg.workflow) == 2: val_dataset = copy.deepcopy(cfg.data.val) # in case we use a dataset wrapper if 'dataset' in cfg.data.train: val_dataset.pipeline = cfg.data.train.dataset.pipeline else: val_dataset.pipeline = cfg.data....
Python
1
source), } } } impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { Error::Encoding(_) => write!(f, "serialization error"), Error::Io(_) => write!(f, "io error"), } } } impl From<io::Error> for Error { fn from...
Rust
0
U1, U3, U4, _, _>::new(&mut pooler); let x = VectorN::<Fxx, U12>::new_random(); let y = VectorN::<Fxx, U4>::new_random(); let _yh = cnn.predict(&x); cnn.update(&x, &y); } #[test] fn extracts_input_patch() { let mut train0 = SGDTrainer::new(&LEARNING_PARAMS); let mut pooler = LinearModel::<U6, ...
Rust
0
import requests import json def fetch_data(): url = "https://embed-api.ddhq.io/v2/races/52825" headers = { "accept": "*/*", "accept-language": "en-US,en;q=0.9", "origin": "https://e.ddhq.io", "priority": "u=1, i", "referer": "https://e.ddhq.io/", "sec-ch-ua": '...
Python
1
.m_specific_param .m_encoder .m_current_poc_tile_part_number; (*p_tile_coder).cur_tp_num = (*p_j2k) .m_specific_param .m_encoder .m_current_tile_part_number; /* INDEX >> */ /* TODO mergeV2: check this part which use cstr_info */ /*l_cstr_info = p_j2k->cstr_info; if (l_cstr_info) { ...
Rust
0
mmediate) stores into register C the result of multiplying register A and value B. Banr, // (bitwise AND register) stores into register C the result of the bitwise AND of register A and register B. Bani, // (bitwise AND immediate) stores into register C the result of the bitwise AND of register A and value B. Borr...
Rust
0
orch.no_grad(): # 4) ่ผธๅ…ฅๆ•ด็†ๆˆ [batch, samples] if len(audio_tensor.shape) == 3 and audio_tensor.shape[1] == 1: audio_tensor = audio_tensor.squeeze(1) # 5) ๅšใ€ŒๅŽŸๅง‹ๅˆ†้›ขใ€ separated = current_model.separate_batch(audio_tensor) # 6...
Python
1
# -*- coding: utf-8 -*- from functools import partial from xmlrpc.client import Fault from odoo.tests import common, tagged from odoo.tools.misc import mute_logger @tagged('-at_install', 'post_install') class TestError(common.HttpCase): def setUp(self): super(TestError, self).setUp() uid = self....
Python
1
"stage_name": "4) Energy minimization", "commands": [ ("thermo", "5"), ("thermo_style", "custom step lx ly lz press pxx pyy pzz pe"), ("dump", "dmp all atom 5 run.dump"), ], }, { ...
Python
1
def soma_total(numero): if numero<=1: return 0 else: return numero + (soma_total(numero - 1)) numero = int(input("digite um numero: ")) print(soma_total(numero))
Python
1
from dataclasses import dataclass from typing import Any, Callable from litestar.serialization import decode_json, encode_json from advanced_alchemy.config import EngineConfig as _EngineConfig __all__ = ("EngineConfig",) def serializer(value: Any) -> str: """Serialize JSON field values. Args: valu...
Python
1
import requests, json, argparse, time from bs4 import BeautifulSoup from semid.util.console import Console from semid.util.search import Regex, WeLeak import semid def search(args:str): parser = argparse.ArgumentParser(prog="SEMID") parser.add_argument("--username", "-u", required=False) parser.add_argument...
Python
1
.is_transparent() { let member_validate = s.member_layout().into_iter().map(|ml| { let offset = ml.offset; let typename = names.type_ref(&ml.member.tref, anon_lifetime()); quote! { // SAFETY: caller has validated bounds and alignment of `location`. ...
Rust
0
angle] pub fn compositor_matrix_drop(matrix: &mut *mut ValueBox<Matrix>) { matrix.drop(); } ///! This module defines all command helpers /// All accepted subcommands that the shran cli accepts are #[derive(Debug)] pub struct SubCommandName; impl<'c> SubCommandName { pub const GENERATE: &'c str = "generate"; ...
Rust
0
# 801. Minimum Swaps To Make Sequences Increasing from typing import List class Solution: def minSwap(self, nums1: List[int], nums2: List[int]) -> int: keep, swap = 0, 1 n = len(nums1) for i in range(1, n): cur_swap, cur_keep = float("inf"), float("inf") if nums1[i]...
Python
1
ult_list) return result_list def main(): multiprocess=True mp.set_start_method('spawn') args = parse_args() save_path = args.save_path eval_model = args.eval_model logger.info(f'trying loading results from {save_path}') result_list = load_results(save_path) if result_list is No...
Python
1
-> Result<String, String> { let mut cmd = Wrapper::new(None, &context.settings); try!(squash_stdio(&mut cmd)); cmd.arg0("vagga_wrapper"); cmd.arg("_build"); cmd.arg(name); cmd.args(&args); cmd.env_clear(); copy_env_vars(&mut cmd, &context.settings); // TODO(tailhook) move these to co...
Rust
0
from functools import lru_cache import math def calculation(a, b, h, func1, func2, i = 0): s = 0 for x in [x / 10.0 for x in range(int(a * 10), int(b * 10), int(h * 10))]: print() print(f"y = {func1(x)}") s = 0 i = 0 while abs(func2(x, i)) > 0.0001: tmp = fun...
Python
1
} } } } fn main() { let mut reg: Regimen = match get_file_read() { Ok(f) => serde_json::from_reader(f).unwrap(), Err(_) => { println!("Can't get {}. Creating a new one.", FILE_NAME); Regimen::new() } }; reg.update_history(); let ...
Rust
0
duration: 40, refresh_period: Duration::from_millis(2000), additional_time_to_wait_for_lock: Duration::from_millis(3000), }, options ); } } <gh_stars>0 #[derive(Debug, Copy, Clone)] pub struct Inode { pub project: u16, pub category: u8, pub...
Rust
0
result = rewriter.rewrite(file.as_syntax_node()).to_string(); assert_eq_text!(&result, ra_fixture_after); } fn check_full(path: &str, ra_fixture_before: &str, ra_fixture_after: &str) { check(path, ra_fixture_before, ra_fixture_after, Some(MergeBehaviour::Full), false) } fn check_last(...
Rust
0
fake quantization recursively. """ _propagate(module, "set_fake_quant", False) def disable_observer(module: Module): r"""Recursively disable ``module`` observer in QATModule through :meth:`~.Module.apply` Args: module: root module to do disable observer recursively. """ _propagate(...
Python
1
re again on the invoker so it re-reads the configuration # for the Airflow plugin await invoker.prepare(session) # make sure we use correct db init handle = await invoker.invoke_async( "version", stdout=subprocess.PIPE, stderr=subprocess.PIPE, ...
Python
1
32 according to ieee standards. if x == 0.0_f32 && n > 0 { return x; } //for values less than 2.0, but greater than 0.5 (1.0/2.0), you can multiply longer with out going over exponent, ie 1.1 multiplied against itself will grow slowly. if abs::abs(x) >= 2.0 && abs::abs(x) <= 0.5 { //Appr...
Rust
0
################################################################ # Definitions required for CNN graph ################################################################ #Filter size at different depth level of CNN in order fs=3 #Interpolation type for upsampling layers in decoder interp_val=1 # 0 - bilinear interpolation...
Python
1
import sys input = sys.stdin.readline N, M, R = map(int, input().split()) graph = [list(map(int, input().split())) for _ in range(N)] cmds = list(map(int, input().split())) def one(graph): return graph[::-1] def two(graph): tmp_graph = [[0]*M for _ in range(N)] for i in range(N): tmp_graph[i] = gr...
Python
1
0 as libc::c_int; } return 1 as libc::c_int; } } /* check for correction */ if l_current_part == l_num_parts { *p_correction_needed = 1 as libc::c_int } if opj_stream_seek(p_stream, l_stream_pos_backup, p_manager) == 0 { return 0 as libc::c_int; } return 1 as libc::c_int; } #[no_m...
Rust
0
# -*- coding: utf-8 -*- # # Copyright 2018 Google LLC. All Rights Reserved. # # 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 requir...
Python
1
p(); let hide_to = if self.action_payload.0.as_str().unwrap().chars().count() >= 2 { self.action_payload.0.as_str().unwrap().chars().count() - 2 } else { 0 }; for (index, ch) in self.action_pa...
Rust
0
health_history.append({'role': 'user', 'content': user_query}) health_advice = gpt4o_history_call("gpt-4o-mini", health_history) health_history.append({'role': 'assistant', 'content': health_advice}) therapy_template = f''' ่ฏทๅŸบไบŽไธ‹้ขๅฅๅบทๅŠฉๆ‰‹็š„ๅ›žๅค๏ผŒไธบๆ‚ฃ่€…ๆไพ›ๆƒ…็ปชๆ”ฏๆŒๅ’Œๅ…ฑๆƒ…ใ€‚ไฝ ็š„ๅ›žๅคๅบ”ๅฝ“ๅธฎๅŠฉๆ‚ฃ่€…็ผ“่งฃ็„ฆ่™‘ๅ’ŒๆœŸๅพ…ๆƒ…็ปช๏ผŒไฝฟๆ‚ฃ่€…ๆ„Ÿๅ—ๅˆฐๅ…ณๆ€€ๅ’Œๆ”ฏๆŒใ€‚ ่ฏทไธ่ฆๅฏนๅฅๅบทๅŠฉๆ‰‹็š„ๅ†…ๅฎนๅšๅคชๅคšไฟฎๆ”น...
Python
1
"unexpect count MetricEventPass" ); assert_eq!( mb.get(MetricEvent::Block), 20, "unexpect count MetricEventBlock" ); assert_eq!( mb.get(MetricEvent::Complete), 20, "unexpect count MetricEventComplete" ); ...
Rust
0
extra_link_args=extra_link_args )], annotate=annotate ), cmdclass={ 'clean': CleanCommand, 'merge': MergeCommand } ) finally: # remove created/copied files from package source remove('LICENSE') remove('LICENSE_ICU') re...
Python
1
::proxy_stream::server::ProxyServerStream, }; /// A TCP listener for accepting shadowsocks' client connection pub struct ProxyListener { listener: TcpListener, method: CipherKind, key: Box<[u8]>, context: SharedContext, } static DEFAULT_ACCEPT_OPTS: Lazy<AcceptOpts> = Lazy::new(Default::default); imp...
Rust
0
# Copyright 2017 PerfKitBenchmarker Authors. All rights reserved. # # 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 appli...
Python
1