text string | label_name string | labels int64 |
|---|---|---|
]:
row.operator("gui.blenrig_6_tabs", icon="PREFERENCES", emboss = 1).tab = "gui_rig_bake"
row.label(text="RIGGING & BAKING")
col.separator()
box = col.box()
box.prop(arm_data, 'reproportion', text="Reproportion Mode", toggle=True, icon_only=True, icon='SHADER... | Python | 1 |
(vector_float4, vector_float4, vector_float4, vector_float4) {
( self._private[0], self._private[1], self._private[2], self._private[3])
}
fn transpose(self) -> Self {
let (vx, vy, vz, vw) = self.to_tuple();
matrix_float4x4::new(
vector_float4::new(vx.x(), vy.x(), vz.x(), vw.... | Rust | 0 |
super::{SimpleAbstractNode, Node, NodeKind};
type T = Range<u8>;
type U = Vec<T>;
type V = Node<T, U>;
type W = VecDeque<V>;
#[test]
fn can_create_simplex_and_confirm() {
let simplex = V::new_simplex(0..1, W::new());
let kind = simplex.kind();
assert_eq!(kind, NodeKind::Simplex);
}
#[test]
fn can_c... | Rust | 0 |
import pandas as pd
from typing import Union, Tuple
import numpy as np
def add_matches_column(df: pd.DataFrame) -> pd.DataFrame:
df = df.copy()
"""
Adds a new 'Matches' column to the DataFrame if it doesn't exist.
Parameters:
df (pd.DataFrame): The DataFrame to which the new column will be added.... | Python | 1 |
import os
import numpy as np
from scipy.misc import imread,imresize
from sklearn.model_selection import train_test_split
from glob import glob
def load_notmnist(path='./notMNIST_small',letters='ABCDEFGHIJ',
img_shape=(28,28),test_size=0.25,one_hot=False):
# download data if it's missing. If ... | Python | 1 |
m_slice::<G1Affine>(&hex::decode("5b3139322c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c302c305d").unwrap()).unwrap(),
g.to_affine(),
);
let g = G1Projecti... | Rust | 0 |
aim the reserved resources of `currency`, `source` and `target`. Returns whether the claim
// /// succeeds.
// fn claim(&self, currency: CurrencyId, source: &AccountId, target: &AccountId) -> bool;
// /// Weight for executing the operation.
// fn weight(&self) -> Weight;
// /// Cancel the resources of `currency` r... | Rust | 0 |
witch 2 Fan 5/1":{
"description":"Cisco Catalyst 9500X Series Fan Module"
},
"Switch 2 Fan 5/2":{
"description":"Cisco Catalyst 9500X Series Fan Module"
},
"Switch 2 Fan Tray Bay 4":{
"description":"Cisco Catalyst 9500X Series 1RU Fan Tray Bay Module C... | Python | 1 |
sys_enter_events())
.sample_cb(handle_event)
.lost_cb(handle_lost_event)
.build()?;
while spinlock.load(Ordering::Relaxed) {
match perf.poll(std::time::Duration::from_millis(100)) {
Ok(()) | Err(Error::System(4)) => {} // EINTER
Err(e) => return Err(e.into())... | Rust | 0 |
ted all images to be 3d but found image that has either more or less")
return list_images
def _get_features(
data: List[Tensor],
device: torch.device,
model: _CLIPModel,
processor: _CLIPProcessor,
) -> Tensor:
"""
Get the CLIP features for the given images.
Parameters
----------
... | Python | 1 |
/// ```
pub fn append_to_container_with_id(&mut self, name: &str, figure_id: u64, location: Point2D) {
// If there is already a definition
if !self.contains_id(figure_id) {
panic!("Definition not found!")
}
self.add_use_to(name, &Renderer::get_id_of_figure(figure_id... | Rust | 0 |
if has_focus {
co::COLOR::ACTIVECAPTION
} else {
co::COLOR::ACTIVEBORDER
});
let hpen = w::HPEN::CreatePen(co::PS::SOLID, 1, color)?;
defer! { hpen.DeleteObject().unwrap(); }
let hpen_def = hdc.SelectObjectPen(hpen)?;
defer! { hdc.SelectObjectPen(hpen_def).unwrap(); }
... | Rust | 0 |
r_each(|&e| *not_finished.entry(e).or_default() -= 1);
let finished = running
.iter()
.filter(|&e| *not_finished.get(e).unwrap() == 0)
.cloned()
.collect::<Vec<u8>>();
finished.iter().for_each(|f| {
not_finished.remove(f);
running... | Rust | 0 |
# Software License Agreement (BSD License)
#
# Copyright (c) 2013, Open Source Robotics Foundation, Inc.
# 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 mus... | Python | 1 |
from django.db import models
# from django.db.models.functions import Abs
class TestTableParent(models.Model):
class Meta:
db_table = 'drop_col_test_table_parent'
class TestTableMain(models.Model):
# parent = models.OneToOneField(TestTableParent, null=True, on_delete=models.CASCADE)
# main_id ... | Python | 1 |
#!/usr/bin/env python3
# For loops execute a block of code a fixed number of times.
# You can iterate over a range, string, sequence, etc.
# Iterating over a range
print("Example 1: Counting from 1 to 10")
for x in range(1, 11):
print(x)
print("\nExample 2: Counting from 10 to 1")
for x in reversed(range(1, 11)):... | Python | 1 |
self.n {
// grid[i].push(HashSet::new());
// }
// }
// for p in &self.nodes {
// grid[p.0 as usize][p.1 as usize].insert(p.2);
// }
// for p in self.forced_choices.get(&assumption).unwrap() {
// grid[p.0 as usize][p.1 as usize].... | Rust | 0 |
, {musical_key_choice[0]}'
if len(combination) < 200:
# exit the loop
break
revised_combination = revise_prompt_with_control_flow(combination)
exclude_styles_pop_genres_prompt = generate_custom_exclude_styles_prompt(exclude_pop_genres)
return revised_combination,... | Python | 1 |
futures::channel::oneshot::channel::<SettingResponseResult>();
if switchboard_lock
.write()
.request(SettingType::DoNotDisturb, request, response_tx)
.is_ok()
{
... | Rust | 0 |
}
}
impl Default for FieldOptions {
#[inline]
fn default() -> FieldOptions {
FieldOptions::new()
}
}
static DESCRIPTOR_RAW : & [u8] = b"\n\x13pecan/options.proto\x12\x05pecan\x1A google/protobuf/descriptor.proto\"+\n\x0CFieldOptions\x12\x1B\n\tbox_field\x18\x01 \x01(\x08R\x08boxField:P\n\tfield... | Rust | 0 |
from brian import *
set_global_preferences(usenewbrianhears=True)
from brian.hears import *
#x = Sound(randn(15,2), samplerate=100*Hz)
#
#print x
#print x.buffer_fetch(0, 10)
#print x.buffer_fetch(5, 15)
#print x.buffer_fetch(10, 20)
#y = Sound(0.1*randn(200,2), samplerate=100*Hz)
#
#x = x+y
#x = x.shift(500*ms)
#x =... | Python | 1 |
str = "i am studying python from GecvCollege"
str = str.capitalize()
print(str)
| Python | 1 |
}
#[derive(Debug)]
enum Instructions {
Generated(Vec<Instruction>),
Arbitrary(Vec<u8>),
}
#[derive(Clone, Copy, Debug)]
enum BlockType {
Empty,
Result(ValType),
FuncType(u32),
}
impl BlockType {
fn params_results<C>(&self, module: &ConfiguredModule<C>) -> (Vec<ValType>, Vec<ValType>)
wher... | Rust | 0 |
t = cipher.decrypt_and_verify(tv.ct, tv.tag)
except ValueError:
assert not tv.valid
else:
assert tv.valid
self.assertEqual(pt, tv.msg)
self.warn(tv)
def test_corrupt_decrypt(self, tv):
self._id = "Wycheproof Corrupt Decrypt CCM Test #" + str(t... | Python | 1 |
Property().SetColor(0,0,0)
# Create cone indicating application of load
#
coneSrc = vtkConeSource()
coneSrc.SetRadius(.5)
coneSrc.SetHeight(2)
coneMap = vtkPolyDataMapper()
coneMap.SetInputConnection(coneSrc.GetOutputPort())
coneActor = vtkActor()
coneActor.SetMapper(coneMap)
coneActor.SetPosition(0,0,11)
coneActor.Rot... | Python | 1 |
import asyncio
import sys
import colorama
from loguru import logger
from src.core.config import ConfigLoader
from src.core.logging import InterceptHandler, LogSetup
from src.services.fastapi_server import Server
class Service:
def __init__(self) -> None:
self.config = ConfigLoader()
self.interce... | Python | 1 |
ance = 0.6
leader_pose = self.turtle_poses['turtle1']
for follower in self.following_turtles:
follower_pose = self.turtle_poses.get(follower)
if not follower_pose:
continue
new_x = leader_pose.x - gap_distance * math.cos(leader_pose.theta)
... | Python | 1 |
from flask import Flask, render_template, jsonify
from conf import METEO_API_KEY, NEWS_API_KEY
from functions import extract_keywords
import json
import requests
# from flask_restful import Api, Resource, abort, reqparse
# from flask_sqlalchemy import SQLAlchemy
# set app et api
app= Flask(__name__)
# api = Api(app)
#... | Python | 1 |
let (prev, _prev) = devstat!(bintime{sec: 0, frac: 0});
let (cur, _cur) = devstat!(bintime{sec: 1, frac: 0});
let r = delta_t!(cur, Some(prev), |ds: &devstat| ds.busy_time);
assert_relative_eq!(r, 1.0);
}
#[test]
fn neg() {
let (prev,... | Rust | 0 |
dget.
pub struct State {
ids: Ids,
}
impl<X, Y, F> PlotPath<X, Y, F> {
/// Begin building a new `PlotPath` widget instance.
pub fn new(min_x: X, max_x: X, min_y: Y, max_y: Y, f: F) -> Self {
PlotPath {
common: widget::CommonBuilder::default(),
style: Style::default(),
... | Rust | 0 |
MqttCodec {
max_payload_size,
}
}
}
impl Decoder for MqttCodec {
type Item = Packet;
type Error = crate::Error;
fn decode(&mut self, buf: &mut BytesMut) -> Result<Option<Packet>, crate::Error> {
// `decode` might be called with `buf.len == 0`. We should return Ok(None)
... | Rust | 0 |
dng8xj1zcu=None, m6k5857c232: mv67d0c86sr=False, i376pp6e7zm: ve01rinh3lz=0, m3nejkombq6=0.0, vrvstoa9h44=b'', yufe3q17x0l: rwb52zf3f29='', xzromlm4cpx: epy7vfza2fg=0j, nbpfj7lqnqf=False, lbr2u33uwa3: ol6rifxqa8n=b'', fppd4um9v9q=''):
ssx76av6pff
'# bang_steamers_july -> travel_police_purchaser'
import hizq... | Python | 1 |
fs") {
Ok(refs) => refs,
Err(err) => {
writer.write_field("")?;
return Err(err.into());
}
};
let mut refs_json = Vec::new();
for ref_doc in refs.iter().filter_map(|x| x.as_document()) {
let url = match ref_doc.get_... | Rust | 0 |
import requests
import sys
import re
requests.packages.urllib3.disable_warnings()
from requests.packages.urllib3.exceptions import InsecureRequestWarning
def title():
print('+------------------------------------------')
print('+ \033[34mPOC_Des: http://wiki.peiqi.tech \033[0m... | Python | 1 |
unctuations': lambda x: self.remove_punctuation(x),
'transform to lowercase': lambda x: x.lower(),
#'replace numbers': lambda x : self.replace_numbers(word_tokenize(x)),
'remove non-ascii characters': lambda x : self.remove_non_ascii(word_tokenize(x)),
'lemmatize verbs': lambda x : self.lemmatize_verbs(x),
... | Python | 1 |
opt.x
bestCycle = ctr
ctr += 1
elapsed_time = (time.time() - start_time)/60.0
print("\nFinal objective: " + "{0:10.3f}".format(bestObj))
print("\nFinal solution: " + str(bestSoln))
print("\nBest cycle: " + str(bestCycle))
print("\nTotal time: " + "{0:3.2f}".format(elapsed_time) + " minutes")
"""
Backo... | Python | 1 |
Some(milliseconds_remaining) => process.integer(milliseconds_remaining)?,
None => false.into(),
};
let term = if options.r#async {
let read_timer_message =
process.tuple_from_slice(&[atom!("read_timer"), timer_reference, read_term])?... | Rust | 0 |
"""
`nums = [1, 2, 3, 4, 5]`
The first time you choose you can either choose 1 or 2 or 3 or 4 or 5. Lets say you choose 2. So the path so far is `[2]`.
The second time you choose you can only choose 1 or 3 or 4 or 5. Lets say you choose 3. So the path so far is `[2, 3]`.
The third time you choose you can only choose 1 ... | Python | 1 |
import numpy as np
from sklearn.metrics import f1_score
import numpy as np
from DistanceDecisionTree import DistanceDecisionTree
from sklearn.model_selection import KFold, TimeSeriesSplit, StratifiedKFold
K_FOLD = 5
def getF1(X,y,min_samples,max_depth):
'''Input: Train data, Test data, minimum number of sample... | Python | 1 |
import tensorflow.compat.v1 as tf
num_classes = 3
_author__ = "Xiangyu Gao"
__copyright__ = "Copyright 2021, The Radar Perception project"
__credits__ = ["Xiangyu Gao"]
__license__ = "MPL 2.0"
__version__ = "0.1.0"
__maintainer__ = "Xiangyu Gao"
__email__ = "xygao@uw.edu"
__status__ = "Dev"
def VGG16(x, keep_prob):... | Python | 1 |
import tkinter
from tkinter.messagebox import showinfo as alert
from tkinter.messagebox import askyesno as question
from tkinter.simpledialog import askstring as prompt
import customtkinter
'''
nombre: Agustin
apellido: Navarro
---
Ejercicio: if_06
---
Enunciado:
Al presionar el botón 'Calcular', se deberá obtener el ... | Python | 1 |
annuity.annuity_joined_users.add(request.user)
serializer = AnnuityDetailSerializer(annuity)
return Response(serializer.data)
@api_view(["POST"])
@permission_classes([IsAuthenticated])
def saving_joins(request, code):
saving = Saving.objects.get(fin_prdt_cd=code)
# 역참조
if request.user in sa... | Python | 1 |
(self._entity_embedding, e)
r_embedding = tf.nn.embedding_lookup(self._relation_embedding, r)
if use_bn:
with tf.variable_scope('input_bn'):
e_embedding = self.bn(e_embedding, is_train=False, reuse=True)
# with tf.variable_scope('input_bn_relation'):
... | Python | 1 |
# Copyright 2020 The HuggingFace Team. 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 by applicabl... | Python | 1 |
量化实现)
laplace_c = F.conv2d(dc_dx, deriv_x, padding=(0, 1)).squeeze(1) + F.conv2d(dc_dy,deriv_y,padding=(1, 0)).squeeze(1)
dc_dx = dc_dx.reshape(B, T, H, W) # 恢复原始维度
dc_dy = dc_dy.reshape(B, T, H, W)
laplace_c = laplace_c.reshape(B, T, H, W)
# 4. 最终计算 (确保所有输入维度一致)
result... | Python | 1 |
leep1=2, match_mode='fuzzy')
if not re:
re = TomatoOcrFindRangeClick('树', sleep1=2, match_mode='fuzzy', x1=91, y1=216, x2=596, y2=1071)
if not re:
swipe(342, 265, 343, 1023, dur=600)
swipe(342, 265, 343, 1023, dur=600)
... | Python | 1 |
f_val(&vertex_buffer_data[..]) as u64,
usage: vk::BufferUsageFlags::TRANSFER_SRC,
sharing_mode: vk::SharingMode::EXCLUSIVE,
..Default::default()
};
let vertex_buffer = VkBuffer::new(allocator, &vertex_buffer_info, &alloc_info_cpu);
vertex_buffer.copy_from_sli... | Rust | 0 |
cfg(feature = "dim3")]
// pub(crate) fn support_edge(cube: &Cuboid, local_dir: Vector<f32>) -> CuboidFeatureEdge {
// let he = cube.half_extents;
// let i = local_dir.iamin();
// let j = (i + 1) % 3;
// let k = (i + 2) % 3;
// let mut a = Point::origin();
// a[i] = he[i];
// a[j] = local_dir... | Rust | 0 |
for (centroid, cluster) in self.clusters() {
// let color = Self::cluster_color_average(&cluster.iter().map(|c| self.color(*c)).collect()).as_image_rgb();
let color = centroid.pixel().color().as_xyz().as_rgb().as_image_rgb();
println!("Color for cluster: {:?}", color);
... | Rust | 0 |
{}", i);
}
// Read back
sdmmc.read_blocks(0, &mut buffer).unwrap();
}
// Check the read
for byte in buffer.iter() {
assert_eq!(*byte, 0x34);
}
info!("Done!");
loop {
cortex_m::asm::nop()
}
}
mod iter_chr;
pub use iter_chr::memchr_iter;
pub use ite... | Rust | 0 |
pub struct ST7735 <SPI, DC, RST>
where
SPI: spi::Write<u8>,
DC: OutputPin,
RST: OutputPin,
{
/// SPI
#[cfg(feature = "noblock_spi")] // If non-blocking SPI is enabled...
_spi: SPI,
#[cfg(not(feature = "noblock_spi"))] // Previously with blocking SPI...
spi: SPI,
/// Data/command... | Rust | 0 |
/Journal/Timecard
Journal = sys::KEY_JOURNAL as _,
/// AL Control Panel
ControlPanel = sys::KEY_CONTROLPANEL as _,
/// AL Select Task/Application
AppSelect = sys::KEY_APPSELECT as _,
/// AL Screen Saver
Screensaver = sys::KEY_SCREENSAVER as _,
/// Listening Voice Command
Voicecommand... | Rust | 0 |
text=content,
metadata={
"source": "web_search",
"query": query,
"title": result.get("title", ""),
"url": result.get("url", ""),
"search_engine": result.get("source", "unknown")
}
... | Python | 1 |
= segments.possible_digits(&self.mappings);
// println!("Checking mappings for {:?} {}. Possible digits: {:?}", segments.segments, segments.segments.len(), possible_digits);
// if possible_digits.len() == 1 {
// let digit = possible_digits[0];
// let possible_segments = digit_to... | Rust | 0 |
from __future__ import absolute_import
import ctypes
from .._base import _LIB
from .. import ndarray as _nd
def sammax_link(in_mat, top1_group, topk_indice, out_mat, num_local_gpus, stream=None):
assert isinstance(in_mat, _nd.NDArray)
assert isinstance(top1_group, _nd.NDArray)
assert isinstance(topk_indic... | Python | 1 |
from random import choice
import requests
from bs4 import BeautifulSoup
# page_number = 1
#
# user_agents = [
# "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36",
# "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, ... | Python | 1 |
sename(file.name)
# 将字段值写入Excel表格
sheet[f"A{row_index}"] = id_value
sheet[f"B{row_index}"] = name_value
sheet[f"C{row_index}"] = severity_value
sheet[f"D{row_index}"] = filename_value
row_ind... | Python | 1 |
let reflected = reflect(unit_dir, rec.nor);
Some(ScatterRecord {
attenuation,
specular_ray: Some(Ray::new(rec.pos, reflected)),
pdf_ptr: Arc::new(NonePDF { val: 0.0 }),
})
} else {
let refracted... | Rust | 0 |
)]
#[cfg_attr(feature = "serde_support", derive(Serialize, Deserialize))]
pub struct ColFlags {
#[br(map = cbool)]
#[binwrite(preprocessor(to_c_bool))]
pub flag1: bool,
#[br(map = cbool)]
#[binwrite(preprocessor(to_c_bool))]
pub rig_col: bool,
#[br(map = cbool)]
#[binwrite(preprocessor... | Rust | 0 |
fn function_call(&mut self, calee: Expression) -> ExprResult {
let Token { pos, .. } = self.next();
let args = self.expr_list(Symbol(ClosePar))?;
self.expect(Symbol(ClosePar))?;
Call(CallData { calee: Box::new(calee), args }).to_expr(pos).wrap()
}
fn index(&mut self, head: Expression) -> ExprResult {
... | Rust | 0 |
# Python bytecode 2.7 (decompiled from Python 2.7)
# Embedded file name: scripts/common/visual_script/general.py
from block import Block, makeResEditorData, InitParam
from constants import GAME_ROOT_DIR_NAME
from slot_types import SLOT_TYPE, arrayOf
from uuid_utils import genUUID
class ResourceSelector(Block):
de... | Python | 1 |
from PyQt5.Qt import Qt
from PyQt5.QtWidgets import QWidget, QPushButton, QLabel, QHBoxLayout, QVBoxLayout, QLineEdit
menu_window = QWidget()
menu_window.resize(400, 300)
menu_window.setWindowTitle("Memory card")
menu_window.move(700, 300)
question_lbl = QLabel('Введіть запитання:')
right_ans_lbl = QLabel('Введіть пр... | Python | 1 |
[$ ($ i : expr) *] y [$ ($ j : ident) *] z [$ ($ t : tt) *]
}
)
=>
{
$ crate :: __foo_state !
(
[$ ($ _ddd) *]
{
x [$ ($ i) * $ e] y [$ ($ j) * $ d] z [$ ($ t) * e ($ d , $ e)]
}
)
}
;
}"#
);
}
}
<filename>zkp-toolkit/cli/src/circuits/mini.rs
use zkp_tool... | Rust | 0 |
self, allocation: Self::Allocation) -> Result<()> {
Ok(Allocator::free(&mut self.lock().unwrap(), allocation)?)
}
}
<gh_stars>0
#![no_std]
#[cfg(feature = "rt")]
pub use cortex_m_rt::entry;
pub use atsamd_hal as hal;
pub use embedded_hal as ehal;
pub use hal::pac;
use hal::clock::GenericClockController;
... | Rust | 0 |
of logs
if get_data::<ConfigKey>(ctx)
.await?
.discord
.log_channels
.contains(&channel_id)
{
return Ok(());
}
// don't log halloween stuff
#[allow(clippy::unreadable_literal)]
if message.author.id == 755580145078632508
|| message.content == "h!t... | Rust | 0 |
}
);
ret = Some(idx);
}
ret
}
const NEVER_MUTATE: u64 = 0;
const MIN_PRIO: u64 = 1;
const MID_PRIO: u64 = 5;
const MAX_PRIO: u64 = 10;
const TYPE_PRIOS: [fn(&Type, Dir) -> u64; 15] = [
res_prio,
const_prio,
int_prio,
flags_prio,
len_prio,
proc_prio,
csu... | Rust | 0 |
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
실제 Chrome 브라우저 사용 - 2차 인증 없음
"""
import asyncio
from playwright.async_api import async_playwright
import subprocess
import os
import time
import psutil
def kill_chrome():
"""기존 Chrome 프로세스 종료"""
for proc in psutil.process_iter(['name']):
if proc.info['... | Python | 1 |
[doc = "Bit 0 Error"]
CAN_STS_LEC_BIT0,
#[doc = "CRC Error"]
CAN_STS_LEC_CRC,
#[doc = "No Event"]
CAN_STS_LEC_NOEVENT,
}
impl CAN_STS_LECR {
#[doc = r"Value of the field as raw bits"]
#[inline(always)]
pub fn bits(&self) -> u8 {
match *self {
CAN_STS_LECR::CAN_STS_LEC... | Rust | 0 |
from main_finetune import set_seed | Python | 1 |
app.post("/api/save-logs")
def api_save_logs():
path = save_logs_to_file()
return jsonify({"ok": True, "path": path})
@app.get("/api/target")
def api_get_target():
with state_lock:
t = target_title_contains
r = refocus_each_press
match_title = None
if t:
hwnd = find_window_... | Python | 1 |
"""Support for TP-Link LTE notifications."""
from __future__ import annotations
import logging
from typing import Any
import attr
import tp_connected
from homeassistant.components.notify import ATTR_TARGET, BaseNotificationService
from homeassistant.const import CONF_RECIPIENT
from homeassistant.core import HomeAssi... | Python | 1 |
e x),
"notifications": OptionalS("notification_setting") >> F(transform_notification_setting),
"members": OptionalS("members", default=[]) >> Forall(transform_team_members),
}
)
return mapping
@classmethod
async def get_mapping_to_provider(
cl... | Python | 1 |
.BOUNDARY_PATH_OUTERMOST,
)
doc = ezdxf.new("R2010")
msp = doc.modelspace()
# The hatch style tag, group code 75, is not supported for the MPOLYGON
# entity by Autodesk products!
# This example remains as it is, maybe I find a solution for this issue in
# the future.
# first create... | Python | 1 |
# If we write out the digits of "60" as English words we get "sixzero"; the number of letters in "sixzero" is seven. The number of letters in "seven" is five. The number of letters in "five" is four. The number of letters in "four" is four: we have reached a stable equilibrium.
# Note: for integers larger than 9, writ... | Python | 1 |
def start_field(self, attrs):
if self.container_stack[-1] is None:
return
field_name = attrs.get('name', None)
if not field_name:
return
self.container_stack[-1].get_field(field_name, True).add_gen(self.gen, attrs)
def parse_args():
p = argparse.Argument... | Python | 1 |
}
impl core::ops::DerefMut for W {
#[inline(always)]
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl From<crate::W<SIGMADELTA7_SPEC>> for W {
#[inline(always)]
fn from(writer: crate::W<SIGMADELTA7_SPEC>) -> Self {
W(writer)
}
}
#[doc = "Field `GPIO_SD7_IN` rea... | Rust | 0 |
ter-cellular Correlation', fontweight = 'bold', fontsize = 14)
axs[1,1].legend(loc = 'upper left')
axs[1,1].grid(True)
axs[1,2].scatter(I2, I4, label='[1] IL-2 v.s [2] IL-4', color = plt.cm.Set2(0), s = 20)
axs[1,2].scatter(I2, I10, label='[1] IL-2 v.s [2] IL-10', color = plt.cm.Set2(1), s = 20)
axs[1,2].set_xlabel('C... | Python | 1 |
import os
import uvicorn
from fastapi import FastAPI, Request, Form, HTTPException
from fastapi.responses import HTMLResponse, FileResponse
from fastapi.staticfiles import StaticFiles
from pydantic import BaseModel
from core.data_processing import init_db
from core.searcher import MilvusSearcher
from core.vectorizer i... | Python | 1 |
one = None,
node_labels: list[str] | None = None,
concurrency: Any | None = None,
) -> EstimationResult:
"""
Estimate the memory consumption of a Harmonic Closeness Centrality algorithm run.
Parameters
----------
G : GraphV2 | dict[str, Any]
The g... | Python | 1 |
- 1;
pub const MAX_HEADER_CODE: u64 = 0xffffff;
pub const MAX_SLOT_NUM: u64 = MAX_HEADER_CODE >> 4;
//3 bytes - 4 bits, reserved for codes
pub const MAX_PAYLOAD_LEN: usize = u16::MAX as usize;
const CONNECT_TIMEOUT: Duration = Duration::from_secs(10);
enum Compressor {
Plain,
Zstd(zstd::block::Compressor),
}... | Rust | 0 |
as frame_system::Config>::Event>;
/// Minimum number of leading zero bits the hash must have to be accepted.
type MinLeftZeros: Get<u32>;
//TODO Hook to notify when work is added (for rewards for example)
//TODO Way to add additional work (in case leader election PoW is used and should be counted)
}
decl_storage... | Rust | 0 |
from .__meta__ import *
try:
from tracer.packageManagers.ipackageManager import IPackageManager
from tracer.packageManagers.alpm import Alpm
except ImportError: pass
@unittest.skipIf((DISTRO != "arch" and DISTRO != "archarm"), "Skipping tests because they are distro-specific")
class TestAlpm(unittest.TestCase):
def... | Python | 1 |
or
* rustrt should raise errors.
*/
}
#[test]
fn test_dedup_shared() {
let mut v0 = ~[@1, @1, @2, @3];
v0.dedup();
let mut v1 = ~[@1, @2, @2, @3];
v1.dedup();
let mut v2 = ~[@1, @2, @3, @3];
v2.dedup();
/*
* If the @pointers... | Rust | 0 |
import re
import requests
from bs4 import BeautifulSoup
from pyrogram import filters
from YukkiMusic import app
def get_video_title(video_id):
url = f"https://www.youtube.com/watch?v={video_id}"
response = requests.get(url)
soup = BeautifulSoup(response.text, "html.parser")
return soup.title.string
... | Python | 1 |
"""JSON Reader."""
import re
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Dict, List, Optional
from llama_index.core.readers.base import BaseReader
from llama_index.core.schema import Document
def _get_leaf_nodes_up_to_level(root: ET.Element, level: int) -> List[ET.Element]:
""... | Python | 1 |
"""
ckwg +31
Copyright 2020 by Kitware, Inc.
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 list of conditions and the ... | Python | 1 |
Cell<UserData>)
});
0
}
_ => unsafe { DefWindowProcW(window, message, wparam, lparam) },
}
}
extern "system" fn wndproc(window: HWND, message: u32, wparam: WPARAM, lparam: LPARAM) -> LRESULT {
let result = std::panic::catch_unwind(|| rusty_wndproc(window, message,... | Rust | 0 |
add(&imm.into())).into();
UserDiff::mem_write_pc_p4(
state,
byte_addr,
DataEnum::Lword(state.user_state.regfile.read(rs2).lower_lword()),
)
.map_err(TermCause::from)
}
}
/// Tests for the base 32-bit ISA.
#[cfg(test)]
mod tests_32 {
use super::*;
... | Rust | 0 |
",")+ => ActionFn(148);
let __sym0 = __pop_Variant9(__symbols);
let __start = __sym0.0.clone();
let __end = __sym0.2.clone();
let __nt = super::__action148::<>(errors, input, __sym0);
__symbols.push((__start, __Symbol::Variant9(__nt), __end));
(1, 10)
}
pub(crate... | Rust | 0 |
.create_buffer_init(&wgpu::util::BufferInitDescriptor {
label: None,
contents: bytemuck::cast_slice(&indices),
usage: wgpu::BufferUsage::INDEX,
});
let bind_group = args.shader.bind_params(
info.device,
... | Rust | 0 |
]
pub mod proctl;
#[doc = "System Control register\n\nThis register you can [`read`](crate::generic::Reg::read), [`reset`](crate::generic::Reg::reset), [`write`](crate::generic::Reg::write), [`write_with_zero`](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd... | Rust | 0 |
t.xticks(rotation=30)
plt.legend()
plt.title("SMA strategy vs Buy & Hold : {} (S0 = {})".format(ticker,alo.round(2)))
plt.show()
pctg = (comb.iloc[len(comb)-1,4]-alo)/alo * 100
bhpctg = (comb.iloc[len(comb)-1,1]-comb.iloc[0,0])/comb.iloc[0,0] * 100
text = '\n'.join((
'Trading Periods :... | Python | 1 |
ent": large_content},
)
test_session.add(large_record)
test_session.commit()
# Should handle large content gracefully
large_record.calculate_quality_scores()
assert large_record.data_quality_score > 0
def test_invalid_data_types(self):
"""Test handling of i... | Python | 1 |
,T11);
}
// =================
// === HasItemAt ===
// =================
macro_rules! gen_has_item_at {
($at:ident $p:tt) => {};
($at:ident [$($p:ident),*] $t:ident $(,$($ts:ident),*)?) => {
impl<$($p,)* X $(,$($ts),*)?> $crate::HasItemAt<$at> for ($($p,)*X,$($($ts,)*)?) {
type Item = X;
... | Rust | 0 |
nobsStep {
fn default() -> Self {
// initalize parameters
let knob_float_param = FloatParam::<KnobsID>::new(
KnobsID::Float, -1.0, 1.0, 0.0, 0.0);
let knob_int_param = IntParam::<KnobsID>::new(
KnobsID::Int, 0, 5, 0, 2);
let knob_db_param = LogDBParam::<Kno... | Rust | 0 |
# pylint: disable=redefined-outer-name
from pathlib import Path
from pytest import fixture, mark
from otazky.brain import Brain, Environment
from otazky.scenario import validate_scenario_file
from otazky.smodules.hardmap_interpreter import add_basic_hardmap_data
@fixture
def brain():
env = Environment()
bra... | Python | 1 |
ed', []),
"properties_preview": result.get('properties', [])[:5],
"errors": result.get('errors', []),
"message": f"Successfully fetched {result.get('saved_count', 0)} properties from {len(result.get('api_sources_used', []))} different sources"
}
else:
... | Python | 1 |
-".into(), s.clone(), t.clone())),
}
}
/// Operator *
pub fn mul(s: &T, t: &T) -> Result<T> {
match (&s.ty, &t.ty) {
(Ty::Uint(w1), Ty::Uint(w2)) if w1 == w2 => Ok(T::new(
term![BV_MUL; s.ir.clone(), t.ir.clone()],
t.ty.clone(),
)),
(Ty::Field, Ty::Field) => Ok(T... | Rust | 0 |
aErrorCommunicationFailure
}
}
} else {
if crate::utils::GlobalConfig::log_error_details() {
error!(
"Can not encode value {} into on of the possible TSS return values.",
e
... | Rust | 0 |
4, msk_size))
new_im_arr = np.array(new_im)
new_im_arr_list.append(new_im_arr)
new_vid_name = 'B' + format(args.batch_size, "04d") + '_S' + format(actual_step, "06d") \
+ '_' + real_names[0] + ".gif"
new_vid_file = o... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.