text string | label_name string | labels int64 |
|---|---|---|
);
let mut offer = Bill::new();
offer.add_item(8., water);
offer.add_item(4., applejuice);
offer.add_item(4., orangejuice);
offer.add_item(40., sandwich);
offer.add_item(2., service);
let mut invoice = Bill::new();
invoice.add_item(2., water);
invoice.add_item(0., applejuice);
... | Rust | 0 |
// @see https://stackoverflow.com/a/42498913/4949386
// - Pass string Rust -> Node FFI with example code.
#[no_mangle]
pub extern "C" fn smpi_free_string(ptr: *mut c_char) {
assert!(!ptr.is_null(), "null ptr passed to Rust free_string fn");
unsafe {
// Free memory.
// - Convert to Rust CString,... | Rust | 0 |
from setuptools import setup, find_packages
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(
name="jsninja-scanner",
version="1.0.0",
author="Your Name",
author_email="your.email@example.com",
description="A comprehensive JavaScript security scanner for ... | Python | 1 |
RISON = 0x2;
}
}
impl Arena<crate::Expression> {
fn get_image_expr_ty(
&self,
handle: Handle<crate::Expression>,
global_vars: &Arena<crate::GlobalVariable>,
arguments: &[FunctionArgument],
) -> Result<Handle<crate::Type>, Error> {
match self[handle] {
cra... | Rust | 0 |
he condition is truthy.
/// * `args[2]` - The value to be returned if the condition is not truthy.
///
/// # Errors
///
/// * `InvalidNumberOfArguments` - If there are too less or too many passed arguments.
fn rusht_if(args: &[Expr]) -> Result<Expr> {
match args {
[cond, on_true, on_false] => match cond.clo... | Rust | 0 |
# Scrapy settings for Maoyan project
#
# For simplicity, this file contains only settings considered important or
# commonly used. You can find more settings consulting the documentation:
#
# https://docs.scrapy.org/en/latest/topics/settings.html
# https://docs.scrapy.org/en/latest/topics/downloader-middleware.... | Python | 1 |
);
// pubkey of secp256k1 private key "mySecret"
let raw_bytes = [
2, 150, 81, 169, 170, 196, 194, 43, 39, 179, 1, 154, 238, 109, 247, 70, 38, 110, 26, 231,
70, 238, 121, 119, 42, 110, 94, 173, 25, 142, 189, 7, 195,
];
let public_key = PublicKey::from_slice(&raw_bytes, PublicKey::DEFAUL... | Rust | 0 |
json_str = target_scan.to_json()
dict_result = target_scan.to_dict()
# Verify all data is preserved
assert dict_result["severity"] == "critical"
assert len(dict_result["possible_attacks"]) == 5
assert "SQL Injection" in dict_result["possible_attacks"][0]
assert "XS... | Python | 1 |
[`read`](crate::generic::Reg::read), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields ... | Rust | 0 |
+ (esti_cam_zz - cam_zz) ** 2)
#logging.info('inv_proj_err (meters), min, mean, median, max: {}, {}'.format(np.min(inv_proj_err), np.mean(inv_proj_err), np.median(inv_proj_err), np.max(inv_proj_err)))
# check accuracy in object coordinate frame
# result = np.dot(np.hstack((esti_cam_xx, esti_cam_yy, esti_ca... | Python | 1 |
type) -> Self {
Element::Value(Value::$id($func(value)))
}
}
};
}
value_from!(Boolean, bool);
value_from!(Char, char);
value_from!(String, String);
value_from!(Bytes, Vec<u8>);
value_from!(UUID, crate::Uuid);
value_from_proc!(String, &str, String::from);
value_from_proc!(Bytes,... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Simple Interest Calculation
Write a program that asks for the principal amount, annual
interest rate, and time in years. Calculate and display the simple interest.
"""
#SI = (P × R × T) / 100
principal = input("Please enter the principal amount: ")
principal = float(principal)
rate = inp... | Python | 1 |
# built-in
from pathlib import Path
# app
from ..controllers import Resolver, analyze_conflict
from ..models import Requirement
from ..package_manager import PackageManager
from ._package import get_resolver
def install_deps(resolver: Resolver, python_path: Path, silent: bool, logger=None) -> bool:
# resolve
... | Python | 1 |
# rsa 高位攻击基础
# https://sagecell.sagemath.org/
# rsa 高位攻击,爆破处理
n = 0x9d3a1a28ecb1bd245dd86b18dc4c5b729f23778710005118836129f08e31d6516de8ab47db1b3b7f660f50d283b1e9f2c06e7836136e4c0159f5d2b05771861d3ce6aa8715932eadc1cc0f380909a1961018340f7393142f9c177b1187151f97ac8cdc4ad17fa59a0f39d192af555f27de9cc800846eb2ca6ce78f87c0c... | Python | 1 |
lts
img_ids = sorted(coco_api.imgs.keys())
imgs = coco_api.loadImgs(img_ids)
logger.info("Loaded {} images in COCO format from {}".format(len(imgs), json_file))
dataset_dicts = []
for img_dict in imgs:
record = {}
record["file_name"] = os.path.join(image_root, img_dict["file_name... | Python | 1 |
_ => false,
};
if replace {
*next_action = Some(evt);
}
})
.expect("Failed to create a window !");
window.set_title("Themed frame".to_string());
window.set_frame_config(create_frame_config());
let mut pools = env.create_double_pool(|_|... | Rust | 0 |
atten()
}
/// Returns the FunctionEnv for `module`::`fun`
/// Returns `None` if this function does not exist
pub fn get_function_env(&self, module: &ModuleId, fun: &IdentStr) -> Option<FunctionEnv> {
self.env
.find_function_by_language_storage_id_name(module, fun)
}
/// Nor... | Rust | 0 |
options: Option<BasicConsumeOptions>,
task_limiter: TaskLimiter,
},
#[cfg(feature = "grpc")]
Grpc { addr: SocketAddrV4 },
}
pub enum ParallelCommonConsumer {
#[cfg(feature = "kafka")]
Kafka {
consumer: StreamConsumer<DefaultConsumerContext>,
ack_queue: KafkaAckQueue,
... | Rust | 0 |
=g.degree,
node_color=g.betweenness(),
node_color_gradient="Viridis",
)
@output(id="bokeh")
@render_widget
def _():
from bokeh.plotting import figure
x = [1, 2, 3, 4, 5]
y = [6, 7, 2, 4, 5]
p = figure(title="Simple line example", x_axis_label... | Python | 1 |
"""
Simple Strip Plot
-----------------
A simple example of how to make a strip plot.
"""
# category: simple charts
import altair as alt
from vega_datasets import data
source = data.cars()
alt.Chart(source).mark_tick().encode(
x='Horsepower:Q',
y='Cylinders:O'
)
| Python | 1 |
from collections.abc import Callable
import biotite.structure as struc
import numpy as np
def apply_and_spread(
segment_start_stop_idxs: np.ndarray, data: np.ndarray, function: Callable, axis: int | None = None
) -> np.ndarray:
"""
Apply a function segment-wise and then spread the result to the original ... | Python | 1 |
pub extern "C" fn lkm_api_info(ptr: *const u8) {
let text = unsafe { cstr_to_str(ptr, 1024) };
info!("{}", text);
}
#[no_mangle]
pub extern "C" fn lkm_api_add_kernel_symbols(start: usize, end: usize) {
use crate::lkm::manager::LKM_MANAGER;
let length = end - start;
use core::str::from_utf8;
le... | Rust | 0 |
[128, 4, 2],
[256, 6, 2],
[512, 16, 2],
[2048, 1, 2]
]
self.override_groups_map = dict()
class RepVGGBLarge(RepVGG):
def __init__(self, class_num=1000, deploy=False):
super(RepVGGBLarge, self).__init__(class_num, deploy)
def auditConfig(self):
... | Python | 1 |
ransforms_centers[1]))
mfovs1_centers_sec2centers[2] = np.concatenate((mfovs1_centers_sec2centers[2], missing_mfovs1_sec2_centers))
# # Put all features of each section in an rtree
# #sec1_features_rtree = tinyr.RTree(interleaved=False, max_cap=5, min_cap=2)
# sec1_features_grid = G... | Python | 1 |
import pandas as pd
from datetime import datetime
class PerformanceUtils(object):
def rate2equity(self, df_rates):
df = df_rates.copy(deep=True)
df.dropna(inplace=True)
for col in df.columns:
df[col] = (df[col] + 1).cumprod()
return df
def equity2rate(self, df_equ... | Python | 1 |
oment_list.extend(
[
moment
for moment in _two_zone_utils.get_gate_error_channel(
moments[i],
np.array(self.local_pauli_rates),
np.array(self.global_pauli_rates),
self.... | Python | 1 |
# Copyright (c) 2022-2025, The Isaac Lab Project Developers (https://github.com/isaac-sim/IsaacLab/blob/main/CONTRIBUTORS.md).
# All rights reserved.
#
# SPDX-License-Identifier: BSD-3-Clause
import gymnasium as gym
from . import agents
from .forge_env import ForgeEnv
from .forge_env_cfg import ForgeTaskGearMeshCfg, ... | Python | 1 |
CallbackRegistration {
key: NonZeroU32::new(u32::MAX).unwrap(),
phantom: PhantomData,
pinned: PhantomPinned,
}
}
#[inline(always)]
#[must_use]
pub fn register_by_ref<R, T>(
receiver: Pin<&'_ R>,
handler: fn(*const R, DomRef<&'_ T>),
) -> CallbackRegistration<R, fn(DomRef<&'_ T>)>
where
fn(DomRe... | Rust | 0 |
edium):
"""
Represents an optical medium for which the permittivity and permeability are known.
This class should never be instantiated directly. Instead it should be
instantiated indirectly by instantiating Medium with any two of
permittivity, permeability, and n specified, or by not specifying an... | Python | 1 |
e]
pub fn activations(&self) -> &[Activation] {
self.act.as_slice()
}
#[inline]
pub fn input_count(&self) -> usize {
self.input_count
}
#[inline]
pub fn output_count(&self) -> usize {
self.output_count
}
}
#[repr(transparent)]
#[derive(Debug, Copy, Clone, Defau... | Rust | 0 |
name = input("Enter your game:")
gender = input("Enter your gender:")
age = input("Enter your age:")
fav_sport = input("Ente your fav sport:")
print(f"Hi my name is {name}, I am a {gender}, My age is {age}, my fav sport is {fav_sport}")
item = "Emaralds"
cost = 188
print("I bought {} and it cost me {}".format (item... | Python | 1 |
c<_> = bs2.intersection(&bs1).iter().cloned().collect();
assert_eq!(inter2_to_1, [Book::new(String::from("Test book2"))]);
}
}
// Copyright © 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR MIT
//! Generic process traits
use alloc::boxed::Box;
use alloc::string::String;
use... | Rust | 0 |
1}"
@trace
def add1_twice(x: int) -> int:
return compose(add1, add1)(x)
assert callable(add1_twice), f"add1_twice is not callable: {add1_twice}"
assert syntactic_eq(add1_twice(1), 3) and syntactic_eq(
compose(add1, add1)(1), 3
)
assert syntactic... | Python | 1 |
if not args.no_gpu: model.cuda()
# Update model weights with checkpoint
checkpoint = args.checkpoint if args.checkpoint else get_checkpoint(args.model_type)
model.resume(checkpoint)
# Get sample image files
low_files = read_dir(
path.join(args.sample_dir, args.model_type, "with_art"),... | Python | 1 |
ATMA,
0x0023 => RType::NAPTR,
0x0024 => RType::KX,
0x0025 => RType::CERT,
0x0026 => RType::DNAME,
0x0027 => RType::SINK,
0x0028 => RType::OPT,
0x0029 => RType::APL,
0x002A => RType::DS,
0x002B => RType::SSHFP,
... | Rust | 0 |
elif self.search_algorithm_type.lower() == "grid":
self._search_algorithm = GridSearcher(self.search_space)
elif self.search_algorithm_type.lower() == "random":
self._search_algorithm = RandomSearcher(self.search_space, self.seed)
elif self.search_algorithm_type.lower() =... | Python | 1 |
"""
Create multiple windows, some of which have their own servers, both before and after `webview.start()` is called.
"""
import bottle
import webview
# We'll have a global list of our windows so our web app can give us information
# about them
windows = []
# A simple function to format a description of our server... | Python | 1 |
= false` or compile with `--no-default-features`."
);
#[cfg(feature = "size_16")]
macro_rules! pick_size_type {
($s16:ty, $s32:ty, $s64:ty) => {
$s16
};
($s16:ty, $s32:ty, $s64:ty,) => {
pick_size_type!($s16, $s32, $s64)
};
}
#[cfg(feature = "size_32")]
macro_rules! pick_size_type {
... | Rust | 0 |
NGTH,
by_words=True
)
post_body = split_post_body[0]
if not images_data:
group_post = await self.bot.send_message(
chat_id=TG_GROUP_ID,
text=post_body
)
else:
... | Python | 1 |
álido notar novamente a o efeito da NÃO memorização)
);
}
return custo; //Custo do melhor caso
}
//Criação da matriz e chamada da função recursiva com memorização
fn init_med_recursivo(str1: &String, str2: &String) -> i32 { //Retorna um inteiro
let n = str1.len() as i32;
let m = str2.len() as ... | Rust | 0 |
ation.stake, 2 * stake.delegation.stake);
}
}
// Copyright 2021 <NAME>.
//
// 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
//
//... | Rust | 0 |
Vec<SignedMessage>)>;
pub const SIG_LEN: usize = 64;
}
#[cfg(feature = "pruntime-client")]
pub mod pruntime_client;
pub mod actions {
pub const ACTION_GET_INFO: u8 = 2;
pub const BIN_ACTION_START: u8 = 128;
pub const BIN_ACTION_SYNC_PARA_HEADER: u8 = BIN_ACTION_START;
pub const BIN_ACTION_DISPA... | Rust | 0 |
);
self.length = new_length;
Ok(new_length)
}
}
#[inline(always)]
fn mprotect(&self, address: *mut u8, length: usize, protection_flags: i32)
{
unsafe { mprotect(address as *mut _, length, protection_flags) };
}
}
<reponame>elithaxxor/Chatroom
### not my code, credit goes to https://github.com/trickst... | Rust | 0 |
all missing hyperparameters (those that are not
specified in param_space)."""
hyperparam_bounds = {"a": [1.0, 2.0], "b": {"c": [2.0, 4.0], "d": [4.0, 10.0]}}
pb2 = _create_pb2_scheduler(hyperparam_bounds=hyperparam_bounds)
mock_runner = MagicMock()
def validate_config(config, bounds):
for p... | Python | 1 |
tem(), result[1].item(), \
trainID2Vid[result[2].item()]
res_m_name = modelID2name[res_m_id]
res_c_name = colorID2name[res_c_id]
# 图像标题
title = 'pred: ' + pred_m_name + ' ' + color_dict[pred_c_name] \
+ ', vehicle ID ' + str(pred_vid... | Python | 1 |
VsDB<T: Engine> {
db: T,
}
impl<T: Engine> VsDB<T> {
#[inline(always)]
fn new() -> Result<Self> {
Ok(Self {
db: T::new().c(d!())?,
})
}
#[inline(always)]
pub(crate) fn alloc_branch_id(&self) -> BranchID {
self.db.alloc_branch_id()
}
#[inline(always)... | Rust | 0 |
metadata = {
'protocolName': 'BMDA - Dengue Protocol',
'author': 'Sakib <sakib.hossain@opentrons.com>',
'description': 'Custom Protocol Request',
'apiLevel': '2.8'
}
def run(ctx):
[p300_mount, temperature, final_tubes, comp_asp_speed, comp_disp_speed,
comp1_vol, comp2_vol, comp3_vol, comp... | Python | 1 |
".to_string())]},
EditElement{edit:vec![Edit::AddAttribute("class".to_string(),"d".to_string())]}
)]
};
fme(&mut xml, &m);
assert_eq!(
unparse(&xml),
r#"<div>a</div><p id="b" class="d">b</p>"#
);
}
#[test]
fn fme3() {
let mut xml = parse(r#"<div class="b">a</div><p>b</p>"#).un... | Rust | 0 |
name == "ScriptCallTest" {
return self.script_call_test(argv, &Element::from(root));
}
None
}
}
fn check_options() {
sciter::set_options(sciter::RuntimeOptions::ScriptFeatures(
sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_SYSINFO // Enables `Sciter.machineName()`
| sciter::SCRIPT_RUNTIME_FEATURES::ALLOW_FIL... | Rust | 0 |
# Copyright (c) 2024-Present
# Author: Jiawei Zhang <jiawei@ifmlab.org>
# Affiliation: IFM Lab, UC Davis
####################
# tinybig Datasets #
####################
"""
This module defines several frequently used dataset, which can be used for training the RPN model in the tinyBIG toolkit.
## Classes in this Modu... | Python | 1 |
# import gin
import numpy as np
import torch
import torch.nn as nn
from torch.nn.utils import weight_norm
from .pcmer import PCmer
def split_to_dict(tensor, tensor_splits):
"""Split a tensor into a dictionary of multiple tensors."""
labels = []
sizes = []
for k, v in tensor_splits.items():
... | Python | 1 |
f item.get("id") == item_id).get("handles")
transforms.append(Transform(file_slug, handles, x, y, rotation))
total_placed_count += 1
result_containers.append(ResultContainer(container_id, transforms))
is_all_placed = total_placed_count == total_requeste... | Python | 1 |
ame='skip_ouput_1')
skip_output_2 = self.conv2d(inputdata=relu_14, out_channel=3, kernel_size=3,
padding='SAME', stride=1, use_bias=False,
name='skip_output_2')
skip_output_3 = self.conv2d(inputdata=relu_16, out_ch... | Python | 1 |
success=True,
message=f"Supported document formats:\n\n{format_list}",
metadata={"supported_formats": list(supported_formats.keys()), "total_formats": len(supported_formats)},
)
# Example usage and entry point
if __name__ == "__main__":
load_dotenv()
# Default argum... | Python | 1 |
from django.contrib import admin
from .models import (
BoundingBoxProject,
ImageCaptioningProject,
ImageClassificationProject,
Member,
Project,
SegmentationProject,
Seq2seqProject,
SequenceLabelingProject,
Tag,
TextClassificationProject,
)
class MemberAdmin(admin.ModelAdmin):
... | Python | 1 |
��', "jiǎ"),
('𩌏', "bó,fú,bù,fù"),
('𩌐', "tà"),
('𩌑', "yuǎn"),
('𩌘', "tà"),
('𩌝', "chuí"),
('𩌠', "xiōng"),
('𩌡', "hé,juē"),
('𩌢', "suō"),
('𩌧', "mò"),
('𩌨', "chóng"),
('𩌩', "suī"),
('𩌪', "zé"),
('𩌫', "lù"),
('𩌬', "zhāng"),
('𩌭', "luò"),
('𩌮... | Rust | 0 |
from distutils.core import setup
from sys import version
# earlier versions don't support all classifiers
if version < '2.2.3':
from distutils.dist import DistributionMetadata
DistributionMetadata.classifiers = None
DistributionMetadata.download_url = None
setup(name='nvidia-ml-py',
version='3.295.0... | Python | 1 |
chema {
fn fmt(f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.write_str("I32Schema")
}
}
#[derive(Debug)]
pub struct U64Schema;
impl Display for U64Schema {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
f.write_str("U64Schema")
}
}
impl DisplayType for U64Schem... | Rust | 0 |
class NoAccessToLeetCode():
def __init__(self,msg):
self.msg=msg
class Leetcode:
def content(self):
print("All Leetcode content : access")
class Bootcamp:
def __init__(self,name,numProSolve):
self.name=name
self.numProSolve=numProSolve
def checkCode(self,course... | Python | 1 |
import json
from typing import List
from django.db import models
class KnowledgeFileMeta(models.Model):
id = models.BigAutoField(primary_key=True, verbose_name='主键')
file_id = models.CharField(max_length=64, default='', verbose_name='来源')
summary_question = models.TextField(verbose_name='总结')
tag = m... | Python | 1 |
str.to_str()?;
ipas.push_str(phonemes_str);
// if not null, we need to make another call
if c_text_ptr.is_null() {
return Ok(ipas)
}
// add newline to imitate espeak executable behavior
ipas.push('\n');
}
}
/// List the names of the voices supported by th... | Rust | 0 |
) => name,
};
files.push(TestFile {
name: name.to_owned(),
path: entry.into_path(),
});
}
files
}
mod action;
mod message;
mod variant;
pub use action::*;
pub use message::*;
pub use variant::*;
use std::fs::{self, File as SyncFile};
use std::sync::{Arc,
... | Rust | 0 |
an integer as the line number");
let file = File::open(&Path::new(&filename[]));
let mut reader = BufferedReader::new(file);
match reader.lines().skip(line_number-1).next() {
None => panic!("No such line (file is too short)"),
Some(result) => match result {
// Handle any errors... | Rust | 0 |
-> Result<(), aws_smithy_http::operation::SerializationError> {
#[allow(unused_mut)]
let mut scope_540 = writer.prefix("Description");
if let Some(var_541) = &input.description {
scope_540.string(var_541);
}
#[allow(unused_mut)]
let mut scope_542 = writer.prefix("Image");
if let Som... | Rust | 0 |
import os
from pathlib import Path
from collections import namedtuple
os.chdir(Path(__file__).parent)
Coord = namedtuple("Coord", ["x", "y"])
def get_new_possition(coord: Coord, direction: str):
new_coord = None
if direction == "^":
new_coord = Coord(coord.x, coord.y+1)
elif direction == ">":
... | Python | 1 |
Main period size. Default is `14`.
///
/// Range is \[`2`; [`PeriodType::MAX`](crate::core::PeriodType)\).
pub period: PeriodType,
/// Signal zone size. Default is `0.2`.
///
/// Range is \[`0.0`; `0.5`\]. Value `0.5` means that the `lower bound` is the same as the `upper bound`.
pub zone: ValueType,
}
impl In... | Rust | 0 |
data.video_convert.link(&data.video_sink).unwrap();
data.audio_convert.link(&data.audio_sink).unwrap();
// set the source URI
data.source.set_property_from_str(
"uri",
"https://www.freedesktop.org/software/gstreamer-sdk/data/media/sintel_trailer-480p.webm",
);
// make sure we'r... | Rust | 0 |
return Err(String::new());
}
// Parse config argument.
let config = match matches.opt_str("c") {
Some(s) => {
if s.is_empty() {
// Option is present, but without any argument.
return Err("Config option is present, b... | Rust | 0 |
}
impl<'a> fmt::Display for MockEvent<'a> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(
f,
"{:>30}: {:>14}",
self.name,
self.value.separated_string()
)
}
}
impl<'a> Printable for MockEvent<'a> {
fn name(&self) -> &str {
self.name
}
fn value(&self) -> u64 {
self.value
}
}
... | Rust | 0 |
import tkinter as tk
from ui.sobre_ui import tela_sobre
from ui.carrinho_ui import tela_carrinho
def tela_menu(usuario):
root = tk.Tk()
root.title("Menu - Loja de Roupas")
root.geometry("600x400")
tk.Label(root, text=f"Bem-vindo(a), {usuario['email']}!", font=("Arial", 16)).pack(pady=20)
# Botões... | Python | 1 |
rf.rs<gh_stars>0
use crate::result::TockResult;
use crate::syscalls::{command, command2};
const DRIVER_NUMBER: usize = 0x90004;
mod command_nr {
pub const COUNT: usize = 0;
pub const CYCLES: usize = 1;
pub const INSTRUCTIONS: usize = 2;
}
pub struct Perf;
impl Perf {
pub fn count(&self) -> TockResul... | Rust | 0 |
es();
let core_input = self.core_ui.get_input_sink();
// Connect the streams
let core = self.core.clone();
let core_ui_events = gtk_events
.map(move |event| {
let mut core = core.lock().unwrap();
// Generate the core UI events fo... | Rust | 0 |
focused)
.expect("No focused output")
}
/// AwesomeWM like workspace behavior for sway
#[derive(Debug, Clap)]
#[clap(version, author, about, global_setting = AppSettings::ColoredHelp, setting = AppSettings::GlobalVersion, setting = AppSettings::VersionlessSubcommands)]
enum Args {
/// Initialize a workspac... | Rust | 0 |
#!/usr/bin/env python
#
# Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
import numpy as np
class Dysco_distance:
def __init__(self, what_distance):
self.what_distance = what_distance
return
def dysco_distance(self, matrix_a, matrix_b):
with np.errstate(invalid='ignore'):
matrix_a = matrix_a.copy()
matrix_b = matrix_b.copy()
... | Python | 1 |
from collections import OrderedDict
from hailo_model_zoo.core.eval.eval_base_class import Eval
from hailo_model_zoo.core.factory import EVAL_FACTORY
ACCEPTED_AGE_DELTA = 5
ADIENCE_AGE_LIST = [3.0, 7.0, 13.5, 22.5, 35.0, 45.5, 56.5]
def _get_age_range(age):
for i, _range_min_age in enumerate(ADIENCE_AGE_LIST):
... | Python | 1 |
}
}
//! An implementation of stencil using depth buffer
use agpu::prelude::*;
fn main() -> Result<(), agpu::BoxError> {
tracing_subscriber::fmt::init();
let program = agpu::GpuProgram::builder("Triangle").build()?;
let gpu = program.gpu.clone();
let example_pipeline = program
.gpu
... | Rust | 0 |
fR { bits }
}
#[doc = "Bit 11 - Time-stamp flag"]
#[inline(always)]
pub fn tsf(&self) -> TsfR {
let bits = {
const MASK: u8 = 1;
const OFFSET: u8 = 11;
((self.bits >> OFFSET) & MASK as u32) as u8
};
TsfR { bits }
}
#[doc = "Bit 12 - Tim... | Rust | 0 |
import ray
from ray import tune
import os
from trainer_sac import _train
from skrl.agents.torch.sac import SAC_DEFAULT_CONFIG
from skrl.resources.preprocessors.torch import RunningStandardScaler
def trainer(tuner):
id = tuner['id']
grad_clip = tuner['grad_clip']
tau = tuner['tau']
alpha = tuner['alpha'... | Python | 1 |
'VolumeMute'), width=8, height=1, state='disabled')
Tooltip(mute_button, image_path=os.path.join(base_image_path, "fingers-mute.jpg"))
volume_up_button = tk.Button(volume_frame, text="🔊 Vol+", command=lambda: self.send_command('VolumeUp'), width=8, height=1, state='disabled')
Tooltip(volume_up... | Python | 1 |
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
Function:
The replay funtion entry
Copyright Information:
Huawei Technologies Co., Ltd. All Rights Reserved © 2020
"""
import os
import stat
REPLAY_BATCH = 'batch'
REPLAY_ITERATE = 'iterate'
CFG_IMPL_DIR = 'impl_dir'
CFG_OUT_DIR = 'out_dir'
AUTO_GEN_DIR = 'auto_gen_d... | Python | 1 |
Bits 3:5 - Indicate the type of cache implemented at level 2."]
#[inline(always)]
pub fn cl2(&self) -> CL2_R {
CL2_R::new(((self.bits >> 3) & 0x07) as u8)
}
#[doc = "Bits 6:8 - Indicate the type of cache implemented at level 3."]
#[inline(always)]
pub fn cl3(&self) -> CL3_R {
CL3... | Rust | 0 |
and") && ffi::egl::GetPlatformDisplayEXT::is_loaded()
{
trace!(log, "EGL Display Initialization via EGL_EXT_platform_wayland");
ffi::egl::GetPlatformDisplayEXT(ffi::egl::PLATFORM_WAYLAND_EXT, display as *mut _, ptr::null())
} else {
trace!(log, "Default EGL Display In... | Rust | 0 |
import shutil
from unittest.mock import patch
from vunnel import result
from vunnel.providers.alma import Config, Provider
from vunnel.providers.alma.parser import Parser
@patch("vunnel.providers.alma.git.GitWrapper.clone_repo")
@patch("vunnel.providers.alma.git.GitWrapper.delete_repo")
def test_provider_schema(mock... | Python | 1 |
-> __jni_bindgen::std::result::Result<__jni_bindgen::std::option::Option<__jni_bindgen::Local<'env, crate::java::nio::file::FileSystem>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// class.path == "java/nio/file/FileSystems", java.flags == PUBLIC | STATIC, .name == "newFileSystem", .descr... | Rust | 0 |
multi(2, 4);
}
#[test]
fn test_future_both_8_thread_multi_4tx() {
_future_both_thread_multi(8, 4);
}
fn _future_both_thread_multi(real_threads: usize, tx_count: usize) {
let rx_count = 1usize;
let mut rt = tokio::runtime::Builder::new().threaded_scheduler().enable_all().cor... | Rust | 0 |
status=HandlerStatus.RETURN,
message_out=response_proto(status=out_status),
message_type=Message.CLIENT_BATCH_SUBMIT_RESPONSE)
for batch in message_content.batches:
if batch.trace:
LOGGER.debug("TRACE %s: %s", batch.header_signature,
... | Python | 1 |
"""Zhong: no subscription exp for SEMO"""
import struct
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
class Cracker:
def __init__(self):
secrets = {
"aes_key": "24f6754364b954cfb33671c831da582edb88b942442357d9c95ae94e9f8fe20d",
"cbc_iv": "c6d30c124fbe47e86a02f... | Python | 1 |
import pandas as pd
import matplotlib.pyplot as plt
def load_data(file_name):
if file_name.endswith(".csv"):
return pd.read_csv(file_name)
elif file_name.endswith(".xlsx"):
return pd.read_excel(file_name)
else:
raise ValueError("Only CSV and Excel files are supported.")
def plot_nu... | Python | 1 |
# Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/client/gui/Scaleform/genConsts/STORAGE_CONSTANTS.py
class STORAGE_CONSTANTS(object):
IN_HANGAR = 'in_hangar'
STORAGE = 'storage'
FOR_SELL = 'for_sell'
PERSONAL_RESERVES = 'personal_reserves'
CUSTOMIZATION = 'customiza... | Python | 1 |
# -*- coding: utf-8 -*-
'''Based on the problem "Lateral-09: Strata with different parameters." of the
publication: "300 Solved Problems Soil / Rock Mechanics and Foundations
Engineering" Copyright by L. Prieto-Portar, October, 2009.
https://bouassidageotechnics.wordpress.com/wp-content/uploads/2016/04/300_solv... | Python | 1 |
# -*- coding: utf-8 -*-
from odoo import api, fields, models, exceptions, _
class ResCurrency(models.Model):
_inherit = 'res.currency'
def rmb_upper(self, value):
"""
人民币大写
传入浮点类型的值返回 unicode 字符串
:param 传入阿拉伯数字
:return 返回值是对应阿拉伯数字的绝对值的中文数字
"""
if self.n... | Python | 1 |
counts as well
for _ in 1..num {
std::thread::spawn(|| {
println!("1");
loop {
std::thread::park();
}
});
}
println!("1");
loop {
std::thread::park();
}
}
fn spawn_na... | Rust | 0 |
/* latin-ext */
@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
src: local('Lato Regular'), local('Lato-Regular'), url(https://fonts.gstatic.com/s/lato/v16/S6uyw4BMUTPHjxAwXiWtFCfQ7A.woff2) format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-2... | Rust | 0 |
# Generated by Django 3.2.10 on 2021-12-26 06:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("base", "0005_formfield_clean_name"),
]
operations = [
migrations.AlterField(
model_name="homepage",
name="featured_... | Python | 1 |
(
hex_script!("6363636363686868686800").asm(),
"OP_IF OP_IF OP_IF OP_IF OP_IF OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_ENDIF OP_0"
);
assert_eq!(hex_script!("2102715e91d37d239dea832f1460e91e368115d8ca6cc23a7da966795abad9e3b699ac").asm(),
"OP_PUSHBYTES_33 02715e91... | Rust | 0 |
_fields(), 0);
#[cfg(not(feature = "llvm3-6"))]
{
assert!(opaque_struct.get_field_type_at_index(0).is_none());
assert!(opaque_struct.get_field_type_at_index(1).is_none());
assert!(opaque_struct.get_field_type_at_index(2).is_none());
assert!(opaque_struct.get_field_type_at_index(... | Rust | 0 |
[u8]>);
#[allow(non_snake_case)]
impl WinBuffer {
fn Buffer(&mut self) -> windows::core::Result<*mut u8> {
Ok(self.0.as_mut_ptr())
}
fn Capacity(&self) -> Result<u32> {
Ok(self.0.len() as u32)
}
fn Length(&self) -> Result<u32> {
Ok(self.0.len() as u32)
}
fn SetLength(... | Rust | 0 |
eMap {
fn set_opt<H>(&self, easy: &mut curl::easy::Easy2<H>) -> Result<(), curl::Error> {
let mut list = curl::easy::List::new();
for entry in self.0.iter() {
list.append(entry)?;
}
easy.connect_to(list)
}
}
<reponame>zhangchunzhong/gluesql<filename>src/executor/exe... | Rust | 0 |
git/ignore"));
}
if let Ok(home) = env::var("APPDATA") {
tries.push(Path::new(&home).join(".gitignore"));
}
if let Ok(home) = env::var("USERPROFILE") {
tries.push(Path::new(&home).join(".gitignore"));
}
if let Ok(home) = env::var("HOME") {
tries.push(Path::new(&home).join(".config/git/ignore"));
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.