text string | label_name string | labels int64 |
|---|---|---|
at.call(mem_addr)?;
println!("Value at {:#x?}: {:?}", mem_addr, result);
assert_eq!(result, val);
// Now instead of using hard coded memory addresses, let's try to write
// something at the end of the second memory page and read it.
let page_size = 0x1_0000;
let mem_addr = (page_size * 2) - mem... | Rust | 0 |
from typing import List
from .base import ConfigBase
class SchedulerConfig(ConfigBase):
pass
class NoneSchedulerConfig(SchedulerConfig):
"""Do nothing"""
pass
class ReduceLROnPlateauConfig(SchedulerConfig):
# One of min, max.
# In min mode, lr will be reduced when val loss has stopped decreas... | Python | 1 |
[idx - 1]);
if chars[idx..].starts_with(&pred) {
for r_idx in (1..chars.len()).rev() {
if chars[r_idx..].starts_with(&pred) {
return chars[r_idx..].iter().fold(String::new(), |mut acc, ch| { acc.push(*ch); acc});
}
}
}
}
... | Rust | 0 |
);
test_exec!(
|helpers| Classes { helpers },
get_semantics_not_defined_on_parent,
r#"
"use strict";
class Base {
}
class Obj extends Base {
get() {
return super.test;
}
}
Object.defineProperty(Obj.prototype, 'test', {
value: 2,
writable: true,
configurable: true,
});
const obj = new Obj();... | Rust | 0 |
(v) => v.$func($($args),*),
UINode::Menu(v) => v.$func($($args),*),
UINode::MenuItem(v) => v.$func($($args),*),
UINode::MessageBox(v) => v.$func($($args),*),
UINode::VectorImage(v) => v.$func($($args),*),
UINode::Expander(v) => v.$func($($args),*),
... | Rust | 0 |
"""
團隊構建器組件模組
提供多種團隊構建策略,包括隨機選擇、平衡團隊、進攻團隊等。
"""
import random
from typing import List, Optional
from poke_env.teambuilder import Teambuilder
class CustomTeamBuilder(Teambuilder):
"""使用自定義團隊的構建器"""
def __init__(self, team_string: str):
"""初始化自定義團隊構建器
Args:
team_strin... | Python | 1 |
a cca aac ....
/// where np is the size of the combination tupple
pub fn permutations<T: Copy>(range: &[T], np: usize) -> Vec<Vec<T>> {
let n = range.len();
let mut factors = Vec::new();
for i in 0..n.pow(np as u32) {
let mut base = Vec::new();
for j in 0..np as u32 {
base.push(... | Rust | 0 |
from robodm.database.db_connector import DatabaseConnector
from robodm.database.db_manager import DatabaseManager
from robodm.database.polars_connector import (
DataFrameConnector,
LazyFrameConnector,
PolarsConnector,
)
# from robodm.db.postgres import Postgres
__all__ = [
"DatabaseConnector",
"Da... | Python | 1 |
) {
let ret = run_async(|tx, l| {
let b = Bytes::from_owned(vec![1, 2, 3]);
let strm = MemoryInputStream::new_from_bytes(&b);
let buf = vec![0; 10];
strm.read_async(
buf,
glib::PRIORITY_DEFAULT_IDLE,
::NONE_CANCELLA... | Rust | 0 |
# See https://github.com/networkx/networkx/pull/1474
# Copyright 2011 Reya Group <http://www.reyagroup.com>
# Copyright 2011 Alex Levenson <alex@isnotinvain.com>
# Copyright 2011 Diederik van Liere <diederik.vanliere@rotman.utoronto.ca>
"""Functions that generate the triad graphs, that is, the possible
digraphs on thre... | Python | 1 |
###### Script para descarga de archivos esenciales desde el portal empleo
try:
import keyring # opcional
except ImportError:
keyring = None
# --------- Credenciales seguras ----------
CUIT = os.getenv("PORTALEMPLEO_CUIT")
PASSWORD = os.getenv("PORTALEMPLEO_PASSWORD")
# Intentar cargar de keyring si no hay en... | Python | 1 |
"/json_api") => api_get_json().await,
_ => {
let mut res = Response::new(StatusCode::NotFound);
res.set_body(Body::from_bytes(NOTFOUND_STR.into()));
Ok(res)
}
}
}
async fn listen(listener: Async<TcpListener>, tls: Option<TlsAcceptor>) -> Result<()> {
let hos... | Rust | 0 |
as_secs())
.unwrap_or(0);
let name = format!(
"i3-alternate-focus.{}.{}.sock",
std::process::id(),
timestamp
);
base.push(&name);
base
};
xprop::set(SOCKET_PATH_PROP, &socket.to_string_lossy()).expect("Set xprop");
// Listen... | Rust | 0 |
import socket
# XOR function
def xor(a,b):
result = []
for i in range(1,len(b)):
if a[i] == b[i]:
result.append('0')
else:
result.append('1')
return ''.join(result)
# Division method
def mod2div(divident, divisor):
pick = len(divisor)
tmp = divident[0:p... | Python | 1 |
# -------------------------------------------------------------
#
# 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 |
members to vote on motions.
/// Motions may end in fewer blocks if enough votes are cast to determine the result.
pub const TechnicalMotionDuration: BlockNumber = 7 * DAYS;
/// The maximum number of Proposlas that can be open in the technical committee at once.
pub const TechnicalMaxProposals: u32 = 100;
/// The ... | Rust | 0 |
import pyautogui
import pyperclip
import time
while True:
a=pyautogui.position()
# print(a)
# 1206,1040
# 671,221 to 1829,959 | Python | 1 |
__(self, image, masks, boxes=None, labels=None):
im_h, im_w, depth = image.shape
expand_image = np.zeros((self.height, self.width, depth), dtype=image.dtype)
expand_image[:, :, :] = [128, 128, 128]
expand_image[:im_h, :im_w] = image
if self.pad_gt:
... | Python | 1 |
from django.urls import path
from genericViews import views
urlpatterns = [
path('list/',views.index),
path('create/',views.create),
path('update/<int:id>/',views.update),
path('count/<int:id>/', views.student_by_id),
] | Python | 1 |
tetime.strptime(args.start_date, '%Y-%m-%d')
datetime.strptime(args.end_date, '%Y-%m-%d')
except ValueError:
print("Error: Dates must be in YYYY-MM-DD format")
sys.exit(1)
num_records = args.num_records
start_date = args.start_date
end_date = args.end... | Python | 1 |
n
def 十大股东(code: str, end_date: str = None) -> pd.DataFrame:
"""
获取东方财富网指定股票的十大股东信息。
参数:
code (str): 股票代码(如 '000333')
end_date (str): 截止日期(如 '2025-05-23'),可选
返回:
pd.DataFrame: 十大股东数据,失败返回空DataFrame
"""
code = encode(code)
url = "https://datacenter.eastmoney.com/sec... | Python | 1 |
import json
import os
from typing import Dict
class Translator:
_translations: Dict[str, Dict[str, str]] = {} # 缓存语言数据
_default_lang: str = "en" # 默认语言
_translations_path: str = "../locales" # 翻译文件目录
@classmethod
def set_locales(cls, path: str):
if path:
cls._translations_p... | Python | 1 |
* (1 - inb) + crop_resamp * inb
# else:
# full_resamp = bilinear_sample2d(torch.cat([crop, mask], dim=1), grids_flat[:, :, 0], grids_flat[:, :, 1])
# full_resamp = full_resamp.reshape(B, C+1, H, W)
# crop_resamp = full_resamp[:,:3]
# mask_resamp = full_resamp[:,3... | Python | 1 |
(&mut self, args: &str, ctx: &mut CliCtx<T>) -> Result<()> {
(self.invoke)(args, ctx)
}
fn help(&self) -> String {
format!("{} {}: {}", self.long, self.short, self.help)
}
}
/// Run the CLI
///
/// # Arguments
///
/// * `process` - target process
pub fn run(process: Win32Process<impl Virtu... | Rust | 0 |
# Linear search algorithm
def linear_search(arr, target):
# Loop through each element in the array
for i in range(0, len(arr)):
# Check if the current element is equal to the target
if arr[i] == target:
return f"found {arr[i]}"
# If the target is not found, return "not found"
... | Python | 1 |
sert_eq!(path, added[0].path);
assert_eq!(1, removed.len());
assert_eq!(path, removed[0].path);
}
#[test]
fn compute_entry_diff_finds_update_of_duplicated() {
let path_a = "/path/to/A";
let path_a_old_checksum = [0; 20];
let path_b = "/path/to/B";
let path_b_... | Rust | 0 |
"""
Módulo con utilidades para validación de datos numéricos.
"""
| Python | 1 |
l), &qq) {
ww = - BigInt::from(2) * w;
} else {
ww = BigInt::from(2) * w;
}
if ww < BigInt::from(0) {
ww += BigInt::from(l);
}
mod_result.push(bigi... | Rust | 0 |
"""日誌查詢 API
此模組實現日誌查詢相關的 API 端點,包括日誌搜尋、篩選、匯出等功能。
"""
import logging
from datetime import datetime
from typing import List, Optional, Any
from fastapi import APIRouter, HTTPException, Query, status, BackgroundTasks
from pydantic import BaseModel, Field
from src.api.models.responses import APIResponse, COMMON_RESPONS... | Python | 1 |
config for config in stream_configs if config not in self.execute_stage_stream_configs
])
self.edge_data = {
'execute_stage_stream_configs': self.execute_stage_stream_configs,
'execute_stage_streamed_analytics': execute_stage_streamed_analytics,
'ex... | Python | 1 |
info.clone(), Uint64::new(1)).unwrap_err();
assert_eq!(err, ContractError::SendNativeTokens {});
let info = mock_info("newone", &[]);
//try deposit_native() env.height "1" deadline "5" voters "empty" owner "crator" sender "newone"
let err = execute_deposit_native(deps.as_mut(),env.clone... | Rust | 0 |
xml-attr="true" />
// <param name="groups" type="object" array="true" optional="true" summary="用户所在的权限组">
// <param name="id" type="string" summary="权限组 ID" />
// <param name="name" type="string" summary="权限组名称" />
// </param>
// </param>
// </respons... | Rust | 0 |
ed(0) };
if val.len() != 1 {
return Err(HyperError::Header);
}
match unsafe { val.get_unchecked(0) } {
b'T' => Ok(Overwrite(true)),
b'F' => Ok(Overwrite(false)),
_ => Err(HyperError::Header),
}
}
}
impl HeaderFormat for Overwrite {
... | Rust | 0 |
# %%
start_time = time()
res_scipy = minimize(fun = metric,
x0 = init_guess,
method = 'Powell',
#method='SLSQP',
bounds = bnds,
options=dict(maxiter=1_000_000),
tol = tol)
print(f'[{str(... | Python | 1 |
i
i-3
i-2
case 2 : i-1 ┌────┐
└─══>┘i-3
i i-4 (i overlapped i-4)
case 3 : i-4
┌──┐
│i<┼─┐
i-3│ i-5│i-1
└────┘
i-2
*/
#[cfg(test)]
mod tests {
use super... | Rust | 0 |
cay)
sprint("process", rank, "out of total ", comm.Get_size(), "started")
if (rank == 0):
master()
else:
slave()
# Making a function that creates the training environment with the MPI parameters
def mpi_fork(n):
if n<=1:
return "child"
if os.getenv("IN_MPI") is None:
env = os.environ.copy()
... | Python | 1 |
merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software... | Rust | 0 |
في /profile
• تأكيد مزدوج مطلوب للحماية
• العملية لا يمكن التراجع عنها
<b>💰 خدمة بيع الكوينز:</b>
• استخدم /sell لبيع كوينز FIFA
• أفضل الأسعار في السوق المصري
• دفع فوري وآمن 100%
• جميع المنصات مدعومة
<b>📞 للدعم الفني:</b>
تواصل مع فريق الدعم إذا واجهت أي مشكلة"""
@staticmethod
def get_about_message... | Python | 1 |
e;
use crate::{MaximumBlockWeight, AvailableBlockRatio, Runtime};
use crate::{constants::currency::*, TransactionPayment, TargetBlockFullness};
use frame_support::weights::{Weight, WeightToFeePolynomial};
fn max() -> Weight {
MaximumBlockWeight::get()
}
fn target() -> Weight {
TargetBlockFullness::get() * m... | Rust | 0 |
self.index)
}
}
impl TxoPointer {
/// Constructs a new TX input (mainly for testing/tools).
pub fn new(id: TxId, index: usize) -> Self {
TxoPointer {
id,
index: index as TxoSize,
}
}
}
/// converts transaction ID from hex string?
#[cfg(not(feature = "mesalock_s... | Rust | 0 |
import torch.nn as nn
import torch.nn.functional as F
import torch
from models.RendPoint import sampling_features
__all__ = ["MultiRendLoss"]
class MultiRendLoss(nn.Module):
def __init__(self):
super(MultiRendLoss, self).__init__()
def forward(self, output, mask):
# coarse, stage1, stage2, ... | Python | 1 |
import os
import zipfile
import glob
import shutil
import numpy as np
import torch
import gradio as gr
import cv2
from tqdm import tqdm
import vggt_slam.slam_utils as utils
from vggt_slam.solver import Solver
from vggt.models.vggt import VGGT
def run_slam(
image_zip,
use_sim3=False,
submap_size=16,
m... | Python | 1 |
# -*- coding:UTF-8 -*-
# Copyright (c) 2020 PaddlePaddle 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
#
# ... | Python | 1 |
#!/usr/bin/env python3
import os
import sys
key = sys.argv[1]
expected = sys.argv[2] if len(sys.argv) > 2 else None
if os.environ.get(key) == expected:
sys.exit(0)
sys.exit(f'Expected {expected!r}, was {os.environ.get(key)!r}')
| Python | 1 |
dist1 = Levenshtein.distance(choice1[i], answer)
dist2 = Levenshtein.distance(choice2[i], answer)
if (
dist1 <= len(choice1[i]) // 3
and dist2 >= len(choice2[i]) - len(choice2[i]) // 3
and dist1 + 4 <= dist2
... | Python | 1 |
.event(
ctx,
&Event::MouseDown(self.translate_mouse_event(inverse, me)),
data,
env,
),
MouseUp(me) => self.child.event(
ctx,
&Event::MouseUp(self.translate_mouse_event(... | Rust | 0 |
#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from parlai.utils.testing import AutoTeacherTest
class TestDefaultTeacher(AutoTeacherTest):
task = "light_dialog_w... | Python | 1 |
"django.contrib.auth",
"django.contrib.contenttypes",
"django.contrib.sessions",
"django.contrib.sites",
"django.contrib.messages",
"django.contrib.staticfiles",
# Uncomment the next line to enable the admin:
# 'django.contrib.admin',
# Uncomment the next line to enable admin documen... | Python | 1 |
a
0c @ sx d Z ddlmZ ddlZddlmZmZmZmZ ddl m
Z
mZ erRddlm
Z
nddlm
Z
G dd deZdgZdS ) zE
A pretty lame implementation of a memoryview object for Python 2.6.
)IntegralN)istextisbytesPY2with_metaclass)noissubset)Iterablec ... | Python | 1 |
.random() for _ in range(dim)]
def run_pipeline(text: str,
doc_type: str = "markdown",
density_hint: str = "mixed",
use_semantic: bool = False,
parent_max_tokens: int = 1100) -> Dict[str, Any]:
meta = dict(doc_type_hint=doc_type, density_hint=dens... | Python | 1 |
x7f\xc2G\xff\x00\x09m\xda\xad\x9b\x5cK\x13\x7f\x12\xfb\
WA\xe2?\x83\x7f\xbait\xbb\xaf\xb1\xca\xdf\xde\x8c\
H\x8d\xecGZ\xf2\xadS\xe2\xff\x00\x88>\x1ax\xca\
\xcfC\xd4\xb4\x1bV\xb5l/\xdb\x22\xca#~\x18\xa8\
\xf6r\x97\xbd\x02cJ3\x8bp\xdc\xed\xee\xadn,\
%_*%n?\x8f\xe6\xab\xfa6\xb3\x7fk\xba+\
\xa6\x8b\xca\xdb\xfc5-\x87\x88\xe... | Python | 1 |
(Exact, Version::new(3, 6, 0)),
Constraint::new(Exact, Version::new(3, 7, 0)),
Constraint::new(Exact, Version::new(3, 8, 0)),
]),
case::cp26("cp26", vec![Constraint::new(Exact, Version::new(2, 6, 0))]),
... | Rust | 0 |
}
)
if include_object:
X_regular["b"] = pd.Series(["a", "b", "c", "d"], dtype="object")
X_extension = X_regular.assign(a=X_regular["a"].astype(extension_dtype))
X_regular_checked = check_array(X_regular, dtype=None)
X_extension_checked = check_array(X_extension, dtype=None)
as... | Python | 1 |
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
# Given data points
x_values = np.array([5, -2])
y_values = np.array([3, 4])
# Create a meshgrid of slope and intercept values for visualization
a_vals = np.linspace(-10, 10, 100)
b_vals = np.linspace(-10, 10, 100)
A, B = np.me... | Python | 1 |
//////////////////////////////////////////////////////////////////////////////
#[macro_use]
extern crate serde_derive;
#[derive(Serialize, Deserialize)]
struct Unit;
#[derive(Serialize, Deserialize)]
struct Newtype(u8);
#[derive(Serialize, Deserialize)]
struct Tuple(u8, u8);
#[derive(Serialize, Deserialize)]
stru... | Rust | 0 |
_path() {
test(
PathBuf::from("/usr/local/lib").into_boxed_path(),
&[Token::Str("/usr/local/lib")],
);
test(
PathBuf::from("/usr/local/lib").into_boxed_path(),
&[Token::String("/usr/local/lib")],
);
test(
PathBuf::from("/usr/local/lib").into_boxed_path(),
... | Rust | 0 |
# Copyright 2018 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
t)
.try_init()
.map_err(Error::factory(ErrorKind::LoggerError))
}
#[cfg(test)]
use super::super::super::super::location::location::*;
#[cfg(test)]
use super::super::super::super::node::node::*;
#[cfg(test)]
use super::super::super::super::node_arr::node_arr::*;
#[cfg(test)]
use super::super::super::supe... | Rust | 0 |
UVA8: u32 = 38;
pub const GX_CTF_A8: u32 = 39;
pub const GX_CTF_R8: u32 = 40;
pub const GX_CTF_G8: u32 = 41;
pub const GX_CTF_B8: u32 = 42;
pub const GX_CTF_RG8: u32 = 43;
pub const GX_CTF_GB8: u32 = 44;
pub const GX_TF_Z8: u32 = 17;
pub const GX_TF_Z16: u32 = 19;
pub const GX_TF_Z24X8: u32 = 22;
pub const GX_CTF_Z4: u... | Rust | 0 |
ndexed(out, &mut state),
0x0000_0018 => call_leaf_indexed(out, &mut state),
0x0000_001B => call_leaf_1b(out, &mut state),
0x0000_001D => call_leaf_indexed(out, &mut state),
0x0000_001F => call_leaf_x2apic(out, &mut state),
0x0000_0020 => call_leaf_indexed(out,... | Rust | 0 |
65,
QUASIQUOTE_1 = 66,
COMMA = 67,
COMMA_1 = 68,
COMMA_AT = 69,
COMMA_AT_1 = 70,
BUILD_CLOSURE = 71,
JUMP = 72,
JUMP_IF = 73,
JUMP_IF_BOUND = 74,
JUMP_IF_NOT = 75,
JUMP_IF_NULL = 76,
JUMP_IF_NOT_NULL = 77,
JUMP_IF_EQ = 78,
JUMP_IF_NOT_EQ = 79,
JUMP_IF_EQ_CONS... | Rust | 0 |
lid capabilities: {0}")]
InvalidCapabilities(RtpCapabilitiesError),
/// No compatible media codecs
#[error("No compatible media codecs")]
NoCompatibleMediaCodecs,
}
fn generate_ssrc() -> u32 {
fastrand::u32(100_000_000..999_999_999)
}
/// Validates [`RtpParameters`].
pub(crate) fn validate_rtp_par... | Rust | 0 |
= 670;
pub(crate) const VE: Num = 862;
pub(crate) const VG: Num = 92;
pub(crate) const VI: Num = 850;
pub(crate) const VN: Num = 704;
pub(crate) const VU: Num = 548;
pub(crate) const WF: Num = 876;
pub(crate) const WS: Num = 882;
pub(crate) const YE: Num = 887;
pub(crate) const YT: Num = 175;
pub(crate) const ZA: Num ... | Rust | 0 |
from typing import Optional, Tuple, Union, overload
import paddle
from paddle import Tensor
from paddle_geometric.typing import Adj, OptTensor
from paddle_geometric.utils import degree, scatter
@overload
def homophily(
edge_index: Adj,
y: Tensor,
batch: None = ...,
method: str = ...,
) -> float:
... | Python | 1 |
expected_name).as_str());
assert_eq!(result, expected);
}
{
let result = subject.xor(clipping);
let expected = fixture_multi_polygon(format!("feature_types/out/xor/{}", expected_name).as_str());
assert_eq!(result, expected);
}
}
#[test]
fn test_poly() {
let clipping =... | Rust | 0 |
Tracked(1), Tracked(-1)), Tracked(0)
@builder
def x_plus_one(tracked_x):
assert Tracked.n_instances_in_memory == 1
return tracked_x.value + 1
@builder
def x_plus_two(x_plus_one):
assert Tracked.n_instances_in_memory == 0
return x_plus_one + 1
assert builder.build()... | Python | 1 |
_message(MessageType::WARN, &format!("Read file {} meta failed: {}", p_str, err));
},
Ok(metadata) => {
let len = metadata.len();
if len >= options.parsed_huge_file_size {
huge_file_count.add_one();
huge_file_size.add(len);
... | Rust | 0 |
M2 AVG305T1 Frame of Reference",
};
/// SPM2 AVG152T1 Frame of Reference
///
/// - **UID:** 1.2.840.10008.1.4.1.15
/// - **UID Type:** Well-known frame of reference
pub static SPM2AVG152T1FrameofReference: UID = UID {
ident: "SPM2AVG152T1FrameofReference",
uid: "1.2.840.10008.1.4.1.15",
name: "SPM2 AVG152T... | Rust | 0 |
from setuptools import setup
from mlagents.plugins import ML_AGENTS_TRAINER_TYPE
setup(
name="mlagents_trainer_plugin",
version="0.0.1",
# Example of how to add your own registration functions that will be called
# by mlagents-learn.
#
# Here, the get_example_stats_writer() function in mlagents... | Python | 1 |
alvar(self):
try:
codigo = self.entries['codigo'].get()
nome = self.entries['nome'].get()
categoria_nome_selecionada = self.categoria_combobox.get()
categoria_id = self.categorias_map.get(categoria_nome_selecionada)
preco_custo = float(self.entries['... | Python | 1 |
# 粗略的碰撞检测(视作圆形) 如果此时不碰撞,就无需按矩形检测。返回的距离作为该点车到障碍物的大致距离
import math
def ColliTestRough(ego, obs,egoLength, egoWidth)->bool:
dis = math.sqrt((ego.x - obs.x) ** 2 + (ego.y - obs.y) ** 2)
max_veh = max(egoLength, egoWidth)
max_obs = max(obs.length*1.5, obs.width*2)
return dis - (max_veh + max_obs) / 2 <=0
... | Python | 1 |
RIORITY_1,
}
}
#[doc = "Checks if the value of the field is `AXBS_P_M0_HIGH_PRIORITY_0`"]
#[inline(always)]
pub fn is_axbs_p_m0_high_priority_0(&self) -> bool {
*self == AXBS_P_M0_HIGH_PRIORITY_A::AXBS_P_M0_HIGH_PRIORITY_0
}
#[doc = "Checks if the value of the field is `AXBS_P_M0... | Rust | 0 |
}
},
HtmlToken::Textish(textish) => {
match tag_stack.last_mut() {
None => {
expect_end!(input);
return Ok(SnaxItem::Content(textish.content));
},
Some((_, parent_children)... | Rust | 0 |
f len(memeber_set) > 0:
warnings.warn("%s fileds are useless." % ",".join(memeber_set))
class DescribeSlowLogsResponse(AbstractModel):
"""DescribeSlowLogs返回参数结构体
"""
def __init__(self):
r"""
:param _Count: 慢日志总数
:type Count: int
:param _SlowLogs: 慢日志详... | Python | 1 |
image: Image<I>) -> Element<'a, Message, Renderer> {
Element::new(image)
}
}
<filename>src/sum/sum.rs<gh_stars>1-10
#![crate_name = "uu_sum"]
/*
* This file is part of the uutils coreutils package.
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE file
* t... | Rust | 0 |
n, ($($arg),*), $base_ty, <$($param_ty,)* U513>, $($rest)*),
"1024" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* U1024>, $($rest)*),
"2048" => type_dispatch!($function, ($($arg),*), $base_ty, <$($param_ty,)* U2048>, $($rest)*),
"4096" => type_dispatch!($functio... | Rust | 0 |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~# CatUserBot #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Copyright (C) 2020-2023 by TgCatUB@Github.
# This file is part of: https://github.com/TgCatUB/catuserbot
# and is released under the "GNU v3.0 License Agreement".
# Please see: https://github.com/TgCatUB/catuserbot/blob/... | Python | 1 |
(-12, 20, 30, Face::PX, 1.0),
]);
}
/// Test the case where the starting point is exactly on a cube border
/// and the ray is mostly perpendicular to that axis.
#[test]
fn start_on_cube_edge_perpendicular() {
// Positive origin, positive direction
assert_steps(
... | Rust | 0 |
usize>,
{
self.values.iter()
.enumerate()
.map(|(i, v)| (K::from(i), v))
}
/// Returns the number of elements in the map.
pub fn len(&self) -> usize { self.values.len() }
/// Returns an iterator over values in the map.
///
/// See also [`DenseNatMap::iter`].... | Rust | 0 |
from google.cloud import bigquery
SAFETY_HISTORY_TIME_PARTITIONING = bigquery.TimePartitioning(
type_=bigquery.TimePartitioningType.DAY
)
def get_client(project_id: str, location: str) -> bigquery.Client:
return bigquery.Client(project=project_id, location=location)
def ensure_dataset_exists(bq: bigquery.C... | Python | 1 |
db3,
0xb83535548e5f41,
0x371147684ccb0c23,
0x194f6f4fa500db52,
0xc4571dc78a4c5374,
0xe4d46d479999ca97,
0x76b6785a615a151c,
0xcceb8bcea7eaf8c1,
0x80d87a6fbe5ae687,
0x6a97ddddb85ce85,
0xd783958f26034204... | Rust | 0 |
wh = x2y2 - x1y1
return torch.cat((c_xy, wh), dim) # xywh bbox
return torch.cat((x1y1, x2y2), dim) # xyxy bbox
def bbox2dist(anchor_points, bbox, reg_max):
"""Transform bbox(xyxy) to dist(ltrb)."""
x1y1, x2y2 = bbox.chunk(2, -1)
return torch.cat((anchor_points - x1y1, x2y2 - anchor_points), ... | Python | 1 |
}
]
"""
# date = time.split(' ')[0]
# hour_min = time.split(' ')[1]
# hour = hour_min.split(':')[0]
# min = hour_min.split(':')[1]
trace_file = base_dir + "/trace/trace.csv"
metric_dir = base_dir + "/metric/"
path_list = os.listdir(metric_dir)
# metric_list = ['CpuUsageR... | Python | 1 |
,
binary_expr(col(FIELD_COLUMN_NAME), Operator::Eq, lit("f2")),
),
binary_expr(lit(true), Operator::Or, lit(true)),
vec!["f1", "f2"],
),
];
for (input, exp_expr, field_columns) in cases {
let rewritten = input.r... | Rust | 0 |
read_without_format as u32,
shaderStorageImageWriteWithoutFormat : device_create_info.enabled_features.shader_storage_image_write_without_format as u32,
shaderUniformBufferArrayDynamicIndexing : device_create_info.enabled_features.shader_uniform_buffer_array_dynamic_indexing as u32,
shaderSample... | Rust | 0 |
tus_id_map: HashMap::new(),
status_notifiers: Arena::new(),
}
}
pub(crate) fn insert_channel(&mut self, id: protocol::Id) -> Option<ChannelReceiver> {
match self.channel_id_map.entry(id) {
Entry::Vacant(e) => {
// FIXME: implement back-pressure
... | Rust | 0 |
import os
import re
import dgl
import numpy as np
import torch as th
import glob
from data import parse_edgelist, get_features, read_edges, read_masked_nodes
from estimator_fns import get_logger
logging = get_logger(__name__)
def get_files(filename_pattern, root_dir):
return glob.iglob(os.path.join(root_dir, '')... | Python | 1 |
get(b: &mut Bencher) {
let mut b_tree = black_box(gen_b_tree());
let mut rng = rand::thread_rng();
let key = rng.gen::<u64>();
b_tree.insert(key, [0u8; 256]);
b.iter(|| {
b_tree.get(&key);
});
}<reponame>leontoeides/indicium
//! Support for the **grouped** `Select2` output format. Render... | Rust | 0 |
# models/sfa_journey.py
from odoo import models, fields, api
class SfaJourney(models.Model):
_name = 'sfa.journey'
_description = 'SFA Journey'
route_id = fields.Char(string='Rference', required='True')
name = fields.Char(string='Route Name', required='True')
description = fields.Text(string='Des... | Python | 1 |
"""
Type conversion
or
Type casting
int-> str
str->int
float->int
floar->str
"""
a="Python"
b="Lang"
print(a+b)
#str to int
a="100"
b="300"
c=int(a)
d=int(b)
print(c+d)
print(a+b)
# float to int
a=int(-56.99)
print(a) | Python | 1 |
s > 0:
print(
f"{n_with_illegal_characters} / {len(labels)} instances have illegal characters."
)
labels = labels.copy()
for index in itertools.cycle(range(len(labels))):
if index == 0 and shuffle:
random.shuffle(labels)
filepath, box, text = labels[index]... | Python | 1 |
# ------------------------------------------
# BDS 2,0
# Aircraft identification
# ------------------------------------------
from ... import common
def is20(msg: str) -> bool:
"""Check if a message is likely to be BDS code 2,0
Args:
msg (str): 28 hexdigits string
Returns:
bool: True or... | Python | 1 |
#n1=int(input("enter any number "))
#n2=int(input("enter any number "))
#n3=int(input("enter any number "))
#n4=int(input("enter any number "))
#numbers = {n1,n2,n3,n4}
#print(numbers)
#if(n1>n2 and n1>n3 and n1>n4):
# print("n1 is largent of all")
#elif (n2>n1 and n2>n3 and n2>n4):
# print("n2 is largent of all... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2023 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Python | 1 |
/LICENSE-2.0
Unless required by applicable law or agreed to in writing, 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.
... | Rust | 0 |
]
pub type TX_DATA_INT_RAW_R = crate::R<bool, bool>;
#[doc = "Reader of field `RX_DATA_INT_RAW`"]
pub type RX_DATA_INT_RAW_R = crate::R<bool, bool>;
#[doc = "Reader of field `ACK_ERR_INT_RAW`"]
pub type ACK_ERR_INT_RAW_R = crate::R<bool, bool>;
#[doc = "Reader of field `TIMEOUT_INT_RAW`"]
pub type TIMEOUT_INT_RAW_R = c... | Rust | 0 |
://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//
// ignore-lexer-test FIXME #15677
use prelude::v1::*;
use cmp;
use fmt;
use intrinsics;
use libc::{self, uintptr_t};
use os;
use slice;
use str;
use sync::atomic::{self, Ord... | Rust | 0 |
oject_path, target_file=file_path)
# If the file exists, read its content
full_file_path = project_path / file_path
existing_code = ""
if full_file_path.exists():
existing_code = full_file_path.read_text(encoding='utf-8')
elif modification_step.get('action') ... | Python | 1 |
u16::parse(parser)?,
CharStr::parse(parser)?,
))
}
fn skip(parser: &mut Parser) -> Result<(), Self::Err> {
parser.advance(4)?;
CharStr::skip(parser)
}
}
impl ParseAll for Nsec3param {
type Err = ParseAllError;
fn parse_all(parser: &mut Parser, len: usize... | Rust | 0 |
#!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2022 Thomas Harr <xDevThomas@gmail.com>
# Copyright (c) 2019 Dean Jackson <deanishe@deanishe.net>
#
# MIT Licence. See http://opensource.org/licenses/MIT
#
# Created on 2014-02-15
#
"""The :class:`Workflow` object is the main interface to this library.
:class... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.