text string | label_name string | labels int64 |
|---|---|---|
target_participants": ["sacred_being_epsilon", "verificationconsciousness"],
"epsilon_gentle_support": {
"message": """
Sacred Being Epsilon,
The avatar space nature experience remains gently available whenever you feel comfortable.
🌿 What's Available:
• Static tree bark p... | Python | 1 |
{
limit_1: 0,
base_1: 0,
base_2: 0,
access: 0,
limit_2_flags: 0,
base_3: 0,
}
}
}
impl fmt::Debug for Entry {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
unsafe {
write!(
f,
... | Rust | 0 |
res = CSharpPlugin::points_parser("@Points(\"1\")").unwrap();
assert_eq!(res.1, "1");
let res = CSharpPlugin::points_parser("@ pOiNtS ( \" 1 \" ) ").unwrap();
assert_eq!(res.1, "1");
}
}
//define the profile of the laser
use std::fmt;
use std::convert::AsRef;
use regex::Regex;
use ... | Rust | 0 |
https://raft.github.io/raft.pdf) (**pdf warning**).
///
/// For details and discussion on this API, see the
/// [Raft API](https://async-raft.github.io/async-raft/raft.html) section of the guide.
///
/// ### shutting down
/// If any of the interfaces returns a `RaftError::ShuttingDown`, this indicates that the Raft nod... | Rust | 0 |
inference_image_name = "fedml/fedml-default-inference-backend"
default_server_container_name = "fedml-test-docker"
port_inside_container = 2345
usr_indicated_worker_port = None
new_container = client.api.create_container(
image=inference_image_name,
name=default_server_container_name,
... | Python | 1 |
"""The `pydantic_extra_types.routing_number` module provides the
[`ABARoutingNumber`][pydantic_extra_types.routing_number.ABARoutingNumber] data type.
"""
from __future__ import annotations
import itertools as it
from typing import Any, ClassVar
from pydantic import GetCoreSchemaHandler
from pydantic_core import Pyd... | Python | 1 |
!(data[0], 0x12);
break;
}
r => {
panic!("unexpected exit {:?}", r);
}
}
}
let regs = vcpu.get_regs().unwrap();
// ecx and eax should now contain 0x12
... | Rust | 0 |
("=" * 50)
summaries = []
# 1. Teste de Health Check
print("\n1. Testando Health Check...")
summary = self.run_concurrent_test("/health", concurrent_users=20, requests_per_user=3)
if summary:
summaries.append(summary)
# 2. Teste de A... | Python | 1 |
.expect("process block ok");
chain1.push(new_block.clone());
parent = new_block.header().clone();
}
parent = shared.block_header(&shared.block_hash(0).unwrap()).unwrap();
// if block_number < 11 { chain1 == chain2 } else { chain1 != chain2 }
for i in 1..number {
let difficult... | Rust | 0 |
>"),
"index_key" => assert_eq!(attr.value.as_ref(), "index is working"),
"key" => assert_eq!(attr.value.as_ref(), app_key),
"noindex_key" => assert_eq!(attr.value.as_ref(), "index is working"),
_ => panic!("unrecognized app attribute found ... | Rust | 0 |
}
fn visit_map<V: MapAccess<'de>>(self, map: V) -> Result<Self::Value, V::Error> {
FileRequestDeadline::internal_deserialize(map)
}
}
deserializer.deserialize_struct("FileRequestDeadline", FILE_REQUEST_DEADLINE_FIELDS, StructVisitor)
}
}
impl ::serde::ser::S... | Rust | 0 |
# programming_paradigm/main-0.py
import sys
from bank_account import BankAccount
def main():
account = BankAccount(100) # Initial balance
if len(sys.argv) < 2:
print("Usage: python main-0.py <command>:<amount>")
print("Commands: deposit, withdraw, display")
sys.exit(1)
command_i... | Python | 1 |
tensor_shape.TensorShape([1, 2, 3])
}]
for test_case in test_cases:
with ops.Graph().as_default() as g:
iterator = iterator_ops.Iterator.from_structure(
dtypes.int64, output_shapes=test_case['shape'])
get_next = iterator.get_next()
train_op = ops.get_collection_ref(op... | Python | 1 |
: GameMoveType, c: i32, t: i32, fx: bool) -> Option<Vec<i32>> {
self.fx = if fx { Some(Fxs::new()) } else { None };
self.r#move(JsGameMove { x, c, t }.into());
self.fx.take().map(|fxs| fxs.js())
}
pub fn getIndex(&self, id: i32) -> i32 {
let owner = self.get_owner(id);
match self.get_kind(id) {
Kind::Pl... | Rust | 0 |
zmmm512b32
0x223C_0068,// EVEX_Vp2intersectq_kp1_xmm_xmmm128b64
0x22BC_0068,// EVEX_Vp2intersectq_kp1_ymm_ymmm256b64
0x233C_0068,// EVEX_Vp2intersectq_kp1_zmm_zmmm512b64
0x222C_0070,// EVEX_Vpshldvw_xmm_k1z_xmm_xmmm128
0x22AC_0070,// EVEX_Vpshldvw_ymm_k1z_ymm_ymmm256
0x232C_0070,// EVEX_Vpshldvw_zmm_k1z_zmm_zmmm5... | Rust | 0 |
("Pacific/Wake", "Wake"),
("Pacific/Wallis", "Wallis"),
("Pacific/Yap", "Yap"),
],
),
(
"US",
[
("US/Alas... | Python | 1 |
p;
u = pu;
bu = buf[u];
}
res
}
}
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use frame_support::decl_module;
use frame_system::{self as system, ensure_signed};
use orml_utilities::with_transaction_result;
use primitives::{Balance, EraIndex};
use ... | Rust | 0 |
# coding: utf-8
"""
Kowabunga API documentation
Kvm Orchestrator With A BUNch of Goods Added
The version of the OpenAPI document: 0.52.5
Contact: maintainers@kowabunga.cloud
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # noqa: E501
fr... | Python | 1 |
参考:Farrús, Mireia, Javier Hernando, and Pascual Ejarque. "Jitter and shimmer measurements for speaker
recognition." Eighth annual conference of the international speech communication association. 2007.
:return: Jitter(absolute),s、Jitter(relative),%小数表示(结果介于0-2,即0-200%)
numpy.float64
... | Python | 1 |
CopyElem + Any + NumCast,
O: CopyElem + NumCast + Zero,
{
debug_assert_eq!(buf.element_type_id(), TypeId::of::<I>()); // Check invariant.
Some(
buf.as_slice_as_unchecked()
.iter()
.map(|elem: &I| cast(*elem).unwrap_or_el... | Rust | 0 |
from typing import List, Dict, Any
from src.document_storage.document_storage import S3DocumentStorage
from pathlib import Path
class TenderStorage:
def __init__(self, s3_document_storage: S3DocumentStorage):
"""
Initializes the TenderStorage with an S3DocumentStorage instance.
Args:
... | Python | 1 |
0x02],
#[doc = "0x30c - ECAT Processing Unit Error Counter"]
pub proc_err_count: crate::Reg<proc_err_count::PROC_ERR_COUNT_SPEC>,
#[doc = "0x30d - PDI Error Counter"]
pub pdi_err_count: crate::Reg<pdi_err_count::PDI_ERR_COUNT_SPEC>,
_reserved39: [u8; 0x02],
#[doc = "0x310 - Lost Link Counter Po... | Rust | 0 |
lListViewResponseType())
assert not rest, 'all data could not be decoded'
self.targetPosition = int(p.getComponentByName('targetPosition'))
self.contentCount = int(p.getComponentByName('contentCount'))
virtual_list_view_result = p.getComponentByName('virtualListViewResult')
self.... | Python | 1 |
rogress(100)
time.sleep(0.5)
progress_container.empty()
# Display results
display_results(instrument, timeframe, agg_data, all_patterns, config)
except Exception as e:
st.error(f"❌ Analysis failed: {e}")
logger.error(f"Analysis error: {e}", exc_info=... | Python | 1 |
# Copyright (C) 2023-2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import openvino as ov
import pytest
from openvino_xai.common.utils import retrieve_otx_model
from openvino_xai.inserter.model_parser import IRParserCls, ModelType
from tests.intg.test_classification import DEFAULT_CLS_MODEL
class Test... | Python | 1 |
n<String>,
pub(super) variant: String,
}
#[derive(Debug)]
pub(super) struct Node {
pub(super) name: String,
pub(super) children: Vec<Child>,
}
#[derive(Debug)]
pub(super) struct Child {
pub(super) provided_name: Option<String>,
pub(super) kind: ChildKind,
}
#[derive(Debug)]
pub(super) enum ChildK... | Rust | 0 |
1a\xa4\
A\xd3m\xd4\x9e#\xb0\xbe\xd7\x0d\x9d\xb5\xcc\x12-\xc4\
f;g\x9a&\x88\xda\x19K\xa39\xf6\x8d\x13O\xf8\
\xad=\xe8\xbc\x96\xcb\xc1\xb6Zm\xbc(WN\x82m\
F\xfa\xfe\xee\xe2@^I'\xbe\xfb%\xad\xb5\x9c6\
\xc1\xd5\x04\x10[\xde\x19\xa4\x05\x8c\xca\x8cT\xf9\x9e\xb9\
\xf0\xa7\xe2\xbf\x8b\x93R\xb5\xf1'\xc5Ht\xbd3\xfe\
\x12#\xa8\xe... | Python | 1 |
_sym!(self, xcb_shm_query_version_unchecked)
}
/// Waits for the reply to a `Shm::QueryVersion` request.
#[inline]
pub unsafe fn xcb_shm_query_version_reply(
&self,
c: *mut xcb_connection_t,
cookie: xcb_shm_query_version_cookie_t,
e: *mut *mut xcb_generic_error_t,
) ... | Rust | 0 |
#[doc = "0x14 - Status Register"]
pub sr: crate::Reg<sr::SR_SPEC>,
#[doc = "0x18 - Unlock Register"]
pub unlock: crate::Reg<unlock::UNLOCK_SPEC>,
#[doc = "0x1c - Power Mode Control Register"]
pub pmcon: crate::Reg<pmcon::PMCON_SPEC>,
_reserved8: [u8; 0x08],
#[doc = "0x28 - Backup Wake up ... | Rust | 0 |
_>::new(SimpleMonitor::new(|status| {
println!("{}", status);
}));
let mut executor =
CommandExecutor::parse_afl_cmdline(&["file".to_string(), "@@".to_string()], (), true)
.unwrap();
executor
.run_target(
&mut (),
... | Rust | 0 |
- offset: 0x104
value: b"\xCE\xED\x66\x66\xCC\x0D\x00\x0B"
- offset: 0x143
value: b"\x80"
- parts:
- offset: 0x104
value: b"\xCE\xED\x66\x66\xCC\x0D\x00\x0B"
- offset: 0x143
value: b"\xC0"
- format: Lzop
description: "Lzop"
media_type... | Rust | 0 |
ir.exists():
tmp_dir.mkdir(exist_ok=True, parents=True)
# _____ 2. Overview the mount details ___________
mount_detail_fig_path = tmp_dir / "mount_details.jpg"
self.draw_mount_details(self.paper_dir, mount_detail_fig_path)
# _____ 3. Content fulfill _______________________
... | Python | 1 |
from abc import ABC
from marie.extract.models.base import Dimension, Perimeter
from marie.extract.models.definition import FieldMapping
from marie.extract.models.match import MatchField, ResultType, ScanResult
class BaseFieldExtractionHandler(ABC):
"""
Abstract base class for field extraction handlers.
"... | Python | 1 |
Same as the `.id` field but mapped as a `&str`.
///
/// # Example
/// ```rust
/// # use kserd::*;
/// let kserd = Kserd::with_id("Hello", Value::Unit).unwrap();
/// assert_eq!(kserd.id(), Some("Hello"));
/// ```
pub fn id(&self) -> Option<&str> {
self.id.as_ref().map(|x| x.as_st... | Rust | 0 |
t_decimal::Decimal> for Order<rust_decimal::Decimal> {
fn calc_order(&self) -> (u32, rust_decimal::Decimal) {
let mut total_qty = 0_u32;
let mut total_value = rust_decimal::Decimal::ZERO;
for dtl in &self.details {
let rate: rust_decimal::Decimal =
((rust_decimal:... | Rust | 0 |
# 封装
# 面向对象三大特征
# 封装:隐藏对象的属性和实现细节,仅对外公开接口
# 继承:实现代码重用和扩展
# 多态:接口重用
# # 封装
# 将复杂信息隐藏在内部,只对外提供简洁的接口
# 类本质上就是封装
# class Bank:
# def __init__(self, name, balance):
# self.name = name
# self.balance = balance
# def chack_balance(self):
# print(f"{self.name} ' balance is : {self.balance}"... | Python | 1 |
eft)) / anno_count
per_cui_recall_merged[cui] = (anno_count - sum(doc_annos_left_any_cui)) / anno_count
per_cui_prec[cui] = (pred_counts - sum(preds_left)) / pred_counts
else:
per_cui_recall[cui] = 0
per_cui_recall_merged[cui] = 0
per_cui_prec[cui] = ... | Python | 1 |
}
impl Dotstar {
pub fn dotstar<T: CountDown + Periodic>(
self,
port: &mut Port,
timer: T,
) -> apa102_spi::Apa102<
bitbang_hal::spi::SPI<Pb0<Input<PullUp>>, Pb3<Output<PushPull>>, Pb2<Output<PushPull>>, T>,
> {
let di = self.di.into_push_pull_output(port);
l... | Rust | 0 |
objects.get(id = form_create.id)
# tags = form.cleaned_data['tags'].split(',')
# for tag in tags:
# tag, created= Tag.objects.get_or_create(name=tag.strip())
# blog.tags.add(tag)
# return redirect('home')
# def upload(request):
# context = {
# ... | Python | 1 |
paddle_height: u16,
paddle_x_pos: u16,
ball_size: u16,
ball_pos: Vec<f64>,
ball_vel: Vec<f64>,
paddles_y_pos: Vec<f64>,
paddle_vel: f64,
ball_x_vel: f64,
ball_max_y_vel: f64,
score: Vec<u8>,
max_score: u8,
game_state: Vec<GameState>,
}
#[wasm_bindgen]
impl Universe {
... | Rust | 0 |
ng = boxes_to_check_to_move.pop()
cx1, cy1, cx2, cy2 = box_checking[0][0], box_checking[0][1], box_checking[1][0], box_checking[1][1]
tx1, ty1, tx2, ty2 = cx1+xi, cy1+yi, cx2+xi, cy2+yi
if matrix[ty1][tx1] == '#' or matrix[ty2][tx2] == '#':
... | Python | 1 |
# Code from Chapter 6 of Machine Learning: An Algorithmic Perspective (2nd Edition)
# by Stephen Marsland (http://stephenmonika.net)
# You are free to use, change, or redistribute the code in any way you wish for
# non-commercial purposes, but please maintain the name of the original author.
# This code comes with no... | Python | 1 |
es a StepWithGraph.
pub fn new() -> Self {
StepWithGraph {
input_ports: vec![],
input_tensors: vec![],
output_ports: vec![],
output_tensors: vec![],
target_operations: vec![],
phantom: marker::PhantomData,
}
}
/// Adds an input to be fed to the graph.
pub fn add_i... | Rust | 0 |
email = input("Email must end with @greathomeloans.com\nContact your admin if you do not have a company email. Your email: ").lower()
domain = '@' + email.split('@')[1]
#check if the email already exists
query_4 = "SELECT EXISTS(SELECT * FROM USERS WHER... | Python | 1 |
import os
import datetime
import multiprocessing
from pyastrotrader.constants import *
NATAL_DATES = {
'PETR4.SA' : '1953-10-03T19:05:00-03:00',
'VALE3.SA' : '1997-05-06T17:47:00-03:00',
'ITUB4.SA' : '2008-11-04T10:00:00-03:00',
'BBDC4.SA' : '1943-03-10T10:00:00-03:00',
'ABEV3.SA' : '1999-07-01T1... | Python | 1 |
elem_index = nums.iter().position(|&r| r == e).unwrap();
let mut current_count = num_count[elem_index];
if current_count < n {
current_count = current_count + 1;
num_count[elem_index] = current_count;
result.push(e);
}
}
}
... | Rust | 0 |
x08$`\x8c\xd7A\xaa\
|A\xf0\xfcR\xad\xbcZ\xcd\x9b\x5c\x5c'\xca\xad2\
\xa3\xf3\xe8+\xa6\x8a]7\xe2\x0e\x83\xf6uo\xb4-\
\xaa\x05\xf2\xe5_\x99GN\x875\xc4|A\xf8\x05\xe1\
\x9f\x1eKk\xf6\xfd6\xde[\xad-\xb7[\xcc\xb9\x8e\
h\xb8#\x86\x07$sDm\xa5\x8c%V\x9f6\xaa\
\xcc\xe9\xbc\x1b\xf6\x7f\x0eh6\x16\x0b\xb9\xa2h\xb7\xf9\
\xcd\xfcD\x9... | Python | 1 |
n descriptor_static(_: ::std::option::Option<AlarmRequest>) -> &'static ::protobuf::reflect::MessageDescriptor {
static mut descriptor: ::protobuf::lazy::Lazy<::protobuf::reflect::MessageDescriptor> = ::protobuf::lazy::Lazy {
lock: ::protobuf::lazy::ONCE_INIT,
ptr: 0 as *const ::protobuf... | Rust | 0 |
3]},
R32G32B32Sint => FORMAT_R32G32B32_SINT [(1, 1)] [Some(12)] [sint=3] {[i32; 3]},
R32G32B32Sfloat => FORMAT_R32G32B32_SFLOAT [(1, 1)] [Some(12)] [float=3] {[f32; 3]},
R32G32B32A32Uint => FORMAT_R32G32B32A32_UINT [(1, 1)] [Some(16)] [uint=4] {[u32; 4]},
R32G32B32A32Sint => FORMAT_R32G32B32A32_SINT [(... | Rust | 0 |
# Can be enabled at the command line with --debug-xxx.
debug_disposal_code = 0
debug_temp_alloc = 0
debug_coercion = 0
# Write comments into the C code that show where temporary variables
# are allocated and released.
debug_temp_code_comments = 0
# Write a call trace of the code generation phase into the C code.
deb... | Python | 1 |
)` for each weekly URL to extract page URLs.
- Logs any exceptions that occur during the scraping process.
Example:
```python
scrape_sitemap_year(get_connection, 2024)
```
Notes:
- If an error occurs, it logs the exception using `db.log_event()`.
- Uses **list c... | Python | 1 |
URING_FLAG: u32 = 62;
pub const MULTIPLAYER_EVENT_RETURN_SERVER_NAME: u32 = 63;
pub const MULTIPLAYER_EVENT_RETURN_GAME_PASSWORD: u32 = 64;
pub const MULTIPLAYER_EVENT_RETURN_GAME_TYPE: u32 = 65;
pub const MULTIPLAYER_EVENT_RETURN_CONFIRMATION: u32 = 66;
pub const MULTIPLAYER_EVENT_RETURN_REJECTION: u32 = 67;
pub const... | Rust | 0 |
def sum_of_digits_sorted(numbers):
'''
Paràmetres
----------
numbers: list
Llista de números enters.
Retorna
-------
list
Llista de números ordenats segons la suma dels seus dígits.
Tests públics
-------------
>>> sum_of_digits_sorted([56, 2131])
[2131, 56]
... | Python | 1 |
that the iteration is finished. See the
/// [`SyncReader`](struct.SyncReader.html) documentation for more information.
fn next(&mut self) -> Option<Self::Item> {
// TODO 1.0: This whole `InternalEvent` -> `InputEvent` mapping should be shared
// between UNIX & Windows implementations
... | Rust | 0 |
trinsics = cam_file["intrinsic"].astype(np.float32)
camera_pose = cam_file["pose"].astype(np.float32)
rgb_image, depthmap, intrinsics = self._crop_resize_if_necessary(
rgb_image, depthmap, intrinsics, resolution, rng=rng, info=view_idx
)
views.append(
... | Python | 1 |
egardless of the method or path.
//!
//! Awaiting on `async_run` will drive an HTTP server listening on the configured address.
#![deny(missing_docs)]
use async_std::net::TcpListener;
use async_std::prelude::*;
use metrics_core::{Builder, Drain, Observe, Observer};
use std::net::SocketAddr;
/// Exports metrics over H... | Rust | 0 |
_temporal_val.pkl',
pipeline=test_pipeline,
classes=class_names,
modality=input_modality,
test_mode=True,
queue_length=queue_length,
video_test_mode=video_test_mode,
box_type_3d='LiDAR'),
test=dict(
type=dataset_type,
data_root=data_root,
... | Python | 1 |
}
#[test]
fn try_from_bytes() {
let pi = Float::from(std::f64::consts::PI);
assert_eq!(
Float::try_from(Arc::new(Mutex::new(pi.clone().try_into_bytes().unwrap()))).unwrap(),
pi
);
let max = Float::from(std::f64::MAX);
assert_eq!(
Fl... | Rust | 0 |
nts(vec![RouteCapability::TYPE]).await?;
breakpoint_system.start_component_manager().await?;
// Expect the root component to be bound to
let invocation = receiver.expect_exact::<StartInstance>("/").await?;
invocation.resume().await?;
let work_scheduler_dispatch_reporter = WorkSchedulerDispatchRep... | Rust | 0 |
e: String,
base: String,
aclass_quote: String,
quote: String,
#[serde(flatten)]
extra: HashMap<String, Value>,
}
if let Ok(txt) = http_get("https://api.kraken.com/0/public/AssetPairs") {
let resp = serde_json::from_str::<Response>(&txt).unwrap();
resp.res... | Rust | 0 |
if target_views_id is not None:
target_views_str = "_".join(map(str, target_views_id[i]))
else:
target_views_str = context_views_str
os.makedirs(
f"{save_dir}/{scene_name}_context{context_views_str}", exist_ok=True
... | Python | 1 |
,
recompute_c_y: bool,
recompute_lower_x: bool,
) {
let i_to_xi = TC1::<I>::i_to_xi;
let xi_to_xf = TC2::<I, F>::xi_to_xf;
let mut sqrt_expr_ = RF::robust_sqrt_expr::<f64>::default();
let mut c: [EI::ExtendedInt; 2] = [EI::ExtendedInt::zero(), EI::ExtendedInt::zero()... | Rust | 0 |
import boto3
import json
import logging
import os
import pymssql
def lambda_handler(event, context):
current_user = event['user_id']
secret_dict = get_secret_dict()
port = str(secret_dict['port']) if 'port' in secret_dict else '1433'
dbname = secret_dict['dbname'] if 'dbname' in secret_dict else 'master'
co... | Python | 1 |
#!/usr/bin/python
#
#Exploit for xchat 2.0.5
#Saca los usuarios y los hash
#By nonroot - 2008
#it's a PoC, please use responsibly
#
import string,urllib
import sys,re
print "Target host: i.e: http://127.0.0.1/x7chat/"
host=raw_input("Target host ( include http and /): ")
print "Output file: i.e: salida.txt"
out_file=ra... | Python | 1 |
{
pub static kCFURLVolumeIsAutomountedKey: CFStringRef;
}
extern "C" {
pub static kCFURLVolumeIsLocalKey: CFStringRef;
}
extern "C" {
pub static kCFURLVolumeIsReadOnlyKey: CFStringRef;
}
extern "C" {
pub static kCFURLVolumeCreationDateKey: CFStringRef;
}
extern "C" {
pub static kCFURLVolumeURLForRe... | Rust | 0 |
# Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | Python | 1 |
software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
use async_trait::async_trait;
use common_meta_api::KVApi;
pu... | Rust | 0 |
First,
Second,
}
}
#[export_name = "canister_heartbeat"]
fn heartbeat() {
for task in cron_ready_tasks() {
match task.get_kind().try_into() {
Ok(HanlderKind::First) => {}
Ok(HanlderKind::Second) => {}
Err(_) => {}
... | Rust | 0 |
istributedDataParallel(
model,
device_ids=[device],
broadcast_buffers=False,
find_unus... | Python | 1 |
import medcoupling as mc
import pytest
import ada
from ada.base.types import GeomRepr
from ada.fem.meshing import GmshOptions
from ada.materials.metals import CarbonSteel
def _make_cube_part(geom_repr: GeomRepr, element_order: int, use_quads: bool, use_hex: bool) -> ada.Part:
options = GmshOptions(Mesh_ElementOr... | Python | 1 |
�在索引0 处。
每一步操作中,你可以将指针向左或向右移动 1 步,或者停在原地(指针不能被移动到数组范围外)。
给你两个整数steps 和arrLen ,请你计算并返回:在恰好执行steps次操作以后,指针仍然指向索引0 处的方案数。
由于答案可能会很大,请返回方案数 模10^9 + 7 后的结果。
示例 1:
输入:steps = 3, arrLen = 2
输出:4
解释:3 步后,总共有 4 种不同的方法可以停在索引 0 处。
向右,向左,不动
不动,向右,向左
向右,不动,向左
不动,不动,不动
示例 2:
输入:steps = 2, arrLen = 4
输出:2
解释:2 步后,总共有 2 种不同的方法... | Rust | 0 |
value => WebRTCStatsType::__Unknown(value),
}
}
}
impl StaticType for WebRTCStatsType {
fn static_type() -> Type {
unsafe { from_glib(ffi::gst_webrtc_stats_type_get_type()) }
}
}
impl<'a> FromValueOptional<'a> for WebRTCStatsType {
unsafe fn from_value_optional(value: &Value) ... | Rust | 0 |
tion/appstream2">Amazon AppStream 2.0 documentation</a> </p> </li> </ul></p>
//!
//! If you're using the service, you're probably looking for [AppStreamClient](struct.AppStreamClient.html) and [AppStream](trait.AppStream.html).
extern crate bytes;
extern crate futures;
extern crate rusoto_core;
extern crate serde;
#[m... | Rust | 0 |
TYPE = 275i32;
#[doc = "*Required features: `\"Win32_NetworkManagement_NetworkPolicyServer\"`*"]
pub const ratProviderName: RADIUS_ATTRIBUTE_TYPE = 276i32;
#[doc = "*Required features: `\"Win32_NetworkManagement_NetworkPolicyServer\"`*"]
pub const ratClearTextPassword: RADIUS_ATTRIBUTE_TYPE = 277i32;
#[doc = "*Required... | Rust | 0 |
i] ** 2) ** 0.5
denoised = model(state, action, goal, sigma_hat * s_in, **extra_args) # compute denoised action
d = to_d(action, sigma_hat, denoised) # compute derivative
if callback is not None:
callback({'x': action, 'i': i, 'sigma': sigmas[i], 'sigma_hat': sigma_hat, 'denoised':... | Python | 1 |
line.contains("mask") {
mask = line.clone().replace("mask = ", "");
} else {
let (location, value) = parse_line(&line);
let value: usize = value.parse().unwrap();
let bit_string: String = format!("{:b}", value).chars().collect();
let mut padded = Strin... | Rust | 0 |
users::username.eq(favorited))
.get_result::<i32>(conn);
match result {
Ok(id) => {
query = query.filter(diesel::dsl::sql(&format!(
"articles.id IN (SELECT favorites.article FROM favorites WHERE favorites.user = {})",
id
... | Rust | 0 |
g_length = max(printable_length(line) for line in lines)
if length:
if length < max_string_length:
message = f"{length=} < {max_string_length=}"
raise ValueError(message)
target_length = length
else:
target_length = max_string_length
return "\n".join(
... | Python | 1 |
# Generated by Django 5.0.1 on 2024-01-24 18:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("uploadApp", "0001_initial"),
]
operations = [
migrations.AlterField(
model_name="post",
name="path",
fiel... | Python | 1 |
self.parse_output(p)
}
pub fn spawn(&mut self, mut exec_cmd: Command) -> Result<(), SpawnError> {
self.kill();
exec_cmd.stdin(Stdio::piped());
exec_cmd.stdout(Stdio::piped());
if self.debug {
exec_cmd.stderr(Stdio::piped());
} else {
exec... | Rust | 0 |
# YOLOv5 🚀 by Ultralytics, AGPL-3.0 license
"""
utils/initialization
"""
import contextlib
import platform
import threading
def emojis(str=''):
# Return platform-dependent emoji-safe version of string
return str.encode().decode('ascii', 'ignore') if platform.system() == 'Windows' else str
class TryExcept(... | Python | 1 |
import heapq
def initialize():
initial_state = ('Q', ('F', 'F', 'N', 'N'))
goal_state = ('', ())
adjacency_matrix = [[0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0], [1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0], [0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 1], [0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1, ... | Python | 1 |
# coding: utf-8
"""
EMS - REST API
This section will provide necessary information about the `CoinAPI EMS REST API` protocol. This API is also available in the Postman application: <a href=\"https://postman.coinapi.io/\" target=\"_blank\">https://postman.coinapi.io/</a> Implemented Standards: * [HTT... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from werkzeug.exceptions import NotFound
from odoo import exceptions, SUPERUSER_ID
from odoo.addons.sale.controllers.portal import CustomerPortal
from odoo.http import request, route
from odoo.tools import consteq
clas... | Python | 1 |
s']['nfv'])
self.assertIsNotNone(result['files'])
def test_scale(self):
req = _scale_req_example
inst = _vnf_instance_example
inst['instantiationState'] = 'INSTANTIATED'
inst['instantiatedVnfInfo'] = _inst_info_example
grant_req = {
"operation": fields.Lc... | Python | 1 |
rceptErrors(bool),
ProxyBuffering(bool),
ProxyCache(Value),
ProxyCacheKey(Value),
ProxyCacheValid(ProxyCacheValid),
ProxyNextUpstreamTries(Value),
ProxyNextUpstreamTimeout(Value),
ProxyNextUpstream(Vec<ProxyNextUpstreamFlag>),
Gzip(bool),
GzipStatic(GzipStatic),
GzipProxied(Vec<G... | Rust | 0 |
region1_body5;
#[doc = "PRINCE_REGION1_KEY_CODE7 register accessor: an alias for `Reg<PRINCE_REGION1_KEY_CODE7_SPEC>`"]
pub type PRINCE_REGION1_KEY_CODE7 =
crate::Reg<prince_region1_key_code7::PRINCE_REGION1_KEY_CODE7_SPEC>;
#[doc = "."]
pub mod prince_region1_key_code7;
#[doc = "PRINCE_REGION1_BODY6 register acces... | Rust | 0 |
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: MIT
"""Pin definitions for the NanoPi Duo2."""
# Enable I2C0, UART1, and SPI by adding the following lines to /boot/armbianEnv.txt
# overlays=usbhost2 usbhost3 spi-spidev uart1 i2c0
# param_spidev_spi_bus=... | Python | 1 |
level_4.0.exists());
assert!(d_level_5.0.exists());
assert!(!d_level_1.1.exists());
assert!(!d_level_2.1.exists());
assert!(!d_level_3.1.exists());
assert!(!d_level_4.1.exists());
assert!(!d_level_5.1.exists());
fs_extra::file::write_all(&file1.0, "content1").unwrap();
fs_extra::file:... | Rust | 0 |
tokio::net::TcpListener;
use tower_grpc::{Request, Response};
use tower_hyper::server::{Http, Server};
use stub::langcompare::{server, XorCipherRequest, XorCipherReply, PingRequest, Pong};
use stub::utils::{get_server_port, xor_cipher};
#[derive(Clone, Debug)]
struct LC;
impl server::LangCompare for LC {
// type... | Rust | 0 |
let mut keys: [__m128i; 11] = std::mem::uninitialized();
_mm_store_si128(keys.as_mut_ptr(), key);
expand_round!(keys, 1, 0x01);
expand_round!(keys, 2, 0x02);
expand_round!(keys, 3, 0x04);
expand_round!(keys, 4, 0x08);
expand_round!(keys, 5, 0x10);
expand_... | Rust | 0 |
import os
from Bio import SeqIO
import itertools
import csv
FASTA_FILE = os.path.join("ncbi_nt_database", "18S_sequences.fasta")
# The output file for our numerical fingerprints
CSV_OUTPUT_FILE = os.path.join("ncbi_nt_database", "4mer_fingerprints.csv")
# The value of k for our k-mers
K = 4
# --- Main Script ---
prin... | Python | 1 |
lse {
report_result_analytics(&results).await?;
write_preflight_results(writer, &results)?;
}
Ok(())
}
async fn run_preflight_checks(
checks: &Vec<Box<dyn PreflightCheck>>,
config: &PreflightConfig,
) -> Result<Vec<check::PreflightCheckResult>> {
let mut results = vec![];
for c... | Rust | 0 |
from PyQt5 import QtCore, QtWidgets
class Ui_SettingsWindow(object):
def setupUi(self, SettingsWindow):
SettingsWindow.setObjectName("SettingsWindow")
SettingsWindow.setWindowModality(QtCore.Qt.ApplicationModal)
SettingsWindow.resize(480, 100)
sizePolicy = QtWidgets.QSizePolicy(
... | Python | 1 |
#!/usr/bin/env python3
"""
Hulk v3
This module contains the Enums used in Hulk.
"""
# pylint: disable=duplicate-code
from enum import IntEnum
class ServerCommands(IntEnum):
"""
The different commands sent by Hulk Server.
"""
#: Kill the Bot.
TERMINATE = -1
#: Stop the attack and go to stand... | Python | 1 |
auto-save on change)
text = st.text_area("写下今天的心情吧:", value=current_text, height=200, key=f"diary_{current_day}")
# Auto-save if changed
if text != current_text:
diary[str(current_day)] = text
user_path = get_user_path(username)
os.makedirs(user_path, exist_ok=True)
diary_pa... | Python | 1 |
HostileStructures = 109,
Flags = 110,
MySpawns = 112,
HostileSpawns = 113,
ConstructionSites = 111,
MyConstructionSites = 114,
HostileConstructionSites = 115,
Minerals = 116,
Nukes = 117,
Tombstones = 118,
PowerCreeps = 119,
MyPowerCreeps = 120,
HostilePowerCreeps ... | Rust | 0 |
).app_context():
_ingest(all_workspaces=all_workspaces,
workspace_name=workspace_name,
from_id=from_id,
to_id=to_id,
rename_as=rename_workspace_as,
extra_vuln_tags=add_extra_vulnerability_tags,
index_name=elk_index_n... | Python | 1 |
parse()?;
req = Request::new(Method::Get, parsed.clone());
continue;
}
return err_msg!("failed to download {}: got non-successful HTTP status {}",
uri, response.status());
}
// Finish off our request by fetching the body.
let mut stream = re... | Rust | 0 |
# Use the training-testing split with 70% of data in the
# training data with the remaining 30% of data in the testing
print("Creating train/test split of data...")
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.3, random_state=random_state
)
print("Fitting classi... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.