text string | label_name string | labels int64 |
|---|---|---|
o
:param _RecordMode: 录制类型:1代表单流 2代表混流 3代表单流和混流。
:type RecordMode: int
:param _RoomId: 房间ID。
:type RoomId: str
:param _RequestId: 唯一请求 ID,由服务端生成,每次请求都会返回(若请求因其他原因未能抵达服务端,则该次请求不会获得 RequestId)。定位问题时需要提供该次请求的 RequestId。
:type RequestId: str
"""
self._RecordIn... | Python | 1 |
ape[1]
#print(graphs[0].x.shape)
#print(graphs[0].y.shape)
#print(graphs[0].edge_index.shape)
ys = [graphs[i].y.item() for i in range(len(graphs))]
num_classes = len(np.unique(ys))
seed=12
rng = np.random.RandomState(seed)
train_mask = torch.zeros(len(graphs), dtype=torch.bool)
... | Python | 1 |
ad lookup the value of `self`
// through the `this` object, basically generating `this.self`.
//
// Unfortunately that's also hard to do! In ESM modes the top-level `this`
// object is undefined, meaning that we can't just generate a function that
// returns `this.self` as it'll throw "can't access ... | Rust | 0 |
1;
pub const TM_TT_PROP__GRAPH_INPUT__TYPE_HASH: ::std::os::raw::c_int = 2;
pub const TM_TT_PROP__GRAPH_INPUT__VALUE_SET_BY_USER: ::std::os::raw::c_int = 3;
pub const TM_TT_PROP__GRAPH_INPUT__VALUE: ::std::os::raw::c_int = 4;
pub const TM_TT_PROP__GRAPH_INPUT__TOOLTIP: ::std::os::raw::c_int = 5;
pub const TM_TT_P... | Rust | 0 |
import os
import zipfile
from google.cloud import storage
# Constants
BUCKET_NAME = "feedback-questions-embeddings-store"
ZIP_BLOB_NAME = "chroma_db/persistentdb.zip"
LOCAL_ZIP_PATH = "retrieved_chroma.zip"
LOCAL_EXTRACT_PATH = "./retrieved_chroma/"
# Initialize GCS client
storage_client = storage.Client()
def downl... | Python | 1 |
b /= 2;
} else if a < 170 {
// Cheapish and looks ok.
// Works for e.g. grid stripes.
let div = (2 * 255 / a as i32) as u8;
r = r / 2 + target.r() / div;
g = g / 2 + target.g() / div;
b = b / 2 + target.b() / div;
a /= 2;
} else {
r = r / 2 +... | Rust | 0 |
]
embed_lab(app["url"], app["title"], hide_top=0, hide_bottom = -5)
# === Tab 2: Control Flow & Logic (iframe ke ELPEEF) ===
with tabs[2]:
app = ELPEEF_APPS["Control Flow & Logic"]
embed_lab(app["url"], app["title"], hide_top=0, hide_bottom = -5)
# === Tab 3: Data Structures (iframe ke ELPEEF) ===
wit... | Python | 1 |
"""
删除Blender材质的工具
"""
import bpy
from ..registry import register_tool
import logging
from typing import Any, Dict, List, Optional
from ..base_tool_handler import BaseToolHandler
from ....utils import thread_utils
# 获取日志器
logger = logging.getLogger("BlenderMCP.DeleteMaterial")
class DeleteMaterialHandler(BaseToolHa... | Python | 1 |
len(key_responses) == 0: # did not found any
return [response]
return key_responses
key_responses = get_key_subresponses(response)
pred_list = key_responses.copy() # keep the original string response
for resp in key_responses:
pred_list.extend(extract_numbers(resp))
tmp... | Python | 1 |
# id 26436 ([Maple Rewards] Chaos Horntail Annihilation and Golden Glory), field 993017200
sm.setSpeakerID(9030200) # Worena
sm.setParam(1)
res = sm.sendAskYesNo("Whoa! You defeated the boss monster! \r\nI'll give you some #bReward Tokens#k for ridding Maple World of evil. Do you want them now?")
sm.createQuestWithQRVa... | Python | 1 |
0a, 0x09, b'H', b'e', b'l', b'l', b'o', b'F', b'o', b'o', b'o',
];
let config = peripheral::Config {
max_events: Some(1), // only send one advert
tx_power: TxPower::Plus3dBm,
primary_phy: nrf_softdevice::ble::Phy::Coded, // can primary be coded? I thought it couldn't
secondary_p... | Rust | 0 |
(TwGraphNode::LoadParam(0), vec![], None), // 0
(TwGraphNode::LoadConst(0), vec![], None), // 1
(TwGraphNode::GetField(0), vec![0], None), // 2
(TwGraphNode::DeleteFromSet, vec![1, 2], None), // 3
],
output: None,
output_type: None,
param_types: vec... | Rust | 0 |
ed_list.append(pred_values)
labels_list.append(label_values)
return selected_values, pred_list, labels_list
def padding_func(list):
max_len = 0
for i in list:
if len(i) > max_len:
max_len = len(i)
new_list = []
for i in l... | Python | 1 |
llvm_denom,
LLVMConstInt(llvm_i64, 0, 0),
libcstr!("denom_is_zero"),
);
// If the denominator 0 then raise a divide by zero error
LLVMBuildCondBr(
fcx.builder,
denom_is_zero,
div_by_zero_block,
non_zero_denom_bloc... | Rust | 0 |
import redis
from redis.exceptions import AuthenticationError, TimeoutError, RedisError
from ifupan.utils.log_util import logger
from ifupan.config.env import RedisConfig
class RedisUtil:
"""
Redis相关方法
"""
@classmethod
def create_redis_pool_sync(cls):
"""
应用启动时初始化redis连接
... | Python | 1 |
ine: &mut String::<1024>) -> Option<String::<1024>> {
let mut token = String::<1024>::new();
let mut retline = String::<1024>::new();
let lineiter = line.as_str().unwrap().chars();
let mut foundspace = false;
let mut foundrest = false;
for ch in lineiter {
if ch != ' ' && !foundspace {
... | Rust | 0 |
end(translated_name)
# 生成并打印带链接的翻译后的 Markdown 表格
markdown_table_with_translations = generate_markdown_with_links(translated_tactic_techniques, translations)
print("=markdown_table_with_translations=")
print(translated_tactic_techniques)
# 如果需要保存到文件
with open("./Attack_CN/docs/mitre_attack_tactic_techniques_with_trans... | Python | 1 |
#User function Template for python3
class Solution:
#Function to check whether there is a subarray present with 0-sum or not.
def subArrayExists(self,arr):
hashset = set()
s=0
for i in range(len(arr)):
s+=arr[i]
if s in hashset or s==0:
retur... | Python | 1 |
from unittest.mock import Mock
from pyramid import testing
from pytest import fixture
from pytest import mark
class TestTagsSheet:
@fixture
def meta(self):
from adhocracy_core.sheets.tags import tags_meta
return tags_meta
def test_create(self, meta, context):
from adhocracy_core... | Python | 1 |
import sys
import cv2 as cv
import numpy as np
from scipy import ndimage
# ฟังก์ชัน robert
def robert(image):
roberts_cross_v = np.array([[1, 0], [0, -1]])
roberts_cross_h = np.array([[0, 1], [-1, 0]])
image = image.astype('float64') / 255.0
vertical = ndimage.convolve(image, roberts_cross_v)
hori... | Python | 1 |
"""Passlib Hashing Backend."""
from typing import TYPE_CHECKING, Any, Union
from passlib.context import CryptContext # pyright: ignore
from advanced_alchemy.types.password_hash.base import HashingBackend
if TYPE_CHECKING:
from sqlalchemy import BinaryExpression, ColumnElement
__all__ = ("PasslibHasher",)
cl... | Python | 1 |
import streamlit as st
import google.generativeai as genai
import os
import PyPDF2 as pdf
from dotenv import load_dotenv
import json
# Load environment variables
load_dotenv()
# Configure the API key for Google Gemini
genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
# Function to get the Gemini model response
de... | Python | 1 |
state structs.
Some(())
}
fn initialize(&mut self, args: Self::Args) {
$(
self.$field_name.try_default_initialize();
)*
}
}
impl $crate::ContractState for $state_name {
const NAME: &'static str = stri... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# */AIPND-revision/intropyproject-classify-pet-images/get_pet_labels.py
#
# PROGRAMMER:
# DATE CREATED:
# REVISED DATE:
# PURPOSE: Create the function get_pet_l... | Python | 1 |
Case");
case.name.expect("Case must have a name")
})
.collect();
self.run_tests(test_names, proxy).await?;
}
}
}
Ok(())
}
async fn run_tests(
&self,
test... | Rust | 0 |
regular expressions. Enabling or disabling a feature will never modify the
match semantics of a regular expression.
The following features are available:
* **unicode** -
Enables all Unicode features. This feature is enabled by default, and will
always cover all Unicode features, even if more are added in the futu... | Rust | 0 |
trar_pontuacao_tempo(self):
tempo_decorrido = (pygame.time.get_ticks() - self.tempo_inicio) // 1000 # Em segundos
texto_nivel = self.fonte.render(f"Nível: {self.nivel}", True, design.BRANCO)
texto_pontuacao = self.fonte.render(f"Pontuação: {self.pontuacao}", True, design.BRANCO)
texto_t... | Python | 1 |
null());
let _new = ldf.collect().unwrap();
let ldf = df
.lazy()
.with_column(
when(col("sepal.length").lt(lit(5.0)))
.then(
lit(3), // is another type on purpose to check type coercion
)
.otherwise(col("sepal.width... | Rust | 0 |
socket.
///
/// For more information about this option, see
/// [`set_multicast_ttl_v4`][link].
///
/// [link]: #method.set_multicast_ttl_v4
pub fn multicast_ttl_v4(&self) -> io::Result<u32> {
self.sys.multicast_ttl_v4()
}
/// Sets the value of the `IP_MULTICAST_TTL` option for... | Rust | 0 |
1]),
vertex([1, -1, 1], [0, 0, 1]),
vertex([1, 1, 1], [0, 0, 1]),
vertex([-1, 1, 1], [0, 0, 1]),
vertex([-1, 1, -1], [0, 0, -1]),
vertex([1, 1, -1], [0, 0, -1]),
vertex([1, -1, -1], [0, 0, -1]),
vertex([-1, -1, -1], [0, 0, -1]),
vertex([1, -1, -1], [1, 0, 0]),
vertex([1, 1, -1], [1, ... | Rust | 0 |
// 0x20
// Jae_rel32_64
0x1F,// os_jcc_2
0x94, 0x01,// 148 = "jae"
0x40,// 0x40
// Je_rel16
0x1F,// os_jcc_2
0x97, 0x01,// 151 = "je"
0x10,// 0x10
// Je_rel32_32
0x1F,// os_jcc_2
0x97, 0x01,// 151 = "je"
0x20,// 0x20
// Je_rel32_64
0x1F,// os_jcc_2
0x97, 0x01,// 151 = "je"
0x40,// 0x40
// Jne_rel1... | Rust | 0 |
#!/usr/bin/env python
# Copyright (c) 2015, Nordic Semiconductor
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of source code must retain the above copyright notice, this
... | Python | 1 |
xp, 1545264000);
assert_eq!(claims.nbf, 1545263000);
assert_eq!(claims.msg, "THIS IS TIME SENSITIVE DATA");
// alternatively, a leeway can account for small clock skew
Jwt::<MyExpirableClaims>::decode(
crate::test_files::JOSE_JWT_WITH_EXP,
&JwtValidator::strict(&... | Rust | 0 |
from keras.layers.core import Dense, Dropout
from keras.models import Sequential
from keras.preprocessing.sequence import pad_sequences
from keras.utils import np_utils
from sklearn.model_selection import train_test_split
import collections
import nltk
import numpy as np
from make_tensorboard import make_tensorboard
im... | Python | 1 |
``
#[macro_export]
macro_rules! fuzz {
(|$buf:ident| $body:block) => {
afl::fuzz(|$buf| $body);
};
(|$buf:ident: &[u8]| $body:block) => {
afl::fuzz(|$buf| $body);
};
(|$buf:ident: $dty: ty| $body:block) => {
afl::fuzz(|$buf| {
let $buf: $dty = {
us... | Rust | 0 |
fn to_next_high_value(&mut self) {
while self.cur_high_long == 0 {
self.to_next_high_long();
}
self.set_bit_for_index += self.cur_high_long.trailing_zeros() as i64;
}
fn next_high_value(&mut self) -> i64 {
self.to_next_high_value();
self.current_high_valu... | Rust | 0 |
import logging.config
import sys
log_config = {
"version": 1,
"disable_existing_loggers": False,
"formatters": {
"default": {
"()": "uvicorn.logging.DefaultFormatter",
"fmt": "[%(asctime)s][%(levelname)s] %(message)s",
"use_colors": None,
},
"acce... | Python | 1 |
Literal(ast::Lit { kind: ast::LitKind::Int(a, _), .. })],
) = attr.meta_item_list().as_deref()
{
Bound::Included(a)
} else {
self.sess
.delay_span_bug(attr.span, "invalid rustc_layout_scalar_valid_range attribute");
... | Rust | 0 |
inconsistent discriminant");
match self {
DeviceClassData::Key(key) => key.serialize_into(bytes),
DeviceClassData::Button(button) => button.serialize_into(bytes),
DeviceClassData::Valuator(valuator) => valuator.serialize_into(bytes),
DeviceClassData::Scroll(scrol... | Rust | 0 |
};
let result = http_handler.graphql_request_handler.handle(req, &http_handler.context);
serde_json::to_string(&result)
}
fn data_model_handler<T>(_: HttpRequest<T>) -> impl Responder {
schema::load_datamodel_file().unwrap()
}
fn playground<T>(_: HttpRequest<T>) -> impl Responder {
fs::NamedFile:... | Rust | 0 |
from __future__ import print_function
import tensorflow as tf
from sklearn.neighbors import NearestNeighbors
import numpy as np
from tqdm import tqdm
import time
def nn_dist(train_set, query_set, exclude_self):
# Flatten
train_set = np.reshape(train_set, [train_set.shape[0], -1])
query_set = np.reshape(query_se... | Python | 1 |
h.to_string_lossy(),
readable_start_line,
readable_start_col,
);
self.render_location(location, padding)?;
self.render_padding(padding)?;
self.snippet_empty()?;
let labels = &diagnostic.labels;
self.render_snippet(padding, source, labels, &diagn... | Rust | 0 |
# Copyright (c) 2021 - present / Neuralmagic, Inc. 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 b... | Python | 1 |
Type
// let str_type = &s[3..6];
// let ty = str_type.parse::<PacketType>()?;
// // Different Approach for Operator or Literal Packets
// match ty {
// PacketType::Literal => {
// ()
// }
// PacketType::Operator(_) => {
// ... | Rust | 0 |
# Task:
# 1. Add one more item to buy
# 2. Calculate the average cost of all items.
# Shopping Calculator
print("Running 'Shopping Calculator App':")
wallet = 50 # You start with 50$
# Buy Some Items
book = 15
snack = 5
drink = 3
hat = 12 # New item added
# Calculate total spent
total_spent = book + snack + drink... | Python | 1 |
# Distance the aggressive cows
# def ok(arr, x, K):
# n = len(arr)
# count = 1
# arr.sort() # Sort the array initially
# start = arr[0]
# # Gap checked from 1 -> 9 finally gap of 3 is accepted(as count = 3)
# for i in range(1, n):
# if arr[i] - start >= x:
# start = arr[i]
#... | Python | 1 |
ualCfg: configuración actual.
- nameZone: nombre de la zona que se va a activar.
"""
command = f"cfgadd {actualCfg}, \"{nameZone}\""
print(f"Enviando comando: {command}")
response = ssh_command(hostCfg["host"], hostCfg["port"], hostCfg["username"], hostCfg["password"], command)
print(response)
... | Python | 1 |
probability
and adds a conouter to show where z=0
"""
#setup useful ranges and common linspaces
x0_space = np.linspace(x0_rng[0], x0_rng[1], 40)
x1_space = np.linspace(x1_rng[0], x1_rng[1], 40)
# get probability for x0,x1 ranges
tmp_x0,tmp_x1 = np.meshgrid(x0_space,x1_space)
z = ... | Python | 1 |
}
Ok(body_new)
}type MyClosure= FnMut(i64)->bool;
struct Fruit {
info: String,
myclosure: Box<MyClosure>,
}
impl Fruit {
pub fn eat(&self) {
println!("eat fruit");
}
pub fn run(&mut self) {
for i in 0..10 {
(*self.myclosure)(i);
}
}
}
fn main() {
l... | Rust | 0 |
rom_struct(&mut self, public_key: PublicKey);
fn get_header(&self) -> BytesMut;
fn sign(&self, secret_key: &SecretKey) -> Result<SignedBlock, Error>;
fn valid_header(&self) -> bool;
fn get_merkle_tree(&self) -> MerkleTree<Transaction>;
fn get_merkle_root(&self) -> Vec<u8>;
}
impl BlockExt for Block... | Rust | 0 |
me>aetherknight/fractal-rs
// Copyright (c) 2015-2019 <NAME>.) <NAME>
//
// 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 req... | Rust | 0 |
}
/// An open RFC connection
pub struct RfcConnection {
connection_handle: *mut RfcConnectionHandle,
}
/// An RFC function
pub struct RfcFunction<'conn, 'fun: 'conn> {
connection: &'conn RfcConnection,
fun: *mut RfcDataContainerHandle,
fun_desc: Vec<RfcParameter<'conn, 'fun>>,
}
impl RfcConnection {... | Rust | 0 |
::PostTurnEnd),
BattleFlow::PostTurnEnd => Some(BattleFlow::PlayerChange),
BattleFlow::PlayerChange => {
let next_index = (game.current_player_index + 1) % game.players.len();
let next_player = game.players[next_index];
game.stacks.push(BattleFrame... | Rust | 0 |
_not_called()
price_events_manager.handle_price(price=decimal_random_price(max_value=random_price_1 - trading_constants.ONE),
timestamp=random_timestamp())
price_events_manager.handle_price(price=decimal_random_price(min_value=random_price_1),
... | Python | 1 |
("-> Solved day 00 in {:?}\n", timer.elapsed());
}
}
pub mod day01 {
use mr_kaffee_2021_01::*;
use std::time::Instant;
const INPUT: &str = include_str!("../../../../day01/rust/mr-kaffee/input.txt");
const EXP_1: usize = 1_374;
const EXP_2: usize = 1_418;
pub fn solve() {
let timer... | Rust | 0 |
import numpy as np
def read_npy(type_name):
data = np.load(r'C:\Users\86178\Desktop\课题\下载\混沌时间序列\多维混沌时间序列\standard_data\{}_rec_dict.npy'.format(type_name),allow_pickle=True).tolist()
list_name = list(data.keys())
max_dim = max([data[name].shape[1] for name in list_name])
target = data[list_name[0]][1... | Python | 1 |
rn is empty",
});
}
if pattern.len() > len {
return Err(Error::BadInput {
err: "Pattern is longer than restricted length",
});
}
check_len(bytes, pattern.len())?;
... | Rust | 0 |
::std::mem::zeroed() } }
}
pub type clock_t = __clock_t;
pub type clockid_t = __clockid_t;
pub type timer_t = __timer_t;
#[repr(C)]
#[derive(Copy, Clone)]
#[derive(Debug)]
pub struct tm {
pub tm_sec: ::std::os::raw::c_int,
pub tm_min: ::std::os::raw::c_int,
pub tm_hour: ::std::os::raw::c_int,
pub tm_mda... | Rust | 0 |
ofm_stride_c = 1
ofm_stride_w = ifm_channels if ofm_width > 1 else 1
ofm_stride_h = ifm_channels * ofm_width if ofm_height > 1 else 1
else:
ofm_stride_w = 16
ofm_stride_c = 16 * ofm_width
ofm_stride_h = 16 * ofm_width * ((ifm_channels - 1) // 16 + 1)
serial_binary... | Python | 1 |
emscripten_output!(
"../../emtests/test_funcptr.wasm",
"test_funcptr",
vec![],
"../../emtests/test_funcptr.out"
);
}
use my_des;
fn main() {
let sample_inp: Vec<u64> = vec![
0x0123456789ABCDEF,
0x0123456789ABCDEF,
0x0123456789ABCDEF
];
let sample... | Rust | 0 |
Waker.html#method.into_waker
/// [`LocalWaker::wake`]: ../task/struct.LocalWaker.html#method.wake
/// [`Waker`]: ../task/struct.Waker.html
fn poll(self: Pin<&mut Self>, lw: &LocalWaker) -> Poll<Self::Output>;
}
impl<'a, F: ?Sized + Future + Unpin> Future for &'a mut F {
type Output = F::Output;
fn... | Rust | 0 |
::from(DUMMY_CREATED_ON) }
}
pub fn get_init_chat_messages() -> Vec<ChatMessage> {
let mut messages = Vec::new();
for _ in 0..20 {
messages.push(get_init_chat_message());
}
return messages;
}
entrypoint!(process_instruction);
pub fn process_instruction(
program_id: &Pubkey,
accounts: &... | Rust | 0 |
"""
1329. Sort the Matrix Diagonally - Important !!!
"""
def diagonal_sort(matrix):
num_rows = len(matrix)
num_cols = len(matrix[0]) if num_rows > 0 else 0
# Sort diagonals starting from the leftmost column
for col in range(num_cols):
diagonal = []
row = 0
c = col
... | Python | 1 |
eatures:,}")
logger.info(f" File size: {metadata['pmtiles']['size_mb']} MB")
else:
logger.error("❌ PMTiles validation failed")
sys.exit(1)
# Cleanup
if geojson_file.exists():
geojson_file.unlink()
logger.info("🧹 Cleaned up temporary... | Python | 1 |
-----------------------
ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True)
# https://django-allauth.readthedocs.io/en/latest/configuration.html
ACCOUNT_AUTHENTICATION_METHOD = "username"
# https://django-allauth.readthedocs.io/en/latest/configuration.html
ACCOUNT_EMAIL_REQUIRED = True
# ht... | Python | 1 |
rollout_buffer.values.flatten(), self.rollout_buffer.returns.flatten())
# Logs
self.logger.record("train/entropy_loss", np.mean(entropy_losses))
self.logger.record("train/policy_gradient_loss", np.mean(pg_losses))
self.logger.record("train/value_loss", np.mean(value_losses))
sel... | Python | 1 |
4d9_4a4f);
x
}
use std::thread;
use crate::support::temp_project::temp_project;
use hamcrest2::assert_that;
use hamcrest2::prelude::*;
use test_support::matchers::execs;
#[test]
fn install_node() {
let p = temp_project().build();
assert_that!(p.volta("install node@14.15.4"), execs().with_status(0));
... | Rust | 0 |
for optimized 128-bit division.
// Returns the divisor, the number of digits processed, and the
// number of leading zeros in the divisor.
#[inline]
#[cfg(all(feature = "power_of_two", not(feature = "radix")))]
pub(crate) fn u128_divisor(radix: u32) -> (u64, usize, u32) {
debug_assert_radix_primitive!(radix);
... | Rust | 0 |
goDB connection closed successfully")
except Exception as e:
logging.error(f"Error closing MongoDB connection: {str(e)}")
# Use a thread-local storage for the database manager instance
_thread_local = local()
def get_db_manager():
"""Get or create thread-local database manager instance."""
... | Python | 1 |
* `xq1` $:= (1 + ($`endo`$ - 1)\cdot b_1) \cdot x_t$
//~ * `xq2` $:= (1 + ($`endo`$ - 1)\cdot b_3) \cdot x_t$
//~ * `yq1` $:= (2\cdot b_2 - 1) \cdot y_t$
//~ * `yq2` $:= (2\cdot b_4 - 1) \cdot y_t$
//~
//~ These are the 11 constraints that correspond to each EVBSM gate,
//~ which take care of 4 bits of the scalar... | Rust | 0 |
\x16\x00\x0dr\
\x00+2+201\x05\x22&54>\x0432\
\x1e\x02\x15\x14\x0e\x04'2>\x0454&#\x22\x0e\
\x04\x15\x14\x16\x01\xe3\xb1\xbb\x1c=`\x87\xb0o^\x8a\
[,\x1f@c\x87\xaeXFt^F/\x17eh\
Du`I2\x1ah\x14\xfe\xecf\xe4\xe4\xcd\xa0\x5c\
>w\xado{\xf9\xe8\xc9\x96U\x8eM\x87\xb1\xc9\xd3\
d\x9b\xa4L\x85\xac\xc3\xc9^\xa9\xb4\x00\x01\x01*\x00\... | Python | 1 |
import threading
class dbConn:
__instance = None
__lock = threading.Lock()
def __new__(cls, *args, **kwargs):
if cls.__instance is None:
with cls.__lock:
if cls.__instance is None:
cls.__instance = super().__new__(cls)
return cls.__instance... | Python | 1 |
45e9aafbba6a90dc0
d40a
BlindedElement = 030185e431f056e75ba7fac49da70790031daa333d16f05e1de
471e24afe0ed985c770ce77bd1bebec527e9a76feecc6afd92c5fd00481ba7fb843d
2aab52337cb716e
EvaluationElement = 02000859e1abc2ed28086b854ec5ae72311244fdeedf81d7
69af6a6f2c83f00fa48df1f1a0c0b6fac84cc654b7757ac042107a6b3043e483bb3b
74de5... | Rust | 0 |
Spread the bits of the BigUint among coordinates for the given number of dimensions in a round-robin fashion,
/// delaminating the big integer.
///
/// If reverse_order is true (the normal situation) then the first (lowest order) bit of the `BigUint`
/// is assigned to the low-order bit position of t... | Rust | 0 |
revocation_key: dummy_key.clone(),
broadcaster_htlc_key: dummy_key.clone(),
countersignatory_htlc_key: dummy_key.clone(),
broadcaster_delayed_payment_key: dummy_key.clone(),
};
let channel_pubkeys = ChannelPublicKeys {
funding_pubkey: dummy_key.clone(),
revocation_basepoint: dummy_key.clone(),
... | Rust | 0 |
import torch
from torch import nn, optim
from math import pi
import torch.nn.functional as F
def Laplace(p):
A = 0.08
ep = 0.03
tal = 0.1
f = 50
w = 2 * pi * f
q = torch.tensor(1 - pow(ep, 2))
y = A * torch.exp((-ep / (torch.sqrt(q))) * (w * (p - tal))) * (-torch.sin(w * (p - tal)))
r... | Python | 1 |
paddings,
num_channel_indices,
channel_indices,
) = kernels
n_instances, n_columns, _ = X.shape
num_kernels = len(lengths)
_X = np.zeros(
(n_instances, num_kernels * 2), dtype=np.float32
) # 2 features per kernel
for i in prange(n_instances):
a1 = 0 # fo... | Python | 1 |
ight', 'or': 'ଡ଼ାହାଣପାଖ ଉପର|normal', 'pt_BR': 'vertical', 'ro': 'upright|normal|înpicioare', 'ru': 'прямой|обычный', 'sid': 'aliqiniitira|rosaminoha', 'sk': 'normálne|no', 'sl': 'pokonci|navadno', 'sq': 'lart|normal', 'tr': 'üstsağ|normal', 'uk': 'прямий|звичайний', 'vec': 'vertegałe|normałe', 'zh_CN': '正体|正|一般|upright... | Python | 1 |
to_c(success, s);
close_mpst_multi(s)
},
Branching1fromAtoS::<i32>::Again(s) => {
let (fail, s) = recv_mpst_s_from_a(s)?;
let s = send_mpst_s_to_c(fail, s);
choice_s(s)
},
})
}
fn main() {
let (thread_a, thread_c, thread_s) = fork_mpst(... | Rust | 0 |
#!/usr/bin/env python3
# Import the core classes from the siliconcompiler library.
from siliconcompiler import ASIC, Design
# Import a pre-defined "target" which sets up a specific PDK,
# standard cell library, and tool flow.
from siliconcompiler.targets import freepdk45_demo
def main():
'''
This script demo... | Python | 1 |
enable_health_check: bool,
//
pub matrix_homeserver: String,
pub matrix_username: String,
pub matrix_password: String,
//
pub twitter_screen_name: String,
pub twitter_api_key: String,
pub twitter_api_secret: String,
pub twitter_token: String,
pub twitter_token_secret: String,
... | Rust | 0 |
{
group: Option<String>,
id: usize,
}
impl HudOrder {
pub fn next(&mut self) -> HudOrder {
let ret = self.clone();
self.id += 1;
ret
}
pub fn in_group(mut self, group: &str) -> HudOrder {
self.group = Some(group.to_string());
self
}
}
#[derive(Default)]... | Rust | 0 |
e), 1)
int64_col = feature.int64_list.value[0]
seen_rows.append(int64_col)
# Create our expected Example.
expected_example = example_pb2.Example()
expected_example = _ConvertRowToExampleProto(_ROWS[int64_col])
# Compare.
self.assertProtoEquals(example, expected_... | Python | 1 |
# -*- coding: utf-8 -*-
################################################################################
## Form generated from reading UI file 'Ejemplo_pdfViewWFsJMW.ui'
##
## Created by: Qt User Interface Compiler version 6.6.0
##
## WARNING! All changes made in this file will be lost when recompiling UI file!
#####... | Python | 1 |
, 3, 4 in arbitrary order
/// for x in heap.into_iter() {
/// // x has type i32, not &i32
/// println!("{}", x);
/// }
/// ```
fn into_iter(self) -> IntoIter<T> {
IntoIter { iter: self.data.into_iter() }
}
}
#[stable(feature = "rust1", since = "1.0.0")]
impl<'a, T> IntoItera... | Rust | 0 |
}
#[doc = "Bit 11 - Request new data while in sequential program mode"]
#[inline(always)]
pub fn prog_seq_data_req(&self) -> PROG_SEQ_DATA_REQ_R {
PROG_SEQ_DATA_REQ_R::new(((self.bits >> 11) & 0x01) != 0)
}
#[doc = "Bit 10 - Flash interface busy status bit"]
#[inline(always)]
pub fn ... | Rust | 0 |
sn't changed from its previous value, a `value` that
the user has changed while using the app will keep that change, as
long as the new `value` also matches what was given originally.
Used in conjunction with `persistence_type`.
- persistence_type (a value equal to: 'local', 'session', 'memory'; default 'l... | Python | 1 |
ponse.xpath('//div[@id="tab-attributes"]//tr')
for row in Data:
weight=row.xpath('./td[@itemprop="weight"]/span[@itemprop="value"]/text()').get()
if weight:
item['weight']=weight
else:
classstr=row.xpath('./td[@class]/@class').get()
... | Python | 1 |
"""
Module to expose more detailed version info for the installed `numpy`
"""
version = "2.0.0"
__version__ = version
full_version = version
git_revision = "1d49c7f7ff527c696fc26ab2278ad51632a66660"
release = 'dev' not in version and '+' not in version
short_version = version.split("+")[0]
| Python | 1 |
{
match *self {
Error::Window(ref err) => err.description(),
Error::Font(ref err) => err.description(),
Error::Render(ref err) => err.description(),
}
}
}
impl ::std::fmt::Display for Error {
fn fmt(&self, f: &mut ::std::fmt::Formatter) -> ::std::fmt::Result... | Rust | 0 |
let table_index = n << 1;
utils::write_two_bytes(buf, &mut sep, table_ptr, table_index);
} else {
let table_index = n << 1;
utils::write_one_byte(buf, &mut sep, table_ptr, table_index + 1);
}
... | Rust | 0 |
#!/usr/bin/env python
"""
Copyright (c) 2006-2025 sqlmap developers (https://sqlmap.org/)
See the file 'LICENSE' for copying permission
"""
from plugins.generic.syntax import Syntax as GenericSyntax
class Syntax(GenericSyntax):
@staticmethod
def escape(expression, quote=True):
"""
>>> Syntax.... | Python | 1 |
}
impl<'de> Deserialize<'de> for RootDiff {
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
#[derive(Deserialize)]
#[serde(field_identifier, rename_all = "camelCase")]
enum Field {
ObjectId,
#[serde(rename = ... | Rust | 0 |
zed = BLS12381PublicKey::try_from(serialized);
prop_assert_eq!(Some(keypair.public_key), deserialized.ok());
}
}
#[test]
fn test_keys_custom_serialisation(
keypair in uniform_keypair_strategy::<BLS12381PrivateKey, BLS12381PublicKey>()
) {
{
let serialized... | Rust | 0 |
CodeTableKind::Normal => {}
OpCodeTableKind::T0F => self.append_op_code(0x0F, 1, sep),
OpCodeTableKind::T0F38 => self.append_op_code(0x0F38, 2, sep),
OpCodeTableKind::T0F3A => self.append_op_code(0x0F3A, 2, sep),
OpCodeTableKind::MAP5 => self.sb.push_str("MAP5"),
OpCodeTableKind::MAP6 => self.sb.push_str... | Rust | 0 |
()).unwrap_or("stderr");
match LogTarget::new_with(g_log, &config) {
Ok(t) => logger::logger_init(t, Some("nntp_rs_server".to_string())),
Err(e) => {
eprintln!("nntp-rs: logging.general: {}: {}", g_log, e);
exit(1);
},
}
// Open the incoming log
let i_log... | Rust | 0 |
x-mir.
unsafe { *px }
}
pub fn main() {
println!("{:?}", crux_test());
}
<reponame>jonathanxuu/starks-verifier-1
use crate::{math::field, utils::as_bytes};
use sha3::Digest;
// CONSTANTS
// ================================================================================================
// Exponents for S-BOX... | Rust | 0 |
"statusFlags().isPrompt() * 1 ",
"uint16", doc=("gen status flags stored bitwise, bits are: "
"0 : isPrompt, "
"1 : isDecayedLeptonHadron, "
"2 : isTauDecayProduct, "
"3 : isPromptTauDecayProduct, "
... | Python | 1 |
db70_runner.query(uniref90_msa_as_a3m)
uniref90_out_path = msa_output_dir / Path(f'{file_name}_uniref90_hits.sto')
with open(uniref90_out_path, 'w') as f:
f.write(jackhmmer_uniref90_result['sto'])
mgnify_out_path = msa_output_dir / Path(f'{file_name}_mgnify_hits.sto')
with open(mgnify_out_path, 'w') as f:
... | Python | 1 |
TAG_RESET_FLAG_PROCPU_R::new(((self.bits >> 20) & 0x01) != 0)
}
#[doc = "Bit 19"]
#[inline(always)]
pub fn rtc_cntl_ocd_halt_on_reset_procpu(&self) -> RTC_CNTL_OCD_HALT_ON_RESET_PROCPU_R {
RTC_CNTL_OCD_HALT_ON_RESET_PROCPU_R::new(((self.bits >> 19) & 0x01) != 0)
}
#[doc = "Bit 18"]
#... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.