text string | label_name string | labels int64 |
|---|---|---|
#Programa 4.6 "Programa que utilice una función para realizar operaciónes matematicas basicas"
#Elaborado el 14/11/2024
#Elaborado por : Evelyn Jocelyn León de Luna
def operaciones(num1,num2,digitos):
suma = num1 + num2
resta = num1 - num2
multiplicación = num1 * num2
division = float(num1/num2)
m... | Python | 1 |
SerializationError> {
if let Some(var_29) = &input.audio {
let mut object_30 = object.key("Audio").start_object();
crate::json_ser::serialize_structure_crate_model_audio_artifacts_configuration(
&mut object_30,
var_29,
)?;
object_30.finish();
}
if let ... | Rust | 0 |
from elasticsearch import Elasticsearch
from dotenv import load_dotenv
import os
import json
load_dotenv()
ELASTIC_PASSWORD = os.getenv("ELASTIC_PASSWORD")
ELASTIC_USERNAME = os.getenv("ELASTIC_USERNAME")
es = Elasticsearch(
"http://localhost:9200",
basic_auth=(ELASTIC_USERNAME, ELASTIC_PASSWORD)
)
if not e... | Python | 1 |
ert_eq!(FIELD_OFFSET!(PEB, u), 88);
assert_eq!(FIELD_OFFSET!(PEB, SystemReserved), 96);
assert_eq!(FIELD_OFFSET!(PEB, AtlThunkSListPtr32), 100);
assert_eq!(FIELD_OFFSET!(PEB, ApiSetMap), 104);
assert_eq!(FIELD_OFFSET!(PEB, TlsExpansionCounter), 112);
assert_eq!(FIELD_OFFSET!(PEB, TlsBitmap), 120);
... | Rust | 0 |
# Generated by Django 3.2.20 on 2023-09-01 14:51
import uuid
import django.core.serializers.json
import django.db.models.deletion
import nautobot.extras.models.mixins
import nautobot.extras.models.statuses
import taggit.managers
from django.db import migrations, models
class Migration(migrations.Migration):
dep... | Python | 1 |
from scrapy.crawler import CrawlerProcess
from scrapy.settings import Settings
from betscraper.spiders import spider_betano, spider_betx, spider_forbet, spider_fortuna, spider_kingsbet, spider_merkur, spider_sazka, spider_synottip, spider_tipsport
from betscraper.spiders import spider_betano_detail, spider_betx_detail,... | Python | 1 |
(ops)).with_tags(tag)
c_expected = cirq.Circuit(
_wrap_in_cop([h_cz_y, cirq.Y(q[1])], '1'),
cirq.Moment(cirq.X(q[0]).with_tags("ignore")),
cirq.CircuitOperation(cirq.FrozenCircuit(h_cz_y)).repeat(6).with_tags("ignore"),
_wrap_in_cop([cirq.CNOT(*q), cirq.CNOT(*q)], '2'),
cirq... | Python | 1 |
ynesis::passport::Passport,
}
struct Sims {
rng: ChaChaRng,
sims: BTreeMap<String, Sim>,
}
impl Sim {
pub fn blocks(&self) -> PassportBlocks<Vec<u8>> {
let mut blocks = PassportBlocks::new();
for block in self.passport.blocks() {
blocks.p... | Rust | 0 |
"""
This code is for aggregating the results obtained over 3 runs.
"""
import os, json
from collections import defaultdict
import numpy as np
final_results = defaultdict(list)
for model_path in ["pretrain_data_paraphrase_comparative", "pretrain_data_paraphrase_comparative_seed33", "pretrain_data_paraphrase_comparative... | Python | 1 |
#
# Author: Jay Deiman
# Email: admin@splitstreams.com
#
# This file is part of pylibgal3.
#
# pylibgal3 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
# ... | Python | 1 |
] * len(query)
for dev_id in range(core.get_xpu_device_count()):
utilization_xpu = core.get_xpu_device_utilization_rate(dev_id)
mem_total = (
core.get_xpu_device_total_memory(dev_id) / 1024 / 1024
) # with MB
mem_used = (
core.get_xpu_device_used_memory(dev_... | Python | 1 |
let mut scope = Scope::new();
scope.push_constant("x", 42 as INT);
assert!(matches!(
*engine.run_with_scope(&mut scope, "x = 1").expect_err("expects error"),
EvalAltResult::ErrorAssignmentToConstant(x, _) if x == "x"
));
Ok(())
}
#[cfg(not(feature = "no_object"))]
#[test]
fn test_cons... | Rust | 0 |
##修改部分为第七步模型结构####
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# 上分思路\n",
"- 数据\n",
"- 模型\n",
"- 损失函数\n",
"- 训练方式\n",
"- 超参数"
]
},
{
"cell_type": "markdown",
"metadata": {
"jp-MarkdownHeadingCollapsed": true,
"tags": []
},
"source":... | Python | 1 |
]
extern crate serde_json;
mod ffi;
pub mod mpz;
pub mod mpq;
pub mod mpf;
pub mod rand;
pub mod sign;
#[cfg(test)]
mod test;
<filename>src/utils.rs
use num::Float;
use cpython::{FromPyObject, PyObject, PyResult, Python};
use ordered_float::{NotNaN, OrderedFloat};
#[inline]
crate fn pylist_to_vec<T>(py: Python<'_>,... | Rust | 0 |
trides[1] + 1
W = (W - ks[1] + 2*pd) // strides[1] + 1
ret.extend([[C, H, W]] * (2*n))
# Second block (only first layer may have stride).
C = fs[2]
H = (H - ks[0] + 2*pd) // strides[2] + 1
W = (W - ks[1] + 2*pd) // strides[2] + 1
ret.extend([[C, H, W]] * (2*n))
... | Python | 1 |
pub fn try_add_custom_storage<S: 'static + UnknownStorage + Send + Sync>(
&self,
storage_id: StorageId,
storage: S,
) -> Result<(), error::Borrow> {
let _ = self
.all_storages
.try_borrow()?
.custom_storage_or_insert_by_id(storage_id, || storag... | Rust | 0 |
#!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from typing import Set, Optional
from collections import namedtuple
# set is an OptionalSet as below
NamedOptionalSet = namedtuple("NamedOptionalSet", ["name", "set"])
class OptionalSet:
def __init__(self, set: Optional[Set] = None):... | Python | 1 |
WlOutput, ()>,
D: AsMut<DelegateToMe>,
{
fn bind(
_state: &mut D,
_handle: &DisplayHandle,
_client: &Client,
_resource: New<wl_output::WlOutput>,
_global_data: &(),
_data_init: &mut DataInit<'... | Rust | 0 |
import openai
from openai import OpenAI
from tenacity import retry, stop_after_attempt, wait_exponential
from common.settings import settings
openai_client = OpenAI(api_key=settings.openai_api_key)
@retry(
stop=stop_after_attempt(0), wait=wait_exponential(multiplier=1, min=4, max=10)
)
def response(messages: list... | Python | 1 |
AppSettings, ErrorKind, };
/// let result = App::new("prog")
/// .setting(AppSettings::ArgRequiredElseHelp)
/// .subcommand(App::new("config")
/// .about("Used for configuration")
/// .arg(Arg::new("config_file")
/// .help("The configuration file to use")))
... | Rust | 0 |
}
fn increment_energy_level(&mut self) -> FlashOption {
self.energy_level = self.energy_level + 1;
if self.energy_level > FLASH_ENERGY_LEVEL {
self.energy_level = RESET_ENERGY_LEVEL;
return FlashOption::Flahsed;
}
return FlashOption::NotFlashed;
}
}
i... | Rust | 0 |
x5c\x13\xb7\xcc4\x99\x8a\xab5\x0f\xcaQ\xb7\xa9I\
\x9b\xe79\xf7\x1e\x8e\xb8w\xef\x1e\xf1tJUU\x94\
V\xd2U\xf8\xd6su}\xcd\xf3\x9b\xe7\xac\x8b\x82s\
s+\x88\x8a\x9d\xb2^\xafyy]\xb3X.\xb9\xdf\
\x1d\x93\xe79\xae[sss\xc3A\xd2I\x1e\xc0\x89\
X\xf9uTJ\xfe\xbf\xf1)i\x9a2\x8d\x0f\xa9\xeb\
\x9a\x8bE\x15\x04]\xc9z\xb5Fu\xa2\xbc\x98\x... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of the PsychoPy library
# Copyright (C) 2012-2020 iSolver Software Solutions (C) 2021 Open Science Tools Ltd.
# Distributed under the terms of the GNU General Public License (GPL).
import psychopy.logging as logging
try:
from psychopy_eyetracker_sr_research.sr_research.eyelink.eyetr... | Python | 1 |
# Retrieve loss values
for k in loss_keys:
epoch_val_losses[k] += float(val_losses[k])
if val_step == 0:
val_outs_summary = outputs
# Write validation loss values in Tensorboard
... | Python | 1 |
"""Tests for: Node for circular doubly linked list"""
import pytest
from robotpuzzle.node import Node
@pytest.mark.initial
@pytest.mark.node
def test_initial_repr(new_node):
"""Test initial repr"""
cur_count = f"{Node.count - 1:03d}"
assert repr(new_node) == f"Node({cur_count}, False, None, {cur_count}, ... | Python | 1 |
output.stdout);
let stderr = String::from_utf8_lossy(&output.stderr);
println!("Stdout:\n{}\nStderr:\n{}\n", stdout, stderr);
panic!("Running C tests failed with non-zero return code");
}
}
#[test]
fn c_tests_integration_run_console_logger() {
c_tests_run("./integration", Some("console"... | Rust | 0 |
_len == 0 {
p
} else {
p / (min_len as u64)
};
let mut start = 0;
let mut end = min_len;
let mut sum = ps.iter().take(min_len).sum::<u64>();
loop {
let len = end - start;
if sum > max_avg * (len as u64) {
return None;
}
match sum.cmp... | Rust | 0 |
data_points_1_1[0].start_time_unix_nano,
)
self.assertNotEqual(
data_points_0_1[1].start_time_unix_nano,
data_points_1_1[1].start_time_unix_nano,
)
self.assertEqual(
data_points_0_0[0].time_unix_nano,
data_points_1_0[0].start_time_uni... | Python | 1 |
'])
df = df.sort_values('Date').reset_index(drop=True)
df['stage1_target'] = (df['FullTimeResult'] == 'D').astype(int)
df['stage2_target'] = df['FullTimeResult'].map({'H': 0, 'A': 1})
# Temporal split
cutoff_date = pd.to_datetime('2023-05-01')
train_df = df[df['Date'] < cutoff_date].copy()
... | Python | 1 |
class Settings():
"""A class to store all settings for Alien invasion"""
def __init__(self):
"""Initialize the game's static settings"""
# Screen Settings
self.screen_width = 1440
self.screen_height = 790
self.bg_color = (3, 10, 50)
# Ship settings
self.ship_limit = 2
# Bullet settings
self.bulle... | Python | 1 |
self.dir_text_label.setText(_translate("PDFdir", "目录文本"))
self.space_level_box.setText(_translate("PDFdir", "以空格分层"))
self.dir_text_edit.setHtml(
_translate(
"PDFdir",
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/s... | Python | 1 |
pub biome_color: InnerColor,
}
impl BlockProps {
pub fn new() -> Self {
BlockProps {
air: true,
water: false,
waterlogged: false,
biome_color: InnerColor::None,
}
}
pub fn new_from<'a, I: Iterator<Item = &'a str>>(name: &'a str, state: I)... | Rust | 0 |
Address
pub fn address(&self) -> Address {
match self {
KeyPair::Secp256k1(private_key) => private_key.address(),
#[cfg(feature = "ed25519")]
KeyPair::Ed25519(private_key) => private_key.address(),
KeyPair::Sm2(private_key) => private_key.address(),
... | Rust | 0 |
class Student:
status = '쉬는 중'
def __init__(self, kor, eng, math):
self.kor = kor
self.eng = eng
self.math = math
@staticmethod
def print_start_time_of_study():
print("9시 땡")
Student.status = '공부 중'
han = Student(0, 0, 0)
hong = Student(0, 0, 0)
print(Student.... | Python | 1 |
Palette::new(&[
Rgb([0, 0, 0]),
Rgb([187, 187, 0]),
Rgb([255, 187, 0]),
Rgb([255, 255, 0]),
Rgb([255, 255, 136]),
Rgb([255, 255, 255]),
]),
Self::Snow => {
Palette::new(&[Rgb([0, 0, ... | Rust | 0 |
, c12: 25.0, c22: 27.0,
};
assert_ulps_eq!(A + B, result);
let mut mat = A.clone();
mat += B;
assert_ulps_eq!(mat, result);
}
#[test]
fn subtract() {
let result = Matrix3x3 {
c00: -9.0, c10: -9.0, c20: -9.0,
c01: -9.0, c11: -9.0, c21: ... | Rust | 0 |
('$\sigma/\sigma_{1}$', size=15)
plt.xlabel('Modes', size=15)
plt.xlim(0, 11)
plt.legend(fontsize=12)
plt.xticks(fontsize=15)
plt.yticks(fontsize=15)
plt.show()
#%% POD MODES
modes = pod.modes
plt.figure(figsize=(6,4))
plt.plot(space, modes*-1)
plt.ylabel('$f_{g}$(t)', size=15)
plt.xlabel('x', size=15)
plt.title('N... | Python | 1 |
alice(), NATIVE_CURRENCY_ID, 100),
(bob(), NATIVE_CURRENCY_ID, 100),
(alice(), X_TOKEN_ID, 100),
(bob(), X_TOKEN_ID, 100),
])
}
pub fn build(self) -> sp_io::TestExternalities {
let mut t = frame_system::GenesisConfig::default()
.build_storage::<Ru... | Rust | 0 |
# apps/core/search.py
from django.db import models
class SearchManager(models.Manager):
"""
Custom manager for ParadeDB BM25 search functionality.
"""
def search(self, query, fields=None):
"""
Perform a BM25 search on specified fields.
:param query: The search query string
... | Python | 1 |
nd_faults<BS, RT>(
rt: &mut RT,
sector_size: SectorSize,
sectors: &[SectorOnChainInfo],
) -> Result<(), ActorError>
where
BS: BlockStore,
RT: Runtime<BS>,
{
if sectors.is_empty() {
return Ok(());
}
let weights = sectors
.iter()
.map(|s| to_storage_weight_desc(sec... | Rust | 0 |
class Solution:
def distinctNames(self, ideas: List[str]) -> int:
ans = 0
# Group strings by initials
suffixes = [set() for _ in range(26)]
for idea in ideas:
suffixes[ord(idea[0]) - ord('a')].add(idea[1:])
for i in range(25):
for j in range(i + 1, 26):
count = len(suffixes[i... | Python | 1 |
b37a307bbb66333164ec9e1b24ea0d6c3ffddcec4f68e744\
3056193a03c810e11344ca06d8ed8a2bfb1e8d48cfa6bc0eb4e2464b74814240\
7c9f431aee769960e15ba8b96890466ef2457599852385c661f752ce20f9da0c\
09ab6b19df74e76a95967446f8d0fd415e7bee2a12a114c20eb5292ae7a349ae\
577820d5520a1f3fb62a17ce6a7e68fa7c79111d8860920bc048ef43... | Rust | 0 |
in(
os.path.dirname(__file__), "workspace_did_change_configuration.json"
),
"r",
) as f:
self.server.notify.workspace_did_change_configuration(
{"settings": json.load(f)}
)
assert "capabilitie... | Python | 1 |
WINDOW_KEY,
&WindowSettings::from_display(&display),
);
epi::set_value(storage.as_mut(), EGUI_MEMORY_KEY, &*ctx.memory());
app.save(storage.as_mut());
storage.flush();
}
... | Rust | 0 |
ypes('test_ros', mode='.srv')
for t in ['test_ros/RossrvA', 'test_ros/RossrvB']:
assert t in l
def test_get_srv_text(self):
d = get_test_path()
srv_d = os.path.join(d, 'srv')
with open(os.path.join(srv_d, 'RossrvA.srv'), 'r') as f:
text = f.read()
sel... | Python | 1 |
"""
Copyright (c) 2019-2024 Intel Corporation
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 w... | Python | 1 |
}
#[test]
fn semicolon() {
let scanners: &mut Vec<&Scanner> = &mut vec![&DelimiterScanner];
lex_from_str(";", "Smcl", scanners);
}
<filename>src/format/pfs0.rs
use byteorder::{LittleEndian, WriteBytesExt};
use crate::format::utils;
use std;
use std::fs::File;
use std::io::Read;
use std::io::Seek;
use std::io:... | Rust | 0 |
xb6\x0c\xc1FH\xc3k(z\xe1\xf0n\x93\x8f\xc5\x9c\
\xafi\x08\x92\x825(\x8e\x9c\x82\x14I8\x22\xa1\xb0\
r2\x09C&\x982\x8b\xf4\xbc\x0c\xa8\xbf\xe9e\xd0\
\xe4hk\xb1\x05\x8a>\x92r\x94\xa4v\xb3\xf8\xef\xcc\
\xecJ\x1b\x02*rJ\x22\x19\xaf\xe1\xf4\xb9!\x92|\
>\xd3p\xf8\xc5R\xb4\xc2A!R(N\xd7\xc2\xa8\
\xdd\x00Y_\xad+\x0f\x95I\xcf\x1d\... | Python | 1 |
.mkdir(args.output)
pass_filter = None
target_tag = ""
if args.tvm:
pass_filter = tvm_pass_filter
target_tag = "tvm_"
elif args.ort:
pass_filter = ort_pass_filter
target_tag = "ort_"
else:
print(f"[WARNING] No pass filter is used (use --tvm or --ort)")
a... | Python | 1 |
# Copyright 2024 Matheus Vilano
# SPDX-License-Identifier: Apache-2.0
from simplevent import RefEvent as _RefEvent
from waapi import WaapiClient as _WaapiClient
from pywwise.decorators import callback
from pywwise.enums import ECaptureLogItemType, ECaptureLogSeverity
from pywwise.primitives import GameObjectID, GUID,... | Python | 1 |
import numpy as np
import random
def ransac_line_fit(stars, iterations=500, threshold=5):
best_line = None
best_inliers = []
for _ in range(iterations):
sample = random.sample(stars, 2)
(x1, y1) = sample[0][:2]
(x2, y2) = sample[1][:2]
if x1 == x2 and y1 == y2:... | Python | 1 |
t, default=None,
help='Number of patients per chunk (default: auto)')
args = parser.parse_args()
# Set parallel flag (default is True, unless --no-parallel is specified)
args.parallel = not args.no_parallel
# Print processing mode
if args.parallel:
n_wor... | Python | 1 |
_eq!(8.0, mass.m, r2nd <= Magnitude::EPSILON);
let mass = Mass::in_picograms(8.0_e15);
assert_float_eq!(8.0, mass.m, r2nd <= Magnitude::EPSILON);
let mass = Mass::in_fg(8.0_e18);
assert_float_eq!(8.0, mass.m, r2nd <= Magnitude::EPSILON);
let mass = Mass::in_femtograms(8.0_e18);
assert_float_eq!(... | Rust | 0 |
# Copyright (C) 2018-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
from openvino_genai import GenerationResult, GenerationConfig
def compare_generation_result(hf_result: GenerationResult,
ov_result: GenerationResult,
generation_config: Generat... | Python | 1 |