text string | label_name string | labels int64 |
|---|---|---|
= config_loader.get_vendor_config(vendor)
crawler_settings = vendor_config.get('crawler_settings', {})
save_raw_html = crawler_settings.get('save_raw_html', False)
if save_raw_html:
CONSOLE.print(f"[yellow]🐛 调试模式已启用,将保存原始HTML到debug目录[/yellow]")
# 查找对应的链接文件
link_files = find_link_f... | Python | 1 |
default_net();
let mem = GuestMemoryMmap::from_ranges(&[(GuestAddress(0), MAX_BUFFER_SIZE)]).unwrap();
// transmute mem_ref lifetime to 'a
let mem_ref = unsafe { mem::transmute::<&GuestMemoryMmap, &'a GuestMemoryMmap>(&mem) };
let rxq = VirtQueue::new(GuestAddress(0), me... | Rust | 0 |
not is_image(path) and not is_svg(path):
dial = Gtk.AlertDialog(
message="No valid image or video.",
detail="Only images and videos are supported.",
modal=True
)
GLib.idle_add(dial.show)
return
asset... | Python | 1 |
class Solution:
def pacificAtlantic(self, heights: list[list[int]]) -> list[list[int]]:
ROWS, COLS = len(heights), len(heights[0])
res = []
visitPacific = set()
visitAtlantic = set()
def visit(row:int,col:int, visitSet:set, prevH:int):
if row < 0 or row == ROWS o... | Python | 1 |
D FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
// SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
// WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
// OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
// CONNECTION WITH THE USE OR PERFORM... | Rust | 0 |
return "??:{}:{}:{}".format( s.opaque, s.test, ' '*(s.data.nbits/4) )
#-------------------------------------------------------------------------
# MemMsg
#-------------------------------------------------------------------------
# Single class that contains both the memory request and response types.
# This simplifi... | Python | 1 |
tempt < max_retries - 1:
wait_time = (attempt + 1) * 2
print(f"请求频率限制,等待 {wait_time} 秒后重试...")
time.sleep(wait_time)
continue
else:
print(f"文章请求失败,状态码: {resp.status_code}")
... | Python | 1 |
ents: commitments,
};
// each participant generates their signature share
for (participant_index, nonce) in nonces {
let share_package = shares
.iter()
.find(|share| participant_index == share.index)
.unwrap();
let nonce_to_use = nonce[0];
let sig... | Rust | 0 |
import numpy as np
import h5py
import argparse
import scipy.stats as stats
import unyt
argparser = argparse.ArgumentParser()
argparser.add_argument("input", nargs="+")
argparser.add_argument("output")
args = argparser.parse_args()
nfile = len(args.input)
time = np.zeros(nfile)
radius = np.zeros(nfile)
velocity = np.... | Python | 1 |
let mode;
let mut _flags = 0;
match magic {
BOC_INDEXED_TAG => {
ref_size = first_byte as usize;
index_included = true;
mode = BocSerialiseMode::Indexed;
},
BOC_INDEXED_CRC32_TAG => {
ref_size = first_byte as usize;
index_... | Rust | 0 |
number = "7316717653133062491922511967442657474235534919493496983520312774506326239578318016984801869478851843858615607891129494954595017379583319528532088055111254069874715852386305071569329096329522744304355766896648950445244523161731856403098711121722383113622298934233803081353362766142828064444866452387493035890729... | Python | 1 |
/ Common
(0x1f0b1, 0x1f0c0), // Common
(0x1f0c1, 0x1f0d0), // Common
(0x1f0d1, 0x1f0f6), // Common
(0x1f100, 0x1f10d), // Common
(0x1f110, 0x1f16d), // Common
(0x1f170, 0x1f1ad), // Common
(0x1f1e6, 0x1f200), // Common
(0x1f200, 0x1f201), // Hiragana
(0x1f201, 0x1f203), // Common
... | Rust | 0 |
# =============================================================================
# masking.py
# =============================================================================
# Маскирование белка
#
# Часть проекта с проектной смены "Большие Вызовы"
#
# Лицензия: MIT (см. LICENSE)
# =======================================... | Python | 1 |
"""Whisper model building blocks."""
from typing import Dict
import flax.linen as nn
import jax
import jax.numpy as jnp
from minimind.config import Config
from minimind.modeling.architectures import register_architecture
from minimind.modeling.modules.whisper_blocks import WhisperSpeechEncoder, WhisperTextDecoder
@... | Python | 1 |
stabilizers: Option<PyReadonlyArray1<usize>>,
) -> PyReturn<'py> {
let w = to_rational_vector(weight);
let stabs = match stabilizers {
Some(x) => Some(x.as_array().to_vec()),
None => None,
};
let result = self.roots.orbit(w, stabs);
let (numer, denom)... | Rust | 0 |
"""Process the DATE command. Arguments:
None
Returns:
resp: server response if successful
date: Date suitable for newnews/newgroups commands etc.
time: Time suitable for newnews/newgroups commands etc."""
resp = self.shortcmd("DATE")
if resp[:3] != '111':
... | Python | 1 |
manual_link_hwnd_btn = _create_btn_in_(hwnd_frame, "手绑")
(manual_link_hwnd_btn.set_bind_map(
**{"1": lambda: self.do_and_update_ui(partial(AccInfoFunc.manual_link_hwnd_of_account, sw, account))})
.apply_bind(self.root))
_pack_btn_left(manual_link_hwnd_btn)
hidden_hw... | Python | 1 |
/// ```
pub fn skip_current_subtree(&mut self) {
self.stack.truncate(self.last_subtree);
}
}
impl<'tcx> Iterator for TypeWalker<'tcx> {
type Item = Ty<'tcx>;
fn next(&mut self) -> Option<Ty<'tcx>> {
debug!("next(): stack={:?}", self.stack);
match self.stack.pop() {
... | Rust | 0 |
TEMPLATE,
chat_template_content_format="auto",
request_logger=None)
req = ChatCompletionRequest(
model=MODEL_NAME,
messages=[{
"role": "user",
"content": "what is 1+1?"
}],
guided_decodi... | Python | 1 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from typing_extensions import Literal
from ..._models import BaseModel
__all__ = ["FileSearchTool"]
class FileSearchTool(BaseModel):
type: Literal["file_search"]
"""The type of tool being defined: `file_search`"""
| Python | 1 |
import random
import numpy as np
import cv2
def load_data(density_path, train=True):
if train:
rgb_path = density_path.replace('train_density', 'train_img').\
replace('DENSITY', 'IMG').replace('npy', 'png')
depth_path = density_path.replace('train_density', 'train_depth').\
... | Python | 1 |
# plots.py
import plotly.express as px
import plotly.graph_objects as go
from src.data.transformers import (
producto_mas_ingresos,
ranking_problemas,
top_10_ejecutivos,
porcentaje_estados,
promedio_vida_util,
producto_menor_vida_util,
casos_por_mes
)
def plot_producto_mas_ingresos(data):
... | Python | 1 |
3, 0, 3), # Process P1 with priority 0
Process("P2", 4, 1, 2), # Process P2 with priority 2
Process("P3", 6, 2, 4), # Process P3 with priority 1
Process("P4", 4, 3, 6), # Process P4 with priority 3
Process("P5", 2, 5, 10), # Process P5 with priority 0
]
scheduler1 = Scheduler(process_list)
# Prio... | Python | 1 |
class User:
def __init__(self, nome, genero_preferido, autor_favorito, idade):
self.nome = nome
self.genero_preferido = genero_preferido
self.autor_favorito = autor_favorito
self.idade = idade
def criar_usuario():
print(f"\n*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-... | Python | 1 |
doesn't fit in alloc")
}
fn in_only<'a>(&'a self, setup_data: &'a [u8], in_data: &'a mut [u8]) -> ::usb_core::host::AsyncWaitIo<'a, usize>
{
enum FutureState<'a> {
Init {
setup_data: &'a [u8],
in_data: &'a mut [u8],
},
Started {
_bb_setup: Option<::kernel::memory::virt::AllocHandle>,
bb_... | Rust | 0 |
get_child_text_opt("headerStructName")?)
.address_offset(tree.get_child_u32("addressOffset")?)
.default_register_properties(RegisterProperties::parse(tree, config)?)
.children({
let children: Result<Vec<_>, _> = tree
.children()
... | Rust | 0 |
res: 'Win32_System_Console'*"]
pub const NLS_IME_DISABLE: u32 = 536870912u32;
#[doc = "*Required features: 'Win32_System_Console'*"]
pub const NLS_KATAKANA: u32 = 131072u32;
#[doc = "*Required features: 'Win32_System_Console'*"]
pub const NLS_ROMAN: u32 = 4194304u32;
#[doc = "*Required features: 'Win32_System_Console'*... | Rust | 0 |
]
pub extern "C" fn real_dot_product_prec32(vector: &VecBuf,
operand: &VecBuf)
-> ScalarInteropResult<f32> {
vector.convert_scalar(|v| {
PreciseDotProductOps::<GenDspVec<Vec<f32>, f32>, f32, f32, meta::RealOrComplex, meta::T... | Rust | 0 |
{
print!("called `my_mod::call_public_function_in_my_mod()`, that\n> ");
nested::public_function_in_my_mod();
print!("> ");
nested::public_function_in_super_mod();
}
// pub(crate) makes functions visible only within the current crate
pub(crate) fn public_function_in_crate()... | Rust | 0 |
ILING AS THEY ARE SUPPOSED TO BE UNIQUE.
// Note that if you want to make the ransomware more unique and harder to be removed you should go in other files and change other settings
// A guide in the README.md on how to make this more random and secure should be coming soon.
// the amount of money you want t... | Rust | 0 |
n dtcm_err_sig_en(&self) -> DTCM_ERR_SIG_EN_R {
DTCM_ERR_SIG_EN_R::new(((self.bits >> 4) & 0x01) != 0)
}
#[doc = "Bit 5 - OCRAM Access Error Interrupt Enable"]
#[inline(always)]
pub fn ocram_err_sig_en(&self) -> OCRAM_ERR_SIG_EN_R {
OCRAM_ERR_SIG_EN_R::new(((self.bits >> 5) & 0x01) != 0)... | Rust | 0 |
{
fn mssig(&mut self, sk: &mss::PrivateKey<TW, P>, hash: &External<Mac>) -> Result<&mut Self> {
ensure!(
P::HASH_SIZE == (hash.0).0,
"Trit size of `external tryte hash[n]` to be signed with MSS must be equal {} trits.",
P::HASH_SIZE
);
ensure!(
... | Rust | 0 |
self._check(data)
def test_all_masked(self):
data = ma.arange(12, dtype=np.int)
data[:] = ma.masked
self._check(data)
def test_multi(self):
for dtype in [np.int, np.float]:
data = ma.arange(12, dtype=dtype)
data[::2] = ma.masked
self._... | Python | 1 |
et Some(mut log) = stream.try_next().await? {
let is_restricted = options.is_restricted_log(&log);
let should_display = options.should_display(&log);
if !should_display && !is_restricted {
continue;
}
if log.moniker == "test_root" {
log.moniker = "<root>"... | Rust | 0 |
from Generate_data import generate_data, bursts
from Signal import Signal
import matplotlib.pyplot as plt
import numpy as np
import Analysis as sys
from Algorithms.metropolis import metropolis
from Algorithms.MyNUTS import MyNUTS
from Algorithms.NUTS import NUTS
from Algorithms.HMC import HMC
from Algorithms.MALA impo... | Python | 1 |
ility function to get a shared reference to the underlying WorkingSet.
fn wrap<T, F>(ws: *mut TCWorkingSet, f: F) -> T
where
F: FnOnce(&WorkingSet) -> T,
{
// SAFETY:
// - ws is not null (promised by caller)
// - ws outlives 'a (promised by caller)
let tcws: &TCWorkingSet = unsafe { TCWorkingSet::... | Rust | 0 |
# Licensed to Elasticsearch B.V. under one or more contributor
# license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright
# ownership. Elasticsearch B.V. licenses this file to you under
# the Apache License, Version 2.0 (the "License"); you may
# not use ... | Python | 1 |
W1,
w2: W2,
}
fn build() -> Ecs {
let mut ecs = Ecs::new();
for _ in 0..N {
let e = ecs.make();
ecs.r.insert(e, R { x: 0.0 });
ecs.w1.insert(e, W1 { x: 0.0 });
ecs.w2.insert(e, W2 { x: 0.0 });
}
ecs
}
#[bench]
fn bench_build(b: &mut Bencher) {
b.iter(build);
... | Rust | 0 |
from numpy import *
arr = array([9, 6, 3, 7, 2, 8, 1])
print(arr)
# Adding 5 in each element in array by manually.
for i in range(len(arr)):
arr[i] = arr[i] + 5
print(arr)
# Adding 5 in each element in array by inbuilt function.
arr_1 = array([1, 2, 3, 4, 5, 6, 7])
arr_1 = arr_1 + 5
print(arr_1)
# Reversing... | Python | 1 |
#Haga un programa cuya tarea es escribir algunas de las primeras potencias de dos
#Definimos una variable
potencia = 1
#Por medio de un for calculamos y escribimos los resultados
for e in range(16):
# (e) se utiliza como una variable de control para el bucle e indica el valor actual del exponente
print(f"2 a... | Python | 1 |
*const cuDoubleComplex,
lda: ::libc::c_int,
AP: *mut cuDoubleComplex,
) -> cublasStatus_t;
}
// Copyright (c) 2020-2021 Via Technology Ltd. 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.
... | Rust | 0 |
'a, [u8]>>>,
auth_plugin: Option<AuthPlugin<'a>>,
mut capabilities: CapabilityFlags,
connect_attributes: Option<HashMap<String, String>>,
) -> Self {
let scramble_buf =
if capabilities.contains(CapabilityFlags::CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA) {
Eith... | Rust | 0 |
<A, B>, HalfCarry<HalfSum<A, B>, C>>;
pub type FC<A,B,C> = FullCarry<A,B,C>;
pub type FullAdder<A,B,C> = (
FullSum<FullSum<A, B,Zero>, C,Zero>,
FullCarry<A,B,C>
);
pub type Demux<I,S> = (
Not<Nand<I,Not<S>>>,
Not<Nand<I,S>>,
);
pub type Mux<A,B,S> = Nand< Nand<A, Not<S> > , Nand<B,S> >;
pub type AD... | Rust | 0 |
_pnl, close_details
FROM active_trades
WHERE id = ?
''', (trade_id,))
restored_trade = cursor.fetchone()
if not restored_trade:
print("❌ Failed to verify restoration - trade not found")
return False
... | Python | 1 |
cer, influencee, timestamp, cascade_id, original_user);
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn new() {
let edge: InfluenceEdge<f64> = InfluenceEdge::new(42.0, 13.37, 123, 456, 789, 0.42);
assert_eq!(edge.influencer, 42.0);
assert_eq!(edge.influencee, 13.37);
asse... | Rust | 0 |
'''Escreva um programa que leia dois valores inteiros (x e y) e mostre todos os números primos entre x e y.
'''
def numeroPrimo(n):
if n <= 1:
return False
for i in range(2, int(n**0.5) + 1):
if n % i == 0:
return False
return True
def imprimePrimos(x, y):
for n in rang... | Python | 1 |
import os
def set_environment_variables_for_nccl_backend(single_node=False, master_port=6105):
os.environ['RANK'] = os.environ['OMPI_COMM_WORLD_RANK']
os.environ['WORLD_SIZE'] = os.environ['OMPI_COMM_WORLD_SIZE']
if not single_node:
master_node_params = os.environ['AZ_BATCH_MASTER_NODE'].split('... | Python | 1 |
analytics mode for newly-created project buckets. '
'Changing this setting does not modify any existing buckets.'
),
universe_help='This is not available.\n',
),
)
group = parser.add_mutually_exclusive_group(required=False)
kms_resource_args.AddKmsKeyResourc... | Python | 1 |
import pathlib
import pytest
def pytest_generate_tests(metafunc):
# Run all tests both with and without speedups
metafunc.fixturenames.append('speedups')
metafunc.parametrize('speedups', [False, True])
@pytest.fixture(scope='session')
def cwd() -> pathlib.Path:
return pathlib.Path(__file__).parent
... | Python | 1 |
import matplotlib.pyplot as plt
import json
import numpy as np
with open('store_pv/result ratio={}.json'.format(1), 'r') as f:
raw = json.load(f)
rv_set = range(0, 51)
base, binary, exact = [], [], []
base_low, binary_low, exact_low = [], [], []
base_high, binary_high, exact_high = [], [], []
# for every (rp... | Python | 1 |
int(1, 90))).strftime("%Y-%m-%d")
}
}
# Generate data for all schemas with automatic dependency resolution
# Specifying 'json' as the output_format
results = generator.generate_for_schemas(
schemas=schemas,
prompts=prompts,
sample_sizes=sample_sizes,
custom_g... | Python | 1 |
let Some((name, v1, v2)) =
sketch_params.check_compatibility(&sketch.sketch_params)
{
bail!(
"Sketch {} has {} {}, but working value is {}",
sketch.name,
name,
v2,
... | Rust | 0 |
ep
[1518-11-01 00:25] wakes up
[1518-11-01 00:30] falls asleep
[1518-11-01 00:55] wakes up
[1518-11-01 23:58] Guard #99 begins shift
[1518-11-02 00:40] falls asleep
... | Rust | 0 |
import json
from abc import ABC, abstractmethod
from typing import List, Generator, Any
from openai import APIError
from app.response.entity import ChatFileCitation, Text as RagText, Annotation as RagAnnotation, \
Content as RagContent, Message
from app.response.rag_response import RagStreamSensitive
from app.ser... | Python | 1 |
# -*- coding:utf-8 -*-
import os, time, logging, ConfigParser
from smtplib import SMTP
from email.MIMEText import MIMEText
from email.Header import Header
from email.Utils import parseaddr, formataddr
import settings
default_option = 'mail'
class MailConfig:
def __init__(self):
self.cf = None
s... | Python | 1 |
div>
</div>
</div></div></div></div></div></div></div></main></div><footer id="doz_footer_wrap"><div id="doz_footer">
<div class="footer-section footer-type05 _footer_font_preview footer_align_center footer_align_right"> <div class="inside">
<div class=... | Python | 1 |
"""
controller_type = get_controller_type(
self.Control_Combox.currentText(), maa_config_data.interface_config_path
)
self.Autodetect_combox.clear()
if controller_type == "Adb":
emulators_name = check_path_for_keyword(
maa_config_data.config... | Python | 1 |
from art import logo
print(logo)
bids = {}
bidding_finished = False
def find_highest_bidder(bidding_record):
highest_bid = 0
winner = ""
for bidder in bidding_record:
bid_amount = bidding_record[bidder]
if bid_amount > highest_bid:
highest_bid = bid_amount
winner = ... | Python | 1 |
if bs.isGameOver(bs.personalBoatLog, bs.enemyBoatLog):
if (is_lost(bs.enemyBoatLog)):
message_send(p2, f"{MSG_FINISHED} {MSG_FINISHED_WIN}")
message_send(p1, f"{MSG_FINISHED} {MSG_FINISHED_LOSE}")
main()
turn = not turn
def is_lo... | Python | 1 |
olor=red>注意</font> :该列表最多仅展示前 10个 元素。如希望获得完整结果,请从 SegmentSetFileUrl 对应的文件中获取。
:rtype: list of ReviewAudioVideoSegmentItem
"""
return self._SegmentSet
@SegmentSet.setter
def SegmentSet(self, SegmentSet):
self._SegmentSet = SegmentSet
@property
def SegmentSetFileUrl(self)... | Python | 1 |
nt what's happening to happen"]
pub const ncloglevel_e_NCLOGLEVEL_WARNING: ncloglevel_e = 4;
#[doc = " \"standard information\""]
pub const ncloglevel_e_NCLOGLEVEL_INFO: ncloglevel_e = 5;
#[doc = " \"detailed information\""]
pub const ncloglevel_e_NCLOGLEVEL_VERBOSE: ncloglevel_e = 6;
#[doc = " this is honestly a bit m... | Rust | 0 |
from flask import Flask, send_from_directory
from flask_cors import CORS
import os
from .config import Config
from .database import db, ma
from flask_migrate import Migrate
from swagger.swagger_config import configure_swagger
from app.routes.cliente_route import cliente_bp
from app.routes.contrato_route import contra... | Python | 1 |
]) # HighDepth not present
# Test call without FT field
call_no_ft = vcfpy.Call("sample2", {"GT": "1/1"})
assert not call_no_ft.is_filtered() # No FT field
# Test call with empty FT field
call_empty_ft = vcfpy.Call("sample3", {"GT": "0/0", "FT": []})
assert not call_empty_ft.is_filtered() #... | Python | 1 |
# coding: utf-8
keymap = {
"KC_1": '! ¹\n1 ¡', # Keyboard 1 and Bang, Win: VK_1, AT-101 position: 2
"KC_2": '@ \n2 ²', # Keyboard 2 and At, Win: VK_2, AT-101 position: 3
"KC_3": '# \n3 ³', # Keyboard 3 And Hash, Win: VK_3, AT-101 position: 4
"KC_4": '$ £\n4 ¤', # Keyboard 4 and Dollar, Wi... | Python | 1 |
uper::*;
#[test]
fn problem1_example1() -> Result<(), ParseError> {
let input = parse_input("R8,U5,L5,D3\nU7,R6,D4,L4")?;
assert_eq!(run_problem1(&input)?, 6);
let input =
parse_input("R75,D30,R83,U83,L12,D49,R71,U7,L72\nU62,R66,U55,R34,D71,R55,D58,R83")?;
assert_eq... | Rust | 0 |
baaaabbbbaaabbabaaa
bbbababbbbaaaaaaaabbababaaababaabab
ababaaaaaabaaab
ababaaaaabbbaba
baabbaaaabbaaaababbaababb
abbbbabbbbaaaababbbbbbaaaababb
aaaaabbaabaaaaababaa
aaaabbaaaabbaaa
aaaabbaabbaaaaaaabbbabbbaaabbaabaaa
babaaabbbaaabaababbaabababaaab
aabbbbbaabbbaaaaaabbbbbababaaaaabbaaabba"#),
12
)
... | Rust | 0 |
# 酒店名称
'rating': hotel.rating, # 评分
'price_per_night': hotel.price_per_night, # 每晚价格
'address': hotel.address, ... | Python | 1 |
#!/usr/bin/python
#
# ######################################################################
# Author contact : seeleymagic[at]hotmail[dot]com
# ######################################################################
#
# *** For educational purposes only ***
# You have been warned
#
# My original crash breakdo... | Python | 1 |
from node_launcher.gui.menu.nodes_manage.manage_dialogs.configuration import ConfigurationDialog
from node_launcher.gui.menu.nodes_manage.manage_dialogs.console import ConsoleDialog
from node_launcher.gui.menu.nodes_manage.manage_dialogs.logs import LogsDialog
node_tabs = {
'tor': [
{
'title': ... | Python | 1 |
ll = epoll_create().expect("Failed to create epoll");
let mut tracked_fds = HashSet::<c_ares::Socket>::new();
loop {
// Ask c-ares what file descriptors we should be listening on, and map those requests
// onto the epoll file descriptor.
let mut new_tracked_fds = Hash... | Rust | 0 |
size,
pub neq: usize,
pub classes: EqClassList,
}
impl EqClassCollection {
// /// Add an equivalence class to the set of equivalence classes for this experiment
// pub fn push(&mut self, ec: EqClass) {
// self.classes.push(ec);
// }
pub fn new() -> EqClassCollection {
EqClassCo... | Rust | 0 |
old_dict = {p["id"]: p for p in old_problems}
except Exception:
old_dict = {}
else:
old_dict = {}
new_dict = {p.id: asdict(p) for p in summaries}
merged = {**old_dict, **new_dict}
PROBLEMS_JSON.write_text(
json.dumps(list(merged.values()), ensure_ascii=False, indent... | Python | 1 |
#Assignment 5: Static Variables and Static Methods
class MathUtils:
@staticmethod
def add(a, b):
return a + b
# Example usage
result = MathUtils.add(5, 3)
print(f"The sum is: {result}")
| Python | 1 |
paths of filenames to unixize'
-r --recursive 'Recursively unixize filenames in directories. If \
some of the specified paths are directories, unf \
will operate recursively on their contents'
-f --force 'Do not interactively prompt to ... | Rust | 0 |
iple() {
let m = App::new("multiple_values")
.arg(Arg::new("pos1").about("multiple positionals"))
.arg(
Arg::new("pos2")
.about("multiple positionals")
.takes_value(true)
.multiple_values(true)
.last(true),
)
... | Rust | 0 |
from .common import InfoExtractor
from ..utils import (
clean_html,
extract_attributes,
get_element_by_class,
get_element_html_by_attribute,
get_elements_html_by_class,
int_or_none,
parse_duration,
parse_iso8601,
remove_start,
strip_or_none,
unescapeHTML,
update_url,
... | Python | 1 |
::get_bits(val, ($from, $to)) {
$($kind_variant_val => ::core::option::Option::Some(super::$kind_name::$kind_variant),)*
_ => ::core::option::Option::None,
}
}
};
(@internal, $num_ty:ty, $register:ident, w $name:ident: $from:literal .. $to:literal = enum $kin... | Rust | 0 |
# Copyright (c) 2019 Horizon Robotics. 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 required by applicab... | Python | 1 |
p_header: None
},
_marker: marker::PhantomData::<Ethernet2Header>{}
}
}
}
struct PacketImpl {
ethernet2_header: Option<Ethernet2Header>,
ip_header: Option<IpHeader>,
vlan_header: Option<VlanHeader>,
udp_header: Option<UdpHeader>
}
///An unfinished packet that is bui... | Rust | 0 |
Vec<String>, stage: &Vec<u64>, amount: &Vec<String>, gas_price_uusd: Decimal, max_tx_fee: Decimal, gas_adjustment: Decimal, only_estimate: bool) -> anyhow::Result<String> {
let from_account = match mnemonics.len() {
44 => {
// wallet_acc_address
mnemonics.to_string()
}
... | Rust | 0 |
super::BigUint::from(18_446_744_073_709_551_616u128);
let mut it = n.iter_u64_digits();
assert_eq!(it.len(), 2);
assert_eq!(it.next_back(), Some(1));
assert_eq!(it.len(), 1);
assert_eq!(it.next_back(), Some(0));
assert_eq!(it.len(), 0);
assert_eq!(it.next(), None);
}
/*
Copyright 2021 V... | Rust | 0 |
reason: str | None = None
"""
The reason for stopping the execution
"""
class Transition(TransitionEvent):
model_config = ConfigDict(
populate_by_name=True,
)
execution_id: Annotated[UUID, Field(json_schema_extra={"readOnly": True})]
current: Annotated[TransitionTarget, Field(j... | Python | 1 |
# Copyright 2025 The AI Edge Torch Authors.
#
# 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 agreed ... | Python | 1 |
let m = gen_member();
let hm1 = HashMap::new();
let hm2 = HashMap::new();
let vec1 = Vec::new();
#[allow(clippy::zero_prefixed_literal)]
let dt: DateTime<Utc> =
FixedOffset::east(5 * 3600).ymd(2016, 11, 08).and_hms(0, 0, 0).with_t... | Rust | 0 |
from sqlalchemy import func
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.future import select
from fastapi import HTTPException, status
from models.wishlist.wishlist import Wishlist
from schemas.wishlist.wishlist import WishlistSchema
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm imp... | Python | 1 |
ightning_Kill_by_Galaxy_Gunner = 224,
Magrider_Kill_by_Galaxy_Gunner = 225,
Vanguard_Kill_by_Galaxy_Gunner = 226,
Prowler_Kill_by_Galaxy_Gunner = 227,
Scythe_Kill_by_Galaxy_Gunner = 228,
Reaver_Kill_by_Galaxy_Gunner = 229,
Mosquito_Kill_by_Galaxy_Gunner = 230,
LibKill_by_Galaxy_Gunner = 231,... | Rust | 0 |
(request_client.clone(),rx).spawn();
Self{
host,
tenant,
request_client,
subscribe_sender:tx,
subscribe_map: Default::default(),
subscribe_context: Default::default(),
}
}
pub fn gene_config_key(&self,data_id:&str,group:&st... | Rust | 0 |
ate_crc(0x95AC9329AC4BC9B5, 64, 0x0000000000000000, 0x0000000000000000, true)
let lookup_table = REF_64_95AC9329AC4BC9B5;
Self::create_crc_with_exists_lookup_table(
lookup_table,
64,
0x0000000000000000,
0x0000000000000000,
true,
)
... | Rust | 0 |
M[M[B]] <- M[A]
let mut m = Computer::new();
m.load_from_slice(&[6, 4, 5, 0, 8, 6, 7]);
assert_eq!(0, m.counter);
m.step();
assert_eq!([6, 4, 5, 0, 8, 6, 8], m.dump());
assert_eq!(4, m.counter);
}
#[test]
fn it_runs_opcode_7() {
// M[A] <- M[B] + M[C... | Rust | 0 |
peer_id: init_peer_id.to_string(),
service_id: service_id.to_string(),
service_creator_peer_id: service_creator_peer_id.to_string(),
host_id: host_id.to_string(),
particle_id: particle_id.to_string(),
tetraplets: tetraplets.clone(),
... | Rust | 0 |
ICES, default='seed')
quantity = models.DecimalField(max_digits=10, decimal_places=2, default=0, blank=True, null=True)
unit = models.CharField(max_length=50, default='kg', blank=True, null=True) # Unit of measurement
cost_per_unit = models.DecimalField(max_digits=10, decimal_places=2, default=0, blank=Tru... | Python | 1 |
3: mint::ColumnMatrix4x3<f32>,
mat4: mint::ColumnMatrix4<f32>,
arrf: [f32; 32],
arru: [u32; 32],
arri: [i32; 32],
arrvf: [mint::Vector2<f32>; 16],
arrvu: [mint::Vector3<u32>; 16],
arrvi: [mint::Vector4<i32>; 16],
arrm2: [mint::ColumnMatrix2<f32>; 8],
arrm3: [mint::ColumnMatrix3<f32>;... | Rust | 0 |
import cv2
import numpy as np
import pytesseract
from PIL import Image
import os
import re
from enum import Enum
class PreprocessingMethod(Enum):
NONE = "none"
MORPHOLOGICAL = "morphological"
ADAPTIVE_THRESHOLD = "adaptive_threshold"
CANNY_EDGES = "canny_edges"
GAUSSIAN_BLUR = "gaussian_blur"
... | Python | 1 |
from aiogram import Router, F, Bot
from aiogram.types import Message
from aiogram.filters import Command, CommandObject, CommandStart
from keyboards import reply, fabrics, inline, builders
from data.tems import tems
from handlers.questionaire_vshp import formatted_text
from handlers.questionaire_zargor import zaiv_text... | Python | 1 |
ing>, 1024);
let channels = pipe_channels!(rx0, [tx1]);
let config = config!(StringSplitterConfig, "resources/catalogs/text_splitter.yml");
let pipe = mapper!("text_splitter");
let f0 = populate_records(tx0, vec!["foo bar".to_owned()]);
f0.await;
join_pipes!([run_pipe!(pi... | Rust | 0 |
) -> Self::Return {
write!(self.f, "ERROR EXPRESSION {}", position)
}
}
impl<Identifier: fmt::Debug + fmt::Display + Clone> fmt::Display for BaseExpression<Identifier> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
ExpressionPrinter::new(f).accept_expression(self)
}... | Rust | 0 |
};
}
::std::result::Result::Ok(())
}
// Compute sizes of nested messages
#[allow(unused_variables)]
fn compute_size(&self) -> u32 {
let mut my_size = 0;
if let Some(ref v) = self.src.as_ref() {
my_size += ::protobuf::rt::string_size(1, &v);
... | Rust | 0 |
"Microsoft Corporation"
def test_windows_7_32bit_system_details(pml_reader_windows7_32bit):
system_details = pml_reader_windows7_32bit.system_details()
assert system_details["Computer Name"] == "WIN-5V8CQK0CP5H"
assert system_details["Operating System"] == "Windows 7, Service Pack 1 (build 7601.2)"
a... | Python | 1 |
None
}
}
}
<filename>hphp/hack/src/parser/syntax_smart_constructors.rs
/**
* Copyright (c) 2016, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the "hack" directory of this source tree. An additional
* directory.
*
**
*
... | Rust | 0 |
This register you can [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [prset0](prset0) module"]
pub type PRSET0 = crate::Re... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.