text string | label_name string | labels int64 |
|---|---|---|
derive(Debug, PyStructSequence)]
pub(crate) struct UnameResult {
pub sysname: String,
pub nodename: String,
pub release: String,
pub version: String,
pub machine: String,
}
#[pyimpl(with(PyStructSequence))]
impl UnameResult {}
pub(super) fn support_funcs() -... | Rust | 0 |
import numpy as np
from pyscf import gto, scf, mcscf
from dsrg.reference import Reference
from dsrg.driver import DSRG
RTOL = 1.0e-06
ATOL = 1.0e-06
def test_mrdsrg_ldsrg2_1():
mol = gto.M(
atom = '''
N 0.0000 0.0000 0.000
N 0.0000 0.0000 1.100''',
basis = '6-31g',
... | Python | 1 |
ao)]
struct TableNameSimple {
name: String,
schema: String,
}
impl TableNameSimple {
fn to_tablename(&self) -> TableName {
TableName {
name: self.name.to_string(),
schema: Some(self.schema.to_string()),
alias: None,
... | Rust | 0 |
# coding: utf-8
"""
codebeamer swagger API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
The version of the OpenAPI document: 3.0
Generated by OpenAPI Generator (https://openapi-generator.tech)
Do not edit the class manually.
""" # no... | Python | 1 |
-> B\nBN -> B\nBB -> N\nBC -> B\nCC -> N\nCN -> C").unwrap().1;
let polymer = react("NNCB", &rules, 40);
let answer = polymer.most_common_character_count() - polymer.least_common_character_count();
assert_eq!(answer, 2188189693529);
}
}
use misc::*;
use parsers::*;
use tests::test_helpers... | Rust | 0 |
pub fn gpio_qspi_sd1_level_high(&mut self) -> GPIO_QSPI_SD1_LEVEL_HIGH_W {
GPIO_QSPI_SD1_LEVEL_HIGH_W { w: self }
}
#[doc = "Bit 12"]
#[inline(always)]
pub fn gpio_qspi_sd1_level_low(&mut self) -> GPIO_QSPI_SD1_LEVEL_LOW_W {
GPIO_QSPI_SD1_LEVEL_LOW_W { w: self }
}
#[doc = "Bit 11... | Rust | 0 |
_batch.append(face_resized)
face_metadata.append({
"sample_index": save_index
})
# Process batch when it reaches the target size or we have enough samples
if len(face_batch) >= batch_size or save... | Python | 1 |
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
from __future__ import annotations
from typing import Union, Iterable
from typing_extensions import Literal, Required, TypedDict
from .text_block_param import TextBlockParam
from .image_block_param import ImageBlockParam
__all__ =... | Python | 1 |
ory) # 90% utilization
safe_concurrent = int(total_memory * 0.7 / model_memory) # 70% utilization
print(f"Theoretical max concurrent requests: {max_concurrent}")
print(f"Safe concurrent requests (70% util): {safe_concurrent}")
if max_concurrent < 1:
print("⚠️ WARNING: Not enough mem... | Python | 1 |
mat
nonstd: u32,
/// see FB_ACTIVATE_*
activate: u32,
/// height of picture in mm
height: u32,
/// width of picture in mm
width: u32,
/// (OBSOLETE) see fb_info.flags
accel_flags: u32,
/* Timing: All values in pixclocks, except pixclock (of course) */
/// pixel clock in ps... | Rust | 0 |
, 200_000],
extension_display_names: vec![],
extension_relation_order: RelationOrder{
relation_order: vec![
RcString::from("directly_positively_regulates"),
RcString::from("has_direct_input"),
RcString::from("involved_in"),
RcSt... | Rust | 0 |
lined = 0x00,
DW_INL_inlined = 0x01,
DW_INL_declared_not_inlined = 0x02,
DW_INL_declared_inlined = 0x03,
});
dw!(
/// The encodings of the constants used in the `DW_AT_ordering` attribute.
///
/// See Section 7.17, Table 7.17.
DwOrd(u8) {
DW_ORD_row_major = 0x00,
DW_ORD_col_major = 0x01,
});
dw!(
... | Rust | 0 |
| j j | _ | j d 8_ | j d t | j j | _
nK | j ss | j | j
k r | j n | j j | j | j d t d S( Ni u ]Rv ( R7 R t SequenceEndEventR R5 R R RO R R R R' R" R* RP R3 t expect_flow_sequence_itemRh R# ( R ( ... | Python | 1 |
_VECTOR_SIZE: u32 = 56;
pub const XSHAL_USER_VECTOR_ISROM: u32 = 0;
pub const XSHAL_PROGRAMEXC_VECTOR_SIZE: u32 = 56;
pub const XSHAL_USEREXC_VECTOR_SIZE: u32 = 56;
pub const XSHAL_KERNEL_VECTOR_SIZE: u32 = 56;
pub const XSHAL_KERNEL_VECTOR_ISROM: u32 = 0;
pub const XSHAL_STACKEDEXC_VECTOR_SIZE: u32 = 56;
pub const XSH... | Rust | 0 |
ng block announcements.
pub trait BlockAnnounceValidator<B: Block> {
/// Validate the announced header and its associated data.
fn validate(&mut self, header: &B::Header, data: &[u8]) -> Result<Validation, Box<dyn Error + Send>>;
}
/// Default implementation of `BlockAnnounceValidator`.
#[derive(Debug)]
pub struct D... | Rust | 0 |
ile containing the pod field
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Default, JsonSchema)]
pub struct ScaledJobJobTargetRefTemplateSpecDownwardApiItems {
#[serde(rename = "fieldRef", skip_serializing_if = "Option::is_none")]
pub field_ref: Option<crate::models::ScaledJobJobTargetRefTemplate... | Rust | 0 |
# -*- coding: utf-8 -*-
{
'!langcode!': 'ja-jp',
'!langname!': '日本語',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN',
'"User Exception" ... | Python | 1 |
import random
import time
from Pyro5.api import expose, Daemon, locate_ns
HOST_IP = "127.0.0.1" # Set accordingly (i.e. "192.168.1.99")
HOST_PORT = 9092 # Set accordingly (i.e. 9876)
@expose
class StockMarket(object):
def __init__(self, marketname, symbols):
self._name = marketname
se... | Python | 1 |
{
pub fn opposite(&self) -> Vec3 {
Vec3 {
x: self.x,
y: self.y,
z: -self.z,
}
}
}
<filename>metalmq/src/client/mod.rs
pub mod conn;
pub mod state;
use crate::{ErrorScope, Result, RuntimeError};
use metalmq_codec::codec::Frame;
use metalmq_codec::frame;
#[de... | Rust | 0 |
)
} else {
processor.read(block_id, offset, buf)
}
}
extern crate futures;
extern crate log;
extern crate nix;
extern crate regex;
extern crate reqwest;
extern crate tokio;
use super::output::Receiver;
use super::tokio_utils::make_err;
type Result = std::result::Result<bool, tokio::io::Error>;
pub as... | Rust | 0 |
}
}
struct DelayPlugin {
delay_l: Delay,
delay_r: Delay,
filter_l: Filter,
filter_r: Filter,
clipper_l: Clipper,
clipper_r: Clipper,
}
impl Plugin for DelayPlugin {
const NAME: &'static str = "a delay plugin";
const PRODUCT: &'static str = "a delay plugin";
const VENDOR: &'static ... | Rust | 0 |
Type::DescriptionOnly,
];
let pins = pinboard
.search(&queries, &fields)
.unwrap_or_else(|e| panic!(e));
assert!(pins.is_some());
// Run same query, this time with Vec<String> instead of Vec<&str>
let queries = vec!["eagle", "design", "fun"];
let ... | Rust | 0 |
ogram_max = ::std::option::Option::Some(v);
}
// optional uint32 ping_ntile_5th = 50;
pub fn get_ping_ntile_5th(&self) -> u32 {
self.ping_ntile_5th.unwrap_or(0)
}
pub fn clear_ping_ntile_5th(&mut self) {
self.ping_ntile_5th = ::std::option::Option::None;
}
pub fn has_ping... | Rust | 0 |
e,
Single,
TimeSpan,
DateTime,
UInt16,
UInt32,
UInt64,
Null,
String,
Unknown,
}
impl From<u8> for PrimitiveTypeEnumeration {
fn from(x: u8) -> Self {
if x >= PrimitiveTypeEnumeration::Unknown as u8 || x == 0 || x == 4 {
panic!("Invalid PrimitiveTypeEnumeration {:?}", x);
} else {
unsafe { transmut... | Rust | 0 |
pub(crate) obj_id: i32,
}
impl MapColorToImmutableBidderList {
pub fn get_bidder_list(&self, key: &ScColor) -> ImmutableBidderList {
let sub_id = get_object_id(self.obj_id, key.get_key_id(), TYPE_ARRAY | TYPE_AGENT_ID);
ImmutableBidderList { obj_id: sub_id }
}
}
pub struct MapColorToImmutab... | Rust | 0 |
pub struct MinimalDxilHeader {
four_cc: u32,
hash_digest: [u32; 4],
}
const DXIL_HEADER_SIZE: usize = std::mem::size_of::<MinimalDxilHeader>();
pub fn get_dxil_digest(buffer: &[u8]) -> Result<[u32; 4]> {
assert_eq!(DXIL_HEADER_SIZE, 20);
if buffer.len() < DXIL_HEADER_SIZE {
Err(Error::bug("inv... | Rust | 0 |
tick_rate: Duration::from_millis(300),
});
let mut terminal = Terminal::new(backend)?;
let mut app = App {
memory: slice_deque::SliceDeque::new(),
cpu: slice_deque::SliceDeque::new(),
processes: vec![],
system: sysinfo::System::new(),
hostname: sys_info::hostname... | Rust | 0 |
>,
cache: web::Data<CacheState>,
) -> impl Responder {
// Cache data in .json files
match write_to_file("coop", &data).await {
Ok(_) => {
let points_hm = &mut cache.points.lock().await;
let points_cache = points_hm.get_mut("points_coop").unwrap();
for (k, v) in da... | Rust | 0 |
# DO NOT EDIT! This file was auto-generated by crates/build/re_types_builder/src/codegen/python/mod.rs
# Based on "crates/store/re_types/definitions/rerun/testing/components/fuzzy.fbs".
# You can extend this class by creating a "AffixFuzzer19Ext" class in "affix_fuzzer19_ext.py".
from __future__ import annotations
f... | Python | 1 |
from typing import Optional
import pytest
from d3rlpy.algos.qlearning.td3 import TD3Config
from d3rlpy.models import (
MeanQFunctionFactory,
QFunctionFactory,
QRQFunctionFactory,
)
from d3rlpy.types import Shape
from ...models.torch.model_test import DummyEncoderFactory
from ...testing_utils import creat... | Python | 1 |
String::from("0.0.0.0:443")
}
#[derive(Deserialize, Debug)]
pub struct Tls {
#[serde(default = "default_listen")]
pub listen: String,
#[serde(default)]
pub tcp_nodelay: bool,
pub sni: String,
pub cert: String,
pub key: String,
}
fn default_redis() -> String {
String::from("127.0.0.... | Rust | 0 |
prefix"},
],
"global_operator_extra_links": [str(MockOperatorLink())],
"macros": [str(plugin_macro)],
"operator_extra_links": [str(MockOperatorLink())],
"source": None,
"name": "test_plugin_2",
... | Python | 1 |
ov_colors[:, :3] // 3 * 2
plt_plot_outfov.module_manager.scalar_lut_manager.lut.table = outfov_colors
scene = figure.scene
scene.x_minus_view()
scene.camera.position = [27.439972451975247, 30.516016824934898, 52.619995369227944]
scene.camera.focal_point = [25.59999984735623, 27.799999952316284, 1.8... | Python | 1 |
import factory
from dateutil.relativedelta import relativedelta
import pcapi.core.users.constants as users_constants
import pcapi.core.users.factories as users_factories
from pcapi.core.factories import BaseFactory
from pcapi.core.history import models
from pcapi.utils import date as date_utils
class ActionHistoryFa... | Python | 1 |
+ Expression, F> Expression
for CwiseBinExpr<SparseExpr<L>, R, F>
{
}
impl<L: Iterator + Expression, R: DenseExpr + Iterator + Expression, F> ExprSize
for CwiseBinExpr<SparseExpr<L>, R, F>
{
#[inline]
fn expr_size(&self) -> usize {
self.right.expr_size()
}
#[inline]
fn total_size_hi... | Rust | 0 |
guid: GUID_t,
pub instance_handle: InstanceHandle_t,
pub sequence_number: SequenceNumber_t,
pub data_value: Data,
}
<filename>contract-sdk/src/abi/dispatch.rs
//! Request dispatch ABI.
use crate::{
context,
contract::Contract,
error,
event::Event,
memory::HostRegion,
types::{
... | Rust | 0 |
ld, guilds)
await ctx.send(await _(ctx, "Updated guild's description!"))
@guild.command()
async def transfer(self, ctx, user: discord.Member):
"""Transfer ownership of a guild to someone else (guild owner only)"""
async with self.bot.di.rm.lock(ctx.guild.id):
ug = await ... | Python | 1 |
from igv_reports.chralias import get_alias
from igv_reports.stream import getstream
class IdeogramReader:
def __init__(self, file):
self.aliastable = {}
self.ideogram_map = {}
lastchr = None
result = ''
f = None
try:
f = getstream(file)
fo... | Python | 1 |
#!/usr/bin/env python3
import struct
from pwn import *
def prompt(tube, n):
tube.sendlineafter("> \n", str(n))
def create_file(tube, file_name, index, buf_size):
prompt(tube, 1)
tube.sendlineafter("File Name: \n", file_name)
tube.sendlineafter("Index: \n", str(index))
tube.sendlineafter("Buf Si... | Python | 1 |
#!/usr/bin/env python3
import torch
def _matmul_broadcast_shape(shape_a, shape_b, error_msg=None):
"""Compute dimension of matmul operation on shapes (supports broadcasting)"""
m, n, p = shape_a[-2], shape_a[-1], shape_b[-1]
if len(shape_b) == 1:
if n != p:
if error_msg is None:
... | Python | 1 |
# GENERATED BY KOMAND SDK - DO NOT EDIT
import komand
import json
class Component:
DESCRIPTION = "This action create new task"
class Input:
DESCRIPTION = "description"
TITLE = "title"
class Output:
ID = "id"
class CreatetaskInput(komand.Input):
schema = json.loads("""
{
"type": ... | Python | 1 |
HintsConfig = InlayHintsConfig {
type_hints: true,
parameter_hints: true,
chaining_hints: true,
reborrow_hints: ReborrowHints::Always,
closure_return_type_hints: ClosureReturnTypeHints::WithBlock,
binding_mode_hints: true,
lifetime_elision_hints: LifetimeElisionHi... | Rust | 0 |
DATA4_W { w: self }
}
#[doc = "Bit 5 - PIOn_5."]
#[inline(always)]
pub fn data5(&mut self) -> DATA5_W {
DATA5_W { w: self }
}
#[doc = "Bit 6 - PIOn_6."]
#[inline(always)]
pub fn data6(&mut self) -> DATA6_W {
DATA6_W { w: self }
}
#[doc = "Bit 7 - PIOn_7."]
... | Rust | 0 |
c3F\x04\xa1\x88\x09\x17\x84\
\xe1\xe4\x04N\x1d\x1fO\xff\xec\xa7o\xd2\xfe\xbd\x07\x83\
\x99\xe9\x9c\xb6a]k\xf6\x81\xcdM\xd6\xc6\x15f(\
\x8c\xac\x96\xc9|\xd2\x19x7\x1f #\x82\xa9Y\x9a\
\x19c\x9a\x19\x88`\xa4\xb5<=\xd0\x9f\x0a\xa6\x12#\
\xe6Tr\x1cY\xdb\x00\x94\x06p\x0b`v\xc1\x91\xa4\
\xa8\xa4f\xb6\xcc\xb9\xa8TF\x91w\xbdU!\... | Python | 1 |
msg: exec_msg_bz3.clone(),
// },
// PollExecuteMsg {
// order: 4u64,
// contract: VOTING_TOKEN.to_string(),
// msg: exec_msg_bz4.clone(),
// },
// PollExecuteMsg {
// order: 2u64,
// contract: VOTING_TOKEN.to_string(),
// ... | Rust | 0 |
_map)?;
println!("Done processing {} powers", end);
} else {
panic!("Chunk does not have a min and max");
}
}
Ok(())
}
}
// return an expected power for zero-indexed array
// index of 0 -> power of -d
// index of 1 -> power of -d + 1
// ...
/... | Rust | 0 |
import torch
from scipy.spatial import Delaunay
# Modified from https://github.com/pytorch/pytorch/issues/50339#issuecomment-1339910414
class GridInterpolator:
def __init__(self, height: int, width: int) -> None:
self.height = height
self.width = width
self.Y_grid, self.X_grid = torch.mes... | Python | 1 |
.as_mut_ptr(),
) };
}
}
} else {
unimplemented!();
}
})
})
},
build: None,
tangent: None,
adjoint: Some({
Box::new(move |_: Pass, y_: Val<_>, state: RefMut<_>, sink: &mut Sink| {
... | Rust | 0 |
poodle");
assert_eq!(*dog.extra(), 42);
let mammal = Mammal::Dog(dog);
assert_eq!(mammal.name(), "Fido");
assert_eq!(mammal.hair_type(), "curly");
}
#[test]
fn test_storage() {
let mut storage = Storage::new();
storage.insert(
0,
Dog ... | Rust | 0 |
256][google.cloud.kms.v1.ImportJob.ImportMethod.RSA_OAEP_4096_SHA1_AES_256].
///
/// This field contains the concatenation of two wrapped keys:
/// <ol>
/// <li>An ephemeral AES-256 wrapping key wrapped with the
/// [public_key][google.cloud.kms.v1.ImportJob.public_key] u... | Rust | 0 |
_pid_t, __sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn raise(__sig: ::std::os::raw::c_int) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn ssignal(__sig: ::std::os::raw::c_int, __handler: __sighandler_t) -> __sighandler_t;
}
extern "C" {
pub fn gsignal(__sig: ::std::os::raw::c... | Rust | 0 |
#[fail(display = "Unable to compile {}.\n{}\n\n{}", target, message, code)]
Compile { target: ErrorTarget, message: String, code: String },
}
#[derive(Copy, Clone, Debug, Fail)]
pub enum ErrorTarget {
#[fail(display = "shader")]
Shader,
#[fail(display = "program")]
Program,
}
// ===========... | Rust | 0 |
PD_SAR_W<'a> {
w: &'a mut W,
}
impl<'a> FORCE_XPD_SAR_W<'a> {
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub unsafe fn bits(self, value: u8) -> &'a mut W {
self.w.bits = (self.w.bits & !(0x03 << 30)) | (((value as u32) & 0x03) << 30);
self.w
}
}
#[doc = "Reader of fie... | Rust | 0 |
import json
from textblob.wordnet import NOUN
from textblob import Word
cats = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus',
'train', 'truck', 'boat', 'traffic light', 'fire hydrant',
'stop sign', 'parking meter', 'bench', 'bird', 'cat', 'dog',
'horse', 'sheep', 'cow', 'elephant'... | Python | 1 |
84;
#[inline]
pub u32, cta_thread_dimension0, set_cta_thread_dimension0: 607, 592;
#[inline]
pub u32, cta_thread_dimension1, set_cta_thread_dimension1: 623, 608;
#[inline]
pub u32, cta_thread_dimension2, set_cta_thread_dimension2: 639, 624;
#[inline]
p... | Rust | 0 |
3 => {
self.db.delete(&req.row.key).unwrap();
}
_ => unreachable!(),
}
if let Some(cb) = self.cbs.remove(&req.id) {
cb(resp);
}
}
}
pub fn run_node(mut node: Node, ch: Receiver<Msg>) {
let mut t = Instant::now();
let d... | Rust | 0 |
settings)
logging.info("Found %d URL(s) total.", len(jobs))
jobs = preprocess_job_urls(jobs, settings)
logging.info("Will process %d URL(s) after filtering and deduplication.", len(jobs))
if len(jobs) == 0:
sys.exit("No URLs to download.")
if settings.urls_only:
for job in jobs:
... | Python | 1 |
class NoContourException(Exception):
"""
Exception raised when no contour is detected in an image processing operation.
Attributes:
message (str): Explanation of the error.
"""
def __init__(self, message: str = "No contour found!") -> None:
self.message = message
super().__... | Python | 1 |
n masks together!
# This is much faster
start_idx = has_zeros[i]
end_idx = has_zeros[i + 1]
rnn_scores, hxs = self.gru(
x[start_idx:end_idx], hxs * masks[start_idx].view(1, -1, 1)
)
outputs.append(rnn_s... | Python | 1 |
Result<MockStream, Error> {
self.receiver
.recv()
.await
.ok_or(crate::error::Inner::TokioRecvError)
.map_err(Into::into)
}
}
/// Handle for synchronous mock IO listener used to connect to the listener
pub struct Handle {
sender: Sender<MockStream>,
}
i... | Rust | 0 |
E:
# For regular picture shapes
return BytesIO(shape._element.blip.blob)
except Exception:
return None
return None
def _is_picture(self, shape):
if shape.shape_type == pptx.enum.shapes.MSO_SHAPE_TYPE.PICTURE:
return True
if sha... | Python | 1 |
import_(obj, task_name: str, file: str = None):
signer = get_signer(task_name, obj)
if not file:
stdin_text = click.get_text_stream("stdin")
data = stdin_text.read()
else:
with click.open_file(file, "r", encoding="utf-8") as fp:
data = fp.read()
signer.import_(data)
... | Python | 1 |
ntln!(" {: >15} | {:?}", format!("{:?}", line), $line);
println!(" {: >15} | {:?}", format!("{:?}", next), in_next);
assert_eq!(prev.as_ref().map(|s| s.as_ref()), in_prev);
assert_eq!(row, $row);
assert_eq!(col, $col);
assert_eq!(line, $line);
... | Rust | 0 |
bits,
signed,
result_type,
uint_ty,
uniform_uint_ptr,
bindless_idx,
base_offset_var,
element_offset_literal,
sets,
mode,
),
SpirvType::... | Rust | 0 |
"""
Descriptive HTTP status codes, for code readability.
See RFC 2616 - https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
And RFC 6585 - https://tools.ietf.org/html/rfc6585
And RFC 4918 - https://tools.ietf.org/html/rfc4918
"""
def is_informational(code):
return 100 <= code <= 199
def is_success(code):
... | Python | 1 |
&[C] {
self.as_slice()
}
}
impl<'a, C: UChar> From<&'a UStr<C>> for Box<UStr<C>> {
fn from(s: &'a UStr<C>) -> Self {
let boxed: Box<[C]> = Box::from(&s.inner);
let rw = Box::into_raw(boxed) as *mut UStr<C>;
unsafe { Box::from_raw(rw) }
}
}
impl<C: UChar> From<Box<UStr<C>>>... | Rust | 0 |
import datetime
import os.path
import time
import json
from enum import Enum
from sqlalchemy import cast, func
from app.db import MainDb, DbPersist
from app.db.models import *
from app.utils import StringUtils
from app.utils.types import MediaType, RmtMode
class DbHelper:
_db = MainDb()
@DbPersist(_db)
... | Python | 1 |
use std::mem;
pub const PT_NULL:(u32, &str) = (0x00000000, "NULL");
pub const PT_LOAD:(u32, &str) = (0x00000001, "LOAD");
pub const PT_DYNAMIC:(u32, &str) = (0x00000002, "DYNAMIC");
pub const PT_INTERP:(u32, &str) = (0x00000003, "INTERP");
pub const PT_NOTE:(u32, &str) = (0x00000004, "NOTE");
pub const PT_SHLIB:(u32,... | Rust | 0 |
# a층의 b호에 살려면 자신의 아래(a-1층)의 1호부터 b호까지
# 사람들의 수의 합만큼 사람들을 데려와 살아야한다.
# 아파트는 0층부터, 각층은 1호부터
# 0층의 i호는 i명이 산다.
# k층 n호에는 몇 명이 살고 있는지 출력하라.
# 무조건 이 구조는 재귀함수이다.
# apartment[1][0] = apartment[0][0]
# apartment[1][1] = apartment[1][0] + apartment[0][1]
# apartment[1][2] = apartment[1][1] + apartment[0][2]
# apartment[1][3]... | Python | 1 |
expected_output = {
"power_supply_details":{
"PS1":{
"input_voltage_volt":"3.0000",
"input_current_amp":"0.0000",
"input_power_watt":"0.0000",
"output_voltage_volt":"0.0000",
"output_current_amp":"0.0000",
"output_power_watt":"0.0000",
"temperature... | Python | 1 |
nder()?;
thread::sleep(Duration::from_millis(delay));
Ok(())
}
pub fn rainbow(
controller: &mut Controller,
j: u8,
delay: u64,
) -> Result<(), Box<dyn std::error::Error>> {
let leds = controller.leds_mut(0);
for (i, led) in leds.iter_mut().enumerate() {
let j: usize = j.into();
... | Rust | 0 |
nto(),
),
(
b"Ether".to_vec(),
b"ETH".to_vec(),
b"Ethereum Ether".to_vec(),
18u32,
1u32,
H160::zero(),
0u128,
kusama_mainnet_keys::ALICE_SR25519.parse::<AccountId>().unwrap().into(),
),
],
// Tokens endowment
vec![
(
0u32,
40_00... | Rust | 0 |
C_ALetter), ('\u{ab28}',
'\u{ab2e}', WC_ALetter), ('\u{ab30}', '\u{ab5a}', WC_ALetter), ('\u{ab5c}', '\u{ab65}',
WC_ALetter), ('\u{ab70}', '\u{abe2}', WC_ALetter), ('\u{abe3}', '\u{abea}', WC_Extend),
('\u{abec}', '\u{abed}', WC_Extend), ('\u{abf0}', '\u{abf9}', WC_Numeric), ('\u{ac00}',
... | Rust | 0 |
ngeElementsBaseVertex\0".as_ptr())).ok_or("glDrawRangeElementsBaseVertex")?);
let glEnable_p = transmute::<nn_cv, glEnable_t>(Self::ptr_filter(f(b"glEnable\0".as_ptr())).ok_or("glEnable")?);
let glEnableVertexAttribArray_p = transmute::<nn_cv, glEnableVertexAttribArray_t>(Self::ptr_filter(f(b"glEnableVertexAttr... | Rust | 0 |
# Найти штрих-коды и QR-коды на изображении
barcodes = pyzbar.decode(gray_image)
# Перебрать обнаруженные штрих-коды
for barcode in barcodes:
logger.info(
"Цикл для переборки обнаруженных штрих-кодов в extract_barcode_image"
"изображения по ... | Python | 1 |
# You are given an array ‘A’ of length ‘N’ consisting only of positive integers and an integer ‘K’.
# You have to update every element of the array by increasing or decreasing its value by ‘K’ only once.
# Your task is to minimize the difference between maximum and minimum elements of the array
# after performing the... | Python | 1 |
(field=0,bytes=[98]))]\"",
true,
);
}
#[test]
pub fn test_query_parser_hyphen() {
test_parse_query_to_logical_ast_helper(
"title:www-form-encoded",
"\"[(0, Term(field=0,bytes=[119, 119, 119])), (1, Term(field=0,bytes=[102, 111, 114, 109])), (2, Term(field... | Rust | 0 |
path = self.upload(path_exec, "exec.so")
return self._rpc.get_function("tvm.hexagon.load_module")(str(path))
def _aot_executor_from_factory(
self,
module: Union[str, pathlib.Path, AOTExecutorFactoryModule],
):
"""Create a local GraphModule which consumes a remote libmod.... | Python | 1 |
is_empty() {
self.generate_filter();
}
let mut result = self.filters;
let offsets_offset = result.len();
let mut ix = result.len();
result.resize(ix + 4 * self.filter_offsets.len() + 5, 0);
// Put filter offsets at the end
for offset in self.filter_o... | Rust | 0 |
导演
if episode_info.get("director"):
director_el = ET.SubElement(root, "director", tmdbid=str(episode_info.get("director_tmdbid", "")))
director_el.text = episode_info["director"]
ET.SubElement(root, "rating").text = str(episode_info.get("rating", 0))
ET.SubElement(root, "year").text = str(e... | Python | 1 |
n the Google Cloud Console.
#[serde(rename="displayName")]
pub display_name: Option<String>,
/// True if the billing account is open, and will therefore be charged for any
/// usage on associated projects. False if the billing account is closed, and
/// therefore projects associated with it will be ... | Rust | 0 |
]
pub const CREDENTIAL_SUB_TYPE_PGP_CERT: u32 = 5u32;
#[doc = "*Required features: `\"Win32_NetworkManagement_QoS\"`*"]
pub const CREDENTIAL_SUB_TYPE_UNICODE_ID: u32 = 2u32;
#[doc = "*Required features: `\"Win32_NetworkManagement_QoS\"`*"]
pub const CREDENTIAL_SUB_TYPE_X509_V3_CERT: u32 = 4u32;
#[doc = "*Required featu... | Rust | 0 |
::GLenum = 0x86A2;
#[allow(dead_code, non_upper_case_globals)] pub const NUM_EXTENSIONS: types::GLenum = 0x821D;
#[allow(dead_code, non_upper_case_globals)] pub const NUM_PROGRAM_BINARY_FORMATS: types::GLenum = 0x87FE;
#[allow(dead_code, non_upper_case_globals)] pub const NUM_SAMPLE_COUNTS: types::GLenum = 0x9380;
#[al... | Rust | 0 |
}}
ENUM!{enum WBEM_REFRESHER_FLAGS {
WBEM_FLAG_REFRESH_AUTO_RECONNECT = 0,
WBEM_FLAG_REFRESH_NO_AUTO_RECONNECT = 1,
}}
ENUM!{enum WBEM_SHUTDOWN_FLAGS {
WBEM_SHUTDOWN_UNLOAD_COMPONENT = 1,
WBEM_SHUTDOWN_WMI = 2,
WBEM_SHUTDOWN_OS = 3,
}}
pub type CIMTYPE = c_long;
ENUM!{enum WBEMSTATUS_FORMAT {
WB... | Rust | 0 |
{ listener })
}
fn process(&self) {
match self.listener.accept() {
Ok((mut socket, _addr)) => {
socket.write_all(b"INFO {\"server_id\":\"asbLGfs3r7pgZwucUxYnPn\",\"version\":\"1.4.1\",\"proto\":1,\"git_commit\":\"3<PASSWORD>\",\"go\":\"go1.11.5\",\"host\... | Rust | 0 |
estLoader = DataLoader(test_dataset, batch_size=64, shuffle=False, drop_last=True)
adj_A_init = self.initalize_A(node_num)
adj_A_t = self._one_minus_A_t((torch.tensor(adj_A_init)))
# # print(len(trainLoader))
return result_embed, trainLoader, testLoader, a... | Python | 1 |
ssible values of the field `PLUG_CONTACT`"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum PLUG_CONTACTR {
#[doc = "No USB cable attachment has been detected"]
_0,
#[doc = "A USB cable attachment between the device and host has been detected"]
_1,
}
impl PLUG_CONTACTR {
#[doc = r" Returns `true` ... | Rust | 0 |
from functools import wraps
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from Py4GWCoreLib.botting_src.helpers import BottingHelpers
from .decorators import _yield_step, _fsm_step
from typing import Any, Generator, TYPE_CHECKING
from ...enums_src.Model_enums import ModelID
#region RESTOCK
class _Resto... | Python | 1 |
ec(
element_name=self.element_name,
entity_links=(entity_prefix,) + self.entity_links,
metric_subquery_entity_links=self.metric_subquery_entity_links,
)
@override
def with_alias(self, alias: Optional[str]) -> GroupByMetricSpec: # noqa: D102
return GroupByMet... | Python | 1 |
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'PandoraInstaller.ui'
#
# Created: Thu Oct 18 00:46:07 2018
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_dlg_installer(object):
... | Python | 1 |
trics["{}_{}_auc".format(clsname, evalname)]
for clsname in clsnames
]
mean_auc = np.mean(np.array(evalvalues))
ret_metrics["{}_{}_auc".format("mean", evalname)] = mean_auc
return ret_metrics
def log_metrics(ret_metrics, config):
logger = logging.getLogger("global_logger")... | Python | 1 |
be provided, and will be
/// that of the latest day available for the supplied Metric; thus, the
/// outermost Vector will only contain one element.
///
/// ## Errors
///
/// This function may return an Error enum variant if the reqwest library
/// or the API returned an error.
///... | Rust | 0 |
();
let char: Int = F::characteristic();
assert_eq!(
f_deg_ext.clone() % Int::from(deg_ext),
Int::zero(),
"finite field GF({}^{}) is not a subfield of GF({}^{})",
char,
deg_ext,
char,
f_deg_ext,
);
}
/// Test if `alpha` generates a normal basis of `F`... | Rust | 0 |
uery_prompt, "response": response},
"gpt_eval_avg_score": {
"score": score,
},
"gpt_eval_score2_rate": {
"score": score,
},
}
def d170_cn_aggregate_info(results, args):
path = generate_submission_file("dc170_cn_eval_info.json", args)
with open(path, ... | Python | 1 |
_get_dict_len(val), 1);
/// let mut result = std::ptr::null();
/// assert_eq!(haystack_value_get_dict_entry(val, key.as_ptr(), &mut result), ResultType::TRUE);
/// assert_eq!(&*result, entry);
/// # }
/// ```
/// # Safety
/// Panics on invalid input data
#[no_mangle]
pub unsafe extern "C" fn haystack_value_get_dict_ent... | Rust | 0 |
ext(executor=executor)
ctx.run_udf(udf=CheckEnvUDF(), dataset=hdf5_ds_1)
def test_connected_cluster_cannot_snooze(local_cluster_url):
"""
Normally if we go via .connect there is no way to
setup a snooze_manager, and directly calling _scale_up
and _scale_down is unsupported, but check anyway
... | Python | 1 |
fference metric.
def compute_weighted_absolute_difference(label_signal, output_signal, sampling_frequency):
label_signal = np.asarray(label_signal)
output_signal = np.asarray(output_signal)
assert(label_signal.ndim == output_signal.ndim == 1)
assert(np.size(label_signal) == np.size(output_signal))
... | Python | 1 |
from typing import List, Optional, Type
from langchain_core.callbacks import CallbackManagerForToolRun
from pydantic import BaseModel, Field
from langchain_community.tools.office365.base import O365BaseTool
class CreateDraftMessageSchema(BaseModel):
"""Input for SendMessageTool."""
body: str = Field(
... | Python | 1 |
# Step 1: Import libraries
import pandas as pd
import matplotlib.pyplot as plt
# Step 2: Load the CSV file
df = pd.read_csv("sales.csv")
# Step 3: Display first 5 rows
print("Sample Data:")
print(df.head())
# Step 4: Basic info
print("\nDataset Info:")
print(df.info())
print("\nSummary Statistics:")
print(df.descri... | Python | 1 |
#[inline(always)]
pub fn p7sel0_2(&self) -> P7SEL0_2_R {
P7SEL0_2_R::new(((self.bits >> 2) & 0x01) != 0)
}
#[doc = "Bit 3 - P7SEL0_3"]
#[inline(always)]
pub fn p7sel0_3(&self) -> P7SEL0_3_R {
P7SEL0_3_R::new(((self.bits >> 3) & 0x01) != 0)
}
#[doc = "Bit 4 - P7SEL0_4"]
... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.