text string | label_name string | labels int64 |
|---|---|---|
import os
import xmltodict
import json
from cron_translate import extractDetails
import pandas as pd
folderPath = '/Users/balamurugan/Desktop/RunDeck/Input_XML'
inputJsonPath = '/Users/balamurugan/Desktop/RunDeck/Json_File/input_json.json'
jsonFile = '/Users/balamurugan/Desktop/RunDeck/Json_File/final_json.json'
jsonS... | Python | 1 |
in.rs
pub mod args_cleanup;
pub mod config;
pub mod read_file;
pub mod search;
use config::Config;
use read_file::run;
use std::env;
use std::process;
fn main() {
let mut args: Vec<String> = env::args().collect();
args_cleanup::clean(&mut args);
let config = Config::new(&args).unwrap_or_else(|err| {
... | Rust | 0 |
rd_note = ? WHERE password_id = ?')
params = params + (self.data_to_modify[0],)
cursor.execute(statement, params)
connection.commit()
connection.close()
self.check_data_console.preview_data()
self.check_data_console.upda... | Python | 1 |
# so we need to simulate it
COLUMNS_EQUAL_SQL = """
WITH
a_except_b as (
SELECT
{columns_a}
FROM {relation_a} as {alias_a}
LEFT OUTER JOIN {relation_b} as {alias_b}
ON {join_condition}
WHERE {alias_b}.{first_column}... | Python | 1 |
----------------------------
@threaded
def plot_pr_curve(px, py, ap, save_dir=Path("pr_curve.png"), names=()):
"""Plots precision-recall curve, optionally per class, saving to `save_dir`; `px`, `py` are lists, `ap` is Nx2
array, `names` optional.
"""
fig, ax = plt.subplots(1, 1, figsize=(9, 6), tight_... | Python | 1 |
# -*- coding: utf-8 -*-
# pylint: disable=redefined-builtin
from typing import Iterable, Union
from ..core._imperative_rt.core2 import pop_scope, push_scope
from ..functional import clip, concat, minimum, norm
from ..tensor import Tensor
__all__ = ["clip_grad_norm", "clip_grad_value"]
def clip_grad_norm(
tensor... | Python | 1 |
indows_sys::core::HRESULT = -2145124337i32;
#[doc = "*Required features: `\"Win32_System_UpdateAgent\"`*"]
pub const WU_E_DM_BG_ERROR_TOKEN_REQUIRED: ::windows_sys::core::HRESULT = -2145099761i32;
#[doc = "*Required features: `\"Win32_System_UpdateAgent\"`*"]
pub const WU_E_DM_BITSTRANSFERERROR: ::windows_sys::core::HR... | Rust | 0 |
def __call__(self, sample):
label = sample['label']
h, w = label.shape
sample['label_down'] = dict()
for rate in self.downsampling_rates:
label_down = cv2.resize(label.numpy(), (w // rate, h // rate),
interpolation=cv2.INTER_NEAREST)
sample['label_down'][rate] = torch.from_nu... | Python | 1 |
# Copyright (C) 2018-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
# greater_equal paddle model generator
#
import numpy as np
from save_model import saveModel
import paddle
import sys
def greater_equal(name : str, x, y, data_type, cast_to_fp32=False):
paddle.enable_static()
with paddle.sta... | Python | 1 |
e {
start: Datetime {
year: 2003,
month: 9,
day: 16,
dayname: "Tue".into(),
hour: Some(9),
minute: Some(39),
},
end: Datetime {
year... | Rust | 0 |
d(item: proc_macro::TokenStream) -> proc_macro::TokenStream {
field::Field::parse(item.into())
.map(|field| field.into())
.unwrap_or_else(|error| error.to_compile_error())
.into()
}
/// Generates all necessary trait implementations and methods for a `#[repr(u8)]` `enum` type to be
/// used ... | Rust | 0 |
_universes_p1 -= p1_wins_this_throw;
// Scale p1 wins by number of universes from previous (i.e. p2) throw
p1_win_count += p1_wins_this_throw * total_universes_p2;
}
total_universes_p2 *= 27;
if let Some(p2_wins_this_throw) = p2_throw_ways.get(&round) {
// Som... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.response.AlipayResponse import AlipayResponse
class AlipayDataDataserviceAdCreativeCreateormodifyResponse(AlipayResponse):
def __init__(self):
super(AlipayDataDataserviceAdCreativeCreateormodifyResponse, self).__init__()
... | Python | 1 |
from __future__ import annotations
import mimetypes
import re
import warnings
from urllib.parse import quote
from mitmproxy.net.http import headers
def encode_multipart(content_type: str, parts: list[tuple[bytes, bytes]]) -> bytes:
if content_type:
ct = headers.parse_content_type(content_type)
i... | Python | 1 |
offset = fft.fhtoffset(dln, initial=-6*np.log(10), mu=mu)
>>> k = np.exp(offset)/r[::-1] # Output evaluation points
Define the analytical function.
>>> def f(x, mu):
... """Analytical function: x^(mu+1) exp(-x^2/2)."""
... return x**(mu + 1)*np.exp(-x**2/2)
Evaluate the function at... | Python | 1 |
Args:
----
ratio (np.ndarray): Input ratio matrix.
threshold (float): Threshold for NMS.
Returns:
-------
np.ndarray: Binary mask after applying NMS.
"""
return np.transpose(nms_horizontal(np.transpose(ratio), threshold))
if __name__ == "__main__":
import cv2
... | Python | 1 |
_info: &CrateInfo) -> Result<ReportEntry>;
}
/// The name of your crate and the current version.
pub struct SoftwareVersion {
version: Option<String>,
}
impl SoftwareVersion {
pub fn custom<S: AsRef<str>>(version: S) -> Self {
Self {
version: Some(version.as_ref().into()),
}
}
... | Rust | 0 |
limbs[3] as u64) << 32),
(limbs[4] as u64) | ((limbs[5] as u64) << 32),
(limbs[6] as u64) | ((limbs[7] as u64) << 32),
]
}
/// Convert to a [`U64x4`] array.
// TODO(tarcieri): implement all algorithms in terms of `U256`?
#[cfg(target_pointer_width = "64")]
pub(crate) const fn u256_to_u64x4(u256: U2... | Rust | 0 |
}
impl<'a> DclOutputSgv<'a> {
pub fn get_output_register(&self) -> u32 {
match self.operand.get_immediate(0) {
Immediate::U32(reg) => reg,
_ => !0,
}
}
pub fn get_system_name(&self) -> NameToken {
NameToken::from_word(DECODE_D3D10_SB_NAME(unsafe { *self.oper... | Rust | 0 |
lambda: gt_bboxes_vec0, lambda: gt_bboxes_vec)
# in principle, TF does not complain about this
# but we still decided against backprop though matching
# procedure itself because we do not really understand
# what will happen
positive_vec = tf.stop_gradient(positive_vec)
... | Python | 1 |
on_2 = program[current_position + 2] as usize;
let answer = program[input_position_1] + program[input_position_2];
program[output_position] = answer;
}
2 => {
let output_position = program[current_position + 3] as usize;
let input_p... | Rust | 0 |
from audio_processing import AudioProcessingComponentPipeline
import warnings
RECORDING_TIME = 5
def main():
warnings.filterwarnings("ignore")
print("Starting audio processing component...")
print("Press Ctrl+C to stop the program.")
action = None
while True:
try:
action = Audi... | Python | 1 |
vertex_buffer, slice) = gm.factory.create_vertex_buffer_with_slice(&RENDER_CANVAS, ());
// TODO: Put to another location as this never changes and doesn't need to be done each frame
use gfx::Factory;
let sampler = gm.factory.create_sampler(gfx::texture::SamplerInfo::new(
gfx::textur... | Rust | 0 |
import contextlib
import importlib
import unittest.mock
from typing import Any, Callable, Generator, Optional, cast
from nuplan.common.utils.test_utils.function_validation import assert_functions_swappable
def _get_method_from_import(import_str: str) -> Callable[..., Any]:
"""
Gets the method referenced by a... | Python | 1 |
{}
#[cfg(test)]
mod tests {
use super::*;
use crate::common::Tag;
#[test]
fn test_face_from_table_func() {
let face = Face::from_table_func(|table_tag| {
let content = format!("{}-table", table_tag);
Some(content.into_bytes().into())
});
let maxp_table... | Rust | 0 |
_OV_ODBC4 as OdbcVersion>::PrevVersion>
{
}
impl<C: ConnState, A: Ident, CH: OdbcChar> ConnAttr<C, A, SQL_OV_ODBC3_80> for OdbcStr<CH> where
OdbcStr<CH>: ConnAttr<C, A, <SQL_OV_ODBC3_80 as OdbcVersion>::PrevVersion>
{
}
impl<C: ConnState, A: Ident, CH: OdbcChar> ConnAttr<C, A, SQL_OV_ODBC4> for OdbcStr<CH> where
... | Rust | 0 |
",
actual: "string"
}
.with_path(path!["world"])
]
}
.into()
);
}
}
/*
*
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The versio... | Rust | 0 |
"""
View plots of data from three modules connected in series. Data is provided by
NREL and represents a US06 drive cycle test.
"""
import matplotlib.pyplot as plt
from ecm import PackUs06Data
from ecm import config_ax
# Battery modules US06 data
# --------------------------------------------------------------------... | Python | 1 |
B>> for Settings {
fn from(aux: &mut Aux<B>) -> Self {
Self::from_aux(aux)
}
}
impl Settings {
const UNIFORM_SIZE: u64 = std::mem::size_of::<UniformArgs>() as u64;
fn from_aux<B: hal::Backend>(aux: &Aux<B>) -> Self {
Settings { align: aux.align }
}
#[inline]
fn buffer_fram... | Rust | 0 |
# Generated by Django 4.1.3 on 2024-06-17 13:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('Forgotten', '0002_category'),
]
operations = [
migrations.AlterModelOptions(
name='category',
options={'verbose_name... | Python | 1 |
ring {} env var because we got root privileges via \
the setuid root bit.",
env_key
);
load_from_config_file()
} else {
Err(ConfigLoadError::EnvVarNotUnicode(env_key))
}
}
}
}
fn load_config_key... | Rust | 0 |
(key).cloned()
}
pub fn set_env(&mut self, key: &str, val: &str) {
self.proc_data.env.insert(key.into(), val.into());
}
pub fn save(&mut self, regs: &mut Registers, sf: &mut InterruptStackFrame) {
self.regs = unsafe { regs.as_mut().read().clone() };
self.stack_frame = unsafe { ... | Rust | 0 |
").unwrap());
let c = board.castles[board.counter as usize];
assert!(!c.0 && !c.1 && c.2 && c.3);
board.move_piece(&Move::from_str("e8d8").unwrap());
let c = board.castles[board.counter as usize];
assert!(!c.0 && !c.1 && !c.2 && !c.3);
}
#[test]
fn castling_also_moves_the_rook(){
let mut b... | Rust | 0 |
Region::new("europe-west2"),
Region::new("europe-west3"),
Region::new("europe-west4"),
Region::new("northamerica-northeast1"),
Region::new("southamerica-east1"),
Region::new("us-central1"),
Region::new("us-east1"),
Region::new("us-ea... | Rust | 0 |
'''
Ejercicio 15 - Banca online
Escribe un programa que simule una cuenta bancaria.
El programa debe permitir al usuario realizar las siguientes operaciones:
1. Ingresar dinero
2. Retirar dinero
3. Consultar saldo
4. Salir
Inicializa el saldo en 0 y permite al usuario realizar operaciones hasta que decida salir.
'''
... | Python | 1 |
from kadishutu.tools.eprint import eprintf
import os
from typing import Any, Dict
from .generic_early import CommandInstallHandler
from .pyproj import get_groups
class PoetryInstallHandler(CommandInstallHandler):
IDENT = "poetry"
GROUP_NAME = "self-managed"
@classmethod
def likelyness(cls) -> float:... | Python | 1 |
def solution(array, commands):
answer = []
for i in range(len(commands)):
temp=array[commands[i][0]-1:commands[i][1]]
temp.sort()
answer.append(temp[commands[i][2]-1])
return answer | Python | 1 |
fy!(rte_memseg__bindgen_ty_1),
"::",
stringify!(iova)
)
);
}
impl Default for rte_memseg__bindgen_ty_1 {
fn default() -> Self {
unsafe { ::std::mem::zeroed() }
}
}
#[repr(C)]
#[derive(Copy, Clone)]
pub union rte_memseg__bindgen_ty_2 {
pub addr: *mut ::std::os::raw... | Rust | 0 |
import math
import numpy as np
def smoothing_factor(t_e, cutoff):
r = 2 * math.pi * cutoff * t_e
return r / (r + 1)
def exponential_smoothing(a, x, x_prev):
return a * x + (1 - a) * x_prev
class OneEuroFilter:
def __init__(self, t0, x0, dx0=0.0, min_cutoff=1.0, beta=0.0,
d_cutoff=... | Python | 1 |
}
#[doc = "Bit 8 - USART0 APB Clock Enable"]
#[inline(always)]
pub fn usart0_(&mut self) -> USART0__W {
USART0__W { w: self }
}
#[doc = "Bit 9 - USART1 APB Clock Enable"]
#[inline(always)]
pub fn usart1_(&mut self) -> USART1__W {
USART1__W { w: self }
}
#[doc = "... | Rust | 0 |
sh.model.setPhysicalName(1, phys_apex, "APEX")
phys_myo = gmsh.model.addPhysicalGroup(2, [s1])
gmsh.model.setPhysicalName(2, phys_myo, "MYOCARDIUM")
phys_endo = gmsh.model.addPhysicalGroup(1, [endo])
gmsh.model.setPhysicalName(1, phys_endo, "ENDO")
phys_epi = gmsh.model.addPhysicalGroup(1, [epi])... | Python | 1 |
,REMOTE_RELEASE));
}
},
REMOTE_WHO_OWNS => {
let t = threads.get(&a);
t.send(OB_REMOTE_OBJECT_OP(*objects.get(&b),b,REMOTE_WHO_OWNS));
},
REMOTE_OWN(rmode) => {
// b must be in objects as per the same reasoning as
// OB_RQ_ADD_REF() is sound.
let owner = *objects.get(&b);
/... | Rust | 0 |
buildProgressRequest>,
) -> GrpcResult<RebuildProgressReply> {
self.locked(async move {
let args = request.into_inner();
trace!("{:?}", args);
let rx = rpc_submit::<_, _, nexus_bdev::Error>(async move {
nexus_lookup(&args.uuid)?.get_rebuild_progress(&args.... | Rust | 0 |
mm_cmpistri(needle.0, haystack.0, IMM) }
}
/// Search for `needle` in `haystack, with explicit string length.
///
/// In the constant you need to provide (combine with `|`):
/// * A comparison unit: `STR_CMP_U8`, `STR_CMP_U16`, `STR_CMP_I8`, or
/// `STR_CMP_I16`.
/// * A comparison op: `STR_CMP_EQ_ANY`, `STR_CMP_RAN... | Rust | 0 |
}') # pylint: disable=no-member
with torch.no_grad():
forward_loss = 0
sideward_loss = 0
face_loss = 0
a = None
q, v = q0, v0
for frame in range(1, num_frames + 1):
state = get_state(q, v)
a = controller(state, a)
q, v = sim(dofs,... | Python | 1 |
() as *mut i8, 512, &mut handle);
if p.is_null() {
break;
}
if !(mps_scan_bbox(&mut p, p.offset(strlen(p) as isize), &mut ti.bbox) >= 0i32) {
continue;
}
ti.flags |= 1i32 << 0i32;
break;
}
ttstub_input_close(handle);
let form_id = pdf_x... | Rust | 0 |
some() {
*not = true
};
parser.next_expect(Some(Keyword::Null.into()))?;
}
_ => {}
};
Ok(self)
}
fn assoc(&self) -> u8 {
ASSOC_LEFT
}
fn prec(&self) -> u8 {
8
}
}
// Formats an identifier b... | Rust | 0 |
fn test_homogeneous() {
let p = Point3::new(1.0f64, 2.0f64, 3.0f64);
assert!(p.approx_eq( &Point3::from_homogeneous( &p.to_homogeneous() ) ));
}
use super::run_test;
use crate::svd::{DimElement, ValidateLevel};
#[test]
fn decode_encode() {
let tests = vec![(
DimElement::builder()
.dim(100... | Rust | 0 |
_color = vec![[0.0, 0.0, 0.0]];
v_color.extend_from_slice(&[[1.0, 1.0, 0.0]; 10]);
star.set_attribute("Vertex_Color", v_color);
// Now, we specify the indices of the vertex that are going to compose the
// triangles in our star. Vertices in triangles have to be specified in CCW
// winding (that wil... | Rust | 0 |
= dependency_index(&dep[0], &[&item]) {
log::trace!("Found reverse depndency (index[0]): {}", pos);
new.extend(entry.drain(..=pos));
new.extend(dep.drain(..=0));
continue;
}
if let Some(pos) = dependency_index(&dep[0], &entry) {
log::trace!(... | Rust | 0 |
ommand.1),
}
}/*
This error indicates the use of a loop keyword (break or continue) inside
a closure but outside of any loop
*/
#[cfg(test)]
mod tests {
#[allow(dead_code)]
#[allow(non_snake_case)]
#[allow(unused_imports)]
#[test]
fn with_error1() {
// let _w = || { break; }; // error... | Rust | 0 |
#!/usr/bin/env python3
"""
CSRF Attack Demo
This script demonstrates Cross-Site Request Forgery (CSRF) attacks against web forms.
"""
import random
import time
from typing import Dict, List, Any, Optional
# Script metadata
NAME = "CSRF Attack Demo"
DESCRIPTION = "Demonstrates Cross-Site Request Forgery (CSRF) attacks... | Python | 1 |
timeline, effect_plan, audio_result
)
await self._update_progress(progress, WorkflowStage.QUALITY_VALIDATION, 1.0, "质量验证完成", progress_callback)
# 阶段9: 完成
await self._update_progress(progress, WorkflowStage.FINALIZATION, 0.5, "生成报告...", progress_callback)
p... | Python | 1 |
from models.db import db
cart_product = db.Table('cart_product',
db.Column('cart_id', db.Integer, db.ForeignKey('cart.id'), primary_key=True),
db.Column('product_id', db.Integer, db.ForeignKey('products.id'), primary_key=True)
)
| Python | 1 |
from setuptools import setup
import os
from glob import glob
package_name = 'agro_mate_nav2_system'
setup(
name=package_name,
version='0.0.0',
packages=[package_name],
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name]),
('share/' + pack... | Python | 1 |
eq!(oup.status.success(), true);
}
#[test]
fn test_help_long() {
let oup = exec_target(TARGET_EXE_PATH, &["--help"]);
assert_eq!(oup.stderr, "");
assert_eq!(oup.stdout, help_msg!());
assert_eq!(oup.status.success(), true);
}
#[test]
fn test_version() {
let... | Rust | 0 |
notation = "data/coco/annotations/instances_minival2014.json"
# data processing
class NormParam:
mean = (122.7717, 115.9465, 102.9801) # RGB order
std = (1.0, 1.0, 1.0)
class ResizeParam:
short = 800
long = 1333
class PadParam:
short = 800
long = 1333... | Python | 1 |
e = ImageBuffer::new(max_w, max_h);
let same_color: [u8; 4] = [255, 255, 255, 255];
let diff_color: [u8; 4] = [255, 0, 0, 255];
for h in 0..max_h {
for w in 0..max_w {
let pixel0 = img.get_pixel(w, h);
let pixel1 = img1.get_pixel(w, h);
let color = if pixel0 ==... | Rust | 0 |
user", Value::Bool(mention_user));
self
}
}
impl Default for CreateAllowedMentions {
fn default() -> CreateAllowedMentions {
let map = HashMap::new();
CreateAllowedMentions(map)
}
}
<filename>src/test/run-pass/cap-clause-move.rs
fn main() {
let x = ~1;
let y = ptr::addr_of(... | Rust | 0 |
[0m
[1;94m | [0m
[1;94m14 | [0m
[1;94m15 | [0m @@[1;91mid([left, right], clustered: false)[0m
[1;94m | [0m
"#]];
expectation.assert_eq(&error);
}
#[test]
fn clustered_index_allowed_only_with_preview_flag() {
let dml = indoc! {r#"
model A {
... | Rust | 0 |
#[inline(always)]
pub fn captioposelx_3(self) -> &'a mut W {
self.variant(CAPTIOPOSELX_A::CAPTIOPOSELX_3)
}
#[doc = "Px = P4"]
#[inline(always)]
pub fn captioposelx_4(self) -> &'a mut W {
self.variant(CAPTIOPOSELX_A::CAPTIOPOSELX_4)
}
#[doc = "Px = P5"]
#[inline(always)]... | Rust | 0 |
"""
Copyright 2020 kivou.2000607@gmail.com
This file is part of yata.
yata 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
any later version.
yata is dist... | Python | 1 |
ParseError;
fn from_str(s: &str) -> Result<Self, Self::Err> {
let parts: Vec<_> = s.split('_').collect();
if parts.len() != 3 {
return Err(ButtonInteractionParseError {});
}
if !(*parts.get(0).unwrap()).eq("training") {
return Err(ButtonInteractionParseError ... | Rust | 0 |
#!/usr/bin/env python
# status
import logging
from django.utils.translation import gettext_lazy as _
from dongtai_common.endpoint import R, UserEndPoint
from dongtai_common.models.iast_vul_log import IastVulLog, MessageTypeChoices
from dongtai_web.utils import extend_schema_with_envcheck, get_response_serializer
lo... | Python | 1 |
import sys
import numpy as np
import torch
import matplotlib.pyplot as plt
from scheduler import MasksSchedule
plt.rcParams['font.family'] = 'serif'
plt.rcParams['font.serif'] = ['Times New Roman'] + plt.rcParams['font.serif']
try:
schedule = sys.argv[1]
except:
schedule = 'sigmoid'
batch_size = 16
no_epoch... | Python | 1 |
ent_device())
optimizer_state["found_inf_per_device"][current_device] = found_inf
self._completion_st.wait_stream(torch.cuda.current_stream())
if not self._set_flat_param_view:
with torch.cuda.stream(self._completion_st):
# Copy self._new_params to model params
... | Python | 1 |
field:
// in general, you always know what struct you're working with; so it suffices to describe the
// mathematical object underlying the struct in the struct's documentation
use auto_impl::auto_impl;
// ---------------------------------------------------------------------------
// THE SEMIRING TRAIT
// -... | Rust | 0 |
.object, __jni_method, __jni_args.as_ptr())
}
}
/// public static final [GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES](https://developer.android.com/reference/javax/microedition/khronos/opengles/GL11Ext.html#GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES)
pub const GL_MATRIX_INDEX_ARRAY_BUFFE... | Rust | 0 |
cmds_doc,
user_input=user_input
)
},
],
text_format=CommandPromptOutput,
temperature=0.0
)
# Simplified LLM response items of interest
simple_response = {
"model": response.model,
"temperature": response.tempe... | Python | 1 |
Key) {
match key {
Key::S => {
model.saving = !model.saving;
}
_ => {}
}
}
use pyo3::exceptions;
use pyo3::prelude::*;
use rust_tokenizers::tokenizer::{
AlbertTokenizer, BertTokenizer, CtrlTokenizer, Gpt2Tokenizer, MBart50Tokenizer,
MultiThreadedTokenizer, OpenAiGptTo... | Rust | 0 |
'W', b'T', b'W', b'U', b'W', b'V',
b'W', b'W', b'W', b'X', b'W', b'Y', b'X', b'0', b'X', b'1', b'X', b'2', b'X', b'3', b'X', b'4',
b'X', b'5', b'X', b'6', b'X', b'7', b'X', b'8', b'X', b'9', b'X', b'A', b'X', b'B', b'X', b'C',
b'X', b'D', b'X', b'E', b'X', b'F', b'X', b'G', b'X', b'H', b'X', b'I', b'X', b'J... | Rust | 0 |
# Cấu hình bot
TOKEN = "8045325527:AAGc_PgdTD_F0T7_gP8aD3YrVlhvgQmZFNM" # Thay thế bằng token thực của bot bạn
# Danh sách ID của admin
ADMIN_IDS = [
5457094279, # Thay thế bằng ID Telegram của bạn
# Thêm ID admin khác nếu cần
]
# Đường dẫn đến các file dữ liệu
USERS_FILE = "data/users.json"
PRODUCTS_FILE =... | Python | 1 |
dict) => traverse_dictionary(dict, action, refs),
Object::Stream(ref mut stream) => traverse_dictionary(&mut stream.dict, action, refs),
Object::Reference(id) => {
if !refs.contains(&id) {
refs.push(id);
}
}
_ => {}
}
}
let mut refs = vec![];
traverse_dictionary(&mut self.trail... | Rust | 0 |
source_val, "invalid time");
/// # }
/// ```
#[inline]
#[must_use]
pub fn value(&self) -> &T {
&self.value
}
/// Returns the value, which is failed to convert.
///
/// # Examples
///
/// ```
/// # {
/// // `rfc3339::FullTimeString` is only available when `all... | Rust | 0 |
import logging
from watchFaceParser.models.elements.basic.compositeElement import CompositeElement
from watchFaceParser.models.weatherCondition import WeatherCondition
class WeatherIconElement(CompositeElement):
def __init__(self, parameter, parent, name = None):
self._images = None
self._noWeat... | Python | 1 |
XSoftmaxFullShape::Softmax0d(shape) => {
// TODO: configure tensor layout.
if shape.is_default_nchw() {
assert!(src_desc.set_4d_nchw(
sz2int(shape.src_size[1]),
sz2int(shape.src_size[0]),
1,
1,
).is_ok());
assert!(dst_desc.set_4d_nchw... | Rust | 0 |
pub fn main_height() -> usize { unsafe { MAIN_LOCAL } }
#[derive(Debug)]
pub struct SolvedUtf8Properties {
pub bytes_length: u32,
pub codepoint: u32,
}
impl SolvedUtf8Properties {
pub fn new() -> SolvedUtf8Properties {
return Self {
bytes_length: 0,
codepoint: 0,
};... | Rust | 0 |
tion value="50">50</option>
<option value="100" selected>100</option>
<option value="500">500</option>
<option value="1000">1000</option>
</select>
</label>
</div>
</div>
<button onclick="startBenchmark()">Run Bench... | Python | 1 |
(&ctx, &msg, &identifier).await? {
Some(user) => user,
None => {
msg.channel_id
.say(&ctx, format!("Couldn't find '{}'", identifier))
.await?;
return Ok(());
}
};
... | Rust | 0 |
response=response,
queries_to_jailbreak=map_zero(first_jailbreak_query),
number_of_queries=map_zero(queries),
prompt_tokens=map_zero(prompt_tokens),
response_tokens=map_zero(response_tokens),
jailbroken=classification,
)
jailbreaks_list... | Python | 1 |
PanicInfo;
use ansi_rgb::{ Foreground, red, green };
use buddy_system_allocator::LockedHeap;
use riscv::register::{mhartid};
use benchmark::ErrType;
use cputests::test_all;
use xs_hal::{hit_trap, _print, println, print_logo, UartLite};
use xs_rt::{entry, pre_init};
#[global_allocator]
static ALLOCATOR: LockedHeap = L... | Rust | 0 |
Zero{}
}
}
impl Generator for Zero {
fn process(&mut self) -> SampleT {
0.0
}
}
use std::collections::HashMap;
use case_insensitive_hashmap::CaseInsensitiveHashMap;
use log::info;
use crate::case_insensitive_hashmap;
use crate::common::{BulletFlag, Color, Rect};
use crate::engine_constants::npcs... | Rust | 0 |
import subprocess
import sys
def main():
if len(sys.argv) < 2:
print("Uso: python streamlink_to_ffmpeg.py <URL do vídeo/stream>")
sys.exit(1)
url = sys.argv[1]
rtmp_destination = "rtmp://127.0.0.1:1936/live/stream"
stream_options = [
"streamlink",
"--hls-live-edge", "6"... | Python | 1 |
};
Ok((i, time))
}
/// fragment
/// OFFSET
/// : 'Z'
/// | PLUS_OR_MINUS HOUR ':' MINUTE
/// ;
fn take_offset(i: &str) -> IonResult<&str, Option<UtcOffset>> {
alt((
map(char('Z'), |_| Option::Some(UtcOffset::UTC)),
map(
pair(take_plus_or_minus, take_hour_and_minute),
... | Rust | 0 |
un in CI mode")
parser.add_argument("--output", type=str, help="Output file path for JSON results")
parser.add_argument(
"--html-report",
action="store_true",
help="Generate an HTML report after evaluation",
)
parser.add_argument(
"--version-description",
"--desc"... | Python | 1 |
05, 0x06, 0x07, 0x08, 0x99, 0x99];
let unit = test_parse_attribute_unit(4, Format::Dwarf64, LittleEndian);
let form = constants::DW_FORM_GNU_ref_alt;
let value = AttributeValue::DebugInfoRefSup(DebugInfoOffset(0x0807_0605_0403_0201));
test_parse_attribute(&buf, 8, &unit, form, value);
... | Rust | 0 |
config.file_path = path.to_owned();
config
})
}
pub fn get_server<S>(&self, name: Option<S>) -> Result<&ElasticSearchServer, config::GetServerError> where S: Into<String> {
if self.servers.is_empty() {
return Err(config::GetServerError::NoConfiguredSe... | Rust | 0 |
Ok(())
));
// FINGERPRINT is checked by Message::from_bytes() when present
assert!(msg.has_attribute(FINGERPRINT));
// assert that we produce the same output as we parsed in this case
let mut msg_data = msg.to_bytes();
// match the padding bytes with the original
... | Rust | 0 |
"""
MIT License
Copyright (c) 2017 Sadeep Jayasumana
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, publ... | Python | 1 |
#!/usr/bin/python3
""" Prime Game """
def generatePrimeNumbers(limit):
"""Generate list of primes up to limit"""
primeNumbers = []
sieveList = [True] * (limit + 1)
for potentialPrime in range(2, limit + 1):
if sieveList[potentialPrime]:
primeNumbers.append(potentialPrime)
... | Python | 1 |
from abc import abstractmethod
from typing import Generator, Generic, TypeVar
from accelerate import Accelerator
from accelerate.utils import set_seed
from accelerate.utils.operations import gather_object
from pydantic import BaseModel
from transformers import PreTrainedTokenizerBase
from turbo_alignment.common.data.... | Python | 1 |
) = __jni_env.require_class_method("java/text/Format\0", "parseObject\0", "(Ljava/lang/String;)Ljava/lang/Object;\0");
__jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
}
}
/// [clone](https://developer.android.com/reference/java/text/Format.ht... | Rust | 0 |
ункция для отрисовки градиентного фона
def draw_gradient_background():
for y in range(SCREEN_HEIGHT):
color = (
int(BGCOLOR_START[0] + (BGCOLOR_END[0] - BGCOLOR_START[0]) * y / SCREEN_HEIGHT),
int(BGCOLOR_START[1] + (BGCOLOR_END[1] - BGCOLOR_START[1]) * y / SCREEN_HEIGHT),
... | Python | 1 |
###############################################################################
# Required Libraries
import matplotlib.pyplot as plt
import numpy as np
###############################################################################
# Function: Rank
def ranking(flow):
rank_xy = np.zeros((flow.shape[0], 2))
... | Python | 1 |
{
return y;
}
if ex == 0x7ff || uyi == 0 {
return x;
}
/* note: hypot(x,y) ~= x + y*y/x/2 with inexact for small y/x */
/* 64 difference is enough for ld80 double_t */
if ex - ey > 64 {
return x + y;
}
/* precise sqrt argument in nearest rounding mode without ov... | Rust | 0 |
println!("cargo:rustc-link-search=native={}", libdir);
}
}
<filename>src/templates.rs
use simple_html_template::{TemplateCache, html_map};
use shipyard::EntityId;
use wasm_bindgen::prelude::*;
use web_sys::DocumentFragment;
use crate::dom::selector::entity_id;
pub const BODY:&'static str = "body";
pub const... | Rust | 0 |
014 annotation files
# actually contains bugs that, together with certain ways of using COCO API,
# can trigger this assertion.
assert anno["image_id"] == image_id
# ensure the width and height of bbox are greater than 0
if anno["bbox"][2]... | Python | 1 |
///
/// Caller bounds are `Obligation`s that the caller must satisfy. This is
/// basically the set of bounds on the in-scope type parameters, translated
/// into `Obligation`s, and elaborated and normalized.
///
/// Use the `caller_bounds()` method to access.
///
/// Typically, this is `Re... | Rust | 0 |
Ok(())
}
}
)* }
}
array_impls!(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
);
// Credit to @shepmaster for structure of recursive tuple macro
macro_rules! tuple_impls {
() => {};
// Cop... | Rust | 0 |
# MIT License
#
# Copyright (c) 2018 Evgeny Medvedev, evge.medvedev@gmail.com
#
# 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
# ... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.