text string | label_name string | labels int64 |
|---|---|---|
rmal."]
_1,
}
impl From<TSRR_A> for bool {
#[inline(always)]
fn from(variant: TSRR_A) -> Self {
match variant {
TSRR_A::_0 => false,
TSRR_A::_1 => true,
}
}
}
#[doc = "Reader of field `TSRR`"]
pub type TSRR_R = crate::R<bool, TSRR_A>;
impl TSRR_R {
#[doc = r"G... | Rust | 0 |
}
}
impl PositionRange for TypeDecl {
fn start_position(&self) -> Position {
self._hyphen.start_position()
}
fn end_position(&self) -> Position {
self._dot.end_position()
}
}
<reponame>typicalbot/typicalbot-internal-api
use futures::future::TryFutureExt;
use std::net::Ipv4Addr;
use ... | Rust | 0 |
let blender_process = blender_process
.arg("--background")
.arg("-noaudio")
.args(&["--python", install_mesh2json_path])
// TODO: An API in our root crate for writing the script to a tmp file and giving you
// a link to it
.args(&[
"--python",
wo... | Rust | 0 |
###############################################################
# Copyright 2020 Lawrence Livermore National Security, LLC
# (c.f. AUTHORS, NOTICE.LLNS, COPYING)
#
# This file is part of the Flux resource manager framework.
# For details, see https://github.com/flux-framework.
#
# SPDX-License-Identifier: LGPL-3.0
####... | Python | 1 |
F_PRARGSZ: size_t = 80;
#[repr(C)]
pub struct elf_siginfo {
pub si_signo: c_int,
pub si_code: c_int,
pub si_errno: c_int,
}
#[repr(C)]
pub struct time {
pub tv_sec: c_long,
pub tv_usec: c_long,
}
#[repr(C)]
pub struct elf_prstatus {
pub pr_info: elf_siginfo,
pub pr_cursig: c_short,
pu... | Rust | 0 |
"""
Checks that builtin functions do not get redefined.
In the past when reorganizing builtin functions we sometimes
had missing or duplicate built-in functions definitions.
"""
import os
import pytest
from mathics.core.builtin import Builtin
from mathics.core.load_builtin import mathics3_builtins_modules, name_is_... | Python | 1 |
#! /usr/bin/env python
#
# Software License Agreement (BSD License)
#
# Copyright (c) 2012, Willow Garage, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributions of source c... | Python | 1 |
# -*- coding: utf-8 -*-
import requests
import csv
import json
import io
def isLineEmpty(line):
return len(line) == 0
def read_dataset(filename):
data = json.load(io.open('../datasets/webqsp.test.entities.with_classes.json', encoding='utf-8'))
questions=[[question['utterance'],[x for x in question['... | Python | 1 |
import asyncio
import time
import pytest
import threading
from unittest.mock import patch
from dataroom_client.dataroom_client.client import AsyncRunner
@pytest.fixture(autouse=True)
def cleanup_async_runner():
# This fixture ensures that AsyncRunner is reset after each test,
# preventing state leakage between... | Python | 1 |
##############################################################################
# Copyright 2009, Gerhard Weis
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code ... | Python | 1 |
class Car:
total_car = 0
def __init__(self, brand, model):
self.__brand = brand
self.__model = model
Car.total_car += 1
def get_brand(self):
return self.__brand + " !"
def full_name(self):
return f"{self.__brand} {self.__model}"
def fuel_type(self):
... | Python | 1 |
_y == 2 {
// 3rd rank
Color::White
} else if pos.rank_y == 5 {
// 6th rank
Color::Black
} else {
return Err(anyhow::Error::msg("impossible en passant target"));
};
... | Rust | 0 |
import sys
sys.stdin = open('forth.txt')
def cal(op, a, b):
if op == '+':
return b + a
elif op == '-':
return b - a
elif op == '*':
return b * a
else:
return b//a # int
def solve(fx): # number를 저장하고, 연산식이 나왔을 경우, 연산자와 pop*2를 연산
for token in fx:
if token == '.... | Python | 1 |
# Copyright (c) Opendatalab. All rights reserved.
import copy
import cv2
import numpy as np
class OcrConfidence:
min_confidence = 0.5
min_width = 3
LINE_WIDTH_TO_HEIGHT_RATIO_THRESHOLD = 4 # 一般情况下,行宽度超过高度4倍时才是一个正常的横向文本块
def merge_spans_to_line(spans, threshold=0.6):
if len(spans) == 0:
return ... | Python | 1 |
tr>],
_event: PromptEvent,
) -> anyhow::Result<()> {
let dir = helix_core::path::expand_tilde(
args.first()
.context("target directory not provided")?
.as_ref()
.as_ref(),
);
if let Err(e) = std::env::set_current_dir(dir) {
bail!("Couldn't change the ... | Rust | 0 |
_escape::encode_double_quoted_attribute(value)
)?;
}
write!(f, ">{}</{}>", self.children, self.name)?;
Ok(())
}
}
#[derive(Debug, Clone, Eq, PartialEq, Default)]
pub struct Comment(String);
impl fmt::Display for Comment {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Re... | Rust | 0 |
et and isinstance(target, Character) and not target.is_alive():
target.revive()
return f"{caster.name}の{spell.name}!{target.name}が蘇生した!"
else:
return f"{caster.name}の{spell.name}は失敗した"
def _apply_spell_effect(self, caster: Character, spell: Any,
... | Python | 1 |
e
rr.write("%i %i %0.3f %.3f 1\n" %(j+1, k+1, P[j][k], P[j][k]) )
rr.close()
print('Written RR ' + file_rr + ' !')
def save_contacts_rr(pdb, all_feat_paths, pred_matrix, file_rr):
for path in all_feat_paths:
if os.path.exists(path + pdb + '.pkl'):
features = pickle.load(open... | Python | 1 |
import time
# Import OpenFHE and matrix utilities
import numpy as np
from openfhe import *
import openfhe_numpy as onp
def demo():
"""
Run a demonstration of homomorphic matrix multiplication using OpenFHE-NumPy.
"""
params = CCParamsCKKSRNS()
cc = GenCryptoContext(params)
cc.Enable(PKESchem... | Python | 1 |
eduler": DEFAULT_SCHEDULER,
"fallback_mode": "warn",
},
)
left = pl.LazyFrame({"x": range(15), "y": [1, 2, 3] * 5})
right = pl.LazyFrame({"xx": range(9), "yy": [2, 4, 3] * 3})
if reverse:
left, right = right, left
q = left.join_where(right, pl.col("y") < pl.col("yy"))
... | Python | 1 |
ut, 0, 0, InputEmpty, "");
}
#[test]
fn quote_no_quotes() {
let inp = b("foobar");
let out = &mut [0; 1024];
assert_quote!(inp, out, 6, 6, InputEmpty, "foobar");
}
#[test]
fn quote_one_quote() {
let inp = b("\"");
let out = &mut [0; 1024];
asse... | Rust | 0 |
# Copyright (C) 2010-2011 Richard Lincoln
#
# 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, publish... | Python | 1 |
== size_of::<Dirent>() as isize
{
if de.inum != 0 {
unsafe {
ptr::copy(de.name.as_ptr(), p, DIRECTORY_SIZE);
*(p.add(DIRECTORY_SIZE)) = 0;
}
if stat(buf.as_... | Rust | 0 |
/// Used by a repeater when the inbound channel is idle.
InboundIdle,
/// Used by a repeater when the inbound channel is busy.
InboundBusy,
/// Used when a subscriber is transmitting to a repeater.
SubscriberRepeater,
/// Used when a subscriber is transmitting directly to another subscriber... | Rust | 0 |
&[u8], level: CompressionOptions) {
let compressed = deflate::deflate_bytes_zlib_conf(data, level);
println!("Compressed len: {}, level: {:?}", compressed.len(), level);
let decompressed =
miniz_oxide::inflate::decompress_to_vec_zlib(&compressed).expect("Decompression failed!");
assert!(decompre... | Rust | 0 |
pub graph_module_inject: ::std::option::Option<
unsafe extern "C" fn(manager: *mut ComponentManagerO, module: *mut RenderGraphModuleO),
>,
pub graph_requested:
::std::option::Option<unsafe extern "C" fn(manager: *mut ComponentManagerO) -> StrhashT>,
pub activate_systems: ::std::option::Optio... | Rust | 0 |
determining availability of builder-api components.
///
/// Returns a status 200 on success. Any non-200 responses are an outage or a partial outage.
pub fn status(_req: &mut Request) -> IronResult<Response> {
Ok(Response::with(status::Ok))
}
/// Return an IronResult containing the body of a NetError and the appr... | Rust | 0 |
");
let client = reqwest::Client::new();
let genesis_file = std::env::var("GENESIS_FILE").unwrap_or(
std::env::current_dir().expect("Failed to obtain the current directory path").join("resource").join("genesis_file.txn").to_str()
.ok_or(HarnessError::from_msg(HarnessErrorType::InternalServerErro... | Rust | 0 |
indgen_ty_11>(),
8usize,
concat!("Size of: ", stringify!(NDIlib_v4_5__bindgen_ty_11))
);
assert_eq!(
::std::mem::align_of::<NDIlib_v4_5__bindgen_ty_11>(),
8usize,
concat!("Alignment of ", stringify!(NDIlib_v4_5__bindgen_ty_11))
);
assert_eq!(
unsafe {
... | Rust | 0 |
am_t"
kern_func = (
"hipLaunchKernelGGL("
"kern_func, (stack_size + %(grouping)d - 1) / %(grouping)d, %(threads)d, shared_size, stream, "
) % self.__dict__
return f"""\
int launch_{self.name}(const int *param_stack, int stack_size, {stream_type} stream, i... | Python | 1 |
().build()?
})
}
pub fn get_listed_bouts(&self) -> Result<Vec<Bout>, Box<dyn Error>> {
let page = Html::parse_document(
&self.reqwest_client
.get("https://www.betfair.com/sport/boxing")
.send()?
.text()?
);
let bout_se... | Rust | 0 |
timeout=self.timeout)
return CursorInterface(self.cursor)
async def __aexit__(self, exc_type, exc_val, exc_tb):
await self._con.__aexit__(exc_type, exc_val, exc_tb)
async def __run_query(self):
async with self.pool.acquire() as con:
ps = await con.prep... | Python | 1 |
decoder,
text,
expected
);
// while we're at it, test that the instruction is as long, and no longer, than its
// input
assert_eq!(instr.len().to_const() as usize, data.len(), "instruction length is incorrect, wanted instruction {}... | Rust | 0 |
and.get('func'):
rec_find_args(operand.get('func').get('value'), args)
elif operand.get('type') == 'UnaryOp':# not param判断中
rec_find_args(operand.get('operand'), args)
elif operand.get('type') == 'BinOp':
find_arg_leafs(operand, args)
else:
... | Python | 1 |
import pickle
from fastapi import FastAPI
import numpy as np
from insterfases import DiabetesData
app = FastAPI()
with open ("RFDiabetesv132.pkl","rb") as file:
model=pickle.load(file)
@app.get ("/")
def index():
return{"Mensaje":"API 2 running"}
@app.post("/predict")
def predict(data: DiabetesData):
... | Python | 1 |
check_search("?x -> ?x -> ?x -> ?x", "");
}
#[test]
fn panic_in_infer() {
do_search("∃ x, ?");
}
}
<filename>core/codegen/src/bang/glue.rs
use proc_macro2::TokenStream;
use devise::{Result, Spanned, Diagnostic};
use syn::{parse::Parser, Path, punctuated::Punctuated, token::Comma};
use q... | Rust | 0 |
"""Data models for the application.""" | Python | 1 |
, similarly for (n1>n2)
let mut ord = n1.cmp(&n2);
for i in 0..n1.min(n2) {
ord = unify(ord, self.time[i].cmp(&other.time[i]))?; // return if incomparable
}
Some(ord)
}
}
#[cfg(test)]
mod test {
use super::*;
#[test]
fn vector_clock() {
let v1 = Vect... | Rust | 0 |
, to ensure the value
// is smaller than the modulus.
(&Fp([r6, r7, r8, r9, r10, r11])).subtract_p()
}
/// Return 2*self
#[inline(always)]
pub const fn double(&self) -> Fp {
Fp::add(self, self)
}
/// Compute `self` * `rhs`
#[inline]
pub const fn mul(&self, rhs: ... | Rust | 0 |
32, layers[1], 2)
self.layer3 = self.make_layer(block, 64, layers[2], 2)
self.avg_pool = nn.AvgPool2d(8)
self.fc = nn.Linear(64, num_classes)
def make_layer(self, block, out_channels, blocks, stride=1):
downsample = None
if (stride != 1) or (self.in_channels != out_channels)... | Python | 1 |
n() {
let output = Command::new("./target/debug/rdf")
.arg("./tests/tab_indentation.txt")
.output()
.unwrap();
assert_eq!(
String::from_utf8_lossy(&output.stdout),
TAB_INDENTATION_OUTPUT
);
}
}
use std::rc::Rc;
pub fn wind... | Rust | 0 |
cast i32 integer {} (the timezone offset in whole seconds) into an i16 integer.", of))?, // Keep the rest as-is
};
let golang_whole_nanos: i128 = Self::nanos_from_golang_zero(dt.unix_timestamp_nanos());
// remove nanoseconds and cast to i64 as per golang
let golang_secs = i64::try_from... | Rust | 0 |
er {
Yes,
No,
Maybe
}
}
#[derive(StructOpt, Debug)]
/// Get funny gifs from https://yesno.wtf
struct Opt {
#[structopt(possible_values = &Answer::variants())]
#[structopt(hide_possible_values = true, case_insensitive = true)]
/// Answer either `yes`, `no` or `maybe`
answer: ... | Rust | 0 |
import numpy as np
import pandas as pd
import torch
import torch.nn as nn
from .dataset import QuadInMem
from .prevalence import est_multivariate_g
from .nn_blk import EmbedNet
CXR_AKL = 1
CXR_Z_DICT = {
'Age': {'float': [0, 150]},
'Sex': {'F': 0, 'M': 1, 'U': 2, float('nan'): 3},
'AP/PA': {'AP': 0, 'PA... | Python | 1 |
"""
Recognizes MediaWiki's human conversion format.
Use locale='zh' for no conversion.
Reference: (all tests passed)
https://zh.wikipedia.org/wiki/Help:高级字词转换语法
https://www.mediawiki.org/wiki/Writing_systems/Syntax
>>> print(convert_for_mw('在现代,机械计算-{}-机的应用已经完全被电子计算-{}-机所取代', 'zh-hk'))
... | Python | 1 |
card.op = Op.objects.get_or_create(
name="Unknown", slug="unknown"
)[0]
if atribute := card_data.get("attribute"):
if atribute := Atribute.objects.filter(
... | Python | 1 |
#!/usr/bin/python
#
# \file 1_export.py
# \brief Export smallbank
# \date 2009-03-10-20-54-GMT
# \author Jan Boon (Kaetemi)
# Python port of game data build pipeline.
# Export smallbank
#
# NeL - MMORPG Framework <https://wiki.ryzom.dev/>
# Copyright (C) 2009-2014 by authors
#
# This program is free software: you ca... | Python | 1 |
r.cubic_state.w_cubic(t + r.min_rtt);
// w_est(t)
let w_est = r.cubic_state.w_est(t, r.min_rtt);
let mut cubic_cwnd = r.congestion_window;
if w_cubic < w_est {
// TCP friendly region.
cubic_cwnd = cmp::max(cubic_cwnd, w_est as usize);
} else if cubic_c... | Rust | 0 |
import logging
from unittest import TestCase
from imarkdown.adapter import AliyunAdapter, LocalFileAdapter
from imarkdown.constant import MdAdapterType
from imarkdown.converter import BaseMdImageConverter, MdImageConverter
from imarkdown.schema import MdFile, MdFolder
logging.basicConfig(level=logging.DEBUG)
logger =... | Python | 1 |
.column(0)[0],
step.0.exp(),
epsilon = 0.01
));
}
}
#[test]
fn test_ivp_quadratic() {
let t_initial = 0.0;
let t_final = 10.0;
let path = solve_ivp(
(t_initial, t_final),
(0.1, 0.001),
&[1.0],
&quadratic_deriv,
0.00001,
&m... | Rust | 0 |
()))}).fold(0.0, f64::max);
// Stopping conditions
if r_eq.lp_norm(1) + r_ineq.lp_norm(1) <= tol_scaling * options.con_tol && r_dual.lp_norm(1) <=tol_scaling * options.fun_tol && r_c < options.fun_tol{
let soln = QPSolution{
fval: 0.5*x0.dot(&(hess*&x0)) + x0.dot(&c),
... | Rust | 0 |
config_file = "wechat_config.json"
config = {}
if os.path.exists(config_file):
with open(config_file, 'r', encoding='utf-8') as f:
config = json.load(f)
# 确保last_inputs存在
if 'last_inputs' not in config:
... | Python | 1 |
import sys
import time
from progressbar import ProgressBar, Percentage, Bar, ETA, FileTransferSpeed, \
RotatingMarker, ReverseBar, SimpleProgress
def example0():
pbar = ProgressBar(widgets=[Percentage(), Bar()], maxval=300).start()
for i in range(300):
time.sleep(0.01)
pbar.update(i+1)
... | Python | 1 |
dResourceType(
self,
):
input_arn = "arn:aws:iam::111111111111:account/prowler"
with raises(RoleArnParsingInvalidResourceType) as error:
parse_iam_credentials_arn(input_arn)
assert error._excinfo[0] == RoleArnParsingInvalidResourceType
def test_iam_credentials_arn_p... | Python | 1 |
import datetime as dt
import re
from typing import Pattern
from freezegun import freeze_time
from faker import Faker
from faker.providers.user_agent import Provider as UaProvider
class TestUserAgentProvider:
"""Test user agent provider methods"""
num_samples = 1000
android_token_pattern: Pattern = re.... | Python | 1 |
larger
bv.resize(64, true);
// Here the complete iter-rev-take-rev-sequence is mandatory to reproduce the
// error, just the `collect` is here for convenience.
let last_few: Vec<_> = bv
.iter()
.rev()
.take(N)
.rev()
.collect();
// Also notice, `bv` only contains `true`, but with `N` < 4, the `last_few... | Rust | 0 |
RQPD ymm1 {k1}, vm64y`
///
/// `EVEX.256.66.0F38.W1 93 /vsib`
///
/// `AVX512VL and AVX512F`
///
/// `16/32/64-bit`
EVEX_Vgatherqpd_ymm_k1_vm64y = 3326,
/// `VGATHERQPD zmm1 {k1}, vm64z`
///
/// `EVEX.512.66.0F38.W1 93 /vsib`
///
/// `AVX512F`
///
/// `16/32/64-bit`
EVEX_Vgatherqpd_zmm_k1_vm64z = 3327,
... | Rust | 0 |
import requests
def test_api():
url = "https://pokeapi.co/api/v2/pokemon/ditto" # Bulbizarre
response = requests.get(url)
if response.status_code == 200:
data = response.json()
print(f"Nom : {data['name']}")
print(f"Types : {[t['type']['name'] for t in data['types']]}")
pr... | Python | 1 |
ipped) array containing grouped arrays of values from
/// the array1 ... arrayN arguments from index 0, 1, 2, etc.
///
/// This function accepts a variable number of arguments. The length of the returned
/// array is equal to the length of the shortest array in the arguments.
///
/// ## Examples... | Rust | 0 |
import random
subjects = [
"SRK",
"Virat Kohli",
"SK",
"A Mumbai Cat",
"Prime Minister Modi ",
"Auto Ricksaw Driver From Delhi",
"Amul Milk"
]
actions = [
"Launches",
"Cancels",
"Dances With",
"Eats",
"Declares war on",
"Orders",
"Celebrates"
]
places_or_thing... | Python | 1 |
use std::fmt;
use std::io::Write;
use std::sync::RwLock;
pub struct ComposedRenderer<'a> {
renderers: RwLock<Vec<Box<dyn Render + 'a>>>,
}
pub trait Render {
fn render(&self, out: &mut dyn Write, params: Context<'_>) -> Result<()>;
}
impl<'a> ComposedRenderer<'a> {
pub fn new() -> Self {
let rend... | Rust | 0 |
orkflow.add_node("denial", run_denial_agent)
# Add edges
# workflow.add_conditional_edges(
# START,
# route_query,
# {
# "conversational": "conversational",
# "suicide_prevention": "suicide_prevention",
# "anger_management": "anger_management",
# "motivational": "motivationa... | Python | 1 |
"""
Gets methods return querysets
"""
from django.db.models import Q
from api import models
# * -------------------------- CONVERSATIONS -----------------------------
def get_receiver(current_profile, conversation):
receiver = conversation.participants.exclude(id=current_profile.id)
return receiver[0]
... | Python | 1 |
# --- EJM 1 --------------------------------------------------------------------
def contar_Lineas(lista:list[int])->int:
contador = 0
longitud = (len(lista)-1)
while longitud >= 0:
longitud -= 1
contador += 1
return contador
#print(cantidadLista([1,2,3]))
archivo = open("mi_arch... | Python | 1 |
**kwargs):
r"""Label smooth loss.
Args:
pred (torch.Tensor): The prediction with shape (N, \*).
label (torch.Tensor): The ground truth label of the prediction
with shape (N, \*).
weight (torch.Tensor, optional): Sample-wise loss weight with s... | Python | 1 |
l`, if the `Switch` is still alive.
/// This is mostly for internal use. Nesting calls to this function will
/// cause panics due to repeated borrows.
pub fn modify_request_poll<F, R>(&self, f: F) -> R
where F: FnOnce(Option<&mut RequestPoll<'a>>) -> R
{
match self.0.upgrade() {
... | Rust | 0 |
t_pointer_width = "64")]
#[test]
#[should_panic]
fn bsm64_lb32_empty() { BitSlice::<Msb0, u64>::empty().load_be::<u32>(); }
#[cfg(target_pointer_width = "64")]
#[test]
#[should_panic]
fn bsm64_lb64_empty() { BitSlice::<Msb0, u64>::empty().load_be::<u64>(); }
#[test]
#[should_panic]
fn bsl08_ll08_full() { [0u8; 2].bit... | Rust | 0 |
for mat, frame in self.args:
mat = mat.xreplace(rule)
new_args.append([mat, frame])
return Vector(new_args)
class VectorTypeError(TypeError):
def __init__(self, other, want):
msg = filldedent("Expected an instance of %s, but received object "
"'%... | Python | 1 |
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
import pytest
from aiperf.common.exceptions import NoMetricValue
from aiperf.metrics.metric_dicts import MetricRecordDict
from aiperf.metrics.types.request_latency_metric import Req... | Python | 1 |
{
pub sin: sockaddr_in,
pub sin6: sockaddr_in6,
pub sconn: sockaddr_conn,
pub sa: sockaddr,
}
/* ** Structures and definitions to use the socket API ***/
#[derive(Copy, Clone)]
#[repr(C)]
pub struct sctp_rcvinfo {
pub rcv_sid: uint16_t,
pub rcv_ssn: uint16_t,
pub rcv_flags: uint16_t,
... | Rust | 0 |
.push(role_name.clone());
} else {
errors.push(format!("You don't have the `{}` role.", role_name));
}
}
}
}
}
let mut s = String::new();
if !added_names.is_empty() {
let _ = write!(s, "Added roles:... | Rust | 0 |
from django.shortcuts import render, redirect
from noticias.forms import NoticiaForm
from noticias.models import Noticia
# Create your views here.
def criar_noticia(request):
form = NoticiaForm(request.POST or None)
sucesso = False
if form.is_valid():
form.save()
sucesso = True
context... | Python | 1 |
import pandas as pd
import os
def rename_svg_files(csv_file_path, svg_directory_path):
# Load the CSV file
data = pd.read_csv(csv_file_path)
# Create a dictionary to map UPC to SKU
upc_to_sku = dict(zip(data['UPC'].astype(str), data['SKU']))
# Check if the directory exists
if not os.p... | Python | 1 |
st of tuples
# (source start file, name, description, authors, manual section).
man_pages = [(master_doc, "python-cfonts", "python-cfonts Documentation", [author], 1)]
# -- Options for Texinfo output ----------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (sou... | Python | 1 |
e
let bundle = psk.map(|bytes| PskBundle {
psk: bytes,
psk_id: psk_id.unwrap(),
});
// These better be set if the mode ID calls for them
match mode_id {
0 => OpModeR::Base,
1 => OpModeR::Psk(bundle.unwrap()),
2 => OpModeR::Auth(pk.unwrap()),
3 => OpModeR:... | Rust | 0 |
ate_default_refinement_ctx(insertion_ctx.problem.clone()), insertion_ctx);
assert_eq!(
get_sorted_customer_ids_from_jobs(&insertion_ctx.solution.required),
vec!["c1", "c2", "c4", "c5", "c6", "c7"]
);
assert_eq!(get_customer_ids_from_routes_sorted(&insertion_ctx), vec![vec!["c0", "c3"]]);
}
... | Rust | 0 |
c C s d t t t j d } d j | j } t j | d } | j d | j | j j
| j j | j j
d | j | j j | j | | j t j d | | S( sU
Save the message stored in self.recordedData to... | Python | 1 |
_ => panic!("unify_many: impossible: case handled above"),
}
}
}
fn bind(a: Tv, t: Type) -> Result<Subst, TypeError> {
if t == Type::TVar(a.clone()) {
Ok(HashMap::new())
} else if occurs_check(&a, t.clone()) {
Err(TypeError::InfiniteType(a, t))
} else {
let mut hm = H... | Rust | 0 |
};
image_promises.push(default_tex_promise);
for texture in self.textures {
let width = texture.width();
let height = texture.height();
let (image, promise) = ImmutableImage::from_iter(texture.into_pre_mul_iter(),
ImageDimensions::Dim2d{... | Rust | 0 |
;
pub const CLIENT_PLUGIN_AUTH: u32 = 524288;
pub const CLIENT_CONNECT_ATTRS: u32 = 1048576;
pub const CLIENT_CAN_HANDLE_EXPIRED_PASSWORDS: u32 = <PASSWORD>;
pub const CLIENT_SESSION_TRACKING: u32 = 8388608;
pub const CLIENT_PROGRESS: u32 = 536870912;
pub const CLIENT_PROGRESS_OBSOLETE: u32 = 536870912;
pub const CLIEN... | Rust | 0 |
import torch
from torch.nn import functional as F
from torch import nn
from torchvision.ops import boxes as box_ops
class Assigner:
BELOW_LOW_THRESHOLD = -1
BETWEEN_THRESHOLDS = -2
def __init__(self, fg_iou_thresh, bg_iou_thresh, allow_low_quality=True):
self.fg_iou_thresh = fg_iou_thresh
... | Python | 1 |
# symbolic math exercise ( picture.1)
# ကြိုး = ရေတွင်း + 1 ( ကြိုးသည် ရေတွင်းထက်တစ်တောင်ပိုသည်။ )
# ရေတွင်း = ကြိုး / 2 + 1 ( ရေတွင်းသည် ကြိုးတစ်ဝက်ထက် တစ်တောင်ပိုသည်။ )
# equation ဖြစ်အောင် နှစ်ခုလုံးကို zero နဲ့ညီအောင်လုပ်မည်။
# 0 = ရေတွင်း + 1 - ကြိုး
# 0 = ကြိုး / 2 + 1 - ရေတွင်း
from sympy import symbols, solv... | Python | 1 |
comment = comment,
flag = flag,
created = created,
request = request,
)
# Confirmation views.
flag_done = confirmation_view(
template = "comments/flagged.html",
doc = 'Displays a "comment was flagged" success page.'
)
delete_done = confirmation_view(
template = "comme... | Python | 1 |
f self.display_gutter {
gutter_size.width
} else {
0.0
},
self_size.height,
);
let editor_bc = BoxConstraints::new(Size::ZERO, editor_size);
let editor_size = self.editor.layout(ctx, &editor_bc, data, env);
... | Rust | 0 |
import sys,os
import numpy as np
import matplotlib.pyplot as plt
import jcmwave
from scipy.optimize import minimize
from basicfunctions.covariance.cov import *
from basicfunctions.derivative.dGPR import *
from basicfunctions.reconstruction.recon import*
from Training.training import *
from mpl_toolkits import mplot... | Python | 1 |
worker_id)
continue
except Exception as range_e:
debug_print(f"range processing failed: {range_e}", worker_id)
if not safe_mode:
raise
return formulas
def extract_cell_values_task(file_path: str, target_addresses: Dict[str, List[str]],
... | Python | 1 |
a=1
b=2
print(a+b)
c= "Divit"
d= "518"
print(c+d)
# Basic just like using "" for string, 1,2,3...n for numbers, 16.518 for floating point number | Python | 1 |
written = 0;
let mut called_progress: Option<Instant> = None;
loop {
let len = match reader.read(&mut buf).await {
Ok(0) => break,
Ok(len) => len,
Err(ref err) if err.kind() == ErrorKind::Interrupted => continue,
Err(err) => return Err(err.context("Failed... | Rust | 0 |
stmt_compiled: Bc::default(),
body_stmts: StmtsCompiled::empty(),
stmt_compile_context: StmtCompileContext::default(),
inline_def_body: None,
globals,
}
}
}
#[derive(Clone, Debug)]
pub(crate) struct DefCompiled {
pub(crate) function_name: String,
p... | Rust | 0 |
# 卖单从低到高
return {
'bids': bids,
'asks': asks,
'timestamp': int(time.time() * 1000)
}
except Exception as e:
logger.error(f"获取备用深度数据出错: {str(e)}")
return None
async def get_market_price_info(self, size: float) ... | Python | 1 |
获取智能体 {agent_id} 决策失败: {e}")
return self._get_default_decision(agent_id)
def _get_default_decision(self, agent_id: str) -> Dict:
"""获取默认决策"""
return {
'signal': 0.0,
'confidence': 0.1,
'reasoning': f"默认决策 - {agent_id}"
}
async def... | Python | 1 |
Info::vested_transfer())]
pub fn vested_transfer(
origin: OriginFor<T>,
currency_id: CurrencyIdOf<T>,
dest: <T::Lookup as StaticLookup>::Source,
schedule: VestingScheduleOf<T>
) -> DispatchResult {
T::UpdateOrigin::ensure_origin(origin)?;
let from = T::TreasuryAccount::get();
let to = T::Lookup... | Rust | 0 |
import asyncio
import flet as ft
name = "ProgressRing Example"
def example():
t = ft.Text(value="Click the button...")
pr = ft.ProgressRing(width=16, height=16, stroke_width=2)
async def button_clicked(e):
t.value = "Doing something..."
t.update()
b.disabled = True
b.upd... | Python | 1 |
= read(filepath)?;
let config_file: TiKvBackendConfigFile = serde_yaml::from_slice(content.as_slice())?;
Ok(config_file)
}
}
impl Default for TiKvBackendConfigFile {
fn default() -> Self {
TiKvBackendConfigFile {
pd_endpoints: vec![],
dry_run: true,
}
... | Rust | 0 |
()) {
*i = *j << 3;
},
LITERAL_PREDICTION_MODE_UTF8 =>
for (i, j) in ret.iter_mut().zip(constants::UTF8_CONTEXT_LOOKUP.split_at(256).0.iter()) {
*i = *j;
},
LITERAL_PREDICTION_MODE_MSB6 =>
for (index, val) in ret.iter_mut().... | Rust | 0 |
storage value by adding the new contribution, or else
///insert the new Id/contribution
if ContStore::<T>::contains_key(c1.account){
ContStore::<T>::mutate(c1.account,|value|{
*value += c1.contribution;
})
} else {
ContStore::<T>::insert(&account,value);
//let mut ve=<ContAcc<T>>::get(... | Rust | 0 |
le.set_table_width(80);
} else {
table.load_preset(comfy_table::presets::UTF8_FULL);
}
let columns = (table.get_table_width().unwrap() / 9) as usize;
for chunk in self.tries.chunks(columns) {
let mut row = Row::new();
for (word, attempts) in chunk {
... | Rust | 0 |
I::from(RawId(ind))
}
pub fn indices(&self) -> impl Iterator<Item = I> {
(0..self.0.len()).map(|ind| I::from(RawId(ind)))
}
pub fn entries(&self) -> impl Iterator<Item = (&T, I)> {
self.indices().map(move |v| (&self[v], v))
}
pub fn iter(&self) -> impl Iterator<Item = &T> {
... | Rust | 0 |
#!/usr/bin/env python3
"""
Test script for FastMCP-based OpenAPI server.
"""
import os
import sys
import logging
import asyncio
# Add src to path
sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'src'))
async def test_fastmcp_server():
"""Test FastMCP server implementation."""
print("Testing FastMCP... | Python | 1 |
# import isaacgym
# assert isaacgym, "import isaacgym before pytorch"
import torch
class HistoryWrapper:
def __init__(self, env):
self.env = env
self.obs_history_length = self.env.num_history_length
self.num_obs_history = self.obs_history_length * self.env.num_obs
self.obs_histor... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.