text string | label_name string | labels int64 |
|---|---|---|
e_pending, false);
assert_eq!(frame.header.ack_request, true);
assert_eq!(frame.header.pan_id_compress, false);
assert_eq!(frame.header.version, FrameVersion::Ieee802154_2003);
assert_eq!(
frame.header.destination,
Address::Short(PanId(0xffff), ShortAddress(0x0002... | Rust | 0 |
GNORED](https://developer.android.com/reference/android/opengl/GLES30.html#GL_TIMEOUT_IGNORED)
pub const GL_TIMEOUT_IGNORED : i64 = -1i64;
/// public static final [GL_TRANSFORM_FEEDBACK](https://developer.android.com/reference/android/opengl/GLES30.html#GL_TRANSFORM_FEEDBACK)
pub const GL_TRANS... | Rust | 0 |
#!/usr/bin/python3
def print_last_digit(number):
last_digit = abs(number) % 10
print(last_digit, end="")
return last_digit
| Python | 1 |
id += 1;
oid
}
//----------------------------------------------------------------------------------------------
pub fn historical_data_operations_req(&self) -> Result<(), IBKRApiLibError> {
//Requesting historical data
self.client
.as_ref()
.unwrap()
... | Rust | 0 |
}
fn render_feature_debug_name() -> &'static str {
$struct_name::feature_debug_name()
}
};
}
<gh_stars>0
use djangohashers::make_password;
use rand::{thread_rng, Rng};
const PASSWORD_LEN: usize = 30;
const CHARSET: &[u8] = b"ABCDEFGHIJKLMNOPQRSTUVWXYZ\
abcdefghijklmnopqrstuvwxyz\
... | Rust | 0 |
}
# API 요청 파라미터 정의
class FinancialRequest(BaseModel):
company_stock_code: str
period: int
@app.post('/financial_statements')
async def get_financial_statement(data: FinancialRequest):
if data.period not in [3, 5]:
raise HTTPException(status_code=400, detail='유효하지 않은 기간입니다. 3년 또는 5년을 선택해 주세요.')
... | Python | 1 |
.0, top));
path_builder.build()
}
// Box Drawings Light Vertical, "│".
fn path_for_unicode_2502(size: &Size, render_context: &mut RenderContext) -> Path {
let mut path_builder = render_context.path_builder().expect("path_builder");
let thickness = size.height * LINE_THICKNESS_FACTOR;
let left = size.wi... | Rust | 0 |
),
}
}
#[inline]
pub fn children_mut(&mut self) -> Option<&mut Children> {
match self {
&mut View::Text(_) => None,
&mut View::Data {
ref mut children, ..
} => Some(children),
}
}
#[inline]
pub fn clone_no_children(&self... | Rust | 0 |
tput ONLY the result dictionary in the following format, with no additional text or explanation:
{{
"topic_name": {{
"mastery": <average mastery score from 0 to 100>,
"subtopics_to_practice": ["list of subtopics extracted from the hints or guidance"]
}}
}}
Ensure that the subtopics are concise and directly... | Python | 1 |
nknown_ent(tail):
if tail not in unknown_ent_cates:
unknown_ent_cates[tail] = {2: [tri]}
else:
unknown_ent_cates[tail][2] = (
unknown_ent_cates[tail][2] + [tri]
if unknown_ent_cates[tail].get(2, None)
els... | Python | 1 |
4t23df32543f55";
mint_tokens_to(
&mut context,
&mint.pubkey(),
&token_account.pubkey(),
&mint_authority,
tokens_amount,
)
.await
.unwrap();
let bot_oracle_message = vote_message!([
recipient_eth_key.as_ref(),
b"|",
tokens_amount.to_le... | Rust | 0 |
};
/// ValueExpression
/// Lit: literal like string or number ...
/// ExternalValue: rust ident start with `@`
#[derive(Eq, PartialEq, Debug)]
pub enum Value {
Lit(Lit),
ExternalValue(Ident),
}
impl Parse for Value {
fn parse<'a>(input: &'a ParseBuffer<'a>) -> Result<Self, Error> {
let ahead = inp... | Rust | 0 |
ureFlags,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VkExportFenceCreateInfo {
pub sType: VkStructureType,
pub pNext: *const ::std::os::raw::c_void,
pub handleTypes: VkExternalFenceHandleTypeFlags,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct VkExportSemaphoreCreateInfo {
pub sType: ... | Rust | 0 |
x09, 0x8d, 0xeb, 0x9c, 0x32, 0xb1, 0xfd, 0x86, 0x62, 0x05, 0x16, 0x5f, 0x49, 0xb8, 0x00] => {
true
}
// 39382357235489614581723060781553021112529911719440698176882885853963445705823 (order 8)
&[0x5f, 0x9c, 0x95, 0xbc, 0xa3, 0x50, 0x8c, 0x24, 0xb1, 0xd0, 0xb1, 0x55, 0x9c, 0x83, 0xef,... | Rust | 0 |
# if left_hand_detected and right_hand_detected :
# #recorder = ScreenRecorder()
# #### checking
# len_line = math.hypot(left_coordinate[0]-right_coordinate[0], left_coordinate[1]-right_coordinate[1])
# if len_line < 24 and record_flag == False:
... | Python | 1 |
argv)
tz = ZoneInfo(args.tz)
# Parse
hr, stress, sleep = parse_snapshots(args.input, limit=args.limit)
# Prepare output dir
args.out.mkdir(parents=True, exist_ok=True)
# Write JSON
print("Analyzing missing days ...", flush=True)
report, spans_json = compute_missing(hr, stress, sleep, ... | Python | 1 |
nd.is_empty() {
let mut prepend = DisplayString::from_string(prepend);
if !joined.is_empty() {
prepend.push(' ');
prepend += joined;
}
prepend
} else {
joined
}
}
fn entry_date(entry: &Entry, force_year: bool) -> String {
if let Some(date) = e... | Rust | 0 |
xs)*));
}
macro_rules! impl_generate_param_abi_for_tuple {
($first:tt,) => {
impl<$first> GenerateParamAbi for ($first,)
where
$first: GenerateParamAbi
{
fn generate_ty_name() -> String {
String::from("tuple")
}
fn generate_in... | Rust | 0 |
pipe = pipeline("image-to-text", model="google/pix2struct-ai2d-base")
url = "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/transformers/tasks/ai2d-demo.jpg"
image = Image.open(requests.get(url, stream=True).raw)
prompt = "What does the label 15 represent? (1) la... | Python | 1 |
, 'b c h w -> b c (h w)', h=self.input_size, w=self.input_size)
for tab in self.tablock2:
x = tab(x)
x = rearrange(
x, 'b c (h w) -> b c h w', h=self.input_size, w=self.input_size)
x = self.conv2(x)
x = self.swintransformer2(x)
x = rearrange(
... | Python | 1 |
ANY: DWORD = 0xFD;
pub const ACPI_PPM_HARDWARE_ALL: DWORD = 0xFE;
pub const MS_PPM_SOFTWARE_ALL: DWORD = 0x1;
pub const PPM_FIRMWARE_ACPI1C2: DWORD = 0x00000001;
pub const PPM_FIRMWARE_ACPI1C3: DWORD = 0x00000002;
pub const PPM_FIRMWARE_ACPI1TSTATES: DWORD = 0x00000004;
pub const PPM_FIRMWARE_CST: DWORD = 0x00000008;
p... | Rust | 0 |
64> { re: 1., im: 0. };
// Build projector 1
let mut active_projector = Array2::zeros((2, 2));
active_projector[[1, 1]] = Complex::<f64> { re: 1., im: 0. };
// sigma_x
let x = gates::PauliX::new(0);
let sigma_x = x.get_matrix();
let mut inactive_matrix_list = Vec::<Array2<Complex<f64>>>::... | Rust | 0 |
x = x + x1
x = self.net.last_second_conv(x)
x = self.net.pool(x)
x = self.net.last_conv(x)
x = hardswish(x)
x = self.net.dropout(x)
x = paddle.flatten(x, start_axis=1, stop_axis=-1)
x = self.net.out(x)
return x
def siamese_mv3(class_dim, use_cu... | Python | 1 |
# Generated by Django 3.1.2 on 2020-10-06 08:58
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("staticscanners", "0029_auto_20201006_0834"),
]
operations = [
migrations.RenameField(
model_name="bandit_scan_db",
old_name="... | Python | 1 |
vertices.append((xPixel, yPixel))
vertices.append(pixelPos)
break # Stop at first intersection
return vertices
def _buildVerticesAndLabels(self):
super(GLPlotFrame2D, self)._buildVerticesAndLabels()
vertice... | Python | 1 |
_bidi_rule(&str_chars!(R, NSM, NSM, NSM, NSM)), true);
// Next tests check that last character is not in [`R`, `AL`, `EN`, or `AN`]
assert_eq!(satisfy_bidi_rule(&str_chars!(R, CS)), false);
assert_eq!(satisfy_bidi_rule(&str_chars!(R, ET, NSM)), false);
assert_eq!(satisfy_bidi_rule(&str_c... | Rust | 0 |
"10.69.111.111/32": {"ip": "10.69.111.111", "prefix_length": "32"},
"broadcast_forwarding": "disabled",
"icmp_redirects": "never sent",
"icmp_replies": "never sent",
"icmp_unreachables": "always sent",
"mtu": 1500,
"mtu_available": 1500,
... | Python | 1 |
(int(y[end]), int(x[end])),
(255, 0, 0), 5)
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
img_out = Image.fromarray(img)
img_out.show()
def show_prections(img, predictions):
i = 0
jointsnum = predictions.shape[0]
for coord in range(jointsnum):
if(True):
... | Python | 1 |
from odoo import fields, models
class SaleOrderLine(models.Model):
_inherit = 'sale.order.line'
opportunity_id = fields.Many2one(related='order_id.opportunity_id', index=True, readonly=True)
| Python | 1 |
UniformLocation, count: GLsizei, value: *const GLuint) {
unsafe {
gl::Uniform4uiv(location.0, count, value);
}
}
pub fn uniform_matrix_2fv(location: UniformLocation, count: GLsizei, transpose: GLboolean, value: *const GLfloat) {
unsafe {
gl::UniformMatrix2fv(location.0, count, transpose,... | Rust | 0 |
oxed().shared()
}
fn receive_scalar_subquery_res(mut pipeline: Pipeline) -> SharedFuture<'a> {
let subquery_future = async move {
let mut stream = pipeline.execute().await?;
let mut columns = None;
while let Some(data_block) = stream.next().await {
l... | Rust | 0 |
n.Pose):
if self.urdf_path is not None:
self.model.set_pose(pose * self.origin_offset)
else:
self.model.set_pose(pose)
def get_point_cloud(self, sample_radius=5e-3):
obj_meshes = [self.get_obj_mesh()]
return get_point_cloud_from_meshes(obj_meshes, sample_radi... | Python | 1 |
_end {
h32 += unsafe { *p } as u32 * PRIME32_5;
h32 = rotl32!(h32, 11) * PRIME32_1;
p = unsafe { p.offset(1) };
}
h32 ^= h32 >> 15;
h32 *= PRIME32_2;
h32 ^= h32 >> 13;
h32 *= PRIME32_3;
h32 ^= h32 >> 16;
h32
}
#[inline(always)]
fn update_endian(state: &mut State32,... | Rust | 0 |
"""Tests for the capacity calculation and histogram creation."""
import math
from jaxtyping import Float
import pytest
from syrupy.session import SnapshotSession
import torch
from torch import Tensor
from sparse_autoencoder.metrics.train.abstract_train_metric import TrainMetricData
from sparse_autoencoder.metrics.tr... | Python | 1 |
s_line_algorithm)
impl<C: PixelColor> Iterator for LineIterator<C> {
type Item = Pixel<C>;
fn next(&mut self) -> Option<Self::Item> {
// return none if stroke color is none
self.style.stroke_color?;
if !self.stop {
let point = self.start;
if self.start == self.... | Rust | 0 |
cr:
s += "%s\n" % descr
else:
# deal with generic tags
prefix, sep, postfix = tag.rpartition(":")
descr = TAG_MISSING_DESCRIPTION.get(prefix + sep)
descr = descr % postfix
if descr:
s += "%s\n... | Python | 1 |
trfsSendCommand::Link(from, to) => process_link(from, to, work_bench),
BtrfsSendCommand::Unlink(local_path) => process_unlink(local_path, work_bench),
BtrfsSendCommand::Rmdir(local_path) => process_rmdir(local_path, work_bench),
BtrfsSendCommand::SetXattr(path, name, data) => {
proce... | Rust | 0 |
"""キャラクター作成ウィザードのテスト"""
import pytest
import pygame
import pygame_gui
from unittest.mock import Mock, MagicMock, patch
from src.facilities.ui.wizard_service_panel import WizardStep
from src.facilities.ui.ui_element_manager import UIElementManager
@pytest.fixture
def mock_controller():
"""FacilityControllerのモック""... | Python | 1 |
igned pointer
pub type PCUNZWCH = *const WCHAR; // Unaligned pointer
pub type LPCWCHAR = *const WCHAR;
pub type PCWCHAR = *const WCHAR;
pub type LPCUWCHAR = *const WCHAR; // Unaligned pointer
pub type PCUWCHAR = *const WCHAR; // Unaligned pointer
pub type UCSCHAR = c_ulong;
pub const UCSCHAR_INVALID_CHARACTER: UCSCHAR ... | Rust | 0 |
owner of the shared data map in one of the scoped data maps");
builder = builder.and_then(move |mut inner| {
let data_maps = &mut inner.data_maps;
let data_map_arr = data_maps.get_mut(&new_path);
if let Some(data_map_arr) = data_map_arr {
... | Rust | 0 |
tv2.ctag == "TVint"
return tval_btf(tv1.arg1 != tv2.arg1)
raise TypeError(pnm) # HX-2025-06-03: unsupported!
if (tm0.ctag == "TMapp"):
tm1 = tm0.arg1
tv1 = term_eval01(tm1, env)
assert tv1.ctag == "TVclo"
tm2 = tm0.arg2
tv2 = term_eval01(tm2, env)
... | Python | 1 |
R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 7 - Transmit FIFO Buffer Available"]
#[inline(always)]
pub fn tb(&self) -> TB_R {
TB_R::new(((self.bits >> 7) & 0x01) != 0)
}
}
#[doc = "Channel Configuration Register\n\nThis register you can [`read`](crate::generic::Reg::read). See [API... | Rust | 0 |
)
CONSOLE.print(f":white_check_mark: Done loading checkpoint from {load_path}")
pipeline.models.to(pipeline.device)
return load_path, load_step
def ensemble_eval_setup(
config_paths: List[Path],
eval_num_rays_per_chunk: Optional[int] = None,
test_mode: Literal["test", "val", "infer... | Python | 1 |
ction(_fill_with_strategy)
def _fill_constant(expr: Column, value: Column) -> Column:
return self._F.ifnull(expr, value)
return self._with_elementwise(_fill_constant, value=value)
def log(self, base: float) -> Self:
def _log(expr: Column) -> Column:
return (
... | Python | 1 |
#! /usr/bin/env python
###############################################################################
#
# simulavr - A simulator for the Atmel AVR family of microcontrollers.
# Copyright (C) 2001, 2002 Theodore A. Roth
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of th... | Python | 1 |
coverage_steck,
path=plot_dir.joinpath(
f"genre_probability_cat_{topN}",
f"bars_{topN}_{distribution_type}_{alpha_steck_select}_cov.json",
),
)
write_json_file(
kl_system_level,
path=plot_dir.joinpath(
f"genre_probability_cat_{topN}",
f"bars_{topN}_{distribution_type}_{al... | Python | 1 |
e(self.raw, val);
}
self
}
/// See DBOptions doc
pub fn writable_file_max_buffer_size(self, val: usize) -> Self {
unsafe {
ll::rocks_envoptions_set_writable_file_max_buffer_size(self.raw, val);
}
self
}
// If not nullptr, write rate limiting is e... | Rust | 0 |
, x*tile_size, jnp.array(0, dtype=jnp.int32)))
def render_row(carry, x):
img, y = carry
img = render_tile_at(img, y, x)
return (img, y), None
def render_grid_rows(img, y):
(img, y), _ = lax.scan(render_row, (img, y), jnp.arange(width))
return img, None
img, _ =... | Python | 1 |
A7,// Cmpxchg486_rm32_r32
0x0002_00A8,// Pushw_GS
0x0002_00A8,// Pushd_GS
0x0002_00A8,// Pushq_GS
0x0002_00A9,// Popw_GS
0x0002_00A9,// Popd_GS
0x0002_00A9,// Popq_GS
0x0002_00AA,// Rsm
0x0002_00AB,// Bts_rm16_r16
0x0002_00AB,// Bts_rm32_r32
0x0002_00AB,// Bts_rm64_r64
0x0002_00AC,// Shrd_rm16_r16_imm8
0x00... | Rust | 0 |
"$(( ~!-x ))",
BitwiseNot(Box::new(LogicalNot(Box::new(UnaryMinus(x()))))),
),
(
"$(( !~++x ))",
LogicalNot(Box::new(BitwiseNot(Box::new(PreIncr(String::from("x")))))),
),
(
"$(( ~!++x ))",
BitwiseNot(Box::new(LogicalNot(Box... | Rust | 0 |
-> Self {
DT1_CLK_SEL_R(crate::FieldReader::new(bits))
}
}
impl core::ops::Deref for DT1_CLK_SEL_R {
type Target = crate::FieldReader<bool, bool>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&self.0
}
}
#[doc = "Field `DT1_CLK_SEL` writer - "]
pub struct DT1_CLK_SEL_W<'a> {... | Rust | 0 |
import pika
import mysql.connector
import json
credentials = pika.PlainCredentials('guest', 'guest')
connection = pika.BlockingConnection(pika.ConnectionParameters('192.168.180.2', 5672, '/', credentials))
channel = connection.channel()
channel.exchange_declare(exchange='deletion', exchange_type='direct')
channel.que... | Python | 1 |
from langchain_huggingface import ChatHuggingFace, HuggingFaceEndpoint
from dotenv import load_dotenv
import streamlit as st
from langchain_core.prompts import PromptTemplate, load_prompt
load_dotenv()
llm= HuggingFaceEndpoint(repo_id="deepseek-ai/DeepSeek-V3.1", task="text-generation", max_new_tokens=500)
model= Ch... | Python | 1 |
"recoding categoricals {:.0?}",
Instant::now().duration_since(start)
);
EncodingDictionary {
ncolors,
colors,
recode,
field_dims: color_counters,
}
}
/// returns field dims for sparse values only
pub(crate) fn field_dims(&... | Rust | 0 |
undo_tbs_sql = tools.mysql_query(
"select undo_tbs_name,max(used_mb),max(pct_used),min(pct_used),avg(pct_used) from oracle_undo_tbs_his where tags = '%s' and DATE_FORMAT(chk_time,'%%Y-%%m-%%d %%H:%%i:%%S')> '%s' and DATE_FORMAT(chk_time,'%%Y-%%m-%%d %%H:%%i:%%S') < '%s' group by undo_tbs_name" % (
... | Python | 1 |
pub dim_type: DimensionTypeRegistry,
#[serde(rename = "minecraft:worldgen/biome")]
pub wg_biom: BiomeRegistry,
}
#[derive(serde::Deserialize, serde::Serialize)]
pub struct DimensionTypeRegistry {
#[serde(rename = "type")]
pub r#type: String,
pub value: Vec<DimensionTypeRegistryEntry>,
}
#[derive(s... | Rust | 0 |
4_to_ff(1 << SHA256_GADGET_CHUNK_SIZE),
u64_to_ff(1 << (2 * SHA256_GADGET_CHUNK_SIZE)), u64_to_ff(1 << (3 * SHA256_GADGET_CHUNK_SIZE)),
];
if let OverflowTracker::SignificantOverflow(_n) = input.overflow_tracker {
let of = self.allocate_converted_num(cs, &var, self.max_of_width... | Rust | 0 |
# This guide demonstrates how to create Python-controlled animations using Colight plots, the `.reset` method, and interactive sliders. We'll cover:
# 1. Setting up a basic animated plot
# 2. Creating interactive animations with ipywidgets
#
# We must use the `"widget"` [rendering modes](essential-reading/#rendering-mo... | Python | 1 |
15,
/// `char16_t`
Char16 = 6,
/// `char32_t`
Char32 = 7,
/// `short`
Short = 16,
/// `unsigned short`
UShort = 8,
/// `int`
Int = 17,
/// `unsigned int`
UInt = 9,
/// `long`
Long = 18,
/// `unsigned long`
ULong = 10,
/// `long long`
LongLong = 19,... | Rust | 0 |
source_x: isize, source_y: isize) -> usize {
// Starting from a negative angle means the first asteroid we find will be one with angle 0.0.
let mut last_angle = -1.0;
let mut asteroids_destroyed = 0;
loop {
let (asteroid, angle) = find_next_asteroid(&map, last_angle);
destroy_asteroid(m... | Rust | 0 |
d_duration_ms_bucket".to_owned(),
serde_json::to_value(commands_duration_ms_bucket)
.to_indy(IndyErrorKind::IOError, "Unable to convert json")?,
);
Ok(())
}
pub(crate) fn get_metric_json(value: usize, tags: HashMap<String, String>) -> IndyResult<Value> {
let... | Rust | 0 |
table. If you want to modify the scopes
or the subject used for delegation, use :meth:`with_scopes` or
:meth:`with_subject`::
scoped_credentials = credentials.with_scopes(['email'])
delegated_credentials = credentials.with_subject(subject)
"""
@_helpers.copy_docstring(credentials_asyn... | Python | 1 |
from pydantic import BaseModel
class Token(BaseModel):
access_token: str
token_type: str
class TokenData(BaseModel):
username: str | None = None
role: str | None = None
class LoginRequest(BaseModel):
email: str
password: str
| Python | 1 |
NDEFINED, fixed=Component.UNDEFINED, sticky=Component.UNDEFINED, color=Component.UNDEFINED, expand=Component.UNDEFINED, loading_state=Component.UNDEFINED, **kwargs):
self._prop_names = ['children', 'id', 'brand', 'brand_external_link', 'brand_href', 'brand_style', 'className', 'class_name', 'color', 'dark', 'ex... | Python | 1 |
and method == "POST"
and data[0].get("drivewsid")
):
if data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::root":
return ResponseMock(DRIVE_ROOT_WORKING)
if data[0].get("drivewsid") == "FOLDER::com.apple.CloudDocs::documents":
... | Python | 1 |
pe NegativeImbalanceOf<T> = <<T as Config>::Vrmeta as Currency<<T as frame_system::Config>::AccountId>>::NegativeImbalance;
pub type BalanceOf<T> = <<T as Config>::Vrmeta as Currency<<T as frame_system::Config>::AccountId>>::Balance;
impl<T: Config> Pallet<T> {
pub fn switch(i: u32) -> BalanceOf<T> {
... | Rust | 0 |
ock)
.build();
let my_udt = CellOutput::new_builder()
.capacity(input_ckb.pack())
.lock(success_lock)
.build();
let mut true_commit = vec![2u8];
true_commit.extend_from_slice(&mut commit[..]);
let withdraw_outputs_data: Vec<Bytes> = vec![
true_commit.into(),
... | Rust | 0 |
}
if canmovedragons(state, 1) {
framebuffer.spr(57, 48, 8);
}
if canmovedragons(state, 2) {
framebuffer.spr(58, 48, 0);
}
for i in 0..=CELLS_MAX_INDEX {
let (posx, posy) = get_card_pos(i);
drawcell(framebuffer, &state.cells[i as usize], posx, posy);
}
l... | Rust | 0 |
r},
io::{Seek, SeekFrom, Write},
rc::Rc,
usize,
};
use std::cell::RefMut;
use super::tuple::{Tuple, TupleScheme};
enum SearchFor {
IntField(IntField),
LeftMost,
RightMost,
}
/// B+ Tree
pub struct BTreeTable {
// the file that stores the on-disk backing store for this B+ tree
// file... | Rust | 0 |
from argparse import ArgumentParser, Namespace
from pathlib import Path
from packs.completeness import completeness_test # type: ignore
from packs.unbalanced import unbalanced_test # type: ignore
from pyspark.sql import SparkSession # type: ignore
def main():
# Pull args from CLI
args = parse_args()
... | Python | 1 |
from itertools import permutations
pos_list = list(permutations(['1','1','2'], 3))
teacher_score = 0
min_diff = min(abs(teacher_score - int(''.join(pos_score))) for pos_score in pos_list)
print(min_diff) | Python | 1 |
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | Python | 1 |
formula_count += 1
# 替换公式
modified_content = replace_with_clean_blank(modified_content, f"${formula}$",(f"[FORMULA_PLACEHOLDER:{placeholder}]","complex_formular"),mode)
# 处理块级公式
for i, formula in enumerate(block_pattern... | Python | 1 |
# -*- coding: utf-8 -*-
"""
全面測試執行腳本
此腳本用於執行所有類型的測試,包括單元測試、整合測試、端到端測試,
並生成測試覆蓋率報告和性能測試報告。
使用方法:
python scripts/run_tests.py [options]
選項:
--unit-tests: 執行單元測試
--integration-tests: 執行整合測試
--e2e-tests: 執行端到端測試
--coverage: 生成測試覆蓋率報告
--performance: 執行性能測試
--stress: 執行壓力測試
--all: 執行所有測試
... | Python | 1 |
if listeners.is_empty() {
pending::<()>().await;
}
else {
let _ = select_all(
listeners.into_iter().map(|listener| {
tokio::spawn(single_http_listener(listener, origins.clone()))
})
).await;
}
}
/// Returns a future for a single HTTP list... | Rust | 0 |
@nth 5/24",
"/// @offset 13",
"/// @eval fn",
];
let spec = FunctionSpec::new("test".into(), function_type.into(), comment.into_iter());
assert_matches!(
spec,
Some(Ok(FunctionSpec {
nth_entry_of: Some((5, 24)),
of... | Rust | 0 |
from abc import abstractmethod, ABC
from typing import List
from aiogram import types
class BaseStorage(ABC):
@abstractmethod
async def set_media_group_as_handled(self, media_group_id: str) -> bool:
pass
@abstractmethod
async def append_message_to_media_group(
self, media_group_id: s... | Python | 1 |
struction::Jgz(r, v) => {
let entry = *registers.entry(r).or_insert(0);
if entry != 0 {
i += v - 1;
}
}
}
i += 1;
}
mul_count
}
#[cfg(test)]
mod tests {
use super::*;
use test::Bencher;
#[bench]
fn day23(b: &mut Bencher) {
b.iter(|| {
let input = ... | Rust | 0 |
et_header,
dump_func=dump_header,
doc="Which methods can be used for the cross origin request.",
)
access_control_allow_origin = header_property[str](
"Access-Control-Allow-Origin",
doc="The origin or '*' for any origin that may make cross origin requests.",
)
access_co... | Python | 1 |
SA {
fn clone(&self) -> Self {
*self
}
}
#[repr(C, packed(1))]
#[doc = "*Required features: 'Win32_Media_Audio'*"]
pub struct MIDIINCAPSW {
pub wMid: u16,
pub wPid: u16,
pub vDriverVersion: u32,
pub szPname: [u16; 32],
pub dwSupport: u32,
}
impl ::core::marker::Copy for MIDIINCAPSW {... | Rust | 0 |
Opt)]
#[structopt(rename_all = "snake")]
enum Command {
Artifact(ArtifactCommand),
}
fn main() -> Result<()> {
let cmd = Command::from_args();
let subscriber = tracing_subscriber::FmtSubscriber::new();
tracing::subscriber::set_global_default(subscriber).unwrap();
match cmd {
Command::Arti... | Rust | 0 |
Incrementally iterate sorted set elements for elements matching a pattern.
#[inline]
fn zscan_match<K: ToRedisArgs, P: ToRedisArgs, RV: FromRedisValue>
(&mut self, key: K, pattern: P) -> RedisResult<Iter<'_, RV>> {
let mut c = cmd("ZSCAN");
c.... | Rust | 0 |
it: ValueRef
}
macro_rules! upcall (
(fn $name:ident($($arg:expr),+) -> $ret:expr) => ({
let fn_ty = Type::func([ $($arg),* ], &$ret);
base::decl_cdecl_fn(llmod, ~"upcall_" + stringify!($name), fn_ty)
});
(nothrow fn $name:ident($($arg:expr),+) -> $ret:expr) => ({
let fn_ty = Type::... | Rust | 0 |
my_size += ::protobuf::rt::unknown_fields_size(self.get_unknown_fields());
self.cached_size.set(my_size);
my_size
}
fn write_to_with_cached_sizes(&self, os: &mut ::protobuf::CodedOutputStream<'_>) -> ::protobuf::ProtobufResult<()> {
os.write_unknown_fields(self.get_unknown_fields()... | Rust | 0 |
"""
Copyright (c) 2018-2024 Intel Corporation
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 wri... | Python | 1 |
_wins_work() {
ExtBuilder::build().execute_with(|| {
// Create a new game between players 1 and 2
assert_ok!(TicTacToe::create_game(Origin::signed(1), 2));
// 1 | |
// ---------
// 2 | 1 |
// ---------
// 2 | | 1
// Players make moves according to board diagram
assert_ok!(TicTacToe::t... | Rust | 0 |
push_preserved!(),
$save2!(),
// TODO: Map PTI
// $crate::arch::x86_64::pti::map();
// Call inner function with pointer to stack
"
mov rdi, rsp
call {inner}
",
// TODO: Unm... | Rust | 0 |
axis2] = self.margin;
if fs[axis2] > 0 {
target_size[axis2] = fs[axis2];
} else {
target_size[axis2] = container_size[axis2];
}
}
}
child.borrow_mut().set_pos((pos[0], pos... | Rust | 0 |
64c::PI * (index.0 as f64 / index.1 as f64);
let radius = if index.1 >= 2 { 100.0 } else { 0.0 };
let color = Hsv::new(ang as f32 * 180.0 / f32c::PI, 0.5, 0.9).to_rgb().to_inner();
let escaped_name = escape_xml(&breed.ident.id);
write!(breed_sprites, r#"<sprite name="{name}" x="{x}" y="{y}" heading="{h... | Rust | 0 |
LETTER A WITH CIRCUMFLEX AND GRAVE
pub const KEY_Acircumflexgrave: u32 = 0x0100_1ea6;
/// U+1EA7 LATIN SMALL LETTER A WITH CIRCUMFLEX AND GRAVE
pub const KEY_acircumflexgrave: u32 = 0x0100_1ea7;
/// U+1EA8 LATIN CAPITAL LETTER A WITH CIRCUMFLEX AND HOOK ABOVE
pub const KEY_Acircumflexhook: u32 = 0x0100_1ea8;
/// U+1EA... | Rust | 0 |
def is_mirror(str1, str2):
filter1 = ''.join(filter(str.isalpha, str1))
filter2 = ''.join(filter(str.isalpha, str2))
return filter1 == filter2[::-1]
"""
Given two strings, determine if the second string is a mirror of the first.
A string is considered a mirror if it contains the same letters in reverse ... | Python | 1 |
ize100k > (BZ_HDR_0 as i32 + 9) {
retVal = BZ_DATA_ERROR_MAGIC;
break 'outer;
}
s.blockSize100k -= BZ_HDR_0 as i32;
if s.smallDecompress > 0 {
s.ll16 =
BZALLOC(strm, s.blockSize100k * 100000 * size_of::<u16>() as i32... | Rust | 0 |
coin::PublicKey::strict_decode(&PK_BYTES_03[..]).unwrap();
let pubkey_04 =
bitcoin::PublicKey::strict_decode(&PK_BYTES_04[..]).unwrap();
let pubkey_onekey =
bitcoin::PublicKey::strict_decode(&PK_BYTES_ONEKEY[..]).unwrap();
test_suite(&pubkey_02, &PK_BYTES_02, 33);
... | Rust | 0 |
> String {
let renderer = Self {};
let config = BaseConfig::new(badge, &renderer);
let body = format!(
r##"<linearGradient id="{s}" x2="0" y2="100%">
<stop offset="0" stop-color="#fff" stop-opacity=".7"/>
<stop offset=".1" stop-color="#aaa" stop-opacity=".1"/>
<stop offset="... | Rust | 0 |
import os
import time
from typing import Generator
import docker
import numpy as np
import pytest
from tempo.aio.model import Model
from tempo.aio.pipeline import Pipeline
from tempo.aio.utils import model, pipeline
from tempo.seldon import SeldonDockerRuntime
from tempo.serve.metadata import DockerOptions, ModelFram... | Python | 1 |
# Задание 2. Турнир
# Что нужно сделать
# Для двух дней соревнований по волейболу необходимо сформировать турнирную сетку
# из восьми человек. На первый день из списка участников решили выбрать каждого второго.
# Дан список из восьми имён: Артемий, Борис, Влад, Гоша, Дима, Евгений, Женя, Захар.
# Напишите программу, ко... | Python | 1 |
]) -> Dict[str, int]:
"""無効化されたフィードのエントリーを削除"""
queue = self.load_queue()
# 有効なフィード一覧を取得
enabled_feeds = set()
for feed_name, feed_config in feeds_config.get("feeds", {}).items():
if feed_config.get("enabled", True):
enabled_feeds.add(feed_nam... | Python | 1 |
List(es, _) => return (Some(es[0].clone()), *es = es.clone().map(|es| &es[1..])).0,
}
}
}
}
#[derive(Default)]
pub struct LispRemapper {
pub atom: AtomVec<AtomID>,
pub lisp: HashMap<*const LispKind, (LispVal, LispVal)>,
}
impl Remap<LispRemapper> for AtomID {
fn remap(&self, r: &mut LispRemapper) -> ... | Rust | 0 |
serialize, Debug, Serialize)]
pub struct AuthzRequest {
subject: Subject,
object: Object,
action: String,
}
#[derive(Deserialize, Debug, Serialize)]
struct Subject {
namespace: String,
value: SubjectValue,
}
#[derive(Deserialize, Debug, Serialize)]
#[serde(untagged)]
enum SubjectValue {
New(St... | Rust | 0 |
EF4444",
"emoji": "😔"
}
]
else: # 4 уровня (по умолчанию)
quarter = max_score // 4
return [
{
"level": "minimal",
"range": [0, quarter],
"color": "#10B981",
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.