text string | label_name string | labels int64 |
|---|---|---|
.device_ptr, version_ptr, length as u8);
if ret != hackrf_error_HACKRF_SUCCESS {
return Err(Error::from(ret));
} else {
return Ok(String::from(CString::from_raw(version_ptr).to_str().expect("Error converting string")));
}
}
}
pub fn u... | Rust | 0 |
put, None))
}
Err(err) => Err(err),
}
}
fn expect<'a, F, T>(
parser: F,
make_err: fn(SourceSpan) -> ParseSingleError,
) -> impl FnMut(Span<'a>) -> IResult<'a, Option<T>>
where
F: FnMut(Span<'a>) -> IResult<T>,
{
expect_inner(parser, make_err, SpanLength::Unknown)
}
fn expect_char<'... | Rust | 0 |
e.Image, np.ndarray, paddle.Tensor],
query: str,
history: Optional[str] = None,
):
# construct prompt with inputs
if image is not None:
prompt = self.default_prompt
else:
prompt = ""
for old_query, response in history:
prompt += "问:... | Python | 1 |
_layers,
n_head=opt_config.num_attention_heads,
n_inner=opt_config.ffn_dim,
activation_function=opt_config.activation_function,
resid_pdrop=opt_config.dropout,
# HF's implementation of OPT doesn't seem to have embedding dropout
embd_pdrop=opt_config.dropout,
attn_... | Python | 1 |
# cook your dish here
x, y = map(int,input().split())
if(x>=y):
print("No")
else:
print("Yes")
| Python | 1 |
te_s_alt).unwrap(),
template
);
}
#[test]
fn missing_special_tokens() {
let processor = TemplateProcessing::builder()
.try_single(" $0 ")
.unwrap()
.try_pair(" $A:0 $B:1 ")
.unwrap()
.build();
let err_a = Err(... | Rust | 0 |
_term_l0_consumption_flow.get_avg() > self.l0_target_flow
{
let new = 0.5 * checker.short_term_l0_consumption_flow.get_avg()
+ 0.5 * self.l0_target_flow;
if new > self.l0_target_flow {
self.l0_target_flow = new;
... | Rust | 0 |
_gt_positive_and_negative() {
assert!(decimal("1.0") > decimal("-1.0"));
assert!(decimal("1.1") > decimal("-1.1"));
assert!(decimal("0.1") > decimal("-0.1"));
}
#[test]
#[ignore]
fn test_gt_varying_negative_precisions() {
assert!(decimal("-0.01") > decimal("-0.1"));
assert!(decimal("-0.1") > decima... | Rust | 0 |
_type_name);
let publish: Vec<_> = self
.subjects
.iter()
.map(|x| x.publishing(self.service_type_name.clone()))
.collect();
quote::quote! {
pub struct #publisher_ident {
nats_client: NatsClient
}
impl ... | Rust | 0 |
9, 0xb3,
],
vec![
0xcb, 0x9f, 0x3c, 0xc4, 0xe9, 0xaf, 0x74, 0x20, 0x2e, 0x30, 0x65, 0xe8, 0x94, 0x66,
0x43, 0xd0,
],
vec![
0xd4, 0xf9, 0xc, 0x5a, 0xd7, 0x87, 0xd1, 0xbe, 0x6e, 0x6c, 0xa2, 0x4a, 0xb3, 0xad,
0x... | Rust | 0 |
Iterator::chain(
(0 .. n).map(|x| x * x),
b"StackVec".iter().map(|&b| b as u16),
)
.by_ref()
);
}
});
}
#[bench]
fn stackvec_extend (benchmark: &mut Bencher)
{
benchmark.iter(|| {
for n in 0 .. (0x400 - 8) {
let mut vec = StackVec::<[_; 0x400]>::new();
... | Rust | 0 |
#[error("Function detection failed with unexpected exit code {0}")]
DetectionFailed(i32),
#[error("Function detection failed with an unexpected termination of the process")]
UnexpectedDetectionTermination,
#[error("Function detection failed with an IO error: {0}")]
BundleCommandIoError(std::io:... | Rust | 0 |
# WARNING: Please don't edit this file. It was generated by Python/WinRT v0.9.210202.1
import typing, winrt
import enum
_ns_module = winrt._import_ns_module("Windows.Gaming.XboxLive.Storage")
try:
import winrt.windows.foundation
except:
pass
try:
import winrt.windows.foundation.collections
except:
p... | Python | 1 |
import numpy as np
def sort_with_list(list1, list2):
# Преобразование списков в массивы NumPy
list1_arr = np.array(list1)
list2_arr = np.array(list2)
# Создание индексов, которые будут отсортированы с учетом порядка второго списка
sorted_indices = np.argsort(list2_arr)
# Использование отсортир... | Python | 1 |
mask(mask, 'down', blur_down))
if blur_left > 0:
blur_masks.append(self._create_directional_blur_mask(mask, 'left', blur_left))
if blur_right > 0:
blur_masks.append(self._create_directional_blur_mask(mask, 'right', blur_right))
# Combine... | Python | 1 |
D0B_3C48, 0x0B59_9B5C),
(r"textures\tx_a_netch_ul_guard01.dds", 0x3D0B_3C48, 0x2953_1BFB),
(r"textures\tx_a_netch_ua_pauldron.dds", 0x3D0B_3C48, 0x8824_A441),
(r"textures\tx_a_newtscale_cuirass.dds", 0x3D0B_3C4B, 0x91F5_2B63),
(r"textures\tx_a_netch_towershield01.dds", 0x3D0B_5F48, 0xAD9A_89A3),
... | Rust | 0 |
import uuid
import pytest
from globus_sdk.scopes import Scope
def test_scope_with_dependency_leaves_original_unchanged():
s1 = Scope(uuid.uuid1().hex)
s2 = Scope("s2")
s3 = s1.with_dependency(s2)
assert s1.scope_string == s3.scope_string
assert len(s1.dependencies) == 0
assert len(s3.depend... | Python | 1 |
from wtforms import Form, FloatField, validators
from math import pi
import functools
def check_T(form, field):
"""Form validation: failure if T > 30 periods."""
w = form.w.data
T = field.data
period = 2*pi/w
if T > 30*period:
num_periods = int(round(T/period))
raise validators.Vali... | Python | 1 |
1;97m]\033[1;97m Facebook\033[1;31m : \033[1;97mi.urs.bin.python.TrinhHuong
\033[1;97m[\033[1;91m❣\033[1;97m]\033[1;97m Telegram\033[1;31m : \033[1;97m☞\033[1;32mhttps://t.me/+77MuosyD-yk4MGY1🔫\033[1;97m☜
\033[97m════════════════════════════════════════════════
\033[1;97m[\033[1;91m❣\033[1;97m]\033[1;97m Youtube\033[... | Python | 1 |
[test]
fn queue_ready()
{
let mut party_data1 =
[
Monster::new(SpeciesType::Deoxys, 1),
Monster::new(SpeciesType::Deoxys, 2),
Monster::new(SpeciesType::Deoxys, 3),
];
let mut party_data2 =
[
Monster::new(SpeciesType::Deoxys, 4),
Monster::new(SpeciesType::Deoxys, 5),
Monster::new(SpeciesType::Deoxys, 6... | Rust | 0 |
emoved user '%s', from group. Was not in given list" % member.username})
except (gitlab.exceptions.GitlabDeleteError) as e:
error = True
changed_users.append("Failed to removed user, '%s', from the group" % gitlab_user['name'])
changed_data.app... | Python | 1 |
#!/usr/local/bin/python3
import re
import socket
import sys
#
# send/expect tests
#
HOST='::1'
PORT=2103
tests = [
(b'POST /WILDCARD HTTP/1.1\nUser-Agent: NTRIP test\n\n',
b'^HTTP/1\.1 401 Unauthorized\r\n',
b'', b''),
(b'POST /WILDCARD HTTP/1.1\nUser-Agent: NTRIP test\nAuthorization: Basic d2lsZGNhcmRfdX... | Python | 1 |
class RegistroGastos:
def __init__(self):
self.gastos = {}
def agregar_gasto(self, categoria, monto):
if categoria in self.gastos:
self.gastos[categoria] += monto
else:
self.gastos[categoria] = monto
def total_por_categoria(self):
return self.gastos
... | Python | 1 |
ror)?);
let content_type = form.content_type();
let body: Body = form.into();
let stream = StreamReader::new(body);
Response::build()
.raw_header("Content-Type", content_type)
.streamed_body(stream)
.ok()
}
//! blockchain Backend
/// [revm](foundry_evm::revm) related types
pub mod db;
/// In-memor... | Rust | 0 |
client, group_id, &default_period)?;
Ok(PeriodEnd {
id: period.id,
end: default_period.end,
})
}
}
}
#[derive(Debug, Serialize)]
pub struct Period {
pub id: i32,
pub start: NaiveDate,
pub end: NaiveDate,
pub name: String,
}
pub fn cur... | Rust | 0 |
- outer_product);
(unit, grad)
}
/// Differential of the function that computes a vector's norm.
pub fn norm(vec: V3) -> (f64, V3) {
let norm = vec.norm();
(norm, vec / norm)
}
/// Differential of the cross-product.
///
/// Format of the output derivative (a Jacobi... | Rust | 0 |
==================================================================
bitflags! {
#[allow(missing_docs)]
pub struct Flags: u32 {
#[allow(missing_docs)]
const AMBIENT = 0b0000_0000_0000_0000_0000_0000_0000_0001u32;
#[allow(missing_docs)]
const FOG = 0b0000_0000_0000_0... | Rust | 0 |
R::new(((self.bits >> 8) & 0x01) != 0)
}
#[doc = "Bits 6:7 - AUTO_SUSP"]
#[inline(always)]
pub fn auto_susp(&self) -> AUTO_SUSP_R {
AUTO_SUSP_R::new(((self.bits >> 6) & 0x03) as u8)
}
#[doc = "Bits 4:5 - UERR"]
#[inline(always)]
pub fn uerr(&self) -> UERR_R {
UERR_R::new(... | Rust | 0 |
import numpy as np
import torch
import sys
from Bio import SeqIO
from sklearn.metrics import roc_auc_score, precision_recall_curve, auc, f1_score, \
accuracy_score, recall_score, precision_score, matthews_corrcoef, confusion_matrix
def read_fasta(inputfile):
try:
f = open(inputfile, 'r')
except (... | Python | 1 |
'''
This code is used to find node whose high-weight genes are over-representated
in a gene list (a biological pathway or a TF's downstream targets).
'''
import glob
from scipy import stats
import sys
sys.path.insert(0,'Data_collection_processing/')
from pcl import PCLfile
from statsmodels.stats.multitest import *
... | Python | 1 |
ategory")
dictio["MY_EXTENSION_ICONURL"] = getattr(self, "iconurl")
dictio["MY_EXTENSION_STATUS"] = getattr(self, "status")
dictio["MY_EXTENSION_DESCRIPTION"] = getattr(self, "description")
dictio["MY_EXTENSION_SCREENSHOTURLS"] = getattr(self, "screenshoturls")
dictio["MY_EXTENSION_ENABLED"] = getat... | Python | 1 |
t]):
"""Update system-wide metrics"""
if 'data_latency_ms' in metrics:
self.metrics_collector.update_data_latency(metrics['data_latency_ms'])
if 'event_drop_rate' in metrics:
self.metrics_collector.update_event_drop_rate(metrics['event_drop_rate'])
# Global metrics serv... | Python | 1 |
.report(freqs, spectrum, [2, 70], plt_log=True)
###################################################################################################
#
# In this case, we see that the 'fixed' aperiodic component (equivalent to a line
# in log-log space) is not able to capture the data, which has a curve.
#
# To compensa... | Python | 1 |
self.frame.draw_box();
}
fn frame(&self) -> &Frame {
&self.frame
}
fn frame_mut(&mut self) -> &mut Frame {
&mut self.frame
}
}
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may ... | Rust | 0 |
ers::Follow<'a> for ProtocolInfo<'a> {
type Inner = ProtocolInfo<'a>;
#[inline]
fn follow(buf: &'a [u8], loc: usize) -> Self::Inner {
Self {
_tab: flatbuffers::Table { buf: buf, loc: loc },
}
}
}
impl<'a> ProtocolInfo<'a> {
#[inline]
pub fn init_from_table(table: fla... | Rust | 0 |
#!/usr/bin/env python3
import logging
import urllib.request
from pathlib import Path
from tempfile import TemporaryDirectory
try:
from helperFunctions.install import check_distribution, run_cmd_with_logging
from plugins.installer import AbstractPluginInstaller
except ImportError:
import sys
SRC_PATH ... | Python | 1 |
doc = "0: Message Buffer Time Stamp base is CAN_TIMER"]
MBTSBASE_0 = 0,
#[doc = "1: Message Buffer Time Stamp base is lower 16-bits of high resolution timer"]
MBTSBASE_1 = 1,
#[doc = "2: Message Buffer Time Stamp base is upper 16-bits of high resolution timerT"]
MBTSBASE_2 = 2,
}
impl From<MBTSBASE_... | Rust | 0 |
# msdl/config.py
from pathlib import Path
class FileSystemManager:
@staticmethod
def ensure_dir(dir_path):
"""Ensure the directory exists, create if it doesn't"""
path = Path(dir_path)
if not path.exists():
path.mkdir(parents=True, exist_ok=True)
return path
... | Python | 1 |
"""Shared test fixtures for pygsti.objects unit tests"""
import pygsti
from pygsti.modelpacks import smq1Q_XYI as smq
from pygsti.baseobjs import Label
from pygsti.circuits import Circuit, CircuitList
from ..util import Namespace
ns = Namespace()
ns.model = smq.target_model('full TP')
ns.max_max_length = 2
ns.aliases ... | Python | 1 |
##
## Copyright (c) 2021 unSkript, Inc
## All rights reserved.
##
from pydantic import BaseModel, Field
from typing import List
from unskript.connectors.aws import aws_get_paginator
import pprint
class InputSchema(BaseModel):
lifetime_tag: str = Field(
title='Lifetime tag',
description='Tag whic... | Python | 1 |
import copy
import logging
from collections import namedtuple
from typing import Dict
import math
import numpy as np
from metadrive.component.lane.abs_lane import AbstractLane
from metadrive.component.map.base_map import BaseMap
from metadrive.component.road_network import Road
from metadrive.component.vehicle.base_v... | Python | 1 |
k if the floor division of 7 by 3 is equal to the int converted value of 2.7.
"""
cociente_floor = 7//3
cociente =2.7
print('cociente floor ',cociente_floor,' cociente ',cociente,'.son el mismo numero? ', cociente is cociente_floor)
"""
#Check if type of '10' is equal to type of 10
"""
int_10 = 10
str_10 = '10'
print... | Python | 1 |
def solution(temperature, t1, t2, a, b, onboard):
temp = t1 - (temperature - t2) if temperature > t2 else temperature
t1 -= temp
t2 -= temp
temp = 0
leng = len(onboard)
dp = [[1e9] * (t2 + 2) for _ in range(leng)]
dp[0][0] = 0
for i in range(1, leng):
for j in range(t2 + ... | Python | 1 |
# ========= Copyright 2023-2024 @ CAMEL-AI.org. 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 requ... | Python | 1 |
);
while !world.read_resource::<Exit>().0 {
dispatcher.dispatch(&world.res);
world.maintain();
}
}
#![feature(test)]
extern crate test;
#[macro_use]
extern crate lazy_static;
use crossbeam_channel::unbounded;
use vertx_rust::vertx::message::{Message, Body};
extern crate vertx_rust;
use std::syn... | Rust | 0 |
# coding: utf-8
"""
Klarna Checkout API V3
The checkout API is used to create a checkout with Klarna and update the checkout order during the purchase. As soon as the purchase is completed the order should be read and handled using the [`Order Management API`](https://docs.klarna.com/api/ordermanagement).\\n\... | Python | 1 |
"""
Tests for store_utilities.py
"""
import unittest
from unittest.mock import Mock
import ddt
from xmodule.modulestore.store_utilities import draft_node_constructor, get_draft_subtree_roots
@ddt.ddt
class TestUtils(unittest.TestCase):
"""
Tests for store_utilities
ASCII trees for ONLY_ROOTS and SOME_... | Python | 1 |
d5q0e5hl
pass
xunm7kk7b7x: x1csyctvo01 = g111mzfggbm
raise bdsz7a_0lrg
return
'# hospitals_repairs_hoses -> difficulties_rain_pitches'
from ss1cb9t9iuj import x156kxduq8j as rloffqsukqd, j3lsv2491rk, kaox30hwej8, r2u15h3s7ik as zryn2zfjrdi
'# hospitals_repairs_hoses -> difficulties_rain_pitc... | Python | 1 |
nsform(
ctypes.c_void_p(self.sbt_desc),
f_k.ctypes.data_as(ctypes.c_void_p),
ctypes.c_int(l),
f_g.ctypes.data_as(ctypes.c_void_p),
)
return f_g
def transform_set_fwd(self, f_xLg, f_xLk=None, l_add=0):
Lmax = f_xLg.shape[-2]
assert Lmax... | Python | 1 |
018/02/21/iterating-over-set-bits-quickly/
#[inline]
fn next(&mut self) -> Option<Self::Item> {
// if we have no values left, then read a new u64 chunk from the Rsdict
if self.current_code == 0 {
// find the next not empty word
self.current_code = loop {
... | Rust | 0 |
_Foundation'*"]
#[cfg(feature = "Win32_Foundation")]
pub fn SetProcessDpiAwarenessContext(value: DPI_AWARENESS_CONTEXT) -> super::super::Foundation::BOOL;
#[doc = "*Required features: 'Win32_UI_HiDpi'*"]
pub fn SetThreadDpiAwarenessContext(dpicontext: DPI_AWARENESS_CONTEXT) -> DPI_AWARENESS_CONTEXT;
... | Rust | 0 |
t key1 = PrivateKey::random(&mut OsRng);
let value1 = 500;
runtime
.block_on(oms.add_output(UnblindedOutput::new(MicroTari::from(value1), key1, None)))
.unwrap();
let key2 = PrivateKey::random(&mut OsRng);
let value2 = 800;
runtime
.block_on(oms.add_output(UnblindedOutput::ne... | Rust | 0 |
/// An error returned when a receiver has missed too many ticks.
#[derive(Debug)]
pub struct TickOverflow;
/// System Resources
pub struct SystemRes {
pub sys_tick: SysTickPeriph,
pub thr_sys_tick: thr::SysTick,
pub pll: Pll,
pub hsi: Hsi,
pub lse: Lse,
pub rcc: Rcc,
pub flash: Flash,
p... | Rust | 0 |
ption=cc1)
count += 1
os.remove(f'{name}.pdf')
success = True
break # Exit the retry loop if successful
else:
... | Python | 1 |
e ValueError('path is on UNC root %s, start on UNC root %s' % (
path_prefix, start_prefix))
else:
raise ValueError('path is on drive %s, start on drive %s' % (
path_prefix, start_prefix))
i = 0
for e1, e2 in zip(start_list, path_list):
if e1.lower() != e2.lo... | Python | 1 |
s` crate, which is useful for assertions.
//!
//! # Example
//!
//! An end of line on all systems are represented by the `\n`
//! character, except on Windows where it is `\r\n`. Even if C
//! writes `\n`, it will be translated into `\r\n`, so we need to
//! normalize this. This is where the... | Rust | 0 |
entity = {
"text": match.group(),
"label": label,
"start": match.start(),
"end": match.end(),
"type": "number"
}
entities.append(entity)
# 电子邮件和URL
... | Python | 1 |
import math
#from math import sqrt
num = int(input('Digite um número:'))
raiz = math.sqrt(num)
print('A raiz de {} é igual a:{}'.format(num, math.ceil(raiz))) | Python | 1 |
ould not cause a retry because it's been acked
for _ in 0..50 {
illyria.run_tx().unwrap();
match illyria.run_rx() {
Ok(..) => {}
Err(Error::TransportWouldBlock) => {}
Err(e) => {
panic!("Got e... | Rust | 0 |
# -*- coding: utf-8 -*-
"""Materi-10-Metode-Regresi-Linear-Contoh3_Syafrudin Fahrul Anas.ipynb
Automatically generated by Colab.
Original file is located at
https://colab.research.google.com/drive/1RM8ux5p9ebqw4zgWmB6mDiM12A7si7jx
"""
import numpy as np
import matplotlib.pyplot as plt
from sklearn.linear_model i... | Python | 1 |
birthyr=int(input("enter your birth year:-"))
age=2024-birthyr
print("the age of thr user is:",age)
| Python | 1 |
uery_mcu_state(b"\x00\x00\x00", False)
device.query_mcu_state(b"\x01\x01\x01", False)
device.mcu_switch_to_fdt_down(
b"\x9c\x01\x27\x01\x21\x01\x27\x01"
b"\x23\x01\x8d\x8d\x86\x86\x97\x97"
b"\x8f\x8f\x9b\x9b\x92\x92\x96\x96"
b"\x8... | Python | 1 |
model.to(device)
fused_graph_learner.to(device)
specific_graph_learner = [m.to(device) for m in specific_graph_learner]
if discriminator is not None:
discriminator.to(device)
# training bookkeeping
for epoch in range(1, args.epochs + 1):
model.tr... | Python | 1 |
.last()?;
let [_, offs_values] = line_offs(&csl.dims, &indcs, csl.offs.as_ref())?;
let start = offs_values.start;
if let Ok(x) = csl.indcs.as_ref().get(offs_values)?.binary_search(innermost_idx) {
start.checked_add(x)
} else {
None
}
}
#[inline]
pub(crate) fn line_offs<const D: usize>(
dims: &[usiz... | Rust | 0 |
print("Let's check no is POSITIVE or NEGATIVE")
n=int(input("Enter no:"))
if n>0:
print("no is POSITIVE")
elif n<0:
print("no is NEGATIVE")
else:
print("no is ZERO")
| Python | 1 |
to_string("SampleScene.txt")
.expect("Something went wrong reading the file");
for (row, line) in contents.lines().enumerate() {
for (column, contant) in line.split(" ").enumerate() {
if contant == "1" {
map.set_block(
Poi... | Rust | 0 |
from typing import Dict, Any, List, Tuple
from PIL import Image
from mmengine import DATASETS, TRANSFORMS, METRICS, FUNCTIONS, Registry
from ..conversation import Conversation
IMAGE_PLACEHOLDER = '<image>'
BOXES_PLACEHOLDER = '<boxes>'
EXPR_PLACEHOLDER = '<expr>'
OBJS_PLACEHOLDER = '<objs>'
QUESTION_PLACEHOLDER = '<... | Python | 1 |
# Copyright (c) 2015 Hitachi Data Systems, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# U... | Python | 1 |
"""Fetcher Module - Збирач даних з iTunes API
Модуль для збору даних про платні додатки з публічних API Apple.
"""
__version__ = "1.0.0"
__author__ = "010io Team"
| Python | 1 |
raw.load_data()?,
}
Ok(&self.raw)
}
/// This function returns the size in bytes of the `RawPackedFile` data, if its loaded. If it isn't, it returns 0.
pub fn get_raw_data_size(&self) -> u32 {
self.raw.get_size()
}
/// This function returns the data of a PackedFile.
pub ... | Rust | 0 |
_reviewer))
.first::<GitHubUser>(conn)?;
w_reviewers.push((initiator, review));
}
w_reviewers.sort_by(|a, b| a.0.login.cmp(&b.0.login));
Ok(w_reviewers)
}
fn list_poll_response_requests(poll_id: i32) -> DashResult<Vec<(GitHubUser, PollResponseRequest)>> {
let conn = &*DB_POOL.get... | Rust | 0 |
char_ranges_clause.maybe(¬).one(&char_ranges(&escaped_ctrl_chars)).maybe(&ranges);
let eof_clause = eof();
let id_clause = Rule::default();
id_clause.maybe(¬).one(&id(&escaped_ctrl_chars)).maybe(&ranges);
let literal_clause = Rule::default();
literal_clause.maybe(¬).one(&literal... | Rust | 0 |
def generate_negative_samples(self):
assert self.seed is not None, 'Specify seed for random sampling'
np.random.seed(self.seed)
negative_samples = {}
print('Sampling negative items')
for user in trange(self.user_count):
if isinstance(self.train[user][1], tuple):
seen = set(x[0] f... | Python | 1 |
from warnings import warn
from .std import TqdmDeprecationWarning
from .utils import ( # NOQA, pylint: disable=unused-import
CUR_OS, IS_NIX, IS_WIN, RE_ANSI, Comparable, FormatReplace, SimpleTextIOWrapper,
_environ_cols_wrapper, _is_ascii, _is_utf, _screen_shape_linux, _screen_shape_tput,
_screen_shape_wi... | Python | 1 |
{ // test sample: 70% of values cmp:max(jg, fk) / cmp::min(jg, fk) are between 1.1 and 3.7 with median being 1.8
let dominant_gradient: BlendType = if DOMINANT_DIRECTION_THRESHOLD * jg < fk { BLEND_TYPE_DOMINANT } else { BLEND_TYPE_NORMAL };
if ker.f != ker.g && ker.f != ker.j {
blend_f = d... | Rust | 0 |
e option
# or en if the language is not set.
#epub_language = ''
# The scheme of the identifier. Typical schemes are ISBN or URL.
#epub_scheme = ''
# The unique identifier of the text. This can be a ISBN number
# or the project homepage.
#epub_identifier = ''
# A unique identification for the text.
#epub_uid = ''
#... | Python | 1 |
EXTI9_5);
pub mod interrupt {
pub use bare_metal::Mutex;
pub use critical_section::CriticalSection;
pub use embassy::interrupt::{declare, take, Interrupt};
pub use embassy_extras::interrupt::Priority4 as Priority;
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[allow(non_camel_case_types)]
p... | Rust | 0 |
#coding=utf-8
'''
Created on 2015年8月21日
@author: atool
'''
import MySQLdb
from app import db_config
import time
import sys
from app.wraps.mysql_escape_warp import mysql_escape
reload(sys)
sys.setdefaultencoding('utf8')
@mysql_escape
def dict_2_sql_conditions(dict_param):
conditions = []
p_keys = dict_param... | Python | 1 |
();
cmd.insert("listIndexes", Bson::String(self.name()));
self.db.command_cursor(cmd, CommandType::ListIndexes, self.read_preference.to_owned())
}
}
<filename>src/ast/stmt.rs
use super::annotation::*;
use super::expr::*;
use super::identifier::*;
use super::literal::*;
use super::ty::*;
use crate::s... | Rust | 0 |
clock
PIN_SIOD:26,
PIN_SIOC:27,
PIN_D7:35,
PIN_D6:34,
PIN_D5:39,
PIN_D4:36,
PIN_D3:21,
PIN_D2:19,
PIN_D1:18,
PIN_D0:5,
PIN_VSYNC:25,
PIN_HREF:23,
... | Python | 1 |
1RXSRC_R::new(((self.bits >> 6) & 0x01) != 0)
}
#[doc = "Bit 16 - UART0 Open Drain Enable"]
#[inline(always)]
pub fn uart0ode(&self) -> UART0ODE_R {
UART0ODE_R::new(((self.bits >> 16) & 0x01) != 0)
}
#[doc = "Bit 17 - UART1 Open Drain Enable"]
#[inline(always)]
pub fn uart1ode(&s... | Rust | 0 |
#!/usr/bin/env python
# vi: set fileencoding=utf-8
from sopel.config.types import StaticSection, ValidatedAttribute
from sopel.tools import events
import sopel.bot as bot
import sopel
from urllib.parse import urlparse
import logging
import json
import socket
class IrkerSection(StaticSection):
listen_port = Vali... | Python | 1 |
.add(restored_rule)
await db.commit()
await db.refresh(restored_rule)
logger.info(f"✅ Восстановлена версия правил ID {rule_id} как новое правило ID {restored_rule.id}")
return restored_rule
except Exception as e:
logger.error(f"❌ Ошибка при восстановлении пр... | Python | 1 |
, leftlen, &compare, &compare, super::MAX_RECURSION_LIMIT);
assert_eq!(count.get(), 1);
for (i, elem) in s.iter().enumerate() {
assert_eq!(*elem, i);
}
}
#[test]
fn merge_left_alternative() {
let mut s = [
2, 4, 6, 8, 10, 12, 14, 16,
1, 3,... | Rust | 0 |
/// [`LOGFONT`](crate::LOGFONT) `lfPitchAndFamily` (`u8`), used with
/// [`PITCH`](crate::co::PITCH).
=>
DONTCARE, 0 << 4
ROMAN, 1 << 4
SWISS, 2 << 4
MODERN, 3 << 4
SCRIPT, 4 << 4
DECORATIVE, 5 << 4
}
pub_struct_const! { FILE_ATTRIBUTE, u32,
/// File attribute
/// [flags](https://docs.microsoft... | Rust | 0 |
(res) = stream.next().await {
assert!(res.is_ok());
let data_block = res.unwrap();
match index {
0 | 1 | 2 => assert_blocks_eq(expected[index].clone(), &[data_block]),
_ => panic!(),
}
index += 1;
}
}
use crate::{
error::PdfResult, filter::flate::B... | Rust | 0 |
default_initial_settings = {
"name": "Biqu B1",
"manufacturer": "Biqu",
"start_gcode": " ; BIQU B1 Start G-code\nM117 Getting the bed up to temp!\nM140 S{data['bed_temp']} ; Set Heat Bed temperature\nM190 S{data['bed_temp']} ; Wait for Heat Bed temperature\nM117 Get... | Python | 1 |
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 applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
/... | Rust | 0 |
import _plotly_utils.basevalidators
class DashValidator(_plotly_utils.basevalidators.DashValidator):
def __init__(
self, plotly_name="dash", parent_name="histogram2dcontour.line", **kwargs
):
super(DashValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | Python | 1 |
_R {
GPIO_FUNC27_IN_INV_SEL_R::new(((self.bits >> 5) & 0x01) != 0)
}
#[doc = "Bits 0:4"]
#[inline(always)]
pub fn gpio_func27_in_sel(&self) -> GPIO_FUNC27_IN_SEL_R {
GPIO_FUNC27_IN_SEL_R::new((self.bits & 0x1f) as u8)
}
}
impl W {
#[doc = "Bit 6"]
#[inline(always)]
pub fn... | Rust | 0 |
olor or selected_sticker.color,
stroke_width=resolve_value(args.stroke_width, DEFAULT_STROKE_WIDTH),
stroke_color=args.stroke_color or DEFAULT_STROKE_COLOR,
line_spacing=resolve_value(args.line_spacing, DEFAULT_LINE_SPACING, float),
auto_adjust=args.auto_adjust or (args.s... | Python | 1 |
_CLOSED)
# Switch status back to open
url = reverse("v2:alarm-switch", args=[alarm.pk])
resp = self.client.patch(url, {"status": constants.ALARM_OPENED})
self.assertEqual(resp.status_code, 204)
# Check actual status
url = reverse("v2:alarm-detail", args=[alarm.pk])
... | Python | 1 |
](crate::generic::Reg::write_with_zero), [`modify`](crate::generic::Reg::modify). See [API](https://docs.rs/svd2rust/#read--modify--write-api).\n\nFor information about available fields see [dckcfgr](dckcfgr) module"]
pub type DCKCFGR = crate::Reg<u32, _DCKCFGR>;
#[allow(missing_docs)]
#[doc(hidden)]
pub struct _DCKCFG... | Rust | 0 |
ntIndex(self.settings.value("basic/click_mode", 0, type=int))
self.click_mode_combo.currentIndexChanged.connect(self.update_click_mode)
mode_row.addWidget(self.click_mode_combo)
mode_row.addStretch()
button_layout.addLayout(mode_row)
# 长按时间设置
hold_row = QHBoxLayo... | Python | 1 |
alized index");
let parser = SaneQueryParser::new(index, fields);
parser
};
Ok(parser)
}
method parse(mut cx) {
let query_str = cx.argument::<JsString>(0)?.value();
let query = {
... | Rust | 0 |
env::set_var("ONET_SUBSTRATE_WS_URL", "ws://127.0.0.1:9944");
};
}
}
if let Some(data_path) = matches.value_of("data-path") {
env::set_var("ONET_DATA_PATH", data_path);
}
if let Some(substrate_ws_url) = matches.value_of("substrate-ws-url") {
env::set_var("ONET... | Rust | 0 |
"doc")
.current_dir("./tests/simple_project")
.assert()
.success();
// succeeds with generated docs
Command::cargo_bin("cargo-deadlinks")
.unwrap()
.arg("deadlinks")
.current_dir("./tests/simple_project")
.assert()
... | Rust | 0 |
to.a.kind(), Kind::Double);
assert_eq!(to.b, "mighty");
assert_eq!(to.c, "tch".to_string());
assert_eq!(to.d, Device::Cpu);
}
}
#[doc = "Reader of register FLCTL_IFG"]
pub type R = crate::R<u32, super::FLCTL_IFG>;
#[doc = "Reader of field `RDBRST`"]
pub type RDBRST_R = crate::R<bool, bool>;
... | Rust | 0 |
# coding: UTF-8
# Coder for Japanese grid square code. (JIS C 6304 / JIS X 0410)
# 行政管理庁告示第143号 http://www.stat.go.jp/data/mesh/
def _encode_i2c(lat, lon, base1):
t=[]
while base1>80:
t.append(1 + (lat&1)*2 + (lon&1))
lat = lat>>1
lon = lon>>1
base1 = base1>>1
if base1==80:
t.append(lon%10)
t.append(l... | Python | 1 |
)
else:
result = np.load(desc_path)
Descs = result["Descs"]
normals = result["normals"]
neighboor = result["neighboor"].tolist()
n = Descs.shape[0]
Descs = torch.tensor(Descs, device='cuda')
pred = []
with torch.no_grad():
... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.