text string | label_name string | labels int64 |
|---|---|---|
assert success is True
assert "已撤銷" in message
# 驗證方法被調用
mock_update_status.assert_called_once_with(
mock_session, "test_key_123", KeyStatus.REVOKED, "Security breach"
)
mock_log_event.assert_called_once()
@patch.obje... | Python | 1 |
is expected to work with OpenGL version 3.3 and above, and
//! OpenGL ES version 3.0 or above. This should cover the vast majority of even
//! fairly dated hardware. Please submit an issue for any incompatibilities
//! found with these OpenGL versions, pull requests to extend support to earlier
//! versions are welcom... | Rust | 0 |
# East / West
").unwrap();
}
let invalid = |_| format!("Invalid coord: \"{}\"", data);
let cap = RE.captures(data).ok_or_else(|| format!("Invalid coord: \"{}\"", data))?;
let lat = Self::multiplier_lat(&cap[3]).map_err(invalid)?
* Self::parse_component(&cap[... | Rust | 0 |
, tweet.created_at);
println!();
}
} else {
for tweet in tweets.iter().rev() {
println!("{}: {}", tweet.user.screen_name.red(), tweet.text);
}
}
}
fn split_query(query: &str) -> HashMap<Cow<str>, Cow<str>> {
let mut param = HashMap::new();
for q in query.... | Rust | 0 |
ogies (UK) Ltd.
// This file is part of Parity Ethereum.
// Parity Ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Par... | Rust | 0 |
# 10 - Classificação de Notas:
# Crie um programa que solicite uma nota de 0 a 100
# e informe o conceito (A, B, C, D, F) com base na nota.
while True:
n = intInput('Digite a nota: ')
if n < 20:
print('F')
elif n > 21 and n < 40:
print('D')
elif n > 41 and n < 60:
print('C')
elif n > 61 and n < ... | Python | 1 |
= self.maximum_burst_bitrate_kbps {
os.write_int32(4, v)?;
}
if let Some(v) = self.supports_video_hevc {
os.write_bool(5, v)?;
}
if let Some(v) = self.disable_steam_store {
os.write_bool(6, v)?;
}
if let Some(v) = self.disable_client_cu... | Rust | 0 |
fiSetupDialog",s,c)
# The Wifi object here is not actual object, Dynamically relevant modules are selected based on
# wifi-config value in the models file.
def getWifiObject(self,wifiConfVal):
self.wifiConfVal = wifiConfVal
if wifiConfVal == WIFI_CONFIG_LEDM:
self.wifiObj = Led... | Python | 1 |
$fn_name_basics:ident,
$fn_name_underflow:ident,
$fn_name_underflow_interrupt:ident,
$reg_lo:expr,
$reg_hi:expr,
$reg_cr:expr,
$icr_flag:expr
) => {
#[test]
fn $fn_name_basics() {
use crate::timer::fl... | Rust | 0 |
the attestation flow for
/// AWS Nitro Enclaves for a secure attestation implementation. This is merely here for
/// illustrative purposes.
static TOTALLY_INSECURE_ROOT_PRIVATE_KEY: [u8; 32] = [
0xe6, 0xbf, 0x1e, 0x3d, 0xb4, 0x45, 0x42, 0xbe, 0xf5, 0x35, 0xe7, 0xac, 0xbc, 0x2d, 0x54, 0xd0,
0xba, 0x94, 0xbf, 0... | Rust | 0 |
# ➊ 노드 클래스 정의
class Node:
# ➋ 노드 클래스 생성자
def __init__(self, key):
self.left = None
self.right = None
self.val = key
# ➌ 이진 탐색 트리 클래스
class BST:
# ➍ 초기에 아무 노드도 없는 상태
def __init__(self):
self.root = None
# ➎ 루트 노드부터 시작해서 이진 탐색 트리 규칙에 맞는 위치에 새 노드 삽입
def insert(self, key):
# 루트 노드가 없는 경우 새로... | Python | 1 |
# Copyright (c) 2024 yasuhiro yamashita
# Released under the MIT license.
# see http://open source.org/licenses/MIT
#
# ========================================
# pathe motocamera digitlize mod controler
# controler program ver.0.0.0
# on Raspberry Pi Zero2W
# image sensor:IMX708
# =====================================... | Python | 1 |
import ui
def main() -> None:
ui.init()
if __name__ == '__main__':
main() | Python | 1 |
int128::from(10000u128)};
let res = execute(deps.as_mut(), env, info, msg);
assert!(res.is_err());
}
fn test_compound_zero(deps: &mut OwnedDeps<MockStorage, MockApi, WasmMockQuerier>) {
// reinvest zero
let env = mock_env();
let info = mock_info(TEST_CONTROLLER, &[]);
let msg = ExecuteMsg::comp... | Rust | 0 |
input_strings = self.question_encoder_tokenizer.batch_decode(question_input_ids, skip_special_tokens=True)
context_input_ids, context_attention_mask = self.postprocess_docs(
docs, input_strings, prefix, n_docs, return_tensors=return_tensors
)
return BatchEncoding(
{
... | Python | 1 |
cess': False, 'error': str(e)}), 500
@app.route('/api/nodule/<session_id>/<int:nodule_id>', methods=['GET'])
def get_nodule_data(session_id, nodule_id):
try:
# 检查会话是否存在
if session_id not in SESSION_DATA:
return jsonify({"success": False, "error": "会话不存在"}), 404
# 获取会话数据
... | Python | 1 |
flags = 0;
let handle = unsafe { fd.as_raw_handle() };
let access_mode = winx::file::query_access_information(handle)?;
let mode = winx::file::query_mode_information(handle)?;
// Append without write implies append-only (__WASI_FDFLAGS_APPEND)
if access_mode.contains(AccessMode::FILE_APPEND_DATA)... | Rust | 0 |
"""
Snake, Water, Gun Game
This program allows a user to play the classic game against the computer.
It uses a function to determine the winner based on the rules.
Rules:
- Gun beats Snake
- Snake beats Water
- Water beats Gun
"""
import random
# --- GAME LOGIC FUNCTIONS ---
def get_computer_choice():
"""
... | Python | 1 |
omString,
options,
channel_credentials,
insecure,
call_credentials,
compression,
wait_for_ready,
timeout,
metadata,
_registered_method=True)
@staticmethod
def QueryVectors(request,
target,
... | Python | 1 |
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, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF AN... | Rust | 0 |
# Copyright (c) 2024 Microsoft Corporation.
# Licensed under the MIT License
"""Util functions to retrieve text units from a collection."""
from typing import Any, cast
import pandas as pd
from graphrag.data_model.entity import Entity
from graphrag.data_model.text_unit import TextUnit
def get_candidate_text_units... | Python | 1 |
def imp(
self,
url,
path,
out=None,
rev=None,
config=None,
remote=None,
remote_config=None,
**kwargs,
):
erepo = {"url": url}
if rev is not None:
erepo["rev"] = rev
if remote and remote_config and isinstance(config, str):
raise ValueError(
"Ca... | Python | 1 |
B,
/// BT.2020 10-bit systems
BT2020_10Bit,
/// BT.2020 12-bit systems
BT2020_12Bit,
/// SMPTE ST 2084, ITU BT.2100 PQ
SMPTE2084,
/// SMPTE ST 428
SMPTE428,
/// BT.2100 HLG (Hybrid Log Gamma), ARIB STD-B67
HLG,
}
/// Bit depth (8 = 1 byte, >=10 = 2 bytes)
#[repr(C)]
#[derive(Deb... | Rust | 0 |
1(&inputs[0].shape().iter().map(|&d| d as i64).collect::<Vec<_>>());
let shape = shape.cast_to_dt(self.dt)?.into_owned();
Ok(tvec![shape.into_arc_tensor()])
}
}
impl TypedOp for Shape {
fn output_facts(&self, inputs: &[&TypedFact]) -> TractResult<TVec<TypedFact>> {
let shape = inputs[0]... | Rust | 0 |
rix[0], matrix[1]):
rec[k] = v
# 额外行合并(若存在)
for extra_row in matrix[2:]:
for idx, val in enumerate(extra_row):
rec[f"额外字段{idx+1}"] = val
records.append(rec)
return records
def transform_to_2d_l... | Python | 1 |
lf.value
elif self.value != self.value_default:
state['value'] = self.value
return state
#----------------------------------------------------------------------------
# MIDI CC processing
#----------------------------------------------------------------------------
def midi_control_change(self, val):
#... | Python | 1 |
import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
arr = []
visited = [[0 for _ in range(5)] for _ in range(5)]
for _ in range(5):
arr.append(list(map(int, input().split())))
ans = 0
flag = False
s = []
for _ in range(5):
s.append(list(map(int, input().split())))
for index_i in range(5):
fo... | Python | 1 |
鐵鐡
𠮷野家吉野家
𠮷呑み吉呑み
𠮷兆吉兆
弁護士辯護士
弁理士辨理士
新潟県新泻県
深圳市深セン市
'''
sim_glyphs_list = list(sim_glyphs_list.replace('\n',''))
for c in set(sim_glyphs_list):
glyphs[ord(c)] = c
doublew1_list = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
doublew2_list = 'abcdefghijklmnopqrstuvwxyz'
doublew1_list = list(doublew1_list)
doublew2_list = list(do... | Python | 1 |
se::<usize>().unwrap())} else {None})
.collect::<Vec<usize>>()
)
.collect::<Vec<Vec<usize>>>()
}
#[cfg(test)]
fn part_1() -> usize {
let input = parse_input();
let mut result = 0;
for (j, line) in input.iter().enumerate() {
for (i, val) in line.iter().enumerate() {
if is_low_point(&input... | Rust | 0 |