text
string
label_name
string
labels
int64
y = y.to(device) pred = model(x) loss = loss_fn(pred, y) loss.backward() optimizer.step() optimizer.zero_grad() #测试函数也一样 def val(dataloader, model, loss_fn, device, scheduler): model.eval() test_loss, correct = 0, 0 with torch.no_grad(): for x, y in d...
Python
1
th_bbox) return image # def colorize_text(phrases, colors, text): # # 将短语和颜色组合成 (phrase, color) 的元组 # highlighted_phrases = list(zip(phrases, colors)) # # 使用 gr.HighlightedText 的输出格式 # highlighted_output = { # "text": text, # "entities": [{"entity": phrase, "color": color} for ...
Python
1
if state_machine.keyboard_control: send_command("dev00", "CYCLE") send_command("dev01", "LIGHT_FRONT_OFF") send_command("dev01", "LIGHT_BACK_ON") elif key == pygame.K_q: print("🛑 Q pressed - shutting ...
Python
1
::current_dir()?; run_server( ra_lsp_server::server_capabilities(), receiver, sender, |params, r, s| { let root = params .root_uri .and_then(|it| it.to_file_path().ok()) .unwrap_or(cwd); ra_lsp_server::main_loop(...
Rust
0
import csv from datetime import datetime as dt products = [ ["id","name","price"], [1,"Laptop",1200], [2,"Phone",800], [3,"Headphones",150], [4,"Mouse",40], [5,"Keyboard",60] ] with open("product.csv","w") as file: writer = csv.writer(file) writer.writerows(products) class logger: log_f...
Python
1
.Session() as sess: coord = coordinator.Coordinator() threads = queue_runner_impl.start_queue_runners(sess=sess, coord=coord) for _ in range(100): dq = sess.run(dq_op) indices = dq[0] expected_rows = df.iloc[indices] for col_num, col in enumerate(df.column...
Python
1
lient.room_id != Some(room.id)); room.players_number += 1; client.room_id = Some(room.id); client.set_is_joined_mid_game(room.game_info.is_some()); client.set_is_in_game(room.game_info.is_some()); if let Some(ref mut info) = room.game_info { let teams = info.client_teams(client.id); ...
Rust
0
from string import Template module_name = "Techniques" priority = 4 # Markdown path for techniques techniques_markdown_path = "content/pages/techniques/" # Path for templates techniques_templates_path = "modules/techniques/templates/" # String template for all techniques technique_md = Template( "Title: ${name}...
Python
1
let f2 = Box::pin(rx2.map(drop)) as Pin<Box<dyn Future<Output = ()> + Unpin>>; self.add_task(future::select(f1, f2).map(|_| Ok(()))); Promise::from_future(rx.map_err(crate::canceled_to_error).map(|r| {drop(tx2); r?})) } fn add_task<F>(&self, task: F) where F: Future<Outp...
Rust
0
(n) => assert_float_eq_f64(deepex.unary_op.op.apply(n), n), _ => { unreachable!(); } } } #[test] fn test_deep_lift_node() { let deepex = from_str("(({x}^2.0)*(({x}^1.0)*2.0))+((({x}^1.0)*2.0)*({x}^2.0))").unwrap(); println!("{}", deepex); assert_eq!( format!("{}", de...
Rust
0
from src.inference_utils.functions import inference
Python
1
assert!(tmp.is_zero()); // Add a random number to another one such that the result is s - 1 tmp = Fs([ 0xa11fda5950ce3636, 0x922e0dbccfe0ca0e, 0xacebb6e215b82d4a, 0x97ffb8cdc3aee93, ]); tmp.add_assign(&Fs([ 0x2f7734058628f680,...
Rust
0
xts, }) } pub fn round_end_draw(draw_type: DrawType) -> Self { Self::RoundEndDraw(EventRoundEndDraw { draw_type }) } pub fn round_end_no_tile(tenpais: [bool; SEAT], points: [Point; SEAT]) -> Self { Self::RoundEndNoTile(EventRoundEndNoTile { tenpais, points }) } pub fn ...
Rust
0
, verbose, } => vault_view(file.as_ref(), password, password_file, verbose).await?, }; Ok(()) } #[cfg(test)] mod tests { use super::*; use std::fs; use std::io::Write; use std::process::{Command, Stdio}; use tokio::net::{TcpListener, TcpStream}; #[tokio::test] a...
Rust
0
ef_32k_to_12345_test_count_bytes", Input { src: File::open("./test-resources/deadbeef-18d99661a1de1fc9af21b0ec2cd67ba3.test").unwrap(), non_ascii: false, ibs: 531, print_level: None, count: Some(CountType::Bytes(12345)), cflags: IConvFlags::default(), iflags: ...
Rust
0
is None: logger.warning(f"No appropriate credentials found for profile '{profile_name}'. " f"Skip exporting it. Use --trace flag to see possible error causes.") return pyperclip_spec = importlib_util.find_spec("pyperclip") pyperclip_found = pyperclip_spec is not None ...
Python
1
, _args) { // The shard manager is an interface for mutating, stopping, restarting, and // retrieving information about shards. let data = ctx.data.lock(); let shard_manager = match data.get::<ShardManagerContainer>() { Some(v) => v, None => { let _ = msg.reply("There was a ...
Rust
0
const _ as u64); let start = VirtAddr::new(map.addr() as u64); let pdpte = self.hook.to_guest_phys(pml3t_ident_addr, start); pml4t[0].set_addr(pdpte, Flags::WRITABLE | Flags::PRESENT); let pml3t_addr = self.hook.to_guest_phys(start, start); let flags = Flags::HUGE_PAGE | Flags::...
Rust
0
and horizon. let height_on_screen = (height - depth as f32) * rscale + horizon; let height_on_screen = height_on_screen as i32; // Clamp against y-buffer to make sure more distant landscape doesn't // render over closer parts that have already been drawn....
Rust
0
, " "out_normals_to_vert_faces, normals_to_vert_faces, " "out_normals_to_horiz_faces)" in gen) assert LFRicBuild(tmpdir).code_compiles(psy) def test_all_faces_refelem_gen(tmpdir): ''' Test for code-generation for an invoke containing a single kernel requiring all faces of reference...
Python
1
_void; pub type IconSourceElement = *mut ::core::ffi::c_void; pub type Image = *mut ::core::ffi::c_void; #[doc = "*Required features: `\"UI_Xaml_Controls\"`*"] #[repr(transparent)] pub struct IncrementalLoadingTrigger(pub i32); impl IncrementalLoadingTrigger { pub const None: Self = Self(0i32); pub const Edge: ...
Rust
0
) - 1): self.lod[0].append(offset_lod[0][i + 1] - offset_lod[0][i]) self.output_representation = 8 # output feature size support_types = get_xpu_op_support_types('sequence_conv') for stype in support_types: create_test_class(globals(), XPUTestSequenceConv, stype) class TestSeqConvAp...
Python
1
# -*- coding: utf-8 -*- # # Copyright 2025 Google LLC. All Rights Reserved. # # 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 requir...
Python
1
= df if inplace else df.copy() pat = re.compile("[0-9]{21}_") if UCSF.IMAGE_PATH in df: df[UCSF.IMAGE_PATH] = df[UCSF.IMAGE_PATH].str.replace(pat, "", regex=True, n=count) elif Relion.IMAGE_NAME in df: df[Relion.IMAGE_NAME] = df[Relion.IMAGE_NAME].str.replace(pat, "", regex=True, n=count) ...
Python
1
e_rst_en::CORE_RST_EN_SPEC>, #[doc = "0xd4 - "] pub bt_lpck_div_int: crate::Reg<bt_lpck_div_int::BT_LPCK_DIV_INT_SPEC>, #[doc = "0xd8 - "] pub bt_lpck_div_frac: crate::Reg<bt_lpck_div_frac::BT_LPCK_DIV_FRAC_SPEC>, #[doc = "0xdc - "] pub cpu_intr_from_cpu_0: crate::Reg<cpu_intr_from_cpu_0::CPU_IN...
Rust
0
&dyn Display { /// ptr.unsize(Coercion::to_display()) /// } /// ``` fn to_display() -> core::fmt::Display ); #[cfg(rustc_1_51)] impl<T, const N: usize> Coercion<[T; N], [T]> { /// Create a coercer that unsizes an array to a slice. /// /// # Usage /// /// ``` /// use unsize:...
Rust
0
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. # Copyright 2023 The vLLM team. # # # 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/license...
Python
1
"?><a><b/><b/></a>"#, Span::test_data(), ); let spanned_str: Spanned<String> = Spanned { item: "count(//a/*[position() = 2])".to_string(), span: Span::test_data(), }; let actual = query("", &call, &text, Some(spanned_str)).expect("test should not fai...
Rust
0
Ok(()) } #[pyfunction(name = "__excepthook__")] #[pyfunction] fn excepthook( exc_type: PyObjectRef, exc_val: PyObjectRef, exc_tb: PyObjectRef, vm: &VirtualMachine, ) -> PyResult<()> { let exc = vm.normalize_exception(exc_type, exc_val, exc_tb)?; l...
Rust
0
# Get the selected points and labels point_clouds = point_clouds[:, ind].unsqueeze(0).to(args.device) # Check the dimensionality of labels and perform the indexing accordingly if len(labels.size()) == 1: labels = labels.to(torch.long) elif len(labels.size()) == 2: ...
Python
1
closed_issues/issue_77.rs<gh_stars>100-1000 //! Tests auto-converted from "sass-spec/spec/libsass-closed-issues/issue_77.hrx" #[allow(unused)] fn runner() -> crate::TestRunner { super::runner() } #[test] fn test() { assert_eq!( runner().ok("@mixin m {\r\ \n .m {\r\ \n col...
Rust
0
4096]) else: bot.send_message(message.chat.id, tokeninfo) except: bot.send_message(message.chat.id, "🚫 No Tokens.🚫 ") print('[red] No Tokens[/red]') if txs > ...
Python
1
include their ID in the `on-behalf-of` header in the request. * * **Parameters:** * * * `on_behalf_of: &str` -- The license key provided with your New Relic account. */ pub async fn post_whitelabel_link( &self, body: &crate::types::PostWhitelabelLinksRequest, ) -> Resul...
Rust
0
bra_network_rpc_bytes", "Libra network rpc bytes histogram", &["type", "state"] ).unwrap(); pub static ref LIBRA_NETWORK_RPC_LATENCY: Histogram = register_histogram!( "libra_network_rpc_latency_seconds", "Libra network rpc latency histogram" ).unwrap(); pub static ref L...
Rust
0
# author: Bartlomiej "furas" Burek (https://blog.furas.pl) # date: 2022.04.05 # [python - WebScraping Application - Stack Overflow](https://stackoverflow.com/questions/71745973/webscraping-application/) from bs4 import BeautifulSoup import requests html_text = requests.get('https://au.jora.com/jobs-in-Maryborough...
Python
1
from typing import Any import re, os, shutil, imghdr from hashlib import md5 import os _request_headers_dict = {"User-Agent": "Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.1.6) ", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "...
Python
1
value["usage_date"] = Value::from(date.timestamp()); } else if self.prng.gen_bool(0.15) { value["usage_date"] = Value::from(date.to_rfc2822()); } } fn add_image(&mut self, value: &mut Value) { if self.prng.gen_bool(0.4) { value["account"]["profile_picture"]...
Rust
0
4\x12\x02\x01\x04\ \x12\x03{\x08\x10\n\x0c\n\x05\x04\x12\x02\x01\x06\x12\x03{\x11\x15\n\x0c\ \n\x05\x04\x12\x02\x01\x01\x12\x03{\x16\x1b\n\x0c\n\x05\x04\x12\x02\x01\ \x03\x12\x03{\x1e\x1f\n+\n\x02\x04\x13\x12\x05\x7f\0\x84\x01\x01\x1a\x1e\ \x20Sync\x20is\x20network\x20sync\x20message\n\n\n\n\x03\x04\x13...
Rust
0
_system(mut diagnostics: ResMut<Diagnostics>, assets: Res<Assets<T>>) { diagnostics.add_measurement(Self::diagnostic_id(), assets.len() as f64); } } // Copyright (c) 2019 - 2020 ESRLabs // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in complianc...
Rust
0
# The Leginon software is Copyright under # Apache License, Version 2.0 # For terms of the license agreement # see http://leginon.org # # $Source: /ami/sw/cvsroot/pyleginon/intensitycalibrator.py,v $ # $Revision: 1.11 $ # $Name: not supported by cvs2svn $ # $Date: 2007-05-22 19:21:07 $ # $Author: pulokas $ # $State: Ex...
Python
1
any borrows there were. _ => { let derefs = copy tystr; let tmptystr = ppaux::ty_to_str(tcx, t); lvar.alterations = Some((tystr + tmptystr, derefs)); lvar.ty = tmptystr; ...
Rust
0
.") .width(Length::Fill) .size(100) .color([0.5, 0.5, 0.5]) .horizontal_alignment(HorizontalAlignment::Center); Container::new(title) .width(Length::Fill) .height(Length::Fill) ...
Rust
0
_overridden_02(self): set_module_args(self.fixture_data['overridden_02']['module_args']) self.initialize_facts_get_requests(self.fixture_data['overridden_02']['existing_ptp_port_ds_config']) self.initialize_config_requests(self.fixture_data['overridden_02']['expected_config_requests']) r...
Python
1
e/pytube/issues/1954 check_requirements("pytubefix>=6.5.2") from pytubefix import YouTube streams = YouTube(url).streams.filter(file_extension="mp4", only_video=True) streams = sorted(streams, key=lambda s: s.resolution, reverse=True) # sort streams by resolution for stream in ...
Python
1
3', 'RIDRETH1'], inplace=True) elif 'RIDRETH3' in df.columns: race_col = df['RIDRETH3'] df.drop(columns=['RIDRETH3'], inplace=True) else: race_col = df['RIDRETH1'] df.drop(columns=['RIDRETH1'], inplace=True) df['RIDRETH_merged'] = race_col return df def preprocess_nhan...
Python
1
""" Example 1 - Decorating Trees from Scratch Copyright (c) 2025 Haig Bishop MIT License (see LICENSE file for details) This example demonstrates decorating a tree with RED values: 1. Load the original Newick tree files (.tree) into a RedTree object 2. Decorate the trees with calculated RED values 3. Write the decor...
Python
1
link. """ return pulumi.get(self, "name") @_builtins.property @pulumi.getter def project(self) -> pulumi.Output[_builtins.str]: """ The ID of the project in which the resource belongs. If it is not provided, the provider project is used. """ return pu...
Python
1
* 60 * 60), $pts / (90000 * 60) % 60, $pts / 90000 % 60, $pts % 90000 ) }; } /// Program clock reference (PCR) for synchronizing the decoder with the encoder. /// /// Periodically sent for every program contained in the transport stream. #[derive(Default, Copy, Clone)] p...
Rust
0
import requests import schedule import threading import time from datetime import datetime # -- coding: utf-8 -- # Configuración inicial NESSUS_URL = "https://<TU_NESSUS_URL>" # Reemplaza con la URL de tu instancia de Nessus ACCESS_KEY = "<TU_ACCESS_KEY>" # Reemplaza con tu Access Key SECRET_KEY = "<TU_SECRE...
Python
1
import dataclasses from typing import Dict, List, Tuple, Union from configs2 import activity_class_num, data_count, gram_channel_num @dataclasses.dataclass class NetworkConfiguration: """Network hyper-parameters.""" activator_type: str = 'leaky_relu' # soft plus for fc activator_negative_slope: float = ...
Python
1
julian_day: jd, time_type: TimeType::UT, }), } } else { Builder { target: Err(AstroAlgorithmsError::RangeError(DateRangeError::DateUnderflow(jd, ...
Rust
0
gnature); assert!(res.is_ok()); assert!(res.unwrap()); let res = keypair.public_key.verify(&[0u8, 0u8], &signature); assert!(res.is_err()); } /// Soft ECDSA key create from external representation #[test] fn export_and_import_ecdsa_keys() { let acl = AccessControl::create_with_flags(AttrAcc...
Rust
0
#!/usr/bin/env python import re from setuptools import setup def fread(filepath): with open(filepath) as f: return f.read() def version(): content = fread('livereload/__init__.py') pattern = r"__version__ = '([0-9\.dev]*)'" m = re.findall(pattern, content) return m[0] setup( name=...
Python
1
= hash_hashes(&vec![data_hash, zero_hash], 1, 0); assert_eq!(hash_of_single_hash, hash_of_single_hash_and_zero_hash); } } extern crate ta_lib_wrapper; use ta_lib_wrapper::{TA_Integer, TA_Real, TA_ATR, TA_RetCode}; /// Compute ATR(period) /// This function returns a tuple containing the list of ATR value...
Rust
0
IQUIDATION_CLOSE_FACTOR: u8 = 50; /// Obligation borrow amount that is small enough to close out pub const LIQUIDATION_CLOSE_AMOUNT: u64 = 2; /// Lending market reserve state #[derive(Clone, Debug, Default, PartialEq)] pub struct Reserve { /// Version of the struct pub version: u8, /// Last slot when supp...
Rust
0
environment') parser.add_argument('zip_path', help='Path to the zip file to analyze') parser.add_argument('--extract-path', help='Path to extract files if no threats found') args = parser.parse_args() explorer = SafeZipExplorer() try: file_list, threats = explorer.analyze_zip(args.zip...
Python
1
oss{results[0]}") if __name__ == "__main__": start_time = time.time() config = get_config() if torch.cuda.is_available(): config['device'] = torch.device('cuda:%d'%(config['device'])) else: config['device'] = torch.device('cpu') print("Device: ", config['devi...
Python
1
e plot if args.show_gui: GUI.display_translation_info(img=img_info, tvec=realworld_tvec, tvec_d=desired_realworld_tvec) GUI.display_rotation_info(img=img_info, euler=estimated_euler_angles, euler_d=desired_euler_angles) GUI.display_interpretation(img=img_info...
Python
1
import requests from bs4 import BeautifulSoup import time import random def get_job_location(soup): try: job_location = soup.findAll('div',{'class','t3 mb-0'}) job_location = job_location[3].text job_location = job_location.replace(' ', '') except: try: job_location =...
Python
1
ffd}world\u{fffd}\n"); } #[test] fn test_ff() { test(b"\x0c", " \n"); test(b"\x0chello\x0cworld\x0c", " hello world \n"); } #[test] fn test_del() { test(b"\x7f", "\u{fffd}\n"); test( b"\x7fhello\x7fworld\x7f", "\u{fffd}hello\u{fffd}world\u{fffd}\n", ); } #[test] fn test_non_text_c...
Rust
0
# -------------------------------------------------------- # X-Decoder -- Generalized Decoding for Pixel, Image, and Language # Copyright (c) 2022 Microsoft # Licensed under The MIT License [see LICENSE for details] # Modified by Xueyan Zou (xueyan@cs.wisc.edu) # --------------------------------------------------------...
Python
1
import sys # http://www.unicode.org/Public/UNIDATA/auxiliary/BidiMirroring.txt # This parses a file in the format of the above file and outputs a table # suitable for bsearch(3). This table maps Unicode code points to their # 'mirror'. (Mirroring is used when rendering RTL characters, see the Unicode # standard). By ...
Python
1
import numpy as np import random import SharedArray as SA import torch from util.voxelize import voxelize def sa_create(name, var): x = SA.create(name, var.shape, dtype=var.dtype) x[...] = var[...] x.flags.writeable = False return x def collate_fn(batch): """ Args: batch - [(xyz, fe...
Python
1
unknown')}: {e}" ) return None # CLI Interface @click.command() @click.option( "--scraped-dir", "-s", default="./vulnerability_rules", help="Directory with scraped rules", ) @click.option( "--output", "-o", default="data/trivy_rules_db.json", help="Output data...
Python
1
"""Test VoIP devices.""" from __future__ import annotations from voip_utils import CallInfo from homeassistant.components.voip import DOMAIN from homeassistant.components.voip.devices import VoIPDevice, VoIPDevices from homeassistant.core import HomeAssistant from homeassistant.helpers import device_registry as dr ...
Python
1
)] pub fn standard() -> Config { Config { cases: 10_000, max_global_rejects: 5_000, .. Config::default() } } /// /// A configuration with choice of cases and rejects. /// #[cfg(test)] pub fn config_with(cases: u32, rejects: u32) -> Config { Config { cases: cases, max_global_rejects: rejects, .. standard...
Rust
0
ng,cāng"), ('凕', "mǐng"), ('凖', "zhǔn"), ('凗', "cuī"), ('凘', "sī"), ('凙', "duó"), ('凚', "jìn"), ('凛', "lǐn"), ('凜', "lǐn"), ('凝', "níng"), ('凞', "xī"), ('凟', "dú"), ('几', "jǐ,jī"), ('凡', "fán"), ('凢', "fán"), ('凣', "fán"), ('凤', "fèng"), ('凥', "jū"), ...
Rust
0
# -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. { 'name': 'Newsletter Subscribe Button', 'summary': 'Attract visitors to subscribe to mailing lists', 'description': """ This module brings a new building block with a mailing list widget to drop on any page ...
Python
1
q.dequeue(lft_rec); (*lft_rec).freq += 1; (*lft_rec).loc = lft_pos; q.enqueue(lft_rec); } else { let lft_rec = Box::into_raw(Box::new(Record {loc: lft_pos, freq...
Rust
0
e token ``jti`` field. token_extras: An optional dictionary to include in the token ``extras`` field. send_token_as_response_body: If ``True`` the response will be an oAuth2 token response dict. Note: if a response body is passed this setting will be ignored. Returns: ...
Python
1
: "@dmarcos"}, # Add other Web implementations here ], "WebAssembly": [ {"name": "icpp-llm", "url": "https://github.com/icppWorld/icpp-llm"}, # Add other WebAssembly implementations here ], "Fortran": [ {"name": "llama2.f90", "url": "https://github.com/rbitr/llama2.f90"},...
Python
1
removed_bytes += 1; self.serialization.push_str(&after_username[1..]); } (false, Some('@')) | (_, Some(':')) | (true, _) => { self.serialization.push_str(&after_username); } (false, _) => { added_bytes += 1; ...
Rust
0
import asyncio import subprocess import sys from narada import Narada from narada.config import BrowserConfig async def launch_browser(config: BrowserConfig) -> None: browser_args = [ f"--user-data-dir={config.user_data_dir}", f"--profile-directory={config.profile_directory}", f"--remote-...
Python
1
one; } }; } #[fasync::run_singlethreaded] async fn main() -> Result<(), Error> { // Visit the directory /hub and recursively traverse it, outputting information about the // component hierarchy. See https://fuchsia.dev/fuchsia-src/concepts/components/hub for more // information on the Hub direc...
Rust
0
import streamlit as st from streamlit_searchbox import st_searchbox from models.datasource.yahoo_datasource import search_service from utils.plugins import obtener_plugins import utils.set_logo as set_logo set_logo.set_logo() # 1) Inicializa contadores y selección en session_state if "refresh_counter" not in st.sessi...
Python
1
date: 开始日期 :type start_date: str :param end_date: 结束日期 :type end_date: str :return: 指数分析 :rtype: pandas.DataFrame """ url = "https://www.swsresearch.com/institute-sw/api/index_analysis/index_analysis_report/" params = { "page": "1", "page_size": "50", "index_type"...
Python
1
se(open(os.path.join(data_file_path,"labels.csv"), 'rb').read()) response['Content-Type'] = 'application/octet-stream' response['Content-Disposition'] = 'attachment; filename="exported_trace_lables.csv"' return response def anomaly_period(request): LabelEase.anomaly_period.main(out_p...
Python
1
pub fn WebPAnimDecoderReset(dec: *mut WebPAnimDecoder); #[cfg(feature = "0_5")] #[cfg_attr( feature = "__doc_cfg", doc(cfg(all(feature = "demux", feature = "0_5"))) )] pub fn WebPAnimDecoderGetDemuxer(dec: *const WebPAnimDecoder) -> *const WebPDemuxer; #[cfg(feature = "0_5")] ...
Rust
0
#!/usr/bin/env python3 # roman-to-integer # 罗马数字转整数 """ * 特殊case * IV 5 - 1 * IX 10 - 1 * XL 50 - 10 * XC 100 - 10 * CD 500 - 100 * CM 1000 - 100 * r_d = { "I" : 1, "V" : 5, "X" : 10, "L" : 50, "C" : 100, "D" : 500, "M" : 1000, } * 特殊case,需要将对应前一个字符数字减去,并且将字符对应整数从结果 list 中去除 """ # # @lc app...
Python
1
Route::CreateMessage { channel_id: self.channel_id.0, }, )) } else { let mut form = Form::new(); for (index, (name, file)) in self.attachments.drain().enumerate() { form = fo...
Rust
0
::InvalidVault)?; check!(msrm_vault.delegate.is_none(), MangoErrorCode::InvalidVault)?; check!(msrm_vault.close_authority.is_none(), MangoErrorCode::InvalidVault)?; check_eq!(msrm_vault.owner, mango_group.signer_key, MangoErrorCode::InvalidVault)?; check_eq!(&msrm_vault.m...
Rust
0
import pytz from datetime import datetime import hoshino from hoshino import Service, priv sv_help = ''' 整点报时啦~ · 默认禁用 '''.strip() sv = Service( name = '时报', #功能名 use_priv = priv.NORMAL, #使用权限 manage_priv = priv.ADMIN, #管理权限 visible = True, #False隐藏 enable_on_default = False, #是否默认启用 bundl...
Python
1
} # Adjust mapping logic if additional columns exist if len(cell_data) > 17: entry["Extra"] = cell_data[ 17: ] # Store extra columns if present ...
Python
1
def input_matrix(length,list,col): for i in range(length): x=[] x.append(input().split()) list.append(input().split()) if len(x)!= col: print("Invalid Matrix") return False break else: continue return True dimensions=input(...
Python
1
x9e\x06N\xeadDD~\x1dr\xe0 A\x82\x98\x9a\ \xa9YS\x8b^\xf5\xc5\xbf\x90\xf07\x0a\x91H\x14a\ \x0f\xff\x9a\xd8>\xaf\xf6\x83\x1b\xc7\xdc*\xed\x06\x1f\xb3\ \xdb\x81\xfe\xf5\xd6\x833\xb4m\xd3P\xfa\xcd\xfc\x0b3\ ]\x93G\xdd\x01\x8b\x128\xa1{4\x0b\x037\xab\x95\ \xe7\xa1\xad\xd7\xeb\xd5z\x95\xee\xc2]\x07\xaf\xe4\xe6\xfb\ \xd9\xab\...
Python
1
Request, BlocksByRootRequest, GoodbyeReason, RequestId}; use eth2_libp2p::{Client, NetworkGlobals, PeerAction, PeerId, Request}; use fnv::FnvHashMap; use slog::{debug, trace, warn}; use std::sync::Arc; use tokio::sync::mpsc; use types::EthSpec; /// Wraps a Network channel to employ various RPC related network function...
Rust
0
', default=False, help='Deprecated. Please use cg_server instead.', action='store_true') opts = parser.parse_args() if opts.cloud_gaming: opts.cg_server = True if not opts.sio_root and not opts.cg_server: print("sio_root is missing.") return 1 if opts.gn_g...
Python
1
import streamlit as st st.set_page_config(page_title="ABM App", page_icon="https://media.licdn.com/dms/image/v2/C4E0BAQEUNQJN0rf-yQ/company-logo_200_200/company-logo_200_200/0/1630648936722/kalungi_inc_logo?e=2147483647&v=beta&t=4vrP50CSK9jEFI7xtF7DzTlSMZdjmq__F0eG8IJwfN8") # --- PAGE SETUP --- about_page = st.Page(...
Python
1
deo_transforms.CenterCropResizeVideo(256), # video_transforms.RandomHorizontalFlipVideo(), transforms.Normalize(mean=[0.5, 0.5, 0.5], std=[0.5, 0.5, 0.5], inplace=True) ]) taichi_dataset = SkyImages(config, transform=trans, temporal_sample=temporal_sample) print(len(taichi_dataset)) tai...
Python
1
Goal::Implies(dg, subgoal) => HhGoal::Implies(dg, *subgoal), Goal::And(g1, g2) => HhGoal::And(*g1, *g2), Goal::Not(g1) => HhGoal::Not(*g1), Goal::Leaf(LeafGoal::EqGoal(EqGoal { a, b })) => HhGoal::Unify((), a, b), Goal::Leaf(LeafGoal::DomainGoal(domain_goal)) => HhGoal...
Rust
0
.host_str().ok_or(anyhow!("Invalid url: {}", url))?; let mut path_segments = url .path_segments() .ok_or(anyhow!("Invalid url: {}", url))? .map(|s| s.to_string()) .collect::<Vec<_>>(); path_segments.pop(); path_segments.pop(); path_segments...
Rust
0
round_float64(a: f64) -> f64 { // f64::round violates IEEE 754 by rounding ties away from zero rather than // to nearest even. There appears to be no way to round ties to nearest even // in Rust natively, so bail out to C. extern "C" { fn rint(f: f64) -> f64; } ...
Rust
0
0 for worker in workers: if worker._shutdown: worker.dispose() workers.remove(worker) cv2.destroyWindow(args.sources_names[i]) args.sources_names.remove(args.sources_names[i]) i -= 1 ...
Python
1
l(payload)?; } else { write!(writer, "\r\n")?; } Ok(()) } fn decode<'a>(&self, reader: impl Read + 'a) -> io::Result<Response<Box<dyn BufRead + 'a>>> { let mut reader = BufReader::new(reader); // Let's read the headers let mut buffer = Vec::new(); ...
Rust
0
# SPDX-FileCopyrightText: 2020 Lukas Schrangl <lukas.schrangl@tuwien.ac.at> # # SPDX-License-Identifier: BSD-3-Clause import unittest import os import numpy as np from sdt.loc import bg_estimator from sdt.loc.daostorm_3d import find from sdt.loc.daostorm_3d.data import col_nums path, f = os.path.split(os.path.absp...
Python
1
hingBracketHighlighter}, hint::{Hinter, HistoryHinter}, Cmd, CompletionType, Config, EditMode, Editor, Helper, KeyPress, }; use rustyline_derive::Validator; use std::{ borrow::Cow::{self, Owned}, collections::HashSet, env, fs, io::{Read, Write}, net::{self, ToSocketAddrs}, }; static PROMPT:...
Rust
0
(None)).await; assert_eq!("".to_string(), output); Ok(()) } #[fuchsia_async::run_singlethreaded(test)] async fn test_list_with_one_device_and_no_nodename() -> Result<()> { let output = run_list_test(1, tab_list_cmd(None)).await; let value = format!("Test {}", 0); let...
Rust
0
readdir), //"fd_renumber" => func!(fd_renumber), //"fd_seek" => func!(fd_seek), //"fd_sync" => func!(fd_sync), //"fd_tell" => func!(fd_tell), "fd_write" => func!(fd_write), //"path_create_directory" =...
Rust
0
lize, Deserialize)] pub struct WorkbookRangeFormat { #[serde(rename = "columnWidth")] pub column_width: i64, #[serde(rename = "horizontalAlignment")] pub horizontal_alignment: String, #[serde(rename = "rowHeight")] pub row_height: i64, #[serde(rename = "verticalAlignment")] pub vertical_...
Rust
0
# -*- coding: utf-8 -*- import logging from lncrawl.core.crawler import Crawler logger = logging.getLogger(__name__) class LunarLetters(Crawler): base_url = "https://lunarletters.com/" def read_novel_info(self): logger.debug("Visiting %s", self.novel_url) soup = self.get_soup(self.novel_url)...
Python
1