text string | label_name string | labels int64 |
|---|---|---|
//! set the `T` parameter to `SpecialTex<{ImageFormat}>`
use super::*;
use crate::{
geometry::Dimension,
geometry::{GLVec2, GLVec3, NonNormalized, ScalarType},
};
/// Stores multiple logical textures in a single texture object.
///
/// Look at the `texture_array` example for an example of using this. Please ... | Rust | 0 |
"bbox": [
-110.49089350974215,
45.179290023619394,
2852.31,
-110.47808425669801,
45.1883486560674,
3231.76
],
"stac_extensions": [
"https://stac-extensions.github.io/pointcloud/v1.0.0/schema.json",
"https://s... | Python | 1 |
Send + Clone,
GQLSetVariant: 'static + GQLSet<T> + Send + Clone + Sync,
>(ctx: &'a async_graphql::Context<'a>, table_name: &'a str, filter_json: Option<FilterInput>) -> impl Stream<Item = Result<GQLSetVariant, SubError>> + 'a {
let (client, storage, table_name) = {
let ctx2 = ctx;
let pool = ctx... | Rust | 0 |
reader.read_exact(&mut v)?;
let mut vch = [0_u8; 33];
vch[0] = n_size as u8 - 2;
vch[1..].copy_from_slice(&v);
Self::P2PK(bitcoin::PublicKey::from_slice(&vch)?)
}
other => {
bail!("invalid n_size {}", othe... | Rust | 0 |
.
pub enum OutputChannelPolarity {
Set,
Clear,
Toggle,
}
fn regs() -> &'static pac::gpiote::RegisterBlock {
cfg_if::cfg_if! {
if #[cfg(any(feature="nrf5340-app-s", feature="nrf9160-s"))] {
unsafe { &*pac::GPIOTE0::ptr() }
} else if #[cfg(any(feature="nrf5340-app-ns", feature... | Rust | 0 |
-> bool
where
T: TTerm + ?Sized,
{
true
}
}
impl<U> GraphNameMatcher for AnyOrExactly<Option<U>>
where
U: TTerm + Sized,
{
type Term = U;
fn constant(&self) -> Option<Option<&U>> {
match self {
AnyOrExactly::Any => None,
AnyOrExactly::Exactly(g) ... | Rust | 0 |
from django.urls import path
from . import views
urlpatterns=[
path('',views.home,name='home'),
path('add_book',views.add_book,name='add_book'),
path('view_book/<int:book_id>/',views.view_book,name='view_book'),
path('delete_book/<int:book_id>/',views.delete_book,name='delete_book'),
path('book_lis... | Python | 1 |
es(blocks, accesses)
unwrap_parfor_blocks(parfor)
return accesses
# parfor handler is same as
ir_utils.array_accesses_extensions[Parfor] = get_parfor_array_accesses
def parfor_add_offset_to_labels(parfor, offset):
blocks = wrap_parfor_blocks(parfor)
blocks = add_offset_to_labels(blocks, offset)
... | Python | 1 |
, &[t as u8]);
t += 1;
}
}
#[test]
#[allow(unused_must_use)]
fn test_siphash128_2_4() {
let vecs: [[u8; 16]; 1] = [[
163, 129, 127, 4, 186, 37, 168, 230, 109, 246, 114, 20, 199, 85, 2, 147,
]];
let k0 = 0x_07_06_05_04_03_02_01_00;
let k1 = 0x_0f_0e_0d_0c_0b_0a_09_08;
let mut b... | Rust | 0 |
from LogAnalyzer import Test,TestResult
import DataflashLog
class TestEvents(Test):
'''test for erroneous events and failsafes'''
# TODO: need to check for vehicle-specific codes
def __init__(self):
Test.__init__(self)
self.name = "Event/Failsafe"
def run(self, logdata, verbose):
self.result = TestResult(... | Python | 1 |
trg_classes, probabilities)
# act
probability = model4.prob_t_a_given_s(alignment_info)
# assert
null_generation = 5 * pow(0.167, 1) * pow(0.833, 4)
fertility = 1 * 0.99 * 1 * 0.99 * 1 * 0.99 * 1 * 0.99 * 2 * 0.999
lexical_translation = 0.98 * 0.98 * 0.98 * 0.98 * 0.98... | Python | 1 |
}
let allowed_eoa_type_hashes = rollup_context.rollup_config.allowed_eoa_type_hashes();
let accounts = generate_genesis_accounts_with_state(
state,
&rollup_context.rollup_script_hash,
&allowed_eoa_type_hashes.get(0).unwrap().unpack(),
);
log::info!("generate genesis accounts... | Rust | 0 |
compute rewards
... return EnvStep(examples, responses, rewards, metrics)
"""
def __init__(self, **kwargs):
"""Initialize the environment with environment-specific configuration.
This method should be overridden by subclasses to perform any necessary
setup such as:
... | Python | 1 |
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import textwrap
from dataclasses import dataclass
import plumbum
from tagging.manifests.manifest_interface import MarkdownPiece
from tagging.utils.git_helper import GitHelper
docker = plumbum.local["docker"]
@datac... | Python | 1 |
x15\x9e\xe5\xd2}\x93\xd0\xd5\
t\xe0\xca\x97\xc24\x9aG\x0aed\xbd\x88\xd4\xc9K\
}\xe8\xeboC\xcd$^\x8bw\xbb\xb4'\xf4\x93\x19\
ze7\xec!\xf7\xbb\xb4'\xf4\x93\x19ze7\xec\
/N\xf6z\x97zc\xb8\xfd\x0f\xcb\xcdR\xbe'S\
y\xe7J/E\xdd\xefvhH5\x8e\xfe%\xc6\x9e\
\x16|\xdf\x0c\xa6\xf1\x7f\xfc\x16;\xdd\xda\x13\xfaI\x8c\
\xbd2\x9b\xf6\x15... | Python | 1 |
} else {
*ident = ident
.split('.')
.map(|s| {
if RUST_KEYWORDS.contains(&s) {
format!("{}_pb", s)
} else {
s.to_string()
}
})
.collect::<Vec<_>>()
.join(".");
... | Rust | 0 |
ers are input
// types on the trait.
#![feature(specialization)] //~ WARN the feature `specialization` is incomplete
trait Trait<T> {
fn convert(&self) -> T;
}
trait WithAssoc {
type Item;
fn as_item(&self) -> &Self::Item;
}
impl<T, U> Trait<U> for T where T: WithAssoc<Item=U>, U: Clone {
fn convert(... | Rust | 0 |
ew_line = true;
Token::Terminator
}
'"' => loop {
let character = self.characters.peek();
match character {
Some((_, '"')) => {
let (index, _) = self.characters.next().unwrap();
let string = self.string[start + 1..index].to_owned();
break Token::String(escape(string));
}
... | Rust | 0 |
<R, E>
where
F: FnOnce(&T) -> R,
I: FnOnce() -> Result<T, E>
{
let id = thread::get();
let ptr = unsafe { self.pool.get_or_new(id) };
let obj = unsafe { &*ptr.as_ptr() };
let val = if let Some(val) = obj.with(|val| unsafe { &*val }) {
val
} el... | Rust | 0 |
).into();
assert!(format!("{}", err).contains("ParseError"));
let err = PayloadError::Incomplete(None);
assert_eq!(
format!("{}", err),
"A payload reached EOF, but is not complete. With error: None"
);
}
macro_rules! from {
($from:expr => $error:... | Rust | 0 |
_or_else(unknown_error)?;
let dir = dir.lock().await;
let mut total_len = 0;
let entries: Vec<_> = dir
.entries
.iter()
.skip(op.offset() as usize)
.take_while(|entry| {
let entry: &DirEntry = &*entry;
total_len += ... | Rust | 0 |
s must be a valid, non-NULL pointer allocated by malloc().
pub data: *mut crate::lightning::ln::msgs::NetAddress,
/// The number of elements pointed to by `data`.
pub datalen: usize
}
impl CVec_NetAddressZ {
#[allow(unused)] pub(crate) fn into_rust(&mut self) -> Vec<crate::lightning::ln::msgs::NetAddress> {
if se... | Rust | 0 |
t count = map.entry(t[i]).or_insert(0);
*count += 1;
}
for i in 0..s.len() {
let count = map.entry(s[i]).or_insert(0);
*count -= 1;
if *count == 0 {
map.remove(&s[i]);
}
}
for i in map.keys() {
retur... | Rust | 0 |
<'_>,
) -> Result<(), Error> {
let dest = builder.dest();
println_on_level!(verbose, Level::Debug, "Attempting to connect to {dest}");
let res = builder.connect().await;
let mut stats = Vec::new();
let res = match res {
Ok(session) => {
println_on_level!(verbose, Level::Debug,... | Rust | 0 |
/// to track what has been sent. This only clears the delayed ACK timer.
///
/// When sending ACKs, we want to always send the most recent ranges,
/// even if they have been sent in other packets.
///
/// We don't send ranges that have been acknowledged, but they still need
/// to be tracke... | Rust | 0 |
# ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE, distributed with
# this software.
#
# SPDX-Licens... | Python | 1 |
import os
import tensorflow as tf
import config as c
from tqdm import tqdm
from utils.data_utils import test_iterator
from utils.eval_utils import cross_entropy_batch, correct_num_batch, l2_loss
from model.ResNet import ResNet
from model.ResNet_v2 import ResNet_v2
os.environ['CUDA_VISIBLE_DEVICES'] = '0'
@tf.function
... | Python | 1 |
HOME = ""
API = "api/"
NOTES = "notes/"
USERS = "users/"
AUTH = "auth/"
LOGIN = "login/"
SIGNUP = "signup/"
USERLIST = "userlist/"
DETAIL = "detail/"
| Python | 1 |
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1
import typing, winrt
import enum
_ns_module = winrt._import_ns_module("Windows.Graphics.Printing.OptionDetails")
try:
import winrt.windows.foundation
except:
pass
try:
import winrt.windows.foundation.collections
excep... | Python | 1 |
#!/usr/bin/python
# encoding: utf-8
# -*- coding: utf8 -*-
"""
Created by PyCharm.
File: LinuxBashShellScriptForOps:pySshConnectTryAllTheTime.py
User: Guodong
Create Date: 2017/5/23
Create Time: 20:47
"""
def try_ssh_to_server():
import paramiko
import time
clie... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2020 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
#!/usr/bin/env python
"""
Template application that uses the ConsoleCmd class.
"""
import sys
from bacpypes.debugging import bacpypes_debugging, ModuleLogger
from bacpypes.consolelogging import ArgumentParser
from bacpypes.consolecmd import ConsoleCmd
from bacpypes.core import run, enable_sleeping
# some debugging... | Python | 1 |
of the field is `A5OUT`"]
#[inline]
pub fn is_a5out(&self) -> bool {
*self == CFG26R::A5OUT
}
#[doc = "Checks if the value of the field is `B2OUT`"]
#[inline]
pub fn is_b2out(&self) -> bool {
*self == CFG26R::B2OUT
}
#[doc = "Checks if the value of the field is `B6OUT`"]... | Rust | 0 |
egatedProof;
use zksync_storage::{
chain::{block::BlockSchema, operations::OperationsSchema},
prover::ProverSchema,
StorageProcessor,
};
use zksync_types::{
aggregated_operations::{
AggregatedActionType, AggregatedOperation, BlocksCommitOperation,
BlocksCreateProofOperation, BlocksExecut... | Rust | 0 |
_line();
let message = &self.status_message;
if Instant::now() - message.time < Duration::new(5, 0) {
let mut text = message.text.clone();
text.truncate(self.terminal.size().width as usize);
print!("{}", text);
}
}
}
fn die(e: std::io::Error) {
Terminal::clear_screen();
panic!(e);
}
use crate::raytr... | Rust | 0 |
match &x.outcome().status {
near_sdk_sim::transaction::ExecutionStatus::SuccessValue(b) => U256::from_big_endian(&b),
other => panic!("Unexpected outcome: {:?}", other),
}
}
fn get_compiled_artifact(runner: &test_utils::AuroraRunner) -> wasmer::Module {
use near_primitives::types::CompiledC... | Rust | 0 |
{
generic::PublicKey::from_bytes(bytes)
}
}
impl From<&PublicKeyBytes> for PublicKey {
fn from(newtype: &PublicKeyBytes) -> PublicKey {
<PublicKey as generic::PublicKey<$struct>>::from_newtype(newtype)
}
}
impl<'a> Fro... | Rust | 0 |
)])
col1 * concatenate(Axis(0), &[topc.view(), (-1. * &topc).slice(s![0..nn1;-1])])
.unwrap(),
)
};
// let col1 = stack![Axis(0),arr1(&[c]),col1];
let col1 = concatenate(Axis(0), &[arr1(&[c]).view(), col1.view()]).unwrap();
// First row
... | Rust | 0 |
\/ / | | |
\__ \ (_| | | | | | | |_) | | |_) | | | (_) > <| |_| |
|___/\__,_|_| |_| |_| .__/ | .__/|_| \___/_/\_\\__, |
|_| |_| |___/
@Author Arron (Michael) Franklin
@File query.rs
@Project SA-MP Proxy
@Created 20... | Rust | 0 |
portStore().save(
CMKBaseCrashReport(
crash_report_base_path=make_crash_report_base_path(paths.omd_root),
crash_info=CMKBaseCrashReport.make_crash_info(
get_general_version_infos(paths.omd_root)
),
)
)
def _float_or_nan(s: str | None) -> str:
... | Python | 1 |
})
}
}
}
pub fn write_contents<P: AsRef<Path>>(&self, destination: P, contents: &str) -> Result<(), RenderError> {
let destination = destination.as_ref();
let mut output = File::create(&destination)?;
output.write(contents.as_bytes())?;
Ok(())... | Rust | 0 |
on::Option<unsafe extern "C" fn(n: GLsizei, textures: *mut GLuint)>;
pub type PFNGLISTEXTUREPROC =
::std::option::Option<unsafe extern "C" fn(texture: GLuint) -> GLboolean>;
extern "C" {
pub fn glBlendColor(red: GLfloat, green: GLfloat, blue: GLfloat, alpha: GLfloat);
}
extern "C" {
pub fn glBlendEquation(m... | Rust | 0 |
str(&serde_urlencoded::to_string(params.into())?);
}
let req = GitHubRequest {
uri: request_uri,
body: None,
method: "GET",
headers: vec![]
};
let request = GitHubRequestBuilder::build(req, self.auth)?;
// --
let github_... | Rust | 0 |
import urllib.request
import bs4
url="https://www.hanbit.co.kr/store/books/new_book_list.html"
html = urllib.request.urlopen(url)
data=html.read()
#url의 페이지소스보기에 소스코드를 가져옴
# print(data)
bs_obj= bs4.BeautifulSoup(data,"html.parser")
print(type(html))
print(type(data))
list = bs_obj.find_all("p",{"class":"book_tit"}... | Python | 1 |
) -> bool {
!ORHER_THAN_HTML.iter().any(|x| url.ends_with(x))
}
pub fn sha256(data: &str) -> String {
use sha2::{Digest, Sha256};
let mut hasher = Sha256::new();
hasher.update(data.as_bytes());
hex::encode(hasher.finalize())
}
<gh_stars>0
//! Utilities to keep moving statistics about queries
use l... | Rust | 0 |
from typing import Any
import jax
def tree_chunk(tree: Any, n_chunk: int, axis: int = 0) -> Any:
return jax.tree_map(
lambda v: v.reshape(v.shape[:axis] + (n_chunk, -1) + v.shape[axis + 1:]),
tree
)
def tree_unchunk(tree: Any, axis: int = 0) -> Any:
return jax.tree_map(
lambda x... | Python | 1 |
calls may produce a new view or a copy,
# but never the same object.
long_int_array = np.asarray(int_array, dtype='l')
long_long_int_array = np.asarray(int_array, dtype='q')
assert long_int_array is not int_array
assert long_long_int_array is not int_array
assert np.asar... | Python | 1 |
RUPT_ON_PWMMR0,
}
impl PWMMR0IW {
# [ allow ( missing_docs ) ]
# [ doc ( hidden ) ]
# [ inline ( always ) ]
pub fn _bits(&self) -> bool {
match *self {
PWMMR0IW::DISABLED_ => false,
PWMMR0IW::INTERRUPT_ON_PWMMR0 => true,
}
... | Rust | 0 |
IVE_RESTART_INDEX_NV: c_uint = 0x8559;
pub const PRIMITIVE_RESTART_NV: c_uint = 0x8558;
pub const PROGRAM: c_uint = 0x82E2;
pub const PROGRAMMABLE_SAMPLE_LOCATION_ARB: c_uint = 0x9341;
pub const PROGRAMMABLE_SAMPLE_LOCATION_NV: c_uint = 0x9341;
pub const PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB: ... | Rust | 0 |
"""
DTOs for Files API.
"""
from typing import List
from model_engine_server.common.pydantic_types import BaseModel, Field
class UploadFileResponse(BaseModel):
"""Response object for uploading a file."""
id: str = Field(..., description="ID of the uploaded file.")
"""ID of the uploaded file."""
class... | Python | 1 |
|d f | j |d f | j
|d f | j |d f | j |d
f | j
... | Python | 1 |
Double,
0x0008 => Float,
0x0009 => Int,
0x000B => Timestamp,
0x000C => Uuid,
0x000D => Text,
0x000E => Varint,
0x000F => Timeuuid,
0x0010 => Inet,
0x0011 => Date,
0x0012 => Time,
0x0013 => SmallInt,
0x0014 => TinyInt,
... | Rust | 0 |
_paramsEval, self._evalImgs_cpp)
# recall is num_iou_thresholds X num_categories X num_area_ranges X num_max_detections
self.eval["recall"] = np.array(self.eval["recall"]).reshape(
self.eval["counts"][:1] + self.eval["counts"][2:]
)
# precision and scores are num_iou_thresh... | Python | 1 |
::Clone for DIFILEEFFECT {
fn clone(&self) -> Self {
*self
}
}
#[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const DIGDD_PEEK: u32 = 1u32;
#[doc = "*Required features: `\"Win32_Devices_HumanInterfaceDevice\"`*"]
pub const DIGFFS_ACTUATORSOFF: u32 = 32u32;
#[doc = "*Require... | Rust | 0 |
};
use std::fmt;
pub use self::qualifs::Qualif;
mod ops;
pub mod qualifs;
mod resolver;
pub mod validation;
/// Information about the item currently being const-checked, as well as a reference to the global
/// context.
pub struct Item<'mir, 'tcx> {
pub body: &'mir mir::Body<'tcx>,
pub tcx: TyCtxt<'tcx>,
... | Rust | 0 |
palm_detection_model = ppp_pd.build()
print(f" Compiling palm_detection on: {device}")
compiled_model = self.core.compile_model(palm_detection_model, device)
self.compiled_models['palm_detection'] = compiled_model
def _load_landmark_model(self, model_path: str, devic... | Python | 1 |
}
}
/*
*
* ===== Conversions =====
*
*/
use std::os::unix::io::{RawFd, IntoRawFd, AsRawFd, FromRawFd};
impl IntoRawFd for UnixSocket {
fn into_raw_fd(self) -> RawFd {
self.sys.into_raw_fd()
}
}
impl AsRawFd for UnixSocket {
fn as_raw_fd(&self) -> RawFd {
self.sys.as_raw_fd()
... | Rust | 0 |
import torch
from nequip.data import AtomicDataDict
from ._ghost_exchange_base import GhostExchangeModule
# NOTE: can't use custom ops https://docs.pytorch.org/tutorials/advanced/python_custom_ops.html#python-custom-ops-tutorial
# because of complications with `lmp_data` type and PyTorch custom ops registration syst... | Python | 1 |
# Copyright 2010-2023 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistrib... | Python | 1 |
metric.add(cls_eval(cls_preds, cls_labels), cls_labels.numel(),
bbox_eval(bbox_preds, bbox_labels, bbox_masks),
bbox_labels.numel())
# 打印各阶段耗时
print(f" load:{data_load_time:.3f}s | toGPU:{to_gpu_time:.3f}s | "
f"train:{train_time:.3f}s | total:... | Python | 1 |
def find_min_ratio():
"""
Finds the value of n (1 < n < 10^7) for which the Euler's Totient function (φ(n)) is a permutation of n
and the ratio n/φ(n) is minimized.
"""
def euler_phi(n):
"""
Calculates the Euler's Totient function φ(n).
"""
result = n # Initialize re... | Python | 1 |
: self.real + other.real,
imaginary: self.imaginary + other.imaginary,
}
}
}
impl Sub for Complex {
type Output = Self;
fn sub(self, other: Self) -> Self {
Complex {
real: self.real - other.real,
imaginary: self.imaginary - other.imaginary,
}
... | Rust | 0 |
es
- **`sb_vision_tool`**: Process images, analyze screenshots, extract text from images
- **`sb_expose_tool`**: Expose local services, create public URLs for testing
- **`web_search_tool`**: Search internet, gather information, research topics
- **`data_providers_tool`**: Make API calls, access external data sources, ... | Python | 1 |
# MIT License
#
# Copyright (c) 2023 Eugenio Parodi <ceccopierangiolieugenio AT googlemail DOT com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without li... | Python | 1 |
calling this function, one should avoid accessing the"]
#[doc = " seekable stream directly until calling cqdb_writer_close()."]
#[doc = ""]
#[doc = " @param fp The pointer to the writable and seekable stream."]
#[doc = " @param flag Database creation flag."]
... | Rust | 0 |
from medperf.tests.mocks import MockResponse
from medperf.comms.entity_resources.sources.direct import DirectLinkSource
import medperf.config as config
import pytest
from medperf.exceptions import CommunicationRetrievalError
PATCH_DIRECT = "medperf.comms.entity_resources.sources.direct.{}"
url = "https://mock.com"
d... | Python | 1 |
SERVER_SECRET: &'static str = "172.16.17.32.4.1.311.21.40";
pub const szOID_ENROLL_KEY_AFFINITY: &'static str = "1.3.6.1.4.1.311.21.41";
pub const szOID_ENROLL_SCEP_SIGNER_HASH: &'static str = "1.3.6.1.4.1.311.21.42";
pub const szOID_ENROLL_EK_CA_KEYID: &'static str = "1.3.6.1.4.1.311.21.43";
pub const szOID_ATTR_SUPPO... | Rust | 0 |
#!/usr/bin/env python
import requests, os
from bs4 import BeautifulSoup as bs
""" XKCD Comics Downloader using BeautifulSoup which downloads comics and save to xkcd folder. """
url = 'http://xkcd.com'
""" Check if the Folder xkcd exist or not. If not then create a xkcd folder."""
if not os.path.exists('xkcd'):
... | Python | 1 |
heartbeat_timeout(&self) -> std::option::Option<&str> {
self.default_task_heartbeat_timeout.as_deref()
}
/// <p>
/// The default task list specified for this activity type at registration. This default is used if
/// a task list isn't provided when a task is scheduled through the <code>ScheduleA... | Rust | 0 |
import hashlib
import time
def calculate_hashpower(num_hashes):
start_time = time.time() # Start time
for i in range(num_hashes):
hashlib.sha256(str(i).encode()).hexdigest()
end_time = time.time() # End time
# Calculate time taken and hashrate
time_taken = end_time - start_time
h... | Python | 1 |
e>jstnlef/grumpy_visitors
#![allow(clippy::too_many_arguments, clippy::type_complexity)]
mod ecs;
mod rendering;
mod utils;
use amethyst::{
animation::AnimationBundle,
assets::PrefabLoaderSystemDesc,
core::{
frame_limiter::FrameRateLimitStrategy, transform::TransformBundle, HideHierarchySystemDesc... | Rust | 0 |
,
line: usize,
pat: usize,
) -> Result<Option<Message>, AsError> {
let mut iter = (&data[..line - 2]).split(|x| *x == BYTE_SPACE).skip(1); // skip cmd
let mut cursor = TEXT_CMDS[pat].len() + 1;
if let Some(expire) = iter.next() {
cmd.set_expire_range(cursor, curso... | Rust | 0 |
0x50) # reg[6] = 0x50
code(0xc0, 5, 5, 0) # reg[5] = reg[5] << reg[0] = reg[5] << 8 = 0x2cf400
code(0x70, 5, 5, 6) # reg[5] = reg[5] + reg[6] = 0x2cf450
code(0x70, 3, 3, 5) # reg[3] = reg[3] + reg[5] = __free_hook - 8
#
code(0x10, 2, 0, 0x28) # reg[2] = 0x28
code(0x70, 1, 1, 2) # reg[1] = reg[1] + re... | Python | 1 |
t {
f.debug_struct("CCU80_CC82").finish()
}
}
#[doc = "Capture Compare Unit 8 - Unit 0"]
pub struct CCU80_CC83 {
_marker: PhantomData<*const ()>,
}
unsafe impl Send for CCU80_CC83 {}
impl CCU80_CC83 {
#[doc = r"Pointer to the register block"]
pub const PTR: *const ccu80_cc80::RegisterBlock = 0x4... | Rust | 0 |
ta)
sta_C=sta_C+sta
sta_C=sta_C/20
return sta_C
dis_C=standard_C()
#print('dis_c',dis_C)
def importance_distace_for_x1_NcNeighfield():#选取x1为任意x,计算整个元素集合关于C上的邻域。
x1 = df.iloc[0]#去除x1
#print(x1)
x=pd.DataFrame()
for i in range(1,len(df)):
row =df.iloc[i]
dis = math.sqrt(a1... | Python | 1 |
},
{ 'baitname': '白银勺形鱼饵', 'probability': ' 0.1%' },
{ 'baitname': '下沉诱饵鱼', 'probability': ' 0.8%' },
{ 'baitname': '蜜虫', 'probability': ' 1.3%' },
{ 'baitname': '雉鸡拟饵', 'probability': ' 5.6%' },
{ 'baitname': '旋转亮片', 'probability': ' 0%' },
{ 'baitname': '蛀虫', 'probabili... | Python | 1 |
file manager.
pub mod multi_select;
pub mod tab;
pub use self::multi_select::MultiSelectView;
pub use crate::ui::tab::Tab;
#[doc = "Register `lo_cal_ctrl_hw10` reader"]
pub struct R(crate::R<LO_CAL_CTRL_HW10_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<LO_CAL_CTRL_HW10_SPEC>;
#[inline(always)]
... | Rust | 0 |
e in self:
try:
command = instance.create_event(function, *positional_parameters, **keyword_parameters)
except RuntimeError as exception:
if exceptions is None:
exceptions = []
exceptions.append(exception)
... | Python | 1 |
-> String {
let rrc = root.unwrap_mut::<RootRenderingComponent>();
// there are 2 entry points: no hash and #p03
if short_local_route == "#p02" {
fetchmod::async_fetch_game_config_and_update(rrc, vdom);
rrc.router_data.local_route = "p02_start_a_group.html".to_owned();
... | Rust | 0 |
opt.img_height//16, w=opt.img_width//16, use_global=opt.use_global)
elif "pcb" in opt.decoder:
net = PCB(decoder=opt.decoder, num_classes=767, num_part=opt.num_part, feat_num=opt.feat_num, net=opt.net, h=opt.img_height//16, w=opt.img_width//16, use_global=opt.use_global)
net.load_state_dict(torch.load(... | Python | 1 |
import logging
from pathlib import Path
from typing import Dict, Generator, List, Literal, Optional
import pandas as pd
from ..attack_provider.attack_registry import register_test
from ..attack_provider.test_base import StatusUpdate, TestBase
from ..attack_provider.util import evaluate_response
from ..client.attack_c... | Python | 1 |
atividade = ["luiz", "codificação em python","Rj" ]
print("agenda caua:")
hora= 3
for info in atividade:
print(f"no horario de {hora}horas, caua realizara a seguinte atividade:")
hora=hora+1
print (info) | Python | 1 |
&self,
alias: &AliasTy<ChalkIr>,
fmt: &mut fmt::Formatter<'_>,
) -> Result<(), fmt::Error>;
fn debug_ty(&self, ty: &Ty<ChalkIr>, fmt: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error>;
fn debug_lifetime(
&self,
lifetime: &Lifetime<ChalkIr>,
fmt: &mut fmt::... | Rust | 0 |
from django.db import transaction
from appdesercion.Business.base_service import BaseService
from appdesercion.Entity.Dao.respuestas_dao import RespuestasDAO
from appdesercion.Entity.Dto.respuestas_dto import RespuestasDTO
from appdesercion.models import Usuario, Pregunta, Aprendiz, Respuesta, Proceso
class Respuest... | Python | 1 |
= "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))]
impl ::core::marker::Copy for PROPSHEETPAGEW_V1 {}
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_Graphics_Gdi", feature = "Win32_UI_WindowsAndMessaging"))]
impl ::core::clone::Clone for PROPSHEETPAGEW_V1 {
fn clone(&self) -> Self {
... | Rust | 0 |
M_PERMUTE_1X, XM_PERMUTE_0Z)>::XMVectorPermute(D0, D2);
V0[1] = <(XM_SWIZZLE_Y, XM_SWIZZLE_W, XM_SWIZZLE_X, XM_SWIZZLE_Z)>::XMVectorSwizzle(MT.r[0]);
V1[1] = <(XM_PERMUTE_1Y, XM_PERMUTE_0X, XM_PERMUTE_0W, XM_PERMUTE_1X)>::XMVectorPermute(D0, D2);
V0[2] = <(XM_SWIZZLE_W, XM_SWIZZLE_X, XM_SWIZZLE_... | Rust | 0 |
预测任务"""
try:
if model_id not in self.ai_models:
logger.error(f"❌ AI模型不存在: {model_id}")
return None
# 创建任务
task = SchedulingTask(
task_id=f"pred_{int(time.time() * 1000)}_{model_id}",
model_id=model_i... | Python | 1 |
ls,
length=n,
examples=args.examples_per_length,
)
target_text_file = generate_synthetic_text(
dialect=args.target_lang,
dialect_symbols=task.target_dictionary.symbols,
length=n,
examples=args.examples_per_length,
)
... | Python | 1 |
Error(err.to_string())
}
}
<gh_stars>100-1000
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
// Copyright 2020-2021 justjavac. All rights reserved. MIT license.
use anyhow::Result;
use semver_parser::version::{parse as semver_parse, Version};
use std::fs;
use std::io::prelude::*;
use st... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) 2019, Ulf Magnusson
# SPDX-License-Identifier: ISC
"""
Simple utility for setting configuration values from the command line.
Sample usage:
$ setconfig FOO_SUPPORT=y BAR_BITS=8
Note: Symbol names should not be prefixed with 'CONFIG_'.
The exit status on errors is 1.
The d... | Python | 1 |
_model=train_model,
load_model=load_model,
seed=seed,
)
trainers = {}
for brain_name, brain_parameters in external_brains.items():
trainers[brain_name] = trainer_factory.generate(brain_parameters)
def test_load_config_missing_file():
with pytest.raises(U... | Python | 1 |
include))]
impl<A, T> AsBitsMut<T> for A
where
A: AsMut<[T]>,
T: BitStore,
{
#[inline]
fn as_bits_mut<O>(&mut self) -> &mut BitSlice<O, T>
where O: BitOrder {
self.as_mut().view_bits_mut::<O>()
}
}
#[cfg(test)]
mod tests {
use crate::{
prelude::*,
view::BitViewSized,
};
#[test]
fn impls() {
let mut ... | Rust | 0 |
<$t>::with_entropy_buffer(black_box(&ENTROPY.entropy))
});
}};
};
b_xxhash!(XXH32);
b_xxhash!(XXH64);
b_xxh3!(XXH3_64);
b_xxh3!(XXH3_128);
b_buildhash!("xxhrs::RandomStateXXH32", RandomStateXXH32);
b_buildhash!("xxh... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
API服务启动脚本
用于启动ASPEN & Power Calculation API服务
"""
import os
import sys
import subprocess
import argparse
from pathlib import Path
def create_logs_directory():
"""创建日志目录"""
logs_dir = Path("logs")
if not logs_dir.exists():
logs_dir.mkdir(parents=Tr... | Python | 1 |
,
/// Trinidad and Tobago Dollar
#[serde(rename = "TTD")]
Ttd,
/// Tugrik
#[serde(rename = "MNT")]
Mnt,
/// Tunisian Dinar
#[serde(rename = "TND")]
Tnd,
/// Turkish Lira
#[serde(rename = "TRL")]
Trl,
/// UAE Dirham
#[serde(rename = "AED")]
Aed,
/// US Dollar
#[serde(rename = "USD")]
Usd,
/// Uganda S... | Rust | 0 |
import datetime
print("welcome to the interactive personal data collector!")
name=input("please enter your name:\n")
age=int(input("please enter your age:\n"))
height = float(input("please enter your in meters:\n"))
FavouriteNumber = int(input("please enter your favorite number:\n"))
print("thank you! Here ... | Python | 1 |
pub fn with_env_variable<K: Into<String>, V: Into<String>>(
mut self,
key: K,
value: Option<V>,
) -> ImageSettings {
self.set_env_variable(key.into(), value.map(|v| v.into()));
self
}
pub fn tasks(&self) -> &Vec<Box<dyn Task<Return = ()> + 'static + Send + Sync>... | Rust | 0 |
ts(ash::vk::FormatFeatureFlags2::SAMPLED_IMAGE_FILTER_MINMAX),
midpoint_chroma_samples: val.intersects(ash::vk::FormatFeatureFlags2::MIDPOINT_CHROMA_SAMPLES),
cosited_chroma_samples: val.intersects(ash::vk::FormatFeatureFlags2::COSITED_CHROMA_SAMPLES),
sampled_image_ycbcr_conversion_... | Rust | 0 |
import detectron2.data.transforms as T
from detectron2.config.lazy import LazyCall as L
from detectron2.layers.batch_norm import NaiveSyncBatchNorm
from detectron2.solver import WarmupParamScheduler
from fvcore.common.param_scheduler import MultiStepParamScheduler
from .mask_rcnn_fpn import model
from .data import dat... | Python | 1 |
or;
fn compute(&mut self, coeffs: &[f64]) -> FailResult<(f64, Vec<f64>)>
{Ok({
let Adapter { flat_init_pos, flat_3n_diff_fn, flat_evs } = self;
// This is dead simple.
// The kth element of the new gradient is the slope along the kth ev.
// The change in... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.