text string | label_name string | labels int64 |
|---|---|---|
diffuse_bind_group
})
}
#[allow(unused_variables)]
fn resize(&mut self, display: &Display, width: u32, height: u32) {
self.camera.calc_aspect(width, height);
}
#[allow(unused_variables)]
fn update(&mut self, display: &Display, dt: Duration) {
}
#[allow(un... | Rust | 0 |
"VkPhysicalDeviceSubgroupSizeControlPropertiesEXT")]
#[derive(Copy, Clone)]
#[repr(C)]
pub struct PhysicalDeviceSubgroupSizeControlPropertiesEXT {
pub s_type: crate::vk1_0::StructureType,
pub p_next: *mut std::ffi::c_void,
pub min_subgroup_size: u32,
pub max_subgroup_size: u32,
pub max_compute_work... | Rust | 0 |
0.9891765099647811,
-0.049067674327415586,
-0.9987954562051722,
-0.14673047445536058,
0.9700312531945421,
0.3368898533922222,
-0.9039892931234447,
-0.5141027441932267,
0.8032075314806446,
0.6715589548470253,
-0.6715589548470154... | Rust | 0 |
String,
total: String,
}
impl MyOrder{
fn new(asset:&str,unit:&str,price:f64)->MyOrder{
let cost = &key(&[asset,":",unit,":",&tostring(price),":"]);
MyOrder{
price: key(&[asset,":",unit,":",&tostring(price)]),
time: key(&[cost,"time"]),
side: key(&[cost,"side... | Rust | 0 |
set of field: ",
stringify!(iox_pub_options_t),
"::",
stringify!(subscriberTooSlowPolicy)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<iox_pub_options_t>())).initCheck as *const _ as usize },
24usize,
concat!(
"Offset of field: ... | Rust | 0 |
d_messages(paraphaser_response)
query_generator_response = query_generator.send_request(query_generator_messages)
print("\nquery list:\n")
print(query_generator_response, end='\n')
query_list = ast.literal_eval(query_generator_response)
with ThreadPoolExecutor() as executor:
# 使用 map 保持顺序
... | Python | 1 |
mut dispatcher = Dispatcher::default();
let mut parser = Parser::new();
for byte in INPUT {
parser.advance(&mut dispatcher, *byte);
}
assert_eq!(dispatcher.dispatched.len(), 2);
match &dispatcher.dispatched[0] {
Sequence::Osc(_, false) => (),
... | Rust | 0 |
'weapon': ['sai', 'bo staff']})
>>> df.to_csv('out.csv', index=False).execute()
"""
if mode != "w": # pragma: no cover
raise NotImplementedError("only support to_csv with mode 'w' for now")
op = DataFrameToCSV(
path=path,
sep=sep,
na_rep=na_rep,
float_format... | Python | 1 |
TreeNode {
val: 6,
left: Some(Rc::new(RefCell::new(TreeNode::new(5)))),
right: None,
}))),
}))),
})));
assert_eq!(res1, add_one_row(t1, 1, 2));
let t2 = Some(Rc::new(RefCell::new(TreeNode {
val: 4,
left: Some(Rc::new(RefCell... | Rust | 0 |
0xb0, 0xdf, 0x85,
0x8e, 0xf7, 0xab, 0x39, 0xec, 0x50, 0x2c, 0xd2, 0x98, 0xf2, 0xc4, 0x84, 0xa9, 0xf4,
0xc7, 0xda, 0x74, 0x36,
],
ephemeral_key: [
0x8f, 0xbe, 0xb6, 0xb3, 0x03, 0x8e, 0x69, 0x49, 0x91, 0x6a, 0x2c, 0x06, 0x0e, 0xf9,
0... | Rust | 0 |
ECSZ_R {
ECSZ_R::new(((self.bits >> 10) & 0x03) as u8)
}
}
impl W {
#[doc = "Bits 0:1 - External RAM Address"]
#[inline(always)]
pub fn eradr(&mut self) -> ERADR_W {
ERADR_W { w: self }
}
#[doc = "Bits 2:3 - External RAM Size"]
#[inline(always)]
pub fn ersz(&mut self) ->... | Rust | 0 |
y = base.x + offset[0], base.y + offset[1]
# Do we ever reach out of map bounds?
if not (0 <= px < map_width and 0 <= py < map_height):
continue
if picture[py][px] != NOT_COLORED_YET:
continue
... | Python | 1 |
f your application has many
/// clients and you wish to keep your server happy and your
/// bandwidth costs manageable, don't use too many buckets.
///
///
/// # Panics
///
/// If `name` is already used by another histogram in `service`.
///
/// If `min >= max`.
///
/// If `b... | Rust | 0 |
'0': ('', []),
'1': ('', [
CSN1Bit(name='downlink_npm_transfer_time', bit=5)])}),
CSN1Alt(alt={
'0': ('', []),
'1': ('', [
CSN1Bit(name='event_based_fanr')])}),
CSN1Ref(name='downlink_egprs_level', obj=egprs_level_ie),
CSN1... | Python | 1 |
// TODO: get shader iv的结果是否也需要参考
true => wrapper::is_shader(shader_id),
false => false
}
}
pub fn attach_shader(program_id : GLuint, shader_id : GLuint) -> Result<(), String> {
wrapper::attach_shader(program_id, shader_id);
// TODO: glGetError check
Ok... | Rust | 0 |
status=response.status_code
).inc()
return response
def setup_performance_monitoring(app):
"""Setup database query performance monitoring"""
if app.config.get('SQLALCHEMY_RECORD_QUERIES'):
from sqlalchemy import event
from sqlalchemy.engine import Engine
... | Python | 1 |
] ^ (bbb[$pj2] | !bbb[$pj3])) )*
// Parallel Round 2
$( round!(bbb[$pi0], bbb[$pi1], bbb[$pi2], bbb[$pi3], bbb[$pi4],
$data[$pdata_index2], $pbits2, 0x5c4dd124,
(bbb[$pi1] & bbb[$pi3]) | (bbb[$pi2] & !bbb[$pi3])) )*
// Parallel Round 3
$( round!(bbb[... | Rust | 0 |
raw::c_int;
pub fn sqlite3_column_type(
stmt: *mut sqlite3_stmt,
col_index: os::raw::c_int,
) -> os::raw::c_int;
}
<filename>crates/nu-data/src/value.rs<gh_stars>0
use crate::base::coerce_compare;
use crate::base::shape::{Column, InlineShape};
use crate::primitive::style_primitive;
use chrono::... | Rust | 0 |
>{
&self.data[idx].v
}
pub fn is_generated( &self ) -> bool {
self.generated
}
}
// fn get_random_point_in_ellipse( rng:&mut Rng, width:f64, height:f64 ) -> ( f64, f64 ){
// let t = 2. * PI * rng.next_f64();
// let u = rng.next_f64() + rng.next_f64();
// let r = if u > 1. { 2. - u } else { u };
// ( width... | Rust | 0 |
"""Waveshare e-Paper display drivers."""
from .epd4in2b_v2 import EPD4in2bV2
from .utils import delay_ms
__all__ = ["EPD4in2bV2", "delay_ms"]
| Python | 1 |
import os
import numpy as np
from .eb_operations import *
def pre_compute_params(nchan, length, fs, cfreq):
coscf_total = np.zeros((nchan, length))
sincf_total = np.zeros((nchan, length))
for chan in range(nchan):
cf = cfreq[chan]
tpt = 2 * math.pi / fs
cn = np.cos(tpt * cf)
... | Python | 1 |
import pyautogui
import time
import getpixelcolor
import webbrowser
class Jump:
def short_press():
pyautogui.keyDown("space")
pyautogui.keyUp("space")
def long_press():
pyautogui.keyDown("space")
time.sleep(0.001)
pyautogui.keyUp("space")
class Crouch:
def short_c... | Python | 1 |
StructArray};
use arrow::chunk::Chunk;
use arrow::datatypes::{DataType, Field};
pub fn chunk_to_struct(chunk: Chunk<ArrayRef>, fields: Vec<Field>) -> StructArray {
let dtype = DataType::Struct(fields);
StructArray::from_data(dtype, chunk.into_arrays(), None)
}
mod manager;
mod messages;
pub use manager::DBMan... | Rust | 0 |
import tkinter as tk
from tkinter import filedialog
from pytube import YouTube
import instaloader
def download_video():
youtube_url = youtube_url_entry.get()
instagram_url = instagram_url_entry.get()
download_path = filedialog.askdirectory()
try:
if youtube_url:
yt = YouTube(youtub... | Python | 1 |
.squares[x][y];
}
// down
if x < self.squares.len() - 2
&& self.squares[x + 1][y].is_opposite(self.squares[x][y])
&& !self.squares[x + 2][y].is_opposite(self.squares[x][y])
{
self.squares[x + 1][y] = self.squares[x][y];
}
// left
... | Rust | 0 |
:param parent_id: 父目录 id,默认是根目录
:param min_depth: 最小深度,小于此深度的不会输出
:param max_depth: 最大深度,大于此深度的不会输出,如果小于 0 则无限
:param predicate: 以文件或目录的信息作为参数进行调用,并以返回值作为筛选条件
- 如果返回值是 0 或 None,则跳过此节点以及位于此节点之下的所有节点
- 如果返回值是 1,则输出此节点,但跳过位于此节点之下的所有节点
- 如果返回值是 False,则跳过此节点(但依然会继续处理位于此节点之下的节点)
... | Python | 1 |
o
rgH @ s< d dl mZ d dlmZmZ d dlZd dlmZmZmZm Z m
Z
mZmZ d dl
Zd dlmZ d dlmZmZmZmZmZmZ d dlmZmZ dIddZdId
dZdIddZdIddZdIddZdIddZ dIddZ!dIddZ"dIddZ#dIddZ$G dd d Z%i Z&dJd"d#Z'dKd&d'Z(G d(d) d)e)Z*G... | Python | 1 |
fn workchain_id(&self) -> Option<i32> {
self.workchain
}
pub fn from_file(
configs_dir: &str,
json_file_name: &str,
adnl_config: Option<AdnlNodeConfigJson>,
default_config_name: &str,
client_console_key: Option<String>
) -> Result<Self> {
let config_... | Rust | 0 |
v_expansion_right =
Some(self.generate_expansion_params(params.stop_round() + 1, params.t_exp_right));
// Params for converison
let g_conv = build_gadget(params, 2, 2 * params.t_conv);
let sk_reg_ntt = self.sk_reg.ntt();
let sk_reg_squared_ntt = &sk_reg_n... | Rust | 0 |
import sys
from datetime import datetime
import time,json,requests
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def create_kernel(instance_id,api_key,payload):
url=service_endpoint_url+'/ae/'+instance_id+"/jkg/api/kernels"
response = requests.post(url, data = payload, head... | Python | 1 |
map_ok(move |cookies| {
for c in cookies.iter() {
req.headers_mut().insert(
hyper::header::COOKIE,
hyper::header::HeaderValue::from_str(&format!("{}", c)).unwrap(),
);
}
req
... | Rust | 0 |
&'a Cancellable>>, R: FnOnce(Result<isize, Error>) + Send + 'static>(&self, source: &P, flags: OutputStreamSpliceFlags, io_priority: glib::Priority, cancellable: Q, callback: R) {
let cancellable = cancellable.into();
let cancellable = cancellable.to_glib_none();
let user_data: Box<Box<R>> = Box... | Rust | 0 |
icon_bytes = None
try:
icon_bytes = await character.get_icon_async()
except bestdori.exceptions.NotExistException:
icon_bytes = None
char_names = char_info.get('characterName', [])
if len(char_names) > idx and char_names[idx]:
... | Python | 1 |
inline(always)]
pub fn auxio20(self) -> &'a mut W {
self.variant(SRC_A::AUXIO20)
}
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO19"]
#[inline(always)]
pub fn auxio19(self) -> &'a mut W {
self.variant(SRC_A::AUXIO19)
}
#[doc = "AUX_EVCTL:EVSTAT1.AUXIO18"]
#[inline(always)]
pub fn a... | Rust | 0 |
import sqlite3
from collections.abc import Sequence
from datetime import datetime
from pathlib import Path
from attrs import define
from pyeclab.channel.writers.abstractwriter import AbstractWriter
@define
class SqlWriter(AbstractWriter):
""""""
db: Path | str
experiment_name: str
def write(self, ... | Python | 1 |
w(Ipv4Addr::new([192, 168, 0, 0]), 24).unwrap().into();
let subnet_v6 =
Subnet::new(Ipv6Addr::new([1, 2, 3, 4, 5, 6, 7, 8, 0, 0, 0, 0, 0, 0, 0, 0]), 64)
.unwrap()
.into();
let entry_v4: EntryDest<_, ()> = EntryDest::Remote {
next_hop: SpecifiedAddr... | Rust | 0 |
if copy:
pos = line.find("'''")
content = line[:pos].rstrip()
line = line[pos:]
copy = False
found = True
else:
content = content + line[li... | Python | 1 |
g_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)),
('meeting_time', models.DateTimeField(default=None, null=True)),
('meeting_link', models.CharField(default=None, max_length=255, null=True)),
('mentee', models.ForeignKey(on_d... | Python | 1 |
hared.cmd_opts.medvram:
lowvram.setup_for_low_vram(sd_model, shared.cmd_opts.medvram)
else:
sd_model.to(shared.device)
sd_hijack.model_hijack.hijack(sd_model)
sd_model.eval()
shared.sd_model = sd_model
script_callbacks.model_loaded_callback(sd_model)
print(f"Model loaded.")
... | Python | 1 |
import vim
import vimp
def get_syntax_group(position=None):
"""
Get the name of the syntax group of the character at the specified position
in the current buffer.
Arguments
---------
position: Position
Position of the character in question (line and column indices are
zero-bas... | Python | 1 |
-> empty bytes object\n\nConstruct an immutable array of bytes from:\n \
- an iterable yielding integers in range(256)\n \
- a text string encoded using the specified encoding\n \
- any object implementing the buffer API.\n \
- an integer";
extend_class!(context, bytes_type... | Rust | 0 |
# Creation of an Ellipse
from salome.kernel import salome
salome.salome_init_without_session()
from salome.kernel import GEOM
from salome.geom import geomBuilder
geompy = geomBuilder.New()
gg = salome.ImportComponentGUI("GEOM")
# create vertices
p0 = geompy.MakeVertex(0., 0., 0.)
p1 = geompy.MakeVertex(50., 50., 50.)... | Python | 1 |
# book_base_test.py
#
# This file is part of LilyPond, the GNU music typesetter.
#
# Copyright (C) 2020--2023 Han-Wen Nienhuys <hanwen@xs4all.nl>
#
# LilyPond 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, ei... | Python | 1 |
import yaml
import torch
import numpy as np
from env.resource_env import ResourceEnv
from rlalloc.agents.sac import SAC
from rlalloc.experts.baseline_heuristics import ExpertPolicy
from rlalloc.utils.preprocessing import TraceProcessor
def main():
# Load config
with open('experiments/configs/config.yaml', 'r')... | Python | 1 |
:{Add, AddAssign, MulAssign, Neg, Sub, SubAssign},
};
use num_traits::{One, Zero};
use rand::{
distributions::{Distribution, Standard},
Rng,
};
#[cfg(not(feature = "cuda"))]
use crate::accel_dummy::*;
#[cfg(feature = "cuda")]
use accel::*;
#[cfg(feature = "cuda")]
use {
crate::curves::BatchGroupArithmetic... | Rust | 0 |
ate.get("current_user") != user_id:
st.session_state.current_user = user_id
st.session_state.session_keys = get_session_keys(user_id)
st.session_state.active_session = st.session_state.session_keys[0] if st.session_state.session_keys else None
with st.sidebar:
st... | Python | 1 |
fn wait_for_empty_jobs(&self) {
trace!("waiting for threads to finish processing");
for job in self.local_jobs.iter() {
job.send(Job::Wait).expect("Error while sending job");
}
self.barrier.wait();
}
fn dispatch(&mut self, packet: Packet<'static>, ctx: &ParseCo... | Rust | 0 |
class Logger:
def __init__(self):
pass
@staticmethod
def success(msg):
msg = "{} {}".format("✅ ",msg)
print(msg)
@staticmethod
def info(msg):
msg = "{} {}".format("ℹ️ ",msg)
print(msg)
@staticmethod
def warning(msg):
msg = "{} {}... | Python | 1 |
9r rq rt rs rv rr rw r rx ry r% re rp rf rj ro rn rm rl rg ri rh rk ru r r$ Nrb r r r r r r r r r r r r r r r r$ r* __next__r r r r r^ r^ s N !8< <J#P-k... | Python | 1 |
zer)?;
input
.parse::<isize>()
.map(|v| Some(v))
.map_err(de::Error::custom)
}
<reponame>ololoshka2871/self-recorder-packet
#![feature(total_cmp)]
#![feature(mixed_integer_ops)]
mod test {
use std::path::Path;
use self_recorder_packet::{DataBlockPacker, DataBlockUnPacker};
fn ... | Rust | 0 |
import numpy as np
def espirit(X, d, delta):
print("X: ", X.shape)
M = X.shape[0]
X_esp = X[:-1]
print("X_esp: ", X_esp.shape)
Y_esp = X[1:]
print("Y_esp: ", Y_esp.shape)
Z = np.concatenate((X_esp, Y_esp), axis=0)
print("Z: ", Z.shape)
U_z, S_z, V_z = np.linalg.svd(Z)
print(... | Python | 1 |
.')
# disable ground plane usage if plane data is not available
# this fixes the AssertionError: `use_ground_plane` is True but find plane is None
if hasattr(cfg, 'train_pipeline'):
for i, transform in enumerate(cfg.train_pipeline):
if transform.get('type') == 'ObjectSample':
... | Python | 1 |
import random
from sympy import isprime, primerange
def generate_large_prime(start=10**5, end=10**6):
"""
Generate a large random prime number within the specified range.
"""
primes = list(primerange(start, end))
return random.choice(primes)
def diffie_hellman(p=None):
"""
Implements the D... | Python | 1 |
WriteExt};
use tracing_futures::Instrument;
/// Initializes new HTTP/2.0 streams on a connection by sending a request.
///
/// This type does no work itself. Instead, it is a handle to the inner
/// connection state held by [`Connection`]. If the associated connection
/// instance is dropped, all `SendRequest` functio... | Rust | 0 |
plateSpecDownwardApiResourceFieldRef {
ScaledJobJobTargetRefTemplateSpecDownwardApiResourceFieldRef {
container_name: None,
divisor: None,
resource,
}
}
}
use core::cmp::Ordering;
use std::borrow::Borrow;
use ark_crypto_primitives::prf::blake2s::constraints::{
... | Rust | 0 |
# -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo import fields, models
class ResCompany(models.Model):
_inherit = 'res.company'
l10n_ma_employer_contribution = fields.Float(string="Employer's contribution")
l10n_ma_social_security_organization ... | Python | 1 |
name='Read'
))
fig_disk.add_trace(go.Scatter(
x=[point['timestamp'] for point in self.metrics_history['disk_write']],
y=[point['value'] for point in self.metrics_history['disk_write']],
name='Write'
))
... | Python | 1 |
projectConfig.file_save_funcs[file_path] = save_func
total_chunks.extend(input_splitter.split(json_list, file_path))
if eng_type == "GenDic":
all_jsons.extend(json_list)
except Exception as exc:
LOGGER.error(get_text("file_processing_error"... | Python | 1 |
osY(n) => n,
CameraChange::PosZ(n) => n,
CameraChange::AxisUpX(n) => n,
CameraChange::AxisUpY(n) => n,
CameraChange::AxisUpZ(n) => n,
CameraChange::DirectionX(n) => n,
CameraChange::DirectionY(n) => n,
CameraChange::DirectionZ(n) => n,
... | Rust | 0 |
) -> torch.Tensor:
"""Compute PDE residual loss"""
coords = collocation_points.clone().detach().requires_grad_(True)
u_pred = model.forward(coords)
# Use the problem's residual function
residual = problem.compute_residual(coords, u_pred)
target = torch.zeros_like(re... | Python | 1 |
_verbose(level);
pdf_encoding_set_verbose(level);
agl_set_verbose(level);
otf_cmap_set_verbose(level);
}
pub(crate) unsafe fn pdf_font_get_verbose() -> i32 {
__verbose
}
pub(crate) unsafe fn pdf_font_set_dpi(font_dpi: i32) {
PKFont_set_dpi(font_dpi);
}
/* Here is the complete list of PDF object ty... | Rust | 0 |
m),*)
} else {
panic!();
}
}
}
/// Paging-related arch-specific capabilities.
mod paging;
pub use self::paging::{PML4Descriptor, PML4Cap,
PDPTDescriptor, PDPTCap,
PDDescriptor, PDCap,
PTDescriptor, PTCap,
... | Rust | 0 |
/// 2. The points list where each line contains the `id` of the point, which must be **equal to the position** in the list,
/// followed by the `x` and `y` (and `z`) coordinates;
/// 3. The cells list where each line contains the `id` of the cell, which must be **equal to the position** in the list,
//... | Rust | 0 |
index, arima_test_df['pred_sales'], label='forecast')
plt.legend(loc='best')
plt.xlabel('date')
plt.ylabel('sales')
plt.title('Seasonal ARIMA (SARIMA) forecasts with actual sales and errors')
plt.show()
st.pyplot(plt)
result_df_sarima = arima_test_df.groupby('model').agg(total_sales=('sales', 'sum'),
... | Python | 1 |
tags, children)
}
}
#[derive (Debug)]
pub struct OmapValue {
styles: CommonStyles,
alias: Option<Cow<'static, str>>
}
impl OmapValue {
pub fn new (styles: CommonStyles, alias: Option<Cow<'static, str>>) -> OmapValue { OmapValue { styles: styles, alias: alias } }
pub fn take_alias (&mut self... | Rust | 0 |
al_index)
return -1 # the model is already drawn
elif individual_index+1 <= app.NumModels(): # 一般是从零起步
logger = logging.getLogger(__name__)
logger.debug('The model already exists for individual with index=%d. Skip it.', individual_index)
return -1 # the model... | Python | 1 |
ck
hidden_states = self.norm_out(hidden_states, temb=emb)
hidden_states = self.proj_out(hidden_states)
# 5. Unpatchify
p = self.config.patch_size
p_t = self.config.patch_size_t
if p_t is None:
output = hidden_states.reshape(batch_size, num_frames, height // ... | Python | 1 |
stringify!(ft_eeprom_4222h),
"::",
stringify!(GPIO0_OpenDrain)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<ft_eeprom_4222h>())).GPIO1_OpenDrain as *const _ as usize },
53usize,
concat!(
"Offset of field: ",
stringify!... | Rust | 0 |
"Zábavy nikdy není dost! Jen pozor, ať ti ještě zbyde i na chleba. 😉",
"drug": "🧴 Drogéria je drahá, hlavne keď sú v tom deti. 😉 / "
"Drogérie je drahá, hlavně když jsou v tom děti. 😉",
"elec": "💻 Nový kúsok? Nech dlho slúži a uľahčí deň. 🚀 / "
"Nový kousek? Ať d... | Python | 1 |
pe_1_hygiene() {
let result = true;
let bv: super::BitVec = bit_vec![result];
assert!( bv[0] );
}
// Implements Index for any type that implements Bits.
macro_rules! impl_index_from_bits {
(
$(
impl[ $($param:tt)* ] Index<$ix:ty> for $bv:ty ;
)+
)=> {
$(
impl<$($... | Rust | 0 |
from django.core.mail import EmailMessage
from django.conf import settings
from django.template.loader import render_to_string
# from django.contrib.auth.models import User
from django.contrib.auth import get_user_model
from django.contrib.auth.tokens import default_token_generator
from django.contrib.sites.models impo... | Python | 1 |
IC_KEY_HEX).unwrap();
let verify_msg = QueryMsg::VerifyCosmosSignature {
message: Binary(message),
signature: Binary(signature),
public_key: Binary(public_key),
};
let raw = query(&mut deps, mock_env(), verify_msg).unwrap();
let res: VerifyResponse = from_slice(&raw).unwrap();
... | Rust | 0 |
import RPi.GPIO as GPIO
import time
SW = [5,6,13,19]
GPIO.setwarnings(False)
GPIO.setmode(GPIO.BCM)
GPIO.setup(SW[0],GPIO.IN,pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(SW[1],GPIO.IN,pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(SW[2],GPIO.IN,pull_up_down=GPIO.PUD_DOWN)
GPIO.setup(SW[3],GPIO.IN,pull_up_down=GPIO.PUD_DOWN)
SwC ... | Python | 1 |
args.seed)
if seed != -1:
print(f'Set the global seed: {seed}')
np.random.seed(int(args.seed))
_make_dirs(args.out_dir)
print('====Start processing train dataset====')
if args.use_training_set:
_process_data(args, 'train', 'train')
else:
_process_data(args, 'val', '... | Python | 1 |
ersion {version or '<none>':6} for {path}")
total += 1
print(f"Updated {total} file(s)")
def main():
parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('--overwrite', action='store_true', help="overwrite existing version tags")
parser.add_argument('--baseline', metavar... | Python | 1 |
"""MCP Inspector integration for MCP-Grep."""
import os
import subprocess
import sys
from pathlib import Path
def run_inspector():
"""Run the MCP Inspector with the MCP-Grep server.
This function launches the MCP Inspector web UI with the MCP-Grep server
configured, allowing for interactive debuggin... | Python | 1 |
\"`*"]
pub struct HTTP_MULTIPLE_KNOWN_HEADERS {
pub HeaderId: HTTP_HEADER_ID,
pub Flags: u32,
pub KnownHeaderCount: u16,
pub KnownHeaders: *mut HTTP_KNOWN_HEADER,
}
impl ::core::marker::Copy for HTTP_MULTIPLE_KNOWN_HEADERS {}
impl ::core::clone::Clone for HTTP_MULTIPLE_KNOWN_HEADERS {
fn clone(&self... | Rust | 0 |
assert m_cmd.call_args_list == [
mock.call(mock.ANY, cwd=target.ios_dir, env=mock.ANY),
mock.call([
"xcodebuild",
"-configuration",
"Debug",
"-allowProvisioningUpdates",
"ENABLE_BITCODE=NO",
"... | Python | 1 |
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c) 2024 Phil Thompson <phil@riverbankcomputing.com>
from PyQt6.QtWidgets import (QCheckBox, QComboBox, QFormLayout, QGroupBox,
QLineEdit, QVBoxLayout)
from ....helpers import BaseDialog
from .helpers import BaseType, split_annos
class EnumPropertiesDia... | Python | 1 |
t = np.zeros([10], dtype=int)
for i, bone in enumerate(bones):
start_point, end_point = bone
if is_right(
model_pose[start_point],
model_pose[end_point],
gt_pose[start_point],
gt_pose[end_point],
):
check_result[i] = 1
else:... | Python | 1 |
] extern crate lazy_static;
#[macro_use] extern crate serde_derive;
#[macro_use] extern crate try_opt;
extern crate base64;
extern crate cargo;
extern crate regex;
extern crate reqwest;
extern crate serde_json;
extern crate serde;
extern crate toml;
mod github;
mod license;
mod lockfile;
use std::path::PathBuf;
use ... | Rust | 0 |
downsample=PatchEmbed if (i_layer < self.num_layers - 1) else None,
focal_level=focal_levels[i_layer],
focal_window=focal_windows[i_layer],
use_conv_embed=use_conv_embed,
use_checkpoint=use_check... | Python | 1 |
rs,
np.cos(x_vars) + x_vars,
np.sin(y_vars) + y_vars,
np.cos(y_vars) + y_vars,
np.sin(z_vars) + z_vars,
np.cos(z_vars) + z_vars,
x_vars**2 + y_vars**2 + z_vars**2,
]
features = np.stack(features, axis=1)
# The concepts just... | Python | 1 |
"""Allow reference sections by :ref: role using its title."""
from __future__ import annotations
from typing import TYPE_CHECKING, cast
from docutils import nodes
import sphinx
from sphinx.locale import __
from sphinx.util import logging
from sphinx.util.nodes import clean_astext
if TYPE_CHECKING:
from docutil... | Python | 1 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 1 |
[test]
fn test_game_loop() {
use rand::prelude::IteratorRandom;
use crate::ai;
use crate::player::{
*,
playercomputer::*,
};
let mut rng = rand::thread_rng();
use itertools::iproduct;
for ruleset in
iproduct!(
[10, 20], // n_base_price
[50, 100... | Rust | 0 |
'''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.GL import _types as _cs
# End users want this...
from OpenGL.raw.GL._types import *
from OpenGL.raw.GL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_... | Python | 1 |
p2p_backend=self.DISTRIBUTED_BACKEND,
)
tensor_parallel.random.model_parallel_cuda_manual_seed(0)
model = build_model(
bert_model_provider,
wrap_with_ddp=parallel_state.get_data_parallel_world_size() > 1,
virtual_pipeline_model_parallel_size=virtual_... | Python | 1 |
for key in loss_dict:
if "total" not in key:
if key not in eval_loss_info:
eval_loss_info[key] = 0
eval_loss_info[key] += torch.mean(loss_dict[key]).item()
total_loss = torch.mean(total_loss)
eval_loss += tot... | Python | 1 |
#################################################################################################
# Copyright (c) 2022-2024 Ali Hassani.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software with... | Python | 1 |
import torch
import numpy as np
import cv2 # 需要安装 opencv-python
# ======================================================================
# 1. 精准减法节点:SubtractMaskNode
# 将 mask_b 从 mask_a 中扣除(A & ~B),输出严格二值化后的结果
# ======================================================================
class PreciseSubtractMaskNode:
... | Python | 1 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from fairseq.data.encoders import register_bpe
@register_bpe('hf_byte_bpe')
class HuggingFaceByteLevelBPE(object):
@staticmethod
de... | Python | 1 |
from django.core.exceptions import ValidationError
from django.db import models
from django.contrib.auth.models import User
from django.db.models.deletion import CASCADE, PROTECT, RESTRICT, SET_NULL
from django.core.exceptions import ValidationError
BAD_WORDS = ['java', 'waterfall', 'enterprise']
def validate_no_bad_w... | Python | 1 |
'''
Author: Thyssen Wen
Date: 2022-04-29 10:48:58
LastEditors : Thyssen Wen
LastEditTime : 2022-05-16 21:04:06
Description: TSM action recognition head
FilePath : /ETESVS/model/heads/tsm_head.py
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import constant_init, kaiming_init
... | Python | 1 |
foreground=optplan.Material(mat_name="SiO2"),
background=optplan.Material(mat_name="SiO2"),
gds_layer=[101, 0],
extents=[-10000, -110],
),
optplan.GdsMaterialStackLayer(
foreground=optplan.Material(mat_name="Si"),
... | Python | 1 |
from .campaign_base import CampaignBase
from module.map.map_base import CampaignMap
from module.map.map_grids import SelectedGrids, RoadGrids
from module.logger import logger
from .isp1 import Config as ConfigBase
MAP = CampaignMap('ISP6')
MAP.shape = 'E5'
MAP.camera_data = ['C2']
MAP.camera_data_spawn_point = ['C2']
... | Python | 1 |
}
}
pub fn set_params(&mut self, param: Value) {
self.params = param;
}
}
#[derive(Debug, Serialize)]
pub struct DeleteOpts {
pub name: String,
pub cloud_provider: String,
pub optional: OptionalParam,
}
impl DeleteOpts {
pub fn new(
name: &str,
cloud_provi... | Rust | 0 |
rue, SmartyPants will be used to convert quotes and dashes to
# typographically correct entities.
#html_use_smartypants = True
# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# Additional templates that should be rendered to pages, maps page names to
# template names.
#html_addi... | Python | 1 |
ember, bot):
try:
dir_path = os.path.dirname(os.path.realpath(__file__))
avatar_url = member.avatar.url if member.avatar else member.default_avatar.url
user_img = fetch_and_prepare_avatar(avatar_url, resize_size)
if user_img:
bordered_img = create_circular_image(... | Python | 1 |
ndition) = edge.condition_mut() {
condition.simplify()
} else {
false
}
}
fn simplify_block(block: &mut Block) -> bool {
block
.expressions_mut()
.iter_mut()
.fold(false, |simplified, expr| expr.simplify() || simplified)
}
use nano_pool::cli::start_cli;
use nano_pool... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.