text string | label_name string | labels int64 |
|---|---|---|
from .base import AdaptiveLIFGroup
from .adaptive_learn import AdaptLearnLIFGroup | Python | 1 |
from rest_framework.routers import DefaultRouter
from django.urls import path, include
from .views import PostViewSet, CommentViewSet
from . import views
router = DefaultRouter()
router.register(r'posts', PostViewSet)
router.register(r'comments', CommentViewSet)
urlpatterns = [
path('', include(router.urls)),
... | Python | 1 |
AbsoluteOrRelativeTimeType {
fn default() -> AbsoluteOrRelativeTimeType {
Self::__Unknown__("No valid variants".into())
}
}
impl Validate for AbsoluteOrRelativeTimeType {}
pub type CurrentTime = xs::DateTime;
pub type TerminationTime = xs::DateTime;
pub type ProducerProperties = QueryExpressionType;
... | Rust | 0 |
tree_cancel: Option<oneshot::Sender<()>>,
pub commands: HashMap<i32, Arc<RichCommand>>,
pub commands_view: Vec<Arc<RichCommand>>,
pub jobs: HashMap<i32, Arc<RichJob>>,
pub jobs_graphs: HashMap<CmdId, JobsGraph>,
pub steps: HashMap<i32, Arc<RichStep>>,
pub steps_view: HashMap<JobId, Vec<Arc<Ri... | Rust | 0 |
{
panic!("directory read failed");
}
(*dev_font).name = new(((name_length + 1i32) as u32 as u64)
.wrapping_mul(::std::mem::size_of::<i8>() as u64) as u32) as *mut i8;
if ttstub_input_read(vf_handle, (*dev_font).name, name_length as size_t) != name_length as i64 {
panic!("directory re... | Rust | 0 |
e_test() {
let options = Default::default();
let mut chunk = Chunk::new([0.0, 0.0, 0.0], 1, 1, 1);
chunk.set(0, 0, 0, (0, 1));
let mesh = VoxelBaker::bake::<Chunk, Texture2d, Mesh>(&chunk, &options)
.unwrap()
.unwrap();
let positions_count = mesh.get_positions().len();
let indices... | Rust | 0 |
#Я добавил сюда эту функцию для быстрой подготовки видео
import os
import cv2
from os.path import isfile, join
#Указание директорий видео и директории вырезанных кадров
video_directory = "videos/"
output_directory = "frames/"
def extract_frames(video_dir, output_dir):
videos = [f for f in os.listdir(video_dir)... | Python | 1 |
pub fn matches_name_builder(matches: &ArgMatches) -> Result<X509Name, ParseError> {
let mut x509_name = X509NameBuilder::new()?;
let cn = matches.value_of("cn").ok_or("common name")?;
x509_name.append_entry_by_text("CN", cn)?;
if let Some(x) = matches.value_of("st") {
x509_name.append_entry_b... | Rust | 0 |
ize) {
let auxv = auxv();
(auxv.hwcap, auxv.hwcap2)
}
#[inline]
pub(crate) fn linux_execfn() -> &'static ZStr {
unsafe { ZStr::from_ptr(auxv().execfn as *const _) }
}
#[inline]
pub(crate) fn exe_phdrs() -> (*const c::c_void, usize) {
let auxv = auxv();
(auxv.phdr as *const c::c_void, auxv.phnum)
}... | Rust | 0 |
from __future__ import absolute_import, division, print_function
from cctbx import sgtbx
import scitbx.math
from libtbx.utils import format_cpu_times
import sys
from six.moves import range
special = {
9: 8, 15: 8, 17: 4, 19: 12, 20: 4, 24: 12, 43: 4, 67: 4, 68: 4, 70: 18,
73: 12, 74: 4, 80: 4, 85: 4, 86: 4, 88: 6,... | Python | 1 |
::reference_moles()).unwrap();
let state = StateHD::new(
Dual64::from_re(temperature),
Dual64::from_re(volume).derive(),
arr1(&[Dual64::from_re(moles)]),
);
let pressure =
-contrib.helmholtz_energy(&state).eps[0] * temperature * EosUnit::reference_... | Rust | 0 |
with different concurrency. Once the profiling is done, then the program exits.
.. seealso::
:ref:`Example: Pipeline definitions <pipeline-definitions-example>`
Illustrates how to build a complex pipeline.
:py:func:`profile_pipeline`
A function to profile a Pipeline stage... | Python | 1 |
import torch
def format_time(seconds):
days = int(seconds / 3600/24)
seconds = seconds - days*3600*24
hours = int(seconds / 3600)
seconds = seconds - hours*3600
minutes = int(seconds / 60)
seconds = seconds - minutes*60
secondsf = int(seconds)
seconds = seconds - secondsf
millis = i... | Python | 1 |
PartialEq, Debug)]
struct GlyphDescriptor {
size: u32,
glyph: Glyph,
}
/// Struct containing a font and a cache of rendered glyphs.
pub struct FontFace<'a> {
/// Font.
pub font: Font<'a>,
}
/// Struct containing font, size and baseline.
#[allow(missing_docs)]
pub struct FontDescription<'a, 'b> {
... | Rust | 0 |
ESCAPING](https://developer.android.com/reference/javax/xml/transform/Result.html#PI_DISABLE_OUTPUT_ESCAPING)
pub const PI_DISABLE_OUTPUT_ESCAPING : &'static str = "javax.xml.transform.disable-output-escaping";
/// public static final [PI_ENABLE_OUTPUT_ESCAPING](https://developer.android.com/reference/... | Rust | 0 |
tf8(vec![b'X'; 220]).unwrap());
let mangled = mangle_string(&path);
assert!(mangled.as_bytes().len() < MAX_MANGLED_NAME_LENGTH);
assert_eq!(
path,
restore_slashes(&mangled)
.expect("must decode")
.expect("must be reversible")
);
}
/// A long path should be clea... | Rust | 0 |
_>> {
let _raw = super::raw_guard::RawGuard::new();
let ex = async_executor::Executor::new();
let input = ex.spawn(async {
let mut buf = [0_u8; 4096];
let mut stdin = async_std::io::stdin();
loop {
match stdin.read(&mut buf).await {
... | Rust | 0 |
import pandas as pd
import re
# Function to convert DMS to Decimal Degrees
def dms_to_decimal(dms):
try:
if not dms or dms.strip() == "":
return "" # Return empty for empty input
# Extract degrees, minutes, and seconds
match = re.match(r"(\d+)°(\d+)'([\d.]+)", dms.stri... | Python | 1 |
{ func_name: _f, comment: S("")})?;
let serialized = bytes.stringify()?;
let app_msg: Box<dyn AppMessage> = serde_json::from_str(&serialized).context(NocError::Chain { func_name: _f, comment: S("") })?;
{
if CONFIG.trace_options.all || CONFIG.trace_options.noc {
... | Rust | 0 |
.headers.get('Referer', '').split('owllook_content')[1]
if owl_referer:
latest_read = "/owllook_content" + owl_referer
await motor_db.user_message.update_one(
{'user': user, 'books_url.book_url': book_url},
{'$set': {'books_url.$.last_r... | Python | 1 |
MDeviceEnumerator,
IMMNotificationClient, MMDeviceEnumerator, IMMDevice, IAudioSessionManager2,
IAudioEndpointVolume, IAudioEndpointVolumeCallback, IMMDeviceCollection,
IAudioSessionNotification, IAudioSessionControl, IAudioSessionEvents,
AudioSessionState... | Rust | 0 |
_with_nextgen_public_keys));
counters::EPOCH_NUM.set(0); // No reconfiguration yet, so it is always zero
counters::CURRENT_EPOCH_NUM_VALIDATORS.set(validator.len() as i64);
counters::CURRENT_EPOCH_QUORUM_SIZE.set(validator.quorum_size() as i64);
debug!("[Consensus]: quorum_size = {:?}", ... | Rust | 0 |
elif p_val < 0.01:
significance = '**'
elif p_val < 0.05:
significance = '*'
# else:
# print(f'p value > 0.05 for {stat_name}')
palette = color_dict
plt.figure(figsize=(10, 6))
#actually plot
sns.boxplot(x = 'Group', y = 'Value', da... | Python | 1 |
a product.",
"func": lambda x: program_manager_support_function(x)
},
{
"name": "product manager agent",
"description": " Product Manager, responsible for defining the user stories for a product",
"func": lambda x: product_manager_support_function(x)
}
]
routing_agent.agen... | Python | 1 |
,
)
transformer = BenefitCostInverter()
ranker = CODAS()
dm_transformed = transformer.transform(dm)
result = ranker.evaluate(dm_transformed)
assert result.values_equals(expected)
assert result.method == expected.method
assert np.allclose(result.e_.score, expected.e_.score, atol=1.0e-3... | Python | 1 |
)
.collect();
let begin = Instant::now();
let boxed = if not_that_naive {
not_that_naïve::<_, N>(data)
} else if naive {
naïve::<_, N>(data)
} else {
maybe_uninit::<_, N>(data)
};
let sum = boxed.iter().copied().map(u64::from).sum::<u64>();
let elapsed = begi... | Rust | 0 |
Agent.RequestName(self.agent_id)
self.requested = True
def is_name_ready(self):
"""Check if the name is ready."""
return Agent.IsNameReady(self.agent_id)
def get_name(self):
"""
Get the agent's name.
"""
if not self.name_ready or self... | Python | 1 |
ror;
use crate::syntax::SyntaxKind;
#[derive(Debug, PartialEq)]
pub enum Event {
StartNode {
kind: SyntaxKind,
forward_parent: Option<usize>,
},
AddToken,
FinishNode,
Error(ParseError),
Placeholder,
}
<reponame>rylev/wascc-host
#![doc(html_logo_url = "https://avatars0.githubuser... | Rust | 0 |
/// * ratio_width: `u32`
/// * ratio_height: `u32`
Ratio(f32, f32),
}
#[derive(Debug, Copy, Clone)]
/// Orientation options as an enum
pub enum Orientation {
/// Option for a vertical orientation
Vertical,
/// Option for a horizontal orientation
Horizontal,
}
#[derive(Debug, Clone)]
pub enum E... | Rust | 0 |
{
U::from(self)
}
}
impl WebGl2From<TextureFormat> for (u32, u32, u32) {
fn from(val: TextureFormat) -> Self {
match val {
TextureFormat::R8Unorm => (Gl::R8, Gl::RED, Gl::UNSIGNED_BYTE),
TextureFormat::R8Snorm => (Gl::R8_SNORM, Gl::RED, Gl::BYTE),
TextureFor... | Rust | 0 |
ry<'a> {
pub fn new(key: &'a (Timestamp, Bytes)) -> Self {
Self {
key,
value: None,
compressed: None,
position: None,
}
}
}
<filename>benches/benchmark.rs<gh_stars>10-100
#[macro_use]
extern crate criterion;
use std::net::{Ipv4Addr, Ipv6Addr};
use... | Rust | 0 |
texture_atlas: textures.add(TextureAtlas::from_grid(
asset_server.load("coin.png"),
Vec2::new(16.0, 16.0),
5,
1,
)),
transform: Transform::from_scale(Vec3::splat(10.0)),
..Default::default()
})
.insert(an... | Rust | 0 |
contract: Address,
value: Wei,
input: Vec<u8>,
gas_limit: u64,
access_list: Vec<(Address, Vec<H256>)>, // See EIP-2930
handler: &mut P,
) -> EngineResult<SubmitResult> {
let executor_params = StackExecutorParams::new(
gas_limit,
self.cu... | Rust | 0 |
.into_iter()
.fold(BoolExpr::And(Box::new(l), Box::new(r)), |acc, itm| {
BoolExpr::And(Box::new(itm), Box::new(acc))
})
}
/// Evaluates a boolean expression
pub fn eval(&self, values: &HashMap<VarLabel, bool>) -> bool {
match self {
&B... | Rust | 0 |
)
return ds
def _ds_from_nwb_object(
nwb_file: pynwb.file.NWBFile,
processing_module_key: str = "behavior",
pose_estimation_key: str = "PoseEstimation",
) -> xr.Dataset:
"""Extract a ``movement`` poses dataset from an NWBFile object.
Parameters
----------
nwb_file : pynwb.file.NWB... | Python | 1 |
:Value, D::Error> {
d.deserialize_any(self)
}
fn visit_none<E: Error>(self) -> Result<Self::Value, E> {
Ok(None)
}
}
#[derive(Debug)]
pub struct OsekaiRankingEntry<T> {
pub country: String,
pub country_code: CountryCode,
pub rank: u32,
pub user_id: u32,
pub username: Us... | Rust | 0 |
import time
from integration_tests.test_framework.util import assert_equal, assert_greater_than_or_equal
def test_conflux_context_epochHash(network):
genesis_hash = network.client.block_by_epoch(0)["hash"]
for _ in range(5):
network.client.generate_block_with_parent(genesis_hash)
wait_for_bloc... | Python | 1 |
one, Debug, Deserialize, Serialize)]
pub enum AgentStreamingMessageInner {
ServerStdout(String),
}
use std::collections::{BTreeMap, BTreeSet};
use ucd_parse::{self, UnicodeData};
use crate::args::ArgMatches;
use crate::error::Result;
use crate::util::{print_property_values, PropertyValues};
pub fn command(args: ... | Rust | 0 |
"][:, 3:4] = batch["zoom_mask_ren"] # im_ren, mask_ren
batch["zoom_x_obs"][:, 3:4] = zoom_mask_obs # im_obs, mask_obs
if backbone_cfg.INPUT_DEPTH:
# batch['zoom_x_ren'][:, 4:5] = batch['zoom_depth_ren'] # im_ren, mask_ren, depth_ren
# batch['zoom_x_obs'][:, 4:5... | Python | 1 |
f64,
}
#[repr(C)]
pub struct VkAcquireProfilingLockInfoKHR {
pub ty: VkStructureType,
pub next: *const raw::c_void,
pub flags: VkAcquireProfilingLockFlagsKHR,
pub timeout: u64,
}
#[repr(C)]
pub struct VkPerformanceQuerySubmitInfoKHR {
pub ty: VkStructureType,
pub next: *const raw::c_void,
... | Rust | 0 |
-> List[Dict[str, Any]]:
pass
def get_api(self) -> List[Dict[str, Any]]:
pass
def get_service(self) -> List[Dict[str, Any]]:
"""
注册插件公共服务
[{
"id": "服务ID",
"name": "服务名称",
"trigger": "触发器:cron/interval/date/CronTrigger.from_crontab()",... | Python | 1 |
) -> ::std::os::raw::c_int;
}
#[link(name = "nng")]
extern "C" {
pub fn nng_pub0_open(arg1: *mut nng_socket) -> ::std::os::raw::c_int;
}
#[link(name = "nng")]
extern "C" {
pub fn nng_pub0_open_raw(arg1: *mut nng_socket) -> ::std::os::raw::c_int;
}
#[link(name = "nng")]
extern "C" {
pub fn nng_sub0_open(arg1... | Rust | 0 |
20(&mut self) -> CFIE20_W {
CFIE20_W { w: self }
}
#[doc = "Bit 21 - Cancellation Finished Interrupt Enable 21"]
#[inline(always)]
pub fn cfie21(&mut self) -> CFIE21_W {
CFIE21_W { w: self }
}
#[doc = "Bit 22 - Cancellation Finished Interrupt Enable 22"]
#[inline(always)]
... | Rust | 0 |
quality_e2e.as_ref() {
os.write_tag(2, ::protobuf::wire_format::WireTypeLengthDelimited)?;
os.write_raw_varint32(v.get_cached_size())?;
v.write_to_with_cached_sizes(os)?;
}
if let Some(v) = self.seconds_until_shutdown {
os.write_uint32(3, v)?;
}
... | Rust | 0 |
rip(self):
proto = xla_client.OpSharding()
hlo_sharding = xla_client.HloSharding.from_proto(proto)
serialized_proto = jex.sharding.get_serialized_proto_from_hlo_sharding(
hlo_sharding
)
self.assertIsInstance(serialized_proto, bytes)
deserialized_hlo_sharding = jex.sharding.get_hlo_shardi... | Python | 1 |
# Code generated by Lark OpenAPI.
from typing import Any, Optional, Union, Dict, List, Set, IO, Callable, Type
from lark_oapi.core.model import BaseRequest
from lark_oapi.core.enum import HttpMethod, AccessTokenType
class ListMailgroupPermissionMemberRequest(BaseRequest):
def __init__(self) -> None:
supe... | Python | 1 |
core1', 'buy_wave_score2', 'buy_wave_score3']
:return: ['buy_wave_score1', 'buy_wave_score2', 'buy_wave_score3']
"""
return AbuFeatureWave().get_feature_ump_keys(ump_cls=AbuUmpEdgeWave)
def get_fiter_class(self):
"""
边裁价格波动特征返回的AbuMLPd子类:AbuUmpEdgeWave.UmpWaveFiter
:... | Python | 1 |
total_bid_value, bithumb_total_ask_value, upbit_best_buy_price, upbit_best_sell_price, bithumb_best_buy_price, bithumb_best_sell_price = profit_calculation(coin)
# 현재테더, 10당 차이...
print(f"업비트 매도/매수호가: ")
print(f"업비트 매도시 이익 / 순이익 (%) : {round(profit_upbit * 100,2)} / {round(net_profit_upbit * 100,2)}")
... | Python | 1 |
unencrypted_keypair(Some(seed)).unwrap();
assert_eq!(sk, SecretKey::from_bytes(&sk.to_bytes()).unwrap());
}
#[test]
fn xor_keynum() {
use crate::KeyPair;
use getrandom::getrandom;
let KeyPair { mut sk, .. } = KeyPair::generate_unencrypted_keypair(None).unwrap();
let mut key = vec![0u8; sk.keynum_s... | Rust | 0 |
i += 1;
}
(irom, drom)
}
}
impl InSaveState for DspVersion {
fn serialize(&self, state: &mut SaveStateSerializer) {
(*self as u8).serialize(state)
}
fn deserialize(&mut self, state: &mut SaveStateDeserializer) {
let mut i: u8 = 0;
i.deserialize(state);
... | Rust | 0 |
tput)
path_save_dep = '{}/02_dep.png'.format(self.path_output)
path_save_init = '{}/03_pred_init.png'.format(self.path_output)
path_save_pred = '{}/05_pred_final.png'.format(self.path_output)
path_save_pred_gray = '{}/05_pred_final_gray.png'.format(
... | Python | 1 |
#!/usr/bin/env python
from vtkmodules.vtkFiltersCore import (
vtkStripper,
vtkTriangleFilter,
)
from vtkmodules.vtkFiltersGeneral import vtkWarpLens
from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter
from vtkmodules.vtkIOImage import vtkPNGReader
from vtkmodules.vtkRenderingCore import (
vtkActor,
... | Python | 1 |
vec()];
}
lazy_static! {
static ref BINARY_RESPONSE_CONTENTS: ContentType = ContentType(Mime(TopLevel::Application, SubLevel::OctetStream, Vec::new()));
}
#[derive(Clone)]
pub struct HttpResponse {
pub status: StatusCode,
pub body: String,
pub raw_body: Vec<u8>,
pub headers: HashMap<String, String>... | Rust | 0 |
_KB
.set(opt.mem_high_watermark_kb)
.unwrap_or_else(|_| unreachable!());
MEM_CRITICAL_WATERMARK_KB
.set(opt.mem_critical_watermark_kb)
.unwrap_or_else(|_| unreachable!());
let (lp_tx, lp_rx) = smr::ipc_channel::ipc::channel::<LowPriorityMsg>().unwrap();
LP_TX
.set(Mutex::new(lp_tx))
.unwr... | Rust | 0 |
?;
}
}
let auto_position = if size > 12 {
Some(input.read_u16()?)
} else {
None
};
Ok(Alert {
bounds_rect,
ditl_id,
stages,
auto_position,
})
}
}
struct Dialogs {
param_text: [S... | Rust | 0 |
own
x2 = self.down[0](x1, temb)
x3 = self.down[1](x2, temb)
x4 = self.down[2](x3)
x5 = self.down[3](x4, temb)
x6 = self.down[4](x5)
x7 = self.down[5](x6, temb)
x8 = self.down[6](x7)
x9 = self.down[7](x8)
x10 = self.down[8](x9, temb)
x11 = s... | Python | 1 |
wnd: gui::window::Window<gui::window::ColumnLayout>,
text: gui::components::TextEditMultiline,
text2: gui::components::TextBox,
text3: gui::components::TextBox,
focus: gui::select::SelectId,
}
impl Gui {
pub fn new(device: &vk::device::Device, wnd: &vk::wnd::Window, target: vk::Image, mem: vk::mem::Mem) -... | Rust | 0 |
);
map.blocked[idx] = true;
viewshed.dirty = true;
turn_done.push(entity);
} else {
end_chase.push(entity);
}
}
for done in end_chase.iter() {
chasing.remove(*done);
}
for done in turn_do... | Rust | 0 |
: Option<&str>,
// village_name: Option<&str>,
query: &str,
offset: i64,
limit: i64,
) -> Result<EntriesResult<(VillageData, Village)>> {
use crate::schema::village_data::{self, dsl};
use crate::schema::villages::{self, dsl as dslv};
let mut filterer: Box<dyn... | Rust | 0 |
is not empty, this value will be an `Ok(Some(value))` or `Err(err)` from attempting to parse that body as a `serde_json::Value`.
//! If you expect the response body to be a specific JSON type such as [`apimachinery::pkg::apis::meta::v1::Status`], you can use the `serde_json::Value`
//! as a [`serde::Deserializer... | Rust | 0 |
information only and not financial advice.
Please consult with a qualified professional for specific advice.
"""
return response + disclaimer
# Create a decorator with shared configuration
guardrail_with_handlers = TavoAIGuardrail(
client=client,
metadata=me... | Python | 1 |
"""
SyntaxError: invalid syntax
class Pelota(); SyntaxError: invalid syntax
pass
""" | Python | 1 |
from elements import Element, Code
remark_qualifiers = {
'HE': 'claim payment'
}
class RemarkQualifier(Element):
def parser(self, value: str) -> Code:
description = remark_qualifiers.get(value, None)
return Code(value, description)
| Python | 1 |
ess_decompress_streaming_1byte() {
let buf = generate_bytes();
let mut compressed = Vec::new();
let mut encoder = Encoder::boxed();
let mut stream = encoder.stream_into_vec(&mut compressed);
for &b in &buf {
stream.write(&[b]).unwrap();
}
stream.finish... | Rust | 0 |
# /ui.py
"""
This module is responsible for displaying the output.
Here, both methods of displaying in the terminal and
creating a simple user interface with Gradio are implemented.
"""
import gradio as gr
def display_in_terminal(markdown_content):
"""
Prints the formatted Markdown content directly to the t... | Python | 1 |
def f(a):
for x in range(1, 1000):
f = (x%a!=0) <= ((x%14==0)<= (x%4!=0))
if not f:
return 0
return 1
for a in range(1,1000):
if f(a):
print(a)
| Python | 1 |
90, 0x90, 0xE0,
0xF0, 0x80, 0xF0, 0x80, 0xF0, 0xF0, 0x80, 0xF0, 0x80, 0x80];
<reponame>imbrem/voxel-rs
//! Server-side threads.
pub mod game;
pub mod network;
pub mod worldgen;
<filename>app/src/main/rust/logger/mod.rs<gh_stars>1-10
use android_logger::Config;
use log::Level;
pub fn init()... | Rust | 0 |
"""中間件代碼質量測試
此測試模組驗證中間件系統的代碼質量和基本功能。
"""
import pytest
import sys
import os
from unittest.mock import Mock, patch
# 添加專案根目錄到路徑
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "../..")))
class TestMiddlewareImports:
"""測試中間件模組導入"""
def test_auth_middleware_import(self):
"... | Python | 1 |
Span::new_from_raw_offset(s.len(), 1, "", "") };
assert_eq!(
parse_regex(from_str2(s)),
Ok((
cmp,
Value::Regex(
"arn:[\\w+=/,.@-]+:[\\w+=/,.@-]+:[\\w+=/,.@-]*:[0-9]*:[\\w+=,.@-]+(/[\\w+=,.@-]+)*"
.to_string()
)
))
);... | Rust | 0 |
e in self._reference_index
# Internal methods
def _add_to_indexes(self, component: Component):
"""Add component to all indexes."""
self._components.append(component)
self._reference_index[component.reference] = component
# Add to lib_id index
lib_id = component.lib_id
... | Python | 1 |
# --------------------------------------------------------
# X-Decoder -- Generalized Decoding for Pixel, Image, and Language
# Copyright (c) 2022 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Xueyan Zou (xueyan@cs.wisc.edu)
# --------------------------------------------------------... | Python | 1 |
.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetPipelineExecutableStatisticsKHR.html"]
pub unsafe fn get_pipeline_executable_statistics(
&self,
device: vk::Device,
executable_info: &vk::PipelineExecutableInfoKHR,
) -> VkResult<Vec<vk::PipelineExecutableStatisticKHR>> {
... | Rust | 0 |
fer"));
}
if buf.len() == 1 {
buf[0] = source[0];
} else {
buf.copy_from_slice(&source[..n]);
}
self.pos += n as u64;
Ok(())
}
fn fill_buf(&mut self) -> &[u8] {
let amt = cmp::min(self.pos, self.inner.as_ref().len() as u64);
... | Rust | 0 |
esults)
def _search_papers_by_keywords_api(
self,
keywords: List[str],
category: Optional[str],
max_results: int,
) -> List[PaperData]:
"""
使用 API 按关键词搜索论文
Args:
keywords: 关键词列表
category: 可选的类别限制
max_results: 最大结果数
... | Python | 1 |
rrent_objective
best_F = current_F.copy()
best_WH = current_WH.copy()
print(f"Found better objective: {best_objective}")
return
for k, w in enumerate(receiver_responses):
current_W[depth * M_r:(depth + 1) * M_r, depth] = w
... | Python | 1 |
cksDbWeight;
/// Version of the runtime.
type Version = Version;
/// Converts a module to the index of the module in `construct_runtime!`.
///
/// This type is being generated by `construct_runtime!`.
type PalletInfo = PalletInfo;
/// What to do if a new account is created.
type OnNewAcc... | Rust | 0 |
in Foundation
#![feature(external_doc)]
#![doc(include = "../README.md")]
#![deny(missing_docs)]
#![forbid(unsafe_code)]
mod config;
mod edger8r;
mod env;
mod libraries;
mod sign;
mod utils;
mod vars;
pub use crate::{
config::{ConfigBuilder, TcsPolicy},
edger8r::{Edger8r, Error as Edger8rError},
env::{Er... | Rust | 0 |
= 0x0000000E;
pub const DEVPROP_TYPE_DATE: DEVPROPTYPE = 0x0000000F;
pub const DEVPROP_TYPE_FILETIME: DEVPROPTYPE = 0x00000010;
pub const DEVPROP_TYPE_BOOLEAN: DEVPROPTYPE = 0x00000011;
pub const DEVPROP_TYPE_STRING: DEVPROPTYPE = 0x00000012;
pub const DEVPROP_TYPE_STRING_LIST: DEVPROPTYPE = DEVPROP_TYPE_STRING | DEVP... | Rust | 0 |
bias)
sparseconvnet.forward_pass_hidden_states += output_features.nelement()
return output_features
@staticmethod
def backward(ctx, grad_output):
input_features, input_spatial_size, weight, bias, output_spatial_size, filter_size, filter_stride = ctx.saved_tensors
grad_in... | Python | 1 |
"""
Задание 7:
Напишите программу, которая создает pickle-файл, содержащий список объектов класса
Animal, определенного вами. Класс Animal должен иметь атрибуты name, species и sound и
метод make_sound, который выводит на экран звук животного. Программа должна также
загрузить pickle-файл и вызвать метод make_sound для ... | Python | 1 |
ry_join_all(tasks).await?;
info!("{} Agent end", API_NAMESPACE);
Ok(())
}
<reponame>alanthinker/Pleco
//! Collection of useful functions oriented around modifying singular bits of integer types.
//! You will rarely need to interact with this module directly unless you need functions
//! involving the manipulati... | Rust | 0 |
n(&mut self, rhs: &Overflowing<$t>) {
*self = *self << rhs
}
}
impl<T: IsInteger> ShlAssign<$t> for Overflowing<T> {
fn shl_assign(&mut self, rhs: $t) {
*self = *self << rhs
}
}
impl<T: IsInteger> ShlAssign<&$t> for Overflowing<T> {
fn shl_assign(&mut self, rhs: &$t) {
*self = *self <<... | Rust | 0 |
# MIT License
#
# Copyright (c) 2020 Evgeny Medvedev, evge.medvedev@gmail.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# ... | Python | 1 |
the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x01 << 20)) | ((value as u32 & 0x01) << 20);
self.w
}
}
#[doc = "Driving control enabled for GPIO17.\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enu... | Rust | 0 |
ose lengths and checksums are
//! not known when they are started to end with a small header which
//! restates the length and checksum (presumably for redundancy and to
//! keep the data as local as possible to the current read head). This
//! means that we have to emit this small header whenever we start
//! writing ... | Rust | 0 |
'''
* Escribe un programa que muestre cómo transcurre un juego de tenis y quién lo ha ganado.
* El programa recibirá una secuencia formada por "P1" (Player 1) o "P2" (Player 2), según quien
* gane cada punto del juego.
*
* - Las puntuaciones de un juego son "Love" (cero), 15, 30, 40, "Deuce" (empat... | Python | 1 |
def it_calls_lab_to_rgb_functional(self, request):
image = PILIMG.RGBA_COLOR_500X500_155_249_240
image_arr = np.array(image)
F_lab_to_rgb = function_mock(
request, "histolab.filters.image_filters_functional.lab_to_rgb"
)
F_lab_to_rgb.return_value = image
... | Python | 1 |
t var = &grp1.variable("data").unwrap();
var.values_to(&mut data, ..).unwrap();
for (i, x) in data.iter().enumerate() {
assert_eq!(*x, i as i32);
}
}
#[test]
fn groups_put_extra() {
let d = tempfile::tempdir().expect("Could not create tempdir");
let p = d.path().join("groups_put_extra");
... | Rust | 0 |
0x0000_96D9,// VEX_Vhaddpd_ymm_ymm_ymmm256
0x0000_0721,// Haddps_xmm_xmmm128
0x0000_8594,// VEX_Vhaddps_xmm_xmm_xmmm128
0x0000_96D9,// VEX_Vhaddps_ymm_ymm_ymmm256
0x0000_0721,// Hsubpd_xmm_xmmm128
0x0000_8594,// VEX_Vhsubpd_xmm_xmm_xmmm128
0x0000_96D9,// VEX_Vhsubpd_ymm_ymm_ymmm256
0x0000_0721,// Hsubps_xmm_xm... | Rust | 0 |
&mut self.manifolds {
manifold.pre_solve(bodies, dt_sec);
}
}
pub fn solve(&mut self, bodies: &mut BodyArena) {
for manifold in &mut self.manifolds {
manifold.solve(bodies);
}
}
pub fn post_solve(&mut self) {
for manifold in &mut self.manifolds ... | Rust | 0 |
nd,i],axis = 1))
B3 = np.asarray(B)
plt.plot(t,np.nanmean(B,axis = 0))
plt.title('All cells 0-20 um from photostim')
plt.xlabel('Time from photostim. (s)')
plt.show()
B = []
for i in range(Fstim.shape[2]):
ind = np.where((stimDist[:,i]>300) & (stimDist[:,i]<40000) & (cell_ind<300))[0]
B.append(np.nanmean(F... | Python | 1 |
f has a C API. You can use this to load fonts from memory with e.g.
/// `FKHandleCreateWithMemory()`.
#[no_mangle]
pub unsafe extern "C" fn PFCanvasFontContextCreateWithFonts(fonts: *const FKHandleRef,
font_count: usize)
... | Rust | 0 |
stm32f405",
feature = "stm32f407",
feature = "stm32f411",
feature = "stm32f412",
feature = "stm32f413",
feature = "stm32f415",
feature = "stm32f417",
feature = "stm32f423",
feature = "stm32f427",
feature = "stm32f429",
feature = "stm32f437",
feature = "stm32f439",
feature... | Rust | 0 |
text + associated data + header
DecryptFailure,
/// Could not find the message key required for decryption
///
/// Note that this implementation is not always able to detect when an old `MessageKey` can't
/// be found: a `DecryptFailure` may be triggered instead.
MessageKeyNotFound,
/// He... | Rust | 0 |
= __clockid_t;
pub type timer_t = __timer_t;
pub type useconds_t = __useconds_t;
pub type sbintime_t = __int64_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct sched_param {
pub sched_priority: ::libc::c_int,
}
pub type pthread_t = __uint32_t;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct pthread_attr_t... | Rust | 0 |
),
// The two following cases are not merged just to correctly distinguish between the
// expected type (first component of the tuple) and the inferred type when reporting a row
// unification error.
(TypeWrapper::Ptr(p), tyw) => {
constr_unify(state.constr, p, &tyw)
... | Rust | 0 |
# --- THIS FILE IS AUTO-GENERATED ---
# Modifications will be overwitten the next time code generation run.
import _plotly_utils.basevalidators as _bv
class LinepositionsrcValidator(_bv.SrcValidator):
def __init__(
self,
plotly_name="linepositionsrc",
parent_name="scatte... | Python | 1 |
E2000 threshold to fire")
ap.add_argument("--dom-k", type=int, default=3, help="K for dominant-color KMeans in pass2")
ap.add_argument("--pre", type=float, default=2.0, help="Clip seconds before trigger")
ap.add_argument("--post", type=float, default=3.0, help="Clip seconds after trigger")
ap.add_argume... | Python | 1 |
data_directory_path_map'] = \
parse_paths(self.task_controller.home, data_paths, '/data')
except PathDoesNotExist as e:
status = "NOT STARTED"
workspace = task_dict.get('workspace', None)
command = task_dict.get('command... | Python | 1 |
or(ioe)) if ioe.raw_os_error().unwrap() == 25 => {}
Err(e) => panic!("Unexpected Error:\n{}", e),
}
}
fn create_fake_vhost_net() -> FakeNet<FakeTap> {
FakeNet::<FakeTap>::new(&PathBuf::from("")).unwrap()
}
#[test]
fn test_create_fake_vhost_net() {
create_fake_vh... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.