text string | label_name string | labels int64 |
|---|---|---|
// Break block into sixteen 32-bit `little-endian` words
let mut words = [0u32; 16];
for (o, s) in words.iter_mut().zip(block.chunks_exact(4)) {
*o = u32::from_le_bytes(s.try_into().unwrap());
}
// round 1
a = f(a, b, c, d, words[0], ROUND_TABLE[0], 7);
d = f... | Rust | 0 |
}
}
<reponame>playXE/Jazz<gh_stars>10-100
extern crate jazz;
extern crate jazz_vm;
extern crate structopt;
use jazz::{
parser::{lex, parse},
Compiler,
};
use jazz_vm::machine::Machine;
use std::{fs::File, io::prelude::*, path::PathBuf};
use structopt::StructOpt;
#[derive(StructOpt, Debug)]
pub struct Opti... | Rust | 0 |
leEndian};
///
/// let mut bytes = [0; 16];
/// let numbers_given = [1.0, 2.0, 31.312e31, -11.32e19];
/// LittleEndian::write_f32_into(&numbers_given, &mut bytes);
///
/// let mut numbers_got = [0.0; 4];
/// LittleEndian::read_f32_into_unchecked(&bytes, &mut numbers_got);
/// assert_eq!(... | Rust | 0 |
mpatible)
// |+----- PRG RAM ($6000-$7FFF) (0: present; 1: not present)
// +------ 0: Board has no bus conflicts; 1: Board has bus conflicts
pub flags_10: u8,
// 11-15: Unused padding (should be filled with zero, but some rippers put their name across bytes 7-15)
pub unused: [u8; 5],
}
impl Hea... | Rust | 0 |
수직적으로 이어붙이는 함수이다.
"""
# combine 1단계: 8개의 이미지를 결합하는 과정
if step == 1:
# 이미지 오픈
upper_image = self.cropped_image_list_step_1[upper_image_index]
lower_image = self.cropped_image_list_step_1[lower_image_index]
# combine 2단계: 4개의 이미지를 결합하는 과정
elif ... | Python | 1 |
exit(1)
init_db() # Initialize the database once at startup
init_db2()
init_db3()
print("Generating query IDs for the following usernames:")
for username in usernames:
print(f"- {username}")
try:
asyncio.run(generate_queries_for_all_sessions(username))
... | Python | 1 |
jtjujpo-415[gvkud]
zloolpfsb-zxkav-zlxqfkd-lmboxqflkp-393[lfkox]
zilqwikbqdm-jcvvg-kwvbiqvumvb-174[vbiqk]
kzeed-wfggny-xmnuunsl-853[negud]
ftzgxmbv-xzz-phkdlahi-657[grbhi]
bnqqnrhud-bzmcx-sqzhmhmf-131[hmqbn]
zntargvp-pnaql-pbngvat-nanylfvf-169[napvf]
jxdkbqfz-pzxsbkdbo-erkq-absbilmjbkq-315[uzmcf]
jshzzpmplk-buzahisl-kf... | Rust | 0 |
a,
/// TRINIDAD AND TOBAGO
#[serde(rename = "TT")]
TrinidadAndTobago,
/// TUNISIA
#[serde(rename = "TN")]
Tunisia,
/// TURKEY
#[serde(rename = "TR")]
Turkey,
/// TURKMENISTAN
#[serde(rename = "TM")]
Turkmenistan,
/// TURKS AND CAICOS ISLANDS
#[serde(rename = "TC")]
TurksAndCaicosIslands,
/// TUVALU
#[s... | Rust | 0 |
dict::PrefixDict;
use lindera_core::core::unknown_dictionary::UnknownDictionary;
use lindera_core::core::viterbi::{Lattice, Mode};
use lindera_core::core::word_entry::WordId;
use lindera_dictionary;
use lindera_ipadic;
use lindera_ipadic_builder;
#[derive(Serialize, Clone)]
pub struct Token<'a> {
pub text: &'a str... | Rust | 0 |
0, 80, 50, "C rich black")
self.ctx.cmd_k(0.0, 0.1, 0.0, 1.0)
self.draw_gray_and_text(50, 80 + deltax, 50, "M rich black")
self.ctx.cmd_k(0.0, 0.0, 0.1, 1.0)
self.draw_gray_and_text(50, 80 + 2*deltax, 50, "Y rich black")
self.ctx.cmd_k(0.1, 0.1, 0.1, 1.0)
self.draw_gray_a... | Python | 1 |
{}
/// Marks a type as a DA3 pin
pub trait DA3 {}
/// Marks a type as a DA4 pin
pub trait DA4 {}
/// Marks a type as a DA5 pin
pub trait DA5 {}
/// Marks a type as a DA6 pin
pub trait DA6 {}
/// Marks a type as a DA7 pin
pub trait DA7 {}
/// Marks a type as a DA8 pin
pub trait DA8 {}
/// Marks a type as a DA9 pin
pub t... | Rust | 0 |
# 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
#
# Unless required by applic... | Python | 1 |
UniString::from(env!("GIT_HASH"));
make_json_response(&resp)
}
pub async fn active_chains(
_: Request<Body>,
_: Params,
_: Query,
_: Arc<RpcServiceEnvironment>,
) -> HResult {
empty()
}
pub async fn protocols(
_: Request<Body>,
_: Params,
_: Query,
_: Arc<RpcServiceEnvironment>... | Rust | 0 |
# timetable/views.py
from django.shortcuts import render, get_object_or_404, redirect
from .models import Classroom, Course, Timetable
from .forms import ClassroomForm, CourseForm, TimetableForm
def timetable_list(request):
timetables = Timetable.objects.all()
return render(request, 'timetable/timetable_list... | Python | 1 |
into(self) -> usize {
self as usize
}
}
impl CharacterTrait for Keqing {
const STATIC_DATA: CharacterStaticData = KEQING_STATIC_DATA;
type SkillType = KeqingSkillType;
const SKILL: Self::SkillType = KEQING_SKILL;
type DamageEnumType = KeqingDamageEnum;
type RoleEnum = ();
#[cfg(not... | Rust | 0 |
"""
Служебные команды
"""
import discord
from discord.ext import commands
from ..config import ConfigManager
from ..utils.helpers import add_timestamp
class UtilityCommands(commands.Cog):
"""Класс служебных команд"""
def __init__(self, bot: commands.Bot, config_manager: ConfigManager):
self.bot ... | Python | 1 |
to read config file")?;
let mut cors_builder = warp::cors()
.allow_methods(vec!["GET", "POST"])
.allow_header("content-type")
.allow_header("authorization");
if settings.server.cors_allow_any_origin {
cors_builder = cors_builder.allow_any_origin();
} else if let Some(origins... | Rust | 0 |
from dotenv import load_dotenv
import os
# from langchain_huggingface import HuggingFaceEndpoint
load_dotenv()
# HUGGING_FACE_KEY=os.getenv("HUGGING_FACE_KEY")
# rep_id="mistralai/Mistral-7B-Instruct-v0.3"
# llm=HuggingFaceEndpoint(repo_id=rep_id,temperature=0.2,huggingfacehub_api_token=HUGGING_FACE_KEY)
# x=llm.in... | Python | 1 |
# Copyright 2017 LinkedIn Corporation. All rights reserved. Licensed under the BSD-2 Clause license.
# See LICENSE in the project root for license information.
import io
import venv
import sys
from pathlib import Path
from setuptools import setup, find_packages, Command
from setuptools.command.test import test as Te... | Python | 1 |
import os, pickle, re
from idautils import *
g_track_parent_th = 2 # parent function tracking level threshold
g_parent_func_exclude_list = ['__NMSG_WRITE', '__fassign_l']
g_pfe_list = [get_name_ea_simple(p) for p in g_parent_func_exclude_list]
def get_pfuncs(ea, track_th):
pfuncs = [get_func_attr(ref, FUNCATTR_ST... | Python | 1 |
not detect irq.");
return;
}
let irq = match resource_data.unwrap() {
ResourceData::Irq(i) => i,
ResourceData::Interrupt(i) => i as u8, /* OK...? */
};
pr_info!("IRQ: {}", irq);
make_device_interrupt_handler!(handler, smbus_handler);
i... | Rust | 0 |
parser: P,
separator: S,
_marker: PhantomData<fn() -> F>,
}
impl<F, P, S> Parser for SepBy<F, P, S>
where
F: Extend<P::Output> + Default,
P: Parser,
S: Parser<Input = P::Input>,
{
type Input = P::Input;
type Output = F;
type PartialState = <Or<
SepBy1<F, P, S>,
FnPars... | Rust | 0 |
ISA")),
}
}
}
<gh_stars>1-10
//! Structures and traits that are shared around the whole cell
//! compiler.
#![warn(rust_2018_idioms)]
pub mod error;
mod macros;
pub mod profiler;
pub mod source;
pub mod strings;
use source::FileId;
/// Diagnostic type alias with specific `FileId`.
pub type Diagnostic = c... | Rust | 0 |
equests
#[tokio::test]
async fn test_get_drive() {
let onedrive = onedrive().await;
// #1
let drive1 = onedrive.get_drive().await.expect("Cannot get drive #1");
assert!(drive1.quota.is_some());
assert!(drive1.owner.is_some());
let drive_id = drive1.id.as_ref().expect("drive1 has no id");
... | Rust | 0 |
.push_str(&$s);
out.push_str(crate::color::Reset.as_ref());
out.replace(";m", "m")
}};
}
/// Shortcut to produce a color's ANSI escape code. Don't forget to Reset!
/// ```
/// let mut o = String::new();
/// o.push_str(color!(Blue));
/// o.push_str(color!(Underline));
/// o.push_str("Hyperli... | Rust | 0 |
info!("creating blocks...");
for i in 0..blk_num {
let mut vec = Vec::<u32>::new();
for _ in 0..blk_size {
vec.push(rng.gen_range(1..100));
}
db.insert(i, vec);
}
info!("start building blocks");
for i in 0..blk_num {
info!("building blk with blk id: ... | Rust | 0 |
()
data_infos = mmcv.load(args.data_infos_path)['infos']
data_info_sample_tokens = [info['token'] for info in data_infos]
nusc = NuScenes(version='v1.0-mini', dataroot='./data/nuscenes/', verbose=True)
# render_annotation('7603b030b42a4b1caa8c443ccc1a7d52')
results = mmcv.load(args.result)
samp... | Python | 1 |
.
pub fn ramp_down(sample_rate: u32, cliff_secs: f32, ramp_secs: f32) -> Filter {
let rate = sample_rate as f32;
let cliff_steps = rate * cliff_secs;
let ramp_steps: f32 = rate * ramp_secs;
let mut ramp_i = 0f32;
Box::new(move |sample: Sample| {
let mut val = sample;
if ramp_i < cli... | Rust | 0 |
roidExternalMemoryAndroidHardwareBufferExtension: DeviceV1_0 {
/// The metadata for this extension.
#[allow(deprecated)]
const METADATA: Extension = ANDROID_EXTERNAL_MEMORY_ANDROID_HARDWARE_BUFFER_EXTENSION;
/// <https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/vkGetAndroidHardware... | Rust | 0 |
########################################################################
# File name: __init__.py
# This file is part of: aioxmpp
#
# LICENSE
#
# This program 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 Foundat... | Python | 1 |
Default for CompressionType {
fn default() -> Self {
CompressionType::Gzip
}
}
#[derive(Parser, Debug)]
#[clap(author, version, about, long_about = None)]
struct Args {
/// Input binary file
#[clap(short, long)]
input: String,
/// Output blockmap file
#[clap(short, long)]
outp... | Rust | 0 |
_;
let ptr = &*lock as *const Inner as *mut c_void;
drop(lock);
let context = unsafe {
slirp_init(
config.restricted as i32,
ipv4_enabled,
vnetwork.into(),
vnetmask.into(),
vhost.into(),
... | Rust | 0 |
mod status_provider;
pub use config::{ArtificialUserLoadConfig, NodeLoadConfig};
pub use multi_controller::{MultiController, MultiControllerError};
pub use request_generators::{ServicingStationRequestGen, WalletRequestGen};
pub use scenario::*;
pub use status_provider::VoteStatusProvider;
/**
Internal details to be us... | Rust | 0 |
k in 0..2 {
EE[k] = EEE[k] + EEO[k];
EE[k + 2] = EEE[1 - k] - EEO[1 - k];
}
for k in 0..4 {
E[k] = EE[k] + EO[k];
E[k + 4] = EE[3 - k] - EO[3 - k];
}
for k in 0..8 {
dst[(j << 4) + k] = ITX_CLIP_32(E[k] + O[k]);
ds... | Rust | 0 |
fn build(self) -> crate::model::CustomRoutingAcceleratorAttributes {
crate::model::CustomRoutingAcceleratorAttributes {
flow_logs_enabled: self.flow_logs_enabled,
flow_logs_s3_bucket: self.flow_logs_s3_bucket,
flow_logs_s3_prefix: self.flow_logs_s3_prefix,
... | Rust | 0 |
Field::new(
"d",
DataType::List(Box::new(Field::new("item", DataType::Utf8, true))),
true,
),
]);
let inferred_schema = infer_json_schema(&mut BufReader::new(Cursor::new(data)), None)?;
assert_eq!(inferred_schema, schema);
Ok(())
}
//! Utilities Librar... | Rust | 0 |
borrow_mut(), |value, record| {
reduce_fun(value, record)
})
}
}
}
fn drop_window(&mut self, window: &Window) {
match self.windows.remove(&window) {
Some(state) => {
let state_key = StorageKey::new(self.job_id, self.tas... | Rust | 0 |
import os
import json
from typing import Dict, Any
from flask import current_app
def find_header(file_type: str) -> Dict[str, Any]:
what_file: str = ''
match file_type:
case '1':
what_file = 'func_hander'
# 寻找配置文件路径
cwd: str = os.getcwd()
module_cwd = os.path.dirname(os.pat... | Python | 1 |
Err(Error::from_kind(ErrorKind::DecompositionError(
format!("Eigendecomposition: \
Invalid call to dgeev in argument {}", -info))))
} else if info > 0 {
Err(Error::from_kind(ErrorKind::DecompositionError(
format!("Eigendecomposition: d... | Rust | 0 |
start: 1,
end: 11,
newlines: 2,
initial_padding: 8,
between_padding: 11,
color: HEADER_COLOR
})?;
self.print_temp_row(&daily_temps, 0, 11)?;
self.print... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Usage: python consts.py constants/some_constants.asm
View numeric values of `const`ants.
"""
import sys
import re
const_value = 0
const_inc = 1
def asm_int(s):
base = {'$': 16, '&': 8, '%': 2}.get(s[0], 10)
return int(s if base == 10 else s[1:], base)
def print... | Python | 1 |
inverse:
walsh_img = (img_patch@self.WHmatrix).astype('float64')
elif len(img_patch.shape) == 2:
if inverse:
walsh_img = (self.WHmatrix@img_patch@self.WHmatrix).astype('float64')
WH_patch.append(walsh_img)
r... | Python | 1 |
features = datasets.Features(
{
"index": datasets.Value("string"),
"tweet": datasets.Value("string"),
"label": datasets.Value("string"),
}
)
elif self.config.schema == "seacrowd_text":
... | Python | 1 |
x, paints_tx)).unwrap();
pool.run();
let mut result = vec![' '; 800];
for i in 1..8
{
result[i * 100] = '\n';
}
for paint in paints_rx.remainder().drain(..)
{
if paint.0.x >= 0 && paint.0.y >= 0 && paint.0.x < 100 && paint.0.y < 10
{
let index = (paint.... | Rust | 0 |
import pytest
from EUVpy.empiricalModels.models.SOLOMON import solomon
from EUVpy.tools import processIndices
from scipy.integrate import simpson
import numpy as np
#-----------------------------------------------------------------------------------------------------------------------
#--------------------------------... | Python | 1 |
{}\"", c)))
.unwrap_or($default)
};
}
pub fn load(cfg: &Config) -> Theme {
let mut palette = Palette::default();
let borders = BorderStyle::Simple;
palette[Background] = load_color!(cfg, background, TerminalDefault);
palette[View] = load_color!(cfg, background, TerminalDefault);
pa... | Rust | 0 |
import random
print(random.randint(10000000, 99999999)) | Python | 1 |
(env_value) = self.env.target() {
return Some(Target::from(&env_value, target_list));
}
self.toml
.as_ref()
.and_then(|t| t.default_target(target_list))
}
fn sum_of_env_toml_values(
toml_getter: impl FnOnce() -> Option<Vec<String>>,
env_values... | Rust | 0 |
nullable: false,
idx_type: BTree,
comment: "",
functional: false,
},
],
foreign_keys: [
ForeignKeyInfo {
name: "fk_store_address",
columns: [
... | Rust | 0 |
get_Data)(self as *const _ as *mut _, &mut out);
if hr == S_OK { Ok(HString::wrap(out)) } else { err(hr) }
}}
#[inline] pub fn set_data(&self, value: &HStringArg) -> Result<()> { unsafe {
let hr = ((*self.lpVtbl).put_Data)(self as *const _ as *mut _, value.get());
if hr == S_OK { Ok(())... | Rust | 0 |
import numpy as np
def local_concept_drift_config(n_clients, n_rounds, me, concept_drift_round, seed):
np.random.seed(seed)
concept_drift_rounds = np.random.choice(n_rounds, n_clients, replace=False)
round_number = []
cid_number = []
partition_number = []
me_number = []
for cid in range(1,... | Python | 1 |
`. Unfortunately though LLVM has no native way to
// do this. Thankfully though we can do this with some inline assembly,
// which is easy enough to add via module-level global inline asm.
//
// * ELF - this is very similar to COFF above. One difference is that these
// sections are removed fr... | Rust | 0 |
nc_01_5EF')
def func_01_5EF():
If(
(
(Expr.TestScenaFlags, ScenaFlag(0x0086, 6, 0x436)),
(Expr.TestScenaFlags, ScenaFlag(0x0087, 4, 0x43C)),
Expr.Ez,
Expr.Nez64,
Expr.Return,
),
'loc_5FE',
)
Jump('loc_5FE')
def _loc_5F... | Python | 1 |
from typing import Generator, Optional
from fastapi import Depends, HTTPException, status
from fastapi.security import HTTPBearer, HTTPAuthorizationCredentials
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select
from sqlalchemy.orm import selectinload
from app.core.database import get_db
from... | Python | 1 |
nb_tx_desc: u16,
conf: *const rte_eth_hairpin_conf,
) -> ::std::os::raw::c_int;
}
extern "C" {
#[doc = " Return the NUMA socket to which an Ethernet device is connected"]
#[doc = ""]
#[doc = " @param port_id"]
#[doc = " The port identifier of the Ethernet device"]
#[doc = " @return"]
... | Rust | 0 |
= df["data_quality_score"].mean()
repeat_offenders = df["is_repeat_offender"].sum()
self.logger.info("📊 Gold Layer Summary Statistics:")
self.logger.info(f" • Total records: {total_records:,}")
self.logger.info(f" • Date range: {date_range}")
self.logger... | Python | 1 |
fication_weights(features_query, theta)
cls_scores = cls_scores.view(new_batch_dim, -1) # B * n x nKnovel
grad_logit = self.dni(cls_scores) # B * n x nKnovel
grad = torch.autograd.grad([cls_scores], [theta],
grad_outputs=[grad_logit],
... | Python | 1 |
str
"40", // 0-bstr
),
),
];
for (i, (mac, mac_data)) in tests.iter().enumerate() {
let got = mac.clone().to_vec().unwrap();
assert_eq!(*mac_data, hex::encode(&got), "case {}", i);
let mut got = CoseMac0::from_slice(&got).unwrap();
got.protect... | Rust | 0 |
#!/usr/bin/env python3
"""
Assetfinder MCP Server
A Model Context Protocol server that provides Assetfinder functionality for subdomain discovery.
"""
import sys
import subprocess
import asyncio
import re
from mcp.server.fastmcp import FastMCP
# Check if assetfinder binary is provided
if len(sys.argv) < 2:
print(... | Python | 1 |
Interpol: ORANGE, # class: 'si'
String.Other: "", # class: 'sx'
String.Regex: "", # class: 'sr'
String.Single: "", # class: 's1'
String.Symbol: "", # class: 'ss'
Generic: ... | Python | 1 |
ord: Option<String>,
) -> SignerFn {
Box::new(
move |lock_args: &HashSet<H160>, message: &H256, tx: &json_types::Transaction| {
let path: &[_] = if lock_args.contains(&account) {
&[]
} else {
match lock_args.iter().find_map(|lock_arg| path_map.get(lock... | Rust | 0 |
help="reset traffic flow",
)
parser.add_argument(
"-s",
"--sleep",
type=int,
required=False,
choices=range(11),
default=5,
help="sleep time",
)
args = parser.parse_args()
config = config_load(os.path.join(PATH, os.path.abspath(args.config)))... | Python | 1 |
).into())
}
fn lt_const(self, other: Number) -> TCResult<Self::Compare> {
fn lt_array(l: Array, r: Number) -> Array {
l.lt_const(r)
}
fn lt_number(l: Number, r: Number) -> Number {
(l < r).into()
}
Ok(BlockListConst::new(self.blocks, other, lt_a... | Rust | 0 |
CRIPTORS_REQUIRED {
trace_descriptors (
_descriptors_required.iter () .filter (|_descriptor| if let TargetOperation::Protect = _descriptor.operation { false } else { true }),
Some ("descriptors required:"));
}
log_cut! ();
log_information! (0x4dfe419e, "verifying (2)...");
verify (&_descriptors_required... | Rust | 0 |
A::ENUM_S_P
}
}
#[doc = "Write proxy for field `SRAM_SECT_1_RULE`"]
pub struct SRAM_SECT_1_RULE_W<'a> {
w: &'a mut W,
}
impl<'a> SRAM_SECT_1_RULE_W<'a> {
#[doc = r"Writes `variant` to the field"]
#[inline(always)]
pub fn variant(self, variant: SRAM_SECT_1_RULE_A) -> &'a mut W {
{
... | Rust | 0 |
example, given n = 3, a solution set is:
//! ```text
//! [
//! "((()))",
//! "(()())",
//! "(())()",
//! "()(())",
//! "()()()"
//! ]
//! ```
//!
pub type Input = i32;
pub type Output = Vec<String>;
pub trait Solution {
fn generate_parenthesis(&self, n: i32) -> Vec<String>;
}
// -------------------------... | Rust | 0 |
import time
import pygame
from datetime import datetime
from openpyxl import Workbook, load_workbook
# Pygame-instellingen
pygame.init()
width, height = 600, 500
window = pygame.display.set_mode((width, height))
pygame.display.set_caption("Weergave Namen en Tijd")
font = pygame.font.Font(None, 30)
# Excel-bestand lad... | Python | 1 |
p
// Element information
// Namespace: http://www.w3.org/2001/XMLSchema
// Schema document: xmlschema.xsd
// Type: xsd:attributeGroupRef
// Properties: Local, Qualified
//
// Used in
// Group xsd:attrDecls
// Group xsd:complexTypeModel via reference to xsd:attrDecls
// Type xsd:complexType via reference to xsd:complexT... | Rust | 0 |
"gssapi unknown {} error code {}\n", name, code)?;
break;
}
if message_context == 0 {
break;
}
}
Ok(())
}
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Error::fmt_code(f, sel... | Rust | 0 |
expected"]["qscore_per_atom"] = expected_qscore_per_atom
tests[test["data"]["name"]] = test
return tests
def test_program_template(test):
print("Running prgram template test: ",test["data"]["name"])
model_file = test["data"]["model_file"]
map_file = test["data"]["map_file"]
dm = DataManager()
dm.proc... | Python | 1 |
class MalformedPDFException(Exception):
pass
class PdfminerException(Exception):
pass
| Python | 1 |
# show tracking image
vis_img = self.show_result(img_metas[0]['filename'], raw_result)
# for track_kpt in track_kpts:
# pts = np.array(track_kpt)
# pts = np.concatenate((pts, np.expand_dims((pts[1, :] + pts[2, :]) / 2, 0)), axis=0)
# vis_... | Python | 1 |
fn serialize_field<T>(&mut self, _key: &'static str, _value: &T) -> Result<()>
// where
// T: ?Sized + ser::Serialize,
// {
// unreachable!()
// }
//
// #[tracing::instrument(level="trace", skip())]
// fn end(self) -> Result<Self::Ok> {
// unreachable!()
// }
// }
//
// i... | Rust | 0 |
# This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator2/generator/generator.py script.
"""Public API for tf._api.v2.distribute.cluster_resolver namespace
"""
import sys as _sys
from tensorflow.python.distribute.cluster_resolver.cluster_resolver import ClusterResolver # li... | Python | 1 |
s: &str) -> Vec<usize> {
let mut remainder = s;
let mut res = Vec::new();
let mut cur_end = 0usize;
while let Some(m) = r.find(remainder) {
cur_end += m.end();
res.push(cur_end);
remainder = &remainder[m.end()..];
}
res
}
fn check_message_part2(rule42: &Regex, rule31: &... | Rust | 0 |
in 0..x_size {
item_1.push(TILE_WALL);
item_2.push(TILE_WALL);
}
grid_1.push(item_1);
grid_2.push(item_2);
}
for yi in 1..y_size as usize - 1 {
for xi in 1..x_size as usize - 1 {
grid_1[yi][xi] = random_select(rng, fill_percent);
}
... | Rust | 0 |
n query_kw:
match_score = 1.0
break
elif self._calculate_similarity(query_kw, tag_name) > 0.7:
match_score = 0.8
total_score += match_score * tag_confidence
total_weight += tag_confidence
return total_score / t... | Python | 1 |
Fill(start_color="FF00FF", end_color="FF00FF", fill_type="solid")
grey_fill = PatternFill(start_color="808080", end_color="808080", fill_type="solid")
skin_color_fill = PatternFill(start_color="FFDBAC", end_color="FFDBAC", fill_type="solid")
White_font = Font(color="FFFFFF")
... | Python | 1 |
import altius_py
import onnxruntime as ort
import onnx
import tempfile
import pytest
import os
import numpy as np
from onnx import helper, ValueInfoProto, TensorProto
def test_matmul_1():
with tempfile.TemporaryDirectory() as tmpdir:
op_matmul(os.path.join(tmpdir, "model.onnx"), [5, 10], [10, 15], [5, 15]... | Python | 1 |
#[test]
fn ewma1() {
let mut ewma = EWMA::new(1f64);
ewma.update(3);
ewma.tick();
assert_eq!(0.6f64, ewma.rate());
// Expected values after 1..15 minutes.
let expected = [
0.22072766470286553f64,
0.08120116994196772f64,
0.0298... | Rust | 0 |
proc_macro2::TokenTree::Ident(ident) =>
{
// is it a state ?
if states.contains(&ident)
{
result.push(ident)
}
}
// tokenstream
proc_macro2::TokenTree::Group(group) =>
{
extract_states_from_rule(gro... | Rust | 0 |
#=========================================================================
# Prob07p08_comb_arith_8b_rotator_test
#=========================================================================
# SPDX-License-Identifier: MIT
# Author : Christopher Batten, NVIDIA
# Date : May 20, 2024
from pyhdl_eval.cfg import Config, I... | Python | 1 |
import gymnasium as gym
from gymnasium.wrappers import RecordVideo
import random
import copy
import torch
from torch import nn
GAMMA = 0.97
LEARNING_RATE = 0.001
MEMORY_SIZE = 200
BATCH_SIZE = 50
# 環境の生成
trigger = lambda t: t % 100 == 0
env = RecordVideo(gym.make('CartPole-v0', render_mode="rgb_array"), './video/... | Python | 1 |
# Copyright 2025 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Python | 1 |
)
.key(&queue.0.processing_list)
.key(&queue.0.done_list)
.key(&queue.0.stats_hash)
.arg(job_id)
.arg(now.timestamp_millis())
.arg(expected_expiration.timestamp_millis())
.invoke_async(&mut **conn)
.await?;
Ok(marke... | Rust | 0 |
repr(C)]
#[doc = "*Required features: `\"Win32_System_Diagnostics_Etw\"`, `\"Win32_Foundation\"`, `\"Win32_System_Time\"`*"]
#[cfg(all(feature = "Win32_Foundation", feature = "Win32_System_Time"))]
pub struct TRACE_LOGFILE_HEADER64_0_0 {
pub MajorVersion: u8,
pub MinorVersion: u8,
pub SubVersion: u8,
pu... | Rust | 0 |
counterfactual_samples = sampler.sample(original_sentence=original_utterance, n_samples=n_counterfactual_samples)['counterfactual_sentences']
metric_value = metric(original_utterance, counterfactual_samples)
results.extend(metric_value)
return np.mean(results)
def pairwise_latent_euclidean_d... | Python | 1 |
`SERVER`
//! // `Token` is used to determine that we received an event for the listener
//! // later on.
//! const SERVER: Token = Token(0);
//! poll.registry().register(&mut listener, SERVER, Interest::READABLE)?;
//! # Ok(())
//! # }
//! ```
//!
//! Multiple event sources can be [... | Rust | 0 |
<Box<Schema>>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub min_items: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub max_items: Option<usize>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unique_items: Option<bool>,
#[serde(skip_serializing_if = "Opt... | Rust | 0 |
tribb = {
1:1,
2:2,
3:4,
4:7,
5:13,
6:24,
7:44,
8:81,
9:149 ,
10:274,
11:504,
12:927 ,
13:1705,
14:3136,
15:5768,
16:10609,
17:19513,
18:35890,
19:66012,
20:121415,
21:223317,
22:410744 ,
23:755476,
24:1389537
}
print(tr... | Python | 1 |
mestamp : "";')
html.append(' summaryDiv.innerHTML = `<div style="color:#00ff41;"><b>摘要</b></div><div style="color:#00ff41;">事件數量: ${evts.length} | 總變更數: ${totalChanges}</div><div style="color:#006600;">時間範圍: ${earliestTime} 至 ${latestTime}</div>`;')
html.append(' }')
html.append(' ... | Python | 1 |
, _annotations = arg.partition(" ")
if _annotations.startswith("(") and _annotations.endswith(")"):
arg = arg_name
arg_descriptions[arg] = desc.strip()
elif arg:
arg_descriptions[arg] += " " + line.strip()
return description, arg_descri... | Python | 1 |
rom(buf);
unsafe { Pin::new_unchecked(&mut future) }
.poll(cx)
.map(|r| match r {
Ok((r, _)) => Ok(r),
Err(e) => Err(e),
})
}
}
impl AsyncWrite for UtpStream
where
Self: Unpin,
{
fn poll_write(
mut self: Pin<&mut Self>,
... | Rust | 0 |
al_md = additional_metadata
selected_metadata = connections.select_catalog_and_fields_via_metadata(conn_id,
stream_catalog,
annotated_schema,
... | Python | 1 |
ce(flags, integer_types):
raise TypeError('an integer is required')
if not isinstance(sockaddr, tuple):
raise TypeError('getnameinfo() argument 1 must be a tuple')
address = sockaddr[0]
address = self._hostname_to_bytes(sockaddr[0])
if address in self._LOCAL_AND... | Python | 1 |
import os
import io
import base64
import zipfile
from zeep import Client
from zeep.wsse.username import UsernameToken
from zeep.exceptions import Fault
import requests
from requests.exceptions import HTTPError, ConnectionError, Timeout
# Directorios base
BASE_DIR = "files/facturacion_electronica"
DIR_FIRMA = os.path.j... | Python | 1 |
import pandas as pd
import statsmodels.api as sm # type: ignore
import matplotlib.pyplot as plt
# Load and clean the CSV file
file_path = 'bitcoin_data.csv' # Replace with your file path
data = pd.read_csv(file_path)
# Remove the first row if it contains non-numeric placeholders
data = data.drop(0)
# Convert column... | Python | 1 |
print(r'''
*******************************************************************************
............ ........ .......... ........... ... . . ......... . . ...........
........... ........ ......... . . . . . ... | Python | 1 |
msum(pdf, -1) # (N_rays, N_samples), cumulative distribution function
return _sample_cdf(bins, cdf, fine_samples, det)
def _sample_cdf(bins: torch.Tensor, cdf: torch.Tensor, fine_samples: int, det: bool) -> torch.Tensor:
N_rays, N_samples_ = cdf.shape
cdf = torch.cat([torch.zeros_like(cdf[:, :1]), cdf],... | Python | 1 |
}
}
impl Request {
pub fn query() -> LazyQuery {
LazyQuery::new(requests::table.into_boxed())
}
pub fn find(id: i64) -> Result<Self, Error> {
Ok(requests::table.find(id).first::<Self>(&db_conn()?)?)
}
pub fn create(record: impl Into<DirtyRequest>) -> Result<Self, Error> {
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.