text string | label_name string | labels int64 |
|---|---|---|
Rename this here and in `run_simulation`
def _extracted_from_run_simulation_70(arg0, arg1):
plt.xlabel("Generation")
plt.ylabel(arg0)
plt.title(arg1)
plt.legend()
plt.grid()
plt.show()
if __name__ == "__main__":
num_decades = int(input("Enter simulation runtime in decades: "))
initial_... | Python | 1 |
}
}
pub fn serialize_structure_on_demand_provisioning_specification(
object: &mut smithy_json::serialize::JsonObjectWriter,
input: &crate::model::OnDemandProvisioningSpecification,
) {
if let Some(var_422) = &input.allocation_strategy {
object.key("AllocationStrategy").string(var_422.as_str());
... | Rust | 0 |
et_token_indexers)
return Instance({"source_tokens": source_field, "target_tokens": target_field})
else:
return Instance({'source_tokens': source_field})
@classmethod
def from_params(cls, params: Params) -> 'Seq2SeqDatasetReader':
source_tokenizer_type = params.pop('sour... | Python | 1 |
from typing import Tuple, Optional
from uuid import UUID
from ..sess import eval_lua
__all__ = (
'isAvailable',
'getViewport',
'getCursor',
'setCursor',
'getCursorBlink',
'setCursorBlink',
'clear',
'clearLine',
'read',
'write',
'screen',
'keyboard',
)
def isAvailable... | Python | 1 |
# coding: utf-8
"""
Python SDK for Logto API
Python SDK for Logto API. Note: This SDK is for Logto Cloud and OSS. However, if you are using Logto OSS, some features available in the SDK may not work for you. Please refer to the response of `/api/swagger.json` endpoint on your Logto OSS instance for features ... | Python | 1 |
e.setObjectName('title')
title.setAlignment(Qt.AlignCenter)
welcome = QLabel('欢迎使用茶园环境数据分析系统\n请登录以继续')
welcome.setObjectName('welcome')
welcome.setAlignment(Qt.AlignCenter)
content_layout.addWidget(title)
content_layout.addWidget(welcome)
content_layout.a... | Python | 1 |
from flask.views import MethodView
from flask import render_template, request
class HomeAPI(MethodView):
def get(self):
if 'loggedIn' in request.args and request.args['loggedIn'] == 'true':
return render_template('index_loggedin.html')
elif 'algoStarted' in request.args and request.args['algoStarted'] ... | Python | 1 |
_crud
attr_name = 'start_notice_interval_id'
elif flag == NoticeFlag.END.value:
notice_crud = end_notice_interval_crud
attr_name = 'end_notice_interval_id'
else:
raise ValueError('Некорректный флаг notice interval')
user: UserProfile = await self.g... | Python | 1 |
available_squares(&board).symmetric_difference(&qa2_expected).collect::<HashSet<&Square>>().is_empty());
}
#[test]
fn pieces_king_available_squares() {
let mut board = common::empty_board();
let king = Piece {color: Color::White, figure: Figure::King, square: *board.get_unchecked("b2")};
board.pieces.push(... | Rust | 0 |
nts(self, text):
messages = [
{"role": "system", "content": "당신은 카피킬러 AI입니다."},
{"role": "user", "content": f"다음 글의 주요 포인트를 식별해주세요: {text}"}
]
response = requests.post(self.api_url, json=messages)
response.raise_for_status()
return response.json()
def... | Python | 1 |
node("clip2", &*clip2)?;
let result = mpeg2stinx.invoke("LutXYDiff", &args).map_err(Error::from)?;
if let Some(e) = result.error() {
bail!("{}", e);
}
result.get_node("clip").map_err(Error::from)
}
use simple_html_template::{TemplateCache, html_map};
use wasm_bindgen::prelude::*;
use wasm_bindge... | Rust | 0 |
the subscriber.
//!
//! * `ed25519pk` -- subscriber's Ed25519 public key.
//!
//! * `hash` -- hash value to be signed.
//!
//! * `sig` -- message signature generated with the senders private key.
use core::marker::PhantomData;
use iota_streams_app::message::{
self,
HasLink,
};
use iota_streams_core::{
as... | Rust | 0 |
from django.urls import path
from .views import (
playlist_create_view,
playlist_list_view,
playlist_detail_view,
playlist_delete_view,
playlist_edit_view,
playlist_delete_video,
playlist_add_videos,
)
urlpatterns = [
path('create-view/', playlist_create_view, name='playlist-create'),... | Python | 1 |
# concept_drift/fpdd.py
import numpy as np
from scipy.stats import fisher_exact
class FPDDDriftDetector:
def __init__(self, window_size=30, alpha=0.05):
"""
Fisher Proportions Drift Detector (FPDD)
:param window_size: Size of each sliding window for monitoring errors.
:param alpha:... | Python | 1 |
#[get("/cache/<key>")]
fn get_data(cache_controller_state: State<Arc<Mutex<Controller>>>, key: usize) -> Result<Json<LecarData>, NotFound<&'static str>> {
let cloned_state_arc = Arc::clone(&cache_controller_state);
let mut cache_controller = cloned_state_arc.lock().unwrap();
match (*cache_controller).get(... | Rust | 0 |
should be retrieved.
/// \param shape_mode An empty shape-mode structure to fill, or NULL to check whether the window has a shape.
///
/// \return 0 if the window has a shape and, provided shape_mode was not NULL, shape_mode has been filled with the mode
/// data, SDL_NONSHAPEABLE_WINDOW if the SDL_Window given is not... | Rust | 0 |
t=os.environ["SM_MODEL_DIR"])
# #parser.add_argument("--n_gpus", type=str, default=os.environ["SM_NUM_GPUS"])
# parser.add_argument("--train_data", type=str, default="s3://sagemaker-us-west-2-979105248912/ambuje/dapr/data/pre_train_malomatia/train.jsonl")
# #parser.add_argument("--test_dir", type=str, defau... | Python | 1 |
one
# chunk has 3 rows):
@patch(
"sklearn.ensemble._iforest.get_chunk_n_rows",
side_effect=Mock(**{"return_value": 3}),
)
@pytest.mark.parametrize("contamination, n_predict_calls", [(0.25, 3), ("auto", 2)])
def test_iforest_chunks_works1(
mocked_get_chunk, contamination, n_predict_calls, global_random_seed... | Python | 1 |
r, $span:expr => [STORE_GLOBAL $global:expr; $($rest:tt)*] ) => {
$assembler.store_global($global, $span)?;
emit_bytecode! { $assembler, $span => [$($rest)*] }
};
($assembler:expr, $span:expr => [LOAD_FIELD_TO_LOCAL $field:expr, $slot:expr; $($rest:tt)*] ) => {
$assembler.load_field_to_... | Rust | 0 |
();
let background_rgba = gdk::RGBA::from_str("black").unwrap();
let ch = res.char_code.clone();
res.button.set_child(Some(&*res.drawing_area.borrow()));
let dialog = &main_window.window;
let dialog_char = Rc::new(RefCell::new(char_code));
let result_char = res.char_code.clone();
let main_w... | Rust | 0 |
_self: *const ::std::os::raw::c_void,
_x: *mut fmx__fmxcpt,
) -> fmx_CharacterStyle_ColorChannel16;
}
extern "C" {
pub fn FM_Color_operatorAS(
_self: *mut ::std::os::raw::c_void,
rhs: *const fmx_CharacterStyle_Color,
_x: *mut fmx__fmxcpt,
) -> *mut fmx_CharacterStyle_... | Rust | 0 |
group_ind, _x in enumerate(split_x):
y = self.forward_kag(_x, group_ind)
output.append(y.clone())
y = torch.cat(output, dim=1)
return y
class KAGNConv3DLayer(KAGNConvNDLayer):
def __init__(self, input_dim, output_dim, kernel_size, degree=3, groups=1, padding=0, stride=1, d... | Python | 1 |
impl Into<std::io::Error> for RpcError {
fn into(self) -> std::io::Error {
std::io::Error::new(std::io::ErrorKind::Other, "RPC Error")
}
}
impl From<std::io::Error> for RpcError {
fn from(e: std::io::Error) -> RpcError {
RpcError::Custom(format!("{}", e))
}
}
impl From<bincode::Error> ... | Rust | 0 |
LittleEndian::read_i16(&buf));
/// ```
#[inline]
fn read_i16(buf: &[u8]) -> i16 {
Self::read_u16(buf) as i16
}
/// Reads a signed 24 bit integer from `buf`, stored in i32.
///
/// # Panics
///
/// Panics when `buf.len() < 3`.
///
/// # Examples
///
/// Write... | Rust | 0 |
ize> = HashSet::new();
for y in 0..my {
for x in 0..mx {
let closest = closest_coords(&Coord { x: x, y: y }, coords);
if closest.len() == 1 {
cnt_by_idx[closest[0]] += 1;
if y == 0 || x == 0 || y == my - 1 || x == mx - 1 {
for &c ... | Rust | 0 |
-specific dependency target into GN imperative control flow.
///
/// `Cargo.toml` files can define [platform-specific dependencies] in two ways:
/// - Using `#[cfg]` syntax to match classes of targets.
/// ```text
/// [target.'cfg(unix)'.dependencies]
/// foo = "0.1"
/// ```
///
/// - Listing the full target th... | Rust | 0 |
#
# BitBake Tests for cooker.py
#
# Copyright BitBake Contributors
#
# SPDX-License-Identifier: GPL-2.0-only
#
import unittest
import os
import bb, bb.cooker
import re
import logging
# Cooker tests
class CookerTest(unittest.TestCase):
def setUp(self):
# At least one variable needs to be set
self.d... | Python | 1 |
_eq!(hex_result[i][index], color.to_rgb().unwrap());
// print!("{:?}, ", color.to_rgb().unwrap());
}
// println!("]");
}
}
#[test]
fn test_hex2hex() {
let hex_vec = vec!["#80ffffff", "#c8c8c8", "#ddd", "#ffffff80"];
let hex_result = vec![
vec!["#80ffff", "#80FFFF", "#ffffff", "#80ffffff", "#FFFFFF"... | Rust | 0 |
[inline]
pub fn is_sign_positive(self) -> bool { num::Float::is_sign_positive(self) }
/// Returns `true` if and only if `self` has a negative sign, including `-0.0`, `NaN`s with
/// negative sign bit and negative infinity.
///
/// ```
/// let f = 7.0f32;
/// let g = -7.0f32;
///
///... | Rust | 0 |
::LdrhImm, c, instr) // A7.7.55 T1
} else {
tag::get_narrow(Opcode::StrhImm, c, instr) // A7.7.170 T1
}
}
0b1001 => {
let instr = (hword & 0x7FF) | (13 << 12);
if op_c {
tag::get_narrow(Opcode::LdrImm, c, instr) // A7.7.43 T... | Rust | 0 |
import pygame as pg
import PhysEng as pe
from PhysEng.Visualize import Visualize
from astropy import constants as c
from astropy import units as u
x = pe.Environment()
x.dt = 60*60*24
vis =Visualize(x)
vis.simulationheight = [-5e12, 5e12]
vis.simulationwidth = [-5e12, 5e12]
#create a particle as the sun
#orbital ... | Python | 1 |
.
///
/// > Note: this does not prove that an output has not been previously spent in a ledger. Each
/// spent output yields a unique 'spend tag'. To avoid double spends, the verifier should query
/// this proof for all spend tags, and confirm no spend tag has been used in a previous
/// transaction... | Rust | 0 |
len: usize) -> io::Result<Vec<u8>> {
use std::iter;
let mut buffer: Vec<u8> = iter::repeat(0).take(len).collect();
self.reader.read_exact(&mut buffer[..])?;
Ok(buffer)
}
pub fn take_utf8(&mut self, len: usize) -> io::Result<String> {
// Take the bytes, parse as UTF-8, r... | Rust | 0 |
_ALARMO_INTS_SPEC>`"]
pub type THS_ALARMO_INTS = crate::Reg<ths_alarmo_ints::THS_ALARMO_INTS_SPEC>;
#[doc = "THS Alarm off Interrupt Status Register"]
pub mod ths_alarmo_ints;
#[doc = "THS_ALARM_INTS register accessor: an alias for `Reg<THS_ALARM_INTS_SPEC>`"]
pub type THS_ALARM_INTS = crate::Reg<ths_alarm_ints::THS_AL... | Rust | 0 |
fn move_data_to_end(ops: Vec<Instruction>) -> Vec<Instruction> {
let (mut ops, data) = separate_data(ops);
ops.extend(data.into_iter());
ops
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Pass {
/// Name of the pass
name: String,
/// Actual function
function: fn(Vec<Instruction>) -> Ve... | Rust | 0 |
wlines preceded by \
def t_ESCAPED_NL(t):
r'\\\r?\s*\n'
t.lexer.lineno += 1
def t_COMMENT(t):
r';[^\n]*'
if keep_all:
return t
def t_NEWLINE(t):
r'\r*\n'
t.lexer.lineno += 1 # track line numbers
return t
def t_STRING(t):
r'"[^"]*"' # embedded quotes not supported in UF?... | Python | 1 |
print('{:=^40}'.format(' GOOD THINGS MARKET '))
preço = float(input('Qual o valor da sua compra? '))
print('''FORMAS DE PAGAMENTO
[1] À vista dinheiro/cheque
[2] À vista no cartao
[3] Em ate 2X no cartao
[4] 3X ou mais no cartao''')
pag = int(input('Qual sera a forma de pagamento? '))
if pag == 1:
valor = preço ... | Python | 1 |
t[x])
sen = get_sensitivity(pred[x], gt[x])
pre = get_precision(pred[x], gt[x])
F1 = get_F1(pred[x], gt[x])
#dice = (2 * IoU) / (1 + IoU)
IoUs.append(IoU)
dices.append(dice)
sens.append(sen)
pres.append(pre)
F1s.... | Python | 1 |
mmitter, message, tree, parents)
.map_err(CreateCommitError::CreateUnsignedCommitFailed)
}
} else {
create_unsigned_commit(repo, dest_ref_name, author, committer, message, tree, parents)
.map_err(CreateCommitError::CreateUnsignedCommitFailed)
}
}
#[derive(Debug)]
pub enum CreateGpgSignedCommi... | Rust | 0 |
# See patgen.py for the concept.
import math
import argparse
from .fuseconv import read_svf
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'count', metavar='COUNT', type=int,
help='match patterns for COUNT fuses')
parser.add_argument(
'basename', metavar='BAS... | Python | 1 |
DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};
/// Utility type for manipulating 3-dimensional vectors.
///
/// `Vector3` is a simple type that defines a mathematical vector with
/// three coordinates (x, y and z).
///
/// It can be used to represent anything that has three dimensions:
/// a size, a point, a veloci... | Rust | 0 |
* The GM default controller 'vel-to-filter cut off' is not clearly
* defined: If implemented according to the specs, the filter
* frequency jumps between vel=63 and vel=64. To maintain
* compatibility with existing sound fonts, the implementation is
* 'hardcoded', it is impossible to implement usin... | Rust | 0 |
en: u32 = 3;
pub const FifoQueueLen: u32 = 1;
pub const Period: u64 = 3;
pub const MinFreeze: u64 = 2;
pub const IntakePeriod: u64 = 2;
pub const MaxIntakeBids: u32 = 2;
}
ord_parameter_types! {
pub const One: u64 = 1;
}
impl pallet_orders::Config for Test {
type Event = Event;
type OrderConversions = ();
typ... | Rust | 0 |
import hashlib
import secrets
import string
import re
from datetime import datetime, timedelta
from lockly.veritabani import VeritabaniYoneticisi
import uuid
import smtplib
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import random
class SifreYoneticisi:
def __init__(self):
... | Python | 1 |
t_path, newpath) # Renaming mask
p=p+1
this_mask=cv2.resize(cv2.imread(src_path), img_size,cv2.INTER_AREA)
this_mask = cv2.cvtColor(this_mask, cv2.COLOR_BGR2RGB)
mask_12_channel = np.zeros((len(class_name_mapping),*img_size), dtype=np.uint8) # Initialize... | Python | 1 |
t::Result {
let mut magnet_string = String::from("magnet:?");
if self.xt != String::new() {
magnet_string = format!("{}{}{}:{}", magnet_string, "xt=urn:", self.hash_type, self.xt);
}
let add_to_mag_string = |p_name: String, p_val: &String| -> String {
if p_val !... | Rust | 0 |
ly
if os.path.exists(path):
shutil.rmtree(path)
# monkeypatch golem message function
monkeypatch.setattr(golem.core.log.LoggerAdapter, 'message', mock_message)
logging.basicConfig(level=logging.INFO)
if isinstance(pipeline_case.node_list, list):
pipeline_case.node_list = {0: pipelin... | Python | 1 |
let decoder: &mut LircMode2 = bpf.program_mut("imon_rsc").unwrap().try_into().unwrap();
/// decoder.load()?;
/// decoder.attach(file)?;
/// # Ok::<(), Error>(())
/// ```
#[derive(Debug)]
#[doc(alias = "BPF_PROG_TYPE_LIRC_MODE2")]
pub struct LircMode2 {
pub(crate) data: ProgramData,
}
impl LircMode2 {
/// Load... | Rust | 0 |
ive(Deserialize)]
#[serde(remote = "Secure")]
struct SecureDef {
pub service_token: SecureToken,
#[serde(default = "default_jwt_token_expiration")]
pub jwt_token_expiration: u64,
}
pub fn default_jwt_token_expiration() -> u64 {
60
}
pub type SecureToken = String;
impl From<SecureToken> for Secure {
... | Rust | 0 |
to_df;
pub mod to_parquet;
pub(crate) mod utils;
pub mod where_;
pub mod with_column;
pub use aggregate::DataFrame as DataFrameAggregate;
pub use append::DataFrame as DataFrameAppend;
pub use column::DataFrame as DataFrameColumn;
pub use command::Command as DataFrame;
pub use drop::DataFrame as DataFrameDrop;
pub use... | Rust | 0 |
uture<Act>,
B: ActorTryFuture<Act, Error = A::Error>,
F: FnOnce(A::Ok, &mut Act, &mut Act::Context) -> B,
Act: Actor,
{
type Output = Result<B::Ok, A::Error>;
fn poll(
mut self: Pin<&mut Self>,
act: &mut Act,
ctx: &mut Act::Context,
task: &mut Context<'_>,
) -> P... | Rust | 0 |
import config
from config import ADMIN_BOT_USERNAME
# ------------------------------------------------------------ #
START_TXT = """
**ʜᴇʟʟᴏ** {},
**<blockquote>ɪ'ᴍ ᴀᴅᴇᴘᴛ ᴀᴛ ᴇxᴛʀᴀᴄᴛɪɴɢ ᴏɴʟɪɴᴇ ᴄᴏᴜʀsᴇs ᴡɪᴛʜ ᴄᴜᴛᴛɪɴɢ-ᴇᴅɢᴇ ᴛᴇᴄʜɴᴏʟᴏɢʏ. ɪ'ᴠᴇ ᴍᴀɴᴀɢᴇᴅ ᴛᴏ ɢᴀᴛʜᴇʀ ʟɪɴᴋs ғᴏʀ ᴀʟᴍᴏsᴛ ᴀʟʟ ᴀᴠᴀɪʟᴀʙʟᴇ ᴄᴏᴜʀsᴇs, ᴍᴀᴋɪɴɢ ᴛʜᴇ ᴘʀᴏᴄᴇss ᴇғғᴏ... | Python | 1 |
class Solution:
def countHillValley(self, nums: List[int]) -> int:
coun = 0
skip = []
n = len(nums)
for i in range(1,n-1):
if(i in skip):
continue
left = i
while(left >0 and nums[left] == nums[i]):
left -=1
... | Python | 1 |
FromStr,
};
const detect_step: usize = 100;
#[derive(Default)]
pub struct Response {
pub status: StatusCode,
pub headers: Option<HashMap<String, String>>,
pub body: Option<Vec<u8>>,
}
impl Response {
pub fn body_to_string(&self) -> Result<Cow<str>, Box<dyn Error>> {
match &self.body {
... | Rust | 0 |
tialEq, Eq)]
pub struct LogEntry {
pub address: Address,
pub topics: Vec<H256>,
pub data: Vec<u8>,
}
impl rlp::Decodable for LogEntry {
fn decode(rlp: &rlp::Rlp) -> Result<Self, rlp::DecoderError> {
let result = LogEntry {
address: rlp.val_at(0usize)?,
topics: rlp.list_a... | Rust | 0 |
�️♂️", "");
pub static SPARKLES: Emoji = Emoji("✨ ", "");
pub static SWIRL: Emoji = Emoji("🌀 ", "");
pub static UP: Emoji = Emoji("🆙 ", "");
pub static WARN: Emoji = Emoji("⛔ ", "");
pub static WAVING: Emoji = Emoji("👋 ", "");
pub static WORKER: Emoji = Emoji("👷 ", "");
<reponame>smurawski/compose_yml<filename>sr... | Rust | 0 |
{
continue;
}
hash_set.insert(slot);
bitfield.insert(slot);
}
let max = slot + 1;
let mut time = Measure::start("");
let mut count = 0;
for slot in (min - 10)..max + 100 {
i... | Rust | 0 |
usize = 10;
type Fischlin =
FischlinTransform<DualProofOfExponentSigmaProtocol<G1Affine>, Sha3_256>;
fn file<P: AsRef<Path>>(path: P) -> File {
OpenOptions::new()
.append(true)
.create(true)
.open(path)
.unwrap()
}
fn main() {
let mut skip = match args().skip(1).next().ma... | Rust | 0 |
# backend/run_entry.py
import threading, time, webbrowser, socket
import uvicorn
from app import app # your FastAPI instance
HOST = "127.0.0.1"
PORT = 8000
URL = f"http://{HOST}:{PORT}/"
def _port_is_free(host: str, port: int) -> bool:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
return ... | Python | 1 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import logging
import threading
from enum import Enum
class CommandType(Enum):
# in
Initialize = b'IN'
RequestTrialJobs = b'GE'
ReportMetricData = b'ME'
UpdateSearchSpace = b'SS'
ImportData = b'FD'
AddCustomizedTrial... | Python | 1 |
Ok(args) =>
{
if rl.helper().unwrap().borrow_mut().cmdline( args )
{
break;
}
}
, Err(err) =>
{
println!(... | Rust | 0 |
> 1 {
// 香を打つ手を生成
te_top[*te_num as usize] = Te::from_4(0, to, s_or_e | KomaInf::KY, KomaInf::EMP);
*te_num += 1;
}
if self.hand[(s_or_e | KomaInf::KE) as usize] > 0 && dan > 2 {
te_top[*te_num as usize] = Te::from_4(0, to, s_or_e | KomaInf::KE, KomaInf::... | Rust | 0 |
nu,
m,
arglat,
truelon,
lonper,
}
}
pub(crate) fn datetime_to_gstime(d: DateTime<Utc>) -> c_double {
let jd = datetime_to_julian_day(d);
unsafe { gstime(jd) }
}
pub(crate) struct GravitationalConstants {
pub tumin: c_double,
pub mu: c_double,
pub radiusearthkm: ... | Rust | 0 |
import paddle
import paddle.nn as nn
def bmc_loss(pred, target, noise_var):
"""Compute the Balanced MSE Loss (BMC) between `pred` and the ground truth `targets`.
Args:
pred: A float tensor of size [batch, 1].
target: A float tensor of size [batch, 1].
noise_var: A float number or tensor.
... | Python | 1 |
if self.regs_used[i] == false {
self.regs_used[i] = true;
return i;
}
}
panic!("No registers availbale");
}
/// create temp register
pub fn register_push_temp(&mut self) -> usize{
let value = self.new_register();
self.registers.pus... | Rust | 0 |
# Code generated by Lark OpenAPI.
import lark_oapi as lark
from lark_oapi.api.mail.v1 import *
def main():
# 创建client
client = lark.Client.builder() \
.app_id(lark.APP_ID) \
.app_secret(lark.APP_SECRET) \
.log_level(lark.LogLevel.DEBUG) \
.build()
# 构造请求对象
request: Cr... | Python | 1 |
Which HFCLK192M source is running"]
pub hfclk192mstat: HFCLK192MSTAT,
_reserved41: [u8; 180usize],
#[doc = "0x514 - Clock source for HFCLK"]
pub hfclksrc: HFCLKSRC,
#[doc = "0x518 - Clock source for the LFCLK"]
pub lfclksrc: LFCLKSRC,
_reserved43: [u8; 60usize],
#[doc = "0x558 - HFCLK f... | Rust | 0 |
ược cung cấp ở đầu mỗi query của người dùng. Câu hỏi của người dùng nằm ở cuối.
2. Nếu người dùng hỏi câu hỏi không liên quan đến CLB ProPTIT, hãy trả lời như bình thường, nhưng không sử dụng thông tin từ context
3. Trình bày câu trả lời rõ ràng, dễ hiểu. Có thể sử dụng emoij icon khi cần.
4. Tuyệt đối khô... | Python | 1 |
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: location/v1/location.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import List
import betterproto
from .ou import v1
from .provider import v1
@dataclass
class RegionResource(betterproto.Message):
resource_id... | Python | 1 |
{
let mut attrs = HashMap::new();
attrs.insert(
pkcs11::CKA_CLASS,
Attr::from_ck_object_class(pkcs11::CKO_PRIVATE_KEY),
);
attrs.insert(
pkcs11::CKA_KEY_TYPE,
Attr::from_ck_key_type(pkcs11::CKK_RSA),
);
attrs.insert(pkcs11:... | Rust | 0 |
: u32);
}
extern "C" {
#[doc = " @brief Set the real CPU ticks per us to the ets, so that ets_delay_us will be accurate."]
#[doc = " Call this function when CPU frequency is changed."]
#[doc = ""]
#[doc = " @param uint32_t ticks_per_us : CPU ticks per us."]
#[doc = ""]
#[doc = " @retur... | Rust | 0 |
#[traced_test]
#[tokio::test]
async fn test_split_coin() -> Result<(), anyhow::Error> {
let (_network, mut context, address) = setup_network_and_wallet().await?;
let object_refs = context.gateway.get_owned_objects(address).await?;
// Check log output contains all object ids.
let gas = object_refs.first... | Rust | 0 |
() {
let target = env::var("TARGET").expect("getting target");
let libdir = match env::var("FLYCAP_LIBDIR") {
Ok(dir) => dir,
Err(_) => {
match target.as_ref() {
"x86_64-pc-windows-msvc" | "x86_64-pc-windows-gnu" => {r"C:\Program Files\Point Grey Research\FlyCapture2... | Rust | 0 |
, 1, 1);
m.set(0, 2, 2);
m.set(1, 2, 1);
let clustering = dbscan.perform_clustering(&m);
assert_eq!(clustering[0], Some(0));
assert_eq!(clustering[1], Some(0));
assert_eq!(clustering[2], Some(0));
}
#[test]
fn test_points_that_do_not_belong_to_any_cluster_a... | Rust | 0 |
#[derive(Copy, Clone)]
pub struct Owned(());
impl <'a> ::capnp::traits::Owned<'a> for Owned { type Reader = Reader<'a>; type Builder = Builder<'a>; }
impl <'a> ::capnp::traits::OwnedStruct<'a> for Owned { type Reader = Reader<'a>; type Builder = Builder<'a>; }
impl ::capnp::traits::Pipelined for Owned { type Pi... | Rust | 0 |
for a in 0..size {
s8k.push(s8.insert(a));
}
s8
},
|i| {
for a in i.iter() {
black_box(a);
}
},
BatchSize::SmallInput,
);
});
g.bench_funct... | Rust | 0 |
::Index<Atom> for AtomTable {
type Output = str;
fn index(&self, index: Atom) -> &Self::Output {
self.str(index)
}
}
impl std::ops::Index<AtomU16> for AtomTable {
type Output = [u16];
fn index(&self, index: AtomU16) -> &Self::Output {
self.str_u16(index)
}
}
#[cfg(test)]
mod ... | Rust | 0 |
# 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 use ... | Python | 1 |
IdentityModule::add_attribute(
Origin::signed(2),
"prasad".as_bytes().to_vec(),
"name".as_bytes().to_vec(),
"<NAME>".as_bytes().to_vec()
),
Error::<Test>::NotAuthorized
);
// Attribute value should be blank
assert_eq!(IdentityModule::get_attribute((identity, "name".as_bytes().to_vec(... | Rust | 0 |
from .codec_manager import CodecManager
from .input_handler import InputHandler
def encode(input_path: str, output_path: str, codec_name: str, **codec_options):
"""
High-level function to encode a video. This is the primary entry point
for using this package as a library.
Args:
input_path (str... | Python | 1 |
B--
T--A-- <=> B--A--
| | | |
"""
if verbosity>0:
print("ENV: init_from_ipeps_pbc")
# Left-upper corner
#
# i(-1) = C--2(+1),3(-1)->1(-1)
# (-1)j--A*--4(-1) 0(+1),1(-1)->0(-1)
# /\(-1)
# (-1)3 m
# \(+1) i(+1)
# ... | Python | 1 |
def test_get(session, service):
from dispatch.service.service import get
t_service = get(db_session=session, service_id=service.id)
assert t_service.id == service.id
def test_create(session, project):
from dispatch.service.service import create
from dispatch.service.models import ServiceCreate
... | Python | 1 |
rvice())
.await
.unwrap();
}
}
<gh_stars>100-1000
use super::*;
bitflags! {
pub struct VMPerms : u32 {
const NONE = 0x0;
const READ = 0x1;
const WRITE = 0x2;
const EXEC = 0x4;
const DEFAULT = Self::READ.bits | Self::... | Rust | 0 |
import numpy as np
import pymesh
def preprocess_mesh(input_mesh, prevent_nonmanifold_edges=True):
r"""Removes duplicated vertices, duplicated faces, zero-area faces, and
optionally faces the insertion of which would cause an edge of the mesh to
become non-manifold. In particular, an iteration is performed... | Python | 1 |
)?,
)
.map(|csp_response| Response::from(&csp_response))?)
}
}
mod verify {
use super::*;
use crate::sign::threshold_sig::dkg::shared_utils::key_for_node_id;
pub fn verify_response<C: DistributedKeyGenerationCspClient, D: DealingsToCspDealings>(
dkg_csp_client: &C,
... | Rust | 0 |
(doubled, (0..10000).map(|x| x*2).collect::<Vec<_>>());
}
}use itertools::Itertools;
fn find_first_invalid_number(numbers: &[u64], preamble_length: usize) -> Option<u64> {
numbers.windows(preamble_length + 1).find_map(|window| {
let (last, preamble) = window.split_last()?;
let valid = preamble
... | Rust | 0 |
gle Diffy/Ackermann Mode]
else:
if abs(x) <= JOY_DEADZONE and abs(y) <= JOY_DEADZONE:
robot.driveSpeed = 0
else:
setDirection(angle)
robot.driveSpeed = speed*14
if abs(turn) > JOY_DEADZONE:
... | Python | 1 |
_universe,
&prioQ,
&per_real_reg,
&edit_list_move,
&edit_list_other,
&vlr_env,
&frag_env,
);
}
// ======== BEGIN Do spill slot coalescing ========
debug!("");
info!("alloc_main: create spills_n_reloads for MOVE insns");
... | Rust | 0 |
sclk cycles"]
CYCLES24,
#[doc = "2: 32 sclk cycles"]
CYCLES32,
}
impl From<CLK_WORD_SIZE_A> for u8 {
#[inline(always)]
fn from(variant: CLK_WORD_SIZE_A) -> Self {
match variant {
CLK_WORD_SIZE_A::CYCLES16 => 0,
CLK_WORD_SIZE_A::CYCLES24 => 1,
CLK_WORD_SIZ... | Rust | 0 |
5:
{
"Room List": {
"0": "bedroom",
"1": "bedroom",
"2": "bedroom",
"3": "bedroom",
"4": "bathroom",
"5": "bathroom",
"6": "livingroom",
"7": "kitchen",
"8": "diningroom",
"9": "circulation"
},
"Adjacency List": [(0, 4), (1, 5), (2, 5), (3, 5), (0, 9), (1, 9), (2, 9), (3, ... | Python | 1 |
_suite = Some(group_cipher_suite);
i += 4;
if (i + 2) > len {
return rsn;
}
let pairwise_cipher_suite_count = LittleEndian::read_u16(&bytes[i..(i + 2)]);
i += 2;
for _ in 0..pairwise_cipher_suite_count {
if (i + 4) > len {
return rsn;
}
let pairwise_... | Rust | 0 |
}
fn album_artist(&self) -> Option<&str> {
self.inner.album_artist()
}
fn set_album_artist(&mut self, v: &str) {
self.inner.set_album_artist(v)
}
fn remove_album_artist(&mut self) {
self.inner.remove_album_artist();
}
fn album_cover(&self) -> Option<Picture> {
... | Rust | 0 |
# =================================================================
# =========== Generates all PST900 dataset results ================
# Written by Neil Rodrigues & Shreyas S. Shivakumar
# =================================================================
# Specifically for evaluation of FastSCNN
# Please follow... | Python | 1 |
class Solution:
def findCenter(self, edges: List[List[int]]) -> int:
x = edges[0][0]
y = edges[0][1]
z = edges[1][1]
w = edges[1][0]
if x == z or x == w:
return x
return y
"""
in O(1) time and space complexity
x = edges[0][0]
y = edges[0]... | Python | 1 |
();
let report_ty = ReportTy::Input;
let report_id = 0;
let orbital_socket = File::open("display:input").expect("Failed to open orbital input socket");
let mut pressed_keys = Vec::<u8>::new();
let mut last_pressed_keys = pressed_keys.clone();
loop {
std::th... | Rust | 0 |
_GUI}{LB_ALT}{LS_CTL}{QT_SFT} n]
[n ~ '`' | Bslash n n ')' '}' ']' '"' n]
[n n t t BSpace Space Enter Delete t t n n]
[n n t t t {LAYER} {LAYER} t t t ... | Rust | 0 |
# Copyright (c) 2019 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 app... | Python | 1 |
};
game_board.play_move(&mv2);
let mv3 = GoMove::Move{x: 1, y: 1, player: State::Black};
game_board.play_move(&mv3);
assert_eq!(game_board.evaluate(), 1.0);
}
}
use std::fs::File;
use std::io::Read;
use fallible_iterator::FallibleIterator;
use postgres::{self, Client, NoTls, types::... | Rust | 0 |
# -*- coding: utf-8 -*-
from __future__ import annotations
import datetime as dt
import numpy as np
import pandas as pd
from feature_base import BaseFeature, FeatureContext
def _rth(df): return df.between_time("09:30", "15:59")
class TurningPointRateClose(BaseFeature):
name = "turning_point_rate_close"
descri... | Python | 1 |
"x",
"one",
"--label",
"y",
"two",
"--",
"bash",
tmp_path / "script.sh",
],
)
# Verify the wrapper executed successfully
assert result.exit_code == 0
# Check that the metrics file exists and contains both stand... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.