text string | label_name string | labels int64 |
|---|---|---|
gl;
let err = gl::GetError();
if err != 0 {
println!("GLError: {} {}", msg, err);
}
}
}
impl WebGLRenderingContext {
pub fn new(_canvas: &isize) -> WebGLRenderingContext {
WebGLRenderingContext {
common: GLContext::new(),
}
}
pub fn load... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
@author:XuMing(xuming624@qq.com)
@description:
"""
import sys
sys.path.append('..')
from pycorrector.macbert.macbert_corrector import MacBertCorrector
def test_long_text_for_macbert():
sents = [
'6、在陈刚担任公司董事、监事、高级管理人员期间,每年转让本公司持有的公司股份数量不超过直接或间接持有公司股份总数的25%,' \
'所持股份总数... | Python | 1 |
cart.y -= 1;
}
};
// Collision detection
let collided = carts
.iter()
.position(|c| !c.removed && c.x == cart.x && c.y == cart.y);
match collided {
Some(collided_index) => {
if fir... | Rust | 0 |
# Language dictionaries
TRANSLATIONS = {
'cs': {
'app_title': 'MetriCalc',
'app_subtitle': 'Export metrik z matice záměn',
'single_processing': 'Jednotlivé zpracování',
'batch_processing': 'Dávkové zpracování',
'select_csv_file': 'Vyber CSV soubor',
'select_output': '... | Python | 1 |
"""New depictions for US units"""
from .Cav_Scout_Dragon_M3A1_US import cav_scout_dragon_m3a1_us
from .Cav_Scout_Dragon_M3A2_US import cav_scout_dragon_m3a2_us
from .F4_Wild_Weasel_2_US import f4_wild_weasel_2_us
from .MANPAD_Stinger_C_Rifles_US import manpad_stinger_c_rifles_us
US_NEW_DEPICTIONS = {
"cav_scout_d... | Python | 1 |
ort Outer
Outer.Inner(1)
@assert_passes()
def test_with_runtime_object(self):
import sys
import types
class Inner:
def __init__(self, arg: int) -> None:
pass
# The bug here only reproduces if a class that exists at runtime contains
... | Python | 1 |
im_size = (5, 5, 5)
lambda0 = 1.55
freq0 = td.C_0 / lambda0
si = td.material_library["cSi"]["Li1993_293K"]
sio2 = td.material_library["SiO2"]["Horiba"]
wg = td.Structure(geometry=td.Box(size=(0.22, 0.5, td.inf)), medium=si)
mode_spec = td.ModeSpec(num_modes=3)
grid_spec = td.GridSpec.auto(wa... | Python | 1 |
::Tweet>>>()
.await?
.into_result()?;
Ok(resp)
}),
);
}
req_fut
.try_fold(
model::ResponseI... | Rust | 0 |
after_bind_uniform_buffers_dynamic : u32,
pub max_descriptor_set_update_after_bind_storage_buffers : u32,
pub max_descriptor_set_update_after_bind_storage_buffers_dynamic : u32,
pub max_descriptor_set_update_after_bind_sampled_images : u32,
pub max_descriptor_set_update_after_bind_storage_images : u32,
pub max_des... | Rust | 0 |
an(value)``: Custom reductions methods must be
# able to deal with NaN values as these are commonly encountered in datasets
# as a "no data value".
# * If Python features are used that are unsupported by Numba, you will get
# somewhat obscure errors. In such a case, ``numba.njit`` and test your
# ... | Python | 1 |
text = input()
half_index = len(text) // 2
second_half = text[half_index:]
print(second_half)
| Python | 1 |
language: &Language, msg: &str) -> String {
let mut key_stream = self.cards.key_stream();
msg.chars()
.map(|ch| {
if language.is_letter(&ch) {
let cp = language.get_cp(&ch);
let new_cp = util::modulo(cp - key_stream.next().unwrap(), la... | Rust | 0 |
())
}
}
/// The word index of the init info in a page.
const INIT_WORD: Nat = 0;
/// The word index of the compact info in a page.
const COMPACT_WORD: Nat = 1;
/// The word index of the content of a page.
///
/// Since a page is at least 8 words, there is always at least 6 words of content.
const CONTENT_WORD: N... | Rust | 0 |
es.copy_from_slice(&hex::decode(payment_id).unwrap());
let format = &MoneroFormat::Integrated(payment_id_bytes);
let private_key = MoneroPrivateKey::<N>::from_seed(seed, format).unwrap();
let public_key = MoneroPublicKey::<N>::from_private_key(&private_key);
... | Rust | 0 |
#[inline(always)]
pub fn mr3rl(&mut self) -> MR3RL_W {
MR3RL_W { w: self }
}
}
<reponame>Hf7WCdtO/KRCore
#![allow(clippy::mut_from_ref)]
use core::cell::UnsafeCell;
pub struct ThreadLocal<T> {
data: UnsafeCell<T>,
}
unsafe impl<T: Send + Sync> Send for ThreadLocal<T> {}
unsafe impl<T: Send + Sync>... | Rust | 0 |
rrno> {
let fd = {
match nc::openat(
nc::AT_FDCWD,
"/dev/uinput",
nc::O_WRONLY | nc::O_NONBLOCK,
0,
) {
Ok(fd) => fd,
Err(errno) => {
println!("Error to open uinput: {}", errno);
return Err(errno)... | Rust | 0 |
tructopt(short)]
display_each_die_roll: bool,
/// Display value probabilities
#[structopt(short)]
probabilities: bool,
}
pub fn run() {
let config = Config::from_args();
match parser::parse(&config.dice_counts) {
Ok((input, dice)) => {
display_results(&config, input, &dice... | Rust | 0 |
# Copyright (c) 2023, NVIDIA CORPORATION & AFFILIATES. 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 requ... | Python | 1 |
rtialEq)]
pub struct Opts<'a> {
pub cmd: Option<&'a str>,
pub hook: Hook,
pub echo: bool,
pub resolve_symlinks: bool,
}
impl Opts<'_> {
#[cfg(unix)]
pub const DEVNULL: &'static str = "/dev/null";
#[cfg(windows)]
pub const DEVNULL: &'static str = "NUL";
}
macro_rules! make_template {
... | Rust | 0 |
:param _MidasEnvironment: 环境名。
__release__: 现网环境
__sandbox__: 沙箱环境
__development__: 开发环境
_缺省: release_
:type MidasEnvironment: str
"""
self._QueryDateType = None
self._QueryTranType = None
self._BankAccountNumber = None
self._SubAccountNumber = None
self._P... | Python | 1 |
11 # 从feature上crop出来特征
maxratio = rois[:, 4] / rois[:, 3]
maxratio = maxratio.max().item()
pooled_width = math.ceil(pooled_height * maxratio)
# 12.1 直接从原图中进行crop
roipool = _RRoiAlign(pooled_height, pooled_width, 1.0 / 4) # 声明类
pooled_feat = roipool(features[1], rois.v... | Python | 1 |
for line in lines:
line = line.strip()
if line.startswith("Order ID:"):
current_order_id = int(line.split(":")[1].strip())
if current_order_id == order_id:
order_details.append(line)
if line == '------------------------------------... | Python | 1 |
: RegA64, imm6: u32, rm: RegA64, shift: u32)
-> Result<(), Self::Error>;
/// [Reference](https://developer.arm.com/documentation/ddi0602/2021-12/Base-Instructions/EON--shifted-register---Bitwise-Exclusive-OR-NOT--shifted-register--?lang=en)
/// Bitwise Exclusive OR NOT (shifted register) performs a bit... | Rust | 0 |
VICE_CRC16_ERR_INT interrupt."]
#[inline(always)]
pub fn crc16_err_int_ena(&mut self) -> CRC16_ERR_INT_ENA_W {
CRC16_ERR_INT_ENA_W { w: self }
}
#[doc = "Bit 7 - The interrupt enable bit for the USB_DEVICE_STUFF_ERR_INT interrupt."]
#[inline(always)]
pub fn stuff_err_int_ena(&mut self) -... | Rust | 0 |
// "Found monitor {} with logical dimensions: {:?}",
// MONITOR_ID,
// (
// monitor_logical_dimensions.width,
// monitor_logical_dimensions.height
// )
// );
//
info!("Creating window and drawing context");
//
// Configure... | Rust | 0 |
olumn display, nightly only
extern crate proc_macro;
use std::{borrow::Cow, collections::HashMap, fs::{create_dir_all, File, OpenOptions},
hash::Hash, io::{BufWriter, Write}, mem, sync::atomic::{AtomicUsize, Ordering::SeqCst}};
use proc_macro2::{Span, TokenStream};
use quote::quote;
// i needed to add these two t... | Rust | 0 |
command += ["--slug", args.tournament_slug]
if args.tournament_name:
command += ["--name", args.tournament_name]
if args.tournament_short_name:
command += ["--short-name", args.tournament_short_name]
run_heroku_command(command)
# Create superuser
print_yellow("Now creating a superuser fo... | Python | 1 |
球員的單場總結與完整的逐打席記錄以供儲存。
採用批次查詢優化,避免 N+1 問題。
"""
if not all_players_data:
return
summary_cols = {c.key for c in inspect(models.PlayerGameSummaryDB).column_attrs}
detail_cols = {c.key for c in inspect(models.AtBatDetailDB).column_attrs}
try:
# --- 效能優化:批次查詢 ---
player_names... | Python | 1 |
# from https://www.astrobetter.com/blog/2010/03/03/fourier-transforms-of-images-in-python/
import numpy as np
def azimuthalAverage(image, center=None):
"""
Calculate the azimuthally averaged radial profile.
image - The 2D image
center - The [x,y] pixel coordinates used as the center. The default is
... | Python | 1 |
from pathlib import Path
from unittest.mock import MagicMock
import pytest
from quantuminspire.sdk.models.hybrid_algorithm import HybridAlgorithm
MOCK_HYBRID_ALGORITHM = "hybrid algorithm"
@pytest.fixture
def mock_file() -> MagicMock:
open_mock = MagicMock(auto_spec=Path)
open_mock.read_text.return_value =... | Python | 1 |
import yaml
from VoltForm import validate_voltform
from VoltForm.engine import provision_compute_cluster
def parse_yaml(config_file):
with open(config_file, 'r') as file:
config = yaml.safe_load(file)
return config
def visualize_yaml_as_mermaid(config):
mermaid_diagram = "graph TD\n"
mermaid_d... | Python | 1 |
response_header[2] = 0;
return Ok((2, 3))
}
let swd_request = read_swd_request(&mut request);
let mut response_count = 0u32;
let result = swd_transfer_block_inner(config, swdio, swd_request, &mut request, &mut response, request_count, &mut response_count);
response_header[0] = (requ... | Rust | 0 |
# Miro - an RSS based video player application
# Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011
# Participatory Culture Foundation
#
# 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; eithe... | Python | 1 |
strict {
llvm_version.major == CRATE_VERSION.major &&
llvm_version.minor == CRATE_VERSION.minor
} else {
llvm_version.major >= CRATE_VERSION.major &&
llvm_version.minor >= CRATE_VERSION.minor
}
}
/// Get the output from running `llvm-config` with the given argument.
///... | Rust | 0 |
ut extension
infer_config["emotion_list"] = {
"default": {
"ref_wav_path": wav_file_found,
"prompt_text": wav_file_name,
"prompt_language": "多语种混合"
}
}
else:
raise Exception("找不到wav参考文件!请把有效wav文件放置在模型文件夹下。否则效果可能会非常怪")
... | Python | 1 |
#!/usr/bin/env python3
"""
Generate all visualizations for the AI impact model
"""
import sys
from main import AIImpactModel
import plotly.io as pio
# Set default renderer to browser
pio.renderers.default = "browser"
def main():
# Initialize model
model = AIImpactModel()
# Run all standard scenarios... | Python | 1 |
unique_labels_norm: an array of normalized unique labels
'''
model_mlp = model_mlp.to(device)
model_h2y = model_h2y.to(device)
''' learning rate decay '''
def adjust_learning_rate_2(optimizer, epoch):
"""decrease the learning rate """
lr = lr_base
num_decays = len(lr_d... | Python | 1 |
der(insert, meridians));
}
fn gen_segment_side(insert: &mut VertexInserter, bottom_radius: f32, top_radius: f32, height: f32) {
let bottom_side_length = bottom_radius; // * f32::consts::SQRT_2;//(bottom_radius*bottom_radius * 2.).sqrt();
let top_side_length = top_radius; // * f32::consts::SQRT_2;//(top_radius*... | Rust | 0 |
e is no special-casing in the SEV backend launch process. It
//! will speak the same protocol for all launch use-cases. The
//! synthetic client allows us to avoid special-casing any of the launch
//! code.
//! 2.) The synthetic client allows for keeps to be launched in solitary
//! environmen... | Rust | 0 |
import asyncio
from crontab import CronTab
from loguru import logger
from tortoise import timezone
from tortoise.expressions import Q
from databack.constants import SCHEDULER_SLEEP_SECONDS
from databack.models import Task
from databack.tasks import run_backup
class Scheduler:
_wait_task = None
_stop = False... | Python | 1 |
RawStr;
fn from_form_value(form_value: &'v RawStr) -> Result<Self, Self::Error> {
unimplemented!()
}
/*fn from_form_value(form_value: &'v RawStr) -> Result<NumberVec, &'v RawStr> {
let mut str = form_value.to_string();
str = str
.replace("[", "")
.replace("... | Rust | 0 |
: {'children': [41, 42], 'parent': 29, 'type': 'call'},
41: {'parent': 40, 'type': 'identifier', 'value': 'fib'},
42: {'children': [43, 44, 48], 'parent': 40, 'type': 'argument_list'},
43: {'parent': 42, 'type': 'LeftParenOp', 'value': '('},
44: {'children': [45, 46, 47], 'parent': 42, 'type': 'binary_operator'},
... | Python | 1 |
rmulas, which are previously verbalized by you.
You will be provided with verbalized fomulas and relevant natural language requirements. Given natural language requirements: {req} and
verbalized formulas {out3}, please identify specific unsatisfied courses, grades, or units.
... | Python | 1 |
};
let res2 = res.parse::<i32>().unwrap_or_default();
res1 - res2
}
FORMAT_AUDIO_BITRATE_KEY => {
let bit1 = match self.get_value(key) {
FormatValue::Integer(v) => v,
_ => 0,
}... | Rust | 0 |
repeat_byte(0);
// F <- A1 <- A2 <- A3.
//
// A3 reverts A1
let (_a3_hash, chain_a) =
construct_chain_on_base(vec![1, 2, 3], finalized_number, finalized_hash, |h| {
if h.number == 3 {
add_reversions(h, Some(1))
}
});
import_blocks_into(
&mut virtual_overseer,
&backend,
Some((fin... | Rust | 0 |
.borrow(&self.node).unwrap().collect_nodes(
pool, nodes, visited, self.node,
);
if !visited.contains_key(&self_rid) {
visited.insert(self_rid, true);
nodes.push(self_rid);
}
}
fn borrow_contents(&self) -> Option<&UniformContents> {
None
}
fn build_declaration(&self, _self_id: usize) -> String {
... | Rust | 0 |
th every
// frame by a *lot* (at least going by the BunnyMark example). The logic is roughly based
// on how FNA and LibGDX implement their spritebatches.
//
// TODO: This function really needs cleaning up before it can be exposed publicly.
if ctx.graphics.element_count + 6 > MAX_INDICES {
... | Rust | 0 |
pe::Json.def() },
ColumnType::JsonBinary => quote! { ColumnType::JsonBinary.def() },
ColumnType::Uuid => quote! { ColumnType::Uuid.def() },
ColumnType::Custom(s) => {
let s = s.to_string();
quote! { ColumnType::Custom(#s.to_owned()).def() }
... | Rust | 0 |
incoming_same_as_source.setChecked(False)
else:
self.incoming_same_as_source.setChecked(True)
if output_fps := advanced_options.output_fps:
self.outgoing_fps_widget.setText(output_fps)
self.outgoing_same_as_source.setChecked(False)
else:
self.outg... | Python | 1 |
RECERR14_R::new(((self.bits >> 24) & 0x01) != 0)
}
#[doc = "Bit 25 - ECC Error in the page between the 3584th and the 3839th bytes"]
#[inline(always)]
pub fn eccerr14(&self) -> ECCERR14_R {
ECCERR14_R::new(((self.bits >> 25) & 0x01) != 0)
}
#[doc = "Bit 26 - Multiple Error in the ... | Rust | 0 |
yers that can join
///
/// > [Method in official docs](https://discordapp.com/developers/docs/game-sdk/lobbies#lobbytransactionsetcapacity)
pub fn capacity(&mut self, capacity: u32) -> &mut Self {
self.capacity = Some(capacity);
self
}
/// Set metadata value under a given key for th... | Rust | 0 |
pub login: String,
}
#[derive(Deserialize, Debug)]
pub struct GitHubResponse<T> {
pub items: Vec<T>,
}
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in... | Rust | 0 |
import logging
import asyncio
from pyrogram import Client, filters
from pyrogram.types import Message
from db.db_utils import get_user_prefix, get_delete_cmd, set_delete_cmd
from utils.filters import simple_cmd_filter
# Настройка логирования
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
... | Python | 1 |
48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e,
0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55,
0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f,
0xb0, 0x54, 0xbb, 0x16,
];
Min... | Rust | 0 |
from typing import override
from bs4 import BeautifulSoup
from ..extractor import Extractor
from ..utils import filter_tag
class FreediumExtractor(Extractor):
"""
freedium.cfd
"""
@override
def can_handle(self, soup: BeautifulSoup) -> bool:
title_tag = soup.title
title = title_ta... | Python | 1 |
from PyQt5.QtWidgets import QMessageBox, QApplication
from src.models.user_model import check_login
class LoginController:
def __init__(self, view):
self.view = view
def handle_login(self, username, password):
print(f"DEBUG: Trying login with {username}/{password}")
if check_login(user... | Python | 1 |
p.procs get {}", data);
// println!("[clone child] Signal was delivered - pause is over");
println!("[clone child] Try to allocate big array");
let _v = Box::new([0i32; 600]);
println!("[clone child] Yeah, get my array memory successfully!");
Command::new("ip")
.arg("link")
.spaw... | Rust | 0 |
_args.lora_alpha,
lora_dropout=script_args.lora_dropout,
target_modules=[
"q_proj",
"v_proj",
"k_proj",
"out_proj",
"fc_in",
"fc_out",
"wte",
],
bias="none",
task_type="CAUSAL_LM",
)
# 5.... | Python | 1 |
erted_state_dict["proj_out.weight"] = checkpoint.pop("final_linear.weight", None)
# Handle the final norm layer
norm_weight = checkpoint.pop("modF.1.weight", None)
if norm_weight is not None:
converted_state_dict["norm_out.linear.weight"] = swap_scale_shift(norm_weight, dim=None)
else:
... | Python | 1 |
comic_panel_prompt_2x2 = """
Generate {} detailed prompts for creating individual comic panels that will visually narrate the following story:
Story:
{}
Prompts:
1. Panel Prompt 1: Story Panel 1
2. Panel Prompt 2: Story Panel 2
3. Panel Prompt 3: Story Panel 3
4. Panel Prompt 4: Story ... | Python | 1 |
#!/usr/bin/env python
from vtkmodules.vtkCommonCore import (
vtkLookupTable,
vtkPoints,
)
from vtkmodules.vtkCommonTransforms import (
vtkThinPlateSplineTransform,
vtkTransform,
)
from vtkmodules.vtkFiltersHybrid import (
vtkGridTransform,
vtkTransformToGrid,
)
from vtkmodules.vtkIOImage import ... | Python | 1 |
IGNORED1,
#[value = 0x04]
NTLM,
#[value = 0x05]
SPNEGO,
#[value = 0x06]
Kerberos,
#[value = 0x07]
CredSSP,
#[value = 0x08]
SRD,
#[fallback]
Other(u8),
}
__flags_struct! {
AuthentificationFailureFlags: u8 => {
retry = RETRY = 0x01,
}
}
// NOW_AUTHENTI... | Rust | 0 |
r (Tx Buffer)"]
pub tid1: TID,
#[doc = "0x38 - Transmit data bytes 1-4 (Tx Buffer)"]
pub tda1: TDA,
#[doc = "0x3c - Transmit data bytes 5-8 (Tx Buffer )"]
pub tdb1: TDB,
#[doc = "0x40 - Transmit frame info (Tx Buffer )"]
pub tfi2: TFI,
#[doc = "0x44 - Transmit Identifier (Tx Buffer)"]
... | Rust | 0 |
= Foo {
a: [0, 0, 0, 0, 0, 0, 0, 0],
b: 42,
c: "foo".to_owned(),
};
let key_cdr = foo.key_cdr();
assert_eq!(key_cdr, vec![0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]);
assert_eq!(false, Foo::force_md5_keyhash());
}
#[test]
fn primitive_array_and... | Rust | 0 |
tail)
}
F::ConcatString(varargs) => {
let mut strings = vec![];
for arg in varargs {
strings.push(e(arg)?.as_string())
}
Ok(StringArray::concat(strings).as_any())
}
F::Hash(varargs) => Ok(AnyArray::I64(I64Array::hash_all(&es... | Rust | 0 |
find_element(By.ID, "PAN")
Kartno.send_keys("455529045865561")
DropdowmAy = driver.find_element(By.ID, "ExpiryMonth")
driver.find_element(By.ID, "CVV").click()
AySec = Select(DropdowmAy)
ay = AySec.options
time.sleep(1)
AySec.select_by_visible_text("9")
time.sleep(1)
AySec.select_by_index("8")
time.sleep(1)
DropdowmY... | Python | 1 |
st.selectbox("Farm Type", ["Pig Farm", "Poultry Farm", "Mixed Farm"])
st.selectbox("Farm Size", ["Small (< 100 animals)", "Medium (100-500 animals)", "Large (> 500 animals)"])
st.multiselect("Specializations", ["Breeding", "Organic Farming", "Feed Production", "Disease Management"])
... | Python | 1 |
from django.contrib import admin
from .models import Client,TicketCenter,TicketTech,Center,FeedBack
# Register your models here.
admin.site.register(Client)
admin.site.register(Center)
admin.site.register(TicketCenter)
admin.site.register(TicketTech)
admin.site.register(FeedBack) | Python | 1 |
_type == ref_type else "mixed"
if common_type == "mixed":
log.error("Type of IE output {} isn't equal with type of FW output {} for layer '{}'"
.format(data_type, ref_type, layer))
status = False
statu... | Python | 1 |
_sessions2::ObserverDiscoveryRequestStream| {
let observer_request_sink = observer_request_sink.clone().sink_err_into();
spawn_log_error(request_stream.err_into().forward(observer_request_sink));
},
);
inspector.serve(&mut server).expect("Serving inspect");
s... | Rust | 0 |
2);
a[(0, 2)] = x[0];
a[(0, 3)] = 1.;
a[(a_size - 2, 0)] = 6. * x[0];
a[(a_size - 2, 1)] = 2.;
a[(a_size - 1, a_size - 4)] = 6. * x[n - 1];
a[(a_size - 1, a_size - 3)] = 2.;
let (mut i_1, mut i_n, mut i_4, mut i_2n, mut i_3n): (usize, usize, usize, usize, usize);
for i in 0..n-1 {
... | Rust | 0 |
impl<R: rand::Rng> MinefieldGenerator<R> {
pub fn new(conf: Conf, rng: R) -> Self {
MinefieldGenerator {
conf,
rng: std::cell::RefCell::new(rng),
}
}
pub fn from_args(rng: R) -> Self {
MinefieldGenerator::new(Conf::from_args(), rng)
}
}
impl MinefieldGen... | Rust | 0 |
contains(crate::BufferUses::MAP_READ) {
glow::STREAM_READ
} else {
glow::DYNAMIC_DRAW
}
} else {
glow::STATIC_DRAW
};
gl.buffer_data_size(target, raw_size, usage);
}
gl.bind_buffe... | Rust | 0 |
e frames. (This is somewhat a detection of standing waves/modals)
We define surrounding areas/windows, for relevance and return the maximum
for differential analysis.
Parameters:
S: STFT of processed audio
Returns:
differential_score: Severeness of ringing on [-2288,2288]
... | Python | 1 |
.kind),
feasability=feasability.or_else(self.feasability),
)
@staticmethod
def _build_name(target: TimePlanActivityTarget, entity_id: EntityId) -> EntityName:
return EntityName(f"Work on {target.value!s} {entity_id}")
class TimePlanAlreadyAssociatedWithTargetError(EntityAlreadyExi... | Python | 1 |
onent_run = random.choice([1, 2, 3, 4, 5, 6])
choice_label.config(text=f"Player chose: {player_run} | Opponent: {opponent_run}")
if player_run == opponent_run:
if two_player_innings == 1:
two_player_target = (p1_score if p1_batting_first else p2_score) + 1
two_player_innings = 2... | Python | 1 |
e, MacroExpansionConfig};
use clap::Parser;
use std::path::PathBuf;
#[derive(Debug, Parser)]
#[clap(
name = "ffi_cbindgen",
about = r#"
Generate a cbindgen style C++ header for a list of .rs sources.
Example invocation:
$ ffi_cbindgen --header foo-bar.h \
--namespaces HPHP,hackc \
--includes hphp/hack/... | Rust | 0 |
}
return clean_uri.trim_end_matches('/').to_string();
},
_ => clean,
};
return clean;
}
use crate::{Fq, FQ_ONE};
use ark_ff::{
field_new,
fields::fp2::{Fp2, Fp2Parameters},
};
pub type Fq2 = Fp2<Fq2Parameters>;
pub struct Fq2Parameters;
impl Fp2Parameters for Fq2Parameters {
type Fp = Fq... | Rust | 0 |
brary.")]
#![cfg_attr(not(feature = "std"),
doc = "Substrate's runtime standard library as compiled without Rust's standard library.")]
#[macro_export]
macro_rules! map {
($( $name:expr => $value:expr ),*) => (
vec![ $( ( $name, $value ) ),* ].into_iter().collect()
)
}
/// Feature gate some code that should on... | Rust | 0 |
status::Status> {
let wakeup = with_handle(self.0, |obj| match obj {
FidlHandle::LeftChannel(cs, peer) => match *cs.lock() {
ChannelState::Closed => Err(zx_status::Status::PEER_CLOSED),
ChannelState::Open(_, ref mut st) => {
Sel... | Rust | 0 |
from sympy import parse_expr
from sympy import preorder_traversal
from benchmark.utils.symbolic_check_utils import model_verification
from evolutionary_forest.forest import EvolutionaryForestRegressor
hyper_params = [
{},
]
est = EvolutionaryForestRegressor(
n_gen=100,
n_pop=200,
select="AutomaticLe... | Python | 1 |
relative_minutes.value().value,
datetime.value().form.is_12_clock())?
.precision(datetime.value().precision))
);
b.rule_3("relative minutes to|till|before <integer> (hour-of-day)",
relative_minute_check!(),
b.reg(r#"к|до"#)?,
... | Rust | 0 |
from .cnab import Cnab, CnabBatch, CnabDetailRecord, CnabLine, RecordType
| Python | 1 |
contract = match self.get(correlation_id, &key).map_err(Into::into)? {
Some(Value::Contract(contract)) => contract,
Some(other) => {
return Err(execution::Error::TypeMismatch(TypeMismatch::new(
"Value::Contract".to_string(),
other.type_stri... | Rust | 0 |
ties: &Element) -> (Stage, FullClass) {
let stage: Stage = properties
.get_child("stage", NAMESPACE)
.expect("Couldn't find `stage` element")
.text()
.parse::<usize>()
.expect("Stage wasn't a valid number")
.into();
let classification_elem = properties
.g... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2019-03-19 15:46
from __future__ import unicode_literals
from django.db import migrations, models
import registration.models
class Migration(migrations.Migration):
dependencies = [
('registration', '0008_auto_20180309_1546'),
]
operations ... | Python | 1 |
import argparse
import torch
import torch.nn as nn
from mmcv.runner import save_checkpoint
from mmdet.apis import init_detector
def fuse_conv_bn(conv, bn):
""" During inference, the functionary of batch norm layers is turned off
but only the mean and var alone channels are used, which exposes the
chance... | Python | 1 |
vention.
pub fn new(
current_dir: LeafId,
build_tool: LeafId,
source_file: LeafId,
program_database_file: LeafId,
command_args: LeafId,
) -> BuildInfo {
BuildInfo {
args: vec![
current_dir,
build_tool,
so... | Rust | 0 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
# The codes of the payment method to activate when Pay on site is activated.
DEFAULT_PAYMENT_METHOD_CODES = {
'pay_on_site',
}
| Python | 1 |
ssword) VALUES (?, ?, ?)",
(username, email, hashed_password)
)
conn.commit()
return jsonify({"message": "User registered successfully"}), 201
except sqlite3.IntegrityError as e:
error_message = "Username or email already exists" if "UNIQUE" in str(e) else "Database erro... | Python | 1 |
import numpy as np
############## VIS LDMK ##################
HAND_SKELETON_CMU = np.array(
[
[0, 1],
[1, 2],
[2, 3],
[3, 4],
[0, 5],
[5, 6],
[6, 7],
[7, 8],
[0, 9],
[9, 10],
[10, 11],
[11, 12],
[0, 13],
... | Python | 1 |
", "AS", "B6", "CO", "DH", "DL", "EV", "F9", "FL", "HA", "HP", "MQ", "NW", "OH",
"OO", "TZ", "UA", "US", "WN", "XE", "YV",
]
.iter()
.map(ToString::to_string)
.collect();
let origin_variants: Vec<String> = vec![
"ABE", "ABI", "ABQ", "ABY", "ACK", "ACT", "ACV", "ACY", "ADK", "ADQ", "AEX", "AGS", "AKN",
"ALB",... | Rust | 0 |
.collect::<Vec<_>>();
Ok(list)
}
fn get_series(&self, series: &str) -> Result<Option<Series>> {
let mut sth = self.conn.prepare(
"select * from series where name = ?1",
)?;
let result = sth.query_row(
&[&series as &ToSql],
|row|... | Rust | 0 |
import torch
from typing import Optional, List
class NestedTensor(object):
def __init__(self, tensors: torch.Tensor, masks: Optional[torch.Tensor]):
"""
Args:
tensors: Tensor, (B, C, H, W)
masks: Tensor, (B, H, W)
"""
assert tensors.shape[0] == masks.shape[... | Python | 1 |
}
impl<T: Float, R> Bernoulli<T, R> {
pub fn new(arr_rng: ArrRng<T, R>, p: f64) -> Self {
Self { arr_rng, p }
}
}
pub struct Exponential<T: Float, R> {
pub arr_rng: ArrRng<T, R>,
pub lambda: f64,
}
impl<T: Float, R> Exponential<T, R> {
pub fn new(arr_rng: ArrRng<T, R>, lambda: f64) -> Se... | Rust | 0 |
hen the cache is cold or when
/// restoring new backups.
#[ derive (Clone) ]
pub struct ChunkCache <Key: ChunkCacheKey> {
data: Arc <ChunkCacheData>,
state: Arc <Mutex <ChunkCacheState <Key>>>,
cpu_pool: CpuPool,
}
pub trait ChunkCacheKey: Clone + Eq + Hash + Send + Sync + 'static {
}
impl <Type> ChunkCacheKey fo... | Rust | 0 |
::windows_sys::core::GUID { data1: 3830354984, data2: 48572, data3: 18823, data4: [160, 153, 64, 220, 143, 210, 85, 231] };
pub const ExplorerBrowser: ::windows_sys::core::GUID = ::windows_sys::core::GUID { data1: 1912169349, data2: 56790, data3: 18643, data4: [160, 193, 174, 6, 232, 176, 85, 251] };
#[doc = "*Require... | Rust | 0 |
assert_eq!(p2, PageId(2));
let tree = HTree {
root_page: PageId(2),
comparator: Eavt,
store: &store,
heap: &heap,
};
let iter = tree.into_iter(&make_datom(&0), &make_datom(&10));
for (&datom, y) in iter.zip(0..10) {
... | Rust | 0 |
{
// Given
// When
let response = HttpResponse::Ok().cbor(response::Logout);
// Then
assert!(response.is_ok());
}
<filename>2019/aoc_1902/src/lib.rs
/* --- Day 2: 1202 Program Alarm ---
On the way to your gravity assist around the Moon, your ship computer beeps
angrily about a "1202 program alarm... | Rust | 0 |
r"Register block"]
#[repr(C)]
pub struct DPPI {
#[doc = "0x00 - Description cluster: Select between secure and non-secure attribute for the DPPI channels"]
pub perm: crate::Reg<self::dppi::perm::PERM_SPEC>,
#[doc = "0x04 - Description cluster: Prevent further modification of the corresponding PERM register"... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.