text string | label_name string | labels int64 |
|---|---|---|
ts.shape[2]-rad):
if mask[d0, d1, d2]:
assert np.array_equal(
np.array(global_outputs[d0, d1, d2]),
np.array([d0, d1, d2, 0]))
# Create dataset
def do_test(dim0, dim1, dim2, ntr, nsubj, max_blk_e... | Python | 1 |
number of bytes required to store
/// the entries it holds.
///
/// The upper bound is only present if some property of the type ensures that its
/// allocations do not exceed the bound, and is `None` otherwise (to indicate an
/// unlimited upper bound).
///
/// If the type's allocated memor... | Rust | 0 |
#
# This file is part of the Chemical Data Processing Toolkit
#
# Copyright (C) Thomas Seidel <thomas.seidel@univie.ac.at>
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# versi... | Python | 1 |
from .analysis import analysis_mcp
__all__ = ["analysis_mcp"]
| Python | 1 |
def meu_decorador(funcao):
def envelope(*args, **kwargs):
print("faz algo antes de executar")
resultado = funcao(*args, **kwargs)
print("faz algo depois de executar")
return resultado
return envelope
@meu_decorador
def ola_mundo(nome, outro_argumento):
print(f"Olá mundo {n... | Python | 1 |
);
// Modify the TrapFrame
self.context.set_ip(entry_addr);
self.context.set_sp(ustack_top);
info!("exec:END: path: {:?}", path);
Ok(0)
}
pub fn sys_yield(&mut self) -> SysResult {
//thread::yield_now();
Ok(0)
}
/// Get the current process id
... | Rust | 0 |
32
+ 256i32
+ 256i32
+ 13i32
+ 256i32
+ 4i32
+ 256i32
+ 1i32
+ 3i32 * 256i32
+ (0x10ffffi32 + 1i32)
+ (0x10ffffi32 + 1i32)
+ (0x10ffffi32 + 1i32... | Rust | 0 |
image must have an aspect ratio = width / height within this range.
area_range: An optional list of `floats`. The cropped area of the image
must contain a fraction of the supplied image within in this range.
max_attempts: An optional `int`. Number of attempts at generating a cropped... | Python | 1 |
}
}
impl_subtype!(FCmpInst => CmpInst);
<reponame>EuKaique/Projeto-Diagnostico-Medico
net.sf.jasperreports.components.table.util.TableUtil
<filename>src/subsurface.rs
use crate::hittable::{Hittable, HitRecord};
use crate::texture::{Texture, SolidColor};
use crate::material::{Material, Isotropic};
use crate::color:... | Rust | 0 |
from nose.tools import nottest
import numpy as np
from zipline.testing.predicates import assert_equal
from zipline.pipeline import Classifier, Factor, Filter
from zipline.utils.numpy_utils import float64_dtype, int64_dtype
from .base import BaseUSEquityPipelineTestCase
@nottest
class BaseAliasTestCase(BaseUSEquityP... | Python | 1 |
information about reading until whitespace or any of some character.
#[derive(Clone, Debug, PartialEq)]
pub struct UntilAny {
/// The characters to stop at.
pub any_characters: Arc<String>,
/// Whether empty data is accepted or not.
pub optional: bool,
/// The property to store read text.
pub pr... | Rust | 0 |
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b... | Python | 1 |
uct BrickConfig {
pub origin : Vec2,
pub size : Vec2,
pub width : f32,
pub height : f32,
pub col_width : f32,
pub row_height : f32,
pub spacing : Vec2
}
impl BrickConfig {
pub fn new() -> BrickConfig {
let game_area = vec2(config::GAME_AREA_WIDTH as f32, config::GAME_AREA_HEIGHT... | Rust | 0 |
# Copyright (c) 2017-2025 Satpy developers
#
# This file is part of satpy.
#
# satpy is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
... | Python | 1 |
-= qi4i7v1nn4l
nonlocal tvoaa5xd0uk
import qa8h230h4dz as okhln0bcvus, pz8zoa4fci2, lu_2hlwxuwc, kyrjflc9ceo as mvp8iro506x, rff3v1l01ob, n4_acdk97lk as g34_d0fmrfy, buwc_wtzs7o as x_4jgoyp4ww, mg4___ulv7o, l9vkluaei2g as pspkwi2remq, dn14esbpf_0
pass
False .a3b6z2u553n: aqpn0e2bmge = dot8f4f88g3
f... | Python | 1 |
df = pd.DataFrame(episode_sf_list_after_filter, columns=['episode', 'first_reach_step'])
df.to_csv('./episode_sf_table_after_filter.csv', index=False)
if __name__ == '__main__':
jsp_path = '../../ur5e_DDPG_article2_0_01_20000csv/joint_path_csv/'
est_path = './'
JSP = Joint_Space_Path(max_episod... | Python | 1 |
import os
import psycopg2
import streamlit as st
def conectar_banco():
return psycopg2.connect(
host=os.getenv("DB_HOST"),
database=os.getenv("DB_NAME"),
user=os.getenv("DB_USER"),
password=os.getenv("DB_PASS"),
)
def criar_tabela():
conn = conectar_banco()
cur = con... | Python | 1 |
emonic::Vrsqrt28ps),
ffi::_ND_INS_CLASS::ND_INS_VRSQRT28SD => Ok(Mnemonic::Vrsqrt28sd),
ffi::_ND_INS_CLASS::ND_INS_VRSQRT28SS => Ok(Mnemonic::Vrsqrt28ss),
ffi::_ND_INS_CLASS::ND_INS_VRSQRTPH => Ok(Mnemonic::Vrsqrtph),
ffi::_ND_INS_CLASS::ND_INS_VRSQRTPS => Ok(Mnemonic::Vr... | Rust | 0 |
}
}
<filename>chips/src/stm32f4/delay.rs
use embedded_hal::blocking::delay::DelayUs;
use super::clock::HCLK;
pub struct TickDelay;
impl<T: Into<u32>> DelayUs<T> for TickDelay {
fn delay_us(&mut self, us: T) {
cortex_m::asm::delay(us.into() * (HCLK / 1000) / 1000 + 1)
}
}
use rustic_users::rustic::U... | Rust | 0 |
#!/usr/bin/env python
# coding: utf-8
# Copyright (c) QuantStack.
# Distributed under the terms of the Modified BSD License.
from .openlayers import *
from ._version import __version__, version_info
def _jupyter_labextension_paths():
"""Called by Jupyter Lab Server to detect if it is a valid labextension and
... | Python | 1 |
telnet.read().expect("Read error");
// Write helo hi
telnet.write("helo hi\r\n".as_bytes()).expect("Read error");
telnet.read().expect("Read error");
// Set from email
telnet.write("mail from:<<EMAIL>>\r\n".as_bytes()).expect("Read error");
telnet.read().expect("Read error");
... | Rust | 0 |
12_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT: u32 = 2u32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"]
pub type D3D12_COLOR_WRITE_ENABLE = i32;
#[doc = "*Required features: `\"Win32_Graphics_Direct3D12\"`*"]
pub const D3D12_COLOR_WRITE_ENABLE_RED: D3D12_COLOR_WRITE_ENABLE = 1i32;
#[doc = "*Required feature... | Rust | 0 |
nction.evaluate_with_params(env, db, param_value_list)
}
}
fn eval_list(env: &mut Env, db: &Database, items: Vec<Expr>) -> Result<Val, EngineError> {
let mut evaluated_items = Vec::new();
for expr in items {
evaluated_items.push(eval_expr(env, db, expr)?);
}
Ok(Val::List(evaluated_items))
... | Rust | 0 |
.get_schema().try_write() {
let schema_ref = this.get_registry().get_schema_by_id(id, format).await?;
*handle = Some(schema_ref);
}
}
},
}
}
fn deserialize_avro<D: DeserializeOwned>(schema_ref: &SchemaRef, data: &[u8]) -> Result<D> {
i... | Rust | 0 |
rBuilder::new().from_writer(vec![]);
// / wtr.serialize(("Boston", "United States", 4628910))?;
// / wtr.serialize(("Concord", "United States", 42695))?;
// /
// / let data = String::from_utf8(wtr.into_inner()?)?;
// / assert_eq!(data, "\
// / Boston,United States,4628910
// ... | Rust | 0 |
from sqlalchemy import select
from sqlalchemy.ext.asyncio import AsyncSession
from app import models
from app.schemas import users as usr_schemas
async def create_user(
payload: usr_schemas.UserIn, db: AsyncSession
) -> usr_schemas.UserOut:
"""
@param payload: UserIn schema object
@param db: SQLAlche... | Python | 1 |
const SECRET_BECH32_HRP: &'static str = "kes25519-12-sk";
fn generate<T: RngCore + CryptoRng>(mut rng: T) -> Self::Secret {
let mut priv_bytes = [0u8; common::Seed::SIZE];
rng.fill_bytes(&mut priv_bytes);
let seed = common::Seed::from_bytes(priv_bytes);
let (sk, _) = sum::keygen... | Rust | 0 |
self.assertIsNotNone(_get_column_by_name(columns, "nested.c"))
self.assertIsNotNone(_get_column_by_name(columns, "nested.d.e"))
self.assertIsNotNone(_get_column_by_name(columns, "nested.f.h.i"))
def test_parses_flatten_nested_results(self):
raw_results = [
{
... | Python | 1 |
ze)).page_ref;
*fresh1 = 0 as *mut pdf_obj;
(*(*p).pages.entries.offset(i as isize)).flags = 0i32;
let ref mut fresh2 = (*(*p).pages.entries.offset(i as isize)).resources;
*fresh2 = 0 as *mut pdf_obj;
let ref mut fresh3 = (*(*p).pages.entries.offset(i as isize... | Rust | 0 |
self.addr
}
/// Returns camera's client id.
#[inline]
pub fn cid(&self) -> &[u8] {
&self.cid[..]
}
/// Returns camera's MAC address.
#[inline]
pub fn mac(&self) -> &MacAddr {
&self.info.mac
}
/// Returns camera's firmware version.
#[inline]
pub fn v... | Rust | 0 |
jobvt,
m,
n,
&mut A.data,
lda,
&mut s,
&mut u,
ldu,
&mut vt,
ldvt,
&mut optimal_work,
optimal_lwork ... | Rust | 0 |
collect::<Result<Vec<_>, _>>()?;
let package = Package {
name: package.take_name(),
repository: package.take_repository(),
releases,
};
Ok(package)
}
/// Download a version of a package as a tarball
///
async fn get_package_tarball(
&... | Rust | 0 |
20],
// Registers
pub vram_address: VRAMAddress,
pub tmp_vram_address: VRAMAddress,
// Mapper
pub o_p_mapper: Option<Box<dyn Mapper>>
}
impl PPUBus {
pub fn new() -> Self {
PPUBus {
pattern_tables: [[0;0x1000];2],
name_tables: [[0;0x0400];2],
pale... | Rust | 0 |
bserver::observe_string("cookie", key);
let cookie: String =
match signed_cookies::signed_value::<String>(cookie, DECADE, &cookie_secret()) {
Ok(cookie) => cookie,
Err(e) => {
observer::log("signature failed");
observer::observe_string("cookie", cookie... | Rust | 0 |
# -: Fibonacci Series :-
# [ The Fibonacci series is a sequence of numbers where each number is the sum of the two preceding ones, usually starting with 0 and 1. So, the sequence goes: 0, 1, 1, 2, 3, 5, 8, 13, 21, and so on. ]
# =====================================================================... | Python | 1 |
inner: Frame { inner: mem::zeroed() },
};
let image = init_frame(&mut frame.inner.inner, &context);
// Initialize this process's symbols
let _c = ::dbghelp_init();
// And now that we're done with all the setup, do the stack walking!
while dbghelp::StackWalk... | Rust | 0 |
import numpy as np
import numpy.typing as npt
from scipy import stats
def _apply(response_mat: npt.NDArray) -> npt.NDArray:
"""Apply majority voting to crowdsourced dataset.
!!! Example
The following code apply majority voting to find labels for tasks in a
crowdsourcing problem. We assume w... | Python | 1 |
from django.db import models
import uuid
from users.models import User
from opportunities.models import Opportunity
def resume_upload_path(instance, filename):
# Upload to MEDIA_ROOT/resumes/user_id/filename
return f'resumes/{instance.user.id}/{filename}'
class Application(models.Model):
id = models.UUIDF... | Python | 1 |
def combine_names(name, surname):
return name + " " + surname | Python | 1 |
loss_total)
psnr_loss.append(avg_psnr)
#save model.pkl
if epoch == end_epoch or avg_psnr>max_psnr or avg_ssim>max_ssim:
max_psnr = avg_psnr
max_ssim = avg_ssim
torch.save(model.state_dict(), './%s/net_params_%d.pkl' % (model_dir, epoch)) # save only the parameters
print("\n*********... | Python | 1 |
x16440) as *const ());
// (unit_clear)();
// (callback)();
// }
// patch::call_patch(0x165e8, 0x16440, unit_clear_hook)
// }
// let feat = SomeFeature::new(gen);
// ```
// that doesn't work because a fn can't capture environment, an... | Rust | 0 |
>()?;
Ok(m)
}
<filename>src-tauri/src/main.rs
#![cfg_attr(
all(not(debug_assertions), target_os = "windows"),
windows_subsystem = "windows"
)]
use std::fs::File;
use std::fs;
use flate2::read::GzDecoder;
use std::io::Read;
use std::path::Path;
mod cmd;
fn main() {
tauri::AppBuilder::new()
.invoke_handl... | Rust | 0 |
end::TVMContext;
/// let ctx = TVMContext::from("cpu");
/// assert!(ctx.exist());
///
/// ```
///
/// It is possible to query the underlying context as follows
///
/// ```
/// # use tvm_frontend::TVMContext;
/// # let ctx = TVMContext::from("cpu");
/// println!("maximun threads per block: {}", ctx.exist());
/// ```
// ... | Rust | 0 |
name, val in query_args.copy():
# remove URL arguments
for pattern in rule[self.Fields.del_args]:
if re.match(pattern, name):
log.debug("TRACKER_PATTERNS: %s remove tracker arg: %s='%s'", parsed_new_url.netloc, name, val)
... | Python | 1 |
)>();
let _t = thread::spawn(move|| {
rx3.recv().unwrap();
tx1.clone();
assert_eq!(rx3.try_recv(), Err(TryRecvError::Empty));
tx1.send(2).unwrap();
rx3.recv().unwrap();
});
tx3.send(()).unwrap();
select! {
_i1 = rx1.recv() => {},
_i2 = rx2.recv()... | Rust | 0 |
bol):
"""특정 종목의 매수 타이밍 종합 분석"""
print(f"\n🔍 {symbol} 기술적 분석 시작...")
# 1. 데이터 조회
df = self.get_stock_data(symbol, days=500)
if df is None:
return None
# 2. 기술적 지표 계산
indicators = self.calculate_long_term_indicators(df)
if indi... | Python | 1 |
read_micros_seconds",
"Histogram of titan blob file read micros",
&["db", "type"]
).unwrap();
pub static ref STORE_ENGINE_BLOB_FILE_SYNC_MICROS_VEC: GaugeVec = register_gauge_vec!(
"tikv_engine_blob_file_sync_micros_seconds",
"Histogram of titan blob file sync micros",
&[... | Rust | 0 |
from typing import Iterable, Tuple
import torch.nn as nn
from transformers.utils import logging
from ...composition import adjust_tensors_for_parallel_
from ...model_mixin import EmbeddingAdaptersMixin, InvertibleAdaptersMixin, ModelBaseAdaptersMixin
logger = logging.get_logger(__name__)
class XmodModelAdaptersM... | Python | 1 |
: PublicKey = secret_key.as_ref().into();
Self::new(secret_key, public_key)
}
}
impl ValidatorSecret for Keypair {
type Hash = Digest;
type Signature = Signature;
fn sign(&self, hash: &Digest) -> Signature {
crypto::sign(hash, self.secret_key.as_ref(), &self.public_key)
}
}
impl C... | Rust | 0 |
x55, 0xAA]),
};
let cluster_size_in_bytes: u32 = bios_parameter_block.logical_sectors_per_cluster as u32
* bios_parameter_block.bytes_per_logical_sector as u32;
let num_clusters = (filedata.len() as f32 / cluster_size_in_bytes as f32).ceil() as usize;
let fat = FAT::FAT12(... | Rust | 0 |
00,Y");
// Accumulator
assert_assemble_err!("BPL A");
// Indirect
assert_assemble_err!("BPL ($4400)");
// IndexedIndirect
assert_assemble_err!("BPL ($44,X)");
// IndirectIndexed
assert_assemble_err!("BPL ($44),Y");
// Immediate
assert_assemble_err!("BPL #$44");
// Impli... | Rust | 0 |
else:
A, B = _track_str.split('.')
A = int(A)
B = int(B)
rank = A
if B == 3:
zb_str = '010101'
elif B == 4:
zb_str = '0... | Python | 1 |
"""
AWS Bedrock Examples
This file demonstrates how to use AWS Bedrock models with browser-use.
We provide two classes:
1. ChatAnthropicBedrock - Convenience class for Anthropic Claude models
2. ChatAWSBedrock - General AWS Bedrock client supporting all providers
Requirements:
- AWS credentials configured via environ... | Python | 1 |
import cv2 as cv
import numpy as np
import urllib.request
from inference import predict_face
from PIL import Image
urllib.request.urlretrieve('https://raw.githubusercontent.com/opencv/opencv/master/samples/dnn/face_detector/deploy.prototxt', 'deploy.prototxt')
urllib.request.urlretrieve('https://raw.githubusercontent.... | Python | 1 |
/// Converts the `Date` to a UTC `DateTime`.
///
/// If the `Date` is invalid (i.e. NAN), this function will return `None`.
pub fn to_utc(self) -> Option<DateTime<Utc>> {
self.0
.map(|utc| Utc::now().timezone().from_utc_datetime(&utc))
}
/// Optionally sets the individual co... | Rust | 0 |
is_compare() {
self.compare_details.focus(focus);
} else {
self.single_details.focus(focus);
}
}
fn is_compare(&self) -> bool {
self.commit.map(|p| p.other.is_some()).unwrap_or_default()
}
}
impl DrawableComponent for CommitDetailsComponent {
fn draw<B: Backend>(
&self,
f: &mut Frame<B>,
rect: R... | Rust | 0 |
import os
from typing import Dict, Optional, Union
import pydantic
from azure.storage.blob import BlobServiceClient
from structlog import get_logger
from tenacity import retry
from modelkit.assets import errors
from modelkit.assets.drivers.abc import StorageDriver, StorageDriverSettings
from modelkit.assets.drivers.r... | Python | 1 |
16 = 3536;
pub const HOMEOPATHIC_MEDICINE_SEED: u16 = 3537;
pub const HOWLING_WOLF_EMBLEM: u16 = 3538;
pub const HOWLING_WOLF_EMBLEM_SEED: u16 = 3539;
pub const CHARBROILED_WOLF_EMBLEM: u16 = 3540;
pub const CHARBROILED_WOLF_EMBLEM_SEED: u16 = 3541;
pub const HERO_PORTRAIT___BUDDY: u16 = 3542;
pub const HERO_PORTRAIT__... | Rust | 0 |
OrdStatusEnum::PendingNew),
"B" => Ok(FieldOrdStatusEnum::Calculated),
"C" => Ok(FieldOrdStatusEnum::Expired),
"D" => Ok(FieldOrdStatusEnum::AcceptedForBidding),
"E" => Ok(FieldOrdStatusEnum::PendingReplace),
_ => {
Err(OurParserError { unrego... | Rust | 0 |
", "TXS", "TAS",
"SHY", "STA", "SHX", "AHX", "LDY", "LDA", "LDX", "LAX", "LDY", "LDA", "LDX", "LAX", "TAY",
"LDA", "TAX", "LAX", "LDY", "LDA", "LDX", "LAX", "BCS", "LDA", "KIL", "LAX", "LDY", "LDA",
"LDX", "LAX", "CLV", "LDA", "TSX", "LAS", "LDY", "LDA", "LDX", "LAX", "CPY", "CMP", "NOP",
"DCP", "CPY", ... | Rust | 0 |
def prepare_image_latents(self, image, batch_size, num_images_per_prompt,
dtype, device, do_classifier_free_guidance, generator=None):
if not isinstance(image, (torch.Tensor, PIL.Image.Image, list)):
raise ValueError(
f'`image` has to be of type `torch.Tensor`, `PIL.Image.Image` or list but ... | Python | 1 |
es = json.load(open('./opencompass/datasets/medbench/entity_list.jsonl', 'r'))
for line in pred_file:
gen_output = line
answer_str = gen_output.split("\n")[-1]
answers = answer_str.split(",")
answers = [w.strip() for w in answers if len(w.strip()) > 0]
answers = [w for w in ... | Python | 1 |
input_rows: u64,
delete_predicates: HashSet<Arc<DeletePredicate>>,
compacted_parquet_file_paths: Vec<ParquetFilePath>,
os_chunks: Vec<Arc<dyn QueryChunk>>,
max_order: ChunkOrder,
database_checkpoint: DatabaseCheckpoint,
partition_checkpoint: PartitionCheckpoint,
partition: Arc<RwLock<Pa... | Rust | 0 |
import streamlit as st
import time
import numpy as np
st.markdown("# Plotting Demo")
st.sidebar.header("Plotting Demo")
st.write(
"""This demo illustrates a combination of plotting and animation with
Streamlit. We're generating a bunch of random numbers in a loop for around
5 seconds. Enjoy!"""
)
progress_bar = s... | Python | 1 |
, "Op:SShift" ),
TokenKind::OpImpl => write!(f, "Op:Impl" ),
TokenKind::OpSeqRel => write!(f, "Op:SeqRel" ),
TokenKind::OpFatArrL => write!(f, "Op:FatArrL" ),
TokenKind::OpStarLT => write!(f, "Op:StarLT" ),
... | Rust | 0 |
import numpy as np
import rclpy
from rclpy.node import Node
from nav_msgs.msg import OccupancyGrid
from geometry_msgs.msg import PoseStamped
from rcl_interfaces.msg import Log
import time
import math
class Mapping(Node):
def __init__(self):
super().__init__("mapping_node")
self.is_moving = False
... | Python | 1 |
from spartacus.src.biomech_system import BiomechCoordinateSystem
from spartacus.src.enums_biomech import CartesianAxis, AnatomicalLandmark, Segment
def test_risk_routine():
# create a biomech system
all_good = BiomechCoordinateSystem(
segment=Segment.THORAX,
antero_posterior_axis=CartesianAxi... | Python | 1 |
"""FPL Graph Package
Graph-based decision workflow and conditional logic for FPL agents.
"""
from .fpl_graph import FPLDecisionGraph, FPLWorkflowNode
from .conditional_logic import FPLConditionalEngine
from .signal_processing import FPLSignalProcessor
__all__ = ['FPLDecisionGraph', 'FPLWorkflowNode', 'FPLConditional... | Python | 1 |
'''
Python Routines for COsmology and Data I/O
PyRCODIO Pandas Version
Edoardo Carlesi 2020
ecarlesi83@gmail.com
main_particles_extract.py: extract particle data within a high-res region in the ICs or in a snapshot
'''
import read_files as rf
import halo_utils as hu
import plot_utils as pu
import ... | Python | 1 |
# Write a Python program to find the sum of all elements in a list.
def sum_of_elements(lst):
return sum(lst)
nmb = [1, 2, 3, 4, 5]
tSum = sum_of_elements(nmb)
print(f"The sum of all elements in the list is: {tSum}") | Python | 1 |
Eq)]
pub struct Work([u8; Work::LEN]);
hexify!(Work, "work");
impl Work {
pub const LEN: usize = 8;
pub fn zero() -> Self {
Self([0u8; Self::LEN])
}
pub fn random() -> Self {
let mut s = Self([0u8; Self::LEN]);
rand::thread_rng().fill_bytes(&mut s.0);
s
}
//... | Rust | 0 |
struct GuestIovec {
iov_base: i32,
iov_len: i32,
}
debug!("=> fd: {}, iov: {}, iovcnt = {}", fd, iov, iovcnt);
let mut ret = 0;
unsafe {
for i in 0..iovcnt {
let guest_iov_addr =
emscripten_memory_pointer!(ctx.memory(0), (iov + i * 8)) as *mut Gue... | Rust | 0 |
ing up from Power Saving and M4S0 power domain is NOT in active mode."]
pub struct M4S0_PD_EVENT_MASK_W<'a> {
w: &'a mut W,
}
impl<'a> M4S0_PD_EVENT_MASK_W<'a> {
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the fie... | Rust | 0 |
StartTime")
self._EndTime = params.get("EndTime")
self._PageSize = params.get("PageSize")
self._PageNum = params.get("PageNum")
self._OrderType = params.get("OrderType")
self._User = params.get("User")
self._DbName = params.get("DbName")
self._SqlType = params.get... | Python | 1 |
#[serde(tag = "type")]
pub enum AnyConsensusState {
Tendermint(TendermintConsensusState),
#[cfg(any(test, feature = "mocks"))]
Mock(MockConsensusState),
}
impl AnyConsensusState {
pub fn client_type(&self) -> ClientType {
match self {
AnyConsensusState::Tendermint(_cs) => ClientTyp... | Rust | 0 |
vModule(
inner_channels,
out_channels,
kernel_size=1,
norm_cfg=self.norm_cfg,
act_cfg=None
)
)
self.up_sample_layers = nn.ModuleList()
assert up_sample_scale == 4
self.up_sample_layers.append(
... | Python | 1 |
/// can't provide enough precision, and larger $n$ always works better.
pub struct EulerMaclaurinMethod<T: MyReal> {
dirichlet: BandwidthInterp<T>,
n: usize,
atol: f64,
}
impl<T: HardyZDep> EulerMaclaurinMethod<T> {
pub fn new(n: usize, atol: f64) -> Self {
let dirichlet =
Bandwidt... | Rust | 0 |
# Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# 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 requi... | Python | 1 |
[2][3] = v.z;
}
pub fn apply_translation(&mut self, v: &Vector3) {
self.data[0][3] += v.x;
self.data[1][3] += v.y;
self.data[2][3] += v.z;
}
pub fn set_scale(&mut self, v: &Vector3) {
self.data[0][0] = v.x;
self.data[1][1] = v.y;
self.data[2][2] = v.z;
... | Rust | 0 |
.bits >> 4) & 0x0f) as u8)
}
#[doc = "Bits 8:11 - security violation master number"]
#[inline(always)]
pub fn sec_vio_info_master(&self) -> SEC_VIO_INFO_MASTER_R {
SEC_VIO_INFO_MASTER_R::new(((self.bits >> 8) & 0x0f) as u8)
}
}
<reponame>Chopinsky/rust_simple_server
#![allow(dead_code)]
#![a... | Rust | 0 |
SERVERDATA_RESPONSE_VALUE, CString::new("he1lo").unwrap());
assert_eq!(packet1, expected_packet1);
assert_eq!(packet2, expected_packet2);
}
#[test]
fn test_unknown_packet_type() {
const UNKNOWN_TYPE_EXAMPLE: &[u8] = &[
0x0F, 0x00, 0x00, 0x00, // Size
0x00, ... | Rust | 0 |
ne to get (Default 20, Max 40).
/// It is optional.
///
/// Returns an array of `Status`es, most recent ones first.
///
/// Does not require authentication.
fn tag_timeline(&self, hashtag: TagID, query: TimelineQuery) -> Result<Vec<entities::Status>>;
}
<reponame>sval-rs/sval
#![cfg(test)]
exte... | Rust | 0 |
import sys
sys.path.append('core')
import torch
from torch.nn import functional as F
import numpy as np
from PIL import Image
from matplotlib import pyplot as plt
from core.utils.flow_viz import flow_to_image
from core.lrflow import LRFlow
import glob
import os
class InputPadder:
""" Pads images such that dimensio... | Python | 1 |
from .otBase import BaseTTXConverter
# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html
class table__m_o_r_x(BaseTTXConverter):
"""The AAT ``morx`` table contains glyph transformations used for script shaping and
for various other optional smart features, akin to ``GSUB`` and ``... | Python | 1 |
me\tWaiting Time\tTurnaround Time\tCompletion Time")
for i in range(n):
print(f"{processes[i][0]}\t\t{processes[i][1]}\t\t{processes[i][2]}\t\t{waiting_time[i]}\t\t{turnaround_time[i]}\t\t{completion_time[i]}")
print(f"\nAverage Waiting Time: {avg_waiting_time}")
print(f"Average Turnaround Time: {a... | Python | 1 |
import numpy as np
import cv2
def get_masks_rois(masks):
if len(masks) == 0:
return np.empty((0,), dtype=object)
# Если маски представлены в виде 2D массива, расширяем их до 3D
if isinstance(masks, np.ndarray) and masks.ndim == 2:
masks = np.expand_dims(masks, axis=0)
extended = T... | Python | 1 |
t forget to update the index to the duplicated vertex+normal
vertices.extend(newvertices)
if normalwarning:
print "Warning: some face without a normal detected, calculating it (x" + str(normalwarning) +")"
print "Info: Writing the resulting Octree-file"
dummywarning = 0
out = pack('III', 0xDEADBEEF if (TEXTURING or G... | Python | 1 |
gb1555: *const u8,
dst_argb: *mut u8,
width: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn ARGB4444ToARGBRow_AVX2(
src_argb4444: *const u8,
dst_argb: *mut u8,
width: ::std::os::raw::c_int,
);
}
extern "C" {
pub fn RGB24ToARGBRow_NEON(
src_rgb24: *const u... | Rust | 0 |
)`, you are ensured unique access to
/// the peripheral and there cannot be data races (unless other
/// code uses `unsafe`, of course). You can then pass the
/// `Instance` around to other functions as required. When you're
/// done with it, you can call `release(instance)` to return it.
///
//... | Rust | 0 |
mut self) -> &mut dyn (::std::any::Any) {
self as &mut dyn (::std::any::Any)
}
fn into_any(self: ::std::boxed::Box<Self>) -> ::std::boxed::Box<dyn (::std::any::Any)> {
self
}
fn descriptor(&self) -> &'static ::protobuf::reflect::MessageDescriptor {
Self::descriptor_static()
... | Rust | 0 |
ss(reduction_type=reduction_type)
self.__regularization_loss = GradientLoss(scales=scales, reduction_type=reduction_type)
self.__alpha = alpha
self.__prediction_ssi = None
def forward(
self,
prediction: Float[Tensor, "1 32 mult"],
target: Float[Tensor, "1 32 mult"],... | Python | 1 |
q!(i5, i1, "i5 is the lowest possible index (i1) even though i1 was not the first or last index removed");
assert_eq!(list.get(i5), Some(&5), "The value at i5 is correct");
let i6 = list.insert(6);
let i7 = list.insert(7);
assert_eq!(i6, i2, "i6 takes the next available index (i2)");
... | Rust | 0 |
"""
Imamo razred "Knjiga", ki ima tri atribute: "naslov", "avtor" in "leto_izdaje".
Naredili bomo zanka, ki bo v loopu vprašala po naslovu, avtorju in letu izdaje knjige.
Nato pa bomo v loopu kreirali novo kopijo razreda "Knjiga" z vrednostmi, ki smo jih podali znotraj loopa.
Vpisovanje knjig se bo zaključilo, ko bo... | Python | 1 |
to_string(), "-P42D");
assert_eq!(Duration::seconds(42).to_string(), "PT42S");
assert_eq!(Duration::milliseconds(42).to_string(), "PT0.042S");
assert_eq!(Duration::microseconds(42).to_string(), "PT0.000042S");
assert_eq!(Duration::nanoseconds(42).to_string(), "PT0.000000042S");
a... | Rust | 0 |
idx < 0:
if -idx > len(self):
raise ValueError("absolute value of index should not exceed dataset length")
idx = len(self) + idx
dataset_idx = bisect.bisect_right(self.cumulative_sizes, idx)
if dataset_idx == 0:
sample_idx = idx
else:
... | Python | 1 |
"""Computes v1 - v2."""
return Vecs(v1.x - v2.x, v1.y - v2.y, v1.z - v2.z)
def vecs_squared_distance(v1: Vecs, v2: Vecs) -> torch.Tensor:
"""Computes squared euclidean difference between 'v1' and 'v2'."""
return (squared_difference(v1.x, v2.x) +
squared_difference(v1.y, v2.y) +
squared... | Python | 1 |
#!/usr/bin/python3
# SPDX-License-Identifier: GPL-2.0-or-later
# Copyright (C) 2019-2021 Patryk Obara <patryk.obara@gmail.com>
# pylint: disable=missing-docstring
# pylint: disable=wrong-spelling-in-comment
import os
import unittest
import preconfig
TAR_TEST_DIR = 'tests/files/resource/'
TAR1 = TAR_TEST_DIR + 't... | Python | 1 |
ENTER = 89,
RICON_BOX_CIRCLE_MASK = 90,
RICON_POT = 91,
RICON_ALPHA_MULTIPLY = 92,
RICON_ALPHA_CLEAR = 93,
RICON_DITHERING = 94,
RICON_MIPMAPS = 95,
RICON_BOX_GRID = 96,
RICON_GRID = 97,
RICON_BOX_CORNERS_SMALL = 98,
RICON_BOX_CORNERS_BIG = 99,
RICON_FOUR_BOXES = 100,
RIC... | Rust | 0 |
vector of type `__m512i` with all elements set to zero.
///
/// [Intel's documentation](https://software.intel.com/sites/landingpage/IntrinsicsGuide/#avx512techs=AVX512F&expand=33,34,4990&text=_mm512_setzero_si512)
#[inline]
#[target_feature(enable = "avx512f")]
#[cfg_attr(test, assert_instr(vxorps))]
pub unsafe fn _m... | Rust | 0 |
we handle a 'TE: gzip' request header
def test_h2_003_61(self, env):
url = env.mkurl("https", "test1", "/index.html")
r = env.curl_get(url, options=['-H', 'TE: gzip'])
# such a request headers is not allowed in HTTP/2
assert r.exit_code == 92, r
# lets do some error tests
d... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.