text string | label_name string | labels int64 |
|---|---|---|
k_cache, v_cache, kv_len)
def get_kv_cache(self, in_place=False):
return self.engine.get_kv_cache(in_place=in_place)
def gather_kv(self, indices: list[int]):
self.engine.gather_kv(indices)
@torch.inference_mode()
def inference(self,
input_ids: torch.LongTensor,... | Python | 1 |
path_env() -> Option<PathBuf> {
env::var("TODOS_FILE_PATH").map(PathBuf::from).ok()
}
fn config_dir() -> Result<PathBuf, &'static str> {
if let Ok(s) = env::var("TODO_CONFIG_DIR") {
Ok(s.into())
} else if let Some(mut p) = dirs::config_dir() {
p.push("todo");
Ok(p)
} else {
... | Rust | 0 |
(0.6595011102219, -2.1359434279405),
/// (0.6583348114025, -2.1354884206045),
/// (0.6581220034068, -2.1382437718946),
/// (0.6594479998527, -2.1384597563896),
/// (0.6599990002976, -2.1376771158464),
/// ]
/// .iter()
/// .map(|v| GeoCoord::new(v.0, v.1))
/// .collect();
///
/// let h = polyfill(&vec![sf_verts... | Rust | 0 |
#!/usr/bin/env python
import rospy
from trajectory_msgs.msg import JointTrajectory, JointTrajectoryPoint
def send_joint_trajectory():
# Initialize ROS node
rospy.init_node('send_joint_trajectory', anonymous=True)
# Publisher to the joint trajectory topic
joint_pub = rospy.Publisher('/robot/joint_t... | Python | 1 |
r <= decay:
topk_r2i[index].remove(nnode)
del pseudo_labels_cam,cluster_cam,fname_cam,local_pseudo_dataset,global_cluster,local_cluster
print(len(topk_rgb[0]),len(topk_ir[0]),len(topk_i2r[0]),len(topk_r2i[0]))
del index_f_ir,index_f_rgb,camid... | Python | 1 |
[5, 1],
[2, 3],
[6, 2],
[3, 7],
[4, 5],
[7, 4],
[4, 8],
[5, 6],
[9, 5],
[6, 7],
[10, 6],
[7, 11],
[8, 9],
[11, 8],
[9, 10],
[10,... | Rust | 0 |
is_set(&self, index: usize) -> bool;
}
impl BitVecMut for Vec<u8> {
fn set(&mut self, index: usize) {
let slot = index >> 3;
while slot >= self.len() {
self.push(0);
}
self[slot] |= 1 << (index as u8 & 7)
}
}
impl BitVec for Vec<u8> {
fn is_set(&s... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (C) Alibaba Group Holding Limited.
""" R2Plus1D stem. """
import math
import torch
import torch.nn as nn
from models.base.base_blocks import Base3DStem
from models.base.base_blocks import STEM_REGISTRY
@STEM_REGISTRY.register()
class R2Plus1DStem(Base3DStem):
"""
R(2+1)D... | Python | 1 |
# Copyright (c) 2020 The Plankton Authors.
# All rights reserved.
#
# This source code is derived from UUV Simulator
# (https://github.com/uuvsimulator/uuv_simulator)
# Copyright (c) 2016-2019 The UUV Simulator Authors
# licensed under the Apache license, Version 2.0
# cf. 3rd-party-licenses.txt file in the root direct... | Python | 1 |
#!/usr/bin/env python3
# coding=utf-8
# Copyright 2020 The HuggingFace Team. 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/LICENS... | Python | 1 |
fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.desc.fmt(f)
}
}
impl From<TarError> for Error {
fn from(t: TarError) -> Error {
Error::new(t.io.kind(), t)
}
}
use super::require_id_header;
use crate::Outbound;
use linkerd_app_core::{
classify, config, http_tracing, metrics,
... | Rust | 0 |
"""Реализуйте класс SkipIterator. При создании экземпляра класс должен принимать два аргумента в следующем порядке:
iterable — итерируемый объект
n — целое неотрицательное число
Экземпляр класса SkipIterator должен являться итератором, который генерирует элементы итерируемого объекта iterable, пропуская по n элементов... | Python | 1 |
def plot_polar_image(data, origin=None):
"""Plots an image reprojected into polar coordinages with the origin
at "origin" (a tuple of (x0, y0), defaults to the center of the image)"""
polar_grid, r, theta = reproject_image_into_polar(data, origin)
plt.figure()
plt.imshow(polar_grid, extent=(theta.... | Python | 1 |
from tinygrad.tensor import Tensor
from tinygrad.helpers import to_mv
def qcom_tensor_from_opencl_address(opencl_address, shape, dtype):
cl_buf_desc_ptr = to_mv(opencl_address, 8).cast('Q')[0]
rawbuf_ptr = to_mv(cl_buf_desc_ptr, 0x100).cast('Q')[20] # offset 0xA0 is a raw gpu pointer.
return Tensor.from_blob(ra... | Python | 1 |
and_fill(periods, fill_value).try_into_js(&cx)
}
#[js_function(1)]
pub fn fill_null(cx: CallContext) -> JsResult<JsExternal> {
let params = get_params(&cx)?;
let ldf = params.get_external::<LazyFrame>(&cx, "_ldf")?.clone();
let fill_value = params.get_external::<Expr>(&cx, "fillValue")?.clone();
ldf.f... | Rust | 0 |
import json
import os
import re
import sys
from tqdm import tqdm
__all__ = ['convert_to_anli_statement']
# String used to indicate a blank
BLANK_STR = "___"
def clean_json_line(json_line):
def clean_text(text):
return " ".join(text.strip().split())
json_line["question"]["stem"] = clean_text(json_lin... | Python | 1 |
vn_params["mean"]) / self.mvn_params["std"]
def undo_mvn(self, feats):
if self.mvn_params is None:
return feats
else:
return feats * self.mvn_params["std"] + self.mvn_params["mean"]
def iterator(self, bs, lab_names=[], talab_names=[], seqs=None,
shuffle=Fals... | Python | 1 |
class User:
def __init__(self, first_name: str, last_name: str, driving_license_number: str):
self.first_name = first_name
self.last_name = last_name
self.driving_license_number = driving_license_number
self.rating = 0
self.is_blocked = False
@property
def first_name... | Python | 1 |
o(f"Sensitivity analysis results saved to: {sensitivity_file}")
# Generate report with sensitivity analysis
logger.info("Generating final report...")
generate_report(all_metadata, stats, tests, sensitivity_results)
total_time = time.time() - start_time
logger.info(f"Total processing time: ... | Python | 1 |
24, 128],
[128, 192, 64], [192, 0, 96], [192, 96, 0], [128, 64, 192],
[0, 128, 96], [0, 224, 0], [64, 64, 64], [128, 128, 224],
[0, 96, 0], [64, 192, 192], [0, 128, 224], [128, 224, 0],
[64, 192, 64], [128, 128, 96], [128, 32, 128], [64, 0, 192],
... | Python | 1 |
AsyncResult's.
/// Called when the an addon is being unloaded. This eliminates the task queue.
/// Any holders of `AsyncResult` objects that are blocked on `.get()` may be
/// waiting forever. This can be called from addons if the thread-safe
/// features aren't going to be utilized. No need to have a timer ca... | Rust | 0 |
<T> {
array.iter()
}
#[inline]
fn as_slice(array: &Self::Array) -> &[T] {
array
}
}
impl<'a, T, N> ReinterpretAsGrouped<N> for &'a [T; $n]
where
T: bytemuck::Pod,
N: Unsigned + Array<T>,
... | Rust | 0 |
one for each class
show_images = []
for cls in range(self.config.sensitive_data.n_classes):
show_images.append(syn_data[syn_labels==cls][:8]) # Select the first 8 images for each class
show_images = np.concatenate(show_images) # Concatenate the selected images into a single array
... | Python | 1 |
"""
Table Bubble Plot (Github Punch Card)
-------------------------------------
This example shows github contributions by the day of week and hour of the day.
"""
# category: scatter plots
import altair as alt
from vega_datasets import data
source = data.github.url
alt.Chart(source).mark_circle().encode(
x='hour... | Python | 1 |
;
Ok(())
}
pub fn get_max_speed_hz(fd: RawFd) -> io::Result<u32> {
let mut max_speed_hz: u32 = 0;
try!(from_nix_result(unsafe { ioctl::get_max_speed_hz(fd, &mut max_speed_hz) }));
Ok(max_speed_hz)
}
pub fn set_max_speed_hz(fd: RawFd, max_speed_hz: u32) -> io::Result<()> {
try!(from_nix_result(unsa... | Rust | 0 |
# =============================================================================== #
# #
# This file has been generated automatically!! Do not change this manually! #
# ... | Python | 1 |
f"请输入正确的指令,例如金银阁10大、、金银阁10奇、金银阁10猜3"
# if XiuConfig().img:
# pic = await get_msg_pic(msg)
# await dufang.finish(MessageSegment.image(pic), at_sender=True)
# else:
# await dufang.finish(msg, at_sender=True)
# price_num = int(price)
# if in... | Python | 1 |
# -*- coding: utf-8 -*-
from django.urls import reverse
from django.test import TestCase, Client
from django.utils.translation import ugettext as _
from opds_catalog import opdsdb
from opds_catalog import settings
from constance import config
class feedsTestCase(TestCase):
fixtures = ['testdb.json']
de... | Python | 1 |
'蛏', "chēng"),
('蛐', "qū"),
('蛑', "móu,máo"),
('蛒', "gé,luò"),
('蛓', "cì"),
('蛔', "huí"),
('蛕', "huí,huǐ"),
('蛖', "máng,bàng"),
('蛗', "fù"),
('蛘', "yáng,yǎng"),
('蛙', "wā,jué"),
('蛚', "liè"),
('蛛', "zhū"),
('蛜', "yī"),
('蛝', "xián"),
('蛞', "kuò,shé"),
('蛟'... | Rust | 0 |
clearer msg in case of failure
libpaths = [x for x in libpaths if TESTFN_PREFIX in x]
assert normpath(funky_path) in libpaths
for path in libpaths:
assert isinstance(path, str)
@pytest.mark.skipif(CI_TESTING, reason="unreliable on CI")
class TestFSAPIsWithInvalidPa... | Python | 1 |
"""定义文本片段及其相关类"""
import json
import uuid
from copy import deepcopy
from typing import Dict, Tuple, Any
from typing import Union, Optional, Literal
from .time_util import Timerange, tim
from .segment import Clip_settings, Visual_segment
from .animation import Segment_animations, Text_animation
from .metadata import... | Python | 1 |
Arg::with_name("port")
.short("p")
.long("port")
.help("UDP port to bind to")
.takes_value(true)
.required(true),
)
.arg(
Arg::wit... | Rust | 0 |
import sys
import json
from lark.grammar import Rule
from lark.lexer import TerminalDef
from lark.tools import lalr_argparser, build_lalr
import argparse
argparser = argparse.ArgumentParser(prog='python -m lark.tools.serialize', parents=[lalr_argparser],
description="Lark Serializ... | Python | 1 |
.ok_or_else(|| format!("No url for {:?}", item))?
.to_owned(),
published: parse_pub_date(date)?,
};
updates.push(update);
}
}
}
Ok(updates)
}
fn atom_to_updates(feed: &Feed) -> Result<Vec<Upd... | Rust | 0 |
]
fn constructing_a_null_virtual_address() {
assert_eq!(VirtualAddress(0), VirtualAddress::zero())
}
#[test]
fn adding_to_a_virtual_address() {
assert_eq!(VirtualAddress(0xfee00010), VirtualAddress(0xfee00000) + 0x10u64);
assert_eq!(VirtualAddress(0xffff8000fee00000), VirtualAdd... | Rust | 0 |
ly required to set up the application environent on macOS
// (but not necessary in normal Cocoa applications where this is set up autmatically)
examples_common::run(example_main);
}
<gh_stars>10-100
use std::path::PathBuf;
use clap::Parser;
use crate::validators;
#[derive(Parser)]
#[clap(about, version, auth... | Rust | 0 |
::parse_pattern(
&bij
).unwrap().apply(egraph, map);
res.append(&mut bind_ij);
let bji = format!(
"(b+ {j} {i} (l* (b- {aj} {ai} ?a) (b- {bj} {bi} ?b)))",
i=&i, j=&j, ai=&ai, aj=&aj, bi=&bi, bj=&bj
... | Rust | 0 |
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<aiAABB>())).mMin as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(aiAABB),
"::",
stringify!(mMin)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null:... | Rust | 0 |
OOKS` AS b LEFT JOIN `shops` AS s ON `b`.`id` = `s`.`book`;", &sql);
/// # Ok(())
/// # }
/// ```
#[derive(Clone)]
pub struct SqlName {
parts: Vec<String>,
alias: Option<String>,
}
impl SqlName {
/// Name of identifier
pub fn new<S: ToString>(name: S) -> Self {
Self {
parts: vec![na... | Rust | 0 |
from typing import Union
import torch
def update_tensor_inplace(dst: torch.Tensor, src: torch.Tensor):
assert dst.dtype == src.dtype, "Tensors must have the same dtype"
# update tensor shape and stride
dst.as_strided_(src.shape, src.stride())
# If not the same underlying storage move tensor data
... | Python | 1 |
ist_468.finish();
}
#[allow(unused_mut)]
let mut scope_470 = writer.prefix("AcceleratorName");
if let Some(var_471) = &input.accelerator_names {
let mut list_473 = scope_470.start_list(true, Some("item"));
for item_472 in var_471 {
#[allow(unused_mut)]
let mut ent... | Rust | 0 |
0
}
}
}
}
macro_rules! impl_field_encode {
($oneof:ident,[$($f:ident),*],[$($i:tt),*]) => {
impl<$($f),*> Encode for Oneof<($($f),*,)>
where
$($f: RequiredFieldEncode),*
{
type Item = $oneof<$($f::Item),*>;
fn encode(&mut self, b... | Rust | 0 |
# Copyright 2022 The HuggingFace Team. 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 required by applicabl... | Python | 1 |
oc_hidden)]
impl SID {
const BIT_LEN_LEN: usize = 6;
const BIT_LEN: usize = 1 << Self::BIT_LEN_LEN;
/// p番目のビットが立っているか
///
/// ## 計算量
/// O(1)
pub fn access(&self, p: usize) -> bool {
self.bits[p >> Self::BIT_LEN_LEN] >> (p & (Self::BIT_LEN - 1)) & 1 != 0
}
/// [0, p)にbのビット... | Rust | 0 |
ring() }
Level::Warn => { "Warn".apply_styles(&self.0.warn).to_string() }
Level::Info => { "Info".apply_styles(&self.0.info).to_string() }
Level::Debug => { "Debug".apply_styles(&self.0.debug).to_string() }
Level::Trace => { "Trace".apply_styles(&self.0.trace).to_string()... | Rust | 0 |
"""A processor for the named entity recognition task."""
from __future__ import annotations
from explainaboard import TaskType
from explainaboard.metrics.f1_score import F1ScoreConfig, SeqF1ScoreConfig
from explainaboard.metrics.metric import MetricConfig
from explainaboard.processors.sequence_labeling import SeqLabP... | Python | 1 |
from .assigners import AssignResult, BaseAssigner, MaxIoUAssigner
from .bbox_target import bbox_target
from .geometry import bbox_overlaps
from .samplers import (BaseSampler, CombinedSampler,
InstanceBalancedPosSampler, IoUBalancedNegSampler,
PseudoSampler, RandomSampler, S... | Python | 1 |
достойнство и права. Те са надарени с разум и съвест и следва да се отнасят помежду си в дух на братство.";
const TRANSLIT_BG: &'static str = "Vsichki hora se razhdat svobodni i ravni po dostoynstvo i prava. Te sa nadareni s razum i savest i sledva da se otnasyat pomezhdu si v duh na bratstvo.";
#[test]
fn test_bulga... | Rust | 0 |
_cp.tx0);
if (*p_image).x0 < (*(*p_j2k).m_private_image).x0 {
(*p_image).x0 = (*(*p_j2k).m_private_image).x0
}
(*p_image).x1 = l_tile_x
.wrapping_add(1 as libc::c_int as libc::c_uint)
.wrapping_mul((*p_j2k).m_cp.tdx)
.wrapping_add((*p_j2k).m_cp.tx0);
if (*p_image).x1 > (*(*p_j2k).m_private_image... | Rust | 0 |
ains(PageAttributes::LARGE)
&& (va & mask_2m) == 0
&& (len & mask_2m) == 0
&& (template.frame_address() as usize & mask_2m) == 0
{
// 2M Pages
todo!();
} else {
// 4K Pages
let count = len / Self::PAGE_SIZE_MIN;
... | Rust | 0 |
# This file is part of Py6S.
#
# Copyright 2012 Robin Wilson and contributors listed in the CONTRIBUTORS file.
#
# Py6S is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, o... | Python | 1 |
olled + 1.0))
def test_vis_img():
'''
Visualize real image quality when compressed to 64x64.
This gives a base of how good the generator is.
'''
path = r'/Users/jamie/Downloads/101_ObjectCategories/Faces_easy/image_0080.jpg'
img = cv2.imread(path, 1)
img = np.float32(cv2.resize(img,... | Python | 1 |
/// Example: Positive and negative number without decimal
Integer,
/// Example: Positive number with decimal
Float,
/// Example: Negative number with decimal
MinusFloat,
/// Example: ';'
Semicolon,
/// Example: '+'
Plus,
/// Example: '-'
Minus,
/// Example: '*'
Multi... | Rust | 0 |
import pytest
from wthrnuri.weather import get_weather_from_geocode, get_geocode, parse_region_name, parse_sentence, get_ent_date, \
get_weather, query
def test_query(mocker):
question = "내일 서울 날씨 어때?"
mocker.patch("wthrnuri.weather.get_geocode", return_value=(37.5667, 126.9783))
mocker.patch("wthrn... | Python | 1 |
BASE_HOST', klass=BaseSetting, kwargs={
'has_default': True, 'default_value': None
}
)
SettingNamespaceSingleton.register_setting(
name='DATABASE_PORT', klass=BaseSetting, kwargs={
'has_default': True, 'default_value': None
}
)
SettingNamespaceSingleton.register_setting(
name='DATABASE_C... | Python | 1 |
ng', 'rightPadding', 'bottomPadding', 'topPadding'],
{'id': 'text', 'showBoundary': 'bool'})))
frames.append(frame)
gr = pt.getElementsByTagName('pageGraphics')
if len(gr):
drw = canv.RmlDraw(gr[0], self.doc.styles)
self.page_te... | Python | 1 |
"""
Py-ART: The Python ARM Radar Toolkit
=====================================
"""
# print information on citing Py-ART, this message can be suppressed by
# setting the PYART_QUIET environment variable
_citation_text = """
## You are using the Python ARM Radar Toolkit (Py-ART), an open source
## library for working w... | Python | 1 |
try:
TEXT = unicode
except NameError: #pragma NO COVER Py3k
PY3 = True
TEXT = str
STRING_TYPES = (str, bytes)
def b(x, encoding='ascii'):
return bytes(x, encoding)
else: #pragma NO COVER Python2
PY3 = False
STRING_TYPES = (unicode, bytes)
def b(x, encoding='ascii'):
if is... | Python | 1 |
ome::Success(
AuthCont {
cookie: cookie_deserialized,
}
)
} else {
Outcome::Forward(())
}
},
None => Outcome::Forward(())
}
}
}
//! An I... | Rust | 0 |
import threading
from models import Agent
from runtime.agent.agent_type import Message
from runtime.agent.memory.embeddings_memory import LongTermEmbeddingsMemory
from runtime.agent.memory.redis_memory import ShortTermRedisMemory
class AgentMemory:
"""AgentMemory is used to store the context of the agent."""
... | Python | 1 |
import unittest
from src.dp.digital_dp.template import DigitalDP
class TestGeneral(unittest.TestCase):
def test_digital_dp(self):
dd = DigitalDP()
cnt = [0] * 10
n = 1000000
for i in range(1, n + 1):
for w in str(i):
cnt[int(w)] += 1
for d in... | Python | 1 |
_size: *mut size_t = libc::malloc(mem::size_of::<u64>()) as *mut u64;
let pkl_mol: *mut c_char =
get_mol(sdf_string.as_ptr(), pkl_size, add_json.as_ptr());
//get molecule as json object
let rdkit_json_cchar = get_json(pkl_mol, *pkl_size, add_json.as_p... | Rust | 0 |
b, b], 2, 3);
///
/// assert_eq!(image.get_height(), 3);
/// ```
fn get_height(&self) -> usize {
self.height
}
#[inline]
/// Get the width
///
/// # Example
/// ```
/// use sahara::source::{Source2D, Image2D};
/// use sahara::pixel::RgbaPixel;
///
/// let... | Rust | 0 |
):
replace_dict['user_repo_override'] = c['user_repo_override']
for repo_dict in deepcopy(c['l10n_repos']):
repo_dict['repo'] = repo_dict['repo'] % replace_dict
repos.append(repo_dict)
else:
repos = c.get("l10n_repos")
... | Python | 1 |
from robyn import Robyn
from service_wallet.controller.v1 import wallet_controller as v1
def setup_routes(app: Robyn):
@app.get("/api/wallet/health")
async def health_check(request):
return {"status": "OK"}
v1.WalletController(app)
| Python | 1 |
"""Testing basic pipeline stages."""
import pytest
import pandas as pd
from pdpipe.basic_stages import ConditionValidator
from pdpipe.cond import HasNoMissingValues, HasNoColumn
from pdpipe.exceptions import FailedConditionError
DF1 = pd.DataFrame([[1, 4], [4, None], [1, 11]], [1, 2, 3], ["a", "b"])
def test_cond... | Python | 1 |
ption::Error> {
let http_client = operation_config.http_client();
let url_str = &format!(
"{}/subscriptions/{}/providers/Microsoft.Migrate/assessmentProjects",
operation_config.base_path(),
subscription_id
);
let mut url = url::Url::parse(url_str).cont... | Rust | 0 |
}
input.sort_by(|a, b| a.partial_cmp(b).unwrap());
let mut ks = vec![];
let size = input.len() / (k as usize);
for i in 1..k {
ks.push(input[(i as usize) * size] as f32);
}
for i in 0..k - 1 {
let perc = (((i + 1) * size as u32) as f32) / input.len() as f32;
let perc_... | Rust | 0 |
32> = std::collections::BTreeMap::new();
}
lazy_static::lazy_static! {
pub static ref empty_int_string_map: std::collections::BTreeMap<i32, String> = std::collections::BTreeMap::new();
}
lazy_static::lazy_static! {
pub static ref empty_string_int_map: std::collections::BTreeMap<String,... | Rust | 0 |
kill):
partial_matches.add(p_kw)
partial_score = (len(partial_matches) / max(len(project_keywords), 1)) * 20
score += exact_score + partial_score
debug_info.append(f"Exact Keyword Score: {exact_score:.2f}")
debug_info.appe... | Python | 1 |
:
# Based on 3.4. in https://arxiv.org/pdf/2305.08891.pdf
noise_pred = rescale_noise_cfg(
noise_pred,
noise_pred_text,
guidance_rescale=guidance_rescale,
)
# compute the p... | Python | 1 |
rue,
save_weights_only=True,
auto_insert_metric_name=True,
dirpath=output_dir,
every_n_epochs=1,
save_on_train_epoch_end=save_on_train_epoch_end,
mode=mode, )
def build_early_stop_callback(self, train_stage):
self.validate_model_stage(... | Python | 1 |
from __future__ import annotations
import subprocess
from PyInstaller import __main__ as pyi_main
# Test out the package by importing it, then running functions from it.
def test_pyi_hooksample(tmp_path):
app_name = "userapp"
workpath = tmp_path / "build"
distpath = tmp_path / "dist"
app = tmp_path ... | Python | 1 |
{
Some(time) => Some(time),
None => None,
};
let last_updated = convert_option_string_to_option_date(last_updated);
let hide: i32 = row.get(3)?;
Ok(ContactType::new_from_db(id, name, last_updated, hide))
... | Rust | 0 |
# -*- encoding:utf-8 -*-
"""Autogenerated file, do not edit. Submit translations on Transifex."""
MESSAGES = {
"%d min remaining to read": "%d دقیقه برای خواندن باقی مانده",
"(active)": "(فعال)",
"Also available in:": "همچنین قابل دسترس از:",
"Archive": "آرشیو",
"Atom feed": "",
"Authors": "نوی... | Python | 1 |
!(throwaway_vec[1 << 15] == 99);
kernel.set_arg("buf", Some(&buffer)).unwrap();
}
/// Create a vector on the heap, then a buffer right after it. Assign the
/// buffer as a kernel argument. Let them both fall out of scope. Run kernel.
/// If a copy of the pointer to the buffer is not made by the kernel, it will
/... | Rust | 0 |
import ParkingCar0
import gymnasium as gym
import pygame
import sys
pygame.init()
screen = pygame.display.set_mode((400, 400))
env = gym.make("ParkingCar0/ParkingCar-v0", render_mode='human')
MS_FOR_FRAME = 30
for game in range(1):
done = False
action = 0
initial_state = env.reset()
while True:
... | Python | 1 |
down
SoftwareShutdown,
/// Unknown function
Unknown,
}
const fn atsam4_cs_to_pcs(cs: u8) -> u8 {
match cs {
0 => 0b0000, // xxx0 => NPCS[3:0] = 1110
1 => 0b0001, // xx01 => NPCS[3:0] = 1101
2 => 0b0011, // x011 => NPCS[3:0] = 1011
3 => 0b0111, // 0111 => NPCS[3:0] = 0111... | Rust | 0 |
} else {
sse_none
};
// accumulate possible filter values into the tally
tally[0] += sse_none;
tally[mask] -= sse_none;
if flatp {
tally[mask] += sse_wide6;
} else {
tally[mask] += sse_narrow2;
tally[nhev] -= sse_narrow2;
tally[nhev] += sse_narrow4;
}
}
}... | Rust | 0 |
e big integer");
let c = BigUint::parse_bytes(
b"77578995801157823671636298847186723593814843845525223303932",
10,
)
.expect("failed to parse big integer");
BigUint::modpow(&c, &d, &n)
}
// RSA Starter 6
pub fn ras_starter_6() -> String {
let n = b"15216583654836731327639981224133... | Rust | 0 |
# -------------------------------------------------------------
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you unde... | Python | 1 |
# Copyright 2024 The TensorFlow Authors. 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 required by applica... | Python | 1 |
t_reference) == str(query_object)
def test_supports(self):
# Arrange
connector = storage_connector.BigQueryConnector(0, "BigQueryConnector", 99)
external_feature_group = feature_group.ExternalFeatureGroup(
storage_connector=connector, primary_key=[""]
)
# Act
... | Python | 1 |
t_ProtectCall = 7,
ButtonRequest_SignTx = 8,
ButtonRequest_FirmwareCheck = 9,
ButtonRequest_Address = 10,
ButtonRequest_PublicKey = 11,
}
impl ::protobuf::ProtobufEnum for ButtonRequestType {
fn value(&self) -> i32 {
*self as i32
}
fn from_i32(value: i32) -> ::std::option::Option<B... | Rust | 0 |
y_path, "r") as f:
for line in f:
sql = sql + line
matches = re.findall(r'\b(\w+)\s*=\s*(\w+)\b', sql)
for match in matches:
key, value = match
if not key.isdigit() and not value.isdigit():
join_pairs.append(match)
# counter = Count... | Python | 1 |
inished_path)
@pytest.mark.async_
@pytest.mark.slow
@pytest.mark.gpu
def test_actor_learner_training_gpu(self):
self._test_actor_learner_training(0, steps=100000)
@pytest.mark.async_
@pytest.mark.slow
def test_actor_learner_training_cpu(self):
self._test_actor_learner_train... | Python | 1 |
;
extern crate regex;
extern crate thiserror;
extern crate toml;
extern crate validator;
#[macro_use]
extern crate rocket;
extern crate rocket_sync_db_pools;
#[macro_use]
extern crate serde_derive;
#[macro_use]
extern crate lazy_static;
#[macro_use]
extern crate diesel;
#[macro_use]
extern crate diesel_migrations;
#[m... | Rust | 0 |
cation": {
"geohash": "u0"
}
}
},
{
"match_all": {}
}
],
"must": {
... | Python | 1 |
+= 1;
}
}
}
for i in 0..N {
for j in 0..N {
tiles[i][j] = ids[tiles[i][j]];
}
}
let mut ps = mat![0; N; N];
for i in 0..N {
for j in 0..N {
ps[i][j] = rng.gen_range(0, 100);
}
}
Input { s, tiles, ps }
}
fn rect(x: usize, y: usize, w: usize, h: usize, fill: &str) -> Rectangle {
Rectangle::new... | Rust | 0 |
// displaying it to the user.
#[serde(skip_serializing_if = "Option::is_none")]
pub mutable_content: Option<u8>,
}
/// Different notification content types.
#[derive(Serialize, Debug, Clone)]
#[serde(untagged)]
pub enum APSAlert {
/// Text-only notification.
Plain(String),
/// A rich localized noti... | Rust | 0 |
"""
raise NotImplementedError("Subclasses must implement `get_annotated_queryset`.")
def get_queryset(self):
sort_by = self.request.GET.get('sort', self.default_sort_field)
direction = self.request.GET.get('direction', 'asc')
if direction == 'desc':
sort_by = f'-{sort... | Python | 1 |
eturn result;
}
readonly Func<int, int, bool> BlocksLight;
readonly Func<int, int, int> GetDistance;
readonly Action<int, int> SetVisible;
Offset source, quadrant;
int rangeLimit;
}
*/
use std::sync::Once;
static ALREADY_INIT: Once = Once::new();
mod c_predicates {
#[link(name = "predicates")]
... | Rust | 0 |
# Copyright 2015 The TensorFlow Authors. 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 required by applica... | Python | 1 |
pa",
"Howard_Y",
"萌新6:开启6次以上Fever状态\n高手8:取得两次“S”评价,取得300000以上的分数\n大触11:完美击退所有摆锤和突袭敌人,完美躲避所有障碍,完美演奏所有乐谱(长按)"
],
1061:
[
"Luna Express 2032",
"放弃治疗Vol.1",
"Sakamiya feat.小宮真央",
"1:55",
"100~155",
"购买曲包",
"4-6-8",
"8⭐",
"lu... | Python | 1 |
SE_CDET_0_CTRL_1_SPEC {
type Reader = R;
}
#[doc = "`write(|w| ..)` method takes [se_cdet_0_ctrl_1::W](W) writer structure"]
impl crate::Writable for SE_CDET_0_CTRL_1_SPEC {
type Writer = W;
}
#[doc = "`reset()` method sets se_cdet_0_ctrl_1 to value 0"]
impl crate::Resettable for SE_CDET_0_CTRL_1_SPEC {
#[... | Rust | 0 |
llowed_updates)
.limit(self.limit);
match self.api.send_timeout(request, self.timeout).await {
Ok(updates) => {
for update in updates {
self.last_update = max(update.id, self.last_update);
yield update;
... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
RTT2UDP配置文件
"""
import json
import os
import sys
import logging
from pathlib import Path
class Config:
def __init__(self):
# 设置应用程序名称
self.app_name = "RTT2UDP"
# 配置文件路径
self.config_file = self._get_config_path()
... | Python | 1 |
verviewResponse(AbstractModel):
"""DescribeDSPAAssessmentProcessingRiskOverview返回参数结构体
"""
def __init__(self):
r"""
:param _ProcessingRiskCount: 待处理的风险数
:type ProcessingRiskCount: int
:param _AffectedAssetCount: 受影响的资产数
:type AffectedAssetCount: int
:param _... | Python | 1 |
# Copyright 2017-2020 EPAM Systems, Inc. (https://www.epam.com/)
#
# 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 appli... | Python | 1 |
= "dox"))]
fn connect_initialize_web_extensions<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v2_8", feature = "dox"))]
fn connect_property_local_storage_directory_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId;
#[cfg(any(feature = "v2_10", feature = "d... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.