text string | label_name string | labels int64 |
|---|---|---|
PI](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sr](index.html) module"]
pub struct SR_SPEC;
impl crate::RegisterSpec for SR_SPEC {
type Ux = u32;
}
#[doc = "`read()` method returns [sr::R](R) reader structure"]
impl crate::Readable for SR_SPEC {
type Reade... | Rust | 0 |
#!/usr/bin/env python
import os, sys
targets = ['lib/codemirror.js']
for mode in 'clike clojure coffeescript commonlisp css diff dtd ecl eiffel erlang fortran gfm go groovy haskell haxe htmlembedded htmlmixed http javascript jinja2 julia less lua markdown nginx ntriples ocaml octave pari pascal perl php pig properti... | Python | 1 |
XK_Launch0", 0x1008FF40);
keysyms.insert("XF86XK_Launch1", 0x1008FF41);
keysyms.insert("XF86XK_Launch2", 0x1008FF42);
keysyms.insert("XF86XK_Launch3", 0x1008FF43);
keysyms.insert("XF86XK_Launch4", 0x1008FF44);
keysyms.insert("XF86XK_Launch5", 0x1008FF45);
keysyms.insert("XF86XK_Launch6", 0x1008FF46);
keys... | Rust | 0 |
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Dialog(object):
def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(360, 244)
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(100, 80, 201, 33))
font = QtGui.QFont()
fo... | Python | 1 |
().unwrap().len();
let block_count = size / BLOCK_SIZE as u64;
// TODO(jfsulliv): If file is S_ISBLK, we should use its block size. Rust does not appear to
// expose this information in a portable way, so we may need to dip into non-portable code
// to do so.
let allocator = Buff... | Rust | 0 |
clkris(&self) -> CLKRIS_R {
CLKRIS_R::new(((self.bits >> 1) & 0x01) != 0)
}
}
use crate::graph::JsGraph;
use js_sys::{Array, Function};
use std::collections::HashMap;
use wasm_bindgen::prelude::*;
#[wasm_bindgen(js_name = coarsen)]
pub fn js_coarsen(
graph: &JsGraph,
groups: &Function,
shrink_node: ... | Rust | 0 |
import torch
import torch.nn as nn
from typing import Union, List, Dict, Any, cast
import torchvision
import torch.nn.functional as F
class VGG(torch.nn.Module):
def __init__(self, arch_type, pretrained, progress):
super().__init__()
self.layer1 = torch.nn.Sequential()
self.lay... | Python | 1 |
, data_loader, args.show, args.show_dir)
else:
model = MMDistributedDataParallel(
model.cuda(),
device_ids=[torch.cuda.current_device()],
broadcast_buffers=False)
outputs = custom_multi_gpu_test(model, data_loader, args.tmpdir,
... | Python | 1 |
or)
}
impl From<IOError> for MergeError {
fn from(error: IOError) -> Self {
MergeError::IO(error)
}
}
impl From<ChecksumError> for MergeError {
fn from(error: ChecksumError) -> Self {
MergeError::Process(TestError::Checksum(error))
}
}
impl From<FunctionError> for MergeError {
fn ... | Rust | 0 |
ait
}
upload::CMD_PUSH => {
let cmd = upload::Push {};
cmd.run(args).await
}
newhippo::CMD_NEW_HIPPO => {
let cmd = newhippo::NewHippofacts {};
cmd.run(args).await
}
newhippo::CMD_NEW => {
let cmd = newhippo::New... | Rust | 0 |
# Databricks notebook source
html = """ <h1 style="color:Black;text-align:center;font-family:Ariel"> Report on Dominant Formula 1 Teams </h1> """
displayHTML(html)
# COMMAND ----------
# MAGIC %sql
# MAGIC create or replace temp view v_dominant_teams
# MAGIC as
# MAGIC select team_name,
# MAGIC count(1) as t... | Python | 1 |
ples, 1, 1, 1, device=normals.device)
u2 = torch.rand(self.num_samples, 1, 1, 1, device=normals.device)
# Convert random samples to spherical coordinates
theta = torch.acos(torch.sqrt(1 - u1)) # Elevation angle (weighted by cosine)
phi = 2 * torch.pi * u2 # Azimuthal angle
si... | Python | 1 |
a preview of my cloned voice.", embed=True),
response_format: str = Body("mp3", embed=True)
):
"""
Generate a preview of a cloned voice with a standard text.
- **voice_id**: ID of the cloned voice to use
- **text**: Optional custom text for the preview
- **response_format**: Audio format (m... | Python | 1 |
import numpy as np
def fft_multiply(x, y):
"""
Multiply two integers using Fast Fourier Transform (FFT).
This implementation handles large integers and ensures precision.
:param x: First integer
:param y: Second integer
:return: Product of x and y
"""
# Convert the integers to digi... | Python | 1 |
re, no consistency guarantees are
/// provided of course.
///
/// Note that being panic-safe introduces extra cost. If you won't use the
/// forest after the panic happens, use more efficient but panic-unsafe
/// version, [`remove_hooked`][`Self::remove_hooked`].
///
/// # Panics
///
... | Rust | 0 |
if datetime.fromtimestamp(payload["exp"]) > latest_allowed:
self.logger.warning("Expired MFA cookie")
return
if not any(device.pk == payload["device"] for device in allowed_devices):
self.logger.warning("Invalid device PK")
return
... | Python | 1 |
de(rename = #self)]
})
} else {
None
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_to_ident() {
assert_eq!("meta/root".to_ident(), "meta_root");
}
}//! CVSS v2 base metrics
use crate::common::{AsStr, NumValue, ParseError};
use std::s... | Rust | 0 |
et_duration(next_cycle_time);
cycle_timer.reset();
}
}
}
}
fn test_modify_player(
input: Res<JoyrideInput>,
mut player: ResMut<Player>,
mut racer_query: Query<&mut Racer>,
) {
let mut racer = racer_query
.get_mut(player.racer_ent)
.expect(PLAYER_N... | Rust | 0 |
ODO this 4+ is not according to protocol, but gets openssh working
//TODO this is ad-hoc formula
let alignment : u8 = match cipher_block_size {
Some(size) => size,
None => 8 //rfc4253 on random padding
};
let min_padding_length: u8 = alignment - ((packet_length_without_random % alignment as u... | Rust | 0 |
import turtle
import time
import random
hiz = 0.15
pencere = turtle.Screen()
pencere.title('Yılan Oyunu')
pencere.bgcolor('lightgreen')
pencere.setup(width=600, height=600)
pencere.tracer(0)
kafa =turtle.Turtle()
kafa.speed(0)
kafa.shape('square')
kafa.color('black')
kafa.penup()
kafa.goto(0, 100)
kafa.direction = '... | Python | 1 |
s, momentum=momentum, nesterov=False, **opt_args)
elif opt_lower == 'fusedadam':
optimizer = FusedAdam(parameters, adam_w_mode=False, **opt_args)
elif opt_lower == 'fusedadamw':
optimizer = FusedAdam(parameters, adam_w_mode=True, **opt_args)
elif opt_lower == 'fusedlamb':
optimizer =... | Python | 1 |
import asyncio
import os
import sys
import traceback
from beeai_framework.agents.requirement import RequirementAgent
from beeai_framework.agents.requirement.requirements.conditional import ConditionalRequirement
from beeai_framework.backend import ChatModel
from beeai_framework.errors import FrameworkError
from beeai_... | Python | 1 |
#python
import k3d
import testing
document = k3d.new_document()
source1= k3d.plugin.create("PolyCube", document)
source1.width = 2.0
source1.height = 2.0
source1.depth = 2.0
source2 = k3d.plugin.create("PolyCube", document)
source2.width = 4.0
source2.height = 4.0
source2.depth = 4.0
modifier1 = k3d.plugin.create(... | Python | 1 |
()
.clear_target([0.2, 0.2, 0.2, 1.0], 10.0)
.with_pass(DrawFlat2D::new().with_transparency(
ColorMask::all(),
ALPHA,
// NOTE: I have no idea what this `DepthMode` does, as it isn't documented,
// but sprite ordering via their z positions only works ... | Rust | 0 |
def main():
ruta_csv= input("ingrese el nombre del archivo csv: ")
df_ingresos = cargar_archivo_csv(ruta_csv)
if df_ingresos is not None:
analizar_ingresos(df_ingresos)
graficar_por_categoria(df_ingresos)
graficar_por_dia(df_ingresos)
convertir_a_excel(df_ingresos)
# ... | Python | 1 |
# MTUOC-deduplicator
# Copyright (C) 2025 Antoni Oliver
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | Python | 1 |
'whole tumor': (1, 2, 3),
'tumor core': (2, 3),
'enhancing tumor': (3,)
},
num_training_cases=(477),
file_ending='.nii.gz',
regions_class_order=(1, 2, 3),... | Python | 1 |
}
}
pub type IP_ADAPTER_ADDRESSES_LH = _IP_ADAPTER_ADDRESSES_LH;
pub type PIP_ADAPTER_ADDRESSES = *mut IP_ADAPTER_ADDRESSES_LH;
extern "stdcall" {
#[link_name = "\u{1}_GetAdaptersAddresses@20"]
pub fn GetAdaptersAddresses(
Family: ULONG,
Flags: ULONG,
Reserved: PVOID,
... | Rust | 0 |
PadShape::Rect => write!(f, "rect"),
PadShape::RoundRect => write!(f, "roundrect"),
}
}
}
impl fmt::Display for Layer {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
let mut layers: Vec<&str> = Vec::new();
if self.contains(Layer::COPPER_TOP | Layer::COP... | Rust | 0 |
ax2.plot(finer_minutes, alpha_mean, '-', linewidth=2.0, markersize=12,
label="{} (mean)".format(r'$\alpha$'), color="dimgrey")
ln7 = ax2.plot(finer_minutes, alpha_min, '-', linewidth=2.0, markersize=12,
label="{} (min)".format(r'$\alpha$'), color="lightgrey")
... | Python | 1 |
will start during init
so we have to detect state by checking the ticker.
"""
(
cur_minutes,
cur_seconds,
total_minutes,
total_seconds,
) = self._pianobar.match.groups()
time_remaining = int(cur_minutes) * 60 + int(cur_seconds)
... | Python | 1 |
"""
# ----------------------------------------------------------------------------------------------------------------------
# Problem 9: Palindrome Number (A number (such as 16361) that remains the same when its digits are reversed. In other words, it has reflectional symmetry across a vertical axis.)
# https://leetco... | Python | 1 |
/// - t : FnMut(&[T]) -> bool - A function for checking whether to traverse the branch.
/// It shall return true if the branch need to be traversed.
/// - cb : FnMut() - A callback function that notify caller that new result is available.
///
/// # Safety
/// This function is unsafe to used. This function store resu... | Rust | 0 |
scale: jax.Array | None,
offset: jax.Array | None,
*,
axis: int,
epsilon: float,
scale_offset: float,
subtract_mean: bool,
return_residuals: bool,
config: _Config,
) -> tuple[tuple[jax.Array, jax.Array | None, jax.Array | None], None]:
"""Computes normalizati... | Python | 1 |
self) {
if !self.token.is_empty() {
let token = Token {
tok: Tok::from_str(&self.token.to_lowercase()).unwrap_or(Tok::Literal),
s: self.token.clone(),
};
self.tokens.push(token);
self.token.clear();
}
}
}
use system::mem... | Rust | 0 |
import discord
from discord.ext import commands
import asyncio
import config
from utils.database_handler import init_db
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents) # 前缀无所谓,我们用提及
@bot.event
async def on_ready():
... | Python | 1 |
2.840.113556.1.4.619";
#[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"]
pub const LDAP_SERVER_LAZY_COMMIT_OID_W: &str = "1.2.840.113556.1.4.619";
#[doc = "*Required features: `\"Win32_Networking_Ldap\"`*"]
pub const LDAP_SERVER_LINK_TTL_OID: &str = "1.2.840.113556.1.4.2309";
#[doc = "*Required features: `\"W... | Rust | 0 |
'这不是金先生吗!',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0008,
(
'你又来利贝尔\n',
'玩了吗?',
TxtCtl.Enter,
),
)
CloseMessageWindow()
ChrTalk(
0x0108,
(
'#070F哈哈,也差不多吧。',
... | Python | 1 |
osition(self):
if self.start_tween:
if not self.is_enabled:
# คำนวณตำแหน่งเป้าหมายที่ถูกปรับด้วย offset (กึ่งกลางของภาพ)
target_x = self.target_pos[0] - self.rect.width / 2
target_y = self.target_pos[1] - self.rect.height / 2
... | Python | 1 |
e and state types
/// match this color's space and state. Use only if you are sure that this color
/// is in the correct format.
fn downcast_unchecked<Spc: ColorSpace, St: State, A: AlphaState>(&self) -> ColorAlpha<Spc, St, A>;
}
*/
<filename>learning/nature_of_code/ecosystem_project/src/main.rs
use std::co... | Rust | 0 |
import operator
import numpy as np
import pytest
from pandas import (
DataFrame,
Series,
)
import pandas._testing as tm
class TestMatmul:
def test_matmul(self):
# matmul test is for GH#10259
a = Series(
np.random.default_rng(2).standard_normal(4), index=["p", "q", "r", "s"]
... | Python | 1 |
#! /usr/bin/env python3
# This script generates the symbol.py source file.
import sys
import re
def main(inFileName="Include/graminit.h", outFileName="Lib/symbol.py"):
try:
fp = open(inFileName)
except OSError as err:
sys.stderr.write("I/O error: %s\n" % str(err))
sys.exit(1)
with ... | Python | 1 |
= "poolROI", skip_serializing_if = "Option::is_none")]
pub pool_roi: Option<String>,
/// Pool ROI over 12 months
#[serde(rename = "poolROI12", skip_serializing_if = "Option::is_none")]
pub pool_roi12: Option<String>,
}
impl PoolDetail {
pub fn new() -> PoolDetail {
PoolDetail {
... | Rust | 0 |
python实例手册
#encoding:utf8
# 设定编码-支持中文
0 说明
手册制作: 雪松 littlepy www.51reboot.com
更新日期: 2020-03-06
欢迎系统运维加入Q群: 198173206 # 加群请回答问题
欢迎运维开发加入Q群: 365534424 # 不定期技术分享
请使用"notepad++"或其它编辑器打开此文档, "alt+0"将函数折叠后方便查阅
请勿删除信息, 转载请说明出处, 抵制不道德行为
错误在所难免, 还望指正!
[python实例手册] [shell实例手册] [LazyMan... | Python | 1 |
::DictTrait for Dict {
fn as_raw_Dict(&self) -> *const c_void { self.as_raw() }
fn as_raw_mut_Dict(&mut self) -> *mut c_void { self.as_raw_mut() }
}
impl Dict {
}
/// This struct stores the scalar value (or array) of one of the following type: double, cv::String or int64.
/// @todo Maybe int64 is useless because do... | Rust | 0 |
import tensorflow as tf
from tensorflow import keras
import numpy as np
import cv2
from keras.models import load_model
from main import facedetect
facedetect = cv2.CascadeClassifier('haarcascade_frontalface_default.xml')
cap = cv2.VideoCapture(0)
cap.set(3, 640)
cap.set(4, 480)
font = cv2.FONT_HERSHEY_COMPLEX
# mo... | Python | 1 |
let mut reader = MessageReaderBase { stream: mock };
let _err = reader.read_message().await.expect_err("Error is expected");
Ok(())
}
#[async_std::test]
async fn can_read_chunks() -> Result<(), Error> {
let chunks = vec![
data_sample(0, 0x1),
data_sample(1, 0x1),
data_sample(16, 0x... | Rust | 0 |
, the above mechanism could be used
/// as a method to implement a local cache.
// Note: see for helpful description of inode fields and when/how to update them.
// https://man7.org/linux/man-pages/man7/inode.7.html
mod fs_tree_types;
mod metadata;
mod tree_replica;
use log::{debug, error};
use openat::{Dir, SimpleTyp... | Rust | 0 |
_vision import AIServiceVisionClient
HAS_OCI_PY_SDK = True
except ImportError:
HAS_OCI_PY_SDK = False
class AiVisionImageJobFactsHelperGen(OCIResourceFactsHelperBase):
"""Supported operations: get"""
def get_required_params_for_get(self):
return [
"image_job_id",
]
d... | Python | 1 |
er's input buffer and/or output buffer.
///
/// # Errors
///
/// This function may return the following errors:
///
/// * `NoDevice` if the device was disconnected.
/// * `Io` for any other type of I/O error.
#[inline(always)]
fn clear(&self, buffer_to_clear: crate::ClearBuffer) -> c... | Rust | 0 |
fy_path_to_submodule() {
check_types_source_code(
r#"
mod foo {
pub struct Foo;
}
fn bar() {
let foo: foo::Foo = foo::Foo;
foo
} //^ foo::Foo
"#,
);
}
#[test]
fn omit_default_type_parameters() {
check_types_source_code(
r#"
struct Foo<T = u8> { t: T }
fn main() {
let foo ... | Rust | 0 |
_div_si = BigInt::mod_mul(&s_inv_i, &ipp.b_tag, &order);
let b_div_si_thetainvi = BigInt::mod_mul(&theta_inv_ext[i], &b_div_si, &order);
BigInt::mod_sub(&b_div_si_thetainvi, &beta_ext[i], &order)
})
.collect();
// exponent of g
let w_bn = challenge_w.to_big_int()... | Rust | 0 |
}
//! ```
//!
//! Now every time your models change and you compile your code the corresponding
//! Elm models will be generated. You can find them in the `generated` directory in
//! your projects root. The are called after the corresponding Rust definitions.
//! I.e. `Message.elm` and `User.elm` in this case.
//!
//... | Rust | 0 |
list.push_back(4);
{
let mut iter_mut = list.iter_mut();
let ref1 = iter_mut.next().unwrap();
let ref2 = iter_mut.next().unwrap();
drop(iter_mut);
*ref1 = 6;
*ref2 = 7;
}
assert_eq!(list, vec![6, 7, 3, 4]);
}
}
pu... | Rust | 0 |
: &T::ValueType, limit: (i32, i32)) -> i32 {
self.0.map(value, limit)
}
fn range(&self) -> Range<T::ValueType> {
self.0.range()
}
// TODO: See issue issue #88
fn key_points<HintType: KeyPointHint>(&self, hint: HintType) -> Vec<T::ValueType> {
let range = 0..(self.0.size() + s... | Rust | 0 |
)
.await?;
Ok(tonic::Response::new(records::MarkRecordResponse {
record: Some(record.into()),
}))
}
async fn add_record_tag(
&self,
request: Request<AddRecordTagRequest>,
) -> Result<Response<AddRecordTagResponse>, Status> {
let user = su... | Rust | 0 |
0xff) as u8;
r[2] = (((self.n[9] & 0x3f) << 2) | ((self.n[8] >> 24) & 0x3)) as u8;
r[3] = ((self.n[8] >> 16) & 0xff) as u8;
r[4] = ((self.n[8] >> 8) & 0xff) as u8;
r[5] = (self.n[8] & 0xff) as u8;
r[6] = ((self.n[7] >> 18) & 0xff) as u8;
r[7] = ((self.n[7] >> 10) & 0xff)... | Rust | 0 |
import json
import boto3
dynamodb = boto3.resource("dynamodb")
table = dynamodb.Table("Order")
def valid_req(data):
if "order_id" not in data:
return False
return True
def get_current_date():
current_date_obj = datetime.now()
current_date = current_date_obj.strftime("%Y%m%d") # ex: 20250411 ... | Python | 1 |
from plugins.XSStrike.core.checker import checker
def filterChecker(url, params, headers, GET, delay, occurences, timeout, encoding):
positions = occurences.keys()
sortedEfficiencies = {}
# adding < > to environments anyway because they can be used in all contexts
environments = set(['<', '>'])
fo... | Python | 1 |
: FILE_SIZE,
}),
..FileNode::default()
},
],
..Directory::default()
};
let error = verify_directory_canonical(EMPTY_DIGEST, &directory).expect_err("Want error");
assert!(error.contains("roland"), "Bad error message: {}", error);
}
#[test]
fn duplicate_path_in_file_and_directory() {... | Rust | 0 |
# Import necessary libraries
import pytest
from mineplayer import MinePlayer, UserAvatar
def test_create_player():
"""Test creating a new player object with a valid username."""
player = MinePlayer("Sam510208")
assert player.username == "Sam510208"
assert isinstance(player.uuid, str) # Check if UUID ... | Python | 1 |
import os
source = "/Users/baharspring/veeam/source"
def get_structure_folder(directory):
"""
Collect the structure of a directory, including all its subdirectories.
Args:
- directory (str): Path to the directory whose structure needs to be collected.
Returns:
- list of str: A list of relative... | Python | 1 |
# Bonsai - OpenBIM Blender Add-on
# Copyright (C) 2020, 2021 Dion Moult <dion@thinkmoult.com>
#
# This file is part of Bonsai.
#
# Bonsai is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the... | Python | 1 |
, representable_cache, ty)
}),
)
}
// Fixed-length vectors.
// FIXME(#11924) Behavior undecided for zero-length vectors.
ty::Array(ty, _) => is_type_structurally_recursive(tcx, sp, seen, representable_cache, ty),
ty::Adt(def, substs) => {
/... | Rust | 0 |
}
fn set_channel_count_mode(&self, v: ChannelCountMode) {
assert!(v != ChannelCountMode::Max, "NotSupportedError");
self.channel_config.set_count_mode(v);
}
fn set_channel_count(&self, v: usize) {
assert!(v <= 2, "NotSupportedError");
self.channel_config.set_count(v);
... | Rust | 0 |
def is_matching(opening, closing):
pairs = {'(': ')', '[': ']', '{': '}'}
return pairs.get(opening) == closing
def max_correct_expr_length(text):
max_len = 0
stack = []
last_invalid = -1 # Индекс последнего некорректного символа
for i, ch in enumerate(text):
if ch in '([{':
... | Python | 1 |
arsing the last activity timestamp failed for this request, indicating a session data error.
monitoring_utils.set_custom_attribute('session_inactivity.last_touch_error', str(e))
monitoring_utils.record_exception()
else:
# .. custom_attribute_name: ses... | Python | 1 |
from indicators.candlestick.patterns.candlestick_finder import CandlestickFinder
class BullishEngulfing(CandlestickFinder):
def __init__(self, target=None):
super().__init__(self.get_class_name(), 2, target=target, type='buy')
def logic(self, idx):
candle = self.data.iloc[idx]
prev_ca... | Python | 1 |
info!("Solution2.1: {:?}", problem2::solve_part1(&input2));
info!("Solution2.2: {:?}", problem2::solve_part2(&input2));
let input3 = problem3::parse_input(problem3::INPUT_PATH);
info!("Solution3.1: {:?}", problem3::solve_part1(&input3));
info!("Solution3.2: {:?}", problem3::solve_part2(&input3));
... | Rust | 0 |
# Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree. An additional grant
# of patent rights can be found in the PATENTS file in the same directory.
from parlai.core.worlds imp... | Python | 1 |
,
std::sync::Arc,
stry_backend::DataBackend,
stry_config::Config,
tokio::{runtime::Builder, sync::broadcast},
};
pub fn start(cfg: Config) -> anyhow::Result<()> {
openssl_probe::init_ssl_cert_env_vars();
let cfg = Arc::new(cfg);
let (_file_guard, _flame_guard, reg) = setup::logger(cfg.clo... | Rust | 0 |
str;
use std::sync::{Arc, Mutex, RwLock};
use crate::objects::*;
/// Model for service's subsystem
#[derive(Clone)]
pub struct Subsystem {
pub eps: Arc<Mutex<Box<dyn GsEps>>>,
pub errors: Arc<RwLock<Vec<String>>>,
pub last_cmd: Arc<RwLock<AckCommand>>,
}
impl Subsystem {
/// Creates new Subsystem str... | Rust | 0 |
for time series at fixed points (hr), default is 2
Returns:
--------
x : numpy.ndarray
Longitudes of the grid (degree)
y : numpy.ndarray
Latitudes of the grid (degree)
maxwind : numpy.ndarray
Storm maximum wind speed at each point on the grid (knots)
"""
if extent ... | Python | 1 |
from pyrogram import Client, filters
from pyrogram.types import Message
import requests
from SHUKLAMUSIC import app
@app.on_message(filters.command("population"))
def country_command_handler(client: Client, message: Message):
# Extract the country code from the command
country_code = message.text.split(maxspl... | Python | 1 |
> {
Operation::BinaryOperation(self.semantics)
}
}
pub struct ConstantOp<Number: Clone + From<f64>> {
pub symbol: &'static str,
pub semantics: Number,
}
impl<Number: Clone + From<f64>> ConstantOp<Number> {
pub fn operation(&self) -> Operation<Number> {
Operation::Constant(self.semant... | Rust | 0 |
DisplayPlaneAlphaFlagsKHR](https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkDisplayPlaneAlphaFlagsKHR.html).
///
/// Use the macro `VkDisplayPlaneAlphaFlags!` as an alternative method to create a structure. For example, these two snippets return the same value:
/// ```
/// VkDisplayPlaneAlphaFlag... | Rust | 0 |
= MIB * 1024;
const TIB: u64 = GIB * 1024;
const FAT16_MIN: u64 = 16 * MIB;
const FAT16_MAX: u64 = (4096 - 1) * MIB;
const FAT32_MIN: u64 = 33 * MIB;
const FAT32_MAX: u64 = 2 * TIB;
const EXT4_MAX: u64 = 16 * TIB;
const BTRFS_MIN: u64 = 250 * MIB;
match... | Rust | 0 |
Vec<_> = (0..len)
.map(|_| {
(
CowBytes::arbitrary(g),
DefaultMessageActionMsg::arbitrary(g),
)
})
.map(|(k, v)| (k, v.0))
.collect();
let node: LeafNode ... | Rust | 0 |
Params::new()
}
}
/// Initializes DyNet.
///
/// # Panics
///
/// Panics if an invalid value is specified in `params`.
pub fn initialize(params: &mut DynetParams) {
unsafe {
check_api_status!(dynet_sys::dynetInitialize(params.as_mut_ptr()));
}
}
/// Resets random number generators.
pub fn reset_rn... | Rust | 0 |
,
MUT_MUTEX_LOCK,
*method_span,
"calling `&mut Mutex::lock` unnecessarily locks an exclusive (mutable) reference",
"change this to",
"get_mut".to_owned(),
Applicability::MaybeIncorrect,
... | Rust | 0 |
Code::RControl => Key::RCtrl,
winit::VirtualKeyCode::RAlt => Key::RAlt,
winit::VirtualKeyCode::RMenu => Key::RGui,
// Map to backslash?
// K::GraveAccent => Key::Unknown,
winit::VirtualKeyCode::Home => Key::Home,
winit::VirtualKeyCode::Insert => Key::Insert,
winit... | Rust | 0 |
> height(&right.right) {
let new_right = rotate_right(right);
root.right = Some(new_right);
update_height(&mut root);
update_max(&mut root);
} else {
root.right = Some(right);
}
rotate_left(root)
}
fn balance<K: Clone + Ord, V>(root: Box<Node<K, V>>) -> Box<Node<K,... | Rust | 0 |
at `filename:line` log invocation.
/// The log level has to be enabled for it to work.
/// Will be written in the log file with the lowest severity.
pub log_backtrace_at: Option<String>,
/// Log to stderr instead of logfiles
pub logtostderr: bool,
/// Log to stderr and logfiles
pub alsologt... | Rust | 0 |
::str::FromStr for Visibility {
type Err = ParseVisibilityError;
fn from_str(s: &str) -> Result<Visibility, Self::Err> {
match s {
"public" | "Public" => Ok(Visibility::Public),
"home" | "Home" => Ok(Visibility::Home),
"followers" | "Followers" => Ok(Visibility::Foll... | Rust | 0 |
"0|\
20@1500,0|\
21@3000,0|\
22@4500,0|\
23@6000,0|\
24@7500,0"
);
}
#[test]
fn gpos_chaining3_simple_006() {
assert_eq!(
shape(
"aots/fonts/gpos_chaining3_simple_f2.otf",
"\u{0000}\u{0000}\u{0015}\u{0016}\u{0017}\u{0018}\u{00... | Rust | 0 |
row_length,col_length=map(int,input().split())
row_li = [col_length]
col_li = [row_length]
for i in range(int(input())):
type_, loc =map(int,input().split())
if type_==0:
row_li.append(loc)
else:
col_li.append(loc)
row_li=sorted(row_li)
col_li=sorted(col_li)
real_row_li=[]
real_col_li=[]
v... | Python | 1 |
"""Some basic tests to test installation."""
import os
import unittest
from alpa import (init, parallelize, ShardParallel, PipeshardParallel,
AutoLayerOption, prefetch)
from alpa.device_mesh import get_global_cluster
from alpa.testing import assert_allclose, get_mlp_train_state_and_step
class Insta... | Python | 1 |
rive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PropSeqBinOp {
ImplOverlap,
ImplNonoverlap,
FollowOverlap,
FollowNonoverlap,
}
#[moore_derive::visit]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum PropBinOp {
Or,
And,
Until,
SUntil,
UntilWith,
SUntilWith,
Impl,
... | Rust | 0 |
).map(|p| p.into());
Ok(Json(ListResponse {
data: payments,
next,
}))
}
#[get("{id}/payments/{payment}")]
async fn get_payment(
ids: Path<(String, u64)>,
current_user: User,
context: Data<Context>,
) -> Result<Json<Payment>, Error> {
AssetAuth.is_authorized(Verb::Read, ¤t_... | Rust | 0 |
# Copyright (c) OpenMMLab. All rights reserved.
from .backbones import * # noqa: F401, F403
from .dense_heads import * # noqa: F401, F403
from .detectors import * # noqa: F401, F403
from .layers import * # noqa: F401, F403
from .losses import * # noqa: F401, F403
from .necks import * # noqa: F401, F403
from .roi_... | Python | 1 |
#[wasm_bindgen_test]
fn export() {
js_export();
}
macro_rules! import_macro {
($(($rust:ident, $js:ident, $i:ident))*) => ($(
#[wasm_bindgen(module = "tests/wasm/slice.js")]
extern "C" {
fn $js(a: &[$i]) -> Vec<$i>;
}
#[wasm_bindgen]
pub fn $rust(a: &[$i]) ... | Rust | 0 |
/primitive.i8.html) number
///
/// # Examples
///
/// ```
/// use rustils::parse::ushort::i8_to_u16_res;
/// use rustils::error::ParseError::InvalidNumber;
///
/// assert_eq!(i8_to_u16_res(0_i8), Ok(0_u16));
/// assert_eq!(i8_to_u16_res(127_i8), Ok(127_u16));
/// assert_eq!(i8_to_u16_res(-1_i8), Err(InvalidNumber(Strin... | Rust | 0 |
import tushare as ts
import pandas as pd
import time
import requests
from config import TUSHARE_TOKEN
# 设置Tushare Token
ts.set_token(TUSHARE_TOKEN)
pro = ts.pro_api()
# 获取全市场股票列表(带重试)
def get_stock_list_with_retry(max_retries=5):
"""
获取全市场股票列表,并加入重试机制,防止Tushare超时或限流导致失败
"""
for attempt in range(max_re... | Python | 1 |
assert_eq!(v, vt);
for _ in 0..10 {
step(&mut p, &mut v);
}
let (pt, vt) = parse_test_vector(indoc!(
"pos=<x= 30, y= -8, z= 3>, vel=<x= 3, y= 3, z= 0>
pos=<x= -2, y= -4, z= 0>, vel=<x= 4, y=-13, z= 2>
pos=<x=-18, y= -7, z= 15>, ve... | Rust | 0 |
x, y, z = map(int, input("\nВведите 3 целых числа через пробел: ").split())
mul1, mul2, mul3 = x*y, y*z, z*x
pow4, mod, div = x**4, y%z, z//x
print(f"\nУмножение: {mul1}, {mul2}, {mul3}")
print(f"Степень/остаток/деление: {pow4}, {mod}, {div}")
print(f"Сумма результатов: {pow4 + mod + div}") | Python | 1 |
Rgb(0x0C, 0xF0, 0xA4),
Rgb(0x05, 0xFB, 0xFF),
Rgb(0x5E, 0x5E, 0x5E),
Rgb(0x0D, 0x0D, 0x0D),
Rgb(0x0D, 0x0D, 0x0D),
Rgb(0xFF, 0xFF, 0xFF),
Rgb(0xA6, 0xFC, 0xFF),
Rgb(0xB3, 0xEC, 0xFF),
Rgb(0xDA, 0xAB, 0xEB),
Rgb(0xFF, 0xA8, 0xF9),
Rgb(0xFF, ... | Rust | 0 |
\xcef\x1b\xca\x0b\xe0w#g\x93:{\x9b\xf9\x86}\
\xdc\x9c\x9f\xcc\xbfvz\x9d,\xed\x02\xc9\xb3k\xee\xcf\
\xfc]hg\xd0\x15\x03\xfaC\xcb\xe7<h\x82|\xd2\
\xcbh\x17\xc8\xd8#\xe6\xd2o\x9ct,@\xefE\xc6\
\xd2c\x1aS\x85\x13/m\x02\xf2jD\xaekK\xbb\
\xc0A\x96g\x89\xf3\xa8a{\xb60\xc1\xa8\xe7-1\
h\x83\xbe\xdeBD\xf7\x81\x9a?\xe9\xc2\x89!\xf... | Python | 1 |
range {
// Insert the element into the set and check that the element
// was not already in the set.
match self.elements.insert(key, false) {
Some(false) => panic!("Attempting to insert elements already in the Set"),
_ => {}
}
}
... | Rust | 0 |
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
from keras.datasets import mnist
from keras.models import Sequential
from keras.utils.np_utils import to_categorical
from keras.models import Sequential
from keras.layers import Activation, Dense
from keras import optimizers
(X_train... | Python | 1 |
.next(), Some(&mut "value1"));
assert_eq!(iter.next_back(), Some(&mut "value4"));
assert_eq!(iter.next(), Some(&mut "value2"));
assert_eq!(iter.next_back(), Some(&mut "value3"));
assert_eq!(iter.next(), None);
}
#[test]
fn test_values_mut_empty() {
let mut map: ListO... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.