text string | label_name string | labels int64 |
|---|---|---|
if p != 0 && p != 1 {
return ((stbi__err("bad DQT type")) as i32);
}
if t > 3 {
return ((stbi__err("bad DQT table")) as i32);
}
i = ((0) as i32);
while (i < 64) {
(*z).dequant[(... | Rust | 0 |
ue,
log_entry_date=entry_date)
# obey max results returned
if plugin_object.cli_args.max is not None and num_entry >= plugin_object.cli_args.max:
return
# in case all log entries matched teh filter
if num_entry == 0:
status_message = f"... | Python | 1 |
nstanceOutput
from volcenginesdkescloud.models.warm_node_resource_spec_for_describe_instances_output import WarmNodeResourceSpecForDescribeInstancesOutput
from volcenginesdkescloud.models.warm_node_storage_spec_for_describe_instance_output import WarmNodeStorageSpecForDescribeInstanceOutput
from volcenginesdkescloud.mo... | Python | 1 |
r s r _writer3 "
$_
GGDM __ (
6r r r r FFFNNFRr r r r rT r r\ r* r functoolsr itertoolsr typingr cache__all__r r- r4 r? rC r
r r r r
r r r r r r r5 rw r r r r r r r os.pathrV ... | Python | 1 |
iation)
# Convert all columns to string to ensure JSON serializability
data = data.astype(str)
records = data.to_dict(orient="records")
# Always include batter and pitcher, plus all requested fields
filtered_records = []
for row in records:
... | Python | 1 |
ttrib['name'] = dst
def duplicate_anchor_v2(glyph, src, dst):
sourceAnchor = src
destAnchor = dst
gname = glyph.name
anchorList = [ g.anchors[anchor].name for anchor in range(len(g.anchors))]
anchorDict = { g.anchors[anchor].name : g.anchors[anchor].position for anchor in range(len(g.anch... | Python | 1 |
default = 100,
min = 0,
max = 100,
subtype = 'PERCENTAGE'
)
height : FloatProperty(
name = "Height",
description = "Height of the snow",
default = 0.3,
step = 1,
precision = 2,
min = 0.1,
max = 1
)
vertices ... | Python | 1 |
ap(&self) -> u32 {
let mut a: u32 = 0;
for i in self.pixels.iter().flat_map(|p| [p.red(), p.green(), p.blue(), p.alpha()]) {
a += i as u32;
}
a
}
}
pub struct NestedData { pub pixels: Vec<Vec<u8>> }
impl NestedData {
pub fn collect_loop(&self) -> Vec<u8> {
le... | Rust | 0 |
#!/usr/bin/env python3
"""
Agent Memory System
This module maintains agent memory with decay and associations.
It enables an AI agent to store, recall, and manage knowledge over time.
Core features:
- Memory persistence with natural decay
- Recency boosting for recently accessed information
- Knowledge correction thr... | Python | 1 |
()) {
Ok(file) => {
*response.body_mut() = Some(ResponseBody::File(file));
true
}
Err(ref e) => {
if let Some(err) = unsafe { err.as_mut() } {
*err = e.into();
}
false
}
}
.tap(|_| {
let _ = qiniu... | Rust | 0 |
np.load(f"{result_dir}/mmlu_hidden.npy")
for layer_idx, (layer_vals1, layer_vals2) in enumerate(zip(vals1, vals2)):
num_tokens1 = layer_vals1.shape[0]
num_tokens2 = layer_vals2.shape[0]
limit = min(num_tokens1, num_tokens2)
layer_vals1 = layer_vals1[:limit]
layer_vals2 = lay... | Python | 1 |
#[serde(skip_serializing_if = "Option::is_none")]
pub currency: Option<Currency>,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub parent: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")... | Rust | 0 |
#
# @lc app=leetcode id=453 lang=python
#
# [453] Minimum Moves to Equal Array Elements
#
# @lc code=start
class Solution(object):
def minMoves(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
# @lc code=end
| Python | 1 |
class Employee:
name = "Harry" # This is the class attribute
language = "py"
emp1= Employee()
emp2= Employee()
print(f"Employee 1 created with the name {emp1.name}. He is learning {emp1.language}")
emp2.language= "Javascript and React" # This is an instance attribute
print(f"Employee 2 created with the ... | Python | 1 |
import requests
import re
import sys
list_urls = open("check_urls.txt")
existing_urls = []
host = sys.argv[1]
base_url = "http://" + host + "/"
print base_url
def check_page(url):
req = requests.get(url)
return req
#Checking non existig page
base_req = requests.get(base_url + "rejgwterlbjwfnvierwebjrwfebelivajr"... | Python | 1 |
SOFTMAXCLASSIFICATIONLOSS,
__module__ = 'object_detection.protos.losses_pb2'
# @@protoc_insertion_point(class_scope:object_detection.protos.WeightedSoftmaxClassificationLoss)
))
_sym_db.RegisterMessage(WeightedSoftmaxClassificationLoss)
WeightedSoftmaxClassificationAgainstLogitsLoss = _reflection.GeneratedProtoc... | Python | 1 |
# -*- coding: utf-8 -*-
#
# This file is part of BES.NAURU.LIMS.
#
# BES.NAURU.LIMS 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, version 2.
#
# This program is distributed in the hope that it will be useful... | Python | 1 |
return len(self.names)
if __name__ == '__main__':
names = ['dsgdb9nsd_000001', 'dsgdb9nsd_000002', 'dsgdb9nsd_000030', 'dsgdb9nsd_000038']
# df_train = pd.read_csv('../input/champs-scalar-coupling/train.csv', usecols=['molecule_name'])
# names = df_train['molecule_name'].unique()
train_loader = D... | Python | 1 |
import streamlit as st
st.header("About Us")
st.write(f"You are logged in as {st.session_state.role}.") | Python | 1 |
exception(er)
return
else:
y = e.chat_id
if not DestiM.contains(y):
DestiM.add(y)
await e.eor("Destination added succesfully")
else:
await e.eor("Destination channel already added")
@ultroid_cmd(pattern="ddest( (.*)|$)")
async def dd(event):
chat_id = event.... | Python | 1 |
[inline(always)]
pub fn fh1_b_ost_u(&self) -> FH1_B_OST_U_R {
FH1_B_OST_U_R::new(((self.bits >> 22) & 0x03) as u8)
}
}
impl W {
#[doc = "Bit 0"]
#[inline(always)]
pub fn fh1_sw_cbc(&mut self) -> FH1_SW_CBC_W {
FH1_SW_CBC_W { w: self }
}
#[doc = "Bit 1"]
#[inline(always)]
... | Rust | 0 |
d, SpecificTy> { }
unsafe impl<'cid, 'mid, 'fid, Ty: ?Sized, General: ?Sized> DerivesFrom<General> for Alloca<'cid, 'mid, 'fid, Ty> where Value<'cid, 'mid, 'fid, PointerType<'cid, Ty>>: DerivesFrom<General> { }
impl<'cid, 'mid, 'fid, Ty: ?Sized> Alloca<'cid, 'mid, 'fid, Ty> {
pub fn set_alignment(&mut self, alignm... | Rust | 0 |
: Some(Statistics::int32(Some(1), Some(3), None, 7, true))
},
Page::DataPageV2 {
buf: ByteBufferPtr::new(vec![4; 128]),
num_values: 10,
encoding: Encoding::DELTA_BINARY_PACKED,
num_nulls: 2,
num_rows: 12,
def_levels_byte_len: 24,
rep_levels_byte_len: 3... | Rust | 0 |
# Copyright 2021 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Python | 1 |
(if is_fast { 250 } else { 500 });
let busy_start = sine1.mix(sine2).take_duration(cadence).amplify(half_volume);
let busy_loop = busy_start.clone().delay(cadence).repeat_infinite();
self.sink.append(busy_start);
self.sink.append(busy_loop);
}
fn queue_off_hook_tone(&self, volum... | Rust | 0 |
backend) will be used which will cause a figure to be raised if
`~matplotlib.pyplot.show` is called. If it is False, the figure is
created using `.FigureCanvasBase` and the drawing backend is selected
as `.Figure.savefig` would normally do.
Returns
-------
`.Figure`
Th... | Python | 1 |
"""
Read PyTorch model from .pth.tar checkpoint.
Code from:
https://github.com/rgeirhos/texture-vs-shape/blob/master/models/load_pretrained_models.py
Accessed 02.03.2020
"""
import os
import torch
import torchvision
import torchvision.models
from torch.utils import model_zoo
model_urls = {
'resnet50_trained_on_S... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import api, fields, models, _
class AccountChartTemplate(models.Model):
_inherit = 'account.chart.template'
def _prepare_all_journals(self, acc_template_ref, company, journals_dict=None):
res... | Python | 1 |
0c - Interrupt Status Register"]
pub ce_isr: crate::Reg<ce_isr::CE_ISR_SPEC>,
#[doc = "0x10 - Task Load Register"]
pub ce_tlr: crate::Reg<ce_tlr::CE_TLR_SPEC>,
#[doc = "0x14 - Task Status Register"]
pub ce_tsr: crate::Reg<ce_tsr::CE_TSR_SPEC>,
#[doc = "0x18 - Error Status Register"]
pub ce_e... | Rust | 0 |
LRUTimeCache::new(Duration::from_millis(100));
cache.insert("a");
cache.insert("b");
std::thread::sleep(Duration::from_millis(20));
cache.insert("a");
// a is newer now
std::thread::sleep(Duration::from_millis(85));
assert!(cache.contains(&"a"),);
// b... | Rust | 0 |
from odoo import models, fields
class BankFcustomer(models.Model):
_name = "feedback.feedback"
_description = "Bank Customer"
name = fields.Many2one("bank.customer", string="Select Account Holders ", domain=[('status', '=', 'confirm')])
email = fields.Char(string='Email')
phone = fields.Char(stri... | Python | 1 |
Url
@StreamUrl.setter
def StreamUrl(self, StreamUrl):
self._StreamUrl = StreamUrl
@property
def PrivateMapKey(self):
"""TRTC房间权限加密串,只有在TRTC控制台启用了高级权限控制的时候需要携带,在TRTC控制台如果开启高级权限控制后,TRTC 的后台服务系统会校验一个叫做 [PrivateMapKey] 的“权限票据”,权限票据中包含了一个加密后的 RoomId 和一个加密后的“权限位列表”。由于 PrivateMapKey 中包含 RoomI... | Python | 1 |
date: 指定日期,如果为None则使用第一个可用日期
output_file: 输出文件路径,如果为None则显示图表
Returns:
matplotlib.figure.Figure: 图表对象
"""
if not self.data:
logger.warning("没有可用的数据进行交易量分布图绘制")
return None
if date is None:
date = li... | Python | 1 |
# CHALLENGES #
"""
EL FAMOSO "FIZZ BUZZ”:
Escribe un programa que muestre por consola (con un print) los
números de 1 a 100 (ambos incluidos y con un salto de línea entre
cada impresión), sustituyendo los siguientes:
- Múltiplos de 3 por la palabra "fizz".
- Múltiplos de 5 por la palabra "buzz".
- Múltiplos de 3 y de ... | Python | 1 |
index : bpy.props.IntProperty()
def execute(self, context):
obj = context.object
if self.index >= 0 and self.index < len(obj.mcow_physics_entity_gibs):
obj.mcow_physics_entity_gibs.remove(self.index)
return {"FINISHED"}
def register_property_class_gib():
bpy.utils.regist... | Python | 1 |
--------
def __len__(self):
return len(self.windows)
def __getitem__(self, idx):
clip_key, start = self.windows[idx]
ids_sorted = sorted(self.clip_groups[clip_key])
L = len(ids_sorted)
# フレーム skip
if self.T > 1 and self.split == "train" and (self.skip_min, self... | Python | 1 |
# Clínica
# Módulo: Pacientes
# 26/05/2025
# Autor: Kauan Ferreira
pacientes = {} #chave: identificador (id) -> pacientes{"id": id, "nome": nome, "celular": celular}
# Procedures / Functions
def cadastrar():
print('\n--- Cadastro de Paciente ---\n')
id = int(input(f'Identificador do paciente: '))
# Consu... | Python | 1 |
w(
ctx,
ui,
gameplay.clone(),
))))
}),
)
}
fn make_load_map(gameplay: GameplayMode) -> Box<dyn State> {
WizardState::new(Box::new(move |wiz, ctx, ui| {
if let Some((_, name)) = wiz.wrap(ctx).choose("Load which map?", || {
l... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" @todo add docstring """
# ### imports ###
from collections import OrderedDict
import io
import json
import os
import pprint
import sys
from jsoncomment import JsonComment
# from jsonschema import validate
def decode(s):
"""doc me"""
if sys.version_info >= ... | Python | 1 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class FleetVehicleModelCategory(models.Model):
_name = 'fleet.vehicle.model.category'
_description = 'Category of the model'
_order = 'sequence asc, id asc'
_sql_constra... | Python | 1 |
MaybeValue::total(format!("{} {}.bits {} {}", name, self.transpile_ty(to1)?, so1, so2))
})
};
let infix_binop = |name| Ok(MaybeValue::total(format!("{} {} {}", so1, name, so2)));
match op {
BinOp::A... | Rust | 0 |
sbxsvc::Request>(),
reply_handler.clone(),
)));
// Set up thread to handle incoming channel -- replies are routed
// to reply buffer, requests to the RPC request handler given.
// This is a very simplistic way of handling (no multiplexing),
// to be replaced by proper I/O model later.
s... | Rust | 0 |
let peer1 = async move {
while swarm1.next().now_or_never().is_some() {}
for l in Swarm::listeners(&swarm1) {
tx.send(l.clone()).await.unwrap();
}
loop {
swarm1.next().await;
}
};
let peer2 = async mov... | Rust | 0 |
This interface calculates the similarity between query and document.
Args:
query(str): the input query text.
document(str): the input document text.
Returns:
lda_sim(float): likelihood based similarity between query and document
b... | Python | 1 |
## fufluns - Copyright 2021 - deroad
import glob
import os
SEVERITY="severity"
DESCRIPTION="description"
ISSU_NSURLSWIZZLING = "TrustKit swizzling on NSURL is disabled"
DESC_NSURLSWIZZLING = "Swizzling allows enabling pinning within an App without having to find every instance of NSURLConnection or NSURLSession dele... | Python | 1 |
eback.format_exc())
print(f"[ConnectWindow] create_new_instance {transport} name {transport.name}")
if HCIControl._main_window is None:
raise ValueError("Main window must be set before creating a new instance.")
if transport is None:
raise ValueError("Transpo... | Python | 1 |
[ # 通知方式
{"phase": 3, "type": ["mail", "weixin", "voice"]}, # 执行阶段,3-执行前,2-成功时,1-失败时
{"phase": 2, "type": ["mail", "weixin", "voice"]},
{
"phase": 1,
"type": ["mail", "weixin", "voice", "wxwork-bot"],
"chatid":... | Python | 1 |
from subprocess import *
import os
#to get all the pages just add append base_url/index(index).html
#for craigslist casual encounters this is newyork.craigslist.org/cas/index100.html
#where the 1 in index100 will be incremented to get all pages.
urls_to_scrape = open("urls_to_scrape.txt","r")
current_dir = os.getcw... | Python | 1 |
as u8);
}
#[test]
#[should_panic]
fn test_genres_max() {
Genres::default().get(Genre::max() + 1);
}
fn make_genres() -> Genres {
let mut genres = Genres::default();
genres.add(Genre::Adventure);
genres.add(Genre::Music);
genres.add(Genre::War);
genres
}
#[test]
fn test_genr... | Rust | 0 |
FIRST_BYTE_MAX_VALUE: u8 = 0b01111111 as u8;
const VALID_TWO_BYTE_UTF8_FIRST_BYTE_RANGE: (u8, u8) = (0b11000000 as u8, 0b11011111 as u8);
const VALID_TWO_BYTE_UTF8_SECOND_BYTE_RANGE: (u8, u8) = (0b10000000 as u8, 0b10111111 as u8);
const VALID_THREE_BYTE_UTF8_FIRST_BYTE_RANGE: (u8, u8) = (0b11100000 as u8, 0b11110111... | Rust | 0 |
multiply can never affect the bits to the right of it, a
/// subsequent update that also differed in this bit could result in a predictable collision.
///
/// This version avoids this vulnerability while still only using a single multiply. It takes advantage
/// of the fact that when a 64 bit multiply ... | Rust | 0 |
# -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Scientific Package. This package holds all simulators, and
# analysers necessary to run brain-simulations. You can use it stand alone or
# in conjunction with TheVirtualBrain-Framework Package. See content of the
# documentation-folder for more details. See also http://ww... | Python | 1 |
2',
'height': '0.3',
'width': '0.5'
}
highlighted_node_style = {
'fillcolor': '#FFD580',
'color': '#FFA500'
}
edge_style = {
'color': '#6C8EBF',
'arrowsize': '0.5',
'penwidth': '0.6',
'fontname': 'Helvetica',
'fontsize': '8',
... | Python | 1 |
// sockfd: self.sockfd,
channelId: self.localId,
event: EVENT_OUT,
}),
});
}
}
// println!(
// "RDMAChannel::ProcessRDMAWriteImmFinish 2, localId: {}",
// self.... | Rust | 0 |
m_onnx_configs = {
"encoder_model": encoder_config,
"decoder_model": decoder_config,
"decoder_with_past_model": decoder_with_past_config,
}
with TemporaryDirectory() as tmpdirname:
main_export(
model_id,
output=tmpdirname,
... | Python | 1 |
ect Bit : 0\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
#[repr(u8)]
pub enum CBREF1_A {
#[doc = "0: Comp. B Int. Ref.1 Select 0 : 1/32"]
CBREF1_0 = 0,
#[doc = "1: Comp. B Int. Ref.1 Select 1 : 2/32"]
CBREF1_1 = 1,
#[doc = "2: Comp. B Int. Ref.1 Select 2 : 3/32"]
CBREF1_2 = 2,... | Rust | 0 |
t msg_out = gimli_aead_decrypt(&ct, &ad, tag, nonce, key);
assert_secret_seq_eq!(msg, msg_out, U8);
}
#[test]
fn tg_gimli_aead_125_166() {
let key = Key::from_public_slice(&[
0xfb, 0xbb, 0x3e, 0x1d, 0x3c, 0x1d, 0xe3, 0x40, 0x9d, 0xc1, 0xb1, 0xa7, 0x8b, 0x46, 0x59,
0x7a, 0xce, 0x95, 0x2e, 0xb4, ... | Rust | 0 |
will never be set; retransmission after NACK reception is disabled."]
TNCK_THD_0,
#[doc = "1: TNTE will be set after 1 nack is received; 0 retransmissions occurs."]
TNCK_THD_1,
#[doc = "2: TNTE will be set after 2 nacks are received; at most 1 retransmission occurs."]
TNCK_THD_2,
#[doc = "3: TNTE will be s... | Rust | 0 |
origin, get_keys_response.server_key.clone())?
.into_iter()
.map(|(k, v)| (k.to_string(), v.key))
.collect();
pub_key_map
.write()
.map_err(|_| Error::bad_database("RwLock is poisoned."))?
.insert(origin.to_stri... | Rust | 0 |
es_batch(gzh, start_page=0, batch_size=20, page_size=10):
"""批量抓取公众号文章列表 - 优化版本使用会话复用"""
all_articles = []
consecutive_empty_pages = 0
max_consecutive_empty = 3
end_page = start_page + batch_size
for page in range(start_page, end_page):
params = {
'sub': 'list',
... | Python | 1 |
NUMERIC_ERROR_COMPENSATION_OFFSET: f32 = 1e-4;
pub trait Intersect {
type Result;
/**
* Tests a `ray` and an object for intersection and returns whether there is one.
* Returns information of the hitpoint, if any
**/
fn intersect(&self, ray: &Ray) -> Option<Self::Result>;
}
impl<Primitive>... | Rust | 0 |
t_eq!(value, result);
}
#[test]
fn test_u32_bytes_round_trip() {
test_round_trip(123u32);
}
#[test]
fn test_f64_bytes_round_trip() {
test_round_trip(123f64);
}
#[test]
fn test_vec2_round_trip() {
test_round_trip(Vec2::new(1.0, 2.0));
}
#[test]
... | Rust | 0 |
Apply multi-band equalization using existing single-band equalizer.
Two composition modes are supported:
- 'sum': Extract per-band bandpass components and sum them together. Each
component is scaled by its corresponding gain. This emulates a
multi-band ban... | Python | 1 |
ed secret
let mut x_u_bytes = [0; 32];
x_u_bytes.copy_from_slice(&msg_1.x_u[..32]);
let u_public = x25519_dalek::PublicKey::from(x_u_bytes);
let shared_secret = self.secret.diffie_hellman(&u_public);
Ok(Msg2Sender {
c_v: self.c_v,
shared_secret,
... | Rust | 0 |
'''1- Classificador de Idade
Crie um programa que solicite a idade do usuário e classifique-o
em uma das seguintes categorias:
*Criança (0-12 anos),
*Adolescente (13-17 anos),
*Adulto (18-59 anos) ou
*Idoso (60 anos ou mais). '''
# Solicita a idade do usuário
idade = int(input("Digite sua idade: "))
# Verific... | Python | 1 |
self.immutable.is_disjoint(&other.mutable)
}
pub fn set_bits_for_query<Q>(&mut self, world: &World)
where
Q: Query,
{
self.immutable.clear();
self.mutable.clear();
let iterator = world.archetypes();
let bits = iterator.len();
self.immutable.grow(bits);
... | Rust | 0 |
return Ok(None);
}
Ok(rlp::decode(&b)?)
}
async fn read_transactions(
&self,
base_tx_id: u64,
amount: u32,
) -> anyhow::Result<Vec<ethereum::Transaction>> {
trace!(
"Reading {} transactions starting from {}",
amount,
... | Rust | 0 |
ssiping_with_two_nodes = server1
.logger
.get_lines_as_string()
.iter()
.any(|s| s.contains("received gossip on 2 nodes"));
assert!(is_gossiping_with_one_node, "Before second node bootstrap");
assert!(!is_gossiping_with_two_nodes, "Before second node bootstrap");
let client... | Rust | 0 |
Error,
}
#[derive(Debug)]
pub enum WaitError<'a, T> {
Timeout,
Abandoned(AbandonedMutexGuard<'a, T>),
Other(Error),
}
<gh_stars>1-10
//! Numerical optimisation using the Nelder-Mead algorithim
//!
//! Translation of the pure Python/Numpy implementation of the Nelder-Mead algorithm.
//! Reference: <https://... | Rust | 0 |
n",
"-o",
&format!("build\\ALVR_Installer_v{}.exe", version),
],
)
.unwrap();
}
pub fn publish_server(is_nightly: bool) {
build_server(true, is_nightly, false);
zip_dir(&server_build_dir()).unwrap();
if cfg!(windows) {
if is_nightly {
fs::copy(
... | Rust | 0 |
specific::BOXARRAYOID as isize,
FLOAT8ARRAYOID = pg_sys::pg11_specific::FLOAT8ARRAYOID as isize,
ABSTIMEARRAYOID = pg_sys::pg11_specific::ABSTIMEARRAYOID as isize,
RELTIMEARRAYOID = pg_sys::pg11_specific::RELTIMEARRAYOID as isize,
TINTERVALARRAYOID = pg_sys::pg11_specific::TINTERVALARRAYOID as isize,
... | Rust | 0 |
import cv2
import numpy as np
# resim oluştur
img = np.zeros((512,512,3), np.uint8) # siyah bir resim
print(img.shape)
cv2.imshow("Siyah", img)
# çizgi
# (resim, başlangıç noktası, bitiş noktası, renk, kalınlık)
cv2.line(img, (100,100), (100,300), (0,255,0), 3) # BGR = (0,255,0)
cv2.imshow("Cizgi", img)
# dikdörtge... | Python | 1 |
f"NTTP1_bx",
if_forward=True,
if_phase1=True,
start_limb=0,
end_limb=prm.L,
)
nttp2_bx = pf.ntt(
nttp1_bx,
f"NTTP2_bx",
if_forward=True,
if_phase1=False,
start_limb=0,
end_limb=prm.L,
)
"""
"""
res_ax = pf.end(nttp2_ax, 1, 0)
res_bx = pf... | Python | 1 |
import pandas as pd
import numpy as np
from sklearn.linear_model import Lasso
from sklearn.model_selection import cross_val_score
from sklearn.preprocessing import StandardScaler
# Function to load data from a CSV file
def load_data(file_path, target_column):
data = pd.read_csv(file_path)
data = data.drop(colu... | Python | 1 |
import uuid
from flask import Flask, render_template, request
from services.awg_converter.converter import decode_config
from services.awg_converter.exceptions import DecodeError
from config import sentry_sdk
app = Flask(__name__)
app.secret_key = uuid.uuid4().hex
@app.route('/', methods=['GET'])
def index():
... | Python | 1 |
#!/usr/bin/env python
from __future__ import print_function
import roslib
roslib.load_manifest('nav_cloning')
import rospy
import csv
import math
import numpy as np
def calc_histogram_training_posture():
rospy.init_node('calc_histogram_training_posture_node', anonymous=True)
path = roslib.packages.get_pkg_dir(... | Python | 1 |
``
//!
//! Example 2: deserialize a structure
//!
//! ```rust
//! let my_struct: MyStruct = body!(req, MyStruct);
//! ```
//!
//! # Response
//!
//! The `response!` macro allows you to easily create an HTTP response by specifying the HTTP status
//! code and either a JSON object, a serializable structure, or... | Rust | 0 |
If a team doesn't have permission for the repository, you will receive a `404 Not Found` response status.
*
* **Note:** You can also specify a team by `org_id` and `team_id` using the route `GET /organizations/{org_id}/team/{team_id}/repos/{owner}/{repo}`.
*
* FROM: <https://docs.github.com/rest/re... | Rust | 0 |
def showReadingGlassesOrder(firstName, lastName, Address, Country, Lenses, Boolean):
print("********************************************** ")
if firstName=="Akshay" and Country=="Canada":
print(firstName + " " + lastName)
print(Address + ", " + Country)
print("---------------------------... | Python | 1 |
match self {
ConsumedOk(t) => ConsumedOk(f(t)),
EmptyOk(t) => EmptyOk(f(t)),
ConsumedErr(e) => ConsumedErr(e),
EmptyErr(e) => EmptyErr(e),
}
}
}
/// A `Result` type which has the consumed status flattened into the result.
/// Conversions to and from ... | Rust | 0 |
LAYOUTS_EXPS = {
"random0": [1, 3, 4, 5, 7, 9, 17, 26, 28, 29],
"random0_medium": [12, 21, 29, 36, 38, 39, 44, 46, 47, 49],
"random1": [3, 15, 71, 74, 77, 80, 99, 119, 120, 134],
"random3": [3, 34, 38, 42, 90, 98, 112, 115, 162, 164],
"small_corridor": [34, 55, 78, 79, 90, 93, 120, 129, 133, 144],
... | Python | 1 |
E_SECRET_KEY = os.environ.get('TIBANNA_PROFILE_SECRET_KEY', '')
# default step function name
TIBANNA_DEFAULT_STEP_FUNCTION_NAME = os.environ.get('TIBANNA_DEFAULT_STEP_FUNCTION_NAME', 'tibanna_unicorn')
# S3_ENCRYPT_KEY_ID for Tibanna output buckets
S3_ENCRYT_KEY_ID = os.environ.get('S3_ENCRYPT_KEY_ID', None)
# dynam... | Python | 1 |
r(), "--depth", "1"]
} else {
vec!["--single-branch", "--branch", "master"] // Can't specify depth if you switch to a different commit hash later.
};
let git_status = Command::new("git")
.arg("clone")
.args(clone_args)
.... | Rust | 0 |
FIG_DHCP_SEND_HOSTNAME")]
pub static SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME: once_cell::sync::Lazy<&'static str> =
once_cell::sync::Lazy::new(|| unsafe {
CStr::from_ptr(ffi::NM_SETTING_IP_CONFIG_DHCP_SEND_HOSTNAME)
.to_str()
.unwrap()
});
#[doc(alias = "NM_SETTING_IP_CONFIG_DHCP_TI... | Rust | 0 |
This crate provides functions which can query a SkySpark server, using
//! the Haystack REST API and the SkySpark REST API's `eval` operation.
//! Some Haystack operations are not implemented
//! (watch* operations, pointWrite and invokeAction).
//!
//! # Example Usage
//! Put this in the main function in the `main.rs... | Rust | 0 |
import pyved_engine as pyv
# constants
BG_COLOR = 'antiquewhite2'
COLOR_PALETTE = {
0: (244, 105, 251),
1: (105, 184, 251)
}
class SharedVars:
def __init__(self):
self.game_over = False
self.av_y_speed = 0
self.curr_color_code = 0
def event_handling(ev_queue, state):
pygame... | Python | 1 |
able: Assignable) -> ObjectKey {
db.intern_object(Object { typ, assignable }).into()
}
pub fn try_new(
db: &dyn Arch,
typ: impl TryIntern<ObjectType>,
assignable: impl TryResult<Assignable>,
) -> Result<ObjectKey> {
Ok(Object::new(
db,
typ.try... | Rust | 0 |
etstate__ and it does not
# accept any arguments so we need to make sure not to call it with
# an argument here. To be compatible with Python < 3.11 we need to
# be careful not to assume that c or object has a __getstate__
# method though.
getstate = getattr(c... | Python | 1 |
"));
/// A helper that renders any error as context for `DownloadError`.
#[derive(Debug, Fail)]
struct DisplayError(String);
impl fmt::Display for DisplayError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
self.0.fmt(f)
}
}
#[derive(Debug, Fail, Clone, Copy)]
pub enum DownloadErrorKind {
... | Rust | 0 |
0903"]), ("\uAC00\u0903",
&["\uAC00\u0903"], &["\uAC00", "\u0903"]), ("\uAC00\u0308\u0903",
&["\uAC00\u0308\u0903"], &["\uAC00\u0308", "\u0903"]), ("\uAC01\u0903",
&["\uAC01\u0903"], &["\uAC01", "\u0903"]), ("\uAC01\u0308\u0903",
&["\uAC01\u0308\u0903"], &["\uAC01\u0308",... | Rust | 0 |
_stars>1-10
use core::fmt;
use std::ops::Range;
use chumsky::{
error::{Error, Simple},
prelude::*,
text::{ident, int, TextParser},
Parser,
};
pub use Dir::*;
pub use Token::*;
use crate::spanned::{Spanned, SpannedExt};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum Dir {
L,
R,
}
... | Rust | 0 |
# SHIFTED BINARY SEARCH
# O(logN) time and space
def shiftedBinarySearch(array, target):
# Write your code here.
return binarySearch(array, target, 0, len(array) - 1)
def binarySearch(array, target, left, right):
if left > right:
return -1
mid = left + right
if array[mid] == target:
return mid
if... | Python | 1 |
{
self.inner_mut().find_control_mut(arg)
}
#[inline]
fn find_control<'a>(&'a self, arg: types::FindBy<'a>) -> Option<&'a dyn Control> {
self.inner().find_control(arg)
}
#[inline]
fn native_container_id(&self) -> <Self as HasNativeIdInner>::Id {
self.inner().native_container... | Rust | 0 |
import pytest
from crime_data.common.base import ExplorerOffenseMapping
from crime_data.common.cdemodels import HateCrimeCountView
class TestHateCrimeCountView:
"""Test the HateCrimeCountView"""
def test_hate_crime_count_view(self, app):
hcv = HateCrimeCountView('bias_name', year=2014, state_id=6, as... | Python | 1 |
44u32 => "MTLE-9990",
18046u32 => "MTLE-9990",
18146u32 => "MTLE-9990",
18264u32 => "MTLE-9990",
18300u32 => "MTLE-9990",
18303u32 => "MTLE-9990",
18360u32 => "MATH-1010",
18008u32 => "MATH-1020",
18293u32 => "MATH-2010",
18018u32 => "MATH-2400",
18015u32 => "MATH-4800",
18071u32 => "MATH-6970",
18072u32 =>... | Rust | 0 |
).unwrap();
assert_eq!(
*t.root(),
reference_trie_root::<T, _, _, _>(vec![
(vec![0x01u8, 0x23], vec![0x01u8, 0x23]),
(vec![0x81u8, 0x23], vec![0x81u8, 0x23]),
(vec![0xf1u8, 0x23], vec![0xf1u8, 0x23]),
])
);
}
test_layouts!(insert_value_into_branch_root, insert_value_into_branch_root_internal);
fn inse... | Rust | 0 |
path: &str,
method: &str,
) -> Result<Vec<String>, Box<dyn std::error::Error>> {
let conn = Connection::new_session()?;
let proxy = conn.with_proxy(service, obj_path, Duration::from_millis(100));
let (name,): (Vec<String>,) = proxy.method_call(service, method, ())?;
Ok(name)
}
pub fn dbus_call(
... | Rust | 0 |
import matplotlib.pyplot as plt
import torch
import numpy as np
from sklearn.manifold import TSNE
from sklearn.metrics import confusion_matrix, ConfusionMatrixDisplay
def make_loss_plot(epochs, losses):
plt.plot(range(epochs), torch.hstack(losses).detach().numpy())
plt.ylabel('Loss')
plt.xlabel('Epoch');
... | Python | 1 |
);
self
}
pub fn set_sql_injection_match_set_id(
mut self,
input: std::option::Option<std::string::String>,
) -> Self {
self.sql_injection_match_set_id = input;
self
}
/// <p>The name of the <code>SqlInjectionMatchSet</c... | Rust | 0 |
nonzero(delete_mask).squeeze(1)
return delete_mask
# def process_gaussian_cloud_torch(self, gaussian_cloud, depth_map):
# # 将高斯点云的坐标转换为128x128深度图的尺度
# coords = (gaussian_cloud[:, :3] * 127).long()
# # 确保坐标在合法范围内
# coords = torch.clamp(coords, 0, 127)
# # 将深度图转换为二值图(深... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.