text string | label_name string | labels int64 |
|---|---|---|
import itertools
from uuid import UUID
from flask import Blueprint, current_app, jsonify
from flask.typing import ResponseReturnValue
from app.common.auth.authorisation_helper import AuthorisationHelper
from app.common.data.interfaces.collections import get_collection
from app.common.data.interfaces.user import get_c... | Python | 1 |
present_images.push(
ImageBuilder::new(device.surface_format().format, 1, 1)
.tiling_optimal()
.build_from_present_image(device, present_images_raw[i]),
);
}
VkSwapchain {
swapchain,
swapchain_extent,
present_images,
swapchain_loader,
scre... | Rust | 0 |
me);
params.insert("varKey".to_string(), varkey);
super::call(service, "script", "action", "clearScriptVar", params)
}
/**
* Clears the variables of the given script. Returns an API error (DOES_NOT_EXIST) if no script with the given name exists.
*/
pub fn clear_script_vars(service: &ZapService, scriptname: St... | Rust | 0 |
e well-known protobuf types instead
/// of using the already-compiled versions available in the `prost-types` crate.
///
/// This defaults to `false`.
pub fn compile_well_known_types(mut self, compile_well_known_types: bool) -> Self {
self.compile_well_known_types = compile_well_known_types;
... | Rust | 0 |
fax or postal mail.')
gettext('Download Contract')
gettext('Creative Commons 1.0 Universal (CC0 1.0) Public Domain Dedication')
gettext('Creative Commons Attribution 4.0 International (CC BY 4.0)')
gettext('Creative Commons Attribution-ShareAlike 4.0, International (CC BY-SA 4.0)')
gettext('Creative Commons Attribution... | Python | 1 |
), 7);
}
#[test]
fn jp_0x8000() {
let rom = vec![
0b11_000_011,
0x00,
0x80, // JP 0x8000
];
let mut cpu = create_cpu(rom);
run_steps_without_wait_cycles(1, &mut cpu);
let registers = &cpu.registers;
assert_eq!(registers.pc(... | Rust | 0 |
&mut Engine) -> Failure
where
T: OperationBehavior
{
minmax::<T>(engine, "MINMAX", MIN | MAX)
}
// (x y - x*y)
pub(super) fn execute_mul<T>(engine: &mut Engine) -> Failure
where
T: OperationBehavior
{
binary::<T>(engine, "MUL", |y, x| x.mul::<T>(y))
}
// (x - x*y)
pub(super) fn execute_mulconst<T>(en... | Rust | 0 |
lways)]
pub fn auxio17(self) -> &'a mut W {
self.variant(EVOBS_SEL_A::AUXIO17)
}
#[doc = "EVSTAT1.AUXIO16"]
#[inline(always)]
pub fn auxio16(self) -> &'a mut W {
self.variant(EVOBS_SEL_A::AUXIO16)
}
#[doc = "EVSTAT0.AUXIO15"]
#[inline(always)]
pub fn auxio15(self) -> ... | Rust | 0 |
> assert_eq!("not-error", *ok),
//! Err((ERR_FOO, e)) => assert_eq!("foo test", e.get_message().unwrap()),
//! Err((ERR_BAR, e)) => assert_eq!("bar test", e.get_message().unwrap()),
//! oth => panic!("unexpected: {:?}", oth),
//! }
//! }
//! ```
//!
//! ### std::io Interoperability
//!
//! `... | Rust | 0 |
rtEqual(sig.kwonlydefaults, gevent_sig.kwonlydefaults, func_name)
# Should deal with others: https://docs.python.org/3/library/inspect.html#inspect.getfullargspec
def assertEqualFlakyRaceCondition(self, a, b):
try:
self.assertEqual(a, b)
except AssertionError:
fl... | Python | 1 |
gress = getRichProgress()
with progress:
allFiles = getFilesFromDir(imageFolder, progress, True)
shuffle(allFiles)
lenSplit = len(allFiles) // parallel
fileGroups, starts = list(), list()
start = 0
for i in range(parallel):
fileGroups.append(allFiles[... | Python | 1 |
from flask_jwt_extended import get_jwt_identity
from app.models.transaction_model import TransactionModel
from app.utils.exceptions import appNotFoundError, appForbiddenError
def execute(id, user_id_token=None):
transaction = TransactionModel.query.get(id)
if not transaction:
raise appNotFoundError(... | Python | 1 |
import numpy as np
import yaml
def getCameraExtrinsics(sensors_path, camera_channels):
data = ''.join(open(sensors_path, 'r').readlines())
car_cfg = loadYamlStr(data)
sensors_extrinsics = obtainSensorsExtrinsics(car_cfg, camera_channels)
camera_extrinsics = getBodytoCamera(camera_channels, sensors_ext... | Python | 1 |
import cStringIO, zipfile
from django.conf import settings
from django.http import HttpResponse
from django.template import loader
def compress_kml(kml):
"Returns compressed KMZ from the given KML string."
kmz = cStringIO.StringIO()
zf = zipfile.ZipFile(kmz, 'a', zipfile.ZIP_DEFLATED)
zf.writestr('doc.... | Python | 1 |
#skip blank line, all columns value should be None
if d and filter(None, d.values()):
data.append(d)
else:
break
return data
line_iter = ReadLines(sheet, line)
result = []
data = {}
while ... | Python | 1 |
from discord.ext.commands import Context
from discord.ext import commands
from discord import Interaction, app_commands
from env import config
from use_cases.general.crypto import CryptoBuyUseCase, CryptoPricesUseCase
class CryptoCod(commands.Cog):
def __init__(self, client):
self.client = client
@c... | Python | 1 |
\\?\C:
Some(VerbatimDisk(drive))
} else {
// \\?\prefix
Some(Verbatim(prefix))
}
}
} else if let Some(path) = strip_prefix(path, r".\") {
// \\.\COM42
let (prefix, _) = parse_next_com... | Rust | 0 |
#
# Copyright © 2019 Keith Packard <keithp@keithp.com>
#
# 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 version.
#
# This progra... | Python | 1 |
]);
v[3] = add(v[3], v[4]);
v[15] = xor(v[15], v[0]);
v[12] = xor(v[12], v[1]);
v[13] = xor(v[13], v[2]);
v[14] = xor(v[14], v[3]);
v[15] = rot8(v[15]);
v[12] = rot8(v[12]);
v[13] = rot8(v[13]);
v[14] = rot8(v[14]);
v[10] = add(v[10], v[15]);
v[11] = add(v[11], v[12]);
v[... | Rust | 0 |
Ok(num)
} else {
Err(error)
}
} match is_it_fifty(my_num) {
Ok(_v) => println!("Good! my_num is 50"),
Err(_e) => println!("Error. my_num is {:?}", my_num)
}
}
//final note:for compiler error "expected this, found enum,etc" quickest/easiest thing to... | Rust | 0 |
str = include_str!("token.abi.keep.json");
pub const TOKEN_KEEP: &str = "KEEP";
pub const TOKEN_TBTC: &str = "TBTC";
pub const TOKEN_ETH: &str = "ETH";
/*
# mainnet
curl 'https://api.etherscan.io/api?module=stats&action=tokensupply&contractaddress=0x85eee30c52b0b379b046fb0f85f4f3dc3009afec'
curl 'https://api.ethersca... | Rust | 0 |
d Service Account
flags.AddBuildServiceAccountFlag(parser)
# Add flag for Binary Authorization Policy (2nd Gen only)
flags.AddBinaryAuthorizationMutexGroup(parser)
@base.ReleaseTracks(base.ReleaseTrack.GA)
class Deploy(util.FunctionResourceCommand, base.Command):
"""Create or update a Google Cloud Function."... | 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 us... | Python | 1 |
assert result.exit_code
assert "No specified queue 5 found on port Ethernet0" in result.output
# Remove existing queue
with mock.patch('utilities_common.cli.run_command') as mock_run_command:
result = runner.invoke(config.config.commands["interface"].commands["buffer"].command... | Python | 1 |
from .base_notification import BaseNotification
class LayerNotifications(BaseNotification):
def __init__(self, logger, ifttt_alerts, plugin_manager):
BaseNotification.__init__(self, logger, plugin_manager)
self._layers = []
self._ifttt_alerts = ifttt_alerts
self.reset_layers()
def get_layers(self):
""" ... | Python | 1 |
# Copyright (c) 2022 PaddlePaddle 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 appli... | Python | 1 |
::collections::HashMap;
use serde::de;
use crate::{Error, HzdataValue};
pub struct HzdataValueMapAccess {
values: Vec<(String, HzdataValue)>,
}
impl HzdataValueMapAccess {
pub(super) fn new(values: HashMap<String, HzdataValue>) -> Self {
HzdataValueMapAccess {
values: values.into_iter().... | Rust | 0 |
#!/usr/bin/env python3
"""
测试启动小红书首页Activity功能
专门测试使用adb直接启动小红书首页Activity的功能
验证启动命令是否正确执行,以及启动结果验证
"""
import sys
import time
from datetime import datetime
from pathlib import Path
# 设置项目根目录路径
project_root = Path(__file__).parent.parent.parent
sys.path.insert(0, str(project_root))
from src.collectors.competitor_sho... | Python | 1 |
_id == self.node_cpu_1_id
# Test with non-existent ID
model = self.workflow_output.get_output_model_by_id("non_existent")
assert model is None
def test_get_output_models(self):
# execute
models = self.workflow_output.get_output_models()
# assert
assert len(... | Python | 1 |
a9P\xd3\x19\xeb\x92\xf6\x9d\
f\x8d\x7f\xa2[:\xc72\xe9\xb4\xa3\x86\xbd \xd0\xd8\
:\x1c\x9b\x9c\x0cx\xa3\x8f\x97\xd7Yo\xc7pj\xfc\
`lY\xb5\x90\x1e\x84L\xd9\x07\x16k\xccg\xe0\xe6\
\xe1\x8c\x83\xf7\xfd\x9cXe{\xbb\x94\x02\xe3\xbd\x93\x1a\
\xf7\x8e\xb7-\xa5,.n`\xf4\xa1fM6\x90\xad\
\x9c\xa6M\x1d\xf6x;B\xcf_\x85\xe3_\xbc9\x0d\
... | Python | 1 |
#
# @lc app=leetcode id=1005 lang=python
#
# [1005] Maximize Sum Of Array After K Negations
#
# @lc code=start
class Solution(object):
def largestSumAfterKNegations(self, nums, k):
"""
:type nums: List[int]
:type k: int
:rtype: int
"""
# 1.negative int: find the maxi... | Python | 1 |
turn datos
except sqlite3.Error as e:
print(f"Error en consulta: {e}")
return []
def borrar(self, seleccion):
"""
Elimina un producto de la tabla `productos` basado en el identificador proporcionado.
:param seleccion: El identificador del producto a eliminar... | Python | 1 |
s.contains_key(&k) {
k
} else {
let mut new_name = k.clone();
new_name.push_str("[0]");
new_name
};
let map_v = value.clone();
let map_err = |x: ValueError| FieldError::new(x, key.clone(), map_v);
... | Rust | 0 |
());
}
#[test]
fn simple_values_query_tests() {
let mut qsm = QueryStringMapping::new();
qsm.insert(
"bool_val".to_owned(),
vec![FormUrlDecoded::new("true").unwrap()],
);
qsm.insert(
"i8_val".to_owned(),
vec![FormUrlDecoded::ne... | Rust | 0 |
x not in class_ids_val]
if self.split == 'trn':
return class_ids_trn
else:
return class_ids_val
def build_img_metadata(self):
def read_metadata(split, fold_id):
fold_n_metadata = os.path.join('./data/splits/pascal/%s/fold%d.txt' % (split, fold_id))
... | Python | 1 |
,
}
}
}
#[derive(Copy, Clone, Debug)]
pub struct GameStateChangePending {
}
impl Default for GameStateChangePending {
fn default() -> GameStateChangePending {
GameStateChangePending {
}
}
}
#[derive(Copy, Clone, Debug)]
pub struct GameStateChangeApply {
_end_compute: bool... | Rust | 0 |
OpenChannel),
#[api(type = 33)]
#[display(inner)]
AcceptChannel(AcceptChannel),
#[api(type = 34)]
#[display(inner)]
FundingCreated(FundingCreated),
#[api(type = 35)]
#[display(inner)]
FundingSigned(FundingSigned),
#[api(type = 36)]
#[display(inner)]
FundingLocked(Fund... | Rust | 0 |
gs, shift_tokens = shift_tokens)
if emb_dim != dim:
self.transformer = ProjectInOut(self.transformer, emb_dim, dim, project_out = not return_embeddings)
self.norm = nn.LayerNorm(emb_dim)
self.out = nn.Linear(emb_dim, num_tokens) if not return_embeddings else nn.Identity()
def ... | Python | 1 |
import tensorflow.compat.v2 as tf
import tensorflow_datasets as tfds
import tensorflow_model_optimization as tfmot
def normalize_img(image, label):
"""Normalizes images: `uint8` -> `float32`."""
return tf.cast(image, tf.float32) / 255.0, label
tfds.disable_progress_bar()
tf.enable_v2_behavior()
(ds_train, ... | Python | 1 |
# Abre una terminal e instala flask:
# pip install flask
from flask import Flask
aplicacion = Flask(__name__)
@aplicacion.route("/")
def raiz():
cadena = '''
<style>
.celda{width:50px;height:50px;border:1px solid grey;}
body{display:grid;grid-template-columns:auto auto auto auto auto ... | Python | 1 |
cent2, &input1_key, &input2_key, &mut closure);
}
join_helper(&recent1, &recent2, input1_key, input2_key, &mut closure);
}
output.insert(Relation::from_vec(results));
}
/// Join, but for two relations.
pub(crate) fn join_into_relation<'me, Key: Ord, T1: Ord, T2: Ord, Result: Ord>(
input1:... | Rust | 0 |
:Vec<LegalMove> = Vec::new();
match &state.banmen {
&Banmen(ref kinds) => {
for y in 0..kinds.len() {
for x in 0..kinds[y].len() {
let (x,y) = match t {
Teban::Sente => (x,y),
Teban::Gote => (8 - x, 8 - y),
};
Rule::win_only_moves_with_point_and_kind_and_buffer(
... | Rust | 0 |
# -*- encoding: utf-8 -*-
# This is a package that contains a number of modules that are used to
# test import from the source files that have different encodings.
# This file (the __init__ module of the package), is encoded in utf-8
# and contains a list of strings from various unicode planes that are
# encoded diffe... | Python | 1 |
import warp as wp
from scene import BoxScene
import pyvista as pv
import numpy as np
from outputs import OutputType, OutputStyle, PyvistaInteractive, PyvistaVideo, PlySeries
def main(
output_type: OutputType = PyvistaInteractive(),
output_style: OutputStyle = OutputStyle(),
):
wp.init()
N = 50 + 1
... | Python | 1 |
else:
return S.NegativeInfinity
@property
def zdirection(self):
"""The z direction of the ray.
Positive infinity if the ray points in the positive z direction,
negative infinity if the ray points in the negative z direction,
or 0 if the ray is horizontal.
... | Python | 1 |
we collect all the declared list filters.
qs = self.root_queryset.clone()
(
self.filter_specs,
self.has_filters,
remaining_lookup_params,
search_may_have_duplicates,
has_active_filters,
) = self.get_filters(request)
# Then, we... | Python | 1 |
nfo("load_pretrained: resized variant: %s to %s" % (posemb.size(), posemb_new.size()))
ntok_new = posemb_new.size(1)
if self.classifier == "token":
posemb_tok, posemb_grid = posemb[:, :1], posemb[0, 1:]
ntok_new -= 1
... | Python | 1 |
the struct to use.
let member_id = get_axis_pts_x_memberid(module, recordlayout_info, &axis_pts.deposit_record);
if let Some(inner_typeinfo) = get_inner_type(typeinfo, member_id) {
match inner_typeinfo {
TypeInfo::Array{dim, arraytype, ..} =>... | Rust | 0 |
import flet as ft
from database.db import buscar_solicitacoes_pendentes, atualizar_status_solicitacao
from views.login_view import login_view
def guarda_view(page, realizar_login):
solicitacoes = buscar_solicitacoes_pendentes()
def aprovar_solicitacao(e, solicitacao_id):
atualizar_status_solicitacao(... | Python | 1 |
# 更新探索率
if self.epsilon > self.epsilon_min:
self.epsilon *= self.epsilon_decay
# 列印訓練信息
print(f"\n第 {episode + 1}/{episodes} 輪 (地圖 {self.robot1.li_map})")
print(f"步數: {steps}, 總獎勵: {total_reward... | Python | 1 |
, "bù"),
('㾠', "kuáng"),
('㾡', "què"),
('㾢', "ài"),
('㾣', "qīn"),
('㾤', "qiāng"),
('㾥', "chù"),
('㾦', "pèi,pēi"),
('㾧', "kuò,luǒ"),
('㾨', "yī,qǐ,ǎi"),
('㾩', "guāi"),
('㾪', "shěng"),
('㾫', "piān"),
('㾭', "zhòu"),
('㾮', "huáng"),
('㾯', "huī,tuí"),
('㾰', "hú"... | Rust | 0 |
hs[key.lower() + ".smcp"] and isNeeded[key]:
thisFont.glyphs[key.lower() + ".smcp"].setLeftKerningGroup_(re.sub("UC_", "SC_", groupsUC[key][0]))
thisFont.glyphs[key.lower() + ".smcp"].setRightKerningGroup_(re.sub("UC_", "SC_", groupsUC[key][1]))
if sender == self.w.allcapButton:
if thisFont.glyphs[k... | Python | 1 |
cfg(any(feature = "v1_18", feature = "dox"))]
#[cfg_attr(feature = "dox", doc(cfg(feature = "v1_18")))]
pub use self::source_clip_asset::{SourceClipAsset, NONE_SOURCE_CLIP_ASSET};
mod test_clip;
pub use self::test_clip::{TestClip, NONE_TEST_CLIP};
mod text_overlay;
pub use self::text_overlay::{TextOverlay, NONE_TEXT_... | Rust | 0 |
# lovince_quantum_core.py
import numpy as np
import matplotlib.pyplot as plt
import cmath
import math
# ================================
# Lovince Constants (Soul Codes)
# ================================
π = np.pi
φ = (1 + 5 ** 0.5) / 2
ħ = 6.626e-34 # Planck constant
c = 299792458 # Speed of Light
L_ID = 3 * π * ... | Python | 1 |
#!/usr/bin/env python3
"""
Debug distance matrix and clustering to see if they match R exactly
"""
from sequenzo import *
import pandas as pd
import numpy as np
from scipy.cluster.hierarchy import fcluster
def debug_matrix_and_clustering():
# Load the MVAD dataset
df = load_dataset('mvad')
# Define time ... | Python | 1 |
file with repaired code
try:
cleaned_repaired_code = test_manager._clean_test_code(repaired_code)
with open(test_file_path, 'w', encoding='utf-8') as f:
f.write(cleaned_repaired_code)
print(f"Test file overwritten with repaired code: {test_... | Python | 1 |
rue)
} else {
Ok(false)
}
}
pub async fn read_signal() -> AnyproxyState {
loop {
tokio::select! {
biased;
_ = tokio::signal::ctrl_c() => {
return AnyproxyState::Quit;
},
sig = si... | Rust | 0 |
get_hour_min_from_value(record.time_window_end)
if hour > 23:
raise ValidationError(error_msg)
@api.model
def _get_hour_min_from_value(self, value):
hour = math.floor(value)
minute = round((value % 1) * 60)
if minute == 60:
minute = 0
... | Python | 1 |
new("a/b/c/d/e/../../../../../f")?;
/// const EXPECTED: &str = "http://example.com/f";
/// let task = resolver.create_task(reference);
///
/// // Buffer is too short for processing, even though it is long enough
/// // to store the result.
/// let mut buf = [0_u8; EXPECTED.len()];
/// let re... | Rust | 0 |
able(var), end + 1))
}
/// Consume all pending input in the formatting string.
fn consume_pending(&mut self) -> Option<Token<'a>> {
if self.0.is_empty() {
None
} else {
Some(Token::Text(mem::take(&mut self.0)))
}
}
}
impl<'a> Iterator for Parser<'a> {
... | Rust | 0 |
essary_columns,
))
})
}
}
fn default_table_view_on_click<T>(info: DefaultCallbackInfoUnchecked<T>) -> CallbackReturn {
unsafe { info.invoke_callback(table_view_on_click) }
}
pub fn table_view_on_click<T>(_info: DefaultCallbackInfo<T, TableViewState>) -> CallbackReturn {
println!("table... | Rust | 0 |
n squad["data"]:
title = article.get("title", "")
for paragraph in article["paragraphs"]:
context = paragraph["context"] # do not strip leading blank spaces GH-2585
for qa in paragraph["qas"]:
answer_starts = [answer["answe... | Python | 1 |
#####################################################################################
# Copyright (c) 2023-2025 Galbot. All Rights Reserved.
#
# This software contains confidential and proprietary information of Galbot, Inc.
# ("Confidential Information"). You shall not disclose such Confidential Information
# and shal... | Python | 1 |
e, materials) == false {
return None;
}
return None;
}
pub fn has_enough_materials(recipe: &Recipe, materials: &Vec<NamedItem>) -> bool {
for item in recipe.items.iter() {
let id = &item.material_id;
}
return true;
}
#[macro_export]
macro_rules! str {
($value:expr) => (
... | Rust | 0 |
from migen import *
from litex.soc.interconnect.stream import *
from litex.soc.interconnect.stream_sim import *
from litevideo.csc.common import *
from litevideo.csc.rgb2ycbcr import rgb2ycbcr_coefs, RGB2YCbCr
from litevideo.csc.test.common import *
class TB(Module):
def __init__(self):
self.submodules... | Python | 1 |
g
let mut delay = 20; // delay between each request
let mut command = "ddos"; // command to run (ddos, version, help)
let mut args: Vec<String> = std::env::args().collect(); // arguments vector
args.remove(0); // remove the program name from the vector
while args.len() > 0 {
match args[0].a... | Rust | 0 |
self.tol[0];
self.halo[2][1] = x[1] + self.tol[1];
self.halo[2][2] = x[2] - self.tol[2];
self.halo[3][0] = x[0] - self.tol[0];
self.halo[3][1] = x[1] + self.tol[1];
self.halo[3][2] = x[2] - self.tol[2];
self.halo[4][0] = x[0] - self.tol[0];
... | Rust | 0 |
import json
from sodasql.soda_server_client.soda_server_client import SodaServerClient
class MockSodaServerClient(SodaServerClient):
# noinspection PyMissingConstructor
def __init__(self):
self.requests = []
self.commands = []
self.host = 'MockSodaServerClient'
self.token = '... | Python | 1 |
ut self, enabled: bool) -> Result<(), Error<SpiError, PinError>> {
if enabled {
self.hold.set_high().map_err(Error::PinError)
} else {
self.hold.set_low().map_err(Error::PinError)
}
}
/// Wake up the chip and also return the manufacturer ID
pub fn release_fro... | Rust | 0 |
}
}
#[cfg(feature = "std")]
impl<T> Serialize for RwLock<T>
where
T: Serialize,
{
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: Serializer,
{
match self.read() {
Ok(locked) => locked.serialize(serializer),
Err(_) => Err(S::Error::c... | Rust | 0 |
# based on https://github.com/AUTOMATIC1111/stable-diffusion-webui/blob/v1.6.0/modules/ui_gradio_extensions.py
import os
import gradio as gr
import args_manager
from modules.localization import localization_js
GradioTemplateResponseOriginal = gr.routes.templates.TemplateResponse
modules_path = os.path.dirname(os.p... | Python | 1 |
4upqslxwr, n4rmq0_1or5, m147ikvj9p1: ''
@(yield from q587vz2er6u)
def a51mvxm2dpa(ytdwpcwjsw7: e8dnd88bzje, v4zfx2oics4, bql4labwfhi, pj6c6hongzr: ex25j41hi2r, wg2eb7b1mme: gc0vaothqy6, sgfsm5kej4t, yd3ef_z0vsk, x9akg25sm1g: iln4krf42yj, botc8y5uqeo: x_2ybif85mz):
"""# stoppered_blink_raincoat -> splitters_parallel... | Python | 1 |
import struct
import numpy as np
from laserscan import Laserscan
def read_labels(filename):
""" read labels from given file. """
contents = bytes()
with open(filename, "rb") as f: # rb = read binary
f.seek(0, 2) # move the cursor to the end of the file
num_points = int(f.tell() / 4)
f.seek(0, 0)
... | Python | 1 |
, b'c', b'u', b's', b't', b'o', b'm', b'-', b'v', b'a', b'l',
//! b'u', b'e'],
//! result);
//! ```
//!
//! Encodes some pseudo-headers that are already found in the static table.
//!
//! ```rust
//! use hpack::Encoder;
//!
//! let mut encoder = Encoder::new();
//! let headers = vec![
//! (&b":method"[... | Rust | 0 |
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import (QApplication, QMainWindow, QComboBox)
# Only needed for access to command line arguments
import sys
class MainWindow(QMainWindow):
def __init__(self):
super(MainWindow, self).__init__()
self.setWindowTitle("My App")
widget = QCombo... | Python | 1 |
inst: expr3_0,
result: expr4_0,
};
return Some(expr5_0);
}
// Generated as internal constructor for term adc_paired.
pub fn constructor_adc_paired<C: Context>(
ctx: &mut C,
arg0: Type,
arg1: Gpr,
arg2: &GprMemImm,
) -> Option<ConsumesFlags> {
let pattern0_0 = arg0;
let p... | Rust | 0 |
"""
Write a function to pack consecutive duplicates of a given list elements into sublists.
assert pack_consecutive_duplicates([0, 0, 1, 2, 3, 4, 4, 5, 6, 6, 6, 7, 8, 9, 4, 4])==[[0, 0], [1], [2], [3], [4, 4], [5], [6, 6, 6], [7], [8], [9], [4, 4]]
"""
def pack_consecutive_duplicates(lst):
result = []
current =... | Python | 1 |
9]{12}").unwrap();
assert!(re.is_match(®ex("-AZ5750-[a-zA-Z0-9]{12}".to_owned())))
}
#[test]
fn is_digit_range_to_hex_ok() {
let re=Regex::new(r"[A-Z0-9]+").unwrap();
assert!(re.is_match(&digit_range_transformed_to_hex_without_leading_zero()));
}
}use glium::{Frame, VertexBuff... | Rust | 0 |
CreateIcon(hi, w as i32, h as i32, 1, 32,
&and[0] as *const _ as *const _,
&xor[0] as *const _ as *const _)
};
let window_class = WNDCLASSEXW {
cbSize: mem::size_of::<WNDCLASSEXW>() as UINT,
style: 0x0002 | 0x0001,
lpfnWndProc: Some(wnd_proc),
cbClsExtra: 0,
cbWndExtra: 0,
hInstance: hi,
hIcon: ... | Rust | 0 |
_handler = called_off_handler.lock().unwrap();
assert_eq!(*called_on_handler, true);
assert_eq!(*called_off_handler, false);
}
}
<reponame>vic485/EdoEngine-rs
pub mod rle_array;
use crate::{common::BaseNode, expr::Expression, typescript::TSType};
use serde::{Deserialize, Serialize};
use swc_atoms::J... | Rust | 0 |
!in_expression);
m.complete(p, JSX_CLOSING_ELEMENT)
}
/// Expects a JSX token that may be followed by JSX child content.
/// Ensures that the child content is lexed with the [LexContext::JsxChild] context.
fn expect_jsx_token(p: &mut Parser, token: JsSyntaxKind, before_child_content: bool) {
if !before_child... | Rust | 0 |
tions, lineno=lineno, count=count, function_name=None
)
if is_branch and branch_msg is not None:
try:
[covered, total] = branch_msg[branch_msg.rfind("(") + 1 : -1].split("/")
for i in range(int(total)):
_branch_from_json(linecov, data_sources, i, i < int(covered)... | Python | 1 |
#!/usr/bin/python3
# The QtPreview uses software rendering and thus makes more use of the
# CPU, but it does work with X forwarding, unlike the QtGlPreview.
import time
from picamera2 import Picamera2, Preview
picam2 = Picamera2()
picam2.start_preview(Preview.QT)
preview_config = picam2.create_preview_configuratio... | Python | 1 |
unner_for!(tms, TaskRequest, TaskResponse);
generate_runner_for!(tdfs, DFSRequest, DFSResponse);
generate_runner_for!(fns, InvokeTaskRequest, InvokeTaskResponse);
fn connect(args: ConnectOpt) -> Result<(), failure::Error> {
let enclave_info_content = fs::read_to_string(&args.enclave_info)?;
let enclave_info = ... | Rust | 0 |
tils.read_string(file),
read_bones(file),
read_faces(file),
read_bone_bindings(file),
read_uvs(file),
read_blends(file),
read_vertices(file),
)
def write_bmf(file: typing.BinaryIO, bmf: Bmf) -> None:
"""Write BMF."""
utils.write_string(file, bmf.skin_name)
... | Python | 1 |
import os
import numpy as np
import tempfile
import uuid
from archai.common.store import ArchaiStore
CONNECTION_NAME = 'MODEL_STORAGE_CONNECTION_STRING'
def test_store():
con_str = os.getenv(CONNECTION_NAME)
if not con_str:
print(f"Skipping test_store because you have no {CONNECTION_NAME} environment... | Python | 1 |
"""
Default metrics for AutoCV.
"""
from .utils import determine_problem_type
from sklearn.metrics import (
make_scorer,
accuracy_score,
f1_score,
precision_score,
recall_score,
mean_squared_error,
mean_absolute_error,
r2_score
)
# Define default scorers for binary classification
binar... | Python | 1 |
Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub enum PresetNode {
/// Node(s) to the mainnet, the primary public Tangle.
///
/// This is currently a synonym to [`MainnetIotaFoundation`].
///
/// [`MainnetIotaFoundation`]: Self::MainnetIotaFoundation
Mainnet,
/// Node(s) maintained b... | Rust | 0 |
from datetime import date, datetime # noqa: F401
from typing import List, Dict # noqa: F401
from gscoordinator.flex.models.base_model import Model
from gscoordinator.flex.models.fixed_char_char import FixedCharChar
from gscoordinator.flex import util
from gscoordinator.flex.models.fixed_char_char import FixedCharC... | Python | 1 |
f.write("factor")
wait_for_flag("done", CONTROL_FILE)
end = time.time()
if verbosity==True:
print(f"Time spent in pdbridge_factor: {end - start} seconds")
####################### solve
def superlu_solve(vec, verbosity=False):
nrhs=vec.shape[-1]
start = time.time()
CONTROL_FILE... | Python | 1 |
ium": "https://i.pximg.net/user-profile/img/2015/01/08/11/08/15/8818996_7fcca39ad8a0bc7583a0c5c05a3c6470_170.jpg"
},
},
"visible": True,
"width": 1251,
"x_restrict": 0,
},
{
"caption": "■Twitter【<strong><a "
'href="h... | Python | 1 |
rans_twisted_list())
# print(' cis/trans/twisted? %s' % ' '.join(threes.cis_trans_twisted_list()))
try: print(" rama %s" % threes.get_ramalyze_key())
except: print(' rama not specified') # intentional
print(' conf %s' % threes.is_pure_main_conf())
try: print(' phi/psi %s' % thre... | Python | 1 |
44",
],
&[
"--color-only",
"--line-numbers",
"--line-numbers-zero-style",
"#444444",
],
&[
"--color-only",
"--line-numbers",
"--line-numbers-plus-style",
... | Rust | 0 |
1, "February":2, "March":3, "April":4, "May":5, "June":6,
"July":7, "August":8, "September":9, "October":10, "November":11, "December":12}
month = month_dict.get(month_name, 1)
if len(text_parts[2]) > 0:
day = int(re.match('([0-9]+)', text_parts[2]).groups(0)[0])
... | Python | 1 |
t = 0;
if let Some(Ok(record)) = result.next() {
if let Some(entry) = record.get(Some(&"a".into())) {
cnt = match entry.as_ref() {
Entry::Element(RecordElement::OffGraph(CommonObject::Count(cnt))) => *cnt,
_ => {
unreach... | Rust | 0 |
"""
------------------------------------------------------------------------------------------------------------------------
csv_generator.py
Copyright (C) 2019-22 - NFStream Developers
This file is part of NFStream, a Flexible Network Data Analysis Framework (https://www.nfstream.org/).
NFStream is free software: you ... | Python | 1 |
;
}
// Should we support tuple struct?
#[derive(Cacheable, Serialize)]
struct TupleMessage(i32);
#[test]
fn test_tuple_returns_error() {
let message = TupleMessage(1);
assert!(message.cache_message_key().is_err());
}
#[derive(Cacheable, Serialize)]
#[cache_ttl(42)]
#[cache_stale_ttl(30)]
#[cache_version(1)]
... | Rust | 0 |
acked(
nodes as usize,
BASE_DEGREE,
EXP_DEGREE,
porep_id,
api_version,
)
.expect("stacked bucket graph new_stacked failed");
// If a parent index is not less than half the total node count, then
// the parent falls in the secon... | Rust | 0 |
manager.load_segmentation(a_segmentation_stl_file_path.as_posix())
out_path = Path(tmpdir, "out.nii.gz")
an_io_manager.write_segmentation(segmentation_node, out_path)
assert out_path.exists()
def get_np_points(poly: vtkPolyData):
array = np.zeros((poly.GetNumberOfPoints(), 3))
vtk_points: vtkPoint... | Python | 1 |
'view_count': int,
'description': '',
'channel_id': 'UCiu-3thuViMebBjw_5nWYrA',
'channel_url': 'https://www.youtube.com/channel/UCiu-3thuViMebBjw_5nWYrA',
'uploader_url': 'https://www.youtube.com/@coletdjnz',
'uploader_id': '@coletdjnz',
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.