text
string
label_name
string
labels
int64
0%; height:100%"></div> </body> </html>''' file = fileUtils(self.htmlfile,content) file.run() logging.debug("<<") def createErrorHtml(self): logging.debug(">>") content = '''<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1...
Python
1
'cup'].values[0], 2) df_res['w3'] = round(avg_cup_num.loc[avg_cup_num.week_label == 'W3', 'cup'].values[0], 2) df_res['w4'] = round(avg_cup_num.loc[avg_cup_num.week_label == 'W4', 'cup'].values[0], 2) # 加入基础信息 log.debug('模拟基础信息加入') df_res['material_type'] = self.material_type ...
Python
1
()).max().unwrap(); let light_blocks = light_blocks .into_iter() .map(|lb| (lb.height(), lb)) .collect(); Self { chain_id, light_blocks, latest_height, } } } impl Io for MockIo { fn fetch_light_block(&self, height...
Rust
0
import sys TEXT = """ Введите номер предмета 1.Математика 2.Физика 3.Инофрматика 4.Химия 5.Русский язык 6.Биология 7.Английский язык 8.География 9.Немецкий 10.Обществознание 11.Французский 12.Литература 13.Испансикй 14.История """ SUBJECTS = {1: "math", 2:"phys", 3:"inf", ...
Python
1
ple[Tensor, float]: * **avg_influence** (*Tensor*): shape ``[k+1]`` if :obj:`average=True`; shape ``[N, k+1]`` otherwise. * **R** (*float*): Influence‑weighted receptive‑field breadth returned by :func:`influence_weighted_receptive_field`. Example::...
Python
1
https://eprint.iacr.org/2015/267/20180529:135402>, Page 4): if the value //! `x^i` produced by the receiver is not randomized, all the random-OTs //! produced by the protocol will be the same. We fix this by hashing in `i` //! during the key derivation phase. use crate::{ errors::Error, ot::{Receiver as OtRece...
Rust
0
return bias_input = last_add_node.input[1 - self.input_index(mul_node.output[0], last_add_node)] if not self.is_constant_with_specified_rank(bias_input, 1): return self.nodes_to_remove.extend(subgraph_nodes) normalize_node = onnx.helper.make_node( ...
Python
1
import platform, subprocess from pathlib import Path def setup_gpg_signing(gpg_keygrip: str, gpg_password: str): if platform.system() == "Windows": print( "WARNING: Setup for gpg signing not implemented on Windows. Considering it done..." ) return # Caching password must b...
Python
1
= to_pos!(Node::Str { lit: String::from("a"), expressions: vec![] }); let print_stmt = to_pos!(Node::Return { expr }); assert_eq!(desugar(&print_stmt).unwrap(), Core::Return { expr: Box::from(Core::Str { string: String::from("a") }) }); } #[test] fn return_empty_verify() { let print_stmt = to...
Rust
0
IOPE, IOPF, IOPG, ADC1, ADC2, TIM1, SPI1, TIM8, USART1, ADC3, TIM9 = 19, TIM10, TIM11, } #[repr(C, packed)] struct Registers { cr: VolatileCell<u32>, cfgr: VolatileCell<u32>, cir: VolatileCell<u32>, apb2rstr: VolatileCell<u32>, apb1rstr: VolatileCell<...
Rust
0
omputer_count} points" # Display the result cv2.putText(right_img, result, (30, 200), cv2.FONT_HERSHEY_SIMPLEX, 1.5, (0, 0, 255), 2) else: # No hand detected, display appropriate message result = "No hand detected....." cv2.put...
Python
1
import re with open('src/tests.rs', 'r') as f: content = f.read() # Map of message types to their expected MessageBody variant replacements = [ ('Logon::parse(msg)', 'parse_message(msg).body', 'MessageBody::Logon(logon)'), ('Logout::parse(msg)', 'parse_message(msg).body', 'MessageBody::Logout(logout)'), ...
Python
1
(): gr.Markdown("### 📋 可用场景列表") # 构建场景信息文本 scene_list_lines = ["**可用场景:**", ""] for scene_name, scene_info in AVAILABLE_SCENES.items(): scene_list_lines.append(f"**{scene_name}**: {scene_info.ge...
Python
1
import numpy as np from tbats.bats import Components, Case, Context class TestBATSCase(object): def create_case(self, **components): return Case(Components(**components), Context()) def test_fit_only_alpha(self): alpha = 0.7 np.random.seed(333) T = 200 l = 1 ...
Python
1
import httpx import json import asyncio import ssl import os from pathlib import Path # Configuração para HTTP/2 HTTP2_ENABLED = False # Altere para True para usar HTTP/2 (requer certificados TLS) BASE_URL = "https://localhost:4433/api" if HTTP2_ENABLED else "http://localhost:8000/api" async def fazer_requisicao_htt...
Python
1
h(); let mut resp = HttpResponse::build(actix_web::http::StatusCode::OK).json(json!(true)); resp.add_cookie(&cookie).unwrap(); Ok(resp) }, Err(err) => Ok(HecateError::from(err).error_response()) }) } fn user_delete_session( conn: web::Data<DbReadWrite>, ...
Rust
0
() == ClapErrorKind::ArgumentNotFound => {} Err(err) => err.exit(), } match matches.value_of_t::<IpAddr>("OUTBOUND_BIND_ADDR") { Ok(bind_addr) => config.outbound_bind_addr = Some(bind_addr), Err(ref err) if err.kind() == ClapErrorKind::ArgumentNotFound => {} ...
Rust
0
{ let id = self.read_character_id()?; let bounds = self.read_rectangle()?; let flags = self.read_u8()?; let flags2 = self.read_u8()?; let font_id = if flags & 0b1 != 0 { Some(self.read_character_id()?) } else { None }; let font_clas...
Rust
0
ValueLabelsRanges, PrimaryMap<DefinedFuncIndex, ir::StackSlots>, ); struct Sha256Hasher(Sha256); impl<'config> ModuleCacheEntry<'config> { pub fn new<'data>( module: &Module, function_body_inputs: &PrimaryMap<DefinedFuncIndex, FunctionBodyData<'data>>, isa: &dyn isa::TargetIsa, ...
Rust
0
:HSMCI_WPMR_SPEC>; #[doc = "Write Protection Mode Register"] pub mod hsmci_wpmr; #[doc = "HSMCI_WPSR register accessor: an alias for `Reg<HSMCI_WPSR_SPEC>`"] pub type HSMCI_WPSR = crate::Reg<hsmci_wpsr::HSMCI_WPSR_SPEC>; #[doc = "Write Protection Status Register"] pub mod hsmci_wpsr; #[doc = "HSMCI_FIFO register access...
Rust
0
txn submission requests", &["network", "sender"] // sender of txn(s) ) .unwrap() }); pub fn process_txn_submit_latency_timer(network: &str, sender: &str) -> HistogramTimer { PROCESS_TXN_SUBMISSION_LATENCY .with_label_values(&[network, sender]) .start_timer() } /// Tracks latency o...
Rust
0
:new)?; stream.get_mut().set_nonblocking(true)?; Ok(Self::TlsStream(Box::from(BufStream::new(stream)))) } else { conn.set_nonblocking(true)?; Ok(Self::Stream(BufStream::new(conn))) } } fn reader(&mut self) -> &mut dyn Read { match self { ...
Rust
0
# Generated by Django 3.2.22 on 2023-10-24 17:25 import django.core.validators from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('sync', '0019_add_delete_removed_media'), ] operations = [ migrations.AddField( model_name='source...
Python
1
_os = "windows"))] let network_frames = network_interfaces .iter() .filter(|iface| !iface.ips.is_empty()) .map(|iface| (iface, get_datalink_channel(iface))); #[cfg(not(target_os = "windows"))] let network_frames = network_interfaces .iter() .filter(|iface| iface.is_up...
Rust
0
= self._num_neighbors saving_dict['_implicit'] = self._implicit return saving_dict def set_model_state(self, saving_dict): self._preds = saving_dict['_preds'] self._similarity = saving_dict['_similarity'] self._num_neighbors = saving_dict['_num_neighbors'] self._imp...
Python
1
def remove_chars(item): return item[1:-1] friends_map = ["AEmanS", "AAhmedS", "DSamehF", "LOsamaL"] cleaned_list = map(remove_chars, friends_map) for item in cleaned_list: print(item) print("-"*50) #################### use lambda function #################### for item in map(lambda item: item[1:-1], frien...
Python
1
# Import necessary libraries import ftplib import requests from PIL import Image import io from bs4 import BeautifulSoup from datetime import datetime # Get Met Office Data and Strip Today/Tonight Text url = 'http://datapoint.metoffice.gov.uk/public/data/txt/wxfcs/regionalforecast/xml/512?key=YOURMETOFFICEAPIKEY' docu...
Python
1
This function sets the proper values for self.xcoords and self.ycoords. """ def onclick(event): if event.button is MouseButton.LEFT: pass else: global ix, iy ix, iy = event.xdata, event.ydata xcoords.append...
Python
1
_header_2b(addr: u16, block: u8, mode: AccessMode) -> [u8; HEADER_LEN] { [ (addr >> 8) as u8, addr as u8, (block << 3) | ((mode as u8) << 2) | 0b10, ] } /// Helper to create a 4 byte fixed data length SPI header. /// /// # Example /// /// SPI header to read the UIPR register in fixed da...
Rust
0
# A vuetify layout for the glue data viewers. For now we keep this isolated to # a single file, but once we are happy with it we can just replace the original # default layout. import ipyvuetify as v import traitlets from ipywidgets import widget_serialization __all__ = ['vuetify_layout_factory'] class LayoutWidget...
Python
1
import kagglehub import shutil import os def download_fifa_dataset(): """ Downloads the FIFA 23 dataset from Kaggle and moves it to the 'data' folder as 'fifa23.csv'. """ target_folder = "data" os.makedirs(target_folder, exist_ok=True) # Define target path for the CSV file target_path = os...
Python
1
th=Path("/path/to/file/my_file.py"), source_tree=source_tree ) assert len(occurrences) == 1 assert occurrences[0] == Occurrence( filename="my_file.py", file_path=Path("/path/to/file/my_file.py"), line_number=1, rule_id=AvoidTypeHintsInVariableNamesAsSuffix.RULE_ID, r...
Python
1
import sys sys.setrecursionlimit(3000) def f(n): if n < 10: return n - 1 elif n % 2 == 0: return 3 * n - 1 + f(n - 3) else: return 5 * n + 2 + f(n - 4) print(f(4445) - f(4444))
Python
1
import torch import numpy as np from sklearn.metrics import accuracy_score, f1_score, mean_absolute_error from scipy.stats import pearsonr def compute_accuracy(y_true, y_pred_prob): accuracy = accuracy_score(y_true, y_pred_prob) return accuracy def compute_f1_score(y_true, y_pred_prob, average): f1 = 0....
Python
1
#!/usr/bin/env python3 import sys import argparse import os.path from getpass import getpass try: from . import lsb except: import lsb def main(): parser = argparse.ArgumentParser( description="Simple steganography program based on the LSB method." ) parser.add_argument( "a", hel...
Python
1
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. from __future__ import annotations from typing import Union from typing_extensions import Required, TypeAlias, TypedDict from ..graders.multi_grader_param import MultiGraderParam from ..graders.python_grader_param import PythonGrad...
Python
1
IP", default, skip_serializing_if = "Option::is_none")] pub dns_service_ip: Option<String>, #[serde(rename = "dockerBridgeCidr", default, skip_serializing_if = "Option::is_none")] pub docker_bridge_cidr: Option<String>, #[serde(rename = "outboundType", default, skip_serializing_if = "Option::is_none")] ...
Rust
0
let mut vary: Option<Vary>; vary = Header::parse_header([b"*".to_vec()].as_ref()); assert_eq!(vary, Some(Vary::Any)); vary = Header::parse_header([b"etag,cookie,allow".to_vec()].as_ref()); assert_eq!(vary, Some(Vary::Items(vec!["eTag".parse().unwrap(), ...
Rust
0
from securityheaders.models import SecurityHeader from securityheaders.models.xxssprotection import XXSSProtectionDirective from securityheaders.models.annotations import * @requiredheader @description('This header sets the configuration for the cross-site scripting filter built into most browsers. The recommended val...
Python
1
#!/usr/bin/env python # -*- coding: UTF-8 -*- ''' @Project: NarratoAI @File : audio_config @Author : Viccy同学 @Date : 2025/1/7 @Description: 音频配置管理 ''' from typing import Dict, Any from loguru import logger class AudioConfig: """音频配置管理类""" # 默认音量配置 DEFAULT_VOLUMES = { 'tts_volume': 0.8,...
Python
1
b-c"), split_once("a-b-c", "-")); assert_eq!(("a", "-b"), split_once("a--b", "-")); } }//! Formats a C0 CST. #![deny(missing_debug_implementations)] #![deny(missing_docs)] #![deny(rust_2018_idioms)] #[cfg(test)] mod tests; mod expr; mod item; mod root; mod simp; mod stmt; mod ty; mod util; pub use root:...
Rust
0
import pygame from .base import BaseSprite from .card import CardSprite from ..constants import CARD_WIDTH_RATIO, CARD_HEIGHT_RATIO, RESOURCE_PATH class BottomComponentSprite(BaseSprite): def __init__(self, parent_surface, surface, position, player): self._player = player super().__init__(parent...
Python
1
from flask import Flask from flask import jsonify from flask_jwt_extended import create_access_token from flask_jwt_extended import jwt_required from flask_jwt_extended import JWTManager app = Flask(__name__) app.config["JWT_SECRET_KEY"] = "super-secret" # Change this! jwt = JWTManager(app) # Set a callback funct...
Python
1
220, 235, 14, 19, 36, 45, 61, 76, 91, 108, 121, 138, 154, 172, 189, 205, 222, 238, 12, 18, 31, 45, 60, 76, 91, 107, 123, 138, 154, 171, 187, 204, 221, 236, 13, 17, 31, 43, 53, 70, 83, 103, 114, 131, 149, 167, 185, 203, 220, 237, 17, 22, 35, 42, 58, 78, 93, 110, 125, 139, 155, 170, 188, 206, 224, 240, 8, 15, 34, ...
Rust
0
sage = Some( "Destination Public Key/Emoji ID and Amount required\nPress Enter to continue.".to_string(), ); return; } if self.amount_field.parse::<u64>().is_err() { self.error_message = Some("Amount shou...
Rust
0
{ tmp_choose_buf.clear(); tmp_choose_buf.extend(0..out_keycount); } last_rel_beat = rel_beat; ensure!( rel_beat <= unit, "pattern beats cannot go beyond the patter...
Rust
0
tor_indices, ) self.logger.debug( f"Dependent root for attester duties for epoch {epoch} - {response.dependent_root}", ) if response.dependent_root == self.attester_duties_dependent_roots.get( epoch, None, ): ...
Python
1
f.cascades: if targetName == target.name: # Make sure the target is not already being tracked if target not in self.targets: self.targets.append(target) def track(self, frame): gray = cv2.cvtColor(frame.copy(), cv2.COLOR_BGR2GRAY) t...
Python
1
import sys, os import subprocess def main() -> int: ''' Main entry point for running commands in the package. ''' argCount = len(sys.argv) if argCount < 2: print('No arguments provided. Use -h or --help for help.') return 1 if sys.argv[1] == '-h' or sys.argv[1] == '--help': ...
Python
1
n() sys.exit(0) # Overwrite option (for after plex package update/upgrade) elif sys.argv[1] == "overwrite": overwrite_transcoder_after_upgrade() print "Transcoder overwritten successfully" elif sys.argv[1] == "sessions": sessions() elif sys.argv[1] == "check_co...
Python
1
: disable=inconsistent-return-statements def datetime_to_string(o): if isinstance(o, datetime.datetime): return o.__str__() def _add_filter(filters: List[Filterable], is_tag: bool, full_name: str, value: str): if is_tag: name = full_name[len(FILTER_TAG_NAME_PREFIX) :] filters.append(Fi...
Python
1
eg; use std::marker::PhantomData; use num_traits::{Num, One, Zero}; use num_traits::cast::{ToPrimitive, NumCast}; use alga::general::AbstractGroup; use alga::general::AbstractLoop; use alga::general::AbstractMagma; use alga::general::AbstractMonoid; use alga::general::AbstractQuasigroup; use alga::general::AbstractSe...
Rust
0
\ appender, |b,i,e| merge(b,e.$0+e.$1)))"; let conf = default_conf(); let mut x = vec![5; 100]; let mut y = vec![0; 100]; for i in 0..100 { x[i] = i as i64 + 5; } for i in 0..100 { y[i] = i as i64; } let strides = [5, 2, 2]; let shapes = [2, 3, 4];...
Rust
0
itle=Rs?title to display on the installer background instead of default(s skip-buildNs2skip rebuilding everything (for testing/debugging)(sinstall-script=NsTbasename of installation script to be run afterinstallation or before deinstallation(spre-install-script=Ns{Fully qualified ...
Python
1
# Copyright 2022 The LUCI Authors. All rights reserved. # Use of this source code is governed under the Apache License, Version 2.0 # that can be found in the LICENSE file. from PB.go.chromium.org.luci.cv.api.v0 import run as run_pb from PB.go.chromium.org.luci.cv.api.v0 import service_runs as service_runs_pb DEPS = ...
Python
1
let three_letter_iso_country_code = map_2_letter_to_3_letter_country_code(&geo_location); Location { country_name: geo_location.country_name, two_letter_iso_country_code: geo_location.country_code, three_letter_iso_country_code, lat: geo_location.latitude,...
Rust
0
mplement(self, x): r, d_xr = self.equal_to[x] inv, denom = self.elim.get_inverse(r) if inv is None: return None d_ri = self._get_frac_dist(-self.value[r],self.value[inv], denom) y, d_iy = self.equal_to[inv] d_nxy = (-d_xr + d_ri + d_iy)%1 #print("{} +{} -> {} inv[...
Python
1
from enum import Enum class ReportProgress(str, Enum): Submitted = "Submitted" InProcessing = "In processing" Resolved = "Resolved"
Python
1
`*"] pub fn PathRemoveBlanksW(pszpath: ::windows_sys::core::PWSTR); #[doc = "*Required features: `\"Win32_UI_Shell\"`*"] pub fn PathRemoveExtensionA(pszpath: ::windows_sys::core::PSTR); #[doc = "*Required features: `\"Win32_UI_Shell\"`*"] pub fn PathRemoveExtensionW(pszpath: ::windows_sys::core::PWS...
Rust
0
𝐊𝚈𝙰 𝐉𝙰𝚃𝙰 𝐇 𝐓𝙷𝙾𝚁𝙰 𝐃𝙴𝚁 𝐊𝙰𝚁 𝐋𝙾 𝐍𝙰🙂**", ] @Client.on_message(filters.command(["tagall"], prefixes=["/", "@", ".", "#"])) async def mentionall(client, message): chat_id = message.chat.id if message.chat.type == ChatType.PRIVATE: return await message.reply("𝐓𝐡𝐢𝐬 𝐂𝐨𝐦𝐦𝐚𝐧𝐝 �...
Python
1
f]{2})([0-9a-f]{2})").unwrap(); } /// An error that occurred when parsing colors. #[derive(Debug)] pub enum ColorError { /// Error raised when the color was not a valid number. InvalidColor, /// Error raised when the color was number outside of the allowed bounds. OutOfBounds(u8, u8), } /// Joins multiple col...
Rust
0
s', 'mips'], ['endif', 316, '#endif', 'all']]''' start_line = macro_segment[0][1] end_line = macro_segment[len(macro_segment) - 1][1] need_migrate = 1 for i in range(len(macro_segment)): if macro_segment[i][3] not in ['all']: break need_migrate = 0...
Python
1
t}----------------+---------+{activity_dashes}") for name, agg in activity_totals.items(): print(f"{indent}{agg.elapsed:12.6f} ms | {agg.count:7d} | {name}") print() print(f"{indent}CUDA device summary:") print(f"{indent}----------------+---------+{activity_dashes}") print(f"{indent}Total t...
Python
1
ns = np.linspace(-1, 1, n_bins+1) # Create true distribution using CDF differences (bin integration) true_dist = np.array([ norm.cdf(right, true_mu, true_sigma) - norm.cdf(left, true_mu, true_sigma) for left, right in zip(bins[:-1], bins[1:]) ]) true_dist = true_dist / np.sum(true_d...
Python
1
}; use tracing_subscriber::{layer::Context, registry::LookupSpan, Layer}; use crate::tracing::constants; #[derive(Debug, Serialize, Deserialize)] pub struct SearchEvent { pub timestamp: SystemTime, pub kind: SearchEventKind, } #[derive(Debug, Serialize, Deserialize, From)] pub enum SearchEventKind { Sta...
Rust
0
los if slo.get("filter")] related_slo_tasks = [ self._get_slo_related_entities(slo["filter"]) for slo in slos_with_filter ] results = await asyncio.gather(*related_slo_tasks, return_exceptions=True) for slo, entities in zip(slos_with_filter, results): if isinstan...
Python
1
weight.compose(buf); self.port.compose(buf); self.target.compose_canonical(buf); } } impl<N: Compose> Compress for Srv<N> { fn compress(&self, buf: &mut Compressor) -> Result<(), ShortBuf> { buf.compose(&self.priority)?; buf.compose(&self.weight)?; buf.compose(&self.port...
Rust
0
&mut self, var: &st::Variable<'l>, name: &str, ) -> &'l st::Variable<'l> { let new_id = self.fresh_id(name.into()); let flags = var .flags .iter() .filter(|flag| !matches!(flag, st::Flag::IsVar(_))) .copied() .collect(); self.factory().Variable(new_id, var.tpe, fla...
Rust
0
ste! { match fb.format { XRGB8888 => self.[<$name _inner>]::<u32>(fb $(, $($opt),*)?), XRGB1555 | RGB565 => { self.[<$name _inner>]::<u16>(fb $(, $($opt),*)?) } _ => (), } ...
Rust
0
th_foreground(Color::Green) .bold() .italic() .underlined() .with_texts(TextParts::new( Some(String::from("hello")), Some(vec![TextSpan::from("hey")]), )) .build(); assert_eq!(props.background, Color::Blue); ...
Rust
0
""" DeepLabCut Toolbox (deeplabcut.org) © A. & M. Mathis Labs Licensed under GNU Lesser General Public License v3.0 """ from dlclive.version import __version__, VERSION from dlclive.dlclive import DLCLive from dlclive.processor import Processor from dlclive.benchmark import benchmark, benchmark_videos, download_bench...
Python
1
self.path, os.O_RDONLY) if self.early_cpio and skip_cpio: skipcpio(fd) yield fd finally: if fd != -1: os.close(fd) @staticmethod def run(cmd, image): argv = ["/bin/sh", "-c", cmd] output = subprocess.check_output(argv, ...
Python
1
default, skip_serializing_if = "Option::is_none")] pub customization: Option<GuestOsnicCustomization>, #[serde(rename = "ipAddresses", default, skip_serializing_if = "Vec::is_empty")] pub ip_addresses: Vec<String>, #[serde(rename = "macAddress", default, skip_serializing_if = "Option::is_none")] pub...
Rust
0
# ============================================================================== # Copyright (C) 2023 Intel Corporation # SPDX-License-Identifier: Apache-2.0 # ============================================================================== """Openvino Tensorflow relu6 test """ from __future__ import absolute_import fr...
Python
1
c\ g>\xa8\xab\xd14\x11\x0b\xbf\xeau\xf0\x10\xbd\xda\xaa\ L\x85#Pd\xa80_\xafw\xd7\xa0\xfd<\xabF\ -S\x80\xbc\x90r\xe2Q\xf8c\xd5X\xc7\xe2\xa4\xf2\ \xf3L\xe8|\xb03\xb1\xa8\xfc\x84k/@ix\xf9\ X\xab\x83\xbeR\x04\x19\x02\xe8\x9c\x15@\xc6\xde+\x95\ \x15\x0a\xcc\xe7\xba\x19\xe2<\xe2\xa8\x08\x99\xf0%]\x8b\ fN \xd2*\x99\xe1\xcd\xa...
Python
1
splay...", "分析完成,准备为您呈现专业投资建议...": "Analysis complete, preparing to present professional investment advice...", "🔄 分析中": "🔄 Analyzing", "🔄 技术面分析师正在分析,请稍候...": "🔄 Technical analyst is analyzing, please wait...", "🔄 投资大师正在分析,请稍候...": "🔄 Investment master is analyzing, please wait..."...
Python
1
ompare) /// callback function. #[cfg_attr(docsrs, doc(cfg(feature = "comctl")))] pub type PFNLVGROUPCOMPARE = extern "system" fn( groupId1: i32, groupId2: i32, lpRefData: isize, ) -> i32; /// Type alias to /// [`SUBCLASSPROC`](https://docs.microsoft.com/en-us/windows/win32/api/commctrl/nc-commctrl-s...
Rust
0
let ciphertext = b"\xdc\x7e\x84\xbf\xda\x79\x16\x4b\x7e\xcd\x84\x86\x98\x5d\x38\x60\ \x39\xff\xed\x14\x3b\x28\xb1\xc8\x32\x11\x3c\x63\x31\xe5\x40\x7b\ \xdf\x10\x13\x24\x15\xe5\x4b\x92\xa1\x3e\xd0\xa8\x26\x7a\xe2\xf9\ \x75\xa3\x85\x74\x1a\xb9\xce\xf8...
Rust
0
int = 0x00040000; pub const TEXT_ATTR_BULLET_TEXT: c_int = 0x00080000; pub const TEXT_ATTR_BULLET_NAME: c_int = 0x00100000; pub const TEXT_ATTR_BULLET: c_int = (TEXT_ATTR_BULLET_STYLE | TEXT_ATTR_BULLET_NUMBER | TEXT_ATTR_BULLET_TEXT | TEXT_ATTR_BULLET_NAME); pub const TEXT_ATTR_URL: c_int = 0x00200000; pub...
Rust
0
sum(dsl::pdp), // sum(dsl::cases), // sum(dsl::recovered), // sum(dsl::deaths), // )) // .select(sql("SELECT SUM(odp), SUM(pdp), SUM(cases), SUM(recovered), SUM(deaths)")) sql_query(&format!("SELECT SUM(odp) as odp, SUM(pdp) as pdp,...
Rust
0
state, def::CAS_SQUARE_BQ + 1, def::PLAYER_B) && !is_under_attack(state, def::CAS_SQUARE_BQ + 2, def::PLAYER_B) { add_mov(def::CAS_SQUARE_BQ + 2, def::CAS_SQUARE_BQ, def::MOV_CAS, 0); } } } } pub fn gen_capture_and_promo_list(state: &State, cap_list: &mut [u32; def::...
Rust
0
= static_vars.infer(env, ())?; rupro_todo_assert!(constructor.is_none(), AST); rupro_todo_assert!(cd.typeconsts.is_empty(), AST); rupro_todo_assert!(cd.consts.is_empty(), AST); Ok((vec![], vec![], typed_vars, typed_static_vars, typed_methods)) } fn split_methods<'aast>( all_methods: impl Iterator...
Rust
0
import numpy as np a = np.array(42) b = np.array([1, 2, 3, 4, 5]) c = np.array([[1, 2, 3], [4, 5, 6]]) d = np.array([[[1, 2, 3], [4, 5, 6]], [[1, 2, 3], [4, 5, 6]]]) print("entered array is:", a, "and its dimension is:", a.ndim) print("entered array is:", b, "and its dimension is:", b.ndim) print("entered array is:",...
Python
1
class Solution: def xorQueries(self, arr: List[int], queries: List[List[int]]) -> List[int]: pref = [arr[0]] for i in range(1, len(arr)): pref.append(arr[i] ^ pref[i-1]) res = [] for l, r in queries: if l == 0: res.append(pref[r]) ...
Python
1
th/2 / K[0, 2] scale_factor_y = height/2 / K[1, 2] f.write(f"{i} PINHOLE {width} {height} {K[0, 0]*scale_factor_x} {K[1, 1]*scale_factor_y} {width/2} {height/2}\n") # scale focal def save_colmap_images(poses, images_file, train_img_list, write_flag='w'): with open...
Python
1
""" logging helpers, supports vendoring """ from __future__ import annotations import contextlib import logging import os import sys from typing import IO from typing import Iterator from typing import Mapping log = logging.getLogger(__name__.rsplit(".", 1)[0]) log.propagate = False class AlwaysStdErrHandler(loggin...
Python
1
"MALAY"); lang!(76, "MALAYALAM"); lang!(58, "MALTESE"); lang!(78, "MARATHI"); lang!(97, "NEPALI"); lang!(20, "NORWEGIAN"); lang!(72, "ORIYA"); lang!(21, "POLISH"); lang!(22, "PORTUGUESE"); lang!(70, "PUNJABI"); lang!(23, "RHAETOROMANIC"); ...
Rust
0
tered data). If None, results in default no filter """ self._filter = filter if filter is not None else NO_FILTER def set_delayer(self, delayer): """ Sets the delayer for this observable. Args: delayer (None or function): Method to delay the raw ...
Python
1
notmuch_thread_get_newest_date(thread: *notmuch_thread_t) -> time_t; pub fn notmuch_thread_get_tags(thread: *notmuch_thread_t) -> *notmuch_tags_t; pub fn notmuch_thread_get_matched_messages(thread: *notmuch_thread_t) -> c_int; pub fn notmuch_thread_get_messages(thread: *notmuch_thread_t) -> *notmuch_messag...
Rust
0
cryptography.com/cryptanalysis/letter-frequencies-various-languages/english-letter-frequencies/ const TOP_TRIGRAMS: [&str; 2648] = [ "THE", "AND", "ING", "ENT", "ION", "HER", "FOR", "THA", "NTH", "INT", "ERE", "TIO", "TER", "EST", "ERS", "ATI", "HAT", "ATE", "ALL", "ETH", "HES", "VER", "HIS", "OFT", "ITH", ...
Rust
0
dirpath=logger.log_dir, save_top_k=1, mode="min"), ModelCheckpoint(monitor="val_loss", filename="{epoch:02d}-{val_loss:.2f}", dirpath=logger.log_dir, save_top_k=1, ...
Python
1
"Decide which exceptions must be added to this tool for completeness and explain the reasons.", ), ), ) .set_indexing_method(dash_indexing) .set_delta_indent(indent), ), ), ...
Python
1
import argparse import json from utils import * def create_gpt_training_data(groundtruth, prompts, output_file): ground_truth_ranking = normalized_fractional_ranking(groundtruth) labels = [int(r * 100.0) / 10.0 if r < 1.0 else 9.9 for r in ground_truth_ranking] training_data = [] for prompt, label...
Python
1
oupper 0x0077_0001, 0x0000_5004, 0x0000_0000,// VEX_Vzeroall 0x0078_0000, 0x0000_8014, 0x0000_159C,// Vmread_rm32_r32 0x0078_0000, 0x0000_8024, 0x0000_1620,// Vmread_rm64_r64 0x0078_0002, 0x0320_4004, 0x0000_085E,// EVEX_Vcvttps2udq_xmm_k1z_xmmm128b32 0x0078_0002, 0x0320_8404, 0x0000_089F,// EVEX_Vcvttps2udq_ymm_k...
Rust
0
search_info.way_value = Some(WayValue::Win); search_info.comment = Some("Resign.".to_string()); } Some(ForwardCutOff::OpponentWin) } else { // The opponent possibly wins. // 対戦相手の多分勝ち。 if Lo...
Rust
0
cmd = [ "ffmpeg","-y","-framerate",str(r.fps), "-i", os.path.join(cfg.paths.work_dir, r.tmp_dir, "frame_%04d.png"), "-i", cfg.paths.audio_in, "-map", "0:v", "-map", "1:a", "-pix_fmt","yuv420p", out_path ] run_cmd(c...
Python
1
---------------------- for episode in range(num_episodes): # 試行数分繰り返す env.reset() # cartPoleの環境初期化 state, reward, done, _ = env.step(env.action_space.sample()) # 1step目は適当な行動をとる state = np.reshape(state, [1, 4]) # list型のstateを、1行4列の行列に変換 episode_reward = 0 # 2018.05.16 # skanmeraさんより間違いを修...
Python
1
next_roll: 1, } } /// Rolls the die and rotates the next roll value. pub fn roll(&mut self) -> u64 { self.times_rolled += 1; let this_roll = self.next_roll; self.next_roll += 1; if self.next_roll > 100 { self.next_roll = 1; } r...
Rust
0
map(|entry| (entry.medal_id, entry.possession_percent)) .collect(); let acquired = ( user.medals.as_ref().map_or(0, Vec::len), osekai_medals.len(), ); osekai_medals.sort_unstable_by_key(|medal| medal.medal_id); let mut medals = Vec::with_capacity(acquired.0); let medals_i...
Rust
0
def linsearch(arr, target): found = False for index in range(len(arr)): if arr[index] == target: found = True print(f"Value {target} found at index: {index}") if not found: print(f"Value {target} not found in the array.") myArr = [20, 20, 24, 27, 39, 40, 43, 46, 50...
Python
1