text string | label_name string | labels int64 |
|---|---|---|
]
#[cfg(all(target_arch = "x86_64", target_feature = "adx"))]
pub fn mont_mul_asm_adx_with_reduction(a: &[u64; 4], b: &[u64; 4]) -> [u64; 4] {
use core::mem::MaybeUninit;
static ZERO: u64 = 0;
static MODULUS_0: u64 = 0xd0970e5ed6f72cb7;
static MODULUS_1: u64 = 0xa6682093ccc81082;
static MODULUS_2: ... | Rust | 0 |
@auth.requires_login()
def index():
announcements=accessible('announcement')\
(db.announcement.expires_on>=today)\
(db.auth_user.id==db.announcement.owner)\
(~db.announcement.id.belongs(db(db.ignore_announcement.person==auth.user_id)\
._select(db.ignore_anno... | Python | 1 |
import sys
sys.path.append("integrator")
import taichi as ti
import math
import Example
import Camera as Camera
import Scene as Scene
import UtilsFunc as UF
import PT_RGB
class example(Example.example):
def __init__(self, imgSizeX, imgSizeY, sample_count):
ti.init(arch=ti.gpu)
Example.example.__... | Python | 1 |
ubd_xmm_xmm_xmmm128 = 2594,
/// `VPHSUBD ymm1, ymm2, ymm3/m256`
///
/// `VEX.256.66.0F38.WIG 06 /r`
///
/// `AVX2`
///
/// `16/32/64-bit`
VEX_Vphsubd_ymm_ymm_ymmm256 = 2595,
/// `PHSUBSW mm1, mm2/m64`
///
/// `NP 0F 38 07 /r`
///
/// `SSSE3`
///
/// `16/32/64-bit`
Phsubsw_mm_mmm64 = 2596,
/// `PHSUBSW ... | Rust | 0 |
denary",
"quattuordenary",
"quindenary",
"sexdenary",
"septendenary",
"octodenary",
... | Python | 1 |
print_header("详细技术分析")
print_section("1. T-Table优化深度分析")
print("原理:将SM4的T变换T(X) = L(τ(X))分解为:")
print("T(X) = T₀[x₀] ⊕ T₁[x₁] ⊕ T₂[x₂] ⊕ T₃[x₃]")
print("其中 X = (x₀, x₁, x₂, x₃)")
print("\n预计算表结构:")
print("• T₀[i] = L(S[i]) (处理最高字节)")
print("• T₁[i] = L(S[i]) <<< 8 ... | Python | 1 |
capacity(tile_edges.len());
for (i, edge1) in tile_edges.iter().enumerate() {
for edge2 in tile_edges.iter().skip(i + 1) {
match (edge1.location, edge2.location) {
(EdgeLocation::Top, EdgeLocation::Bottom) => {
if edge1.edge == edge2.edge {
... | Rust | 0 |
2::TokenStream;
use quote::quote;
use syn::{parse2, parse_quote};
#[test]
fn test() {
use syn::{Expr, LitStr, Type};
#[derive(Attribute)]
#[attribute(ident = "test")]
struct Test {
// a: u8,
b: LitStr,
c: String,
oc: Option<String>,
od: Option<Type>,
d: T... | Rust | 0 |
from __future__ import annotations
import torch
from collections.abc import Sequence
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from omni.isaac.lab.envs import ManagerBasedRLEnv
from omni.isaac.lab.managers import SceneEntityCfg
def modify_event_parameter(
env: ManagerBasedRLEnv,
env_id... | Python | 1 |
e_info)
.depth_stencil_state(&depth_state_info)
.color_blend_state(&color_blend_state)
.dynamic_state(&dynamic_state_info)
.layout(pipeline_layout)
.render_pass(desc.render_pass.raw);
let pipeline = device
.raw
.create_graphics... | Rust | 0 |
#! /usr/bin/python3.9
"""
Example - Part Hole 001
Description:
Find all the Hole(s) in the active CATPart document and report it's origin
and direction (relative to origin).
Requirements:
- CATIA running.
- A CATPart open that contains a PartBody with Hole(s).
"""
#####... | Python | 1 |
_reg_bypass_count_63(&self) -> bool {
*self == REG_BYPASS_COUNT_A::REG_BYPASS_COUNT_63
}
}
#[doc = "Write proxy for field `REG_BYPASS_COUNT`"]
pub struct REG_BYPASS_COUNT_W<'a> {
w: &'a mut W,
}
impl<'a> REG_BYPASS_COUNT_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub... | Rust | 0 |
false
}
pub fn flatten<T>(opt: Option<Option<T>>) -> Option<T> {
match opt {
Option::Some(maybe) => return maybe,
_ => {}
}
return Option::None;
}
<filename>crypto/src/signature.rs
// Copyright 2020 ChainSafe Systems
// SPDX-License-Identifier: Apache-2.0
//! Definitions of some signature types
//! T... | Rust | 0 |
es"])
return data, is_batch
def inference_model(model: BaseSegmentor, img: ImageType) -> Union[SegDataSample, SampleList]:
"""Inference image(s) with the segmentor.
Args:
model (nn.Module): The loaded segmentor.
imgs (str/ndarray or list[str/ndarray]): Either image files or loaded
... | Python | 1 |
from benchmark_utils import calc_num_bytes
import pytest
import arkouda as ak
OPS = ("sum", "prod", "min", "max", "argmin", "argmax")
TYPES = ("int64", "float64")
@pytest.mark.benchmark(group="Reduce")
@pytest.mark.parametrize("op", OPS)
@pytest.mark.parametrize("dtype", TYPES)
def bench_reduce(benchmark, op, dtyp... | Python | 1 |
pub cfg_vb2: VBusFSR,
#[packed_field(bits = "3:2", ty = "enum")]
pub cfg_vb3: VBusFSR,
#[packed_field(bits = "1:0", ty = "enum")]
pub cfg_vb4: VBusFSR,
}
#[derive(PackedStruct, Debug, PartialEq, Register)]
#[packed_struct(size_bytes = "1", bit_numbering = "lsb0")]
/// This register tracks the stat... | Rust | 0 |
// }
if let Some(coming) = coming {
let text = self.state.get_or_insert_with(|| MessageState::new(1, Default::default()));
text.pages.push(MessagePage {
lines: vec![format!("{} sent out {}!", user, coming)],
wait: Some(0.5),
color:... | Rust | 0 |
end: ServerEnd<NodeMarker>,
) {
// We are reusing the service connection implementation, but to get it to work, we must
// strip the OPEN_FLAG_NO_REMOTE flag (since that isn't permitted for services). Our
// implementation also only allows access if both OPEN_RIGHT_READABLE and
// O... | Rust | 0 |
def funcion_modulo3():
return "Funcion de modulo3 en carpeta4"
| Python | 1 |
#[fasync::run_singlethreaded(test)]
async fn clone_no_describe_no_flags_same_rights() {
let (dir, mut stream) =
fidl::endpoints::create_proxy_and_stream::<DirectoryMarker>().unwrap();
clone_no_describe(&dir, None).unwrap();
assert_matches!(
stream.next().await,
... | Rust | 0 |
mbda('lambda_049E')
def lambda_049E():
ChrSetDirection(0x0008, 270, 400)
ExitThread()
DispatchAsync(0x0008, 0x0001, lambda_049E)
Sleep(400)
ChrTalk(
0x0008,
(
'#0620270201V#703F#2P格兰赛尔配备有\n',
'一个中队的兵力。',
TxtCtl.Enter,
Tx... | Python | 1 |
ver mode
let mode: server::ServerMode;
if let Some(sub_matches) = matches.subcommand_matches("plain") {
let host = sub_matches.value_of("dsthost").unwrap();
let port = sub_matches.value_of("dstport").unwrap();
let hostname = sub_matches.value_of("dsthostname").unwrap();
let dst: ... | Rust | 0 |
nthesisError>
// {
// let domain_size = 5;
// let domain = EvaluationDomain::<Fr>::new(domain_size).unwrap();
// let rng = &mut test_rng();
// let evals:Vec<Fr> = (0..domain_size).map(|_| rng.gen()).collect::<Vec<_>>();
// // //let evals = vec![Fr::rand(&mut rng); domain_size];
// let coeffs = d... | Rust | 0 |
! This is not meant to be in the standard library, it does nothing with
//! green/native threading. This is just a bare-bones enough solution for
//! librustdoc, it is not production quality at all.
#![allow(non_camel_case_types)]
#![allow(nonstandard_style)]
use std::io;
use std::path::Path;
cfg_if! {
if #[cfg(... | Rust | 0 |
te::workflow::{BlueprintBlock, Command, CommandMessage, CommandStatus, SensorStatus};
pub(crate) struct Scale {
id: i32,
sck_pin: i32,
d_out_pin: i32,
last_weight: Arc<Mutex<f32>>,
gui_sender: Arc<Mutex<Sender<SensorStatus>>>,
}
impl Scale {
pub(crate) fn new(block: BlueprintBlock, gui_sender:... | Rust | 0 |
from django_filters import FilterSet, CharFilter, IsoDateTimeFromToRangeFilter, BaseInFilter
from apps.monitor.models.monitor_policy import MonitorAlert
class CommaSeparatedCharInFilter(BaseInFilter, CharFilter):
def filter(self, qs, value):
if value:
if isinstance(value, list):
... | Python | 1 |
eader, Read};
use crossterm::event::KeyCode;
use log::error;
use serde::Deserialize;
use tui::style::{Color, Modifier};
pub fn get_color(color: &str) -> Color {
if let Some(color) = str_to_color(color) {
color
} else {
error!("Did not recognize the color '{}'", color);
Color::White
... | Rust | 0 |
sts::SOCKS5_CMD_TCP_BIND => Some(Socks5Command::TCPBind),
consts::SOCKS5_CMD_UDP_ASSOCIATE => Some(Socks5Command::UDPAssociate),
_ => None,
}
}
}
#[derive(Debug, PartialEq)]
pub enum AuthenticationMethod {
None,
Password { username: String, password: String },
}
... | Rust | 0 |
pub name: String,
pub description: String,
}
impl Realm {
pub fn id(&self) -> Uuid {
self.id
}
pub fn new(
id: Uuid,
name: String,
description: String,
enabled: bool,
created_at: DateTime<Utc>,
updated_at: DateTime<Utc>,
) -> Self {
... | Rust | 0 |
_torch(MSCFramework.TVM, tools, get_model_info(MSCFramework.TVM), training=False)
@pytest.mark.parametrize("tool_type", [ToolType.PRUNER, ToolType.QUANTIZER])
def test_tvm_distill(tool_type):
"""Test tools for tvm with distiller"""
tools = get_tools(tool_type, use_distill=True)
_test_from_torch(MSCFramew... | Python | 1 |
();
async fn nvml() -> StdResult<Arc<Mutex<NVML>>, NvmlError> {
NVML::init().map(|nvml| Arc::new(Mutex::new(nvml)))
}
match INSTANCE.get_or_init(nvml).await {
Ok(v) => Ok(Arc::clone(v)),
Err(e) => Err(Error::nvml_init(e)),
}
}
async fn nvml_bus_id(id: u64) -> Result<String> {
... | Rust | 0 |
o. */
Aninhamento::Esquerda => {
/* Removendo no fim, trabalhando no texto
* da linha, e inserindo novamente como
* linha um, chega ao mesmo texto antigo,
* porém reprocessado. O processo inverso
* também pode ser feito, mas vamos deste
... | Rust | 0 |
googleapis.com/auth/cloud-platform",
Scope::DevstorageReadWrite => "https://www.googleapis.com/auth/devstorage.read_write",
Scope::Bigquery => "https://www.googleapis.com/auth/bigquery",
}
}
}
impl Default for Scope {
fn default() -> Scope {
Scope::Readonly
}
}
//... | Rust | 0 |
# make sure the thing is launched.
# so how does other languages goes like? especially for some bash syntax.
# bash syntax could trigger shutdown.:
from nparr_redis import rget, rset
# it is about editing! how do you change code? how do you modify the code?
# find the possible change.
rf="""def simpleChange(a):
ret... | Python | 1 |
ile, filename, lang)
# 将处理完成的文件名加到列表,下次跳过不处理
if filename not in processed_list_content:
print(f"Added into processed_list: {filename}")
with open(processed_list, "a", encoding="utf-8") as f:
f.write("\n")
f.write(filename)
... | Python | 1 |
};
use crate::database::DbContext;
use rusqlite::ToSql;
pub struct Timeboards<'a> {
db: &'a mut DbContext,
}
impl<'a> Timeboards<'a> {
#[inline]
pub fn new(db: &'a mut DbContext) -> Self {
Self { db }
}
#[inline]
pub fn run_migrations(&self) -> Result<(), Error> {
self.db.conn... | Rust | 0 |
from yacs.config import CfgNode as CN
_C = CN()
_C.dataset = "" # Dataset name
_C.root = "" # Directory where datasets are stored
_C.imb_factor = None # for long-tailed cifar dataset
_C.backbone = ""
_C.resolution = 224
_C.output_dir = None # Directory to save the output files (like log.txt and model weights)
_... | Python | 1 |
# Copyright (c) 2016-2017 Hewlett Packard Enterprise Development LP
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
imp... | Python | 1 |
from tkinter import *
from PIL import Image, ImageTk
import Trainers
import ExpiredTrainers
import Supplements
def display_home():
home_root = Tk()
home_root.title("Home")
home_root.geometry("1000x700+245+50")
home_root["bg"] = "white"
home_root.resizable(FALSE, FALSE)
Font = ("Calibri", "15", ... | Python | 1 |
"""
FocusManager のテスト
t-wada式TDDによるテストファースト開発
"""
import pytest
from unittest.mock import Mock
from src.ui.window_system import FocusManager, Window, WindowState
from src.ui.window_system.focus_manager import FocusChange
class MockWindow(Window):
"""テスト用のモックウィンドウ"""
def __init__(self, window_id: str, p... | Python | 1 |
<(), Error> {
assert!(crate::lazy_round_trip_check::<CsvFile, _>(&cells(), true)?);
assert!(crate::lazy_round_trip_check::<TsvFile, _>(&cells(), true)?);
Ok(())
}
#[test]
fn test_clone() {
let t = TsvFile::from("test");
let _ = t;
}
#[test]
fn test_lazy_... | Rust | 0 |
_valid_trust_domain_char(c: char) -> bool {
matches!(c, 'a'..='z' | '0'..='9' | '-' | '.' | '_')
}
#[cfg(test)]
mod spiffe_id_tests {
use std::str::FromStr;
use super::*;
pub(crate) const TD_CHARS: &[char] = &[
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q... | Rust | 0 |
art = (i, j);
}
if s[i][j] == 'G' {
goal = (i, j);
}
}
}
let dx = vec![1, 0, -1, 0];
let dy = vec![0, 1, 0, -1];
let mut dist = vec![vec![INF; m]; n];
let mut q: VecDeque<(usize, usize)> = VecDeque::new();
q.push_back((start.0, start.1)... | Rust | 0 |
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(alwa... | Rust | 0 |
as_further_move(pos, piece, is_second) {
dest.push(Move::NoPromotion(pos, pos2));
}
if !piece2.is_empty() {
break;
}
}
}
pub fn enumerate_check(&self) -> Vec<Move> {
// TODO: more efficient algorithm
let mut ret = vec![]... | Rust | 0 |
8,
'D+': 9, 'D': 10, 'D-': 11, 'F': 12, 'Error': 13}
filtered_df['grade_order'] = filtered_df['Grade'].map(grade_order)
filtered_df = filtered_df.sort_values('grade_order')
filtered_df = filtered_df.drop(columns=['grade_order'])
elif sort_selection... | Python | 1 |
0
@54
0;JMP
(keyboard.keypressed)
@24576
D=A
@SP
AM=M+1
A=A-1
M=D
@1
D=A
@R13
M=D
@memory.peek
D=A
@R14
M=D
@RET_ADDRESS_CALL106
D=A
@95
0;JMP
(RET_ADDRESS_CALL106)
@54
0;JMP
(keyboard.readchar)
@SP
A=M
M=0
AD=A+1
M=0
@SP
M=D+1
@SP
M=M+1
A=M-1
M=0
@1
D=A
@R13
M=D
@output.printchar
D=A
@R14
M=D
@RET_ADDRESS_CALL107
D=A
... | Rust | 0 |
Ok(if gnss_baro_diff > 1 {(gnss_baro_diff - 1)* 25} else { 0 })}"
)]
pub gnss_baro_diff: u16,
}
impl AirborneVelocity {
/// Return effective (`heading`, `ground_speed`, `vertical_rate`) for groundspeed
#[must_use]
pub fn calculate(&self) -> Option<(f32, f64, i16)> {
if let AirborneVelocityS... | Rust | 0 |
const u8 as *const libc::c_char, fontname);
XftFontClose((*drw).dpy, xfont);
return 0 as *mut Fnt
}
} else if !fontpattern.is_null() {
xfont = XftFontOpenPattern((*drw).dpy, fontpattern);
if xfont.is_null() {
fprintf(stderr,
b"error, ca... | Rust | 0 |
# test iso-8859-1 encoding
# -*- encoding: iso-8859-1 -*-
test = ("Les hommes ont oubli cette vrit, "
"dit le renard. Mais tu ne dois pas l'oublier. Tu deviens "
"responsable pour toujours de ce que tu as apprivois.")
| Python | 1 |
def icn():
print('''
\033[0;32m██████╗ ███████╗ ██████╗ █████╗ ███╗ ██╗ 🌸
██╔══██╗██╔════╝██╔════╝██╔══██╗████╗ ██║ 🌸
██████╔╝███████╗██║ ███████║██╔██╗ ██║ 🌸
██╔═══╝ ╚════██║██║ ██╔══██║██║╚██╗██║ 🌸
██║ ███████║╚██████╗██║ ██║██║ ╚████║ 🌸
╚═╝ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚═╝ ╚═══╝ 🌸\033... | Python | 1 |
!("Mode: {:?}", mode));
let result_val = result.value()?.into_affine();
assert_eq!(
result_val, native_result,
"gadget & native values are diff. after scalar mul {:?}",
scalar,
);
assert!(cs.is_sa... | Rust | 0 |
tials['SecretAccessKey'] = 'second_secret_key'
credentials['Token'] = 'second_token'
self.get_instance_metadata.return_value = instance_config
# Now upon attribute access, the credentials should be updated.
self.assertEqual(p.access_key, 'second_access_key')
self.assertEqual(p.s... | Python | 1 |
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | Python | 1 |
# simple array program
arr = [1, 2, 3, 4, 5]
print(arr)
print(arr[0])
print(arr[1])
print(arr[2])
print(arr[3])
print(arr[4]) | Python | 1 |
am("dxc_id", int, "地下城图号", "刷哪个地下城。\n目前支持:1,3,4,5,6,7,8"),
TaskParam("mode", int, "模式", "mode 0:不打Boss,用队伍1只打小关\n"
"mode 1:打Boss,用队伍1打小关,用队伍[1,2,3,4,5...]打Boss\n"
"mode 2:打Boss,用队伍1打小关,用队伍[2,3,4,5...]打Boss\n"
... | Python | 1 |
= arguments.descriptor)
# Save Figure Matcher
save_figures.saveMatcher(output = output,
matcher = arguments.matcher,
descriptor = arguments.descriptor)
# Save keypoints and descriptors into a file
# from input image
outputs.saveKeypointsAndDescriptors(keypoints = globals.keypo... | Python | 1 |
[serde(skip_serializing_if = "Option::is_none")]
pub server: Option<Server>,
}
use crate::error::*;
use std::{
fs,
path::{Path, PathBuf},
};
/// Allows to extract files from generated APK to use that to generate `.aab`
pub fn extract_archive(archive_path: &Path, output_dir: &Path) -> Result<PathBuf> {
... | Rust | 0 |
# Copyright (C) 2023-present The Project Contributors
#
# 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 o... | Python | 1 |
<Box<dyn Any + Send + Sync>> {
std::mem::replace(&mut self.user_data, data)
}
/// Replace by `None` the user-defined data attached to this object and returns the old value.
#[inline]
pub fn take_user_data(&mut self) -> Option<Box<dyn Any + Send + Sync>> {
self.us... | Rust | 0 |
"""Define Scenario that will run a given program and then revert."""
from typing import List
from ethereum_test_tools.vm.opcode import Macro, Opcode
from ethereum_test_tools.vm.opcode import Macros as Om
from ethereum_test_tools.vm.opcode import Opcodes as Op
from ..common import Scenario, ScenarioEnvironment, Scena... | Python | 1 |
# Checkpoint Model
if (cfg.checkpoint.every > 0 and policy_step - last_checkpoint >= cfg.checkpoint.every) or (
iter_num == total_iters and cfg.checkpoint.save_last
):
last_checkpoint = policy_step
state = {
"world_model": world_model.state_dict()... | Python | 1 |
let mut main_fn: clast::Func = clast::new_fn(
fn_ident,
Some(None),
signature!(()),
Some(None),
true
);
let pfn_ident: &str = &"print";
let pfn_arg_str: &str = &"Hello Clash World!";
let pfn_arg: Option<clast::Arguments>... | Rust | 0 |
"""This hook should collect all binary files and any hidden modules that numpy
needs.
Our (some-what inadequate) docs for writing PyInstaller hooks are kept here:
https://pyinstaller.readthedocs.io/en/stable/hooks.html
"""
from PyInstaller.compat import is_conda, is_pure_conda
from PyInstaller.utils.hooks import coll... | Python | 1 |
= False
include: Annotated[
List[str],
Arg(
short=True,
long=True,
help=(
"Filter the set of input files by including only files matching the `--include`. "
"Note this also accepts glob specifiers like 'folder/*'. "
),
... | Python | 1 |
# Copyright (C) 2014 Jonathon Ogden < jeog.dev@gmail.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.... | Python | 1 |
::{Read, Write};
use regex::bytes::{Regex, Captures};
use std::env;
use std::collections::HashMap;
use std::iter::FromIterator;
lazy_static! {
static ref RE: Regex = Regex::new(r"\$\{(\w+)\}").unwrap();
}
fn template<'t>(input: &'t [u8]) -> (::std::borrow::Cow<'t, [u8]>, bool) {
lazy_static! {
static ... | Rust | 0 |
from user_schedule import User
import webbrowser
import telebot
import time
user = User()
token = 'Enter here your token.'
bot = telebot.TeleBot(token)
def show_all(message):
bot.send_message(message.chat.id, user, parse_mode='html')
def show_plans(message):
bot.send_message(message.chat.id, user.plans_str()... | Python | 1 |
ols.linalg.norm(vector)
eigenvalue = None
for _ in range(max_iters):
dot_products = tools.matmul(diffs, vector)
weighted_sum = tools.sum(diffs * dot_products[:, None], axis=0)
next_vector = weighted_sum / tools.linalg.norm(weighted_sum)
... | Python | 1 |
is_template"]
return preprocess_params, {}, {}
def preprocess(self, image, candidate_labels=None, hypothesis_template="This is a photo of {}.", timeout=None):
image = load_image(image, timeout=timeout)
inputs = self.image_processor(images=[image], return_tensors=self.framework)
inp... | Python | 1 |
----------
class_labels : array-like, shape = [n_samples]
Predicted class labels.
"""
self._check_arrays(X)
if not self._is_fitted:
raise AttributeError('Model is not fitted, yet.')
return self._predict(X).flatten()
def _predict(self, X):
... | Python | 1 |
vdso_addr: *mut libc::c_ulong,
hres_resolution: *mut libc::c_long,
coarse_resolution: *mut libc::c_long,
release: *mut libc::c_char,
release_len: libc::c_int,
tss: *mut timespec,
... | Rust | 0 |
old_file = True
cluster.inputs.out_max_file = True
cluster.inputs.out_mean_file = True
cluster.inputs.out_pval_file = True
cluster.inputs.out_size_file = True
wf.connect(apply_mask, 'out_file', cluster, 'in_file')
wf.connect(cluster,'index_file',outputspec,'index_file')
wf.connect... | Python | 1 |
)
height = gr.Slider(
label="高度",
minimum=512,
maximum=2048,
step=64,
value=720
)
... | Python | 1 |
s(&self) -> (u32, u32) {
self.deref().get_framebuffer_dimensions()
}
fn is_current(&self) -> bool {
self.deref().is_current()
}
unsafe fn make_current(&self) {
self.deref().make_current();
}
}
/// Trait for types that provide a safe access for glium functions.
pub trait Fa... | Rust | 0 |
import requests
### URL
api_url = "https://jsonplaceholder.typicode.com/todos/1"
### GET (URL)
response = requests.get(api_url)
### De gegevens in JSON formaat zetten. (en printen om te bekijken)
#print(response.json())
### De return code of status code van respons (200 == geslaagd)
#print(response.status_code)
#... | Python | 1 |
"k" => (1024, 1),
"MiB" | "miB" | "M" | "m" => (1024, 2),
"GiB" | "giB" | "G" | "g" => (1024, 3),
"TiB" | "tiB" | "T" | "t" => (1024, 4),
"PiB" | "piB" | "P" | "p" => (1024, 5),
"EiB" | "eiB" | "E" | "e" => (1024, 6),
"ZiB" | "ziB" | "Z" | "z" => (1024, 7),
"YiB"... | Rust | 0 |
scalar code path.
pub fn spd_to_xyz_scalar(spd: &SPD) -> XYZf32 {
let mut xyz = XYZf32::from_scalar(0.0);
let mut c = XYZf32::from_scalar(0.0);
unsafe {
for i in 0..SPD_SAMPLES {
let x = XYZf32::new(
spd.values.get_unchecked(i) * W_X.values.get_unchecked(i),
... | Rust | 0 |
d it over the network. The original u16 value can be restored using
* u8_array_to_u16, u8_slice_to_u16, u8s_to_u16 or u8_tuple_to_u16.
*/
pub fn u16_to_u8_array(int16: u16) -> [u8; 2] {
[u16_to_u8_1(int16), u16_to_u8_2(int16)]
}
/**
* Convert 4 u8 values to an i32 value. Every distinct tuple of u8 values will b... | Rust | 0 |
self.0
}
}
impl UsagePercentage
{
/// Represents 0%
pub const Zero: Self = UsagePercentage(0.0);
/// Represents 1%
pub const One: Self = UsagePercentage(1.0);
/// Represents 0.1%
pub const OnePerMille: Self = UsagePercentage(0.1);
/// Represents 0.01%
pub const OneBasisPoint: Self = UsagePercentage(0.01... | Rust | 0 |
# -*- coding: utf-8 -*-
# Copyright 2012 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 require... | Python | 1 |
eg.cpu_reg in last_call_cpu_live_in:
last_use_pos = last_call_pos
#elif ins.opcode is o.NOP1:
# # assert False, f"found nop1 {ins.operands}"
# last_use_pos = n - 1
out.append(LiveRange(pos, last_use_pos, reg, 0... | Python | 1 |
# -*- coding: utf-8 -*-
"""Handle dashboard related signals.
Copyright (C) 2021 Gitcoin Core
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published
by the Free Software Foundation, either version 3 of the License, or
(at your optio... | Python | 1 |
"""
Tests for np.foo applied to Series, not necessarily ufuncs.
"""
import numpy as np
import pytest
from pandas import Series
import pandas._testing as tm
class TestPtp:
def test_ptp(self):
# GH#21614
N = 1000
arr = np.random.default_rng(2).standard_normal(N)
ser = Series(arr)
... | Python | 1 |
NodeType::HNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::HNode,
NodeType::MNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::MNode,
NodeType::PNode(_) => fidl_fuchsia_net_dhcp::NodeTypes::PNode,
};
fidl_fuchsia_net_dhcp::Option_::NetbiosOverTcpipNodeType(fidl_node_type)
}
}
/// N... | Rust | 0 |
=> write!(f, "{{"),
CloseBrace => write!(f, "}}"),
OpenBracket => write!(f, "["),
CloseBracket => write!(f, "]"),
OpenParen => write!(f, "("),
CloseParen => write!(f, ")"),
Semicolon => write!(f, ";"),
Comma => write!(f, ","),
... | Rust | 0 |
import os
from langchain.document_loaders.csv_loader import CSVLoader
from langchain.embeddings.openai import OpenAIEmbeddings
import json
from .common.utils import OPENAI_API_KEY
def csv_embed():
file_path = os.path.dirname(os.path.abspath(__file__))
loader = CSVLoader(file_path=f"{file_path}/phone.csv", e... | Python | 1 |
#!/usr/bin/env python
# coding: utf-8
import pandas as pd
import argparse
parser = argparse.ArgumentParser(description='Blending best single models')
parser.add_argument('input', metavar='INPUT',
help='Input folder', default=".")
parser.add_argument('predictions', metavar='PREDS',
... | Python | 1 |
[check]
#[name = "user_in_voice"]
pub async fn user_in_voice_check(
ctx: &Context,
msg: &Message,
_: &mut Args,
_: &CommandOptions,
) -> Result<(), Reason> {
let guild = msg.guild(&ctx.cache).await.unwrap();
match guild.voice_states.get(&msg.author.id) {
None => {
return Err... | Rust | 0 |
(feature = "nosync"))]
use super::Instance;
#[cfg(not(feature = "nosync"))]
const INSTANCE: Instance = Instance {
addr: 0x4000d000,
_marker: ::core::marker::PhantomData,
};
/// Reset values for each field in SPDIFRX
pub const reset: ResetValues = ResetValues {
SPDIFRX_C... | Rust | 0 |
for key in os.environ:
if key.startswith('OPEN_DASH_'):
env_vars.append(key)
for key in env_vars:
del os.environ[key]
def create(config: Config) -> None:
print(f'Preparing dash bundle from {config.source_path}...')
paths = prepare_folders(config)
# Decostruct the prepare_folders_result dic... | Python | 1 |
_eq!(meta, UpdateStatusMeta::Processed(format!("cucu processed")));
}
}
/**
* iter: just borrow ...
* into_iter: move it!
*/
fn iter_borrow() {
let names = vec!("Bob", "Frank", "Ferris");
for name in names.into_iter() {
match name {
"Ferris" => println!("There is a rustacean among u... | Rust | 0 |
_fairness_fpaxos_improv = 0;
let min_mean_decrease = 15;
let ft_metric = FTMetric::F1F2;
// create ranking params
let params = RankingParams::new(
min_mean_fpaxos_improv,
min_mean_epaxos_improv,
min_fairness_fpaxos_improv,
min_mean_decreas... | Rust | 0 |
c3526)
#[cfg(not(test))]
lazy_static! {
/// The selected "safe" `PRIME_MODULUS` for all group operations
pub static ref PRIME_MODULUS: BigUint =
PRIME_1536.clone();
/// The number 2 as a `BigUint` constant (all groups use generator = 2)
pub static ref GENERATOR: BigUint = BigUint::from(2_u32);... | Rust | 0 |
e1: &str, message2: &str, message3: &str);
#[wasm_bindgen(js_namespace = console, js_name = log)]
fn log4(message1: &str, message2: &str, message3: &str, message4: &str);
}
pub struct WASMLayerConfig {
/// Log events will be marked and measured so they appear in performance Timings
pub report_logs_in_t... | Rust | 0 |
Ok(entries)
}
/// Take a type and create an immutable shared reference to that type.
pub(crate) fn shared_ref(ty: syn::Type, mutable: bool) -> syn::Type {
syn::TypeReference {
and_token: Default::default(),
lifetime: None,
mutability: if mutable {
Some(syn::token::Mut::def... | Rust | 0 |
import os
import json
from tqdm import tqdm
from utils import get_stance
dataset_names = {
'TASK1': ['LLM-mis', 'Pheme'],
'TASK2': ['MFC', 'SemEval-23F'],
'TASK3': ['Generated', 'SemEval-20', 'SemEval-23P']
}
def get_one_stance(data):
father = data['father']
res = data['res']
stances = []
... | Python | 1 |
{
type Output = Wrapping<UInt<LIMBS>>;
fn rem(self, rhs: &NonZero<UInt<LIMBS>>) -> Self::Output {
self % *rhs
}
}
impl<const LIMBS: usize> RemAssign<NonZero<UInt<LIMBS>>> for Wrapping<UInt<LIMBS>> {
fn rem_assign(&mut self, rhs: NonZero<UInt<LIMBS>>) {
*self %= &rhs;
}
}
impl<cons... | Rust | 0 |
rs
.iter_mut()
.enumerate()
.map(|(i, xpub)| xpub.view().map(move |msg| Message::DefineCosigners(i, msg)))
.collect(),
)
}
}
impl Default for DefineCosigners {
fn default() -> Self {
Self::new()
}
}
impl From<DefineCosigners> ... | Rust | 0 |
from typing import List, Tuple
def rolling_max_original(numbers: List[int]) -> List[int]:
""" From a given list of integers, generate a list of rolling maximum element found until given moment
in the sequence.
>>> rolling_max([1, 2, 3, 2, 3, 4, 2])
[1, 2, 3, 3, 3, 4, 4]
"""
return [max(numbers[... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.