text string | label_name string | labels int64 |
|---|---|---|
_exposure_time")]
fn exposure_time(&self) -> Result<f64, glib::Error>;
///
/// # Returns
///
/// auto exposure mode selection
#[doc(alias = "arv_camera_get_exposure_time_auto")]
#[doc(alias = "get_exposure_time_auto")]
fn exposure_time_auto(&self) -> Result<Auto, glib::Error>;
/// Retrieves exposure time bou... | Rust | 0 |
ALID));
}
#[test]
fn InvalidHostname3() {
let mut t = Test::new(TestConfig());
assert!(t.run("34-invalid-hostname.t").is_ok());
assert_eq!(1, t.connp.tx_size());
let tx = t.connp.tx(0).unwrap();
assert!(tx.flags.is_set(HtpFlags::HOSTH_INVALID));
assert!(!tx.flags.is_set(HtpFlags::HOSTU_INVAL... | Rust | 0 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
'a str) -> bool {
error_description.len() > 0 && str_is_nqschar(error_description)
}
// URL parser will handle validity of error_uri
/// grant_type may also be a URI. This only checks grant_name variants
pub fn valid_grant_name_str<'a>(grant_type: &'a str) -> bool {
grant_type.len() > 0 && str_is_name(grant_... | Rust | 0 |
matriz = [[0, 0, 0], [0, 0, 0], [0, 0, 0]]
spar = mai = scol = 0
for l in range(0,3):
for c in range(0,3):
matriz[l][c] = int(input(f'Digite o valor para [{l}, {c}]: '))
print('-='*30)
for l in range(0,3):
for c in range(0,3):
print(f'[{matriz[l][c]:^5}]', end='')
if matriz[l][c]... | Python | 1 |
om_range(minimum: Self, maximum: Self, prng: &mut XorShift128Plus) -> Self {
let diff = maximum.wrapping_sub(minimum) as f32;
let min = minimum as f32;
(min + (prng.random_factor() * diff)) as Self
}
}
impl XorShift128PlusRandomizable for isize {
fn generate(prng: &mut XorShift128Plus)... | Rust | 0 |
Marker {
debug_assert!(SpecialMarker::is_type(obj));
match ImmediateTag::SpecialMarker.untag(obj.0) as u32 {
n if (SpecialMarker::Uninitialized as u32) == n => SpecialMarker::Uninitialized,
n => panic!("{} is not a valid SpecialMarker", n),
}
}
}
impl FromObject for ... | Rust | 0 |
import warnings
from pathlib import Path
from typing import Union
from typeguard import check_argument_types, check_return_type
class DatadirWriter:
"""Writer class to create kaldi like data directory.
Examples:
>>> with DatadirWriter("output") as writer:
... # output/sub.txt is created ... | Python | 1 |
_format(),
&Window::Wayland(ref w) => w.get_pixel_format()
}
}
}
{{doc_comment}}
{{debug}}
pub trait {{rust_trait_local_const}}{{trait_bases_const}} {
fn as_raw_{{rust_local}}(&self) -> {{rust_extern_const}};
{{trait_const_methods}}
}
pub trait {{rust_trait_local}}{{trait_bases_mut}} {
fn a... | Rust | 0 |
_value(val);
print!(")");
}
Expression::BinOp(op, ref lhs, ref rhs) => {
print!("binop({:?}, ", op);
print_value(lhs);
print!(", ");
print_value(rhs);
print!(")");
}
Expression::UnOp(op, ref val) => {
pri... | Rust | 0 |
import keras as K
import tensorflow as tf
import spacy
from keras.layers.recurrent import GRU,LSTM
from keras.layers import Bidirectional,Input,Dense,BatchNormalization,LeakyReLU,Lambda,Reshape,Add,Masking,Dropout,Multiply
from keras import Model
import re
import math
import numpy as np
import keras.backend as K
def ... | Python | 1 |
_id = self.image_token_id,
image_token_caculator = DeepSeekVL2ImageTokenCaculator(self.path),
)
return config
def getLanguageModelConfig(self) -> LanguageModelConfig:
config_ref = DeepseekVLV2Config.from_pretrained(self.path).text_config
n_layers = config_ref.num_hidden... | Python | 1 |
SegmentSelector::new(GdtTable::CS_KERNEL_INDEX as u16, Ring::Ring0)
| SegmentSelector::TI_GDT
}
/// Return the selector for the kernel ss (stack segment).
pub fn kernel_ss_selector() -> SegmentSelector {
SegmentSelector::new(GdtTable::SS_KERNEL_INDEX as u16, Ring::Ring0)
... | Rust | 0 |
from .coco_data import get_coco_data | Python | 1 |
auth_header().send().await?;
if res.status() != 200 {
let status = res.status();
let text = res.text().await.unwrap_or_default();
return Err(Error::InvalidResponse(status, text));
}
let mut cert = None;
let raw = res.text().await?;
let parsed = verify(&raw, VerifyMode::Cer... | Rust | 0 |
from ..action import ReportAction
class ReportActionBTSignal(ReportAction):
"""Warns when a low report rate is discovered and may impact usability."""
def __init__(self, *args, **kwargs):
super(ReportActionBTSignal, self).__init__(*args, **kwargs)
self.timer_check = self.create_timer(2.5, se... | Python | 1 |
: &mut fmt::Formatter<'_>) -> fmt::Result {
if self.is_native() {
write!(f, "<native>")?;
} else {
write!(f, "{}", String::from_utf8_lossy(&self.0))?;
}
Ok(())
}
}
impl std::str::FromStr for Denomination {
type Err = Error;
fn from_str(v: &str) -> Re... | Rust | 0 |
# Copyright 2024 The TensorFlow 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 applica... | Python | 1 |
import matplotlib.pyplot as plt
import numpy as np
test_set = 'val'
con0 = np.load(f'experiments/COCOA/stats/stat_default_no_rgb_{test_set}.npy')
con1 = np.load(f'experiments/COCOA/stats/stat_std_no_rgb_mumford_shah_{test_set}.npy')
con2 = np.load(f'experiments/COCOA/stats/stat_boundary_no_rgb_{test_set}.npy')
con12 ... | Python | 1 |
rror for Error<T> where T: std::error::Error {}
impl<T> From<std::io::Error> for Error<T>
where
T: std::error::Error,
{
fn from(error: std::io::Error) -> Self {
Self::Io(error)
}
}
impl<T> From<SerialPortError> for Error<T>
where
T: std::error::Error,
{
fn from(error: SerialPortError) -> S... | Rust | 0 |
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
from libraries import *
from Dataset import normalization, reverse_normalization
def see_noise_data(
DDPM,
x: torch.Tensor,
df_X: pd.DataFrame,
) -> None:
fig, axs = plt.subplots(1, 5)
original_m... | Python | 1 |
y: &str) -> Option<&Vec<RawConfig>>;
/// Returns an `RCHash` by a given string key, if such an `RCHash` exists; `None` otherwise.
fn get_hash(&self, key: &str) -> Option<&RCHash>;
}
/// Shorthand to build a `RawConfig`-wrapped string, used in accessing an object via a key
pub (crate) fn k(str_key: &str) -> Ra... | Rust | 0 |
::default()
.with_node_id("bubba-node-000".into())
.with_endpoints(
&vec!["tcps://splinterd-node-bubba:8044".into(),
"tcps://splinterd-node-bubba-2:8044".into()])
.bu... | Rust | 0 |
"""
问题2:利用 FY1 投放 1 枚烟幕干扰弹干扰 M1,确定 FY1 的航向、速度、投放点、起爆点,
使“对 M1 的有效遮蔽总时长”最大。
-----------------------------------------------------------------------
建模口径(与问题1一致):
- 导弹 M1 速度 300 m/s,沿直线飞向假目标 (0,0,0)。
- FY1 受领任务后可瞬时定向,然后以 v∈[70,140] m/s 等高度直线匀速飞行(z=1800)。
- 烟幕弹脱离后为抛体:初速=FY1 水平速度,受重力 g。
- 起爆后瞬时形成半径不计的云团中心,之后仅以 3 m/s 竖直下沉,起... | Python | 1 |
<T: AsExpression<Bool>>(expr: T) -> not<T> {
super::operators::Not::new(Grouped(expr.as_expression()))
}
//! # sys (UNIX)
//!
//! UNIX-specific structs and functions. Will be imported as `sys` on UNIX systems.
use std::env::var;
use std::sync::atomic::{AtomicBool, Ordering};
// On UNIX systems, termios represents... | Rust | 0 |
import pytest
@pytest.fixture
def test_device(tmp_path):
"""Create an AVD configuration file."""
config_file = tmp_path / "home/.android/avd/testDevice.avd/config.ini"
config_file.parent.mkdir(parents=True)
# Write a default config. It contains:
# * blank lines
# * a key whose value explicitl... | Python | 1 |
#!/usr/bin/python
#
# Copyright 2015 Google 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 |
"framework")]
#[link(name = "CoreBluetooth", kind = "framework")]
extern "C" {
pub fn dispatch_queue_create(
label: *const c_char,
attr: dispatch_queue_attr_t,
) -> dispatch_queue_t;
}
mod link {
use super::*;
#[link(name = "CoreBluetooth", kind... | Rust | 0 |
# -*- coding: utf-8 -*- #
# Copyright 2020 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 |
);
assert_eq!(status.activity, Some("test".into()));
}
}
<filename>tests/ui/01-fail-missing-repr.rs
#![feature(const_trait_impl)]
use const_enum::ConstEnum;
#[derive(ConstEnum)]
enum Test {
A = 1,
B = 2,
C = 3,
}
pub fn main() {}
<filename>src/memory/mod.rs
use std::fmt;
pub trait Memory {
... | Rust | 0 |
#
# Copyright BitBake Contributors
#
# SPDX-License-Identifier: GPL-2.0-only
#
import argparse
import logging
import os
logger = logging.getLogger('bitbake-layers')
class LayerPlugin():
def __init__(self):
self.tinfoil = None
self.bblayers = []
def tinfoil_init(self, tinfoil):
self.... | Python | 1 |
use dirs;
use base64;
use domain::a2a::*;
use domain::a2connection::*;
use domain::config::*;
use domain::key_deligation_proof::*;
use domain::invite::*;
use domain::status::*;
use env_logger;
use failure::{err_msg, Error, Fail};
use futures::*;
use indy::{self, did, wallet, crypto};
use std::env;
use std::fs;
use std:... | Rust | 0 |
s
//! Middleware that creates a log entry for each HTTP request.
mod middleware;
mod service;
pub use self::middleware::LogMiddleware;
pub use self::service::{LogService, ResponseFuture};
<reponame>thatsimplekid/QuiVive<filename>src/helpers/warn_helper.rs
/* <NAME> - A Discord bot to keep out the riff-raff
* Copyr... | Rust | 0 |
n.h
define_guid!(IID_ID3D10Blob, 0x8ba5fb08, 0x5195, 0x40e2, 0xac, 0x58, 0xd, 0x98, 0x9c, 0x3a, 0x1, 0x2);
// d3d11shader.h
define_guid!(IID_ID3D11ShaderReflectionType, 0x6e6ffa6a, 0x9bae, 0x4613, 0xa5, 0x1e, 0x91, 0x65, 0x2d, 0x50, 0x8c, 0x21);
define_guid!(IID_ID3D11ShaderReflectionVariable, 0x51f23923, 0xf3e5, 0x4b... | Rust | 0 |
import base64
from typing import Dict
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_v1_5
from ..utils import post
BASE_URL = "https://passport.bilibili.com/"
async def _encrypt_pwd(pwd: str) -> str:
"""加密密码"""
url = f"{BASE_URL}api/oauth2/getKey"
resp: Dict[str, str] = await post(url... | Python | 1 |
x7F14_1102, 0x4A8E_6584),
(r"textures\vfx_smokealpha00a.dds", 0x7F16_1202, 0xA42D_1A7C),
(r"textures\vfx_alpha_spark02.dds", 0x7F17_0002, 0x7582_F9D8),
(r"textures\vfx_alpha_steam00.dds", 0x7F17_0002, 0xCD57_C133),
(r"meshes\x\flora_t_podbud_04.nif", 0x7F1C_1126, 0x5C97_C5C0),
(r"meshes\x\flora... | Rust | 0 |
_ENTER_GETEVENTS: u32 = 1;
pub const IORING_ENTER_SQ_WAKEUP: u32 = 1 << 1;
/// Passed in for io_uring_setup(2). Copied back with updated info on success
#[repr(C)]
#[derive(Copy, Clone, Debug, Default)]
pub struct io_uring_params_t {
pub sq_entries: u32,
pub cq_entries: u32,
pub flags: u32,
pub sq_thre... | Rust | 0 |
}
k = m_idum / IQ;
m_idum = IA * (m_idum - k * IQ) - IR * k;
if m_idum < 0 {
m_idum += IM;
}
let j = m_iy / NDIV;
m_iy = m_iv[j as usize];
m_iv[j as usize] = m_idum;
self.m_idum = m_idum;
self.m_iy = m_iy;
m_iy
... | Rust | 0 |
import torch
import torch.nn as nn
from train import MiniTransformer
def load_model(model_path, device='cpu'):
"""Load trained model from checkpoint"""
checkpoint = torch.load(model_path, map_location=device)
# Get architecture from checkpoint, with defaults for older models
d_model = checkpoint.g... | Python | 1 |
= None;
tp.default = None;
tp.bounds.clear();
},
GenericParam::Const(ref mut c) => {
c.eq_token = None;
c.default = None;
}
}
}
if generics.where_clause.as_ref().map_or(false, |clause| clause.predicates.... | Rust | 0 |
Unsupported, &Unsupported,
/* 0x10 */ /* 0x11 */ /* 0x12 */ /* 0x13 */ /* 0x14 */ /* 0x15 */ /* 0x16 */ /* 0x17 */
&Unsupported, &Unsupported, &Unsupported, &Unsupported, &Unsupported, &Unsupported, &Unsupported, &Unsupported,
/* 0x18 */ /* 0x19 */ /* ... | Rust | 0 |
storage-items
decl_storage! {
trait Store for Module<T: Config> as TaskStore {
//Map to track TaskID to Task info.
TaskStorage get(fn task):
map hasher(blake2_128_concat) u128 => TaskDetails<T::AccountId, BalanceOf<T>>;
// Counter to store current task count/ID.
... | Rust | 0 |
Metadata = MaxTokenMetadata;
}
pub type NftError = nft::Error<Test>;
// Build genesis storage according to the mock runtime.
pub fn new_test_ext() -> sp_io::TestExternalities {
system::GenesisConfig::default()
.build_storage::<Test>()
.unwrap()
.into()
}
pub fn run_to_block(n: u32) {
while System::block_numb... | Rust | 0 |
# Copyright (c) 2024, RoboVerse community
# SPDX-License-Identifier: BSD-3-Clause
import json
import logging
from ...domain.interfaces import IRobotController
from ..utils.command_generator import gen_mov_command
from ...domain.constants import RTC_TOPIC
logger = logging.getLogger(__name__)
class RobotControlSer... | Python | 1 |
ner = separated_list1(comma_sep::<Ty>, object_destructure_field::<T, Ty>);
let inner = terminated(inner, opt(comma_sep::<Ty>));
let inner = delimited(
terminated(tag_char('{'), ws::<Ty>),
inner,
preceded(ws::<Ty>, tag_char('}')),
);
map(inner, |fields| ObjectDestructure { fields ... | Rust | 0 |
def make_a_pile(n):
"""
Given a positive integer n, you have to make a pile of n levels of stones.
The first level has n stones.
The number of stones in the next level is:
- the next odd number if n is odd.
- the next even number if n is even.
Return the number of stones in each leve... | Python | 1 |
.Clock(**default_data)],
27,))]
@hook.subscribe.client_new
def dialogs(window):
if(window.window.get_wm_type() == 'dialog'
or window.window.get_wm_transient_for()):
window.floating = True
@hook.subscribe.client_new
def grouper(window, windows={'firefox-aurora': 'home',... | Python | 1 |
| 2
# "Light haze" | 5 | 5 | 4
# "Smoggy air" | 4 | 6 | 5
# "Light fog" | 3 | 8 | 7
# "Thick fog" | 1-2 | 9 | 8
def _ivc_to_model_input(ivc, actual_yield, burst_hei... | Python | 1 |
(20, 0));
// Check that the cloud-hypervisor binary actually terminated
if let Ok(status) = child.wait() {
aver_eq!(tb, status.success(), true);
}
let _ = child.wait();
Ok(())
});
}
#[cfg_attr(not(feature = "mmio"), test)]
... | Rust | 0 |
}
}
#[derive(Debug)]
pub struct TlsStream {
pub(crate) inner: tokio_rustls::server::TlsStream<tokio::net::TcpStream>,
pub(crate) hostnames: std::sync::Arc<Vec<String>>,
}
impl TlsStream {
#[inline]
pub fn local_addr(&self) -> Result<SocketAddr, io::Error> {
let (io, _) = self.inner.get_r... | Rust | 0 |
bus::BusType::Session).unwrap();
let p = c2.with_path(cname, "/test", 1000);
let v = p.get("Interface.Name", "Property.Name").unwrap();
assert_eq!(v.as_i64(), Some(5));
let vv = p.set("Interface.Name", "Property.Name", dbus::arg::Variant(Box::new("Hello".to_string())));
assert_e... | Rust | 0 |
import streamlit as st
import os
import google.generativeai as genai
from streamlit_lottie import st_lottie
from streamlit_lottie import st_lottie_spinner
from authorization import authorization
import requests
from dotenv import load_dotenv
# Load environment variables
load_dotenv()
api_key = os.getenv("API_KEY")
... | Python | 1 |
# This script was generated by an AI model and has not been reviewed by a human expert. Please use with caution.
# Import necessary libraries from SunPy
from sunpy.net import Fido, attrs as a
import datetime
# WARNING: The time ranges defined here may be too broad for the VSO to return complete results.
# Consider us... | Python | 1 |
"""Telemetry module for experiment tracking."""
from .experiment import ExperimentLogger
__all__ = ["ExperimentLogger"]
| Python | 1 |
s)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `XTAL32K_WDT_TIMEOUT` writer - If no clock detected for this amount of time"]
pub struct XTAL32K_WDT_TIMEOUT_W<'a> {
w: &'a mut W,
}
impl<'a> XTAL32K_WDT_TIMEOUT_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always... | Rust | 0 |
T: ?Sized + 'a> {
__lock: &'a RwLock<T>,
}
// impl<'a, T: ?Sized> !marker::Send for RwLockReadGuard<'a, T> {}
#[must_use]
pub struct RwLockWriteGuard<'a, T: ?Sized + 'a> {
__lock: &'a RwLock<T>,
__poison: poison::Guard,
}
// impl<'a, T: ?Sized> !marker::Send for RwLockWriteGuard<'a, T> {}
impl<T> RwLoc... | Rust | 0 |
3, 9, 9, 6, 4, 4, 4, 4, 4, 2, 1, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3,
];
let input: Vec<u8> = input.iter().map(|n| n + 240).collect();
let output: Vec<u16> = output.iter().map(|n| n + 240).collect();
assert_eq!(
rleunpack(&input, 8, 250, Some(21)),
Ok(output.into_b... | Rust | 0 |
FindAccountFromAuthorIndex<Self, Aura>;
type UncleGenerations = UncleGenerations;
type FilterUncle = ();
type EventHandler = (CollatorSelection,);
}
parameter_types! {
pub const Period: u32 = 6 * HOURS;
pub const Offset: u32 = 0;
pub const MaxAuthorities: u32 = 100_000;
}
impl pallet_session::Config for Runtime... | Rust | 0 |
ck_base {
pgt.dealloc_proc_pagetable(proc_size);
return Err("cmd args too much for stack")
}
if pgt.copy_out(arg_slice.as_ptr(), stack_pointer, count).is_err() {
pgt.dealloc_proc_pagetable(proc_size);
return Err("copy cmd args to pagetable go wrong")
... | Rust | 0 |
# This file is part of creddump.
#
# creddump 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.
#
# creddump is distributed in the hope t... | Python | 1 |
ion::is_none")]
pub sorted: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stable: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub stale: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub start_key: Option<String>,
#[serde(... | Rust | 0 |
const UNIT_ANSWER_10A_1: Point = Point { x: 5, y: 8 };
const UNIT_ANSWER_10A_2: Point = Point { x: 1, y: 2 };
const UNIT_ANSWER_10A_3: Point = Point { x: 6, y: 3 };
const UNIT_ANSWER_10A_4: Point = Point { x: 11, y: 13 };
#[test]
fn t10a() {
assert_eq!(
ANSWER_10A,
... | Rust | 0 |
# create virtual host element
phys_id = physical_host.get("id")
host_id = f"{phys_id}/{node.name}"
host_element = etree.SubElement(
physical_host, "testHost", id=host_id, name=node.name
)
# add host type
add_type(host_element, "virtual")
for iface in... | Python | 1 |
nop;
nop;
str r1, [r0, r2];
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
nop;
... | Rust | 0 |
tion<Type> {
let mod_name = self.get_modname(inter, from, env);
let mod_args = self.get_modargs(inter, from, env);
// yet another hack here :(
let ptr;
match inter.modifiers.get(&mod_name) {
Some(func) => {
use std::borrow::Borrow;
ptr = func.borrow() as *const ModifierFunc;
},
None => {retur... | Rust | 0 |
import torch
def stylegan2onnx(_ckpt, _onnx):
from stylegan2.model import Generator
# change Generator forward to forward_z
model = Generator(256, 512, 8)
ckpt = torch.load(_ckpt, map_location="cpu")
model.load_state_dict(ckpt['g_ema'], strict=False)
dlatent = torch.randn(1, 512, device='cpu'... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@author Francisco Presenza
@institute LAR - FIUBA, Universidad de Buenos Aires, Argentina
@date lun sep 13 20:27:17 -03 2021
"""
import numpy as np
class LocalizationFilter(object):
def __init__(self, state, time=0.0):
self.x = state.copy()
self.t ... | Python | 1 |
"""
External dependency unit tests for the feature flag service.
These tests verify the feature flag service implementation with real
PostHog integration when available, and fallback behavior otherwise.
"""
from uuid import UUID
from ee.onyx.feature_flags.posthog_provider import PostHogFeatureFlagProvider
from onyx.... | Python | 1 |
_section_idx)
.ok_or_else(|| traits::Error::with_msg("Could not find section size"))?;
assert!(added <= size);
items.add_root(ir::Item::new(id, name, size - added, ir::Misc::new()));
Ok(())
}
type EdgesExtra = &'a SectionIndices;
fn parse_edges(
&mut self,
... | Rust | 0 |
Revealed: bool,
isFlagged: bool,
isUnknown: bool,
adjacentBombs: i32,
isHint: bool
}
#[derive(Clone, Serialize, Deserialize, Hash, Eq, PartialEq, Debug)]
pub struct Board {
rows: i32,
cols: i32,
cells: Vec<Vec<Cell>>
}
pub type IndexPair = (i32, i32);
pub type IndexVector = Vec<IndexPair>;
type Matrix<T... | Rust | 0 |
dsaPrivateKey::NistP256(k) => {
EcdsaPrivateKey::NistP256(
p256::ecdsa::SigningKey::from_bytes(&k.to_bytes()).unwrap(), /* safe: round-trip */
)
}
}
}
}
/// `EcdsaSigner` is an implementation of [`tink_core::Signer`] for ECDSA.
/// At the mome... | Rust | 0 |
ster: ::vcell::VolatileCell<u8>,
}
#[doc = "Reset Cause"]
pub mod rcause;
use common::{divide, alternate_divide, RD};
use std::cmp::max;
// julian day 146
pub static EPOCH: i32 = -1721279;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct BaliPowukon {
pub luang: bool,
pub dwiwara: i32,
pub triwara:... | Rust | 0 |
storage_capacities = {
'Normal': 200,
'Cold': 100,
'Frozen': 100
} | Python | 1 |
lid(*b, s)
}
/// Construct a new window with any necessary initial data
///
/// # Safety
///
/// Window should only be created if it is valid
unsafe fn new(init: Self::InitData) -> Self;
/// Translate a physical address to be within the range of the window
///
/// # Safety
//... | Rust | 0 |
all(&send_buf)?;
self.device.flush()?;
let mut header_buf = [1; 3];
self.device.read_exact(&mut header_buf)?;
let len = check_header_and_get_payload_size(&header_buf)?;
let mut buf_remaining = Vec::new();
buf_remaining.resize(len + 3, 1);
self.device.read_exact(&m... | Rust | 0 |
Stmt::Break(s) => *s,
Stmt::Continue(s) => *s,
Stmt::Empty(s) => *s,
}
}
}
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde_impl", derive(Serialize, Deserialize))]
pub struct DeclStmt {
pub is_const: bool,
pub name: Ident,
pub ty: TyDef,
pub val: Option<P<Expr>>,... | Rust | 0 |
# if, else, else if statements
#they follow the order of if -> elif -> else or if -> else
# use >=, <= and == to equate
#use COLONS after conditions
#the order of statements matter to prevent a situation where a condition can be determined to be true by two or more statements
age = int( input('How old are you? : '))
i... | Python | 1 |
links to specified DocTypes when deleting documents
# -----------------------------------------------------------
# ignore_links_on_delete = ["Communication", "ToDo"]
# Request Events
# ----------------
# before_request = ["hr_reports.utils.before_request"]
# after_request = ["hr_reports.utils.after_request"]
# Job... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2023 Daniel Estevez <daniel@destevez.net>
#
# This file is part of gr-satellites
#
# SPDX-License-Identifier: GPL-3.0-or-later
#
from gnuradio import gr, blocks, gr_unittest
import numpy as np
# bootstrap satellites module, even from build dir
try:
impor... | Python | 1 |
:sync::Arc;
use std::thread;
/// Simple checkbox. Provides a change hook and the ability to get the state.
/// When checked, the inner box is set to being visible and vise versa.
impl KeepAlive for CheckBox {}
pub struct CheckBox {
pub basalt: Arc<Basalt>,
pub inner_box: Arc<Bin>,
pub outer_box: Arc<Bin>,
checke... | Rust | 0 |
# Rewarder module for only using cosine simliarity
import numpy as np
import torch
import sys
import torch.nn.functional as F
from .rewarder import Rewarder
class Cosine(Rewarder):
def __init__(
self,
**kwargs
):
super().__init__(**kwargs)
def get(self, obs):
# G... | Python | 1 |
# Samuel Gutiérrez Merino
# Escribe un programa que pida el limite inferior y superior de un intervalo. Si el límite inferior es mayor que el superior lo tiene que volver a pedir.
# A continuación se van introduciendo números hasta que introduzcamos el 0. Cuando termine el programa dará las siguientes informaciones:
# ... | Python | 1 |
# Copyright (C) 2020 Adek Maulana
#
# SPDX-License-Identifier: GPL-3.0-or-later
# 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 3 of the License, or
# (at your option) any later v... | Python | 1 |
from t2m.data.dataset import Text2MotionDatasetV2, collate_fn
from t2m.utils.word_vectorizer import WordVectorizer
import numpy as np
from os.path import join as pjoin
from torch.utils.data import DataLoader
from t2m.utils.get_opt import get_opt
def get_dataset_motion_loader(opt_path, batch_size, device):
opt = ge... | Python | 1 |
`b` as shape parameters.
References
----------
.. [1] https://en.wikipedia.org/wiki/Beta_negative_binomial_distribution
%(after_notes)s
.. versionadded:: 1.12.0
See Also
--------
betabinom : Beta binomial distribution
%(example)s
c [ SSS[ R 4S5 [... | Python | 1 |
PAN_SURROUND_FLAGS {
match value {
DspPanSurroundFlags::Default => ffi::FMOD_DSP_PAN_SURROUND_DEFAULT,
DspPanSurroundFlags::RotationNotBiased => {
ffi::FMOD_DSP_PAN_SURROUND_ROTATION_NOT_BIASED
}
}
}
}
impl DspPanSurroundFlags {
pub fn from(va... | Rust | 0 |
unction_nav += ' | [next >](%s)' % doc_page_link(pnum + 1)
buffer = buffer.replace('$[FUNCTION_NAV_HERE', function_nav)
with open(get_path(out_filename_docs % page_name), 'w', encoding='utf-8', newline='\n') as out:
out.write(buffer)
#######################################################... | Python | 1 |
!("{}", e);
HttpResponse::InternalServerError().finish()
})?;
if let Some(loc) = loc {
Ok(HttpResponse::Ok().json(loc.description))
}else {
Ok(HttpResponse::NotFound().finish())
}
}
pub async fn post_body_by_id_json(
path: web::Path<i32>
, pool: web::Data<DbPool>... | Rust | 0 |
#[doc = "STATUS_W1TS register accessor: an alias for `Reg<STATUS_W1TS_SPEC>`"]
pub type STATUS_W1TS = crate::Reg<status_w1ts::STATUS_W1TS_SPEC>;
#[doc = ""]
pub mod status_w1ts;
#[doc = "STATUS_W1TC register accessor: an alias for `Reg<STATUS_W1TC_SPEC>`"]
pub type STATUS_W1TC = crate::Reg<status_w1tc::STATUS_W1TC_SPEC... | Rust | 0 |
K:
parsed_hsp['hit']['seq'] += self.line.strip()
elif state == _STATE_QUERY_BLOCK:
parsed_hsp['query']['seq'] += self.line.strip()
elif state == _STATE_CONS_BLOCK:
hsp.fragment.aln_annotation['homology'] += \
... | Python | 1 |
#
# python_mldb_interface_test.py
# mldb.ai inc, 2015
# This file is part of MLDB. Copyright 2015 mldb.ai inc. All rights reserved.
#
from mldb import mldb
conf = {
"type": "import.sentiwordnet",
"params": {
"dataFileUrl": 's3://public-mldb-ai/testing/MLDB-1084/SentiWordNet_3.0.0_20130122.txt.gz',
... | Python | 1 |
::response::ParseStrictResponse for ModifyVpcTenancy {
type Output =
Result<crate::output::ModifyVpcTenancyOutput, crate::error::ModifyVpcTenancyError>;
fn parse(&self, response: &http::Response<bytes::Bytes>) -> Self::Output {
if !response.status().is_success() && response.status().as_u16() != ... | Rust | 0 |
css).or(main_js).or(main_wasm).or(index_js)
});
let audio_files = warp::get()
.and(warp::path(paths::audio::PREFIX))
.and({
api::wav(paths::audio::CHIMES, files::audio::CHIMES)
.or(api::wav(paths::audio::CHORD, files::audio::CHORD))
.or(api::wav(paths... | Rust | 0 |
gn
mwFreq : float
The microwave frequency in MHz
Range : float
The field range in mT
knots : int, optional
The number of knots of orientation averaging, by default 19
npoints : int, optional
The number of points in the spectrum, by default 1000
Returns
-------
... | Python | 1 |
ext = "I encountered an error while searching. Could you try asking in a different way?"
# Handle the response
if response_text.strip():
print("Jarvis:", response_text)
conversation_context.append({"role": "assistant", "content": response_text})
... | Python | 1 |
load_capacity", UNSET)
remark = d.pop("remark", UNSET)
seats = d.pop("seats", UNSET)
surface_area = d.pop("surface_area", UNSET)
width = d.pop("width", UNSET)
vehicle_itemput_request_schema = cls(
cost_rate=cost_rate,
custom=custom,
folder... | Python | 1 |
... bench: 91,360 ns/iter (+/- 3,417)
// test itoa_u64_simple_lexical ... bench: 43,714 ns/iter (+/- 771)
// test itoa_u64_simple_std ... bench: 373,320 ns/iter (+/- 6,293)
// test itoa_u64_std ... bench: 489,783 ns/iter (+/- 27,719)
// test itoa_u128_he... | Rust | 0 |
# -*- coding: utf-8 -*-
from __future__ import print_function
import sys
# 检查当前Python版本,确保兼容性
if sys.version_info.major < 3:
print("警告: 建议在Python 3环境下运行此测试脚本。")
try:
# --- 这是关键的修改 ---
# 我们明确地告诉Python,要从'bloom'这个包里导入'rosdistro_api'模块
from bloom.rosdistro_api import get_index, list_distributions, get_d... | Python | 1 |
"""魔法管理UIシステム(WindowSystem統合版)"""
from typing import Optional, Callable
from enum import Enum
from src.ui.window_system import WindowManager
from src.ui.window_system.magic_window import MagicWindow
from src.magic.spells import SpellBook, Spell
from src.character.party import Party
from src.character.character import... | Python | 1 |
tr, key: Vec<u8>) -> Result<bool> {
record_metrics("db", prefix_name, "contains_key", self.metrics.as_ref()).call(|| match self
.get(prefix_name, key)
{
Ok(Some(_)) => Ok(true),
_ => Ok(false),
})
}
fn remove(&self, prefix_name: &str, key: Vec<u8>) -> ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.