text
string
label_name
string
labels
int64
for /// [`transition_to_program`](crate::client::StudioMode::transition_to_program). #[skip_serializing_none] #[derive(Debug, Serialize)] pub struct Transition<'a> { /// Name of the transition. pub name: &'a str, /// Transition duration (in milliseconds). #[serde(serialize_with = "ser::duration_millis_...
Rust
0
lices}, }; use std::sync::Arc; use tracing::*; /// Extends the slices when it's full with Saved slices. pub struct ExtendStage { header_slices: Arc<HeaderSlices>, pending_watch: HeaderSliceStatusWatch, remaining_count: usize, } impl ExtendStage { pub fn new(header_slices: Arc<HeaderSlices>) -> Self { ...
Rust
0
"""Functions for various pipeline use cases. Author: Seth Axen E-mail: seth.axen@gmail.com """ from .config.params import params_to_sections_dict from .conformer.util import mol_from_smiles, mol_from_sdf, mol_to_sdf from .conformer.generate import generate_conformers from .fingerprint.generate import fprints_dict_from...
Python
1
TriListIn: *const i32, mut psTriInfos: *mut STriInfo, iMyTriIndex: i32, mut pGroup: *mut SGroup, ) -> bool { let mut pMyTriInfo: *mut STriInfo = &mut *psTriInfos.offset(iMyTriIndex as isize) as *mut STriInfo; // track down vertex let iVertRep: i32 = (*pGroup).iVertexRepresentitive; l...
Rust
0
import argparse from driver_manager import DriverManager from titulo_extractor import TituloExtractor from preco_extractor import PrecoExtractor from disponibilidade_extractor import DisponibilidadeExtractor def main(): # Configura o parser de argumentos parser = argparse.ArgumentParser(description='Verificad...
Python
1
{ 'name': 'Bank Management System', 'version': '1.0.0', 'category': 'Administration', 'license': 'LGPL-3', 'author': 'Alay Shah', 'sequence': 1, 'summary': 'Bank management system ', 'description': """This module contains all the common features of Bank Management System """, 'depen...
Python
1
"""fix_delete 迁移 ID: f3fc1c3ec51d 父迁移: 53691b7cf82d 创建时间: 2025-07-31 15:32:03.929207 """ from __future__ import annotations from collections.abc import Sequence from alembic import op revision: str = "f3fc1c3ec51d" down_revision: str | Sequence[str] | None = "53691b7cf82d" branch_labels: str | Sequence[str] | Non...
Python
1
equivalent to the safe unsize coersion from Box<ErrorImpl<E>> to // Box<ErrorImpl<dyn StdError + Send + Sync + 'static>> except that the // result is a thin pointer. The necessary behavior for manipulating the // underlying ErrorImpl<E> is preserved in the vtable provided by the // call...
Rust
0
model_l = get_cls_net_l(cfg_l) model_l.load_state_dict(loaded_state_l) model_l.to(device) model_l.eval() transform = T.Resize((540, 960)) with zipfile.ZipFile(zip_name_pred, 'w') as zip_file: for file in tqdm(files, desc="Processing Images"): ...
Python
1
r::from_str(config_str) { return Ok(ServerAddress::Ip(addr)); } if !hostname_validator::is_valid(config_str) { return Err(Error::WrapperError(WrapperErrorKind::InvalidParam)); } Ok(ServerAddress::Hostname(config_str.to_owned())) } } impl std::fmt::Display f...
Rust
0
_params: &'a Self::PublicParams, replica_id: &H::Domain, replica: &[u8], node: usize, config: Option<StoreConfig>, ) -> Result<Vec<u8>>; } pub fn replica_id<H: Hasher>(prover_id: [u8; 32], sector_id: [u8; 32]) -> H::Domain { let mut to_hash = [0; 64]; to_hash[..32].copy_from...
Rust
0
from flask import Flask, render_template, request import pandas as pd import plotly.graph_objects as go import os app = Flask(__name__) UPLOAD_FOLDER = 'uploads' if not os.path.exists(UPLOAD_FOLDER): os.makedirs(UPLOAD_FOLDER) @app.route('/') def index(): return render_template('index.html') @app.route('/upl...
Python
1
facet(builder, OUTER_FACET_SIZE, Some(Color::red())); }); } const INDICATOR_FACET_SIZE: Size = size2(80.0, 40.0); const INDICATOR_FACET_DELTA: Size = size2(-10.0, 10.0); fn make_fake_button(builder: &mut SceneBuilder) { builder.group().column().max_size().space_evenly().contents(|builder| { builde...
Rust
0
let should_collapse_and_trim_value_ws = COLLAPSIBLE_AND_TRIMMABLE_ATTRS.contains(&proc[name]); let has_value = chain!(proc.match_char(b'=').keep().matched()); let (typ, value) = if !has_value { (AttrType::NoValue, None) } else { match process_attr_value(proc, should_collapse_and_trim_value_...
Rust
0
::Externref, _ => bail!("currently {:?} is not a valid wasm interface type", a), }) } <gh_stars>10-100 //! C functions not provided by compiler-builtins //! //! Use this instead of linking to libc if you only need a handful of free functions use cty::{c_char, c_void, size_t}; extern "C" { // provided ...
Rust
0
or( u'tag:yaml.org,2002:python/complex', FullConstructor.construct_python_complex) FullConstructor.add_constructor( u'tag:yaml.org,2002:python/list', FullConstructor.construct_yaml_seq) FullConstructor.add_constructor( u'tag:yaml.org,2002:python/tuple', FullConstructor.construct_python_tuple) ...
Python
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- import numpy as np import tensorflow as tf import argparse import os from tensorpack import * from tensorpack.tfutils.symbolic_functions import * from tensorpack.tfutils.summary import * def linearFetch(lst): return lst def expFetch(lst): nums = len(lst) i...
Python
1
er of throttled periods", stat_path.display() ); } if parts[4] != "throttled_time" { bail!( "{} does not contain the total time tasks have spent throttled", stat_path.display() ); } stats.periods = part...
Rust
0
on::from_value(resp["data"]["onDemandView"].clone())?; Ok(result) } #[tokio::test] #[cfg_attr(miri, ignore)] async fn general_api_compatibility_test() -> Result<()> { let schema_id1 = add_schema( "test_schema", POSTGRES_QUERY_ADDR, POSTGRES_INSERT_DESTINATION, ) .await?; let...
Rust
0
.github.io/cf-python/method/cf.Field.squeeze.html>`_ # function applied to the histogram ``array`` extracts the histogram data as a NumPy # array and removes any single dimensions. # - The ``total_valid_sub_cells`` variable calculates the total number of valid # subcells (non-missing data points) by summing the h...
Python
1
# # Newfies-Dialer License # http://www.newfies-dialer.org # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. # # Copyright (C) 2011-2015 Star2Billing S.L. # # The primar...
Python
1
import matplotlib import matplotlib.pyplot as plt import pandas as pd import squarify # qualtities plotted # squarre area is the town surface area (superf) # color scale is the town population in 2011 (p11_pop) # read data from csv file # data from CAPP opendata http://opendata.agglo-pau.fr/index.php/fiche?idQ=27 df ...
Python
1
import itertools import logging from collections import defaultdict from django.core.cache import cache from bkm_ipchooser import constants, types from bkm_ipchooser.api import BkApi from bkm_ipchooser.handlers.base import BaseHandler from bkm_ipchooser.query import resource from bkm_ipchooser.tools import batch_requ...
Python
1
let key = accept_key("<KEY>()); assert_eq!(key, "<KEY> } } <filename>src/commands/ps.rs use crate::{container::Container, utils}; use anyhow::{bail, Context, Result}; use cgroups; use clap::{self, Clap}; use std::{path::PathBuf, process::Command}; /// Display the processes inside the container #[derive(Cla...
Rust
0
xc3\xb7\x07E\x86\xac\ \x5c\x95\xcft\xb2s\xecP\xde\xd2Po\xfa\xe2\x82E\ C\xf9q\xee\x18BE\x87lY\xe0D\xd8p\x7fq\ W\x94\xa7\xa5\x86<\xa1\x0a\x87\xccK6\xfc\xc2[]\ .S\x089\xb2f\xb5\xc7\x1d\x06<\xe9\xc0\xc8 h\ \xbd\x9bc5\xf1\x81\xb0\x16R\xb2\xe97\xa5\x9f\x9c\xe7\ '\xe9zq\x0b\x14\xe0\x02d\x8c\xe8/\xea\x8e9\x01\ F\xa9P\x8b\xfa\x...
Python
1
Returns: Float value between 0.0 and 1.0 indicating proximity to village center (1.0 means at the center, 0.0 means furthest away) """ # Calculate distance from center px, py = position distance = utils.calculate_distance( px, py, village.village_center_x, village.vi...
Python
1
ained( MODEL_NAME, quantization_config=quant_config, device_map="auto", low_cpu_mem_usage=True, # If you later install flash-attn, you can add: attn_implementation="flash_attention_2" ) # Gradient checkpointing + k-bit prep model.config.use_cache = False try: ...
Python
1
$sym:ident $(:: $sym2:ident )+ $( $e:tt )* ) => ( $sym $(:: $sym2 )+ ( $(lisp_arg!($e)),* ) ); ( $sym:ident . $( $sym2:ident ).+ $( $e:tt )* ) => ( $sym.$( $sym2 ).+ ( $(lisp_arg!($e)),* ) ); ( $sym:ident $( $e:tt )* ) => ( $sym ( $(lisp_arg!($e)),* ) ); // execute rust (rust $( $st:stmt )* ) => ( $($...
Rust
0
#[inline] fn set<T: Send + 'static>( &mut self, tcell: &'tcell TCell<T>, value: impl _TValue<T>, ) -> Result<(), SetError<T>> { assert_eq!( mem::size_of_val(&value), mem::size_of::<T>(), "swym currently requires undo callbacks to be zero s...
Rust
0
rator.wait_for_everyone() if track_with_wandb and accelerator.is_main_process: accelerator.log(log_dict, step=(epoch + 1) * len(train_loader)) if (epoch + 1) == num_epochs or (epoch + 1) % save_freq == 0: accelerator.wait_for_everyone() ac...
Python
1
i32, c: i32, d: i32, e: i32, f: i32) -> i32 { debug!("emscripten::___gxx_personality_v0"); 0 } // round 2 pub fn nullFunc_dii(ctx: &mut Ctx, index: i32) { debug!("emscripten::nullFunc_dii"); } pub fn nullFunc_diiii(ctx: &mut Ctx, index: i32) { debug!("emscripten::nullFunc_diiii"); } pub fn nullFunc_iij...
Rust
0
from pydantic import BaseModel from sqlmodel import Field, SQLModel from uuid import uuid4 from datetime import datetime class UserBase(SQLModel): name: str | None = None email: str tel: str | None = None class User(UserBase, table=True): """表结构""" # uuid 标准格式 id: str = Field( defau...
Python
1
olling standard deviation from the underlying stream. Returns ------- `Stream[float]` A rolling standard deviation stream. """ return self.var().sqrt() def min(self) -> "Stream[float]": """Computes a rolling minimum from the underlying stream. R...
Python
1
import pandas as pd from sklearn.model_selection import train_test_split from sklearn.ensemble import RandomForestRegressor from sklearn.impute import SimpleImputer from sklearn.metrics import mean_squared_error, r2_score, mean_absolute_error data = pd.read_csv("train.csv") features = ["LotArea", "BedroomAbvGr", "Fu...
Python
1
p = len(same_res) / len(set(pre_res)) r = len(same_res) / len(set(real_res)) if (p + r) != 0.0: f = 2 * p * r / (p + r) else: f = 0.0 f1 += f # 将结果添加到save_data中 save_data.appen...
Python
1
#!/usr/bin/env python from vtkmodules.vtkCommonCore import ( vtkFloatArray, vtkPoints, ) from vtkmodules.vtkCommonDataModel import ( vtkCellArray, vtkPolyData, ) from vtkmodules.vtkFiltersModeling import vtkPolyDataPointSampler from vtkmodules.vtkRenderingCore import ( vtkActor, vtkPolyDataMappe...
Python
1
SPEC { type Reader = R; } #[doc = "`write(|w| ..)` method takes [timer2_sync::W](W) writer structure"] impl crate::Writable for TIMER2_SYNC_SPEC { type Writer = W; } #[doc = "`reset()` method sets TIMER2_SYNC to value 0"] impl crate::Resettable for TIMER2_SYNC_SPEC { #[inline(always)] fn reset_value() -...
Rust
0
bytes(); out.write_u16::<BigEndian>(bytes.len() as u16)?; out.write_all(bytes)?; }, Constant::MethodHandle { ref kind, ref referent, } => { out.write_u8(kind.as_byte())?; out.write_constant_index(referent)?; } Constant::MethodType(ref index...
Rust
0
(input) } ) ); #[test] fn test_gate_parser() { let mut state: HashMap<String, Gate> = HashMap::new(); state.insert("simple".to_owned(), gate_parser("12345").unwrap().1); state.insert("not".to_owned(), gate_parser("NOT simple").unwrap().1); state.insert("three".to_owned(), gate_parser("3").unwrap()....
Rust
0
# coding=utf-8 from transformers import RobertaTokenizerFast, XLMRobertaTokenizerFast from transformers.file_utils import is_sentencepiece_available from transformers.utils import logging if is_sentencepiece_available(): from .tokenization_LiLTRobertaLike import LiLTRobertaLikeTokenizer else: LiLTRobertaLikeT...
Python
1
ts = 3 prog.unroll(shots=shots) assert len(prog.circuit) == n * shots * prog_length prog.roll() assert len(prog.circuit) == prog_length @pytest.mark.parametrize( "space_unrolled, start_locked", [[True, True], [True, False], [False, True], [False, False]] ) def test_...
Python
1
# -*- coding: utf-8 -*- __version__ = '6.0.1dev' from .configs import config from .configs import * # noqa F401 of Config from .common import * # noqa F403 from .launcher import LazyLLMLaunchersBase from .flow import * # noqa F403 from .components import (LazyLLMDataprocBase, LazyLLMFinetuneBase, LazyLLMDeployBase,...
Python
1
#!/usr/bin/python3 """[Fabric script] """ from fabric.api import env from fabric.api import put from fabric.api import run from fabric.api import local from datetime import datetime from os import path env.hosts = ['34.75.254.10', '34.75.125.125'] env.user = "ubuntu" def do_pack(): """[generates a .tgz archive] ...
Python
1
> 0 broker.disconnect() print("✅ Basic broker working") except Exception as e: print(f"❌ Basic broker failed: {e}") failures.append(f"Basic broker: {e}") # Summary print("\n" + "=" * 60) if not failures: print("🎉 ALL FIXES SUCCESSFUL!") ...
Python
1
| v.is_task()); // all the things that aren't just symlink/copy simple_operations.retain(|_, v| !v.is_task()); // all the things that are quick (don't need to thread off) for (_name, _mo) in simple_operations.into_iter() { let _ = perform_operation_on(_mo).map_err(|e| { hmerror::error( format!("Fa...
Rust
0
import os.path def update_job_count_badge(new_job_count: int) -> None: """ Updates the job badge found in the README. README must contain a line with `![{badge_id}]({badge_url})` Args: new_job_count (int): new job count """ badge_id = "job-count-1" badge_color = 'orange' # !...
Python
1
t bitmap = PageBitmap::new(10); bitmap.mark(PageIndex::new(5)); assert_eq!( Range { start: PageIndex::new(0), end: PageIndex::new(1), }, bitmap.restrict_range_to_predicted(bitmap.page_range()), ); assert_eq!( Range { start: PageIndex::n...
Rust
0
ConfigurationResponse; #[cfg(feature = "api")] pub use self::initializer_configuration::ListInitializerConfigurationResponse; #[cfg(feature = "api")] pub use self::initializer_configuration::PatchInitializerConfigurationResponse; #[cfg(feature = "api")] pub use self::initializer_configuration::{ReadInitializerConfigura...
Rust
0
ate { host_base: String, bulk_queue: Arc<Mutex<bulk::BulkQueue>>, db: db::DbAddr, db_uri: String, google_auth_client: Arc<Mutex<GoogleAuthClient>>, recent_tags: Arc<Mutex<cache::tags::RecentTagCache>>, header_links: pages::HeaderLinkCollection, } #[derive(Debug, StructOpt)] #[structopt(name...
Rust
0
id: REFIID, ppv: *mut *mut c_void) -> HRESULT; } UNION! {#[cfg_attr(target_arch = "x86", repr(packed))] union NOTIFYICONDATAA_u { [u32; 1], uTimeout uTimeout_mut: UINT, uVersion uVersion_mut: UINT, }} STRUCT! {#[cfg_attr(target_arch = "x86", repr(packed))] struct NOTIFYICONDATAA { cbSize: DWORD, hWn...
Rust
0
import torch from datasets import load_dataset from whistress import WhiStressInferenceClient if __name__ == "__main__": # Load your dataset, replace with the actual dataset you are using dataset_name = "slprl/StressTest" # Example dataset name, change as needed dataset = load_dataset(dataset_name) ...
Python
1
snocat // Copyright (c) Microsoft Corporation. // Licensed under the MIT license OR Apache 2.0 use crate::services::{demand_proxy::DemandProxyClient, PresetServiceRegistry}; use anyhow::{Context as AnyhowContext, Error as AnyErr, Result}; use futures::{future::*, *}; use snocat::{ common::{ authentication::Simpl...
Rust
0
# for i, (score, acc_score, format_score, valid_response_length, data_source, prompt_str, response_str, ground_truth, time_consume) in enumerate(results): for i, result in enumerate(results): if isinstance(result[0], dict) and result[0]['is_filter'] == True: invalid_uids.append(...
Python
1
class Solution: def generateAbbreviations(self, word: str) -> List[str]: ans = [] def getCountString(count: int) -> str: return str(count) if count > 0 else '' def dfs(i: int, count: int, path: List[str]) -> None: if i == len(word): ans.append(''.join(path) + getCountString(count)) ...
Python
1
streaming responses def generate(): while True: token = token_queue.get() if token is None: # End of stream break yield token # Return a streaming response return Response(generate(), mimetype='text/plain')...
Python
1
muex.add_scalar(tmp) acc = _multiexp(None, muex, False) _add_keys(muex_acc, muex_acc, acc) _sc_mulsub(tmp, proof.a, proof.b, proof.t) _sc_mul(tmp, tmp, x_ip) _sc_muladd(z3, tmp, weight_z, z3) _sc_sub(tmp, m_y0, z1) z3p = _sc_sub(None...
Python
1
o the known server dhcp_msg['flags'] = enums.bootp.Flag.UNICAST return SentDHCPMessage( dhcp=dhcp_msg, eth_dst=lease.server_mac, # default ip_dst to broadcast, it should not be necessary # but it'll avoid a crash if the server_id is...
Python
1
, }; let mut mip_levels = 1; if header.flags & DDS_HEADER_FLAGS_MIPMAP != 0 { mip_levels = header.mip_map_count.max(1).min(10); } bitmap.num_mip_levels = mip_levels; let mut total_size = 0; for i in 0..mip_levels { bitmap.mip_level_offsets[i as usize] = total_size as u32; ...
Rust
0
ight) _test_convert_result([data, weight], traced_module, tm_result, max_err=1e-4) # skip # @pytest.mark.parametrize( # "model", ["resnet18",], # ) # def test_model(model): # data = np.ones((1, 3, 224, 224)).astype(np.float32) # if megengine.__version__ < "1.1.0": # commit_id = "dc2f2cfb228a13...
Python
1
ruth的情况 if isinstance(item["answer"], list): gold_answers = item["answer"] else: gold_answers = [item["answer"]] # 为每个ground truth生成prompt for gold_answer in gold_answers: prompt = get_judge_prompt(question, gold_answer, prediction) ...
Python
1
ng { let seg = last_path_segment(path); if_chain! { if let Some(ref params) = seg.parameters; if !params.parenthesized; if let Some(to_ty) = params.types.get(1); if let TyRptr(_, ref to_ty) = to_ty.node; then { return snippet(cx, to_ty.ty.span, &to_ref_ty.to_s...
Rust
0
asis_timer", StasisTimer, b"irradiate_timer", IrradiateTimer, b"matrix_timer", MatrixTimer, b"matrix_hitpoints", MatrixHitpoints, b"acid_spore_count", AcidSporeCount, b"fighters", Fighters, b"mines", Mines, b"hitpoints", Hitpoints, b"hitpoints_percent", HitpointsPercent, b"shields", ...
Rust
0
[macro_export] macro_rules! bare_print { ($($arg:tt)*) => ({ putfmt(format_args!($($arg)*)); }); } #[macro_export] macro_rules! bare_println { () => (bare_print!("\n")); ($($arg:tt)*) => (bare_print!("{}\n", format_args!($($arg)*))); } pub const MMIO_MTIMECMP0: *mut u64 = 0x0200_4000usize as *mut u64; pub...
Rust
0
(), AnyError> { let mut directories = self.directories.borrow_mut(); for path in dir_path.ancestors() { if !directories.insert(path.to_path_buf()) { break; } } Ok(()) } fn write_file(&self, file_path: &Path, text: &str) -> Result<(), AnyError> { let parent = file_path.parent...
Rust
0
import os import json def summarize_files_contents(file_paths): print("Entered summarize_files_contents function with", len(file_paths), "file paths.") summaries = [] for file_path in file_paths: print("Processing file:", file_path) summary = {} try: with open(file_pa...
Python
1
gisterUnit(ha_sensor.get('register')) if ha_sensor.get('dev_class'): config_msg['device_class'] = ha_sensor.get('dev_class') if ha_sensor.get('state_class'): config_msg['state_class'] = ha_sensor.get('state_class') if ha_sensor.get(...
Python
1
) else: return Response({'error': 'Código inválido ou expirado.'}, status=status.HTTP_400_BAD_REQUEST) @api_view(['POST']) def submeter_avaliacao(request, escola_id): """ Endpoint para submeter uma avaliação para uma escola específica. Requer o header 'Authorization: Bearer <token>'. P...
Python
1
} macro_rules! println_on_level { ($verbosity:expr, $level:expr, $fmt: expr) => { crate::utility::PrintBasedOnVerbosity::println(&$verbosity, $level, &std::format_args!($fmt)) }; ($verbosity:expr, $level:expr, $fmt: expr, $($args: expr), *) => { crate::utility::PrintBasedOnVerbosity::prin...
Rust
0
#!/usr/bin/env python3 from math import sqrt, sin, cos, pi import util radius_x = 160//2 radius_y = 100//2 def f(t): return (sqrt(t)*cos(2*pi*sqrt(t)), 0.92*sqrt(t)*sin(2*pi*sqrt(t))) coords = [] for i in range(1000000): any = False a, b = f(float(i)/10.0) x = round(radius_x+a) y = round(radius_...
Python
1
#!/usr/bin/env python # Copyright (c) 2020 The BitcoinZ Community # Copyright (c) 2017 The Zcash developers # Distributed under the MIT software license, see the accompanying # file COPYING or https://www.opensource.org/licenses/mit-license.php . # # Create a large wallet # # To use: # - Copy to qa/rpc-tests/wallet_la...
Python
1
hape()[1..].iter().product(); let patch_size = filter.shape()[..filter.ndim()-1].iter().product(); let input_channels = input.shape()[input.shape().len()-1]; let output_channels = output_grad.shape()[output_grad.shape().len()-1]; let input_spatial = &input.shape()[1..input.shape().len()-1]; let filter_spati...
Rust
0
let default_fields = do fields.map |&(ident, span)| { cx.field_imm(span, ident, default_call(span)) }; cx.expr_struct_ident(span, substr.type_ident, default_fields) } } } StaticEnum(*) => { cx.span_f...
Rust
0
( hex!("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA7179E84F3B9CAC2FC63254E"), hex!("5ECBE4D1A6330A44C8F7EF951D4BF165E6C6B721EFADA985FB41661BC6E7FD6C"), hex!("78CB9BF2B6670082C8B4F931E59B5D1327D54FCAC7B047C265864ED85D82AFCD"), ), ( hex!("FFFFFFFF00000000FFFFFFFFFFFFFFFFBCE6FAADA...
Rust
0
# -*- coding: utf-8 -*- # Copyright 2023 Google LLC # # 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...
Python
1
add_domain_synonym(DomainSynonym { from_hostname, to_domain_id }).await { Ok(_) => { Some(Flash::success(Redirect::to(uri!(get_admin_domains)), "Updated domain synonym")) } Err(e) => { warn!("Unable to update domain synonym: {:?}", e); Some(Flash::...
Rust
0
changqifuzhai, \ zibengongjijin, \ jingzichan, \ zhuyingshouru, \ zhuyinglirun, \ ...
Python
1
441, 4449, 4452, 4453, 4455, 4469, 4473, 4482, 4485, 4487, 4488, 4490, 4499, 4505, 4506, 4510, 4512, 4519, 4520, 4525, 4540, 4542, 4546, 4552, 4556, 4559, 4567, 4568, 4575, 4594, 4604, 4606, 4618, 4623, 4641, 4656, 4658, 5010, 5017, 5039, 5042, 5068, 5080, 5084, 5091, 5095, 5099, 5103, 5105, 5121, 5138, 515...
Python
1
be either `"quantitative"` (for using a linear bin scale) or [`"ordinal"` /// (for using an ordinal bin /// scale)](https://vega.github.io/vega-lite/docs/type.html#cast-bin). /// - When using with [`timeUnit`](https://vega.github.io/vega-lite/docs/timeunit.html), the /// `type` property can be either `...
Rust
0
gle a_angle = 90 - self.sol_elev c_angle = 180 - awn_angle - a_angle vertical_position = super().calculate_position() length = ((self.h_win - vertical_position) * sin(rad(a_angle))) / sin( rad(c_angle) ) # return np.clip(length, 0, self.awn_length) re...
Python
1
_agents_temp2 = alive_agents.unsqueeze(1) alive_agents_tensor = th.zeros_like(alive_agents_temp1, dtype=th.float32) alive_agents_tensor[alive_agents_temp1 == True] = 1 alive_agents_tensor2 = th.zeros_like(alive_agents_temp2, dtype=th.float32) alive_agents_tensor2[alive_...
Python
1
node: if brightness < out_line_node: outline_middle = max_a else: outline_middle = 0 outline_a = 0 if media_type == 'show' else outline_middle # 黑色背景 contrast_factor = 1.65 # 色阶增强因子,大于1增强,小于1减弱 # 将高斯模糊后的海报上叠加黑色透明层 overlay_layer = Image.ne...
Python
1
'loc>>, pub(crate) location: FileLocation<'loc>, } #[derive(PartialEq, Debug, Clone, Serialize, Deserialize, Hash)] pub(crate) struct WhenGuardBlockClause<'loc> { pub(crate) conditions: WhenConditions<'loc>, pub(crate) block: Block<'loc, GuardClause<'loc>>, } #[derive(PartialEq, Debug, Clone, Serialize, D...
Rust
0
# 移除特效字幕相关UI组件 # # # # # 绑定按钮点击事件 # template_id # ], # ) # ) # ) # ) # 生成封面图按钮绑定的回调函数 ...
Python
1
start of the description let rowlen = row.char_len(); if rowlen < 24 { (24 - rowlen).times(|| { row.push_char(' ') }) } else { row.push_str(desc_sep) } // Normalize desc to contain words sepa...
Rust
0
let mut controllers = controllers(&config, true)?; let cards = match switcher.card { Some(card_id) => match controllers.iter().position(|c| c.hw_mon.card.0 == card_id) { Some(card) => vec![controllers.remove(card)], None => { eprintln!("Card does not exists. Avai...
Rust
0
q!(SAMPLE_ITEM_ENTRY_3, gem2, 0); } #[test] fn parse_item_entry_will_return_right_magic1() { assert_item_type_field_eq!(SAMPLE_ITEM_ENTRY_1, magic1, 33); assert_item_type_field_eq!(SAMPLE_ITEM_ENTRY_2, magic1, 0); assert_item_type_field_eq!(SAMPLE_ITEM_ENTRY_3, magic1, 3); } #[test] fn parse_item...
Rust
0
&dyn Source, file: FileId) -> ArcSlice<Diagnostic> { source.parsed(file).1 } #[salsa::query_group(ValidationDatabase)] pub trait Validation: Source { fn validation_diagnostics(&self, file: FileId) -> ArcSlice<Diagnostic>; } fn validation_diagnostics(validation: &dyn Validation, file: FileId) -> ArcSlice<Diag...
Rust
0
class ParkingSystem: def __init__(self, big:int, medium:int, small:int): self.spaces = [big, medium, small] def addCar(self, carType:int) -> bool: if self.spaces[carType - 1] > 0: self.spaces[carType - 1] -= 1 return True return False
Python
1
config_path = os.path.join(self._temp_path, '.config/transmission-daemon') os.makedirs(config_path) with open(os.path.join(config_path, 'settings.json'), 'w') as f: json.dump({ 'rpc-bind-address': '127.22.54.99', }, f) tc = Transmission...
Python
1
""" 数据集模块,用于管理和下载基准测试数据集 """ # 导出数据集类 from .mathvista import MathVistaDataset from .mmmath import MMMathDataset from .mmmu import MMMUDataset # 支持的数据集映射 supported_datasets = { 'mathvista': MathVistaDataset, 'mmmath': MMMathDataset, 'mmmu': MMMUDataset, } __all__ = ['MathVistaDataset', 'MMMathDataset', 'M...
Python
1
# Copyright (c) OpenMMLab. All rights reserved. import platform from unittest import TestCase import pytest import torch from mmpretrain.models import MoCoV3, MoCoV3ViT from mmpretrain.structures import DataSample class TestMoCoV3(TestCase): backbone = dict( type='MoCoV3ViT', arch='mocov3-small...
Python
1
appearence); self } pub fn scale(mut self, scale: Scale) -> Marker { self.scale = Some(scale); self } } impl<'a> Default for Marker { fn default() -> Self { Marker::new() } } impl<'a> From<Location> for Marker { fn from(location: Location) -> Self { Mar...
Rust
0
; Ok(Self { target_image_path, target_image, confs, errors, }) } fn calc_errors(&mut self) { for conf in &self.confs { let runtime = Runtime::load(conf).unwrap(); let output = &runtime.renderer.config.output; ...
Rust
0
a.value().the_nth(-1) } ); b.rule_2("last <day-of-week>", b.reg(r#"前の"#)?, time_check!(form!(Form::DayOfWeek{..})), |_, a| { a.value().the_nth(-1) } ); b.rule_2("<day-of-week> of last week", b.reg(r#"先週の"#)...
Rust
0
Noise is an XOR function, and audio output is negated before being output. All the Sega-made PSG chips act as if the frequency was set to 0 if 0 is written to the frequency register. ** NCR8496 (as used on the Tandy 1000TX) is similar to the SN76489 but with a different noise LFSR pattern: taps on bits A and...
Rust
0
<HCBULKCURRENTED_SPEC>`"] pub type HCBULKCURRENTED = crate::Reg<hcbulkcurrented::HCBULKCURRENTED_SPEC>; #[doc = "Contains the physical address of the current endpoint descriptor of the bulk list"] pub mod hcbulkcurrented; #[doc = "HCDONEHEAD register accessor: an alias for `Reg<HCDONEHEAD_SPEC>`"] pub type HCDONEHEAD =...
Rust
0
art_coord['y'] * frame.shape[0])) end_point = (int(end_coord['x'] * frame.shape[1]), int(end_coord['y'] * frame.shape[0])) cv2.line(frame, start_point, end_point, (255, 0, 0), 2) # Blue line # Draw guide connections if show_guide and guide_im...
Python
1
artanair-test-mono-release/mono/MH004", # "/home/honsen/tartan/test/tartanair-test-mono-release/mono/MH005", # "/home/honsen/tartan/test/tartanair-test-mono-release/mono/MH006", # "/home/honsen/tartan/test/tartanair-test-mono-release/mono/MH007"] test_split = ["...
Python
1
l ::protobuf::reflect::ProtobufValue for RequirementType { fn as_ref(&self) -> ::protobuf::reflect::ProtobufValueRef { ::protobuf::reflect::ProtobufValueRef::Enum(self.descriptor()) } } #[derive(Clone,PartialEq,Eq,Debug,Hash)] pub enum ColumnType { COLUMN_KEYS = 0, COLUMN_VALUES = 1, } impl ::...
Rust
0
omment['text']) # if not any(u['id'] == comment['user']['pk'] for u in users): # user = { # 'id': comment['user']['pk'], # 'username': comment['user']['username'], # 'full_name': comment['user'][...
Python
1