text
string
label_name
string
labels
int64
nks| or |mid_line|@>; crate::section_0354::Scan_a_control_sequence_and_set_state_skip_blanks_or_mid_line!($globals); } else if state_plus_cur_cmd_matches_any_case_plus!(state_plus_cur_cmd, active_char) { // any_state_plus(active_char): @<Process an active-character control sequen...
Rust
0
= int(input()) cenaakc1 = int(input()) stok = False while cenaakc1 != 0: if not stok: if cenaakc < cenaakc1: incena = cenaakc1 stok = True if stok: if cenaakc > cenaakc1: outcena = cenaakc1 break cenaakc = cenaakc1 cenaakc1 = int(input()) ...
Python
1
CUDNN, the batch size is cut in half and passed to `function`. `function` must take in a `batch_size` parameter as its first argument. function (`callable`, *optional*) A function to wrap starting_batch_size (`int`, *optional*) The batch size to try and fit into memory ...
Python
1
2 = lterm!(_); smap.extend(v0.clone(), v1.clone()); smap.extend(v1.clone(), v2.clone()); let v3 = lterm!(_); let vs = LTerm::singleton(v3.clone()); let v4 = lterm!(_); smap.extend(v2.clone(), vs.clone()); smap.extend(v3.clone(), v4.clone()); let w = smap...
Rust
0
lling_{}_gizeh_crop_no_roi.tif".format(method) ), rtol=0.1, atol=0.1, ) kwargs["dsm_file"] = input_dsm_roi kwargs["roi_polys"] = roi_poly kwargs["roi_epsg"] = roi_epsg # second test with an roi _ = dsm_filling_application.run(**kwargs...
Python
1
} fn encoding_segments_slices(gids: &[u32]) -> Vec<(SegmentEncodingStrategy, Vec<u32>)> { let ctx = Context::new(Optimization::O3); let map = make_character_map('A', &gids); let segments = encoding_segments_continuous(&map, map.iter(), &ctx); segments .map(|segment|...
Rust
0
aint(value) } fn paint_level(&self, level: Level) -> Paint<Level> { self.paint(&level, level) } } impl Default for Colors { fn default() -> Self { Self { trace: Style::new(Color::Black), debug: Style::new(Color::Fixed(7)), info: Style::new(Color::Uns...
Rust
0
_lng }, 'destination': { 'lat': dest_lat, 'lng': dest_lng }, 'submit_time': row.submit_time.isoformat() } requests.append(request_data) ...
Python
1
from fasthtml.common import * from fasthtml.svg import * from ..templates.template import page_template from fh_frankenui.core import * @page_template("404 - App Name") def custom_404_handler(request): return Section( Div( Div( H1( "404", ...
Python
1
from django import forms class AulaForm(forms.Form): titulo = forms.CharField(label='Título da Aula', max_length=100) descricao = forms.CharField(label='Descrição', widget=forms.Textarea) data = forms.DateField(label='Data da Aula', widget=forms.DateInput(attrs={'type': 'date'})) professor = forms.Char...
Python
1
self.max * other.max,) } } impl Div for StridedInterval_n { type Output = StridedInterval_n; fn div(self, other: StridedInterval_n) -> StridedInterval_n { let t1 = other.stride / self.min.abs() as u64; let t2 = self.stride / other.min.abs() as u64; l...
Rust
0
k, v in PanoSimDataProvider._actor_pool.items() if v}) @staticmethod def get_traffic_manager_port(): return PanoSimDataProvider._traffic_manager_port @staticmethod def set_traffic_manager_port(tm_port): PanoSimDataProvider._traffic_manager_port = tm_port @staticmethod def clea...
Python
1
::new(location))), None, )), ExpressionOperand::LiteralBoolean(inner) => LiteralAnalyzer::boolean(inner), ExpressionOperand::LiteralInteger(inner) => LiteralAnalyzer::integer(inner), ExpressionOperand::LiteralString(inner) => { ...
Rust
0
_TortUrl @TortUrl.setter def TortUrl(self, TortUrl): self._TortUrl = TortUrl @property def TortTitle(self): r"""侵权标题 :rtype: str """ return self._TortTitle @TortTitle.setter def TortTitle(self, TortTitle): self._TortTitle = TortTitle @prope...
Python
1
ffi::FMOD_DSP_TYPE_THREE_EQ => Ok(DspType::ThreeEq), ffi::FMOD_DSP_TYPE_FFT => Ok(DspType::Fft), ffi::FMOD_DSP_TYPE_LOUDNESS_METER => Ok(DspType::LoudnessMeter), ffi::FMOD_DSP_TYPE_ENVELOPEFOLLOWER => Ok(DspType::Envelopefollower), ffi::FMOD_DSP_TYPE_CONVOLUT...
Rust
0
from mediawords.db import connect_to_db from mediawords.dbi.downloads.store import fetch_content from mediawords.util.guess_date import GUESS_METHOD_TAG_SET from .get_story_date_tag import get_story_date_tag from topics_base.stories import generate_story, SPIDER_FEED_NAME def test_generate_story(): """Test genera...
Python
1
C[n+]7ccc(-c8cc[n+](Cc9cc(C[n+]%10ccc(-c%11cc[n+](CC)cc%11)cc%10)cc(C[n+]%10ccc(-c%11cc[n+](CC)cc%11)cc%10)c9)cc8)cc7)cc(-[n+]7ccc(-c8cc[n+](-c9cc(C[n+]%10ccc(-c%11cc[n+](Cc%12cc(C[n+]%13ccc(-c%14cc[n+](CC)cc%14)cc%13)cc(C[n+]%13ccc(-c%14cc[n+](CC)cc%14)cc%13)c%12)cc%11)cc%10)cc(C[n+]%10ccc(-c%11cc[n+](Cc%12cc(C[n+]%13...
Rust
0
false_fn), process_post: callback(&|_, _| Ok(false)), process_put: callback(&|_, _| Ok(true)), multiple_choices: callback(&false_fn), create_path: callback(&|context, _| Ok(context.request.request_path.clone())), expires: callback(&none_fn), render_response: callback(&none_fn) } ...
Rust
0
#=========================================================== # 整个系统的一些Utils #=========================================================== from dataclasses import dataclass @dataclass class PROMPT_TEMPLATE: PROMPT = { '咖啡厅对话':"假设我们在咖啡店,能否请您和我进行实际的点单对话练习,练习使用英语的点餐用语和交流方式?", '超市购物...
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...
Python
1
Api, Q: Querier>( deps: &mut Extern<S, A, Q>, env: Env, msg: HandleMsg, ) -> StdResult<HandleResponse> { match msg { HandleMsg::AddSquared { amount } => try_addsquared(deps, env, amount), HandleMsg::Reset { total } => try_reset(deps, env, total), } } pub fn try_addsquared<S: Storag...
Rust
0
Return the number of seconds of offset from signing time permitted. /// /// When a signature is checked, the local system time needs to be within /// this many seconds from `time_signed` to be accepted. pub fn fudge(&self) -> u16 { self.fudge } /// Returns a reference to the bytes valu...
Rust
0
// cancelling swap.add_journal_message(JOURNAL_CANCELLED_BY_TIMEOUT.to_string()); return Ok(StateProcessRespond::new(StateId::SellerCancelled)); } if swap.wait_for_backup1 { return Ok(StateProcessRespond::new(StateId::SellerWaitingForBuyerLock) .action(Action::WaitingForTradeBackup) ...
Rust
0
id'] == ['bar'] def test_hidden_tag_is_invisible(self): # Setting .hidden on a tag makes it invisible in output, but # leaves its contents visible. # # This is not a documented or supported feature of Beautiful # Soup (e.g. NavigableString doesn't support .hidden even ...
Python
1
Tensor<f32> = args.fetch(reward_req).unwrap(); let next_board_tensor: Tensor<f32> = args.fetch(next_board_req).unwrap(); (reward_tensor, next_board_tensor) } /// Use representation network inference. pub fn call_representation(session: &Session, graph: &Graph, board: &Tensor<f32>) -> Tensor<f32> { let boa...
Rust
0
, 'r', encoding='utf-8') as f: metadata = json.load(f) metadata_list.append(metadata) except Exception as e: print(f"读取元数据文件 {file} 时出错: {str(e)}") return metadata_list def format_metadata_display(metadata: Dict[str, Any]) -> str:...
Python
1
21 => Some(String::from("RT")), 22 => Some(String::from("NSAP")), 23 => Some(String::from("NSAP-PTR")), 24 => Some(String::from("SIG")), 25 => Some(String::from("KEY")), 26 => Some(String::from("PX")), 27 => Some(String::from("GPOS")), 28 => Some(String::fr...
Rust
0
_frame(initial_look, final_look, eps=eps) initial_params = extrinsics_to_pivot_parameters(initial, pivot_frame, pivot_point) final_params = extrinsics_to_pivot_parameters(final, pivot_frame, pivot_point) # Interpolate the pivot parameters. interpolated_params = interpolate_pivot_parameters(initial_para...
Python
1
#!/usr/bin/env python3 ## -*- coding: utf-8 -*- ## ## Output: ## ## $ ./simplification.py ## Expr: (bvxor (_ bv1 8) (_ bv1 8)) ## Simp: (_ bv0 8) ## ## Expr: (bvor (bvand (_ bv1 8) (bvnot (_ bv2 8))) (bvand (bvnot (_ bv1 8)) (_ bv2 8))) ## Simp: (bvxor (_ bv1 8) (_ bv2 8)) ## ## Expr: (bvor (bvand (bvnot (_ ...
Python
1
tate.mnt_distribution_index += ratio // supply_state.index_updated_at_block = current_block_number let mnt_speed = MntSpeedStorage::<T>::get(pool_id); if mnt_speed.is_zero() { // Distribution is off return Ok(()); } let current_block = frame_system::Pallet::<T>::block_number(); let mut pool_state = ...
Rust
0
import collections import pytest from pandas import Series import pandas._testing as tm class TestSeriesToDict: @pytest.mark.parametrize( "mapping", (dict, collections.defaultdict(list), collections.OrderedDict) ) def test_to_dict(self, mapping, datetime_series): # GH#16122 resul...
Python
1
/// inject transactions into `storage`, as transactions must be verified beforehand. storage: storage::Storage, } impl Mempool { #[allow(dead_code)] pub(crate) fn new(_network: Network) -> Self { Mempool { storage: Default::default(), } } /// Get the storage field of t...
Rust
0
/// /// That is, if (*a*, *b*) = `estimate_prime_pi(n)`, *a* ≤ π(*n*) ≤ /// *b*. The bounds used are proved in [1] and [2, Théorème 1.10], /// and are summarised in [2, pp. 14–15]. /// /// [1]: <NAME>. "Explicit Bounds for Some Functions of Prime /// Numbers". American Journal of Mathematics 63 (1): /// 211–232. 1941....
Rust
0
ForBlocksMessage::new( OperationsForBlock::new( BlockHash::try_from(hex::decode(block_hash).unwrap()).unwrap(), 4, ), Path::op(), ops, ) }) .collect() ...
Rust
0
All); options.default_to_empty = false; let output = expand( r#" value1: $TEST_LIB_EXPAND_ALL_WITH_VALUES1 value2: ${TEST_LIB_EXPAND_ALL_WITH_VALUES2} value3: ${TEST_LIB_EXPAND_ALL_WITH_VALUES3} value4: %TEST_LIB_EXPAND_ALL_WITH_VALUES4% value5: $TEST_LIB_EXPAND_ALL_WITH_VALUES5"#, Some(options...
Rust
0
// This is the expected branch. } else { panic!( "Expected `RevisionCurrentlyCheckedOut` error, got: {:?}", result ) } } } pub mod astable; pub mod expression; pub mod identifier; pub mod literals; mod parse_util; pub mod tokenize; pub mod typ...
Rust
0
---------------------------------------\n') logger_log(log_dir, 'After workload\n') out, err = invoke_cmd('ps aux | grep cockroach-beta-20160714.linux-amd64') to_write = '' out = out.split('\n') out = [i for i in out if i is not None and len(i) > 0 and ('workload_dir0' in i or 'workload_dir1' in i or 'workload_dir2' in...
Python
1
#[test] #[ignore = "cursive anchor positioning is not yet implemented"] fn gpos4_simple_5() { gpos_test( "gpos4_simple_1.otf", "latn", "UNKN", "test", &[17, 18, 20, 19, 17], &[ 0, 0, 0, -3100, 0], &[ 0, 0, 0, -80, 0], None, None ...
Rust
0
# ***************************************************************************** # Copyright (c) 2019 IBM Corporation and other Contributors. # # All rights reserved. This program and the accompanying materials # are made available under the terms of the Eclipse Public License v1.0 # which accompanies this distribution,...
Python
1
import sys import numpy as np import math import random import gym import gym_game def simulate(): global epsilon, epsilon_decay for episode in range(MAX_EPISODES): # Init environment state = env.reset() total_reward = 0 # AI tries up to MAX_TRY times for t in range(M...
Python
1
olumnStatement, AlterViewStatement, ArrayLiteral, // [1, 2] AssertStatement, Asterisk, BinaryOperator, // + | - | = | ... BeginStatement, BetweenOperator, BooleanLiteral, // TRUE | FALSE BreakContinueStatement, CallingArrayAccessingFunction, // OFFSET(1) | SAFE_ORDINAL(3) Cal...
Rust
0
batch_idx % save_every == 0: save_dict = {k: {'mean': v['mean'], 'count': v['count']} for k, v in mean_vectors.items()} torch.save(save_dict, save_path) del batch_layer_outputs torch.cuda.empty_cache() gc.collect() else: print(f"Processing {args.n_samples} messages ...
Python
1
_keycode: Some(glium::glutin::VirtualKeyCode::Escape), .. }, .. } => { return EventsHandlerOutcome::Break; } _ => (), } } ...
Rust
0
from ncdia.utils import HOOKS from .hook import Hook @HOOKS.register class ModelHook(Hook): """A hook to change model state in the pipeline, such as setting device, changing model to eval mode, etc. """ priority = "HIGHEST" def init_trainer(self, trainer) -> None: """Initialize model for...
Python
1
aph( c, margin_lr, cursor_y, text, content_w, font="Helvetica", size=base_font_size, leading=leading ) cursor_y -= 2 _draw_footer(c, page_num, width, client_name, ts_footer, margin_lr) c.save() return outpath, filename def generate_pdf_latest(attack:...
Python
1
#[allow(missing_docs)] #[allow(non_upper_case_globals)] impl SVC { // These are enum-like pub const Scalar : SVC = SVC(D3D_SVC_SCALAR); pub const Vector : SVC = SVC(D3D_SVC_VECTOR); pub const MatrixRows : SVC = SVC(D3D_SVC_MATRIX_ROWS); pub const MatrixColumns : SVC = S...
Rust
0
urce this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds # noqa: E501 :return: The kind of this V1alpha1LocalModelNodeList. ...
Python
1
6}' | '\u{0D02}'..='\u{0D03}' | '\u{0D3E}'..='\u{0D43}' | '\u{0D46}'..='\u{0D48}' | '\u{0D4A}'..='\u{0D4D}' | '\u{0D57}' | '\u{0E31}' | '\u{0E34}'..='\u{0E3A}' | '\u{0E47}'..='\u{0E4E}' | '\u{0EB1}' | '\u{0EB4}'..='\u{0EB9}' | '\u{0...
Rust
0
= Resize((test_shape, test_shape), correct_box=False)(img, None).transpose(2, 0, 1) return torch.from_numpy(img[np.newaxis, ...]).float() def __convert_pred(self, pred_bbox, test_input_size, org_img_shape, valid_scale): """ 预测框进行过滤,去除尺度不合理的框 """ pred_coor = xywh2xyxy(pred_b...
Python
1
^ 1, old_sample.y_bits(high_bit_count) ^ 1, &mut strat_result, ); let sample = pick_sample( &strat_result, bn_accel.as_ref(), blue_noise_retry_count, rng, old_sample.class_bits() ^ 0x...
Rust
0
loat(), -1.0); } #[test] fn null_string() { let results = query("null - 'aaa'", EXAMPLE_JSON); let res = results.get(0).unwrap(); assert!(res.is_number()); assert!(f64::is_nan(res.as_float())); } #[test] fn null_float() { let results = query("null - 1.1", EXAMPLE_JSON); let res = results.ge...
Rust
0
x if x == val + 4 => 7, x if x == val + 5 => 6, _ => 4, }; i += 3; } [x, y, _] if x == val + 1 && y == val + 2 || x == val + 1 && y == val + 3 => { res *= match adap[i + 4] { ...
Rust
0
> std::fmt::Result { f.debug_tuple("OperationRef") // .field(&self.some_field) .finish() } } extern crate gcc; fn main() { gcc::Config::new() .file("src/ptrace_execute/forking.c") .flag("-std=gnu99") .compile("libforking.a"); } use super::*; const DYN_CO...
Rust
0
let checkpoints_dir = root.join("checkpoints"); let layout = StateLayout::new(log, root.clone()); const HEIGHT: Height = Height::new(42); let canister_id = canister_test_id(10); let mut state = ReplicatedState::new_rooted_at( subnet_test_id(1), ...
Rust
0
opic-partial-gromov-wassertein2>` Parameters ---------- C1 : ndarray, shape (ns, ns) Metric cost matrix in the source space C2 : ndarray, shape (nt, nt) Metric costfr matrix in the target space p : ndarray, shape (ns,) Distribution in the source space q : ndarray, shape...
Python
1
#Escreva um programa que solicite ao usuário para digitar uma frase e verifique se todas as palavras estão em letras maiúsculas frase = input('Digite uma frase') if frase.isupper() == True: print('Todas as letras são caixa alta') else: print('Todas as letras não são caixa alta')
Python
1
ptional DESCRIPTION. The default is None. Returns ------- np.ndarray The weighting curve in dB. """ out = [] if freqs is not None: for freq in freqs: out.append(eval('__' + kind + '(' + freq + ')')) elif nth is not None: if nth == 1: ...
Python
1
rap(); let output = decode("66b7f69ac49fab4e5975aeb6fa9287d8eac02ac312c4de78f77f59da16cbcf87274e66801c4b862c33ea79cdc76528862bb2956c06db8b8acfac4794ebf39e35ac03cc73a4351a4ff762f681a48d6f25cad36e2814c9b5c40b9ae92509e58429106847789454d376836936bebc7a80e6c66e7aa52936d6b361378a41f849ad4e48f9ee2d3e92217a908fa8eb35736ac8ad...
Rust
0
PowerPC, S390, ARM, SuperH, IA64, X86_64, AArch64, RISCV, } impl fmt::Display for InstructionSet { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { if let Some(width) = f.width() { match self { InstructionSet::NoSpecific => { ...
Rust
0
zqa3z *= b'' assert x_rkwivh2ym nonlocal myp3dbbox7p @ioc72excylt[''] def b53te0wobsj(bfiyu5pb9a_: z6g_e9fsaie=b'', nym0vniogqm=0.0): raise None from y2b1f_w8bfm import wb3f0eoh6ba, xo35s_b0yqk as po76s_2rttq, bmoybjlzaaz, wo30r3lsad9 as i4har3zis4u, jkj2p5kc7x0 as rth09occy7x, mjlt22mjgf5, c7bdvfhkg6e,...
Python
1
R16G16_SINT [(1, 1)] [Some(4)] [sint=2] {[i16; 2]}, R16G16Sfloat => FORMAT_R16G16_SFLOAT [(1, 1)] [Some(4)] [float=2] {[f16; 2]}, R16G16B16Unorm => FORMAT_R16G16B16_UNORM [(1, 1)] [Some(6)] [float=3] {[u16; 3]}, R16G16B16Snorm => FORMAT_R16G16B16_SNORM [(1, 1)] [Some(6)] [float=3] {[i16; 3]}, R16G16B16U...
Rust
0
swim_form::structural::read::recognizer::LabelledFieldKey::Item(#name) => core::option::Option::Some(#n), }) }); let fn_name = if let Some(var_ord) = variant { suffix_ident(SELECT_INDEX_NAME, *var_ord) } else { syn::Ident::new(SELECT_INDEX_NAME, Spa...
Rust
0
"""Test our ANSI/ECMA REGEXP compiled pattern""" self.assertTrue(ANSI_ECMA_REGEXP.match(str(Colors.CLEAR))) self.assertTrue(ANSI_ECMA_REGEXP.match(str(Colors.RED_NORMAL))) self.assertTrue(ANSI_ECMA_REGEXP.match(str(Colors8Bit(0, 127)))) self.assertTrue(ANSI_ECMA_REGEXP.match(Colors.escap...
Python
1
pivot: id.clock, } } } #[derive(Debug, PartialEq)] pub enum Block { Item(Item), Skip(Skip), GC(GC), } impl Block { pub fn as_item(&self) -> Option<&Item> { match self { Block::Item(item) => Some(item), _ => None, } } pub fn as_item_mut(&m...
Rust
0
S5 URU5 MT UR(aU(aSnOUR S5 UR S URR-5 URR(a7UR S5...
Python
1
6) 0x40, // hop limit 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // source 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, // destination ]; #[test] fn test_ip_ok() { ...
Rust
0
_result", "success"), ], }) } pub fn handle_vote( deps: DepsMut, env: Env, info: MessageInfo, poll_id: u64, approve: bool, ) -> StdResult<Response> { // Ensure the sender not sending funds accidentally if !info.funds.is_empty() { return Err(StdError::generic_err("Do not ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Sales and MRP Management', 'version': '1.0', 'category': 'Hidden', 'description': """ This module provides facility to the user to install mrp and sales modulesat a time. =====================...
Python
1
cfg(feature = "charset")] let bytes = { let encoding = encoding_from_whatwg_label(&_charset) .or_else(|| encoding_from_whatwg_label(DEFAULT_CHARACTER_SET)) .unwrap(); encoding.encode(&text, EncoderTrap::Replace).unwr...
Rust
0
x69, 0xaf, 0x02, 0x67, 0xe7, 0x9f, 0x03, 0x61, 0x33, 0x1b, 0x8a, 0xe1, 0xff, 0x1f, 0xdb, 0x78, 0x8a, 0xff, 0x1c, 0xe7, 0x41, 0x89, 0xf3, 0xf3, 0xe4, 0xb2, 0x48, 0xe5, 0x2a, 0x38, 0x52, 0x6f, 0x05, 0x80, 0xa6, 0xde, 0xbe, 0xab, ], [ 0x1b, 0x2d, 0xf3, 0x81, 0xcd, 0xa4, 0xca, 0x...
Rust
0
AHB4RSTR register. However it still enables the /// peripheral in RCC_AHB4ENR, so our accesses to the peripheral memory will /// always be valid. /// /// This is useful for situations where some GPIO functionality /// was already activated outside the HAL in early startup code /// or a bootloade...
Rust
0
expected_output = { 'power_supplies': { 'POWER SUPPLY-A': { 'type': 'DC', 'status': 'OK', 'voltage': '24V', }, 'POWER SUPPLY-B': { 'type': 'DC', 'status': 'OK', 'voltage': '54V', } }, 'temperatures': { ...
Python
1
ess = grid.checked_swap_cell(x, y, x, y - 1); // The reason we split the probablity to go left or right // is to create a more uniform distrobution of particals if !success { let mut gen = rand::thread_rng(); // If there is a point to the left or right // we want to move there last...
Rust
0
container_size, )?; // Populate each of the reserved annotation IO ranges using the results from above. let header_io_range_index = td_io_range_index - IO_RANGES_PER_ANNOTATION_WRAPPER; let _ = mem::replace(&mut self.io_ranges[header_io_range_index], header_io_range); ...
Rust
0
import os import pandas as pd from sentence_transformers import SentenceTransformer from bertopic import BERTopic from sklearn.feature_extraction.text import CountVectorizer from umap import UMAP from hdbscan import HDBSCAN import numpy as np from datetime import datetime import jieba import warnings warnings.filterwar...
Python
1
""" 流循环管理器 为每个聊天流创建独立的无限循环任务,主动轮询处理消息 """ import asyncio import time from typing import Any from src.chat.chatter_manager import ChatterManager from src.chat.energy_system import energy_manager from src.chat.message_manager.adaptive_stream_manager import StreamPriority from src.common.data_models.message_manager_data...
Python
1
0xB237_40DD), (r"meshes\f\flora_tree_bm_snow_03.nif", 0x151C_1154, 0x225B_202C), (r"meshes\f\flora_tree_bm_snow_06.nif", 0x151C_1154, 0x2EDA_6BFB), (r"meshes\f\flora_tree_bm_snow_04.nif", 0x151C_1154, 0x445A_F533), (r"meshes\f\flora_tree_bm_snow_01.nif", 0x151C_1154, 0x765F_DEEF), (r"meshes\f\f...
Rust
0
want to Amazon Route 53 to send query logs to. This is the format /// of the ARN:</p> /// /// <p>arn:aws:logs:<i>region</i>:<i>account-id</i>:log-group:<i>log_group_name</i> /// </p> /// /// <p>To get the ARN for a log group, you can use the CloudWatch console, the /// <a href="https://docs....
Rust
0
b fn new(rows: usize, columns: usize) -> Map { Map::new_with_value(rows, columns, true) } pub fn new_empty(rows: usize, columns: usize) -> Map { Map::new_with_value(rows, columns, false) } pub fn generate_dfs<F, G>(rows: usize, columns: usize, start: Position, mut initial_peek: F, mut peek: G) -> Map where ...
Rust
0
ver_side), Err(e) => Err(e.into()), } } /// Connect to transport driver, and pass a channel handle for Tx/Rx Qmi messages /// to/from ril-qmi pub async fn connect_transport_device(device: &File) -> Result<zx::Channel, failure::Error> { let qmi_channel: fasync::Channel = fasync::Channel::from_channel(fd...
Rust
0
xtra_tiles == TILES_INDEPENDENT_AUX: aux_raster_size = self.aux_width * self.aux_height if self.aux_depth == DEPTH_4_BIT: aux_raster_size //= 2 elif self.aux_depth == DEPTH_16_BIT: aux_raster_size *= 2 elif self.aux_depth == DEPTH_32_BIT: ...
Python
1
).expect("failed to serialize response")) }) .map_err(|err| warp::reject::custom(AnyhowRejection(err))) }); let r_ready = warp::path("ready").and_then(route_ready); #[cfg(debug_assertions)] let r_on_req = r_on_req.boxed(); #[cfg(debug_assertions)] let r_read...
Rust
0
ub Function: u32, pub Ordinal: u32, pub AddressOfData: u32, } impl ::core::marker::Copy for IMAGE_THUNK_DATA32_0 {} impl ::core::clone::Clone for IMAGE_THUNK_DATA32_0 { fn clone(&self) -> Self { *self } } #[repr(C)] #[doc = "*Required features: `\"Win32_System_WindowsProgramming\"`*"] pub struct...
Rust
0
#[doc = r" Returns `true` if the bit is clear (0)"] #[inline] pub fn bit_is_clear(&self) -> bool { !self.bit() } #[doc = r" Returns `true` if the bit is set (1)"] #[inline] pub fn bit_is_set(&self) -> bool { self.bit() } #[doc = r" Value of the field as raw bits"] ...
Rust
0
base += 1; assert_eq!(*(base as *const u32), 6); base += 4; assert_eq!(*(base as *const u8), 0); // 7 did not get written } log!( logger, "Foo bar again", 1 as u8, 2 as u16, 3 as u32, 4 as u64, 5 as u8, 6 as u32, ...
Rust
0
// following disclaimer in the documentation and/or other materials provided with the distribution. // // 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote // products derived from this software without specific prior written permission. // // THIS SOFTWARE...
Rust
0
Eq, Serialize, Deserialize)] pub struct ContentKeyPolicyFairPlayConfiguration { #[serde(flatten)] pub content_key_policy_configuration: ContentKeyPolicyConfiguration, #[doc = "The key that must be used as FairPlay Application Secret key."] pub ask: String, #[doc = "The password encrypting FairPlay c...
Rust
0
Status, fields: Vec<Field>) -> Request { Request{ line, fields } } pub fn parse<B: BufRead>(reader: &mut B) -> Result<Request, Error> { let mut lines = reader.lines(); let first_line = lines.next() .ok_or(Error::new("Unexpected end of stream"))??; let line = Requ...
Rust
0
from openhands.events.event import Event from openhands.llm.metrics import Metrics, TokenUsage def get_token_usage_for_event(event: Event, metrics: Metrics) -> TokenUsage | None: """ Returns at most one token usage record for either: - `tool_call_metadata.model_response.id`, if possible - otherwis...
Python
1
""" Select which responses should be streamed. Enable response streaming for all HTTP flows. This is equivalent to passing `--set stream_large_bodies=1` to mitmproxy. """ def responseheaders(flow): """ Enables streaming for all responses. This is equivalent to passing `--set stream_large_bodies=1` to mit...
Python
1
1]; let file = File::open(filename).expect("Invalid file!"); let mut lines = Vec::new(); for line in io::BufReader::new(file).lines() { let line_str = line.expect("Invalid line!"); lines.push(line_str) } let lines_count = lines.len(); let mut words_count = 0; let mut c...
Rust
0
import logging import pytest import trio LOGGER = logging.getLogger(__name__) pytestmark = pytest.mark.anyio async def test_lightdb_get(shell, device, wifi_ssid, wifi_psk): # Delete counter in lightdb state await device.lightdb.delete("counter") await trio.sleep(2) # Set Golioth credential g...
Python
1
'variant': 'tonal', 'text': '执行周期支持:' '1、5位cron表达式;' '2、配置间隔(小时),如2.3/9-23(9-23点之间每隔2.3小时执行一次);' ...
Python
1
# } /// ``` fn map_err<'a, F, UO, O>(self, op: O) -> Pin<Box<dyn Future<Output = Result<T, F>> + Send + 'a>> where Self: 'a, O: 'a + FnOnce(E) -> UO + Send, UO: Future<Output = F> + Send, { Box::pin(async move { match self.await { Ok(t) => Ok(...
Rust
0
from typing import TYPE_CHECKING, Any, Callable, Optional, Type, TypedDict, cast import click from click.decorators import _param_memo from pydantic import Field if TYPE_CHECKING: from ._base_settings import Settings class ClickFieldInfoExtra(TypedDict): click_option_name: list[str] click_option_type: A...
Python
1
, and there are multiple /// orientations possible. This is the first of those possible orientations. #[serde(rename = "landscape-primary")] LandscapePrimary, /// The screen width is greater than the screen height, and there are multiple /// orientations possible. This is the second of those possible orientat...
Rust
0
new(port: u16) -> Result<ServerSocket, Exception> { Ok(ServerSocket { socket: TypedServerSocket::new(port)?, servers: HashMap::new(), }) } pub fn recv(&mut self) -> Result<(Vec<Vec<u8>>, SocketAddr), Exception> { let (command, from) = self.socket.read()?; ...
Rust
0
and Heltec lora_node STM32L151CCU6 use stm32l1xx_hal::{ gpio::{gpioa::PA4, Output, PushPull}, prelude::*, rcc, // for ::Config but note name conflict with serial spi::{Pins, Spi}, stm32::{Peripherals, SPI1}, }; #[cfg(feature = "stm32l1xx")] fn setup() -> (Spi<SPI1, impl Pins<SPI1>>, PA4<Output<Pus...
Rust
0
import tarfile with tarfile.open(backup_file, "r:gz") as tar: # Try to read the manifest manifest_file = tar.extractfile("manifest.json") if manifest_file: import json manifest = json.load(manifest_file) ...
Python
1
limited_data[key] = value[:2] + ([{"...more_items": "..."}] if len(value) > 2 else []) else: limited_data[key] = value doc_content += json.dumps(limited_data, indent=2, ensure_ascii=False) else: ...
Python
1