text string | label_name string | labels int64 |
|---|---|---|
"""Constants for the Home Assistant SkyConnect integration."""
DOMAIN = "homeassistant_sky_connect"
| Python | 1 |
y");
}
}
struct TouchTask<S, F>
where
S: Stream<Item = ()>,
F: Framebuffer,
{
touch_int_stream: S,
i2c_3_mutex: Arc<FutureMutex<I2C<device::I2C3>>>,
layer_mutex: Arc<FutureMutex<Layer<F>>>,
}
impl<S, F> TouchTask<S, F>
where
S: Stream<Item = ()>,
F: Framebuffer,
{
async fn run(self... | Rust | 0 |
tive.texture(frame),
}
}
}
use std::{iter, str};
use time::OffsetDateTime;
use url::Url;
use crate::sorting_iter::SortingIterator;
use crate::Method;
mod canonical_request;
mod signature;
mod string_to_sign;
pub(crate) mod util;
#[allow(clippy::too_many_arguments)]
pub fn sign<'a, Q, H>(
date: &Offs... | Rust | 0 |
Tx, UdpPortBindingRx)> {
// Verfify that the indices match up
if sender_binding.idx != receiver_binding.idx {
return Err((sender_binding, receiver_binding));
}
let idx = sender_binding.idx;
self.port_array.map(|table| {
table[idx] = Some(SocketBindingEntry... | Rust | 0 |
y = Pubkey(bytes([1] * 32))
/// >>> str(pubkey)
/// '<KEY>'
/// >>> bytes(pubkey).hex()
/// '0101010101010101010101010101010101010101010101010101010101010101'
///
#[pyclass(module = "solders.pubkey", subclass)]
#[derive(Eq, PartialEq, Ord, PartialOrd, Debug, Default, Hash, Clone)]
pub struct Pubkey(pub ... | Rust | 0 |
#
# Copyright (C) 2023, Inria
# GRAPHDECO research group, https://team.inria.fr/graphdeco
# All rights reserved.
#
# This software is free for non-commercial, research and evaluation use
# under the terms of the LICENSE.md file.
#
# For inquiries contact george.drettakis@inria.fr
#
import os
import logging
from argpa... | Python | 1 |
? what is name, so just find first item
if let Some(item) = self.results.into_iter().find(|_| true ) {
item.as_result()
} else {
Err(ApiError::NoResourceFounded("custom spu".to_owned()))
}
}
}
<reponame>nomad-xyz/configuration
//! Agent configuration types
... | Rust | 0 |
'connect_parameters': connect_parameters_local})
else:
device_dict = device_config.setdefault(name, {})
sleep_disconnect_local = dev.get('sleep_disconnect', 60)
connect_parameters_local = dev.get('connect_parameters', {})
device_dict.update({'sleep_disconnect': sl... | Python | 1 |
);
}
use webcore::value::Reference;
use webcore::try_from::TryInto;
use private::TODO;
/// The `Storage` interface of the Web Storage API provides access to
/// the session storage or local storage for a particular domain.
///
/// [(JavaScript docs)](https://developer.mozilla.org/en-US/docs/Web/API/Storage)
// https:/... | Rust | 0 |
"ite" => Ok(IfThenElse),
str => Err(ParseError::UnknownFunctionSymbol(str.to_string())),
}
} else {
Err(ParseError::InvalidSexp("function symbol", term.clone()))
}
}
fn const_symbol_of_sexp(term: &Sexp) -> Result<ConstSymbol, ParseError> {
if term... | Rust | 0 |
test for this case
if active_index <= index && index <= right_upper_bound {
return (true, index, 1);
}
// Compare left boundary
// agent ids: [0,1,2,3,4,5] :: Tasks 3 :: Active Index 4 :: Agent 0 :: Active Agents [4,5,0]
// TODO: Create test for this case
(a... | Rust | 0 |
from typing import TYPE_CHECKING, Any
from langchain._api import create_importer
if TYPE_CHECKING:
from langchain_community.retrievers import EmbedchainRetriever
# Create a way to dynamically look up deprecated imports.
# Used to consolidate logic for raising deprecation warnings and
# handling optional imports.... | Python | 1 |
# Borrowed from examples
import torch
import time
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self):
self.reset()
def reset(self):
self.val = 0
self.avg = 0
self.sum = 0
self.count = 0
def update(self, val, ... | Python | 1 |
ds during the building.
//!
//! Example:
//!
//! ```
//! # use uuid::Uuid;
//! mod test {
//! # use builder_pattern::Builder;
//! # use uuid::Uuid;
//! #[derive(Builder)]
//! pub struct Test {
//! #[public]
//! id: Uuid,
//! pub name: &'static str,
//! }
//! }
//! use test::Test;... | Rust | 0 |
os.environ['HTTPS_PROXY']
}
LOG('Command being called is %s' % (demisto.command()))
try:
client = Client(url, use_ssl, PROXIES, token)
if demisto.command() == 'test-module':
# This is the call made when pressing the integration Test button.
demisto.results(test... | Python | 1 |
# Generated by Django 5.2.6 on 2025-09-22 08:42
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Doctor',
fields=[
... | Python | 1 |
t},
convert::{TryFrom, TryInto},
fmt::{self, Display, Formatter},
path::{Path, PathBuf},
process::{self, Command},
sync::atomic::{AtomicUsize, Ordering},
};
/// dependencies
pub(crate) use ::{
anyhow::{anyhow, bail, Context, Error, Result},
fehler::throws,
rayon::iter::{IntoParallelRefIterator, Paralle... | Rust | 0 |
return None
if ids:
log.info(
f"Deleting items by IDs from {self.collection_prefix}_{collection_name}. IDs: {ids}"
)
return self.client.delete(
collection_name=f"{self.collection_prefix}_{collection_name}",
ids=ids... | Python | 1 |
super::to_absolute(input.into(), &working_dir),
Ok(fmt_working_dir(output, &working_dir))
);
}
#[ test_case("", "" ; "empty")]
#[cfg_attr(unix, test_case("file.ext", "file.ext" ; "relative" ))]
#[cfg_attr... | Rust | 0 |
kernel_and_task() -> (Arc<Kernel>, TaskOwner) {
create_kernel_and_task_with_fs(FsContext::new(TmpFs::new()))
}
/// Creates a `Kernel` and `Task` for testing purposes.
///
/// The `Task` is backed by a real process, and can be used to test syscalls.
pub fn create_kernel_and_task_with_fs(fs: Arc<FsContext>) -> (Arc<K... | Rust | 0 |
import os
def send_notification(title, message):
os.system(
"""
osascript -e 'display notification "{}" with title "{}"'
""".format(
message, title
)
)
# Example usage:
send_notification("Title", "Message")
| Python | 1 |
/// ```
///
/// ```rust,ignore
/// fn dumb_thing_8(b: (bool, u8)) -> Fed2<u8, i16> {
/// match b {
/// (true, i) => ((i as i16) * -1).into(),
/// (false, i) => i.into(),
/// }
/// }
/// ```
#[cfg(test)]
mod test {
init_fed!();
use self::fed::*;
macro_rules!... | Rust | 0 |
from django.db import models
from django.contrib.auth import get_user_model
DjangoUser = get_user_model()
GENRE_BOARD_GAMES = [
('strategy', 'Стратегическая'),
('economic', 'Экономическая'),
('combat', 'Боевая'),
('cooperative', 'Кооперативная'),
('mobile', 'Подвижная'),
('card', 'Карточная'... | Python | 1 |
e with a `write_fmt` method; generally this comes from an
/// implementation of either the [`fmt::Write`] or the [`io::Write`] trait. The macro
/// returns whatever the `write_fmt` method returns; commonly a [`fmt::Result`], or an
/// [`io::Result`].
///
/// See [`std::fmt`] for more information on the format string sy... | Rust | 0 |
ime_info, impact, sentiment, news_key, history_news)
except Exception as e:
print(f"爬取或处理新闻时发生异常: {e}")
async def fetch_and_process_news_trending(crawler, history_news, url):
try:
result = await crawler.arun(url=url, cache_mode=CacheMode.BYPASS)
html_content = result.html
soup =... | Python | 1 |
old_index_progress += 1;
continue;
}
// rewrite the index
let mut new_index_entries: Vec <RawIndexEntry> =
Vec::new ();
for RawIndexEntry {
index_bundle_header: old_index_bundle_header,
bundle_info: old_index_bundle_info,
} in old_index_entries.into_iter () {
// skip this bundle if t... | Rust | 0 |
# 在输入图像上执行2D最小池化操作,以模拟腐蚀
eroded_image = -F.max_pool3d(-input_image, kernel_size, stride=1, padding=(kernel_size // 2,kernel_size // 2,kernel_size // 2))
return eroded_image
img3=tim(Image.open(vD[np.sort(list(vD.keys()))[-1]])).astype(float)
img4=tim(Image.open(vD[np.sort(list(vD.keys()))[-2]])).astype(flo... | Python | 1 |
care to support it.
#[inline(always)]
fn abort_if_maximum_number_of_references_exceeded(reference_count: usize)
{
if reference_count > Self::MaximumNumberOfReferences
{
abort();
}
}
#[inline(always)]
fn weak_count_is_locked(locked_or_weak_count: usize) -> bool
{
Self::WeakCounterLockSentinel == loc... | Rust | 0 |
VulReport.related_asset_status == u'线上',
VulReport.related_vul_type != u'输出文档',
).all()
count_vul_new_unfinish = len(data_department_vul_list_unfinish)
... | Python | 1 |
'''
7
20 15 19 4 13 11 17
7
20 15 19 4 13 11 23
'''
from heapq import heappush, heappop
N = int(input()) # 필요한 노드 수
arr = list(map(int, input().split()))
heap = [] # 최대힙을 구현하기 위한 리스트
# 최소힙 ( 기본 )
for num in arr:
heappush(heap, num)
print([x for x in heap]) # 힙의 내부 상태를 출력 (음수로 저장된 상태)
while heap:
... | Python | 1 |
pub unsafe fn _mm_mask_cvtepu8_epi16(src: __m128i, k: __mmask8, a: __m128i) -> __m128i {
let convert = _mm_cvtepu8_epi16(a).as_i16x8();
transmute(simd_select_bitmask(k, convert, src.as_i16x8()))
}
/// Zero extend packed unsigned 8-bit integers in a to packed 16-bit integers, and store the results in dst using... | Rust | 0 |
.
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 limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and... | Rust | 0 |
default=True, help="Don't collapse shorter 5' transcripts (default: turned off)")
parser.add_argument("-c", "--min_locus_coverage", type=float, default=0.05, help="Minimum per-locus coverage in percentage (default: 0.05)")
parser.add_argument("--min_locus_coverage_bp", type=int, default=1, help="Minimum per-lo... | Python | 1 |
print("Name : Daleep Singh")
print("Roll No. : 24BEE132")
employees = {1:{20000:101,80000:102,35000:107,25000:105},2:{10000:111,40000:112,35000:116,70000:104}}
for depart,emp in employees.items() :
minSalary = min(emp.keys())
maxSalary = max(emp.keys())
print(f"Department {depart} - Min Salary: {minSalary... | Python | 1 |
StaticTable::get(18).unwrap().with_value("PUT")
]
)
}
#[test]
fn decode_post_base_name_ref_header_field() {
let mut buf = vec![];
HeaderPrefix::new(2, 2, 4, TABLE_SIZE).encode(&mut buf);
LiteralWithPostBaseNameRef::new(0, "new bar3")
.... | Rust | 0 |
) = self.config.policy(project, instance) {
match self.prune_instance(project, instance, &policy) {
Ok((deleted_snapshots, kept_snapshots)) => {
summary.deleted_snapshots += deleted_snapshots;
summary.kept_snapshots += kept_snapshots;
... | Rust | 0 |
arserDict | None) -> list["Episode"]:
"""
Load all episodes for a podcast.
:param podcast: Podcast to load episodes for
:param from_feed: Cached copy of the podcast feed if available, otherwise fetch it
:return: loaded episodes
"""
# Load the XML file
fee... | Python | 1 |
;
locked.release_transform(&mut ids.transform_id.clone())?;
let _ = locked.release_viewport(&mut ids.content_id.clone());
self.scene_root_viewport_ids = None;
}
// Create new viewport.
let ids = TransformContentIdPair {
transform_id: self.id_gener... | Rust | 0 |
'a str);
fn main() {
let sleep_fns: [SleepFn; 3] = [
(sleep, "sleep"),
(usleep, "usleep"),
(nanosleep, "nanosleep"),
];
let time_fns: [TimeFn; 2] = [
(call_clock_gettime, "call_clock_gettime"),
(syscall_clock_gettime, "syscall_clock_gettime"),
];
sleep_and_t... | Rust | 0 |
, PartialEq, Serialize, Deserialize)]
pub enum SrcAuthority {
/// Authority of a single peer.
Node {
/// Public key of the source peer.
public_key: PublicKey,
/// ed-25519 signature of the message corresponding to the public key of the source peer.
signature: Signature,
},
... | Rust | 0 |
ct::<Vec<_>>();
for (ai, a) in tups.iter().enumerate() {
for (bi, b) in tups.iter().enumerate() {
let (la, lb) = (a.len(), b.len());
let val = match la.cmp(&lb) {
Ordering::Equal => {
let lt = a.iter().zip(b.iter()).all(|(x... | Rust | 0 |
reaterAction": -1,
"greaterPos": None,
"actionList": {"tribute": ["S3"]}
}
请仅在对应的JSON格式下访问对应的实例属性,若此时访问其他属性则很有可能是之前处理时未更新的实例属性,不具有准确性。
"""
# TODO: 选手可自行做出其他处理
print("我方等级:{}, 对方等级:{}, 当前等级{}".format(self._selfRank, self._oppoRank, self._curRank))
p... | Python | 1 |
' % (self.srcwidth))
print('Search window size height: %d' % (self.srchgt))
print('Skip sample across: %d' % (self.skipwidth))
print('Skip sample down: %d' % (self.skiphgt))
print('Field margin: %d' % (margin))
print('Oversampling factor: %d' % (self.oversample))
print('Gross offset across: %d' ... | Python | 1 |
inline]
async fn session_unsubscribed(&self, unsubscribed: Unsubscribed) {
let _ = self
.manager
.exec(Type::SessionUnsubscribed, Parameter::SessionUnsubscribed(&self.s, &self.c, unsubscribed))
.await;
}
#[inline]
async fn message_publish(&self, publish: &Pub... | Rust | 0 |
from decimal import Decimal
import pytest
from agenthalo.config import Config
from agenthalo.services.exchanges.jupiter.jupiter import JupiterClient
@pytest.fixture
def jupiter_client(default_config: Config) -> JupiterClient:
return JupiterClient.from_config(default_config, "solana")
def test_get_token_price(... | Python | 1 |
s to append as an appendix to all manuals.
# latex_appendices = []
# If false, no module index is generated.
# latex_domain_indices = True
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual ... | Python | 1 |
rng);
let g = DensePolynomial::<F>::rand(1, rng);
let witness = Witness::<F>::new(&f, &g, &F::one());
assert_eq!(witness.required_rounds(), 1);
// otherwise, it should be the ceil of the log of the coefficients
let f = DensePolynomial::<F>::rand(16, rng);
let g = DensePolynomial::<F>::rand(1, ... | Rust | 0 |
0] += 1;
qdata[1] += l;
}
}
for tl in &l_thresholds {
if l > &tl {
let ldata = l_threshold_data.entry(tl.to_string()).or_insert(vec![0, 0]);
ldata[0] += 1;
ldata[1] += l;
}
}
}
let qkeys... | Rust | 0 |
coords = [ (float(v.attrib['X']), float(v.attrib['Y'])) for v in region.findall("Vertices/Vertex") ]
coords = np.array(coords)
# get the bounding box for the current instance
xmin, ymin = np.min(coords, axis=0)
xmax, ymax = np.max(coo... | Python | 1 |
access_token = auth_result.data.access_token
else:
print(f"❌ Authentication failed: {auth_result.error}")
return
# Step 2: Check monitoring permissions
print("\n🔍 Step 2: Checking permissions...")
perm_result = await clients['auth_provider'].check_permission(
user_id=auth... | Python | 1 |
aphStyle_0 P9Z :X@A*PingFangSC-Regular:!$?%?--(@P X ` h u!, }(!g, H %Rv D bl.% B(=`@H P ] j p x
&
{ l 1w9w 1wwwww 2w Ɔ!Z 1AG?.sRv x=xRxxxx x=x 2Fh fxxxx x=x 3FxjWxxxx x=x 4xxx... | Python | 1 |
.zeros_like(x)
dx.requires_grad_(need_log_prob)
x += dx
dt = torch.full(
(x.shape[0], 1),
(last_t - t.item()) / self.timesteps,
device=x.device,
dtype=torch.float,
)
... | Python | 1 |
}
// ctrl + u
21 => {
if *scroll_offset >= 5 {
*scroll_offset = *scroll_offset - 5;
} else {
*scroll_offset = 0
}
}
// j
106 => { *s... | Rust | 0 |
# coding=utf-8
from matplotlib import pyplot as plt
from matplotlib import font_manager
my_font = font_manager.FontProperties(fname="/System/Library/Fonts/PingFang.ttc")
y = [1,0,1,1,2,4,3,2,3,4,4,5,6,5,4,3,3,1,1,1]
x = range(11,31)
#设置图形大小
plt.figure(figsize=(20,8),dpi=80)
plt.plot(x,y)
#设置x轴刻度
_xtick_labels = ["... | Python | 1 |
), (Solution {}).part_1());
}
}
mod part_2 {
use crate::{
day_01::{k_sums_unsorted, Solution},
shared::{Day, PartSolution},
};
#[test]
fn example() {
let input = vec![1721, 979, 366, 299, 675, 1456];
let results = k_sums_... | Rust | 0 |
ter"]
pub struct W(crate::W<CORE_0_RCD_EN_SPEC>);
impl core::ops::Deref for W {
type Target = crate::W<CORE_0_RCD_EN_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
... | Rust | 0 |
(default, skip_serializing_if = "Option::is_none")]
pub properties: Option<DataBoxEdgeDeviceExtendedInfoProperties>,
}
impl DataBoxEdgeDeviceExtendedInfo {
pub fn new() -> Self {
Self::default()
}
}
#[doc = "The Data Box Edge/Gateway device extended info patch."]
#[derive(Clone, Debug, PartialEq, Se... | Rust | 0 |
"""Functions for modifying UseInGameTextures.ndf"""
from src.constants.ui.icons import INGAME_ICONS
from src.utils.logging_utils import setup_logger
logger = setup_logger(__name__)
def edit_ui_ingame_useingametextures(source) -> None:
"""GameData/UserInterface/Use/InGame/UseInGameTextures.ndf
Edit in-game ... | Python | 1 |
"""Virtual integration for quadrafire."""
| Python | 1 |
s, nrows):
"""Automatically tile the panels of the figure.
This will re-arranged all elements of the figure (first in the
hierarchy) so that they will uniformly cover the figure area.
Parameters
----------
ncols, nrows : type
The number of columns and rows t... | Python | 1 |
from pynput import keyboard
import meArm
import Calibrate
import csv
arm = meArm.meArm()
###############################################################################################################################
# General options settings #
# control set for key mapping
######################################... | Python | 1 |
instance")
@pytest.mark.usefixtures('user_rincewind_site_editor')
def test_create_shortlink_name_authorized(
shortlinkapp: Flask,
client: TestClient,
login: LoginFixtureProtocol,
user_rincewind: models.User,
user_wolfgang: models.User,
create_shortlink: str,
) -> None:
"""Asking for a custo... | Python | 1 |
enc = [-42148619422891531582255418903, -42148619422891531582255418927, -42148619422891531582255418851, -42148619422891531582255418907, -42148619422891531582255418831, -42148619422891531582255418859, -42148619422891531582255418855, -42148619422891531582255419111, -42148619422891531582255419103, -42148619422891531582255... | Python | 1 |
from llmebench.datasets.dataset_base import DatasetBase
from llmebench.tasks import TaskType
class WikiNewsPOSDataset(DatasetBase):
def __init__(self, **kwargs):
super(WikiNewsPOSDataset, self).__init__(**kwargs)
@staticmethod
def metadata():
return {
"language": "ar",
... | Python | 1 |
class testesPessoais:
def atividade1():
print("Iniciando função atividade 1")
nome = input("Digite seu nome: ")
nomeLower = nome.lower()
print(f"Seu nome todo em minúsculo: {nomeLower}")
nomeUpper = nome.upper()
print(f"Seu nome todo em maiusculo: {nomeUpper}")
... | Python | 1 |
_STREAM_MEM_OP_WAIT_VALUE_32 = 1,
CU_STREAM_MEM_OP_WRITE_VALUE_32 = 2,
CU_STREAM_MEM_OP_FLUSH_REMOTE_WRITES = 3,
}
pub type CUstreamBatchMemOpType = CUstreamBatchMemOpType_enum;
#[repr(C)]
#[derive(Copy)]
pub union CUstreamBatchMemOpParams_union {
pub operation: CUstreamBatchMemOpType,
pub waitValue: CU... | Rust | 0 |
# common_words.py
from pathlib import Path
# List of files to analyze
files = ['text_files/pride_and_prejudice.txt', 'text_files/tale_of_two_cities.txt']
for file in files:
path = Path(file)
try:
# Read the entire file
contents = path.read_text(encoding='utf-8')
# Count 'the' ... | Python | 1 |
ls
if (sprite_x < 8) && ((self.ppuctrl & 0x04) == 0) {
break; // hide
} else {
continue; // show
}
}
let low_bit = (low_byte >> (7 - pixel_column)) & 1;
let high_bit = (high_byte >> (7 - pixel_column)) & 1;
let color_number = (high_... | Rust | 0 |
# evaluate_solver.py
from solver import solve, parse_sudoku
from tqdm import tqdm
import time
# File paths
puzzles_path = "sudoku_puzzles.txt"
solutions_path = "sudoku_solutions.txt"
# Read data
with open(puzzles_path, 'r') as f:
puzzles = [line.strip() for line in f.readlines()]
with open(solutions_path, 'r') ... | Python | 1 |
U256_AS_U64, GasCost::new(10, 1)),
(N::U256_AS_U128, GasCost::new(10, 1)),
(N::U256_MUL, GasCost::new(10, 1)),
(N::U256_DIV, GasCost::new(10, 1)),
(N::U256_SUB, GasCost::new(10, 1)),
(N::U256_ADD, GasCost::new(10, 1)),
(N::MOD_ADDRESS_OF, GasCost::new(10, 1)),
];
... | Rust | 0 |
self.plateau_duration - PLATEAU_DURATION_STEP
} else {
self.plateau_duration
}
}
};
}
fn set_expiratory_term(&self, action: SettingAction) -> ControlMessage {
let new_value = match action {
SettingA... | Rust | 0 |
from math import dist
def centroid(cluster):
distance = []
for dot1 in cluster:
sumd = 0
for dot2 in cluster:
sumd += dist(dot1, dot2)
distance.append([sumd, dot1])
return min(distance)[1]
with open('txt/27_A_21932.txt') as file:
data = [list(map(float, i.replace(',... | Python | 1 |
CED,
}
}
#[doc = "Checks if the value of the field is `HW_CTRL`"]
#[inline(always)]
pub fn is_hw_ctrl(&self) -> bool {
*self == AP_FS_DEV_NEEDCLK_A::HW_CTRL
}
#[doc = "Checks if the value of the field is `FORCED`"]
#[inline(always)]
pub fn is_forced(&self) -> bool {
... | Rust | 0 |
["c/x-1"], [])]
),
# cpv's/cp where some cpv's are not instances of the cp. The pkgmap should
# contain an entry for each in the same order, with the cp expanded
# to all installed instances.
_TestData(
["c/x-1", "c/z"], [(["c/x-1"], []), (["c/... | Python | 1 |
um Error<T> {
// // Duplicate QMA Account
// DuplicateAccounts,
// }
// #[pallet::event]
// #[pallet::generate_deposit(pub(crate) fn deposit_event)]
// #[pallet::metadata(T::AccountId = "AccountId", BalanceOf<T> = "Balance", AirDropCurrencyId = "AirDropCurrencyId")]
// pub enum Event<T: Config> {
// /// Mak... | Rust | 0 |
#[doc = " \\note The only EFB pixel format supporting an alpha buffer is <tt>GX_PF_RGBA6_Z24</tt>; see GX_SetPixelFmt(). The alpha \\a enable is ignored for non-alpha"]
#[doc = " pixel formats."]
#[doc = ""]
#[doc = " \\param[in] enable enables alpha-buffer updates with <tt>GX_TRUE</tt>"]
#[doc = ""]
... | Rust | 0 |
from .. import IconBase
class IconSquareScissors(IconBase):
class_name = "lucide lucide-square-scissors"
svg_data = {
"attrs": {
"width": "24",
"height": "24",
"view_box": "0 0 24 24",
"fill": "none",
"stroke": "currentColor",
"stroke_width": "2",
"s... | Python | 1 |
import Spectral_BLDC as Spectral
import time
# Init comms channel
Communication1 = Spectral.CanCommunication(bustype='slcan', channel='COM41', bitrate=1000000)
# Init motor object
Motor1 = Spectral.SpectralCAN(node_id=0, communication=Communication1)
while True:
# Send this msg to the motor controller, it will ... | Python | 1 |
er::StringInfo(StringInfo::new(data)),
FIELD_REF => ConstantContainer::FieldRefInfo(FieldRefInfo::new(data)),
METHOD_REF => ConstantContainer::MethodRefInfo(MethodRefInfo::new(data)),
INTERFACE_METHOD_REF => ConstantContainer::InterfaceMethodInfo(InterfaceMethodRefInfo::new(data)),
NAME_AND_TYPE => ConstantCont... | Rust | 0 |
p = np.array([0.5, 0.5])
print("\np =", p)
V = np.array([10, 3])
print("V =", V)
klMax = 0.1
print("klMax =", klMax)
print("eta = ", reseqp(p, V, klMax))
# print("eta 2 = ", reseqp2(p, V, klMax))
print("Uq = ", maxEV(p, V, klMax))
print("\np =", p)
p = np.array([0.11794872, 0.27... | Python | 1 |
0, :])
return pred_first_state
def predict_missing_states(self, first_state, latent_plan, goal_state):
plan_embedding = self.plan_embedding(latent_plan)
goal_embedding = self.state_embedding(goal_state)
first_state_embedding = self.state_embedding(first_state)
... | Python | 1 |
|| *(*inbuf).offset(4) as i32 == '\u{0}' as i32))
{
*inbuf = (*inbuf).offset(4);
let q = new(
(strlen(pst_const_null).wrapping_add(1)).wrapping_mul(::std::mem::size_of::<i8>()) as _
) as *mut i8;
strcpy(q, pst_const_null);
return pst_new_obj(0i32, q as *mut l... | Rust | 0 |
: italic_correction_index as usize,
kind,
})
}
fn read_n_fixnums<T: io::Read>(
file_reader: &mut TeXFileReader<T>,
num: u16,
) -> io::Result<Vec<f64>> {
(0..num).map(|_| file_reader.read_fixnum()).collect()
}
fn read_lig_kern_step<T: io::Read>(
f... | Rust | 0 |
android.com/reference/android/opengl/GLES20.html#GL_BLEND_SRC_ALPHA)
pub const GL_BLEND_SRC_ALPHA : i32 = 32971;
/// public static final [GL_BLEND_SRC_RGB](https://developer.android.com/reference/android/opengl/GLES20.html#GL_BLEND_SRC_RGB)
pub const GL_BLEND_SRC_RGB : i32 = 32969;
///... | Rust | 0 |
import evaluate as hf_evaluate
try:
compute_ = hf_evaluate.load("code_eval")
test_cases = ["assert add(2, 3)==5"]
candidates = [["def add(a,b): return a*b"]]
results = compute_.compute(references=test_cases, predictions=candidates, k=[1])
except Exception as e:
raise e
def pass_at_k(references: ... | Python | 1 |
_high = {
let high_1_low_2 = product(high_1.into(), low_2.into());
let high_1_high_2 = product(high_1.into(), high_2.into());
Node::union(high_1_low_2, high_1_high_2)
};
let high = Node::union(low_1_high_2, new_high);
(id_1, low_1_lo... | Rust | 0 |
let mut signature = [0; SIGNATURE_LENGTH];
signature[0..32].copy_from_slice(&r.to_bytes());
signature[32..64].copy_from_slice(public_key);
{
let hram = Sha512::new().update(&signature).update(message).finalize();
let hram = Scalar::reduce_from_wide_bytes(&hram);
let r = scalar::mu... | Rust | 0 |
r my_item in arg_items:
my_item_elapsed = my_item.force_end - my_item.force_start
my_item_count = my_item.total
my_grp_elapsed += my_item_elapsed
my_grp_count += my_item_count
my_line = "\nTask: %s, Instructions: %d, Elapsed: %0.3f\n" % (... | Python | 1 |
countId> where
AccountId: Codec, {
fn get_account_liquidity(account: AccountId) -> Result<(Liquidity, Shortfall), DispatchError>;
}
}
use syn::Ident;
/// Extension helper to turn part of a token stream into lowercase
pub trait ToLowercase {
/// Create a lower case copy of this token
fn to_l... | Rust | 0 |
#Divide two numbers
def divide(x,y):
result=x/y
return result
num1 = 30
num2 = 3
result = divide(num1, num2)
print(f"The result of dividing {num1} and {num2} is: {result}")
| Python | 1 |
impl Builder {
/// <p>A unique string used to identify a hosted zone.</p>
pub fn hosted_zone_id(mut self, input: impl Into<std::string::String>) -> Self {
self.hosted_zone_id = Some(input.into());
self
}
/// <p>A unique string used to identify a hosted zone.</p>
... | Rust | 0 |
name>reklawnos/housecat
mod io;
mod core;
use libhc::io::{Print};
use libhc::core::{Import};
use evaluator::clip::Clip;
use std::collections::HashMap;
#[allow(dead_code)]
pub fn open_libs<'a>() -> HashMap<&'static str, Box<Clip>> {
let mut result = HashMap::new();
result.insert("print", Box::new(Print) as Box... | Rust | 0 |
</solver>
/// <iteratives min_value="-inf" max_value="inf" max_step_abs="inf" max_step_rel="inf">
/// <iterative id="0">
/// <iterative id="1" max_step_abs="100">
/// </iteratives>
/// <residuals>...</residuals>
/// </nrf>
///```
///
/// The first one will take the default values, the second... | Rust | 0 |
::Local<'env, crate::android::transition::Transition>>, __jni_bindgen::Local<'env, crate::java::lang::Throwable>> {
// // class.path == "android/transition/TransitionSet", java.flags == PUBLIC | BRIDGE | SYNTHETIC, .name == "setStartDelay", .descriptor == "(J)Landroid/transition/Transition;"
// ... | Rust | 0 |
Identifier x0
Identifier x_step
Prtc
Integer 10
;
Assign
Identifier y0
Subtract
Identifier y0
Identifier y_step"#
.to_string();
let ast = ASTReader::read_ast(s.lines());
assert_eq!(
r#"Datasize: 15 Strings: 0
0 push 420
5 neg
6 store [0]
11 push 300
16... | Rust | 0 |
ait UsesOfPromoDAO.add_uses(session=session, values=values, length=promo_exists.length)
return await message.answer(
f'<a href=\'t.me/{user.username}\'>{user.first_name}</a>, ваша пиписа выросла на <b>{promo_exists.length}см 😊</b>\n'
f'Длина вашей пиписы равна <b>{user.length}см</b> 📏... | Python | 1 |
constraints.append(cp.quad_form(x_target, P_opt) <= 0.75)
# Solve for the target point
prob = cp.Problem(cp.Minimize(objective), constraints)
prob.solve()
x_target_opt = x_target.value
# Skip if no solution
if prob.status != "optimal":
... | Python | 1 |
# Copyright (c) 2024 Alibaba Inc (authors: Xiang Lyu, Liu Yue)
#
# 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 applicab... | Python | 1 |
_preprocess'] = (t1 - t0) * 1000
spherical_coords = self._project_to_spherical(points)
t2 = time.perf_counter()
self.timings['B_projection'] = (t2 - t1) * 1000
if not self.history:
# 如果历史记录为空,则跳过检测,只更新历史
final_dynamic_points = np.array([])
final_sta... | Python | 1 |
et_i32());
assert_eq!(Some(&[1, 2, 3][..]), DataVector::I32(vec![1, 2, 3]).get_i32());
assert_eq!(None, DataVector::F32(vec![1.0, 2.0, 3.0]).get_i32());
assert_eq!(None, DataVector::F64(vec![1.0, 2.0, 3.0]).get_i32());
}
#[test]
fn test_get_f32() {
a... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.