text string | label_name string | labels int64 |
|---|---|---|
mut b = color[2];
let mut a = color[3];
if r < 0.0 { r = 0.0; }
else if r > 1.0 { r = 1.0; }
if g < 0.0 { g = 0.0; }
else if g > 1.0 { g = 1.0; }
if b < 0.0 { b = 0.0; }
else if b > 1.0 { b = 1.0; }
if a < 0.0 { a = 0.0; }
else if a > 1.0 { a = 1.0; }
[r, g, b, a]
}
/// M... | Rust | 0 |
hash(&mut state)
}
}
impl<T: fmt::Debug + 'static> DebugBytes for T {
#[inline]
unsafe fn fmt_bytes(
bytes: &[MaybeUninit<u8>],
f: &mut fmt::Formatter,
) -> Result<(), fmt::Error> {
let typed_data: &T = Bytes::from_bytes(bytes);
typed_data.fmt(f)
}
}
pub type CloneF... | Rust | 0 |
from __future__ import annotations
import numpy as np
import pytest
from numpy.random import default_rng
from tidy3d.material_library.parametric_materials import (
GRAPHENE_FIT_ATOL,
GRAPHENE_FIT_FREQ_MAX,
GRAPHENE_FIT_FREQ_MIN,
GRAPHENE_FIT_NUM_FREQS,
Graphene,
)
from ..utils import AssertLogLev... | Python | 1 |
ut sched = Local::take::<Scheduler>();
let task = Cell::new(task);
do sched.event_loop.callback_ms(10) {
rtdebug!("in callback");
let mut sched = Local::take::<Scheduler>();
sched.enqueue_task(task.take());
... | Rust | 0 |
se_globals)] pub const DRAW_BUFFER8: types::GLenum = 0x882D;
#[allow(dead_code, non_upper_case_globals)] pub const DRAW_BUFFER9: types::GLenum = 0x882E;
#[allow(dead_code, non_upper_case_globals)] pub const DRAW_FRAMEBUFFER: types::GLenum = 0x8CA9;
#[allow(dead_code, non_upper_case_globals)] pub const DRAW_FRAMEBUFFER_... | Rust | 0 |
cp, udp
Pop3 = 110, // tcp, udp
Sunrpc = 111, // tcp, udp
Ident = 113, // tcp, udp
Ntp = 123, // tcp, udp
NetbiosNs = 137, // tcp, udp
NetbiosDgm = 138, // tcp, udp
NetbiosSsn = 139, // tcp, udp
Imap = 143, // tcp, udp
... | Rust | 0 |
maximum length of a TCP header.
pub const MAX_HDR_LEN: usize = 60;
/// The maximum length of the options in a TCP header.
pub const MAX_OPTIONS_LEN: usize = MAX_HDR_LEN - HDR_PREFIX_LEN;
const CHECKSUM_OFFSET: usize = 16;
const CHECKSUM_RANGE: Range<usize> = CHECKSUM_OFFSET..CHECKSUM_OFFSET + 2;
#[derive(Debug, Defa... | Rust | 0 |
free*/ 0, 32, 48, 56, 64, 80, 96, 112, 128, 144,
160, 176, 192, 224, 256,
],
[
// Mpeg2 Layer2
/*free*/ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96,
112, 128, 144, 160,
],
[
// Mpeg2 Layer3
/*free*/ 0, 8, 16, 24, 32, 40... | Rust | 0 |
# This file is part of Indico.
# Copyright (C) 2002 - 2025 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from flask import session
from indico.core import signals
from indico.modules.admin.controllers.base impo... | Python | 1 |
GreaterThan => ">",
BinaryOp::LessThanEqual => "<=",
BinaryOp::GreaterThanEqual => ">=",
BinaryOp::Concat => "&",
BinaryOp::And => "and",
BinaryOp::Or => "or",
BinaryOp::In => "in",
BinaryOp::Map => ".",
BinaryOp::Range => "... | Rust | 0 |
s=False, message="Term not found")
del glossary[request.name]
return glossary_pb2.OperationStatus(success=True, message="Term deleted successfully")
def serve():
server = grpc.server(futures.ThreadPoolExecutor(max_workers=10))
glossary_pb2_grpc.add_GlossaryServiceServicer_to_server(GlossaryServ... | Python | 1 |
# wm, 6.12.2006
from Tkinter import *
from sys import stdout
from random import randint
def see(canvas, item):
x1, y1, x2, y2 = canvas.bbox(item)
cx = (x1+x2)/2
cy = (y1+y2)/2
xo = canvas.canvasx(0)
yo = canvas.canvasy(0)
w = canvas.winfo_width()
h = canvas.winfo_height()
canvas.scan_mark(int(cx), i... | Python | 1 |
sembler::run_test(input).unwrap();
let expected_output = "v2.0 raw\nde01 de00 deff defe defd ";
assert_eq!(output, expected_output);
}
#[test]
fn calculator_example() {
let input = "
.text
.syntax unified
.eabi_attribute 67, \"2.09\" @ Tag_conform... | Rust | 0 |
imbs[i] &= BOTTOM_28_BITS;
i += 1;
}
let mut result = Montgomery { limbs };
result.reduce_carry(carry);
result
}
}
#[allow(clippy::suspicious_arithmetic_impl)]
// Clippy warns when it sees an addition being done in Sub implementation
// which here is completely fine.
i... | Rust | 0 |
Default::default(),
io_preferred: Default::default(),
io_alternative: Default::default(),
uc_preferred: Default::default(),
uc_alternative: Default::default(),
rs_preferred: Default::default(),
rs_alternative: Default::default(),
rsf_p... | Rust | 0 |
90\x0f\xa6O\
\x91\x8f\x0f\x9cg\xcd\xa7\x82\xef)\xa9ggD\xa1\xb9\
'C}kw\x91?:\x8e\xed\xbbO\xdd\xb9#\xe6\
\xb1\xa0\x99\xa1\x84\x7f\xed\xce\xa9C\xfeN\x8f\xec?p\
W\x83M%*.\x0f\xe7\xed%\xdeW\xb5\x99\x88\x98\
\x97\xf8l\x18G\x8f\xeaf\x13#\xb5t\x91:\x7f:\
\xd9\x9e#|\x0dyb;\x9c(\xae\x7f \xb0\x8f\xda\
\xee|Xd\x81H\xf2\x15\xe4\x93... | Python | 1 |
_base_ = 'retinanet_pvtv2-b0_fpn_1x_coco.py'
model = dict(
backbone=dict(
embed_dims=64,
num_layers=[3, 4, 6, 3],
init_cfg=dict(checkpoint='https://github.com/whai362/PVT/'
'releases/download/v2/pvt_v2_b2.pth')),
neck=dict(in_channels=[64, 128, 320, 512]))
| Python | 1 |
ess denied)
--_av-UfLe6y6qxNo54-urtAxbJQ
Content-Type: message/delivery-status
Content-Transfer-Encoding: 7bit
Original-Recipient: <{email_from}>
Action: failed
Diagnostic-Code: smtp; 554 5.7.1 <{email_from}>: Recipient address rejected: Access denied
Remote-MTA: 10.245.192.40
--_av-UfLe6y6qxNo54-urtAxbJQ--"""
M... | Python | 1 |
lizing the `include` query parameter as specified by [JSON API 1.0](https://jsonapi.org/format/1.0/#fetching-includes).\n\nAll related resource objects MUST be returned as part of an array value for the top-level `included` field, see the section JSON Response Schema: Common Fields.\n\nThe value of `include` MUST be a ... | Python | 1 |
.filter(|span| relevant.iter().any(|slice_span| slice_span.contains(*span)))
.collect::<Vec<_>>();
let slice = relevant;
let to_ranges = |v: Vec<Span>| {
v.into_iter()
.filter_map(|span| span.trim_leading_whitespace(source_map))
.flatten()
.filter_map(|span| ... | Rust | 0 |
optimize_00p(b: &mut ::test::Bencher) {
let bounds = default_bounds();
let mut triangles = create_n_cubes(10_000, &bounds);
intersect_scene_after_optimize(&mut triangles, &bounds, 0.0, None, 10, b);
}
#[bench]
fn bench_intersect_120k_after_optimize_01p(b: &mut ::test::Bencher) {
... | Rust | 0 |
d(0..self.num_indices, 0, 0..1); // 2.
}
// submit will accept anything that implements IntoIter
self.queue.submit(std::iter::once(encoder.finish()));
output.present();
Ok(())
}
}//! This module contains the C interface for [`stracciatella::vfs`].
//!
//! [`stracciatella::v... | Rust | 0 |
2 (a small amount of overhead is required
/// out of an even 4096 page for bookkeeping). We could make this a neat power of 2,
/// but then you'd end up doing an extra memory message for the overhead bits that
/// are left over.
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize, Copy, Clone)]
pub struc... | Rust | 0 |
oint_custom_scheduler(tmp_path, crash_on_epoch):
# Reproduces the bug reported in https://github.com/Lightning-AI/pytorch-lightning/issues/11665
model = CustomSchedulerModel(crash_on_epoch=crash_on_epoch)
resume_model = CustomSchedulerModel()
_swa_resume_training_from_checkpoint(tmp_path, model, resume_... | Python | 1 |
# Copyright (C) 2018-2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import numpy as np
import pytest
import torch
from pytorch_layer_test_class import PytorchLayerTest
class TestDevice(PytorchLayerTest):
def _prepare_input(self):
input_data = np.random.randint(127, size=(1, 3, 224, 224))
... | Python | 1 |
"""
The possible states that the process can be in.
"""
from states.singleton import Singleton
class PendingState(metaclass=Singleton):
"""
The state in between the production state.
"""
def __init__(self):
self.name = "pending"
self.text = "Pending"
self.modbus_value = 0
... | Python | 1 |
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from . import test_website_sale_stock_abandoned_cart_email
from . import test_website_sale_stock_multilang
from . import test_website_sale_stock_product_configurator
from . import test_website_sale_stock_product_warehouse
from . import test_web... | Python | 1 |
ype=np.float32)
self.neural_network_outputs = np.zeros((21, 1),dtype=np.float32)
self.delta_position = np.array([0.0, 0.0])
self.age = 0
cell_max_age = 1000
def __str__(self):
return "Cell"
def set_neural_network(self, weight_input_to_hidden, bias_input_to_hidden, weight_h... | Python | 1 |
item = match seq.next_element()? {
Some(c) => c,
None => {
return Err($crate::serde::de::Error::custom("end of stream"))
}
};
}
Ok($thing(ret))
}
}
deserializer.deserialize_seq(Visitor)
}
}
#[cfg(feature = "serde")]
impl $crate::serde::Serializ... | Rust | 0 |
self.bit(variant.into())
}
}
#[doc = "Disable"]
#[inline(always)]
pub fn wkup_id_en_0(self) -> &'a mut W {
self.variant(WKUP_ID_EN_A::WKUP_ID_EN_0)
}
#[doc = "Enable"]
#[inline(always)]
pub fn wkup_id_en_1(self) -> &'a mut W {
self.variant(WKUP_ID_EN_A... | Rust | 0 |
Output<T> {
SteadyStateOutput {
time_series,
deletion_point: None,
batch_size: None,
batch_count: None,
batch_means: Vec::new(),
batches_mean: None,
batches_variance: None,
}
}
/// The steady-state output analys... | Rust | 0 |
listen_addr_in: SocketAddr,
/// Address to publish received LongFi packets to.
#[structopt(
value_name = "ADDR",
long = "longfi-publish",
default_value = "127.0.0.1:31340"
)]
pub longfi_publish_addr_out: SocketAddr,
/// Address to publish raw to-be-transmitted LoRa packets ... | Rust | 0 |
KeyValuePatProp) {
node.value.visit_with(self);
}
fn visit_ident(&mut self, i: &Ident) {
self.to.push((i.sym.clone(), i.span.ctxt()))
}
fn visit_var_declarator(&mut self, node: &VarDeclarator) {
node.name.visit_with(self);
}
}
mod lexer;
mod token;
mod expr;
mod utils;
... | Rust | 0 |
x = x.wrapping_sub(m);
y += 1;
}
}
x
}
fn mul128(u: u64, v: u64) -> U128 {
let u1 = u >> 32;
let u0 = u & (!0 >> 32);
let v1 = v >> 32;
let v0 = v & (!0 >> 32);
let t = u0 * v0;
let w0 = t & (!0 >> 32);
let k = t >> 32;
let t = u1 * v0 + k;
l... | Rust | 0 |
# main.py
from contextlib import asynccontextmanager
import requests # type: ignore
from app.db import create_db_and_tables
from inventory.routes.inventory import inventory_router
from fastapi import FastAPI, HTTPException
from typing import AsyncGenerator
from aiokafka import AIOKafkaConsumer # type: ignore
import a... | Python | 1 |
5\xb9\x19\x0d\
\x8f\x5c\xd2\x87G\xe0\x9f\xf6\x14\x8d\x5c9\x91\xbc@c\
\xa5C\xbf\xa2\x10\x83Q;\x18Qr\x056Ox\xc8\
?\x0dR\xde#\xae\xdcR;\xda\x8a\xbe\x06\x18\xd5w\
$\xb6\x05H\xd0\x00Q\xa7\x02H\x89{\xbc\x13\x01\xe6\
&\x81\x0eIE\xf3\xfb!\xcc/\xbc\xed\x17\x5ce2\
\x96A\x936\x004sm\x86\x00\xb0\xe0\xdcE\xfe\x1f\
\xd4-\x81\xf3\x1c... | Python | 1 |
charreplace_suffix!() ),
( SUFFIX_CHARREPL, "<C-V>U{hex<=8}", charreplace_suffix!() ),
( SUFFIX_CHARREPL, "<C-V>{dec<=3}", charreplace_suffix!() ),
( SUFFIX_CHARREPL, "{any}", charreplace_suffix!() ),
( SUFFIX_CHARREPL, "<C-C>", normal!() ),
( SUFFIX_CHARREPL, "<Esc>", act!(Acti... | Rust | 0 |
40,4,50
55,2,20
38,6,12
"};
const SAMPLE_2: &str = indoc::indoc! {"
class: 0-1 or 4-19
row: 0-5 or 8-19
seat: 0-13 or 16-19
your ticket:
11,12,13
nearby tickets:
3,9,18
15,1,5
5,14,9
"};
#[test]
fn test_ticke... | Rust | 0 |
n dhr12l1_mut(&self) -> *mut Dhr12l1 {
self.dhr12l1_reg().ptr()
}
#[doc="Get the *const pointer for the DHR12L1 register."]
#[inline] pub fn dhr12l1_ptr(&self) -> *const Dhr12l1 {
self.dhr12l1_reg().ptr()
}
#[doc="Read the DHR12L1 register."]
#[inline] pub fn dhr12l1(&self) -... | Rust | 0 |
plication did not change data");
for i in 0..nodes {
DrgPoRep::extract(
&pp,
&replica_id,
mmapped_data.as_mut(),
i,
Some(config.clone()),
)
.expect("failed to extract node data from PoRep");
// This is no longer working, s... | Rust | 0 |
AtomicU32, Ordering},
};
use lazy_static::lazy_static;
use matches::assert_matches;
use proptest::prelude::*;
use tokio::{runtime::Runtime, sync::oneshot};
use futures_util::FutureExt;
use mqtt3::{
proto::{ClientId, QoS},
ReceivedPublication,
};
use mqtt_broker::{
auth::{AllowAll, Authenticator, Authorize... | Rust | 0 |
: EPUB3 nav parsing failed: {str(e)}")
return toc_map
def parse_epub2_ncx(ncx_file):
"""Parse EPUB2 NCX document"""
toc_map = {}
try:
with open(ncx_file, 'rb') as f:
soup_ncx = BeautifulSoup(f, 'lxml-xml')
for nav_point in soup_ncx.find_all('navpoint'):
... | Python | 1 |
isation
try:
org_terms_url = reverse(
"organisation-terms-of-use",
kwargs={"organisation_slug": organisation.slug},
)
except NoReverseMatch:
raise NotImplementedError("Add org terms of use view.")
... | Python | 1 |
print('Albert einstein once said, "A person who never made a mistake never tried anything new"')
# output: Albert einstein once said, "A person who never made a mistake never tried anything new.''' | Python | 1 |
from pydantic import BaseModel, ConfigDict
from typing import List
from datetime import datetime
class Address(BaseModel):
street: str
city: str
zip_code: str
class User(BaseModel):
id: int
name: str
email: str
is_active: bool = True
createdAt: datetime
address: Address
tags: L... | Python | 1 |
import FWCore.ParameterSet.Config as cms
generator = cms.EDFilter("Pythia8GeneratorFilter",
comEnergy = cms.double(13000.0),
crossSection = cms.untracked.double(8.071e+10),
filterEfficiency = cms.untracked.double(0.024),
maxEventsToPrint = cms.untracked.int32(0),
pythiaHepMCVerbosity = cms.untracked.bool(False),
... | Python | 1 |
'percentage': coverage_percent
}
except:
pass
break
return coverage_data
except:
return None
def analyze_module_coverage():
"""Analyze coverage by module category"""
coverage_categories = {
... | Python | 1 |
s[weight].compute_inline()
batch, in_dim = get_const_tuple(data.shape)
out_dim, _ = get_const_tuple(weight.shape)
in_dim_factor = 4
assert in_dim % in_dim_factor == 0, f"Input dimension must divide {in_dim_factor}"
if in_dim % 16 == 0:
in_dim_factor = 16
# create tuning space
... | Python | 1 |
##################
def preprocess_config(cfg: DictConfig):
# resolve configuration interpolations which are using hydra choices
choices = cfg.hydra.runtime.choices
cfg.hydra = OmegaConf.create({'runtime': {'choices': choices}})
cfg = OmegaConf.to_container(cfg, resolve=True)
# remove hydra co... | Python | 1 |
_fields())?;
::std::result::Result::Ok(())
}
fn get_cached_size(&self) -> u32 {
self.cached_size.get()
}
fn get_unknown_fields(&self) -> &::protobuf::UnknownFields {
&self.unknown_fields
}
fn mut_unknown_fields(&mut self) -> &mut ::protobuf::UnknownFields {
&mu... | Rust | 0 |
def validate_input(trans, error_map, param_values, page_param_map):
"""
Validates the user input, before execution.
"""
factors = param_values['rep_factorName']
factor_name_list = []
factor_duplication = False
level_duplication = False
for factor in factors:
# factor names s... | Python | 1 |
clusive;
use std::path::Path;
use asm6502::Opcode;
use nestle_ines::Ines;
use crate::mapper::{Mapper, NROM};
use crate::memory::Memory;
use crate::register::Registers;
pub struct CPU {
registers: Registers,
memory: Memory,
}
impl CPU {
pub fn from_path(path: &Path) -> Result<Self> {
let ines = I... | Rust | 0 |
import os
import unittest
from dotenv import load_dotenv
from ffbb_api_client_v2 import ApiFFBBAppClient
class Test000ApiFfbbAppClient(unittest.TestCase):
def setUp(self):
load_dotenv()
api_token = os.getenv("API_FFBB_APP_BEARER_TOKEN")
if not api_token:
self.skipTest("API_F... | Python | 1 |
html
use core::arch::asm;
/// CEASE, core halt instruction
///
/// This function will never return and will immediately cease the current hart.
///
/// # Unsafety
///
/// Calling this function is unsafe, because the resource this function uses
/// is not freed (i.e. `fn drop` in Drop trait is not called) aft... | Rust | 0 |
Element>(&document()
.create_element("br")
.unwrap()
.try_into()
.unwrap());
display1.append_child(&document().create_text_node("^ for exponentation"));
display1.append_child::<HtmlElement>(&document()
... | Rust | 0 |
# Copyright 2025 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 agreed to in writing, s... | Python | 1 |
= " `FT_DEBUG_LEVEL_ERROR` to get meaningful descriptions."]
#[doc = " 'error_string' will be `NULL` otherwise."]
#[doc = ""]
#[doc = " Module identification will be ignored:"]
#[doc = ""]
#[doc = " ```c"]
#[doc = " strcmp( FT_Error_String( FT_Err_Unknown_File_Format ),"]
#[doc... | Rust | 0 |
""" Newton-Raphson method and associated functions"""
from typing import Callable
import math
import numpy as np
import matplotlib.pyplot as plt
def target_function(x: float) -> float:
"""Target function to find/estimate the roots"""
return -math.log10(x) / x
def prime_of_target(x: float) -> float:
"""... | Python | 1 |
GB;L"),
"RGBA": ("RGBA", "RGBA;L"),
"RGBX": ("RGBX", "RGBX;L"),
"CMYK": ("CMYK", "CMYK;L"),
"YCbCr": ("YCC", "YCbCr;L"),
}
def _save(im, fp, filename):
try:
image_type, rawmode = SAVE[im.mode]
except KeyError as e:
raise ValueError(f"Cannot save {im.mode} images as IM") from e... | Python | 1 |
64,
pub message: [u8; 32],
}
#[derive(Debug, PartialEq, Ssz, Default)]
struct State {
pub messages: Vec<Message>,
}
#[derive(Debug, PartialEq, Ssz, Default)]
struct InputBlock {
pub new_messages: Vec<Message>,
pub state: State,
}
#[test]
fn bazaar_m... | Rust | 0 |
new_network();
let net4 = hub.new_network();
// net1 and net2 already connected
net1.dial_mock(&net2);
// event stream starts here
let (peers, mut events) = net1.get_peer_updates();
// net1 dials net3
net1.dial_mock(&net3);
// net1 is dialed by net3
... | Rust | 0 |
"""ANTS interfaces."""
from nipype.interfaces.base import traits
from nipype.utils.filemanip import fname_presuffix
from niworkflows.interfaces.fixes import (
FixHeaderApplyTransforms,
_FixTraitApplyTransformsInputSpec,
)
class _ApplyTransformsInputSpec(_FixTraitApplyTransformsInputSpec):
# Nipype's vers... | Python | 1 |
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Load the data
data = pd.read_csv('treated_data.csv')
# Define a function to convert comma-separated strings to lists of floats
def str_to_list(s):
return list(map(float, s.strip('[]').split(',')))
# Apply the conversion function to the colu... | Python | 1 |
impl_compare!(lhs.as_ref(), rhs.as_ref(), lt_eq)
}
/// Create a boolean mask by checking if lhs < rhs.
fn like(&self, rhs: &Series) -> Result<DFBooleanArray> {
let (lhs, rhs) = coerce_cmp_lhs_rhs(self, rhs)?;
impl_compare!(lhs.as_ref(), rhs.as_ref(), like)
}
/// Create a bo... | Rust | 0 |
bug, Deserialize, Serialize, Display, Copy, Clone, DieselNewType, Hash, PartialEq, Eq, FromStr,
)]
pub struct HandleId(i64);
impl HandleId {
pub fn stub_id() -> Self {
Self(123)
}
pub fn random() -> Self {
Self(rand::thread_rng().gen())
}
}
#[derive(
Debug, Deserialize, Serialize,... | Rust | 0 |
import os
from FlagEmbedding import FlagAutoReranker
def test_base_multi_devices():
model = FlagAutoReranker.from_finetuned(
'BAAI/bge-reranker-large',
use_fp16=True,
batch_size=128,
query_max_length=256,
max_length=512,
devices=["cuda:3", "cuda:4"], # if you don'... | Python | 1 |
ts)==1:
outputs = outputs[0]
# Create a hash from the rounded outputs
# Round to 6 decimal places to handle floating point differences
rounded_outputs = torch.round(outputs * 1e6) / 1e6
output_bytes = rounded_outputs.cpu().numpy().tobytes()
... | Python | 1 |
import re
import asyncio
from typing import Any
from contextlib import suppress
from datetime import datetime, timedelta
from aiogram import types, Router, F, Bot
from aiogram.types import CallbackQuery, Message, FSInputFile, ChatPermissions
from aiogram.fsm.state import State, StatesGroup
from aiogram.fsm.context im... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
POC Name : XMaker数字报纸通用型get注入漏洞 8 处
Author : a
mail : a@lcx.cc
"""
import urlparse
def assign(service, arg):
if service == 'xplus':
arr = urlparse.urlparse(arg)
return True, '%s://%s/' % (arr.scheme, arr.netloc)
def audit(arg):
ps ... | Python | 1 |
features: `\"Win32_System_RemoteManagement\"`, `\"Win32_Foundation\"`*"]
#[cfg(feature = "Win32_Foundation")]
pub fn WSManPluginAuthzOperationComplete(senderdetails: *const WSMAN_SENDER_DETAILS, flags: u32, userauthorizationcontext: *const ::core::ffi::c_void, errorcode: u32, extendederrorinformation: ::windows... | Rust | 0 |
values_to_primitive::<Int32Type>(av)
.into_date()
.into_series(),
#[cfg(feature = "dtype-datetime")]
AnyValue::Datetime(_, tu, tz) => any_values_to_primitive::<Int64Type>(av)
.into_datetime(*tu, (*tz).clone()... | Rust | 0 |
t IONICON__LOCK_OPEN_OUTLINE: ::std::os::raw::c_int = 62345;
pub const IONICON__LOCK_OPEN_SHARP: ::std::os::raw::c_int = 62346;
pub const IONICON__LOG_IN: ::std::os::raw::c_int = 62347;
pub const IONICON__LOG_IN_OUTLINE: ::std::os::raw::c_int = 62348;
pub const IONICON__LOG_IN_SHARP: ::std::os::raw::c_int = 62349;
pub ... | Rust | 0 |
n(allowed)
def returnBest(
self,
paths: list[tuple[int, str]],
amount: int
) -> list[str]:
"""Returns the files that fit the query the best.
Args:
paths (list[tuple[int, str]]): List of full paths to files.
amount (int): Amount of files ret... | Python | 1 |
from .model_pipeline import ModelPipeline
__all__ = ["ModelPipeline"]
| Python | 1 |
import streamlit as st
st.set_page_config(layout="wide")
st.markdown("### Differentiation")
summary_differentiation = """
Differentiation is the process of finding the slope or rate of change of a function at a particular point.
\nThis is also known as the first derivative of a function or the gradient function.
\nT... | Python | 1 |
ta])* $($lit:literal => $ident:ident),*) => {
$(#[$attr])*
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub enum BuiltinKeyword {
NoKeyword,
$($ident),*
}
#[static_init::dynamic]
static BUILTIN_KEYWORDS: fnv::FnvHashMap<CastAsciiLowerCase<'static>... | Rust | 0 |
s_by(Self::check_count);
if self.i == 0 { 0 } else { 1 + A { i: self.i - 1}.count() } // FAILS
}
#[proof] #[verifier(decreases_by)]
fn check_count(self) {
}
}
} => Ok(())
}
test_verify_one_file! {
#[test] proof_decreases_when_ok code! {
... | Rust | 0 |
import discord
from discord.ext import commands
from discord import app_commands
class LockAll(commands.Cog):
def __init__(self, bot):
self.bot = bot
async def lock_category(self, interaction_or_ctx, category):
for channel in category.channels:
if isinstance(channel, discord.TextCh... | Python | 1 |
can [`read`](crate::generic::Reg::read). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [sar_touch_status2](index.html) module"]
pub struct SAR_TOUCH_STATUS2_SPEC;
impl crate::RegisterSpec for SAR_TOUCH_STATUS2_SPEC {
type Ux = u32;
}
#[doc = "`read()` m... | Rust | 0 |
, Debug)]
#[serde(untagged)]
pub enum ExtraProbePeer {
Present { addrvec: Vec<AddrVec> },
Absent(String),
}
#[derive(Deserialize, Debug)]
pub struct AddrVec {
r#type: String,
addr: String,
nonce: i32,
}
#[derive(Deserialize, Debug)]
pub struct MonMap {
pub epoch: u64,
pub fsid: Uuid,
p... | Rust | 0 |
t);
return r;
}
}
}
}
}
/*
* 接收缓冲区
*/
struct RecvBuf<T: 'static> {
sender: Sender<T>, //发送者
deque: AtomicPtr<VecDeque<T>>, //队列
buf: UnsafeCell<Option<T>>, //缓冲区
}
/*
* 双端队列的接收者
*/
pub struct Receiver<T: 'sta... | Rust | 0 |
await self.db_request(db_request)
else:
await self.db_request(db_request)
async def delete(self, instanced_model):
db_request = [
{
"action": "_db__delete",
"id_data": "{}={}".format(instanced_model.db_pk, getattr(ins... | Python | 1 |
ULT),
1,
10_000,
BtcAddress::P2PKH(H160([1; 20]))
))
.dispatch(origin_of(account_of(NEW_VAULT))),
ReplaceError::AmountBelowDustAmount
);
// if the old_vault does not have sufficient to-be... | Rust | 0 |
get(type_id);
if senders.is_none() {
return;
}
for sender in senders.unwrap() {
let result = sender.send(entity_id);
if let Err(error) = result {
println!("Error sending remove notification {}!", error);
}
}
}
}use sup... | Rust | 0 |
TYPE = 13,
CHANNEL_B_TYPE = 14,
CHANNEL_A_DRIVER = 15,
CHANNEL_B_DRIVER = 16,
CBUS_FUNCTION_0 = 17,
CBUS_FUNCTION_1 = 18,
CBUS_FUNCTION_2 = 19,
CBUS_FUNCTION_3 = 20,
CBUS_FUNCTION_4 = 21,
CBUS_FUNCTION_5 = 22,
CBUS_FUNCTION_6 = 23,
CBUS_FUNCTI... | Rust | 0 |
he document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass
# [howto/manual]).
latex_documents = [
("index", "pint.tex", "pint Documentation", "PINT Developers", "manual")
]
# The name of an image file (relative to this directory) to place at
# the top of the t... | Python | 1 |
idget, WidgetExt, WindowDesc};
use druid::im::vector::Vector;
use druid::text::ParseFormatter;
use druid::widget::{Align, Button, Checkbox, CrossAxisAlignment, Flex, Label, LabelText, TabInfo, Tabs, TabsPolicy, TextBox, ValueTextBox, ViewSwitcher};
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
con... | Rust | 0 |
import pathlib
import random
import shutil
from utiles import utils_fish_landmark_detection
if __name__ == '__main__':
label_file_path = pathlib.Path('H:/code/python/IRFishDetection2.0.0/dataset2.1/poly_and_used_defined_label/all_checked_label/user_defined_json_1.0_2.0')
train_file_path = pathlib.Path('H:/code/... | Python | 1 |
a_handle) = target_layer("a");
let (b_layer, b_handle) = target_layer("b");
let (all_layer, all_handle) = layer::named("all")
.enter(span::mock().with_target("b"))
.enter(span::mock().with_target("a"))
.event(event::msg("hello world").in_scope(vec![
span::mock().with_target(... | Rust | 0 |
#----------------------------------------------------------------------
# Copyright (c) 2010 Raytheon BBN Technologies
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and/or hardware specification (the "Work") to
# deal in the Work without restriction, including witho... | Python | 1 |
.307v-.355c0-.718.273-.927 1.01-1.486.609-.463 1.244-.977 1.244-2.056 0-1.511-1.276-2.241-2.673-2.241-1.326 0-2.786.647-2.754 2.533zm1.562 5.516c0 .533.425.927 1.01.927.609 0 1.028-.394 1.028-.927 0-.552-.42-.94-1.029-.94-.584 0-1.009.388-1.009.94z"/>
</svg>
</p>
</p>
}
} else {
html! { time }... | Rust | 0 |
gister.A = 1;
// test_instruction!(cpu, cpu.register.A, 2, 4);
//
// let mut cpu = CPU::new(MemorySpace::new(&[0x80]));
// cpu.register.B = 1;
// test_instruction!(cpu, cpu.register.A, 1, 4);
//
// let mut cpu = CPU::new(MemorySpace::new(&[0x81]));
// cpu.register.C = 1;
// test_instruction!... | Rust | 0 |
gest)
if answer:
return answer
answer = _beautify(text, lang, **beauty_options)
cache.put(digest, answer)
return answer
def __main__():
text = sys.stdin.read()
filetype = sys.argv[1]
options = {
"": {},
"c": dict(add_comments=True),
"C": dict(add_comments=Fa... | Python | 1 |
# -*- coding: utf-8 -*-
import json
import ujson
import pytest
correct_get_block_1000_response = {
"id": 1,
"result":
{"previous": "000003e7c4fd3221cf407efcf7c1730e2ca54b05",
"timestamp": "2016-03-24T16:55:30", "witness": "initminer",
"transaction_merkle_root": "000000000000000000000000000000000... | Python | 1 |
_parser(input: &str) -> IResult<&str, (&str, Vec<ParsedField>)> {
alt((
tuple((tag_address_parser, fields_parser)),
tuple((
tag_address_without_fields_parser,
internal::succeed(|| vec![]),
)),
))(input)
}
fn tag_address_parser(input: &str) -> IResult<&str, &str> ... | Rust | 0 |
"""
Advent of Code 2023
Day: 11
Problem: 01
Author: Nathan Rand
Date: 09.22.2024
"""
import numpy as np
_GALAXY_CHAR = "#"
_EMPTY_SPACE_CHAR = "."
def expand_universe(universe: np.array):
"""Expands the provided universe"""
expanded_universe = []
for i, universe_strip in enumerate(universe):
if _G... | Python | 1 |
error::NetworkManager::Lif(error::Lif::NotSupported));
}
let reserved: Vec<PortId> = ports
.iter()
.filter_map(|p| if self.port_manager.use_port(*p) { Some(*p) } else { None })
.collect();
if reserved.len() != ports.len() {
self.release_ports(&rese... | Rust | 0 |
#!/usr/bin/env python3
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "pykka",
# ]
# ///
import pprint
import socket
from ipaddress import IPv4Address
import pykka
class Resolver(pykka.ThreadingActor):
def resolve(self, ip: IPv4Address) -> str | None:
try:
info = socket.g... | Python | 1 |
print("Welcome to the Space Mission")
choice1 = input("Do you want to go 'to the moon' or 'to Mars'? ")
if choice1 == "to mars":
print("Game Over")
elif choice1 == "to the moon":
choice2 = input("Do you want to 'land on the surface' or 'stay in orbit'? ")
if choice2 == "land on the surface":
print("... | Python | 1 |
# Given an array of strings strs, group all anagrams together into sublists. You may return the output in any order.
from collections import defaultdict
class Solution:
def groupAnagrams(self, strs: list[str]) -> list[list[str]]:
res = defaultdict(list) # mapping charCount to List of Anagrams
for... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.