text
string
label_name
string
labels
int64
the retrieved values will"] #[doc = " always be zero or positive."] #[doc = ""] #[doc = " Any or all of the size arguments may be `NULL`. If an error occurs, all"] #[doc = " non-`NULL` size arguments will be set to zero."] #[doc = ""] #[doc = " @param[in] window The window whose frame size...
Rust
0
from clusternet.apis.presentation.exceptions import BadRequestException from clusternet.apis.presentation.helpers import ( bad_request, error, internal_server_error, success, validate_required_params ) from clusternet.apis.presentation.protocols import Controller, HttpRequest, HttpResponse from clusternet.apis.work...
Python
1
from typing import ( Any, Optional, Protocol, Sequence, TypeVar, runtime_checkable, ) from typing_extensions import Self ERROR = "__error__" SCHEDULED = "__scheduled__" INTERRUPT = "__interrupt__" RESUME = "__resume__" TASKS = "__pregel_tasks" Value = TypeVar("Value", covariant=True) Update =...
Python
1
umi_len, max_seq_dist, max_umi_dist, umi_on_reverse, verbose_read_names, insert_size, std_dev, )?, cli::CollapseReadsToFragmentsSubcommand::Bam { bam, consensus_fq1, ...
Rust
0
'max': max(red_sums) if red_sums else 0, 'most_common': Counter(red_sums).most_common(10) }, 'blue_sum_stats': { 'mean': round(np.mean(blue_sums), 2) if blue_sums else 0, 'std': round(np.std(blue_sums), 2) if blue_sums else 0, 'm...
Python
1
lf.ax2.set_ylim(0, y_upper_limit) # Utilisation de MaxNLocator pour limiter le nombre de ticks sur l'axe x self.ax2.xaxis.set_major_locator(ticker.MaxNLocator(20)) self.fig2.autofmt_xdate() # Gestion du curseur if self.cursor2: self.cursor2.visible = False ...
Python
1
intrinsics::TypeId::of::<COverlayEnabledMsg>() } fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor { ::protobuf::MessageStatic::descriptor_static(None::<Self>) } } impl ::protobuf::MessageStatic for COverlayEnabledMsg { fn new() -> COverlayEnabledMsg { COverlayEna...
Rust
0
#!/usr/bin/env python3 # Original Author: christoph.roesmann@tu-dortmund.de # aizzat : Update python3 path # if it does not work - please change to '#!/usr/bin/env python' in path on the header # This is to fix some compatibility issues with ROS on Melodic import rospy, math from geometry_msgs.msg import Twist from a...
Python
1
mut ffi::c_void> { let dos_header = self.handle as winnt::PIMAGE_DOS_HEADER; let nt_headers = (self.handle as *const u8).offset((*dos_header).e_lfanew as _) as winnt::PIMAGE_NT_HEADERS; let image_size = (*nt_headers).OptionalHeader.SizeOfImage; let scan_bytes = self.handle a...
Rust
0
[g_optim,mse,all_sum], feed_dict={ gt: train_gt, lms: train_lms, ms_hp: train_ms_hp, pan_hp: train_pan_hp } ) if i % 10 == 0: print("Iter: " + str(i) + " MSE: "...
Python
1
# Validate using existing security framework validation_result = file_validator.validate_file_upload( file_data=file_data_b64, content_type=content_type, filename=filename, user_id="url_download", ) return validatio...
Python
1
# -*- coding: utf-8 -*- # @Time : 2017/12/26 18:56 # @Author : play4fun # @File : Stores.py # @Software: PyCharm """ Stores.py: """ import simpy def producer(env, store): for i in range(100): yield env.timeout(2) yield store.put('spam猪肉 %s' % i) print('商店 Produced spam猪肉 at', env....
Python
1
irectory containing chroma_db index (default: current directory)') args = parser.parse_args() if args.index_dir: print(f"# Using index from: {args.index_dir}", file=sys.stderr) # Initialize client client = SearchClient(index_dir=args.index_dir) # Run search using the new ...
Python
1
n, n_class classifiers are trained in a one-versus-all approach. Concretely, this is implemented by taking advantage of the multi-variate response support in Ridge. Examples -------- >>> from sklearn.datasets import load_breast_cancer >>> from sklearn.linear_model import RidgeClassifierCV >...
Python
1
global pathgame if "東方紅魔郷.exe" in i: vppath = i.replace('東方紅魔郷.exe','') pathgame = "vpatch_th06.dll" if "th07.exe" in i: vppath = i.replace('th07.exe','') pathgame = "v...
Python
1
_urls: dict = { "yzm": "https://jywg.18.cn/Login/YZM?randNum=", "login": "https://jywg.18.cn/Login/Authentication?validatekey=", "query_asset_and_pos": "https://jywg.18.cn/Com/queryAssetAndPositionV1?validatekey=", "query_orders": "https://jywg.18.cn/Search/GetOrdersData?validatekey=", "query_trades...
Python
1
proc::drawing::draw_convex_polygon_mut; use imageproc::drawing::Point; let mut image = GrayImage::from_pixel(300, 300, Luma::black()); let white = Luma::white(); let triangle = vec![Point::new(35, 50), Point::new(145, 80), Point::new(5, 60)]; draw_convex_polygon_mut(&mut image, &triangle, white); ...
Rust
0
self.bits >> 12) & 0x0f) as u8) } #[doc = "Bits 16:19"] #[inline(always)] pub fn delay4(&self) -> DELAY4_R { DELAY4_R::new(((self.bits >> 16) & 0x0f) as u8) } #[doc = "Bits 20:23"] #[inline(always)] pub fn delay5(&self) -> DELAY5_R { DELAY5_R::new(((self.bits >> 20) & 0x0...
Rust
0
__all__ = [ 'ActionLogEntry' ] import auto_prefetch from django.db import models from django.contrib.auth import get_user_model User = get_user_model() class ActionLogEntry(auto_prefetch.Model): class Meta(auto_prefetch.Model.Meta): verbose_name = 'Действие' verbose_name_plural = 'Действия'...
Python
1
options, FileSize}; use rand::{distributions::Standard, prelude::*, thread_rng, Rng}; fn main() { for count in [0, 1, 10, 100, 1_000, 10_000, 100_000, 1_000_000].into_iter() { let roaring = random_bitmap::<Roaring, u32>(count); let two_levels = random_bitmap::<RoaringTwoLevels, u64>(count); ...
Rust
0
JavaTools.log("Passenger " + parts[1] + " cannot leave Elevator " + parts[3] + " when the door closed\n", output, "red") if parts[3] == passenger_data[parts[2]]["TO"] and parts[1] == 'F': passenger_data[parts[1]]["ARRIVE"] = True passenger_data[p...
Python
1
} } fn stat(&self) -> Result<DbStat, &'static str> { Ok(DbStat { n_records: self.db.len() as u64, }) } fn iter_keys(&self, opts: IterOptions) -> Result<KeyList, &'static str> { let mut key_list = KeyList { ...
Rust
0
from .QQEventHandler import QQEventHandler from .QQUtils import * from ffxivbot.models import * import logging import json import random import requests from bs4 import BeautifulSoup import urllib import logging import time import traceback def QQCommand_joke(*args, **kwargs): action_list = [] try: g...
Python
1
ec / 1_000_000, 0)); let visit_date_str = time::strftime("%Y-%m-%d %H:%M:%S", visit_date) .unwrap_or_else(|_| String::from("Invalid visit date")); println!("#{}\nTitle: {:?}", i, title); println!("URL: {:?}", url); println!("Visit Date: {:?}\n", visit_date_str); i +=...
Rust
0
ta { let index: usize = plte_index as usize; for color_index in index*PLTE_CHANNELS..index*PLTE_CHANNELS+PLTE_CHANNELS { color_data.push(plte_data[color_index]); } } color_data } fn compute_orig_pixel_offset(orig_size: usize, new_size: usize, ratio: f64) -> usize { // U...
Rust
0
LOGGERS.""" # Arrange # Pick a logger from ERROR_ONLY_LOGGERS logger_name = list(ERROR_ONLY_LOGGERS)[0] log_level = "INFO" mock_logger = Mock() mock_logging.getLogger.return_value = mock_logger mock_logging.ERROR = 40 # Mock the logging level constant # ...
Python
1
import structlog from flare_ai_social.ai import GeminiProvider from flare_ai_social.prompts import ( CHAIN_OF_THOUGHT_PROMPT, FEW_SHOT_PROMPT, ZERO_SHOT_PROMPT, ) from flare_ai_social.settings import settings logger = structlog.get_logger(__name__) # Test prompts are selected from within the training dat...
Python
1
# Copyright 2005 Joe Wreschnig # 2016 Nick Boultbee # # 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 2 of the License, or # (at your option) any later version. import ...
Python
1
import rclpy from rclpy.node import Node from sensor_msgs.msg import PointCloud2, PointField from std_msgs.msg import Header import depthai as dai import numpy as np import struct import sensor_msgs_py.point_cloud2 as pc2 class DepthToPointCloud(Node): def __init__(self): super().__init__('depth_to_pointcl...
Python
1
} data = edit_torrent(metafile2, edits) meta = pyben.load(metafile2) assert data == meta assert "private" not in data["info"] def test_edit_none(metafile2): """ Test edit torrent with None for all params. """ edits = { "announce": None, "url-list": None, "commen...
Python
1
unsafe fn from_ptr_new(ptr: *mut wl_proxy) -> WlCompositor { let data: *mut UserData = Box::into_raw(Box::new(( ptr::null_mut(), Option::None, Arc::new((AtomicBool::new(true), AtomicPtr::new(ptr::null_mut()))), ))); ffi_dispatch!...
Rust
0
ed @classmethod def ensure_abstract_eval_bound(cls): if not cls._ABSTRACT_EVAL_BOUND: cls._PRIM.def_abstract_eval( lambda x, weight, bias: cls.abstract_eval(x, weight, bias) ) cls._ABSTRACT_EVAL_BOUND = True @LinearPlugin._PRIM.def_impl def _linear_...
Python
1
duel = DuelCounter() if not args: await bot.finish(ev, '请输入查好感+女友名。', at_sender=True) name = args[0] cid = chara.name2id(name) if cid == 1000: await bot.finish(ev, '请输入正确的女友名。', at_sender=True) cidlist = duel._get_cards(gid, uid) if cid not in cidlist: await bot.fin...
Python
1
# Calcula sueldo varios empleados """ Elaborar un algoritmo que calcule e imprima el sueldo de varios empleados, cada empleado se tratará en forma similar al problema de cálculo de sueldo de un empleado. """ eleccion = 'S' while eleccion == 'S': nombre = input("Ingrese el nombre del empleado: ") horas...
Python
1
#!/usr/bin/env python # -*- coding: utf-8 -*- import argparse import glob import os import numpy as np import vtk import whitematteranalysis as wma def list_files(input_dir,regstr): # Find input files input_mask = f"{input_dir}/{regstr}" input_pd_fnames = glob.glob(input_mask) input_pd_fnames = sor...
Python
1
n.get("altitude") self._state = state_value self._extra_attributes.update(main_data) # Добавляем атрибут "tomorrow" для сенсора main if self.coordinator._forecast_enabled: twice_daily = merged.get("twice_daily_forecast", []) forecast_key =...
Python
1
} } } fn get_empty_object() -> GuraType { object! { empty_object: {} } } const PARENT_FOLDER: &str = "objects"; #[test] /// Tests all kind of objects fn test_normal() { let parsed_data = common::get_file_content_parsed(PARENT_FOLDER, "normal.ura").unwrap(); assert_eq!(parsed_data, get_exp...
Rust
0
# 创建 adb 客户端 client = AdbClient(host="127.0.0.1") # 目标设备序列号 target_serial = f"127.0.0.1:{EMULATOR_PORT}" # 检查是否已连接目标模拟器 devices_list = client.device_list() emulator_connected = any(d.serial == target_serial for d in d...
Python
1
full_paths.get(0).unwrap().len() - 1); let mut past_1k = HashSet::new(); // println!("{}", full_paths.iter().fold(0, |sum, path| { // if path.len() >= 1000 { // sum + 1 // } else { // sum // } // })); for path in &full_paths { if path.len() > 10...
Rust
0
_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dx3cr](index.html) module"] pub struct DX3CR_SPEC; impl crate::RegisterSpec for DX3C...
Rust
0
ic']) w = worker.Worker(**worker_conf) runner = threading_utils.daemon_thread(w.run) runner.start() w.wait() workers.append((runner, w.stop)) # Now use those workers to do something. print('Executing some work.') engine_options['topics...
Python
1
O_LOCATION, etc. Framebuffer::from_textures(vec![albedo, normals, occluder, depth]) } fn new_screen_reflector(canvas: Rc<RefCell<Canvas>>) -> Result<Framebuffer, NewFramebufferError> { let size = screen_light_size(canvas.clone()); let reflector = Texture::new( canvas.borrow().gl(), size, ...
Rust
0
the ID is valid and use it to access the [GcSystem] /// /// NOTE: The system is bound to the lifetime of *THIS* id. /// A CollectorId may have an internal pointer to the system /// and the pointer may not have a stable address. In other words, /// it may be difficult to reliably take a pointer to a...
Rust
0
''' MIT License Copyright (c) 2022 HuangChenrui<hcr2077@outlook.com> Duel DQN needs to change DQN_Net, split it to A_Net and V_Net... ''' # Pytorch import torch import torch.nn as nn import torch.nn.functional as F # Net Params N_ACTIONS = 5 # Action Space is an array[steering, acceleration] like [-0.5,0.5] which ne...
Python
1
def foo(a, *args, *, b): ... def foo(a, *args, b, c, *): ...
Python
1
r() # Write the last entries batch_size = len(image_data) if batch_size > 0: np.save( shard_file_path.format(name="image_data", idx=shard_idx), allow_pickle=False, arr=image_data, ) np.save( shard_file_path.format(name="class_labels",...
Python
1
# f1_eda_simple.py # Requisitos: pandas, matplotlib -> pip install pandas matplotlib from pathlib import Path import pandas as pd import matplotlib.pyplot as plt import matplotlib.ticker as ticker import math # ===== CONFIG ===== CSV_PATH = r"f1.csv" # ajuste aqui OUT_DIR = Path("saida_f1") def main(): # 1) L...
Python
1
r#"FROM `cake`"#, r#"LEFT JOIN `cake_filling` AS `r0` ON `cake`.`id` = `r0`.`cake_id`"#, r#"LEFT JOIN `filling` AS `r1` ON `r0`.`filling_id` = `r1`.`id`"#, r#"LEFT JOIN `vendor` AS `r2` ON `r1`.`vendor_id` = `r2`.`id`"#, ] .join(" ") ...
Rust
0
"publishDate": "2019-09-14 00:00:00", }, ] result = find_yesterdays_opps(opps) expected = ([], True) self.assertEqual(result, expected) @patch('fbo_scraper.sam_utils.get_day') def test_find_yesterdays_opps_more(self, mock_get_day): mock_get_day.side_effe...
Python
1
, 3), (3, 4), (4, 5), (5, 1) ]).unwrap(); let blossom = Blossom::new(6, vec![ 2, 3, 4 ], vec![ 1, 5, 4 ]); let path = vec![ 0, 6 ]; assert_eq!(blossom.lift(path, &graph), vec![ 0, 1, 2, 3, 4, 5 ]) } #[test] fn none_blossom_right() { let graph = D...
Rust
0
[ NegativeLogLikelihoodLoss(random_velocs=False), NegativeLogLikelihoodLoss(random_velocs=False), ], pre_softmax_weights=torch.clone(pre_softmax_weights), ).to(device) loss_scheduler = GeometricLossSchedule(every=every, factor=factor) for idx in range(1, 50 * every...
Python
1
button.add_event_listener(move |_: ClickEvent| { match callback() { Ok(()) => (), Err(e) => window().alert(&format!("That was weird: {}", e)), } }); } Ok(()) }; for rank in 1..=13 { let row...
Rust
0
# app/routes.py from flask import Blueprint from flask_restful import Api, Resource, reqparse from .models import db, Episode, Guest, Appearance # Create blueprint and attach Api to it api_bp = Blueprint('api', __name__) api = Api(api_bp) # GET /episodes class EpisodesResource(Resource): def get(self): e...
Python
1
| { x_ext.push_str("-gs"); for c in s.chars() { write!(&mut x_ext, "-{:04x}", c as u32).unwrap(); // shouldn't fail unless OOM } }); // ls // List separator, Region and Language/Customize Format/Numbers: ...
Rust
0
skriptem běží a Anet API je dostupné. Tento průvodce byl původně určen kamarádům, ale na základě zájmu ze strany Guild Wars 2 komunity, pokračuji ve vylepšování až do současné podoby. Skript bere v úvahu určité \"konečné\" množství daného předmětu za danou cenu, takže když se vyprodají, nebo jich je velmi málo během a...
Python
1
to the bins of the x-axis /// * you can also access the estimated error of the mean here pub fn mean_slice(&self) -> &[MeanWithError] { &self.mean_with_errors } /// # Iterate over the calculated mean /// * iterates over the means /// * The mean corresponds to the bins of the x-axis...
Rust
0
# Crie um programa que leia o nome completo de uma pessoa e mostre: # - O nome com todas as letras maiúsculas e minúsculas. # – Quantas letras ao todo (sem considerar espaços). # – Quantas letras tem o primeiro nome. nome = input("Digite seu nome completo: ").strip() # elimina espaços nMa = nome.upper() nMi = nome.l...
Python
1
.average /= ret.reviews.len() as f32; Ok(ret) } pub async fn add_review_for_slug( db: &Database, slug: &str, person: &Uuid, rating: i16, comment: &str, ) -> Result<i32, Error> { let opp_id = Opportunity::id_by_slug(db, slug) .await? .ok_or_else(|| Error::NoSuch("opportunity...
Rust
0
ek Alexandrine Neoplatonist philosopher in Egypt who was one of the earliest mothers of mathematics - https://en.wikipedia.org/wiki/Hypatia "hypatia", # Mary Jackson, American mathematician and aerospace engineer who earned the highest title within NASA's engineering department - https://en.wikipedia.org/wiki/...
Python
1
en()?; # let table_description = vec![ # ColumnDescription::new("bar") # .with_type(ColumnDataType::Int) # .create() # ?, # ]; # let hdu = fptr.create_table("foo".to_string(), &table_description) # ?; let data_to_write: Vec<i32> = vec![10101; 5]; h...
Rust
0
()); assert!(result.is_err()); let error = result.unwrap_err(); assert_eq!(error, TINFLStatus::Failed); } /// Fuzzed file that causes panics (subtract-with-overflow in debug, out-of-bounds in release) #[test] fn inf_issue_19() { let data = get_test_file_data("tests/test_data/issue_19.deflate"); let...
Rust
0
ibe(row.append(col))); } } subs }; let (tx, mut vals) = mpsc::channel(3); for s in subs.iter() { s.updates( UpdatesFlags::BEGIN_WITH_LAST | UpdatesFlags::STOP_COLLECTING_LAST, tx.clone(), ) } ...
Rust
0
kens_tokenizer(self): pass @unittest.skip( reason="FastSpeech2Conformer tokenizer does not support adding tokens as they can't be added to the g2p_en backend" ) def test_add_special_tokens(self): pass @unittest.skip( reason="FastSpeech2Conformer tokenizer does not suppo...
Python
1
from django.db.models.sql.query import * # NOQA from django.db.models.sql.query import Query from django.db.models.sql.subqueries import * # NOQA from django.db.models.sql.where import AND, OR __all__ = ['Query', 'AND', 'OR']
Python
1
top_idx][::-1] vals = mean_abs[top_idx][::-1].astype(float) plt.figure(figsize=(8,5)) plt.barh(y=[str(tok) for tok in feats], width=vals) plt.xlabel("Mean |SHAP value|") plt.title("Top 15 most important tokens (global)") plt.tight_layout() plt.savefig(OUT/"b...
Python
1
.to_str(), header_value.to_str()); } // send response let final_request = http_request.body(sent_form_body).unwrap(); if let Ok(sent_response) = function(&final_request) { let content = sent_response.body(); // default: application/octet-stream, but should be provided by the client ...
Rust
0
from pydantic import BaseModel from typing import List, Optional from enum import Enum class PokemonType(str, Enum): grass = "grass" fire = "fire" water = "water" electric = "electric" ice = "ice" poison = "poison" ground = "ground" flying = "flying" psychic = "psychic" bug = "b...
Python
1
self.outport(SERIAL_BASE + Registers::Inten as u16, ((divisor & 0xF0) >> 8) as u8); // Set data/stop bits and parity, which will also clear DLAB. let meta: u8 = match dbits { 5 => 0, 6 => 0b01, 7 => 0b10, _ => 0b11, ...
Rust
0
oded message. """ # msg = socket.recv() try: assert msg[0] == HEADER assert msg[-1] == CR dispenser_id = msg[1:3] command = msg[3:5] amount = msg[5:-1] except: raise Exception('Invalid Command') match comm...
Python
1
import setuptools from os import path import re PKG_NAME = "squigualiser" MOD_NAME = "src" # add readme to long description as that's what pypi sees with open("README.md", "r") as f: long_description = f.read() # get version from file rather than here so change isn't in this file __version__ = "" exec(open("{}/_...
Python
1
( TendermintVotePower::zero(), *app.power_changed_in_block .get(&staking_account_address) .unwrap() ); let account = get_account(&address, &app); assert!(account.is_jailed()); } #[test] fn begin_block_should_jail_non_live_validators() { use chain_abci::app::into...
Rust
0
cket") @_builtins.property @pulumi.getter(name="influxDbProto") def influx_db_proto(self) -> pulumi.Output[Optional[_builtins.str]]: """ Protocol for InfluxDB. Choice is between `udp` | `http` | `https`. If not set, PVE default is `udp`. """ return pulumi.get(self, "influx_d...
Python
1
#!/usr/bin/env python # Software License Agreement (BSD License) # # Copyright (c) 2009, Willow Garage, Inc. # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # # * Redistributions of source code...
Python
1
depth=depths_upsample[(self.num_layers - 1 - i_layer)],drop=drop_rate, attn_drop=attn_drop_rate, drop_path=dpr[sum(depths_upsample[:(self.num_layers - 1 - i_layer)]): sum(depths_upsamp...
Python
1
{ log::warn!("File not found: {:?}", &file_path); Ok(Response::new(StatusCode::NotFound)) } Err(e) => Err(e.into()), } } } } #[cfg(test)] mod test { use super::*; use std::fs::{self, File}; use std::io::Write;...
Rust
0
import argparse import cv2 import numpy as np import torch from detectron2.projects.DensePose.densepose import add_densepose_config from detectron2.projects.DensePose.densepose.vis.densepose_results import ( DensePoseResultsFineSegmentationVisualizer as Visualizer, ) from detectron2.projects.DensePose.densepose.vi...
Python
1
et fsecs = duration.subsec_nanos() as f64 / 1_000_000_000.0 + duration.as_secs() as f64; CFRunLoopTimerSetNextFireDate(self.timer, current + fsecs) } } } } macro_rules! os_capabilities { ( $( $(#[$attr:meta])* $error_name:i...
Rust
0
> Result<f32, ParseFloatError> { Ok(try!(parse_expression(&mut line.chars().peekable()))) } fn parse_expression(iter: &mut Peekable<Chars>) -> Result<f32, ParseFloatError> { let mut value = try!(parse_term(&mut iter.by_ref())); loop { value = match retrieve_sign(&mut iter.by_ref()) { So...
Rust
0
ple_data): """測試主要訊號產生器初始化""" price_data, financial_data, news_data = sample_data generator = SignalGenerator( price_data=price_data, financial_data=financial_data, news_data=news_data ) assert generator.price_data is not None assert generator.financial_data...
Python
1
import networkx as nx import matplotlib.pyplot as plt from PIL import Image from rich.console import Console # ---------- 1) PNG rendern (ohne Rand) und Layout zurückgeben ---------- def draw_graph_image(graph, filename="graph.png", seed=42, return_pos=True): pos = nx.spring_layout(graph, seed=seed) plt.figur...
Python
1
} let mut ipix = vec![0; lon.len()]; let layer = healpix::nested::get(ds as u8); ipix.par_iter_mut() .zip_eq(lon.into_par_iter().zip_eq(lat.into_par_iter())) .for_each(|(p, (l, b))| { *p = layer.hash(l, b); }); let times = ti...
Rust
0
# Desenvolva um programa em Python para calcular a média de notas de alunos em uma disciplina. O programa deve solicitar ao usuário o número de alunos e, em seguida, para cada aluno, pedir o nome e três notas. Utilize um loop 'for' para iterar sobre os alunos e suas notas. # Além disso, implemente uma estrutura condic...
Python
1
rmup period during which it increases linearly between 0 and the initial lr set in the optimizer. Args: optimizer ([`~torch.optim.Optimizer`]): The optimizer for which to schedule the learning rate. num_warmup_steps (`int`): The number of steps for the warmup phase. ...
Python
1
ALIGN8_W { w: self } } #[doc = "Writes raw bits to the register."] #[inline(always)] pub unsafe fn bits(&mut self, bits: u32) -> &mut Self { self.0.bits(bits); self } } #[doc = "PDMA Transfer Alignment Status Register\n\nThis register you can [`read`](crate::generic::Reg::read), [`...
Rust
0
insert_registry() { let (mut identity, _, _ , id_keypair) = create(); let reg1 = Registry::new(&id_keypair, "idp.io/test", "test", OType::SET, b"Not important!", identity.prev().unwrap(), 0); assert!(identity.save(reg1.clone()) == Ok(())); let reg2 = Registry::new(&id_keypair, "idp.io/test", "test", O...
Rust
0
e) } fn new_gate( &mut self, variables: P::StateVariables, this_step_coeffs: P::ThisTraceStepCoefficients, next_step_coeffs: P::NextTraceStepCoefficients, ) -> Result<(), SynthesisError> { self.inner.new_gate(variables, this_step_coeffs, next_step_coeffs) } fn...
Rust
0
from datetime import datetime, timedelta import random from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import Select import time def wait_for_calendar(driver): Web...
Python
1
box_overlap_qbox = True for l in range(4): # point l in qboxes for k in range(4): # corner k in boxes vec = boxes[i, k] - boxes[i, (k + 1) % 4] if clockwise: v...
Python
1
SPONSE: return None sw_major = self._get_data(2, "<B") sw_minor = self._get_data(3, "<B") sw_patch = self._get_data(12, "<H") sw_part_number = self._get_data(4, "<I") sw_build_number = self._get_data(8, "<I") self._dbg("") self._dbg("*** Part Number:...
Python
1
// object for long. let c_geom = ogr::OGR_G_GetGeometryRef(self.c_geometry(), n as c_int); return Geometry::with_c_geometry(c_geom, false); } pub fn add_geometry(&mut self, mut sub: Geometry) -> Result<()> { assert!(sub.owned); sub.owned = false; let rv = unsafe { o...
Rust
0
xkb::IMGroupsWhich::UseLatched`](XCB_XKB_IM_GROUPS_WHICH_USE_LATCHED) /// - [`xkb::IMGroupsWhich::UseBase`](XCB_XKB_IM_GROUPS_WHICH_USE_BASE) pub type xcb_xkb_im_groups_which_t = u32; /// The `xkb::IMGroupsWhich::UseCompat` enum variant. /// /// This is a variant of [`xcb_xkb_im_groups_which_t`]. pub const XCB_XKB_IM_G...
Rust
0
= "avx"] unsafe fn _mm256_add_pd() { let a = f64x4::new(1., 2., 3., 4.); let b = f64x4::new(5., 6., 7., 8.); let r = avx::_mm256_add_pd(a, b); let e = f64x4::new(6., 8., 10., 12.); assert_eq!(r, e); } #[simd_test = "avx"] unsafe fn _mm256_add_ps() { let ...
Rust
0
, rhs), mir::BinOp::BitAnd => bx.and(lhs, rhs), mir::BinOp::BitXor => bx.xor(lhs, rhs), mir::BinOp::Offset => { let pointee_type = input_ty .builtin_deref(true) .unwrap_or_else(|| bug!("deref of non-pointer {:?}", input_ty)) ...
Rust
0
pub max_vgpr_count: Option<usize>, } impl PlatformCodegenDesc for CodegenDesc { } // See https://llvm.org/docs/AMDGPUUsage.html#code-object-v3-metadata-mattr-code-object-v3 const NT_AMDGPU_METADATA: u32 = 32; #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] struct HsaMetadataMap<'a> { #[serde(rename...
Rust
0
start_parser.add_argument('--jobs-file', help='Jobs file path') # Status command subparsers.add_parser('status', help='Show status') # Screens command subparsers.add_parser('screens', help='Show active job screen sessions') # Pause command pause_parser = subparsers.add_parser...
Python
1
job_config = { "features_metadata_source_url": "http://host/api/v1/online-feature-store/get-source-mapping", # endpoint to get metadata of features "features_output_cloud_storage_path": "gs://online_feature_store_features_push_prd/features_push_output", "features_write_to_cloud_storage": True, # Optional....
Python
1
AF_INET = 2, // IP Protocol AF_AX25 = 3, // Amateur radio AX.25 AF_IPX = 4, // Novell IPX AF_APPLETALK = 5, // AppleTalk DDP AF_NETROM = 6, // Amateur Radio NetROM AF_BRIDGE = 7, // Multi-protocol bridge AF_AAL25 = 8, // Reserved for Werner's ATM AF_X25 = 9, ...
Rust
0
ters): self._Filters = Filters @property def Offset(self): r"""偏移量。 :rtype: int """ return self._Offset @Offset.setter def Offset(self, Offset): self._Offset = Offset @property def Limit(self): r"""请求对象个数。 :rtype: int """...
Python
1
return json.dumps(msg) old_password = request.form['old_password'] if(old_user.password!=old_password): msg['state'] = 'fail' msg['msg'] = '初始密码错误' return json.dumps(msg) new_password = request.form['new_password'] res = updateUserPasswor...
Python
1
# [MXML-6-04] 4.linearSVC(soft_margin).py # # This code was used in the machine learning online # course provided by # www.youtube.com/@meanxai # www.github.com/meanxai/machine_learning # # A detailed description of this code can be found in # https://youtu.be/LdOcJfJTcwU # import numpy as np import matplotlib.pyplo...
Python
1