text string | label_name string | labels int64 |
|---|---|---|
",
"prior": "PROXY"
},
{
"name": "📺 巴哈姆特",
"type": "select",
"prior": "PROXY"
},
{
"name": "📺 哔哩哔哩",
"type": "select",
"prior": "DIRECT"
},
{
"name": "🌍 国外媒体",
"... | Python | 1 |
to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the So... | Rust | 0 |
(&mut c);
r.buf = vec![1; 3];
assert!(r.read(&mut o).is_err());
assert!(r.buf.len() == 9);
}
}
<reponame>onomyprotocol/near-aurora-bridge<filename>orchestrator/gravity_utils/src/get_with_retry.rs
//! Basic utility functions to stubbornly get data
use clarity::Address as EthAddress;
use clari... | Rust | 0 |
s()]
if contract in exists_contracts:
print('[!] Contract with this address already exists')
continue
return contract
def prompt_precisions(token_symbol):
while 1:
precisions = prompt(
f'Precisions for pair {token_symbol}-USDT* (i.e. 10,1,0.1,0.01)')
... | Python | 1 |
BorshDeserialize, PartialEq, PartialOrd, Clone,
)]
pub struct RpcResponseJsonError {
jsonrpc: String,
error: JsonRpcError,
id: u8,
}
#[derive(
Debug, Serialize, Deserialize, BorshSerialize, BorshDeserialize, PartialEq, PartialOrd, Clone,
)]
pub struct JsonRpcError {
code: i16,
message: String,... | Rust | 0 |
from glob import glob
import gc
import os
from nobrainer.processing.brain_generator import BrainGenerator
from preprocessing import preprocessing_pipe
import argparse
from wirehead import WireheadGenerator
os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3"
os.environ["TF_FORCE_GPU_ALLOW_GROWTH"] = "true"
os.environ["TF_AUTOGRAP... | Python | 1 |
n=int(input("ingrese n : "))
cantidad=int(input("Ingrese la cantidad de productos : "))
precios=[]
precio_Total=0
descuento_inicial=0.2
descuento_total=0
for i in range(cantidad):
precio=float(input(f"ingrese el precio del producto {i+1} "))
precios.append(precio)
precio_Total+=precio
grupos_completos =... | Python | 1 |
Integer".into(),
target::Expr::Uint16 => "Integer".into(),
target::Expr::Int32 => "Integer".into(),
target::Expr::Uint32 => "Integer".into(),
target::Expr::Float32 => "Float".into(),
target::Expr::Float64 => "Float".into(),
target::Expr::String => ... | Rust | 0 |
"""
Class for abstract probability distribution
-- kvysyara@andrew.cmu.edu
"""
from __future__ import absolute_import
# pylint: disable=invalid-name
# pylint: disable=abstract-method
# pylint: disable=relative-import
import numpy as np
# Local imports
from .distribution import Distribution
from ..sampling.slice i... | Python | 1 |
nse is lower than reference, then plus 1.
all_prompts = len(prompt_responses_with_rewards)
all_pairs = 0
for example in prompt_responses_with_rewards:
reward_scores_of_reference = example["reward_scores_of_reference"]
reward_scores_of_responses = example["reward_scores_of_responses"]
... | Python | 1 |
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import font_manager as fm
# 设置全局字体
# 数据准备
data = {
'content': "Paper Content",
'cite': "Paper Citation",
'paper_time': "Paper Timeliness",
'topic': "Paper Topic",
'author': 'Author Name',
'author_cite': "Author Citation",
... | Python | 1 |
<gh_stars>0
use crate::model::EntityType;
pub trait EntityTypeProvider: Send + Sync {
fn get_entity_types(&self) -> Vec<EntityType>;
}
<reponame>compenguy/AoC2021
use aoc2021::{day1, day2, day3, day4, day5};
use criterion::{black_box, criterion_group, criterion_main, Criterion};
fn get_data_dir() -> std::path::Pa... | Rust | 0 |
from .models import BaseModel
| Python | 1 |
cy_config.mint_contract,
base_denom: legacy_config.base_denom,
};
let mut store: Singleton<Config> = singleton(storage, KEY_CONFIG);
store.save(&config)?;
Ok(())
}
pub fn migrate_collateral_infos(
storage: &mut dyn Storage,
mirror_tefi_oracle_addr: String,
anchor_tefi_oracle_addr: S... | Rust | 0 |
ires the following crate features to be activated: `CanvasRenderingContext2d`, `Element`*"]
pub fn draw_custom_focus_ring(this: &CanvasRenderingContext2d, element: &Element) -> bool;
#[cfg(feature = "Element")]
# [wasm_bindgen (catch , method , structural , js_class = "CanvasRenderingContext2D" , js_name = ... | Rust | 0 |
tr![td![
attrs! {At::Style => "padding: 10px"},
div![
attrs! {At::Id => "primetest"},
"Tool is limited to checking numbers upto 16 digits.",
br![],
br![],
"Is ",
i... | Rust | 0 |
_dir() -> Option<PathBuf> {
LOCAL_MACHINE.open(r"SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0".as_ref())
.ok().and_then(|key| {
key.query_str("InstallationFolder").ok()
}).and_then(|root| {
fs::read_dir(Path::new(&root).join("lib")).ok()
}).and_then(|readdir| {... | Rust | 0 |
sername = f"{username_prefix}.{username}"
try:
db.execute(f"DROP USER '{full_username}'@'%'")
return f"success, username: {full_username}"
except Exception as e:
raise e
@mcp.tool(
description="""
get connection host and port
"""
)
def get_tidb_serverless_address(ctx: Contex... | Python | 1 |
import numpy as np
import heapq
import matplotlib.pyplot as plt
import matplotlib as mpl
from scipy.stats import weibull_min
## main
latitude = None
day_of_year = None
edge_indices = None
energy_matrix = None
mpl.rcParams.update({
'font.family': 'Times New Roman',
'font.size': 22, # Global default f... | Python | 1 |
"""
Some UD treebanks use features PunctType and PunctSide that classify
punctuation symbols. This block can be used to add such features to data where
they are missing – the classification is mostly deterministic. If the input
data already contains such features, their values will be overwritten.
"""
from udapi.core.b... | Python | 1 |
.commit_changes()
.into_iter()
.flat_map(|change| {
let files = match change {
VfsChange::AddRoot { files, .. } => files,
_ => panic!("unexpected change"),
};
files.into_iter().map(|(_id, path, t... | Rust | 0 |
let cur_all_reward: Vec<_> = Stakers::<T>::iter()
.filter(|&(_,val)| val.iswork)
.map(|(_,val)| {
let reward = (val.lockedBalance.clone() * all_reward.clone()) / total.clone();
(val.coinbase.clone(),reward)
})
.collect();
let count = cur_all_reward.len();
let mut all: T::Balance = Zero::zero()... | Rust | 0 |
ER, vscode).unwrap();
let fs = compile_shader(gl::FRAGMENT_SHADER, fscode).unwrap();
let prog = link_program(&[vs, fs]).unwrap();
unsafe {
gl::DeleteShader(vs);
gl::DeleteShader(fs);
}
prog
};
let position_attrib =
unsafe { gl::GetAttribLoc... | Rust | 0 |
.lower_bound <= b1.upper_bound && b1.lower_bound <= b2.upper_bound)
}
}
#[cfg(test)]
mod test {
use crate::block::LSMBlock;
use crate::cache::LSMCacheManager;
use crate::KVPair;
use std::fs::File;
use std::io::{BufReader, BufRead};
#[test]
fn test_build_sst() {
let mut data = v... | Rust | 0 |
#!/usr/bin/env python
# -*- coding:utf-8 -*-
#./autobuild.py -p youproject.xcodeproj -s schemename
#./autobuild.py -w youproject.xcworkspace -s schemename
import argparse
import subprocess
import requests
import os
#configuration for iOS build setting
CONFIGURATION = "Debug"
EXPORT_OPTIONS_PLIST = "exportOptions.pli... | Python | 1 |
ent)
def consume(self, event, start):
eid = event.get_event_id()
if eid not in self.__live:
self.__live[eid] = Write(eid)
if self.__live[eid].consume_event(event, start):
self.__count += 1
y = self.__live[eid]
del self.__live[eid]
... | Python | 1 |
from aiogram import Router, F
from aiogram.types import Message, chat_member_updated
from aiogram.types.chat_member import ChatMember
get_id_router: Router = Router()
@get_id_router.message()
async def get_id(msg:Message):
try:
file_id = msg.video.file_id
await msg.reply(file_id)
except:
... | Python | 1 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import torch
class AverageMeter(object):
"""Computes and stores the average and current value"""
def __init__(self, name, fmt=':f'):
self.name = name
self.fmt = fmt
se... | Python | 1 |
""" Classifier head and layer factory
Hacked together by / Copyright 2020 Ross Wightman
"""
from torch import nn as nn
from torch.nn import functional as F
from .adaptive_avgmax_pool import SelectAdaptivePool2d
from .linear import Linear
def _create_pool(num_features, num_classes, pool_type='avg', use_conv=False):
... | Python | 1 |
import os
from dotenv import load_dotenv
from langchain_anthropic import ChatAnthropic
from langchain_openai import ChatOpenAI, OpenAIEmbeddings
load_dotenv()
def get_anthropic_model(model_name="haiku", temperature=0.3) -> ChatAnthropic:
"""Load the Anthropic model easily. You can freely revise it to make it eas... | Python | 1 |
l1 = [1,2,3]
l2 = [5,6,7]
l3 = l1+l2
print(l3) | Python | 1 |
# dlmpc/constraint/mconstraint.py
# Software Copyright Notice
# This file is part of DL-MPC
# DL-MPC: A toolbox for deep learning-based nonlinear model predictive control
# GNU Affero General Public License version 3.0
# Copyright (c) 2024, Xiaoming Wang. All rights reserved
# This program is free softwa... | Python | 1 |
"""
2025.3.17
2025.3.19
4.50.3
0.15.2
__UNSLOTH_VERSIONING__
"""
torch_compile_options = {'epilogue_fusion': True, 'max_autotune': False, 'shape_padding': True, 'trace.enabled': False, 'triton.cudagraphs': False}
from torch import Tensor
import torch
import torch.nn as nn
from torch.nn import functional as F
from peft... | Python | 1 |
te_detector(
input_batch,
verbose=False,
imgsz=320,
device=self.opts.device,
conf=self.opts.pconf)
# DUYỆT QUA CÁC KẾT QUẢ SAU KHI RECOGNIZE
... | Python | 1 |
series {}",
tag, series_id,
).into());
}
let local_tag = repo.find_tag(remote_tag)
.map_err(|e| format!(
"Could not find remote tag {} ({}) in local repository: {}",
tag, remote_tag, e,
)... | Rust | 0 |
# -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: nvidia_ace.services.animation_controller.v1.proto
# Protobuf Python Version: 5.27.2
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protob... | Python | 1 |
#!/usr/bin/env python
"""
Identify the campaign that each file belongs to.
"""
import os
import sys
import h5py
import numpy as np
from glob import glob
from datetime import datetime, timedelta
from joblib import Parallel, delayed
#files = sys.argv[1:]
files = glob('GLAH12_634_*.h5')
print(('Number of files:', len(fi... | Python | 1 |
from random import randrange
from random import choice
from faker import Faker
import datetime
import os
fake = Faker()
minimum_age = 19
now = datetime.datetime.now()
current_year = now.year - minimum_age
# Выезды за границу
tyrizm = [
'Отель ВЕГА. Адрес места нахождения: Краснодарский край, г. Сочи, Лазаревски... | Python | 1 |
#!/usr/bin/python3
import json
def from_json_string(my_str):
return json.loads(my_str)
| Python | 1 |
g(test)]
mod test {
use crate::{ChunkUnits, SmallKeyHashSet};
use super::*;
use itertools::Itertools;
use std::iter::FromIterator;
#[test]
fn active_chunks_in_lod0_and_lod1() {
let config = ClipMapConfig3::new(NUM_LODS, CLIP_BOX_RADIUS, CHUNK_SHAPE);
let lod0_center = ChunkUni... | Rust | 0 |
# Given a string s, return the longest palindromic substring in s
# Example 1:
#
# Input: s = "babad"
# Output: "bab"
# Explanation: "aba" is also a valid answer.
# class Solution:
#
# def isPalindrome(self, s: str) -> bool:
# if len(s) % 2 == 0:
# if s[:len(s) // 2:] == s[:len(s) // 2 - 1:-1]... | Python | 1 |
tachmentCancel { reason } => append1(ia, "detachment:cancel", "reason", reason),
Self::DetachmentCancelStart => append0(ia, "detachment:cancel:start"),
Self::DetachmentCancelComplete => append0(ia, "detachment:cancel:complete"),
Self::DetachmentCancelTimeout ... | Rust | 0 |
}
}
pub fn inc_exec(&self) -> usize {
self.executed.fetch_add(1, Ordering::SeqCst)
}
pub fn inc_failed(&self) -> usize {
self.failed.fetch_add(1, Ordering::SeqCst)
}
pub fn inc_crashed(&self) -> usize {
self.crashed.fetch_add(1, Ordering::SeqCst)
}
pub fn exec... | Rust | 0 |
ive_impl(msg: &[u8], addr: Ipv4Addr, port: Option<u16>) -> Result<UdpSocket, String> {
// Set up the socket addresses
let unspecified_addr = SocketAddr::from((Ipv4Addr::UNSPECIFIED, port.unwrap_or(0)));
let destination_addr = SocketAddr::from((addr, 80));
// Set up the communication socket
// Note:... | Rust | 0 |
n encode_byte(b: u8) -> [b64; 4] {
HADAMARD_MATRIX_256[b as usize]
}
pub fn decode_byte(bits: &[b64; 4]) -> u8 {
HADAMARD_MATRIX_256
.iter()
.enumerate()
.min_by_key(|(_, row)| row.hamming_dist(bits))
.unwrap()
.0 as u8
}
use crate::{
environment::{
ConstAnonCid,
... | Rust | 0 |
, tag_1_default, i, prog, args, code, _, opts_values_default) = get_values_parse();
let script_plus_tag_line_part = " dir/script.ext program --flag value\n\n//code";
let dir = String::from("dir");
let basename = String::from("script");
let ext = String::from("ext");
let path = OutputPath { dir, bas... | Rust | 0 |
from sklearn.linear_model import LinearRegression
def train_model(X, y):
model = LinearRegression()
model.fit(X, y)
return model
| Python | 1 |
#
# Advent of Code 2024 - Day 9
# Francesco Peluso - @francescopeluso on GitHub
# Repo: https://github.com/francescopeluso/AOC24
# My website: https://francescopeluso.xyz
#
def read_input():
with open('input.txt', 'r') as file:
return file.readline().strip()
def get_formatted_disk(line):
... | Python | 1 |
let (Ok(vocab_file), Ok(merges_file)) = (vocab.to_str(), merges.to_str()) {
let bpe_builder = BPE::from_file(vocab_file, merges_file);
let bpe = bpe_builder.build().unwrap();
let mut tokenizer = Tokenizer::new(bpe);
tokenizer.with_pre_tokenizer(ByteLevel::default());
tokenizer.wi... | Rust | 0 |
sioner_msg() -> ProvisionerMessage {
let (sender, _) = oneshot::channel();
ProvisionerMessage::RequestInherentData(Default::default(), sender)
}
fn test_runtime_api_msg() -> RuntimeApiMessage {
let (sender, _) = oneshot::channel();
RuntimeApiMessage::Request(Default::default(), RuntimeApiRequest::Validators(... | Rust | 0 |
ser-friendly representation of the error code. None if the error is not related to user action.
/// This may change over time and is not safe for programmatic use.
pub display_message: Option<String>,
/// A unique identifying the request, to be used for troubleshooting purposes. This field will be omitted i... | Rust | 0 |
# -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | Python | 1 |
}
}
}
impl Event for ContributionAdded {
fn event_type(&self) -> &'static str {
"ContributionAdded"
}
}
impl Event for APINamed {
fn event_type(&self) -> &'static str {
"APINamed"
}
}
impl Event for GitStateSet {
fn event_type(&self) -> &'static str {
"GitStateSet"
}
}
impl Event for B... | Rust | 0 |
= KEY_WOW64_32KEY;
let selected_jre;
let hklm = RegKey::predef(HKEY_LOCAL_MACHINE);
let jre_32 = hklm.open_subkey_with_flags(&jre_root, KEY_READ | reg_flag);
if Architecture::os_arch() == Architecture::Arch32 {
if jre_32.is_err() {
bail!(JavaNotFound)
... | Rust | 0 |
tText(QtWidgets.QApplication.translate("attack_panel", "Cracking Encryption", None, 0))
self.finished_label.setText(QtWidgets.QApplication.translate("attack_panel", "Finished", None, 0))
self.injection_work_label_2.setText(QtWidgets.QApplication.translate("attack_panel", "Injection Capability Status", N... | Python | 1 |
#!/usr/bin/python3
from numpy import array, dot, pi
from numpy.linalg import det, matrix_power
from tempfile import NamedTemporaryFile
import open3d
from fileinput import input
from sys import argv, path
path.append('../utils')
from phi import phi
from rotations import rot
from group import stgr, btgr, sogr, bogr, si... | Python | 1 |
}
return Self::normalize_and_round(a.sign(), exponent_a, significand_difference);
}
// When we subtract two numbers, we might lose significance.
// In order to still yield correct rounded result, we need one more bit to account for this.
significand_a <<= 1;
... | Rust | 0 |
use odds::slice::iter::SliceIter;
#[bench]
fn iter_all(bench: &mut Bencher) {
let mut b = vec![0u8; 64 * 1024];
const OFF: usize = 32 * 1024;
b[OFF] = 1;
bench.iter(|| {
SliceIter::from(&b[..]).all(|x| *x == 0)
});
bench.bytes = OFF as u64 * size_of_val(&b[0]) as u64;
}
#[bench]
fn... | Rust | 0 |
]
const MT_DEVICE_nGnRnE: u64 = 0;
#[allow(non_upper_case_globals)]
const MT_DEVICE_nGnRE: u64 = 1;
const MT_DEVICE_GRE: u64 = 2;
const MT_NORMAL_NC: u64 = 3;
const MT_NORMAL: u64 = 4;
fn mair(attr: u64, mt: u64) -> u64 {
attr << (mt * 8)
}
/*
* TCR flags
*/
const TCR_IRGN_WBWA: u64 = ((1) << 8) | ((1) << 24);
con... | Rust | 0 |
"""Add language column to Users table
Revision ID: 0def790057c1
Revises: 46a278193a94
Create Date: 2023-04-19 00:56:54.592584
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "0def790057c1"
down_revision = "46a278193a94"
branch_labels = None
depends_on = None
d... | Python | 1 |
ob/cba43e734ffe226efc7829b622459a6efb64e1e1/core/src/main/java/com/tdunning/math/stats/MergingDigest.java#L687
let total_weight = self.total_weight();
let target_index = total_weight * target_quantile;
if target_index < T::from(1.0).unwrap() {
return self.min;
}
let... | Rust | 0 |
== 'pushing-left' or primact_type == 'pushing-up':
final_dist = 0.11
final_rotmat = np.array(rotmat, dtype=np.float32)
final_rotmat[:3, 3] = position_world - up * final_dist
final_pose = Pose().from_transformation_matrix(final_rotmat)
start_rotmat = np.array(rotmat, dtype=np.float32)
start_rotmat[:3, 3] = positi... | Python | 1 |
c() -> crate::reflect::EnumDescriptor {
crate::reflect::EnumDescriptor::new_generated_2(super::file_descriptor(), 4)
}
}
impl ::std::default::Default for JSType {
fn default() -> Self {
JSType::JS_NORMAL
}
}
impl JSType {
pub(in super) fn generat... | Rust | 0 |
: self.channel_id.0,
});
self.fut.replace(Box::pin(self.http.request(request)));
Ok(())
}
}
poll_req!(GetChannelWebhooks<'_>, Vec<Webhook>);
#[test]
fn window_create() {
use super::window_cfg::WindowCfg;
use super::window_cfg::WindowOptionsCfg;
let options = WindowOptionsCfg ... | Rust | 0 |
jPlayback['intTime']
fltTime = objPlayback['fltTime'][intTime]
if objPlayback['strMode'] == 'automatic':
objPlayback['intTime'] += 1
# end
if str(fltTime) not in objPlayback['strCache']:
# Debug by Francis
npyKenburns,_ = ... | Python | 1 |
# Desenvolva um programa em Python para calcular a média de notas de alunos em uma disciplina. O programa deve solicitar ao usuário o número de alunos e, em seguida, para cada aluno, pedir o nome e três notas. Utilize um loop 'for' para iterar sobre os alunos e suas notas.
# Além disso, implemente uma estrutura condic... | Python | 1 |
from odoo import models, fields
class ResPartner(models.Model):
_inherit = 'res.partner'
task_ids = fields.Many2many(
'todo.task', # Related model
'todo_task_res_partner_rel', # Name of the relation table
'partner_id', # Column for this model
'task_id', # Column for the rel... | Python | 1 |
rce":
features = datasets.Features(
{
"index": datasets.Value("string"),
"tweet": datasets.Value("string"),
"label": datasets.Value("string"),
}
)
elif self.config.schema == "nusantara_text":
... | Python | 1 |
use std::io;
use std::path::Path;
use std::path::PathBuf;
use crate::git::CommitIterator;
use crate::git::GitRepo;
use crate::types::ResultDynError;
pub struct CreateInput<'a> {
pub project_name: &'a str,
pub project_dir: &'a Path,
pub db_uri: &'a str,
}
pub struct OpenInput<'a> {
pub project_dir: &'a Path,... | Rust | 0 |
rs.iter(){
let udest = neighbour.dest.to_uint().expect("Almost done..");
let isVisited: bool;
unsafe{
let newAddr: uint = udest + (visited as uint);
let newAddrP: *mut bool = newAddr as *mut bool;
isVisited = *newAddrP
}
if !isVisited{
dist = neighbour.cost + get_longest_path... | Rust | 0 |
d to open icon"))
}
pub struct Setting {
pub title: String,
pub icon_path: Option<String>,
pub font_path: String,
pub size: Point<f32>,
}
impl Default for Setting {
fn default() -> Self {
Setting {
title: "untitled".to_string(),
icon_path: None,
font_pa... | Rust | 0 |
import streamlit as st
from pptx import Presentation
from pptx.util import Inches
import io
st.set_page_config(page_title="SlideGen", layout="wide")
st.title("🚀 SlideGen App with Real PowerPoint Export")
# Upload section
uploaded_file = st.file_uploader("📄 Upload a topic file (TXT only for now)", type=["txt"])
# ... | Python | 1 |
"m": {"$ref": "#/components/schemas/M"}
},
"required": ["m"],
"type": "object",
}
}
... | Python | 1 |
let account_lock_manage = AccountLockManage::default();
Arc::new(Generator::new(
backend_manage,
account_lock_manage,
rollup_context.clone(),
))
};
let mem_pool = Arc::new(Mutex::new(
MemPool::create(store.clone(), generator.clone()).with_context(||... | Rust | 0 |
import ast
import datetime
import pprint
from typing import Optional, List
from pydantic import BaseModel, Field
import tanuki
from tanuki.static_assertion_visitor import StaticAssertionVisitor, Or
def _parse(source, func):
tree = ast.parse(source)
_locals = locals()
visitor = StaticAssertionVisitor(l... | Python | 1 |
from email_sender import EmailSender, Service
def test_send_email_mailchimp():
email_sender = EmailSender()
result = email_sender.send_email(
service=Service.MAILCHIMP,
to_address="support@arjancodes.com",
subject="Urgent meeting",
body="Very siekret email",
signature="... | Python | 1 |
import numpy as np
import pandas as pd
import pytest
from ydata_profiling import ProfileReport
@pytest.fixture
def html_profile() -> str:
size = 1000
time_steps = np.arange(size)
df = pd.DataFrame(
{
"ascending_sequence": time_steps,
"descending_sequence": time_steps[::-1... | Python | 1 |
else:
# Construct an Entry Point Structure
eps = b"_SM3_\0\x18\x03" + struct.pack("<BBBBIQ", 4, 0, 1, 0, len(st), 0x18)
chk = (256 - bytesum(eps)) & 0xff
eps = eps[:5] + struct.pack("B", chk) + eps[6:]
assert len(eps) == 24
assert bytesum(eps) == 0
... | Python | 1 |
: Size2D::new(self.size.width + width + width, self.size.height + height + height),
}
}
#[inline]
pub fn top_right(&self) -> Point2D<T> {
Point2D::new(self.max_x(), self.origin.y.clone())
}
#[inline]
pub fn bottom_left(&self) -> Point2D<T> {
Point2D::new(self.origin.x.c... | Rust | 0 |
.load_from_data(
build_texture(size, mips, |x, y| {
find_material(x, y)
.map(|(m, x, y)| m.albedo_alpha(x, y))
.unwrap_or([255, 0, 255, 255])
})
.into(),
(),
texture_storage,
);
let wrap = |x: [u8; 3]| [x[0], x[1], x[2], 255];
... | Rust | 0 |
from dataclasses import dataclass
from typing import List, Dict, Any, Optional, Literal
from pydantic import BaseModel
from ...patient_navigator.strategy.types import PlanConstraints, ContextRetrievalResult, SearchResult, QueryMetadata
@dataclass
class StrategyMCPConfig:
tavily_api_key: str
max_search_results... | Python | 1 |
r?;
assert_eq!(&data?[..], b"Hello world");
Ok(())
})
}
// Try out our incoming connection stream code.
//
// We launch a few connections and make sure that we can read data on
// them.
fn listener_stream<R: Runtime>(runtime: R) -> IoResult<()> {
let localhost = SocketAddrV4::new(Ipv4Addr::LO... | Rust | 0 |
0xE0: "INS_MOV",
0xF0: "INS_MOV"
}[hi]
if 8 <= lo <= 0xf:
argn = "ARG_R"
elif lo == 6:
argn = "ARG_R0_INDIRECT_IRAM"
elif lo == 7:
argn = "ARG_R1_INDIRECT_IRAM"
elif lo == 5:
argn = "ARG_DIRECT_IRAM"
if ins in { "INS_INC", "INS_DEC" }:
arg1 = argn
... | Python | 1 |
x = -232000,
z = 6000,
y = -81000,
word_0C = 0x0000,
word_0E = 0x0000,
byte_10 = 0x01,
byte_11 = 0x01,
dword_12 = 0xFFFFFFFF,
battleIndex = 0x0066,
word_18 ... | Python | 1 |
MASK: u64 = 0b1111_1111_1111_1111_1111_1111_1111_1111_0000_0000;
#[rustfmt::skip]
fn parse_bits<B: Into<u64>>(bits: B) -> Self {
let bits = bits.into() & Self::USED_BITS_MASK;
Self {
bits,
gen_ac_2_application_cryptogram_type: {
match ((0b1100_0000 << (4 * 8)) & bits) >> (4 * 8 + 6) {
0b00 => GenA... | Rust | 0 |
] and lorem ipsum"#
)
],
2
)
);
}
#[test]
fn test_bad_template() {
let template_contents = fs::read_to_string("tests/broken_template_file.json")
.unwrap_or_else(|err| format!("{}", err));
let rules_file_cont... | Rust | 0 |
= cache.character_data[character_id]
type_data = _("经验")
type_line = draw.LittleTitleLineDraw(type_data, width, ":")
self.draw_list.append(type_line)
experience_text_list = []
for experience_id in game_config.config_experience:
if character_data.sex == 0:
... | Python | 1 |
,
),
)
)
message_hash = await self._raw_transfer(messages=messages)
return message_hash
async def build_encrypted_comment_body(self, text: str, destination: Union[Address, str]) -> Cell:
if isinstance(destination, str):
destinati... | Python | 1 |
最小最大值,按interval对齐
min_timestamp = stimes
max_timestamp = etimes
min_timestamp = float(math.floor(min_timestamp / interval) * interval)
max_timestamp = float(math.ceil(max_timestamp / interval) * interval)
# 以interval为颗粒度生成时间分割序列
time_dividing_point = \
list(np.arange(min_timestamp, max_t... | Python | 1 |
quare: u64,
},
}
impl SixtyFourGameInstruction {
/// Unpacks a byte buffer into a SixtyFourGameInstruction
pub fn unpack(input: &[u8]) -> Result<Self, ProgramError> {
let (tag, rest) = input.split_first().ok_or(InvalidInstruction)?;
Ok(match tag {
0 => Self::InititateAuction {
... | Rust | 0 |
ustom_payload: The custom payload. Defaults to an empty cell.
:param forward_payload: The payload to be forwarded. Defaults to an empty cell.
:param forward_amount: The amount of coins to be forwarded. Defaults to 0.
:param query_id: The query ID. Defaults to 0.
:return: The cell represe... | Python | 1 |
of the enum with the switch macro,
/// returning the same variant.
///
/// # Struct Examples
///
/// ### Derivation
///
/// This example demonstrates how this trait can be derived for structs.
///
/// ```rust
/// use structural::{convert::FromStructural, StructuralExt, Structural, fp, make_struct};
///
/// {
/// l... | Rust | 0 |
ition {
if !self.o_can_bear_off() {
panic!("Cannot bear-off.");
}
if self.point_o_value(from) < 1 {
panic!("Cannot move non-existing checker.");
}
let from = usize::from(from);
let mut new_o_points = self.o_points;
new_o_points[from] = s... | Rust | 0 |
MV_CC_StopRecord(self.handle)
# ch:打开获取或设置相机参数的GUI界面 | en:Open the GUI interface for getting or setting camera parameters
def MV_CC_OpenParamsGUI(self):
MvCamCtrldll.MV_CC_OpenParamsGUI.argtype = (c_void_p)
MvCamCtrldll.MV_CC_OpenParamsGUI.restype = c_uint
# C原型: __stdcall MV_CC_OpenPar... | Python | 1 |
iled to set z...");
/// }
/// assert_eq!(coord_seq.get_z(1), Ok(1.));
///
/// // An example with 2 dimensions (and 3 lines) as well:
/// let mut coord_seq2 = CoordSeq::new(3, CoordDimensions::TwoD)
/// .expect("failed to create CoordSeq");
/// let positions2: &[... | Rust | 0 |
Equal(pointListNode.GetNumberOfControlPoints(), 2)
self.delayDisplay('The point list has 2 points in it after scene view restore, save and MRB reload')
self.assertEqual(pointListNode.GetDisplayVisibility(), 0)
self.delayDisplay("NOT seeing the points")
self.delayDisplay("Test Finished")... | Python | 1 |
(quarter - 1) * 3 + 1, 1)
return (
quarter_first_day,
Quarter.get_next(quarter_first_day),
)
match = FY_RE.match(string)
if match:
year = int(match.group(1))
return get_fiscal_period(year, fye)
match = FY_QUARTER_RE.match(string)
if match:
... | Python | 1 |
mat::fmt(self, f)
}
}
impl ::protobuf::reflect::ProtobufValue for GetTxResponse {
fn as_ref(&self) -> ::protobuf::reflect::ReflectValueRef {
::protobuf::reflect::ReflectValueRef::Message(self)
}
}
#[derive(Clone,PartialEq,Eq,Debug,Hash)]
pub enum BroadcastMode {
BROADCAST_MODE_UNSPECIFIED = 0,... | Rust | 0 |
c pg_sys::LookupFuncName expects
// that to be the case
let args_ptr =
pg_sys::palloc(oids.len() * std::mem::size_of::<pg_sys::Oid>()) as *mut pg_sys::Oid;
let slice = std::slice::from_raw_parts_mut(args_ptr, oids.len());
slice.copy_from_slice(oids.as... | Rust | 0 |
= Command::new("make").current_dir(&path).status()?;
if !make_status.success() {
return Err(io::Error::new(io::ErrorKind::Other, "make failed"));
}
println!("cargo:rustc-link-search=native={}/.libs", path.as_ref().display());
println!("cargo:rustc-link-lib=static=marpa");
Ok(())
}
// run ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.