text string | label_name string | labels int64 |
|---|---|---|
_match(
hash_algo: HashingAlgorithm,
pcr_data: &PcrData,
attestation: Attest,
) -> Result<bool> {
let pcr_data = Vec::<TPML_DIGEST>::try_from(pcr_data.clone())?;
let quote_info = match attestation.attested() {
AttestInfo::Quote { info } => info,
_ => {
return Err(KeylimeE... | Rust | 0 |
| MIPS | `$0` or `$zero` | This is a constant zero register which can't be modified. |
| MIPS | `$1` or `$at` | Reserved for assembler. |
| MIPS | `$26`/`$k0`, `$27`/`$k1` | OS-reserved registers. |
| MIPS | `$28`/`$gp` | Global pointer cannot be used as inputs or outputs. |
| MIPS | `$ra` | Return address cannot be us... | Rust | 0 |
# flake8: noqa: F401
# Contexts and bounds by name
from carl.envs.brax.carl_ant import CONTEXT_BOUNDS as CARLAnt_bounds
from carl.envs.brax.carl_ant import DEFAULT_CONTEXT as CARLAnt_defaults
from carl.envs.brax.carl_ant import CARLAnt
from carl.envs.brax.carl_fetch import CONTEXT_BOUNDS as CARLFetch_bounds
from carl.e... | Python | 1 |
Self { c, d, d1, d2 }
}
pub fn open<Q1: Point, Q2: Point>(
&self,
b: Commitment<Q1>,
c: Commitment<Q2>,
nonce: Scalar,
) -> bool {
let q1 = Q1::hash(NOTHING_UP_MY_SLEEVE_Q1);
let q2 = Q2::hash(NOTHING_UP_MY_SLEEVE_Q2);
let d1 = Q1::generator()... | Rust | 0 |
is_some() && body.node_id.unwrap().id != nid {
error!(
"Join Cluster Request body node_id {} does not match path {}, which is used",
body.node_id.unwrap().id, nid
);
}
info!("received register node request for node {:?}:{:?}", nid, body);
let connect_cmd = ConnectNo... | Rust | 0 |
from generate_ppt import Generate_ppt
#coding:utf-8
# 加载已有的PPT模板
ppt_path = "source/ppt_model/1.百廿红-李一.pptx"
generate_ppt = Generate_ppt(ppt_path)
generate_ppt.add_cover("这是标题", "这是作者", "2021年5月")
menu_items = ["目录1", "目录2", "目录3", "目录4"]
generate_ppt.add_menu("source/img/image22.jpg", 3, menu_items)
generate_ppt.add_m... | Python | 1 |
from django.shortcuts import render, redirect, get_object_or_404
from . import models
from .form import EmployeeForms
from .models import Employee
def employeeForm(request, id=0):
if request.method == 'GET':
if id == 0: # Criação de um novo registro
form = EmployeeForms()
else: # Edi... | Python | 1 |
details.push(indent(&format!("{}: {}", key, s)));
} else {
details.push(indent(&format!("{}: {}", key, stringified)));
}
} else {
extras.push(format!("{}={}", key, stringified));
}
}
let formatted_details = if details.len() > 0 {
format... | Rust | 0 |
# 错误次数+1
self.err += 1
# 用f字符串格式化错误类型和错误信息,提供更多的调试信息
print(
f'{time.strftime("%Y-%m-%d_%H-%M-%S")} login:页面加载或元素操作失败,错误类型:{type(e).__name__}, 详细错误信息:{str(e).split("Stacktrace:")[0]}'
)
... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
# Array from .csv
arra=np.genfromtxt('https://raw.githubusercontent.com/marcoreps/multiinstrumentalist/master/csv/20210920-105659_3458A_INL.csv',delimiter=',',skip_header=1)
# Columns to lists
F5700A = [row[0] for row in arra]
HP3458A = [row[1] for row in arra]
PPMde... | Python | 1 |
info!(root_log, "Failed to unmount {:?}: {}", target, e);
}
} else {
let output = Command::new("fusermount").arg("-u").arg(&target).output()?;
if !output.status.success() {
info!(
... | Rust | 0 |
screen_width, screen_height, 1, crate::types::vec4(0.0, 0.0, 0.0, 0.0))?);
copy_program = Some(program::Program::from_source(&gl,
include_str!("shaders/copy.vert"),
include_str!("shaders/copy.frag"))?);
... | Rust | 0 |
s = vec![CustomBlockConfig::new(drive_id.clone(), true, None, true)];
insert_block_devices(&mut vmm, &mut cmdline, event_manager, block_configs);
// Add net device.
let network_interface = NetworkInterfaceConfig {
iface_id: String::from("netif"),
host_dev_name: String::f... | Rust | 0 |
import numpy as np
from omegaconf import DictConfig
import torch
import torch.nn.functional as F
from ....abstract.explainer import Explainer
from ...utils.utils import build_counterfactual_graph_gc
from torch_geometric.utils import k_hop_subgraph
from torch_geometric.data import Data
class EgoExplainer(Explainer):
... | Python | 1 |
import os
from dataclasses import dataclass
from typing import Dict, List, Optional
from dotenv import load_dotenv
from loguru import logger
# 加载.env文件
load_dotenv()
@dataclass
class MonitorConfig:
# 驱动模式:webhook/telegram
driver_type: str
@dataclass
class TelegramConfig:
"""Telegram配置"""
api_id:... | Python | 1 |
rams,
options=options,
),
)
async def reject_async(
self,
account: str,
params: "AccountService.RejectParams",
options: RequestOptions = {},
) -> Account:
"""
With [Connect](https://stripe.com/connect), you can reject accounts ... | Python | 1 |
/// use tokio::io::AsyncWriteExt;
///
/// # #[tokio::main(flavor = "current_thread")]
/// # async fn test () {
/// let mut decoded = "hello world";
/// let mut encoded: Vec<u8> = vec![];
///
/// {
/// let mut encoder = Encoder::with_chunks_size(&mut encoded, 5);
/// encoder.write_all(decoded.as_bytes()).await;... | Rust | 0 |
Collect for DisplayProperty<'gc> {
fn needs_trace() -> bool {
false
}
}
/// The map from key/index to function pointers for special display object properties.
#[derive(Collect)]
#[collect(no_drop)]
pub struct DisplayPropertyMap<'gc>(PropertyMap<DisplayProperty<'gc>>);
impl<'gc> DisplayPropertyMap<'gc... | Rust | 0 |
_levels = AccessLevels {
map: access_levels.map.iter()
.map(|(&k, &v)| (tcx.hir.local_def_id(k), v))
.collect()
};
let send_trait = if crate_name == Some("core".to_string()) {
clean::path_to_... | Rust | 0 |
fn call(&mut self, req: Request<Body>) -> Self::Future {
let mut detox = self.clone();
let resp = async move {
let resp = detox.process(req).await;
tracing::trace!("response {:?}", resp);
let out = match resp {
Err(ref error) => make_error_response(er... | Rust | 0 |
from pydantic import BaseModel, Field
from fastapi import Header, Depends, APIRouter, HTTPException
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from sqlalchemy.orm import Session
from database import get_db
import requests
from models import LUsers
from datetime import datetime, timedelta
from... | Python | 1 |
import requests, json, sys, zipfile, io, os
import pandas as pd
def set_identity(name):
identity = {"name": name}
with open("identity.json", "w") as f:
json.dump(identity, f, ident = 4)
def load_identity():
try:
with open("identity.json", "r") as f:
identity = json.load(f)
... | Python | 1 |
//
// The precondition also ensures that we are the only one accessing
// `self` at the moment so replacing is fine.
unsafe {
let _ = mem::replace(&mut *ptr, Some(value));
}
// SAFETY: With the call to `mem::replace` it is guarant... | Rust | 0 |
type Err = ParseFixedError;
/// Parses a string slice containing decimal digits to return a fixed-point number.
///
/// Rounding is to the nearest, with ties rounded to even.
#[inline]
fn from_str(s: &str) -> Result<Self, Self::Err> {
F::wrapping_from_str(s).map(Wrapping)
}
}
macro_rul... | Rust | 0 |
CHANGE_SUCCESSFUL, RDW_INTERNALPAINT,
},
},
System::{
Com::{
CoCreateInstance, CoInitializeEx, CoUninitialize, CLSCTX_ALL, COINIT_APARTMENTTHREADED,
},
Ole::{OleInitialize, RegisterDragDrop},
},
UI::{
Input::{
KeyboardAndMouse::{
... | Rust | 0 |
},
Ok(_) => println!("unknown request id"),
Err(_) => println!("error assigning request id"),
}},
_ => {
// subscriptions
println!("no id field found in response. must be subscription");
println!... | Rust | 0 |
_key_public = PKey::from_rsa(Rsa::from_public_components(
root_key_rsa.n().to_owned()?,
root_key_rsa.e().to_owned()?,
)?)?;
let root_key = PKey::from_rsa(root_key_rsa.clone())?;
let new_subject = get_cert_subject()?;
let random_numbers = get_random_big_number()?;
let not_before = Utc... | Rust | 0 |
# -*- coding: utf-8 -*-
import ccxt.pro
from asyncio import gather, run
async def symbol_loop(exchange, method, symbol):
print('Starting', exchange.id, method, symbol)
while True:
try:
response = await getattr(exchange, method)(symbol)
now = exchange.milliseconds()
... | Python | 1 |
antizationPreset.PERFORMANCE, inplace_statistics=False)
statistics_aggregator = PT2StatisticsAggregator(dataset)
wrapped_model: GraphModelWrapper = wrap_model(model, input_data, True)
statistic_points = min_max_algo.get_statistic_points(wrapped_model.model, wrapped_model.get_graph())
statistics_aggrega... | Python | 1 |