text string | label_name string | labels int64 |
|---|---|---|
import os
import numpy as np
import sys
import glob
from tqdm import tqdm
from core_3dv.camera_operator import camera_pose_inv
from frame_seq_data import FrameSeqData
def read_scannet_seq(scannet_base_dir, seq_name):
"""
Read SCANNET sequences to the frames collection
:param input_seq_dir: directory singl... | Python | 1 |
{
let image: &mut ColorImage = &mut self.image.lock().unwrap();
let image = std::mem::take(image);
ctx.load_texture(&self.debug_name, image)
})
.id()
}
/// Show the image with the given maximum size.
pub fn show_max_size(&self, ui: &m... | Rust | 0 |
token.subtree(&arena, TraversalOrder::Pre);
/// assert_eq!(subtree.next().unwrap().data, 101);
/// assert_eq!(subtree.next().unwrap().data, 102);
/// assert_eq!(subtree.next().unwrap().data, 103);
/// assert_eq!(subtree.next().unwrap().data, 104);
/// assert_eq!(subtree.next().unwrap().data, 110);
... | Rust | 0 |
from PyQt5.QtWidgets import *
import json
with open('buttons.json', 'r', encoding='utf-8') as f:
butons = json.load(f)
txt = butons['txt']
labels = []
app = QApplication([])
window = QWidget()
window.resize(800, 700)
mainline = QVBoxLayout()
for i in txt:
labels.append(QLabel(i))
for i2 in labels:
main... | Python | 1 |
must_use]
pub fn read_filtered_chunks_from_buffered<'m, T>(
read: impl Read + Seek + Send, // FIXME does not always need be Send
new: impl FnOnce(&[Header]) -> Result<T>,
filter: impl Fn(&T, (usize, &Header), (usize, &TileIndices)) -> bool,
pedantic: bool
) -> Result<(MetaData, T, usize, impl FnMut(&'m ... | Rust | 0 |
mat.cols (),
f64::typ (),
Scalar::default ())?;
for y in 0..mat.rows() {
let out_row = out.at_row_mut::<f64>(y)?;
let mat_row = mat.at_row::<u8>(y)?;... | Rust | 0 |
ation(n: i32, k: i32) -> String {
let (mut nums, mut factorials, n, mut k) = (vec!['1'], vec![1], n as usize, k as usize);
for i in 1..n {
factorials.push(factorials[i - 1] * i);
nums.push(std::char::from_digit(i as u32 + 1, 10).unwrap());
}
k -= 1;
let m... | Rust | 0 |
ARN of the business report schedule.</p>
#[serde(rename = "ScheduleArn")]
pub schedule_arn: String,
/// <p>The name identifier of the schedule.</p>
#[serde(rename = "ScheduleName")]
#[serde(skip_serializing_if = "Option::is_none")]
pub schedule_name: Option<String>,
}
#[derive(Default, Debug, ... | Rust | 0 |
##
# Project: GNOME AppFolders Manager
# Description: Manage GNOME Shell applications folders
# Author: Fabio Castelli (Muflone) <muflone@muflone.com>
# Copyright: 2016-2022 Fabio Castelli
# License: GPL-3+
# This program is free software: you can redistribute it and/or modify
# it under the terms of t... | Python | 1 |
from config import api_id, api_hash, phone, nthlink_dialog_id
from datetime import datetime, timedelta
from telethon import TelegramClient
import asyncio
import pytz
timezone_tw = pytz.timezone('Asia/Taipei')
async def main():
# 建立客戶端並連接
client = TelegramClient('customer_service', api_id, api_hash)
await... | Python | 1 |
from(v1::InvestorZKProofData::decode(&mut input)?))
})?;
lookup.custom_encode(
"OffChainSignature",
TypeId::of::<MultiSignature>(),
|value, data| {
data.encode(value.cast::<MultiSignature>());
Ok(())
},
)?;
lookup.custom_encode(
"H512",
TypeId::of::<MultiSignature>(),
|va... | Rust | 0 |
nswer_probs, qid_has_answer, no_answer_thresh):
new_scores = {}
for qid, s in scores.items():
pred_no_answer = no_answer_probs[qid] > no_answer_thresh
new_scores[qid] = float(not qid_has_answer[qid]) if pred_no_answer else s
return new_scores
def plot_na_prob_histogram(no_answer_probs, qid... | Python | 1 |
def salutation(nom , message = 'Bonjour'):
print(f"{message}, Mr {nom} ")
salutation('walid') | Python | 1 |
PC: ::Parser<'src, Error=PL::Error>,
PR: ::Parser<'src, Error=PL::Error>,
{
Delimited {
parser_l: parser_l,
parser_c: parser_c,
parser_r: parser_r,
}
}
#[derive( Debug, Clone )]
pub struct Delimited<PL, PC, PR> {
parser_l: PL,
parser_c: PC,
parser_r: PR,
}
impl<'src, P... | Rust | 0 |
cell = ListenableCell::new(0);
let s = cell.as_source();
let mut sink = Sink::new();
s.listen(sink.listener());
assert_eq!(None, sink.next());
cell.set(1);
assert_eq!(1, *s.get());
assert_eq!(Some(()), sink.next());
}
#[test]
fn listenable_source_c... | Rust | 0 |
let mut headers = HeaderMap::new();
headers.insert(
header::AUTHORIZATION,
HeaderValue::from_static(CORRECT_AUTH),
);
assert!(VerifyAuthorization::validate(&headers, VALID_PASSWORD).is_ok());
}
#[test]
fn middleware_with_invalid_password() {
let mut ... | Rust | 0 |
::*;
use crate::curve::field::{Field, FieldSqrt, Sign};
use crate::curve::{affine, projective, weierstrass::WeierstrassCurve};
use crate::mp::ct::{Choice, CtEqual, CtOption, CtZero};
use crate::params::sec2::p224r1::*;
use crate::{fiat_define_weierstrass_curve, fiat_define_weierstrass_points};
use crate::{fiat_field_op... | Rust | 0 |
from dotenv import load_dotenv
import os
# Load environment variables
load_dotenv()
# General settings
USE_TESTNET = os.getenv("USE_TESTNET", "False").lower() == "true"
DEFAULT_TRADE_SYMBOL = os.getenv("DEFAULT_TRADE_SYMBOL")
# Spot account keys
SPOT_API_KEY = os.getenv("BINANCE_SPOT_API_KEY")
SPOT_API_SECRET = os.g... | Python | 1 |
igger.metadata.annotations.get("flowdapt.ai/last_run", None)
if not last_run:
last_run = datetime(1970, 1, 1, 0, 0, 0, 0)
else:
last_run = datetime.fromisoformat(last_run)
for schedule in trigger.spec.rule:
next_run = get_next_run_datetime(schedule, last_che... | Python | 1 |
raise NotImplementedError(
'Please modified '
'`MultiViewPipeline` to support lidar processing')
info['axis_align_matrix'] = self._get_axis_align_matrix(info)
info['img_info'] = []
info['lidar2img'] = []
info['c2w'] = []
info['camrotc2w'] = []
... | Python | 1 |
"""
build model from config
"""
from mtrfg.model import MTRfg
from mtrfg.utils import is_file
import torch
def build_model(config, model_start_path = None):
"""
build and return full architecture from the config
"""
## get model from config
model = MTRfg(config)
## move to the correc... | Python | 1 |
from pyrogram import __version__
from bot import Bot
from config import OWNER_ID
from pyrogram.types import Message, InlineKeyboardMarkup, InlineKeyboardButton, CallbackQuery
@Bot.on_callback_query()
async def cb_handler(client: Bot, query: CallbackQuery):
data = query.data
if data == "about":
await qu... | Python | 1 |
t clipping settings
CFG.TRAIN.CLIP_GRAD_PARAM = {
"max_norm": 5.0
}
############################## Validation Configuration ##############################
CFG.VAL = EasyDict()
CFG.VAL.INTERVAL = 1
CFG.VAL.DATA = EasyDict()
CFG.VAL.DATA.BATCH_SIZE = 64
############################## Test Configuration ############... | Python | 1 |
sert_eq!(c.get_line_from_index(14), 3);
}
}
//! livesplit-auto-splitting is a library that provides a runtime for running
//! auto splitters that can control a speedrun timer. These auto splitters are
//! provided as WebAssembly modules.
//!
//! # Requirements for the Auto Splitters
//!
//! The auto splitters must ... | Rust | 0 |
e, AST};
use serde_json::value::Value as Json;
pub(crate) struct ScriptHelper {
pub(crate) script: AST,
}
#[inline]
fn call_script_helper<'reg: 'rc, 'rc>(
params: &[PathAndJson<'reg, 'rc>],
hash: &BTreeMap<&'reg str, PathAndJson<'reg, 'rc>>,
engine: &Engine,
script: &AST,
) -> Result<ScopedJson<'... | Rust | 0 |
n = 0
cont = 0
n = int(input('Digite um numero: '))
while cont <= 10:
cont += 1
res = cont * cont
print(f'{cont} x {n} = {res}') | Python | 1 |
import warnings
def neutralize(weights, assets, group = 'market'):
"""
:param weights: xarray with weights of the algorithm
:param assets: qndata.load_assets
:param group: neutralize positions by 'market', 'industry' or 'sector'
:return: xarray with neutrlized positions
"""
result = weights... | Python | 1 |
s, and assets are initialized and configured.
//! Configuration files are also loaded in this block.
//! If you wish to incorporate more assets they should be initialized here.
//!
//! TA mode is handled shortly after.
//! TA mode give the user the ability to author content. The retractable size panel
//! and the C... | Rust | 0 |
BW_SELR {
match value {
0 => RX_BBA_BW_SELR::_000,
1 => RX_BBA_BW_SELR::_001,
2 => RX_BBA_BW_SELR::_010,
3 => RX_BBA_BW_SELR::_011,
4 => RX_BBA_BW_SELR::_100,
5 => RX_BBA_BW_SELR::_101,
i => RX_BBA_BW_SELR::_Reserved(i),
... | Rust | 0 |
usage will be summed.
Parameters
----------
other : Plan
The Plan to merge with.
Return
------
Plan
The merged Plan.
"""
return _ffi_api.PlanMerge(self, other)
@property
def tensor_configs(self):
"""The TensorCon... | Python | 1 |
# Copyright 2021 Agnostiq Inc.
#
# This file is part of Covalent.
#
# Licensed under the Apache License 2.0 (the "License"). A copy of the
# License may be obtained with this software package or at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Use of this file is prohibited except in compliance with the Licen... | Python | 1 |
: "200 OK".to_string(),
alert: false,
need_to_alert: false,
};
assert_eq!(ok_expected, ok_actual);
}
}
//! # fc
//!
//! A command line program that converts temperature between Fahrenheit and Celsius.
use std::env;
use fc_lib;
const HELP_MSG: &str = r"fc -- convert tempera... | Rust | 0 |
let main_hart = LOTTERY_HART_ID.load(Ordering::SeqCst);
if hartid != main_hart {
while !AP_CAN_INIT.load(Ordering::Relaxed) {}
others_main(hartid);
}
unsafe {
memory::clear_bss();
}
crate::logging::init();
unsafe {
trapframe::init();
}
memory::init(... | Rust | 0 |
_r.suix, shad_sim_r.euix, shad_sim_r.sym.buff);
// let l = shad_sim_r.read_from(&mut input_v, &mut readbuf).unwrap();
assert!(l==3);
}
}
}
/*
#[cfg(test)]
pub mod commontest {
use super::*;
#[test]
fn asym_test () {
let mut pkey = Rsa::generate(2048);
let input = [1,2,3,4,5];
let out = pkey.publi... | Rust | 0 |
persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT... | Rust | 0 |
eration hasn't started before injecting an error).
logger.info("Bootstrapping other nodes")
servers += await manager.servers_add(3)
cql = manager.get_cql()
await wait_for_cql_and_get_hosts(cql, servers, time.time() + 60)
gen_timestamps = set[datetime]()
async def new_g... | Python | 1 |
LVE",
"ALR.CL",
"TSTY",
"NCIT",
"BHLB",
"EBB",
"HBApG",
"MBAYD",
"RBSpJ.CL",
"STRN",
"TSCCD",
"VLR",
"LEGC",
"NKP",
"PIC",
"PKB",
"PMR",
"PPA",
"PUI",
"PXE",
"PXJ",
"PXN",
"UHCPC",
"CGO",
"CRGI",
"EBI",
"EGF",
"HERO",
"IGA",
"LOOKD",
"MATH",
"NXTM",
"STEIE... | Rust | 0 |
&self.variant_con
}
}
impl<'a> DamlVisitableElement<'a> for DamlVariantCon<'a> {
fn accept(&'a self, visitor: &'a mut impl DamlElementVisitor) {
visitor.pre_visit_variant_con(self);
self.tycon.accept(visitor);
self.variant_arg.accept(visitor);
visitor.post_visit_variant_con(se... | Rust | 0 |
xgiFormat::R32_Float => Some(Format::R32_SFloat),
DxgiFormat::R32_UInt => Some(Format::R32_UInt),
DxgiFormat::R32_SInt => Some(Format::R32_SInt),
DxgiFormat::R24G8_Typeless => None,
DxgiFormat::D24_UNorm_S8_UInt => Some(Format::D24_UNorm_S8_UInt),
DxgiFormat::R24_UNorm_X8_Typeles... | Rust | 0 |
let v3 = {
let a1_double = self.c1.double(cs.ns(|| "2a1"))?;
let a2_quad = self.c2.double(cs.ns(|| "2a2"))?.double(cs.ns(|| "4a2"))?;
let a0_plus_2_a1_plus_4_a2 = self
.c0
.add(cs.ns(|| "a0 + 2a1"), &a1_double)?
.add(cs.ns(|| "a0 ... | Rust | 0 |
};
*prior_relative_pitch = relative_pitch;
*prior_pitch = pitch;
Some(pn)
})
.collect()
}
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
enum NavDirection {
Up,
Right,
Down,
Left,
}
struct RelativePitchInput {
direction: NavDirection,
relative_pitch: RelativePitch,
time: u32,
}
... | Rust | 0 |
er` or
/// `Node::InlineString`) will report 0. Others, as `Node::BoxedString` will return the
/// number of additionally allocated bytes.
pub fn allocated_size(&self) -> usize {
match self {
Node::BoxedString(str) => std::mem::size_of::<usize>() + str.len(),
Node::List(list)... | Rust | 0 |
#!/usr/bin/python
# Copyright 2015 Huawei Devices USA 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 r... | Python | 1 |
TcpStream::connect(&addr).await?;
let stream = if let Some(connector) = self.connector {
connector.wrap(host, stream).await?
} else if self.uri.scheme_str() == Some("wss") {
let connector = Connector::new()?;
connector.wrap(host, stream).await?
} else {
... | Rust | 0 |
Date::parse_from_str(&u, "%Y-%m-%d").is_ok() {
return Ok(());
}
Err(String::from("The value is not date of form YYYY-MM-YY"))
}
/// check for gitlab project slug
/// Rules:
/// * can only contain letters, digits, `_`, `-` and `.`
/// * cannot start with `-`
/// * can... | Rust | 0 |
from django.test.utils import override_settings
import pytest
from baserow_premium.row_comments.handler import RowCommentHandler
from baserow_premium.row_comments.models import RowComment
from baserow_premium.row_comments.trash_types import RowCommentTrashableItemType
from baserow.contrib.database.rows.handler import... | Python | 1 |
running:
try:
frame = await asyncio.wait_for(
self._idle_queue.get(), timeout=self._idle_timeout_secs
)
if isinstance(frame, StartFrame) or isinstance(frame, self._idle_timeout_frames):
# If we find a StartFrame or one... | Python | 1 |
"L",
// }
// }
// }
impl_commands! {
(User<'_>, b"USER", user);
(Pass<'_>, b"PASS", pass);
(List<'_>, b"LIST", path);
(Mlsd<'_>, b"MLSD", path);
(Pasv, b"PASV");
(Syst, b"SYST");
(Feat, b"FEAT");
}
impl Command for Type {
fn encode(&self, buf: &mut [u8]) {
let ty = ... | Rust | 0 |
self.next = self.next.add(1);
}
// Fail if it's not a number.
if self.next as usize == next as usize {
return None;
}
Some(value)
}
/// Advances the iterator by the given number of bytes. Returns true if the iterator was
/// advanced without... | Rust | 0 |
r"\[Prediction & Analysis\]:\s*",
f"[Prediction & Analysis]:\nPrediction: {label.capitalize()}\nAnalysis: ",
answer
)
except Exception:
print(symbol, i)
print(label)
print(answer)
continue
system_pro... | Python | 1 |
class Person:
def __init__(self, name: str, surname: str):
self.name = name
self.surname = surname
def __repr__(self):
return f"{self.name} {self.surname}"
def __add__(self, other):
return Person(self.name, other.surname)
class Group:
def __init__(self, name: str, peo... | Python | 1 |
The culture of instant gratification is a topic of discussion nowadays. What about you?",
"The focus of the education system is being debated. What are your thoughts?",
"Podcasts have been rising in popularity. What's your perspective?",
"Travel is considered by some as a great form of education. Do you agr... | Python | 1 |
import collections
class MostCommonClassModel(object):
"""A classification model that predicts the most common label from the training data."""
def __init__(self):
pass
# Every model should have a fit function that takes:
# x - an array of the training data
# y - the correct lables fo... | Python | 1 |
class FaithfulnessTemplate:
@staticmethod
def generate_claims(text, lang: str = "en"):
if lang == "en":
return f"""Based on the given text, please generate a comprehensive list of FACTUAL claims that can inferred from the provided text.
Example:
Example Text:
"Einstein won the noble prize in 1968 for his dis... | Python | 1 |
import discord
# Define a simple View that gives us a counter button.
class Counter(discord.ui.View):
# When pressed, this increments the number displayed until it hits 5.
# When it hits 5, the counter button is disabled, and it turns green.
# NOTE: The name of the function does not matter to the library.... | Python | 1 |
_statement.as_ptr(),
bind_index,
value as libc::c_double,
),
(SqliteType::SmallInt, SqliteBindValue::I32(value))
| (SqliteType::Integer, SqliteBindValue::I32(value)) => {
ffi::sqlite3_bind_int(self.inner_statement.as_ptr(), bind_index, ... | Rust | 0 |
.png')
plt.close()
# plot pixel accuracy
plt.plot(history.history['PA'])
plt.plot(history.history['val_PA'])
plt.title('model pixel accuracy')
plt.ylabel('pixel accuracy')
plt.xlabel('epoch')
# legend
plt.legend(['train', 'val'], loc='upper left')... | Python | 1 |
### Example
///
/// ```
/// #[macro_use] extern crate proptest;
/// use proptest::prelude::*;
///
/// #[derive(Debug)]
/// struct BigStruct { /* Lots of fields ... */ }
///
/// fn very_expensive_function() -> BigStruct {
/// // Lots of code...
/// BigStruct { /* fields */ }
/// }
///
/// # /*
/// #[test]
/// # */
... | Rust | 0 |
Some(((2, 0.000), (0, 0.000)).into()),
invalid: Some(((3, 0.000), (0, 0.000)).into())
}
);
assert_eq!(
round_cutoff(tc.crossing(&tp_0_0, 0_f32.to_radians(), |tp| tp.x <= 3)),
Crossing {
valid: Some(((3, 0.000), (0, 0.000)).into()),
invalid: None,
... | Rust | 0 |
的文件
// 可以随意在这个目录中创建任意多的测试文件, Cargo 会将每一个文件当作单独的 crate 来编译
#[test]
fn it_adds_two() {
common::setup();
assert_eq!(4, chapter11::add_two(2));
}
use std::{
env,
path::{Path, PathBuf},
};
use config::{Config, ConfigError, Environment, File, FileFormat};
use lazy_static::lazy_static;
use serde::Deserialize;... | Rust | 0 |
t data:
return None
# Flatten responses to DataFrame
rows = []
for item in data:
row = {
"response_id": item["response_id"],
"submitted_at": item["submitted_at"],
}
# Add answer data
for answer in item.get("answers", []):
... | Python | 1 |
self.get().partial_cmp(other)
}
}
impl<T> PartialOrd for Value<T>
where
T: Codec + PartialOrd,
{
fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
self.get().partial_cmp(other.get())
}
}
impl<T> Ord for Value<T>
where
T: Codec + Ord,
{
fn cmp(&self, other: &Self) -> Orderin... | Rust | 0 |
from isort.main import main
main()
| Python | 1 |
let event_bytes = input.event.serialize();
let window_bytes = input.window.serialize();
[
response_type_bytes[0],
0,
sequence_bytes[0],
sequence_bytes[1],
event_bytes[0],
event_bytes[1],
event_bytes[2],
event... | Rust | 0 |
yield_now().await;
sched_tx
.send(ScheduleRequest {
message: 8,
run_at: Instant::now(),
})
.await
.unwrap();
// Eventually the background task should finish up and report the message received,
// a timeout here *shou... | Rust | 0 |
/// ```
/// fn main() {
/// use std::io::prelude::*;
/// use mldata::utils::lzw::Decoder;
///
/// let data: &[u8] = &[0x61, 0xC4, 0x8C, 0x21];
/// let mut uncompressor = Decoder::new(data);
/// let mut s = String::new();
/// uncompressor.read_to_string(&mut s);
/// println!("{}", s);
/// ... | Rust | 0 |
import frappe
from datetime import datetime
def execute(filters=None):
columns, data = get_columns(filters), get_data(filters)
return columns, data
def get_columns(filters):
columns = [
{
"label": "Employee",
"fieldname": "employee",
"fieldtype": "Data",
"width": 250
},
{
"label": "Employee Na... | Python | 1 |
fn check_valid_field_paths(&self) -> Result<()> {
let input_paths = self
.schematic
.get_all_components()
.iter()
.filter_map(|c| match c {
ClockComponent::Multiplexer(m) => Some(m.path.clone()),
ClockComponent::Divider(d) => match d.is_fixed() {
true => None,
... | Rust | 0 |
Goal<'static, Zebra> {
either(on_right(a, b, houses), on_right(b, a, houses))
}
pub fn zebra() -> Option<Vec<House>> {
let houses: LVec<LHouse> = lvec![
ltup!("norwegian", var(), var(), var(), var()),
var(),
ltup!(var(), var(), "milk", var(), var()),
var(),
var(),
]... | Rust | 0 |
=> continue,
};
matched_lines += 1;
bytes
},
None => continue,
}
if matched_lines == 8 {
return Ok(memory)
}
}
// TODO: Kinda bad to name it like this
... | Rust | 0 |
okens: int = 512,
) -> str:
"""生成代码。
Args:
messages: 消息列表,用于 instruct 模型
config: 生成配置
max_new_tokens: 最大生成token数量
Returns:
生成的代码字符串
Raises:
CodeGenerationError: 当代码生成失败时抛出
"""
# 对于 instruct 模型,使用 chat tem... | Python | 1 |
pdf")
def set_node_min_pheromone_by_degree(node_list: list[Node]) -> None:
# 各nodeのmin_pheromone属性の値を決定
for node in node_list:
degree = len(node.connection)
node.min_pheromone = MIN_F * 3 // degree
# pheromoneの値をnode.min_pheromoneに変更
node.pheromone = [node.min_pheromone for _ ... | Python | 1 |
_dskyval: u16,
}
const SEVEN_SEG_TABLE: [u8; 11] = [
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, BLANK
0x3F, 0x06, 0x5B, 0x4F, 0x66, 0x6D, 0x7D, 0x07, 0x7F, 0x6F, 0x00,
];
///
/// # Description
///
/// The function is to convert the bits being set by the AGC code within a given
/// IO channel, to the corresponding seven... | Rust | 0 |
out = zpixmap_shm_to_image(shm, size, geom.width, geom.height)
self.game_last_image = out
self.game_last_grab = time.monotonic()
return out
finally:
if shm:
self.manager.free_shm((xid, shm))
def embed_window(self, window: QWindow):
... | Python | 1 |
"""
You are given a string s consisting only of letters 'a' and 'b'. In a single step you can remove one palindromic subsequence from s.
Return the minimum number of steps to make the given string empty.
A string is a subsequence of a given string if it is generated by deleting some characters of a given string withou... | Python | 1 |
import numpy as np
def linear(x, w, b): # [m, in], [in, out], [out] -> [m, out]
return x @ w + b
def softmax(x):
#return np.exp(x) / np.sum(np.exp(x))
max_vals = np.max(x, axis=-1, keepdims=True)
exps = np.exp(x - max_vals)
return exps / np.sum(exps, axis=-1, keepdims=True)
def attention(q, k... | Python | 1 |
new(5646, "Jordan", "<NAME>", 31.7000000, 35.9500008, 731.0),
City::new(5647, "Jordan", "<NAME>", 32.6550000, 35.6836128, 373.0),
City::new(5648, "Jordan", "<NAME>", 30.2500000, 35.4666672, 1426.0),
City::new(5649, "Jordan", "<NAME>", 31.2702778, 35.7386093, 926.0),
City::new(5650, "Jordan", "<NAME>", 32.3166667, 3... | Rust | 0 |
RESULTS.extend(
POOL.map(
run_test,
options_gen(EXECUTABLE, OPTIONS.parallel, OPTIONS.jobs)))
# Now run sequential tests.
if OPTIONS.sequential:
RESULTS.extend(
POOL.map(
run_test,
options_ge... | Python | 1 |
HashSet<syn::Ident>),
Retries(syn::LitInt),
Timeout(syn::LitStr, Duration),
Priority(Priority),
}
#[derive(Clone)]
enum Priority {
Trivial(priorities::trivial),
Low(priorities::low),
Normal(priorities::normal),
High(priorities::high),
Critical(priorities::critical),
}
#[derive(Clone)]
... | Rust | 0 |
sb0, u64>::empty_mut().store_be::<u8>(0);
}
//#[cfg(target_pointer_width = "64")]
//#[test]
//#[should_panic]
pub fn bsl64_sb16_empty() {
BitSlice::<Lsb0, u64>::empty_mut().store_be::<u16>(0);
}
//#[cfg(target_pointer_width = "64")]
//#[test]
//#[should_panic]
pub fn bsl64_sb32_empty() {
BitSlice::<Lsb0, u64>::empt... | Rust | 0 |
# Crie um programa que leia nome e o preço de vários produtos.
# O programa deverá perguntar se o usuário vai continuar ou não.
# No final, mostre:
# A) Qual é o total gasto na compra.
# B) Quantos produtos custam mais de R$ 1000
# C) Qual é o nome do produto mais barato.
print('-'*40)
print('{:^40}'.format('LOJA SUPE... | Python | 1 |
lized_start=6491
_PROVISIONINGRESPONSE._serialized_end=6513
_REMOTEATTESTATION._serialized_start=6515
_REMOTEATTESTATION._serialized_end=6620
_SESSIONINIT._serialized_start=6622
_SESSIONINIT._serialized_end=6635
_SESSIONSTATE._serialized_start=6637
_SESSIONSTATE._serialized_end=6651
_SIGNEDCERTIFICATEST... | Python | 1 |
from numpy import linalg
from lib.printers import print_matrix
from lib.slau import Problem
from lib.generators import get_hilbert_matrix, \
get_random_matrix, get_identity_matrix, \
get_random_vector
from tasks.slau_solver.methods import get_lu_decomposition, \
print_decomposition, get_qr_dec... | Python | 1 |
# Config.py file for motion-track.py Release 1.10
# Display Settings
# ----------------
debug = True # Set to False for no data display
window_on = False # Set to True displays opencv windows (GUI desktop reqd)
show_fps = False # Show Frames per second
# OpenCV Settings
# ---------------
diff_window_on =... | Python | 1 |
from django.urls import path, include
from rest_framework import routers
from .views import *
urlpatterns = [
path('education/', EducationAPIList.as_view()),
path('education/<int:pk>/', EducationAPIUpdate.as_view()),
path('education/create/', EducatioAPICreate.as_view()),
path('educationdelete/<int:p... | Python | 1 |
eros(len(T))
for i, temperature in enumerate(T):
# Setup the gas and reactor
reactor_temperature = temperature
ideal_gas.TP = reactor_temperature, reactor_pressure
ideal_gas.set_equivalence_ratio(phi=1.0, fuel='c12h26',
oxidizer={'o2': 1.0, 'n2': 3.76})
r = ct.Rea... | Python | 1 |
{
initrd_addr = if let Some(addr) = dtb_addr.checked_sub(u64::from(config.initrd_size)) {
addr
} else {
return Err(ErrorKind::InitrdOverflow(dtb_addr, config.initrd_size).into());
};
if !sys_mem.address_in_memory(GuestAddress(initrd_addr), 0) {
initr... | Rust | 0 |
ive(Copy, Clone, Eq)]
pub struct Output {
/// Byte array containing a password hashing function output.
bytes: [u8; Self::MAX_LENGTH],
/// Length of the password hashing function output in bytes.
length: u8,
/// Encoding which output should be serialized with.
encoding: Encoding,
}
#[allow(cl... | Rust | 0 |
Hər sorğuda sessiyanın yenilənməməsi
LOGIN_URL = '/' # Sessiya bitdikdə yönləndiriləcək səhifə
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
# 3. Jazzmin tənzimləmələri
JAZZMIN_SETTINGS = {
# Başlıq və Loqo
"site_title": "AS-AVTO",
"s... | Python | 1 |
_owner = OWNER.load(deps.storage)?;
// Verify sender has permission.
if info.sender != curr_owner {
return Err(ContractError::Unauthorized {});
}
let new_owner = deps.api.addr_validate(&new_owner)?;
OWNER.save(deps.storage, &new_owner)?;
Ok(Response::default()
.add_attribute("m... | Rust | 0 |
SEGV: i32 = 11;
pub const SIGTERM: i32 = 15;
pub const SIGBREAK: i32 = 21;
pub const SIGABRT: i32 = 22;
pub const SIGABRT2: i32 = 22;
// From https://github.com/wine-mirror/wine/blob/master/include/winnt.h#L611
pub const STATUS_WAIT_0: u32 = 0x00000000;
pub const STATUS_ABANDONED_WAIT_0: u32 = 0x00000080;
pub const ST... | Rust | 0 |
remainder = []
for i in range(10):
N = int(input())
remainder.append(N%42)
print(len(set(remainder))) | Python | 1 |
import html
import gradio as gr
import modules.textual_inversion.textual_inversion
from modules import sd_hijack, shared
def create_embedding(name, initialization_text, nvpt, overwrite_old):
filename = modules.textual_inversion.textual_inversion.create_embedding(name, nvpt, overwrite_old, init_text=initializati... | Python | 1 |
::IndexOutOfRangeError {
/// dimension_index: 1,
/// requested: 6,
/// min: 1,
/// max: 5,
/// }
/// );
/// # Ok(())
/// # }
/// ```
///
/// # Panics
///
/// Function should not panic. If you get it to panic, please raise an issue in [github](https://github.com/AndrewSi... | Rust | 0 |
disable_web_page_preview=True,
)
elif next_match:
next_page = int(next_match.group(1))
await query.message.edit(
text=top_text,
reply_markup=InlineKeyboardMarkup(
paginate_modules(next_page + 1, HELPABLE, "help")
),
di... | Python | 1 |
,
'þŸ': 1,
'þƒ': 7,
'ÿJ': 6,
'ÿT': 1,
'ÿY': 1,
'ÿ_': 2,
'ÿj': 2,
'ÿÎ': 1,
'ÿÝ': 1,
'ÿì': 4,
'ÿî': 2,
'ÿï': 1,
'ÿŸ': 1,
'ÿƒ': 7,
'ŒJ': 6,
'ŒT': 1,
'ŒY': 1,
'Œ_': 2,
'Œj': 2,
'ŒÎ': 1,
'ŒÝ': 1,
'Γ': 4,
'Δ': 2,
'Ε': 1,
'ŒŸ': 1,
'Œƒ': 7,
'œJ': 6,
'œT': 1,
'œY': 1,
'œ_': 2,
'œj': 2,
'œÎ': 1,
'œÝ': 1,
'ϓ': 4,
'ϔ': 2,
'ϕ... | Python | 1 |
, true).var_live_on_entry;
println!("Registered liveness data: {:?}", liveness);
for (point, variables) in liveness.iter() {
println!("{:?} has live variables: {:?}", point, variables);
assert_eq!(variables.len(), 1);
}
assert_eq!(liveness.len(), 2);
}
#[test]
// `point1` GOTO `point2`,... | Rust | 0 |
"""Implementation of the ipaddres-based network types adaptation
"""
# psycopg/_ipaddress.py - Ipaddres-based network types adaptation
#
# Copyright (C) 2016-2019 Daniele Varrazzo <daniele.varrazzo@gmail.com>
# Copyright (C) 2020-2021 The Psycopg Team
#
# psycopg2 is free software: you can redistribute it and/or modi... | Python | 1 |
from fastapi import UploadFile, File
import requests
from config import OCR_ENDPOINT, OCR_SKIP_MODELS, OCR_SPEC_MODELS
import time
from typing import List
from utils import contains
def get_ocr_source(data: any) -> List[str]:
if type(data) is str:
return [data]
elif type(data) is list:
# recu... | Python | 1 |
_str().try_into()?);
}
i += 1;
}
if wait_spec.is_none() {
return Err(String::from("No wait params"));
}
Ok(YawnConfig {
wait_spec: wait_spec.unwrap(),
exit_code: exit_code.unwrap_or(0),
})
}
fn run_wait_spec(wait_spec: WaitSpec) {
let duration = match w... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.