text string | label_name string | labels int64 |
|---|---|---|
from calculadora.funciones import *
print("Bienvenido a la calculadora")
print("digite una opcion")
print("1.sumar\n2.restar\n3.multiplicar\n4.dividir")
opcion = int(input("Ingrese la opcion: "))
if opcion == 1:
n1 = int(input("Ingrese el primer numero: "))
n2 = int(input("Ingrese el segundo numero: "))
... | Python | 1 |
g():
"""
Test the blob detection using images on disk
"""
# Get files
path = rospkg.RosPack().get_path('sorting_demo') + "/share/test_head_simulator"
files = [f for f in os.listdir(path) if os.path.isfile(os.path.join(path, f))]
#print(files)
# Process files
for f in files:
... | Python | 1 |
itle': traverse_obj(
response, ('livestream', ('session_title', 'slug')), get_all=False, default=''),
'description': traverse_obj(response, ('livestream', 'channel', 'user', 'bio')),
'channel': traverse_obj(response, ('livestream', 'channel', 'slug')),
'channel_id': s... | Python | 1 |
il::raw_value_tombstone,
}
}
}
lazy_static! {
pub static ref KV_COMMAND_COUNTER_VEC: IntCounterVec = register_int_counter_vec!(
"tikv_storage_command_total",
"Total number of commands received.",
&["type"]
)
.unwrap();
pub static ref KV_COMMAND_COUNTER_VEC_STATIC: Kv... | Rust | 0 |
['x_input'].CopyFrom(
tf.contrib.util.make_tensor_proto(x_train, shape=x_train.shape)
)
request.inputs['y_input'].CopyFrom(
tf.contrib.util.make_tensor_proto(y_train, shape=y_train.shape)
)
# Predict.
future = stub.Predict.future(request, 2.0)
result = future.result().outputs['lo... | Python | 1 |
]")),
_ => parsed.insert(String::from("UN"), String::from("Error")), //todo : Erreur
};
parsed.insert(String::from("I/O"), format!("{}", payload[1] & 0b00011111));
// parsed.insert(String::from("MV"),format!("{}", payload[5] +payload[4]<< 8 +payload[3]<< 16 +payload[2]<< 24));
... | Rust | 0 |
(4, "HI {:?}", 2);
}
#[test]
fn seek_test() {
let cursor = "s=7fdbf48af0cd4ebea663b48532f0f2a9;i=1b48;b=9a9e16e612fa4e308846351376210c0f;\
m=28eb92beb;t=531da2dfe278d;x=2e356bd88254f838"
.to_string();
let mut client = match Journal::open(JournalFiles::All, false, true) {... | Rust | 0 |
s["subprotocols"] = args.subprotocols
opts = {}
if args.nocert:
opts = {"cert_reqs": ssl.CERT_NONE, "check_hostname": False}
if args.headers:
options['header'] = list(map(str.strip, args.headers.split(',')))
ws = websocket.create_connection(args.url, sslopt=opts, **options)
if args.r... | Python | 1 |
_string(), Color::Blue)
}
1 => match buffer[0].to_lowercase().as_str() {
"on" => {
self.options.compile_time = true;
success!()
}
"off" => {
self.options.compile_time = false;
... | Rust | 0 |
# Copyright 2017 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 |
}
/// Opens the database for read only with the specified options.
///
/// # Example
///
/// ```
/// opts = Option()
///
/// rocksdbpy.open_for_readonly('/tmp/test')
///
/// rocksdbpy.open_for_readonly('/tmp/test', opts)
///
/// rocksdbpy.open_for_readonly('/tmp/test', opts, False)
/// ```
#[pyfunction]
pub fn open_f... | Rust | 0 |
#!/usr/bin/env python
import pyami.mrc
import numpy
import shutil
import pyami.imagic
def yflip_copy(mrc_header, fin, fout):
'''
copy stack data from fin to fout, but flip data on y axis
'''
nx = mrc_header['nx']
ny = mrc_header['ny']
nz = mrc_header['nz'] or 1
bpp = mrc_header['dtype'].itemsize
ystride = nx ... | Python | 1 |
sitter, but you can add more languages
tree_sitter_name = f'tree-sitter-{language_name}'
tree_sitter_path = StorageLocation.tree_sitter_dir() / tree_sitter_name
tree_sitter_so = StorageLocation.result_dir() / 'build' / f'build-{tree_sitter_name}.so'
if not tree_sitter_path.exists() or not (tree_sitter_... | Python | 1 |
e.cf_names() {
let handler = engine.cf_handle(name).unwrap();
if let Some(v) = engine.get_property_value_cf(handler, ROCKSDB_CF_STATS_KEY) {
writeln!(&mut s, "{}", v).unwrap();
}
}
if let Some(v) = engine.get_property_value(ROCKSDB_DB_STATS_KEY) {
writeln!(&mut s, "{... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (C) 2019 Inria
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
import os
import sys
from testrunner import run
TIMEOUT = 60
LENGTH = int(os.getenv('CONFIG_PROG... | Python | 1 |
import logging
import os
import typing
from integration.github.github_trivy_finding_notification_handler import GithubTrivyFindingNotificationHandler
from integration.slack.slack_api import SlackApi
from integration.slack.slack_channel_config import SlackChannelConfig
from model.team import Team
from notification.noti... | Python | 1 |
!(":", stringify!($name), ":").as_bytes()
)
}
/// Set the value of this parameter type in the storage.
///
/// This needs to be executed in an externalities provided
/// environment.
pub fn set(value: &$type) {
$crate::storage::unhashed::put(&Self::key(), value);
}
/// Returns the valu... | Rust | 0 |
e Writer
max_workers = max(1, min(multiprocessing.cpu_count()//2, 20))
max_workers = min(max_workers, 20)
if nr_workers is not None:
num_workers = nr_workers
max_workers = nr_workers
# get scroll format
is_zarr = scroll.endswith(".zarr")
if is_zarr:
scroll_format = "zar... | Python | 1 |
self) -> bool {
let null_value = SchnorrPubkey::default();
null_value.data != self.data
}
}
impl fmt::Display for SchnorrPubkey {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let s = hex::encode(&self.data);
write!(f, "{}", s)
}
}
impl FromStr for SchnorrPubkey {
type Err = CfdError;... | Rust | 0 |
the public domain
// worldwide. This software is distributed without any warranty.
//
// You should have received a copy of the MIT License along with this software.
// If not, see <https://opensource.org/licenses/MIT>.
use core::any::Any;
use core::cmp::Ordering;
use core::fmt::Debug;
use std::hash::Hasher;
use std:... | Rust | 0 |
ttributeError::new_err(
"`symbols`, `means`, and `stds` must all have the same length.",
));
}
let quantizer = DefaultLeakyQuantizer::new(min_supported_symbol..=max_supported_symbol);
self.inner
.try_encode_symbols(symbols.iter().zip(means.iter()).zip(std... | Rust | 0 |
r to use than AOAI - but is shown as another example of how to interact with the HTTP Target
#
# The HTTP request to make needs to be captured and put here in the "http_req" variable (the values you need to get from DevTools or Burp)
# For Bing Image Creator the cookies contain the authorization in them, which is captu... | Python | 1 |
figure for avx512'
)
#address sanitizer usage
self.add_option('use_asan',
nargs = 1,
default = 0,
type = int,
help = "Compile to use address sanitizer"
)
#provide libau_cpuid instal... | Python | 1 |
ut = Command::new("sh").arg("-c").arg("which id").output()?;
let buf = String::from_utf8_lossy(&out.stdout);
let path =
buf.lines().next().ok_or_else(|| anyhow!("can't find the id command"))?;
Ok(Mapper(String::from(path)))
})
}
pub(crate) fn groups(&... | Rust | 0 |
def prune_heads(self, heads):
if len(heads) == 0:
return
heads, index = find_pruneable_heads_and_indices(heads, self.self.
num_attention_heads, self.self.attention_head_size, self.pruned_heads)
self.self.query = prune_linear_layer(self.self.query, index)
self.self.key = prune_linear_laye... | Python | 1 |
#[doc = "`read()` method returns [pa6_sel::R](pa6_sel::R) reader structure"]
impl crate::Readable for PA6_SEL {}
#[doc = "`write(|w| ..)` method takes [pa6_sel::W](pa6_sel::W) writer structure"]
impl crate::Writable for PA6_SEL {}
#[doc = "Peripheral select control for PA6"]
pub mod pa6_sel;
#[doc = "Peripheral select ... | Rust | 0 |
# SPDX-License-Identifier: Apache-2.0
import os
import numpy
import onnxruntime as ort
import tensorflow as tf
import tensorflow_hub as hub
import tf2onnx
from _tools import generate_random_images, check_discrepencies
imgs = generate_random_images(shape=(1, 224, 224, 3), scale=1.)
model = tf.keras.Sequential([
hu... | Python | 1 |
# Generated by Django 5.0.2 on 2024-02-08 21:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Training', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='uploadedfile',
name='author',
... | Python | 1 |
load_turbines_to_database(&mut client, turbines).await?;
Ok(())
}
async fn load_counties_to_database(client: &mut Client<Compat<TcpStream>>, counties: Vec<(&String, &String)>) -> Result<(), Box<dyn Error>> {
let tmr = stimer!("LOAD_US_COUNTIES_TO_DATABASE");
for county in &counties {
let stm... | Rust | 0 |
#gen anchors
import torch
import torch.nn as nn
import numpy as np
import itertools
from utils import box_encode
FEATURE_MAPS = [38, 19, 10, 5, 3, 1]
IMG_SIZE = 300
MIN_AREA = [30, 60, 111, 162, 213, 264]
MAX_AREA = [60, 111, 162, 213, 264, 315]
RATIOS = [[2,3], [2, 3], [2, 3], [2, 3], [2], [2]]
SCALES = [0.1,0.2]
STE... | Python | 1 |
.reads_contract_storage(),
Expression::Not(e) => e.reads_contract_storage(),
Expression::Complement(e) => e.reads_contract_storage(),
Expression::UnaryMinus(e) => e.reads_contract_storage(),
Expression::Ternary(c, l, r) => {
c.reads_contract_storage()
... | Rust | 0 |
import asyncio
from typing import Literal
import pytest
import pytest_asyncio
import ailoy as ai
pytestmark = [pytest.mark.asyncio]
@pytest_asyncio.fixture(scope="module")
async def agent():
model = await ai.LocalLanguageModel.create(
"Qwen/Qwen3-0.6B", progress_callback=lambda prog: print(prog)
)
... | Python | 1 |
from loguru import logger
from tools.addons.gets import get_it_running, get_js_lines, get_lua_lines, get_settings
def create_defaults() -> None:
language_file_lua = "ext/Shared/Languages/DEFAULT.lua"
language_file_js = "WebUI/languages/DEFAULT.js"
all_settings = get_settings(first_key="Text")
with... | Python | 1 |
_data.get_alphabet()?),
preserve_case: mash_data.get_preserve_case(),
canonical: !mash_data.get_noncanonical(),
*/
let reference_list = mash_data.get_reference_list()?;
let reference_list_old = mash_data.get_reference_list_old()?;
let references = if reference_list.has_references() {
... | Rust | 0 |
xac\xabqQ\x02\x5c\x80\
\xddIv\xe8J\xed\xe9#\xeeo-\xeck\xaa\xfe\x1c\
\xf8xv\x08\xa9\xe2\xa6\x13;&\xfe/QX\xf6\xbd\
{\x93[\x89\xf7\xa0E\xc0\xda\xe4,\xdd\xd6Gt\xcb\
\xbc\x1a\xf8K\xea\xd1=\xb3\x14\xb8\x12\xf8$p\x1f\xb0\
\xa1\x97\xff\xf3\xa2\xfdA\x1b\x03\xe6\x01\x17d\x07\xa9\x80\
\xf5X\xa0\x90$M\xd2='^\xb1\x81X\x9c\xfd$\
1\x... | Python | 1 |
!(Widget::from(&w), Widget::Entry(Borrowed(&w)));
assert_eq!(Widget::from(w.clone()), Widget::Entry(Owned(w.clone())));
assert_eq!(Widget::from(&Widget::from(w.clone())), Widget::Entry(Borrowed(&w)));
}
#[test]
fn from_checkbox(w: Checkbox<Action>) {
assert_e... | Rust | 0 |
+ 'static + Send>(
&mut self,
_event: HctlEvent,
function: F,
) {
self.register_irq_handler(function);
}
}
<reponame>unalkalkan/stronghold.rs
// Copyright 2020-2021 <NAME>
// SPDX-License-Identifier: Apache-2.0
use std::{
fs,
path::{Path, PathBuf},
};
/// Get the prefe... | Rust | 0 |
import re
def extract_content(text):
# Remove all parentheses and their contents (including nested parentheses)
text = re.sub(r'\([^()]*\)', '', text)
new_string = text.replace("My Answer: ", "").replace("My Follow-up question: ", "")
parts = new_string.split('?')
# If there are more than 4 pa... | Python | 1 |
# Justpy Tutorial demo commands_demo1 from docs/tutorial/working_with_html.md
import justpy as jp
def commands_demo1():
wp = jp.WebPage()
c = jp.parse_html("""
<div>
<p class="m-2 p-2 text-red-500 text-xl">Paragraph 1</p>
<p class="m-2 p-2 text-blue-500 text-xl">Paragraph 2</p>
... | Python | 1 |
let vk_code = key_event.wVirtualKeyCode as i32;
if vk_code == VK_SHIFT {
*shifted = key_event.bKeyDown == TRUE;
return Nothing;
}
if key_event.bKeyDown == FALSE {
return Nothing;
}
if vk_code == VK_UP {
Up
} else... | Rust | 0 |
let _ = err;
Self::new()
}
}
impl fmt::Display for SymbolOverflowError {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.write_str("Symbol overflow")
}
}
impl error::Error for SymbolOverflowError {}
/// Identifier bound to an interned string.
///
/// [`SymbolTable`] i... | Rust | 0 |
.min()
}
pub fn least_steps_to_intersection(&self) -> Option<usize> {
let mut combined_least_steps = HashMap::<Pos, usize>::new();
for (wire_id, _) in self.wires.iter().enumerate() {
let wire_id = wire_id.to_string().chars().next().unwrap();
let pos = Pos::defa... | Rust | 0 |
C-xml-20081126/#syntax>
let mut rest = s;
while let Some((rest_pos, c)) = rest
.char_indices()
.find(|&(_, c)| c == '&' || c == '<' || c == ']' || !is_xml_char(c))
{
let pos = s.len() - rest.len() + rest_pos;
match c {
'&' => {
return ParseResult::... | Rust | 0 |
import torch.nn as nn
import lib.layers.fpn as fpn
from lib.utils.net import convert_conv2convws_model
from qanet.modeling import registry
# ---------------------------------------------------------------------------- #
# Functions for bolting FPN onto a backbone architectures
# ------------------------------------... | Python | 1 |
on", "Conflux"
SS_ARB = "ss-arb", "Alara Reborn"
SS_ZEN = "ss-zen", "Zendikar"
SS_WWK = "ss-wwk", "Worldwake"
SS_ROE = "ss-roe", "Rise of the Eldrazi"
SS_SOM = "ss-som", "Scars of Mirrodin"
SS_MBS = "ss-mbs", "Mirrodin Besieged"
SS_NPH = "ss-nph", "New Phyrexia"
SS_ISD = "ss-isd", "Innis... | Python | 1 |
&node.attrs {
v.visit_attribute(it);
}
tokens_helper(v, &node.group_token.span);
v.visit_expr(&*node.expr);
}
#[cfg(feature = "full")]
pub fn visit_expr_if<'ast, V>(v: &mut V, node: &'ast ExprIf)
where
V: Visit<'ast> + ?Sized,
{
for it in &node.attrs {
v.visit_attribute(it);
}
... | Rust | 0 |
PARAMS")
print(scale.squeeze())
print("ZP PARAMS")
print(zp.squeeze())
print("QUANTIZATION ERROR")
print(quantization_error.item())
assert quantization_error.item() == 0.0
@pytest.mark.parametrize(
"qscheme",
[
torch.per_tensor_symmetric,
torch.per_tensor_affine,
... | Python | 1 |
ruction::XorR8 (Reg8::B),
Instruction::XorR8 (Reg8::C),
Instruction::XorR8 (Reg8::D),
Instruction::XorR8 (Reg8::E),
Instruction::XorR8 (Reg8::H),
Instruction::XorR8 (Reg8::L),
));
}
#[test]
fn test_cp() {
let text = r#"
cp 0xFF
cp [hl]
cp a
cp b
cp c
... | Rust | 0 |
import os
import pandas as pd
from base.base_dataset import MCQVideoDataset
class WebVid(MCQVideoDataset):
"""
WebVid Dataset.
Assumes webvid data is structured as follows.
Webvid/
videos/
000001_000050/ ($page_dir)
1.mp4 (videoid.mp4)
... | Python | 1 |
(1.0, name=Timestamp("2018-01-01 22:33:20.682+01:00")),
),
],
)
def test_time_zone_aware_index(self, stamp, expected):
# GH21194
# Testing awareness of DataFrame index considering different
# UTC and timezone
df = DataFrame(
data=[1, 2],
... | Python | 1 |
mut R,
seq: &mut av1::Sequence,
obu: &obu::Obu,
config: &AppConfig,
) {
let reader = &mut io::Read::take(reader, obu.obu_size as u64);
match obu.obu_type {
obu::OBU_SEQUENCE_HEADER => {
if let Some(sh) = obu::parse_sequence_header(reader) {
if config.verbose > 1 {... | Rust | 0 |
target: str) -> List[float]:
"""Calculate CE loss for target as a response-prefix for the given messages."""
assert isinstance(messages, list) and isinstance(target, str), "expects list of messages and a target string"
inputs = self.tokenize_instructions_fn(instructions=messages, outputs=[targ... | Python | 1 |
import unittest
import torch
from gpytorch.kernels import SpectralDeltaKernel
from gpytorch.test.base_kernel_test_case import BaseKernelTestCase
class TestSpectralDeltaKernel(unittest.TestCase, BaseKernelTestCase):
def create_kernel_no_ard(self, num_dims=2, **kwargs):
return SpectralDeltaKernel(num_dims... | Python | 1 |
(nn.Module):
"""
残差栈类,用于构建多个残差块的堆叠。
Attributes:
_num_residual_layers (int): 残差块的数量。
_layers (nn.ModuleList): 包含多个残差块的列表。
"""
def __init__(self, in_channels: int, num_hiddens: int, num_residual_layers: int,
num_residual_hiddens: int) -> None:
"""
初始化残... | Python | 1 |
) {
Ok(mut i) => {
i.bind_to_bucket(name.clone())?;
self.set_bound(name, i);
}
Err(e) => {
warn!("Could not open libcouchbase bucket: {}", e... | Rust | 0 |
pub level: PageTableLevel,
}
pub struct PageTableWalk {
pub path: ArrayVec<[Pte; 3]>,
pub pa: u64,
}
pub fn walk_page_table<R: Fn(u64) -> Option<u64>>(root: u64, va: u64, read_pte: R) -> Option<PageTableWalk> {
if !is_sv39(va) || root % PAGE_SIZE != 0 {
return None;
}
let mut path = Arr... | Rust | 0 |
gs)
if pretrained:
state_dict = load_state_dict_from_url(model_urls['mobilenet_v2'],
progress=progress)
model.load_state_dict(state_dict)
print('loading>>>>>>>>>>')
return model
if __name__ == '__main__':
import torch
model = mobil... | Python | 1 |
rating a token fails.
pub fn create_agent_auth_token(config: &Config) -> Result<String, IdentityLibError> {
let result = unsafe {
let agent_did = CStringRaw::new(config.agent_did.as_str())?;
let agent_key_name = CStringRaw::new(config.agent_key_name.as_str())?;
let agent_name = CStringRaw::n... | Rust | 0 |
class Solution:
def minOperations(self, nums: List[int]) -> int:
n = len(nums)
ans = n
nums = sorted(set(nums))
for i, start in enumerate(nums):
end = start + n - 1
index = bisect_right(nums, end)
uniqueLength = index - i
ans = min(ans, n - uniqueLength)
return ans
| Python | 1 |
# Copyright (c) 2016-2018, The University of Texas at Austin
# & University of California--Merced.
# Copyright (c) 2019-2020, The University of Texas at Austin
# University of California--Merced, Washington University in St. Louis.
#
# All Rights reserved.
# See file COPYRIGHT for details.
#
# This file is part of th... | Python | 1 |
#!/usr/bin/env python3
'''Log stats - new version
'''
from pymongo import MongoClient
def print_nginx_request_logs(nginx_collection):
'''return stats about Nginx request logs.
'''
print('{} logs'.format(nginx_collection.count_documents({})))
print('Methods:')
methods = ['GET', 'POST', 'PUT', 'PATC... | Python | 1 |
rtt_thresh)
let rtt_thresh = cmp::max(
self.last_round_min_rtt.unwrap() / 8,
MIN_RTT_THRESH,
);
let rtt_thresh = cmp::min(rtt_thresh, MAX_RTT_THRESH);
// Check if we can exit to LSS.
if self.current_... | Rust | 0 |
println!("Missing subcommand.");
println!("Use -h or --help to see usage.");
process::exit(1);
});
let args = &subcommand.matches;
// Determine role
let (role, is_trusted) = match &*subcommand.name {
"initiator" => (Role::Initiator, false),
"initiator_trusted" =... | Rust | 0 |
self.save(self.cntUpdate, modelFolder)
print(f"[Training {self.cntUpdate:4d}] [Ep {ep}, Step {step_num}] Critic Loss: {critic_loss:.4f}, Actor Loss: {actor_loss:.4f}", end='\r', flush=True)
wandb.log({
"critic_loss": critic_loss,
"actor_loss": actor_loss,
"alpha_loss": alpha_loss,
"al... | Python | 1 |
form {'reason': reason_type,
'ntasks': task_count, 'avg': avg} where reason_type is one of
unsupport reason types, task_count is the number of tasks currently
affected with that reason, and avg (if available) is the current most
typical corresponding value. For unsupport reason
... | Python | 1 |
out.lines() {
let mut line = line.expect("gdb-server stdout pipe fail");
line.push('\n');
println!("~{:?}", line);
}
});
}
}
Ok(finally(move || gdb.kill().expect("gdb-server wasn't running")))
}
/// Runs a GDB clien... | Rust | 0 |
dexes, update_indexes)
caches_k.block_until_ready()
end = time.perf_counter()
all_times += end - start
print(func.__name__, "time is", all_times)
def test6():
"""move device test"""
x = torch.randn(10, 20, 20, 20)
x = torch_xla2.tensor.move_to_device(x)
print(x[:, :, 0:1, :])
... | Python | 1 |
f b3 == 0b1110_1101 {
if v.len() >= 6 {
let b4 = v[v.len() - 4];
let b5 = v[v.len() - 5];
let b6 = v[v.len() - 6];
if b2 & 0b1111_0000 == 0b1011_0000 && b5 & 0b1111_0000 == 0b1010_0000 && b6 == 0b1110_1101 {
// six byte case
let c2 ... | Rust | 0 |
classifier.set_params(logisticregression__C=C)
plot_decision_boundary(classifier)
# %% [markdown] tags=["solution"]
#
# - For the lowest values of `C`, the overall pipeline underfits: it predicts
# the majority class everywhere, as previously.
# - When `C` increases, the models starts to predict some datapoin... | Python | 1 |
import heapq
import sys
input = sys.stdin.readline
n = int(input())
min_h = []
max_h = []
for i in range(n):
a = int(input())
if len(min_h) == len(max_h):
heapq.heappush(max_h, -a)
else:
heapq.heappush(min_h, a)
if max_h and min_h and -1 * max_h[0] > min_h[0]:
max_val... | Python | 1 |
nel.selected_member == "char1"
panel.cost_label.set_text.assert_called_with("費用: 5000 G")
panel.vitality_label.set_text.assert_called_with("生命力: 8")
panel.resurrect_button.enable.assert_called_once()
class TestResurrectPanelServiceIntegration:
"""ResurrectPanelのサービス統合テスト"""
... | Python | 1 |
# 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 |
ate::shader::*;
use gl::types::*;
use log::{info, warn};
use std::mem;
use std::os::raw::c_void;
use std::ptr;
#[derive(Debug)]
pub struct FramebufferSystem {
pub shader: Shader,
pub framebuffer: u32,
pub texture_color_buffer: u32,
vao: u32,
vbo: u32,
}
impl Drop for FramebufferSystem {
fn dro... | Rust | 0 |
_BYTES_OUT / 4),
out_fds: Buffer::new(MAX_FDS_OUT),
}
}
/// Flush the contents of the outgoing buffer into the socket
pub fn flush(&mut self) -> IoResult<()> {
let written = {
let words = self.out_data.get_contents();
if words.is_empty() {
... | Rust | 0 |
eboot::RebootMethodsWatcherRegisterRequestStream,
state: Arc<Mutex<ControllerState>>,
) {
fasync::Task::spawn(async move {
while let Some(req) = stream.try_next().await.unwrap() {
match req {
reboot::RebootMethodsWatcherRegisterRequest::Register {
watcher,... | Rust | 0 |
async fn get_media_time(&self, source_name: &str) -> Result<Duration> {
self.client
.send_message::<responses::MediaTime>(RequestType::GetMediaTime { source_name })
.await
.map(|mt| mt.timestamp)
}
/// Set the timestamp of a media source. Supports ffmpeg and vlc med... | Rust | 0 |
Manager, TlsMode};
// Actix
use actix_web::{delete, get, post, put};
use actix_web::{middleware, web, App, Error, HttpResponse, HttpServer};
// Log
use env_logger;
use std::io;
// Serde serialisation
use serde::{Serialize, Deserialize};
// Uuid generation library
use uuid::Uuid;
// Decimal library
use rust_decimal::De... | Rust | 0 |
peech: SNR 5 (raw signal)
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sp.plotsound(noisyspeech_5snr, sr = sr, feature_type = 'signal',
title = '"{}" with {} noise at SNR 5'.format(word.upper(), noise.upper()))
######################################################################
# See Noisy Speech: SNR 5 (s... | Python | 1 |
check_symbol_string("{{Hello}}", "{{"));
}
#[test]
fn check_symbol_pair_test() {
assert_eq!(true, check_matching_pair("{{Hello}}", "{{", "}}"));
}
}
use core::fmt;
use cty::{uint32_t, uint64_t, uintptr_t};
#[repr(C)]
pub struct MemoryMap {
pub buffer_size: uint64_t,
pub buffer: *const ... | Rust | 0 |
import os
from typing import List
import numpy as np
import cv2
import librosa
import webrtcvad
from moviepy import VideoFileClip, concatenate_videoclips, AudioFileClip, CompositeVideoClip, vfx,VideoClip
from pydub import AudioSegment
from skimage import filters, morphology
import wave
from core.cliptemplate.random_tr... | Python | 1 |
elude::Lazy,
solc::{CompilerOutput, Project, ProjectPathsConfig},
types::U256,
};
use evm_adapters::{
evm_opts::{Env, EvmOpts, EvmType},
sputnik::helpers::VICINITY,
FAUCET_ACCOUNT,
};
use regex::Regex;
use sputnik::backend::MemoryBackend;
pub static COMPI... | Rust | 0 |
te::Lifetime(other0)) => self0 == other0,
(WherePredicate::Eq(self0), WherePredicate::Eq(other0)) => self0 == other0,
_ => false,
}
}
}
<gh_stars>0
use maker_panel::{Layer, Panel};
use std::path::PathBuf;
use structopt::StructOpt;
#[derive(Debug)]
enum Err {
IO(std::io::Error),
... | Rust | 0 |
ite(|w| w.fc0_min_khz().bits(0));
clocks.fc0_max_khz.write(|w| w.fc0_max_khz().bits(u32::MAX));
// Start measurement by selecting source clock
clocks.fc0_src.write(|w| w.fc0_src().bits(src as u8));
}
while clocks.fc0_status.read().done().bit_is_clear() {}
clocks.fc0_result.read().... | Rust | 0 |
Unsafety,
/// If `true`, then this trait had the `#[rustc_paren_sugar]`
/// attribute, indicating that it should be used with `Foo()`
/// sugar. This is a temporary thing -- eventually any trait will
/// be usable with the sugar (or without it).
pub paren_sugar: bool,
pub has_auto_impl: bool,
... | Rust | 0 |
in32trace.TermRead()
def setUpWriters(self):
self.processes = []
# 5 processes, quot threads in each process
quot, remainder = divmod(self.FullBucket, 5)
for each in range(5):
self.processes.append(TraceWriteProcess(quot))
if remainder:
self.processe... | Python | 1 |
ed3d::Testbed;
fn main() {
/*
* World
*/
let mut world = World::new();
world.set_gravity(Vector3::new(0.0, -9.81, 0.0));
/*
* Ground.
*/
let ground_size = 50.0;
let ground_shape =
ShapeHandle::new(Cuboid::new(Vector3::repeat(ground_size)));
ColliderDesc::new(g... | Rust | 0 |
anan): Should device play a part in the key-ing of a path?
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
pub(crate) struct PathMtuCacheKey<A: IpAddress>(A, A);
impl<A: IpAddress> PathMtuCacheKey<A> {
fn new(src_ip: A, dst_ip: A) -> Self {
Self(src_ip, dst_ip)
}
}
/// Structure to keep track of th... | Rust | 0 |
import numpy as np
import tensorflow as tf
import tensorflow.contrib.eager as tfe
tf.enable_eager_execution()
X_raw = np.array([2013, 2014, 2015, 2016, 2017], dtype=np.float32)
y_raw = np.array([12000, 14000, 15000, 16500, 17500], dtype=np.float32)
X = (X_raw - X_raw.min()) / (X_raw.max() - X_raw.min())
y = (y_raw - ... | Python | 1 |
,
205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236,
237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252,
253, 254, 255, 256, 384, 512, 768, 1024, 2048, 4096, 8192, 16384, 32768,
)... | Rust | 0 |
(target) => write!(&mut inst_str, "JAL 0x{:04x}", (current_pc & 0xf000_0000) | (target << 2)),
Beq(rs, rt, offset) => write!(&mut inst_str, "BEQ {}, {}, 0x{:04x}", REGISTERS[rs], REGISTERS[rt], offset),
Bne(rs, rt, offset) => write!(&mut inst_str, "BNE {}, {}, 0x{:04x}", REGISTERS[rs], REGISTERS... | Rust | 0 |
_EncodeUnknownFields(message):
"""Remap unknown fields in message out of message.source."""
source = _UNRECOGNIZED_FIELD_MAPPINGS.get(type(message))
if source is None:
return message
result = CopyProtoMessage(message)
pairs_field = message.field_by_name(source)
if not isinstance(pairs_field, messages.Me... | Python | 1 |
4),
TestCase::new("ZFS-8000-GH", "ZFS", 15),
TestCase::new("ZFS-8000-HC", "ZFS", 16),
TestCase::new("ZFS-8000-JQ", "ZFS", 17),
TestCase::new("ZFS-8000-K4", "ZFS", 18),
TestCase::new("SENSOR-8000-09", "SENSOR", 0),
TestCase::new("SENSOR-8000-1N", "S... | Rust | 0 |
# Copyright (c) 2025 Kodo Robotics
#
# 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 applicable law or agreed to in wri... | Python | 1 |
from django.urls import path
from . import views
app_name='todos'
urlpatterns = [
path('', views.IndexView.as_view(), name='index'),
path('<int:todo_id>/delete', views.delete, name='delete'),
path('<int:todo_id>/update', views.update, name='update'),
path('add/', views.add, name='add')
] | Python | 1 |
from, to),
Instruction::TurnOff => self.turn_off(from, to),
Instruction::TurnOn => self.turn_on(from, to),
}
}
fn turn_on(&mut self, from: (u32, u32), to: (u32, u32)) {
for x in from.0..=to.0 {
for y in from.1..=to.1 {
let light = self.matrix.... | Rust | 0 |
ll of those, of course, wrapped inside an `Err`.)
///
/// # Examples
///
/// ```rust,ignore
/// use brawl_api::{Client, Player, traits::*};
///
/// # fn main() -> Result<(), Box<dyn ::std::error::Error>> {
/// let my_client = Client::new("my auth token");
/// let player = Player::fet... | Rust | 0 |
<String>,
}
pub struct AddUserToGroup {
pub user_id: Uuid,
pub group_id: Uuid,
}
pub struct RemoveUserFromGroup {
pub user_id: Uuid,
pub group_id: Uuid,
}
pub struct AddRoleToGroup {
pub group_id: Uuid,
pub role_id: Uuid,
}
pub struct RemoveRoleFromGroup {
pub group_id: Uuid,
pub rol... | Rust | 0 |
Progress};
use crate::database::{BatchDatabase, BatchOperations, DatabaseUtils};
use crate::descriptor::derived::AsDerived;
use crate::descriptor::{
get_checksum, into_wallet_descriptor_checked, DerivedDescriptor, DerivedDescriptorMeta,
DescriptorMeta, DescriptorScripts, ExtendedDescriptor, ExtractPolicy, IntoW... | Rust | 0 |
x,
dirfd: wasm32::__wasi_fd_t,
path_ptr: wasm32::uintptr_t,
path_len: wasm32::size_t,
) -> wasm32::__wasi_errno_t {
use nix::errno;
use nix::libc::mkdirat;
let dirfd = dec_fd(dirfd);
let path = match unsafe { dec_slice_of::<u8>(vmctx, path_ptr, path_len) } {
... | Rust | 0 |
le[List[PolyMatrix], List[PolyMatrix]]:
c_constraints_per_factor = []
for uda_meas in uda_meas_list:
c_constraints_per_factor += get_c_constraints_per_factor(
uda_meas.boolean_variables,
hom_var,
discrete_variable_constraint_names,
)
key = tuple(cont_colum... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.