text string | label_name string | labels int64 |
|---|---|---|
arts)
return (result,)
# 否则使用模板替换
replacements = {
"{role}": role_val,
"{clothing}": clothing_val,
"{hairstyle}": hairstyle_val,
"{skin}": skin_val,
"{face shape}": face_shape_val,
"{ears}": ears_val,
... | Python | 1 |
# Copyright 2022 Huawei Technologies Co., Ltd
#
# 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... | Python | 1 |
# Generated by Django 4.0.5 on 2025-07-30 20:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cook_for_kids', '0012_globalsettings'),
]
operations = [
migrations.AlterModelOptions(
name='globalsettings',
option... | Python | 1 |
rue, a[1:] > a[:-1]] & N.r_[a[:-1] > a[1:], True]
p = N.array(N.where(peaks)[0])
maxidx = N.zeros(N.shape(p))
maxvals = N.zeros(N.shape(p))
for i, pk in enumerate(p):
maxidx[i] = N.argmax(vec[pk - 16:pk + 16]) + pk - 16
maxvals[i] = N.max(vec[pk - 16:pk + 16])
out = N.array([maxidx,... | Python | 1 |
(&self) -> Self { *self }
}
impl ::std::default::Default for Struct__HPDF_DashMode {
fn default() -> Self { unsafe { ::std::mem::zeroed() } }
}
pub type HPDF_DashMode = Struct__HPDF_DashMode;
#[repr(C)]
#[derive(Copy)]
pub struct Struct__HPDF_TransMatrix {
pub a: HPDF_REAL,
pub b: HPDF_REAL,
pub c: HPDF... | Rust | 0 |
eight, width).
target is the object returned by ``coco.loadAnns``.
"""
img_id = self.ids[index]
target = self.coco.imgToAnns[img_id]
ann_ids = self.coco.getAnnIds(imgIds=img_id)
target = self.coco.loadAnns(ann_ids)
path = osp.join(self.root, self.coco.... | Python | 1 |
import sys
import socket
import pyfiglet
ascii_banner = pyfiglet.figlet_format("Hamza_Elatmani \n Python 4 Pentesters \nPort Scanner")
print(ascii_banner)
ip = '10.9.231.156'
open_ports =[]
ports = range(1, 65535)
def probe_port(ip, port, result = 1):
try:
sock = socket.socket(socket.AF_INET, socket.SO... | Python | 1 |
sed,
group_all_fused,
group_all_buffers,
) = _fused_parameters_impl(
real_param,
use_main_grad=use_main_grad,
fuse_param=fuse_param,
comm_overlap=comm_overlap,
comm_group=comm_group,
... | Python | 1 |
:
filedata = f.read()
num = rel_path.count(os.sep)
if rel_path.startswith('comfyui'):
filedata = re.sub(r'(from\s+["\'])rgthree/', f'\\1{"../" * (num + 1)}rgthree/', filedata)
filedata = re.sub(r'(from\s+["\'])scripts/', f'\\1{"../" * (num + 1)}scripts/', filedata)
else:
filedata = re.sub(r'(from\... | Python | 1 |
, None] > cpr).sum(1)
for j in range(n):
OUT.write("%d, %d," % (i, y[j]))
OUT.write(",".join(["%.3f" % b for b in x[j, :]]) + "\n")
OUT.close()
def generate_poisson():
# Regression coefficients
beta = np.zeros(5, dtype=np.float64)
beta[2] = 0.5
beta[4] = -0.5
... | Python | 1 |
_by_name(&question.qname) {
builder = svc.add_srv_rr(services.get_hostname(), builder, DEFAULT_TTL);
builder = self.add_ip_rr(services.get_hostname(), builder, DEFAULT_TTL);
}
}
QueryType::TXT => {
if let Some(svc) = service... | Rust | 0 |
pr<S: Clone + PartialEq, F: Clone, P: Clone> {
True,
False,
Var(usize),
Apply(Predicate<S, P>, Vec<Pattern<F, usize>>)
}
impl<S: Clone + PartialEq, F: Clone + fmt::Display, P: Clone + fmt::Debug> fmt::Debug for Expr<S, F, P> {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
match self {
Expr::True => ... | Rust | 0 |
"2 * 3 + 4",
|arena| binop(arena, binop(arena, int(2), "*", int(3)), "+", int(4))
}
test_parse! {
expression2,
r#"\x y -> x + y"#,
|arena| lambda(arena,
"",
vec![intern("x"), intern("y")],
binop(arena, id("x"), "+", id("y")),
)
}
test_parse! {
expression3,
r#"t... | Rust | 0 |
Type::U:
return 0x16;
case KeybdKey::Type::V:
return 0x2f;
case KeybdKey::Type::W:
return 0x11;
case KeybdKey::Type::X:
return 0x2d;
case KeybdKey::Type::Y:
return 0x15;
case KeybdKey::Type::Z:
return 0x2c;
case KeybdKey::Type::Numpad0:
return 0x52;
... | Rust | 0 |
pleInheritance(
ParentDescriptor: PSECURITY_DESCRIPTOR,
CreatorDescriptor: PSECURITY_DESCRIPTOR,
NewDescriptor: *mut PSECURITY_DESCRIPTOR,
ObjectType: *mut *mut GUID,
GuidCount: ULONG,
IsDirectoryObject: BOOLEAN,
AutoInheritFlags: ULONG,
Token: HANDLE,
... | Rust | 0 |
_lookup = (geoip_lookup as *const GeoIpLookup).as_ref();
let normalizer = StoreProcessor::new(config, geoip_lookup);
Ok(Box::into_raw(Box::new(normalizer)) as *mut RelayStoreNormalizer)
}
}
ffi_fn! {
unsafe fn relay_store_normalizer_free(
normalizer: *mut RelayStoreNormalizer
) {
... | Rust | 0 |
def myfunc():
global x
x = "fantastic" | Python | 1 |
i) //~ ERROR can't compare `&i32` with `(i32, &i32)`
}
type Moo<'a, 'b> = (i32, impl PartialEq<Moo<'b, 'a>> + std::fmt::Debug);
fn moo<'a, 'b>(i: &'a i32) -> Moo<'a, 'b> {
(42, i) //~ ERROR can't compare `&i32` with `(i32, Moo<'b, 'a>::{opaque#0})`
}
fn main() {
let meh = 42;
let muh = 69;
assert_eq!... | Rust | 0 |
elf.gamma;
let f3_tau = Spair::random(rng, self.tau).unwrap();
let f4_alpha_a = Spair::random(rng, self.alpha_a).unwrap();
let f5_alpha_c = Spair::random(rng, self.alpha_c).unwrap();
let f6_rho_b = Spair::random(rng, self.rho_b).unwrap();
let f7_rho_a_rho_b = Spair::random(rng, ... | Rust | 0 |
red: 0.2,
green: 0.2,
blue: 0.2,
alpha: 1.0,
},
bottom_panel_color: Color::Rgba {
red: 0.17,
green: 0.17,
blue: 0.17,
alpha: 1.0,
},
text_color: Color::Rgba {
red: 0.9,
green: 0.6,
blue: 0.2,
alpha: 1.0,
... | Rust | 0 |
Decode,
<<N::Runtime as Runtime>::Signature as Verify>::Signer: From<<<C::KeyType as KeyType>::Pair as Pair>::Public>
+ TryInto<<<C::KeyType as KeyType>::Pair as Pair>::Public>
+ IdentifyAccount<AccountId = <N::Runtime as System>::AccountId>
+ Clone
+ Send
+ Sync,
C: Cli... | Rust | 0 |
import numpy as np
from opensourceleg.actuators.base import CONTROL_MODES
from opensourceleg.actuators.dephy import DephyActuator
from opensourceleg.logging.logger import Logger
from opensourceleg.robots.osl import OpenSourceLeg
from opensourceleg.sensors.encoder import AS5048B
from opensourceleg.utilities import Soft... | Python | 1 |
term, stop_term)
};
prop_assert_eq!(
native(&arc_process, binary, start_term, stop_term),
Err(badarg!().into())
);
Ok(())
},
)
.unwrap();
});
}
us... | Rust | 0 |
_extractor.rs
use super::html_link_extractor::HtmlLinkExtractor;
use super::markdown_link_extractor::MarkdownLinkExtractor;
use crate::markup::{MarkupFile, MarkupType};
use std::fmt;
/// Link found in markup files
#[derive(PartialEq, Clone)]
pub struct MarkupLink {
/// The source file of the link
pub source: S... | Rust | 0 |
("\x1b[31;1m"), String::from("\x1b[32;1m"), String::from("\x1b[34;1m"),
String::from("\x1b[36;1m"), String::from("\x1b[35;1m"), String::from("\x1b[33;1m"),
String::from("\x1b[0m"),
];
let mut color_maps: HashMap<Color, String> = HashMap::new();
keys.iter().zip(values.iter()).for_each(|(&k... | Rust | 0 |
if self.get(a) != 0 {
self.pos = self.get(b) as usize
}
} else {
panic!("Invalid jump_if_true(). Expected: Val, Val, found '{:?}' instead", param)
}
}
fn jump_if_false(&mut self, param: Vec<Val>) {
if let (Some(a), Some(b)) = (param.get(... | Rust | 0 |
r Comm args");
return;
}
};
unimplemented!();
}
<reponame>wcpannell/s32k1-pacs
#[doc = "Register `PARAM` reader"]
pub struct R(crate::R<PARAM_SPEC>);
impl core::ops::Deref for R {
type Target = crate::R<PARAM_SPEC>;
#[inline(always)]
fn deref(&self) -> &Self::Target {
&s... | Rust | 0 |
# kol2testy.py
from testy import *
from kol2test_spec import ALLOWED_TIME, TEST_SPEC, gentest
from copy import deepcopy
def copyarg( arg ):
return deepcopy(arg)
def printarg(*arg):
G = arg[0]
n = len(G)
e = 0
for i in range(n):
e += len(G[i])
print(f'V: {n}')
print(f'E: {e//2}')... | Python | 1 |
_ => {
return Err(constraint_error!(
"Unexpected Constraint Type '{:#?}'",
self
));
}
}
Ok(value_set)
}
fn parse_or_resolve_value(value: &String, resolver: &Resolver) -> Result<i128, Error> {
... | Rust | 0 |
rnes_hut' and the metric is
'precomputed', X may be a precomputed sparse graph.
y : None
Ignored.
Returns
-------
self : object
Fitted estimator.
"""
self.fit_transform(X)
return self
@property
def _n_features_out(sel... | Python | 1 |
eTokenBurned(AccountId, Hash),
}
);
decl_error! {
/// Errors inform users that something went wrong.
pub enum Error for Module<T: Config> {
/// Number is too large or less than zero.
NumOverflow,
/// The minimum value is 1.
AmountLessThanOne,
/// Amount too large (am... | Rust | 0 |
.geometry.bounding_box.height,
)
words_in_line.append(Word(text=clean_word_text, separator='', box=w_box))
full_line_text += clean_word_text
if full_line_text:
l_box = BoundingBox(
... | Python | 1 |
/// println!("{}", *lazy);
///
/// // Prints:
/// // ready
/// // initializing
/// // 92
/// // 92
/// ```
pub struct Lazy<T, F = fn() -> T> {
cell: OnceCell<T>,
init: Cell<Option<F>>,
}
#[cfg(feature = "std")]
impl<T, F: RefUnwindSafe> RefUnwind... | Rust | 0 |
list: String,
}
impl Into<PlayListWhere> for PlayListQuery {
fn into(self) -> PlayListWhere {
PlayListWhere {
play_list: (self.play_list),
}
}
}
impl Into<PlayListFilter> for PlayListQuery {
fn into(self) -> PlayListFilter {
PlayListFilter {
play_list: (self... | Rust | 0 |
sible(u8);
impl SRVCCOperationNotPossible {
const NOT_POSSIBLE: u8 = 0u8;
}
#[derive(Debug, AperCodec)]
#[asn(type = "ENUMERATED", extensible = true, lb = "0", ub = "0")]
pub struct SRVCCOperationPossible(u8);
impl SRVCCOperationPossible {
const POSSIBLE: u8 = 0u8;
}
#[derive(Debug, AperCodec)]
#[asn(type = "... | Rust | 0 |
Provider for GoogleProvider {
fn authorization_endpoint(&self) -> url::Url {
url::Url::parse("https://accounts.google.com/o/oauth2/v2/auth").unwrap()
}
fn token_endpoint(&self) -> url::Url {
url::Url::parse("https://oauth2.googleapis.com/token").unwrap()
}
fn validate_iss(&self, i... | Rust | 0 |
95a351786dd7a188515173f6928a8af8c9baa4dcff268a4f0f" is the hash of
// "0101010101010101010101010101010101010101010101010101010101010202"
let input_data: Vec<H256> = gen_merkle_tree_data_2!();
let merkle_tree = MerkleTree::new(&input_data);
let proof = merkle_tree.proof(0);
assert... | Rust | 0 |
kQueryHandler(self.handle_settings_callback),
MessageHandler(filters.AUDIO, self.handle_audio)
],
ADD_TYPE_NAME: [
MessageHandler(filters.TEXT & ~filters.COMMAND, self.handle_text_input),
CallbackQueryHandler(self.handle_setting... | Python | 1 |
dir = PathBuf::from(std::env::var("OUT_DIR").unwrap());
let new_app_templates_dir = cli_dir
.join("src")
.join("commands")
.join("new")
.join("templates");
let mut data = "".to_string();
for entry in fs::read_dir(&new_app_templates_dir)
.unwrap()
.into_iter(... | Rust | 0 |
/// If the string is marked as not owned then this function does not
/// do anything.
#[no_mangle]
pub unsafe extern "C" fn relay_str_free(s: *mut RelayStr) {
if !s.is_null() {
(*s).free()
}
}
/// Frees a Relay buf.
///
/// If the buffer is marked as not owned then this function does not
/// do anythin... | Rust | 0 |
# Generated by Django 3.2.11 on 2022-02-04 02:01
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("projects", "0002_auto_20220204_0201"),
("label_types", "0002_rename_relationtypes_relationtype"),
]
operat... | Python | 1 |
_hidden,logger=logger,use_ssl=args.use_ssl)
topology_model = topology_model.cpu()
if load_model:
logging.info("Loading Model ... ")
topology_model.load_state_dict(torch.load("checkpoint.pt"))
if save_model:
... | Python | 1 |