text string | label_name string | labels int64 |
|---|---|---|
design() -> Result<i32, String> {
let curr = read_attribute("charge_full_design")?;
curr.parse::<i32>().map_err(|_| {
"Unable to parse the contents of 'charge_full_design' during a battery query".to_owned()
})
}
/// $ cat /sys/class/power_supply/bq27441/charge_now
/// 1528000
pub fn charge() -> Res... | Rust | 0 |
current = iter.next();
}
}
#[test]
fn test_sum_linked_list_1() {
let mut list1: LinkedList<u32> = LinkedList::new();
list1.push_back(9);
list1.push_back(9);
let mut list2 = LinkedList::new();
list2.push_back(5);
list2.push_back(2);
let result = sum_linked_lists(list1, list2);
... | Rust | 0 |
Ok(_) => { info!("Everything worked for S3 list buckets."); },
Err(err) => { info!("Got error in s3 list buckets: {}", err); }
}
}
fn s3_list_buckets_tests(s3: &mut S3Helper<DefaultCredentialsProvider>) -> Result<(), S3Error> {
let response = try!(s3.list_buckets());
info!("Got list of bucket... | Rust | 0 |
},
'interval': 60,
'enable': 1,
},
{
'name': 'gatherproxy',
'resource': [
'http://www.gatherproxy.com/',
'http://www.gatherproxy.com/proxylist/anonymity/?t=Elite',
'http://www.gatherproxy.com/proxylist/anonymity/?t=Anonymous',
... | Python | 1 |
DBError::NotOpen)?;
let db = db.close().await?;
self.r = DB::HalfClosed(db);
Ok(())
}
#[napi]
pub fn close(&mut self, env: Env) -> Result<()> {
let db = self
.r
.as_half_closed_mut()
.ok_or(JsonlDBError::NotStopped)?;
let db = db.close(env)?;
self.r = DB::Closed(db);
... | Rust | 0 |
{
"name": "Hostel Management", # Module title
"summary": "Manage Hostel easily", # Module subtitle phrase
"description": """
Manage Hostel
==============
Efficiently manage the entire residential facility in the school
""", # Supports reStructuredText(RST) format (description is Deprecated)
"vers... | Python | 1 |
# class Solution:
# def kClosest(self, points: List[List[int]], k: int) -> List[List[int]]:
# big = []
# for i in points:
# x= []
# x.append(i[0])
# x.append(i[1])
# x.append((i[0]**2 + i[1]**2)**0.5)
# big.append(x)
# n =len(big)
#... | Python | 1 |
name: Name::Number(3),
ty: Type::pointer_to(allocated_type.clone())
}
);
assert_eq!(gep.dest, Name::Number(12));
assert_eq!(gep.in_bounds, true);
assert_eq!(
gep.indices,
vec![
Operand::ConstantOperand(Constant::Int { bits: 64, value: 0 }),
... | Rust | 0 |
"""
Name: Collin Nunnally
Class: CSE-111
Comments:
"""
def water_column_height(tower_height, tank_height):
# h = t + 3w / 4
water_column_height = (tower_height + ((3 * tank_height) / 4))
return water_column_height
def pressure_gain_from_water_height(height):
# P = ρgh / 1000
pressure_gain_from_wate... | Python | 1 |
ute pixel coordinates.
"""
if not self.normalized:
return self
return self.scale(size)
@dataclass
class Landmark:
"""An object landmark (3d point) detected by a model"""
x: float
y: float
z: float
class Detection(object):
"""An object detection made by a model... | Python | 1 |
}
}
#[cfg(all(test, not(target_arch = "wasm32")))]
mod tests {
use near_sdk::test_utils::{accounts, VMContextBuilder};
use near_sdk::testing_env;
use super::*;
const MINT_STORAGE_COST: u128 = 5870000000000000000000;
fn get_context(predecessor_account_id: ValidAccountId) -> VMContextBuilder ... | Rust | 0 |
import numpy as np
import onnx
from onnx import OperatorSetIdProto, TensorProto, helper, numpy_helper
hidden_size = 4
weight_dim_to_split = 16
X = helper.make_tensor_value_info("input", TensorProto.FLOAT, ["batch", "seqlen", hidden_size])
Y = helper.make_tensor_value_info("output", TensorProto.FLOAT, ["batch", "seqle... | Python | 1 |
callbacks: `startup`, `process` and `destroy`.
//
// `startup` will be called only once at the start of the running of the `App`.
// `process` will be called every frame at the running of the `App`.
// `destroy` will be called only once at the end of the running of the `App`.
//... | Rust | 0 |
[TestFieldName::First, TestFieldName::SecondField] => true,
_ => false,
});
let message = "test".to_string();
let test = TestGen::new(1, &message, &2, message.clone());
let fields = test.into_field_type_array();
assert!(match fields {
[TestGenFieldType::First(1), TestGenField... | Rust | 0 |
m::PathBuf);
if let Some(get_index_arg) = args.get(1);
if let ExprKind::Lit(ref lit) = get_index_arg.kind;
if let LitKind::Str(ref path_lit, _) = lit.node;
if let pushed_path = Path::new(&*path_lit.as_str());
if let Some(pushed_path_lit) = pushed_path.to_str()... | Rust | 0 |
import requests
import sys
import random
import re
import base64
from requests.packages.urllib3.exceptions import InsecureRequestWarning
def title():
print('+------------------------------------------')
print('+ \033[34mPOC_Des: http://wiki.peiqi.tech \033[0m')
print('+ ... | Python | 1 |
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
class Solution:
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = nex... | Python | 1 |
);
res.extend(&addr.ip().octets());
res.extend(&addr.port().to_le_bytes());
res
}
}
}
impl Generator {
/// Initalize a new mac field generator
///
/// # Arguments
///
/// - pk: The public key of the peer to which the generator is associated
///
... | Rust | 0 |
(), String> {
*t = Time::from_record(self)?;
Ok(())
}
}
//////////////////////////// Date //////////////////////////////////
#[derive(Eq, Ord, Clone, Hash, PartialEq, PartialOrd, Serialize, Deserialize, Debug)]
pub struct DateWrapper {
val: ::chrono::NaiveDate,
}
pub type Date = DateWrapper;
... | Rust | 0 |
HL!(); 2 },
0xA7 => { and_ar!(a); 1 },
0xA8 => { xor_ar!(b); 1 },
0xA9 => { xor_ar!(c); 1 },
0xAA => { xor_ar!(d); 1 },
0xAB => { xor_ar!(e); 1 },
0xAC => { xor_ar!(h); 1 },
0xAD => { xor_ar!(l)... | Rust | 0 |
messages must only contain `input_content` data.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StreamingAnnotateVideoRequest {
/// *Required* The streaming request, which is either a streaming config or
/// video content.
#[prost(
oneof = "streaming_annotate_video_request::StreamingReque... | Rust | 0 |
vf_a_idx_list = (
vf_a_idx_list_half1 + vf_a_idx_list[len(vf_a_idx_list) // 2 :]
)
vf_a_emb = vf_a_emb[vf_a_idx_list]
audio_entity_idxes = audio_entity_idxes[vf_a_idx_list]
label_lst.extend(
(audio_entity_idxes == video_entity_... | Python | 1 |
_if = "Option::is_none")]
pub is_azure_backup_agent_upgrade_available: Option<bool>,
#[serde(rename = "isDpmUpgradeAvailable", default, skip_serializing_if = "Option::is_none")]
pub is_dpm_upgrade_available: Option<bool>,
#[serde(rename = "extendedInfo", default, skip_serializing_if = "Option::is_none")... | Rust | 0 |
_381(BlsCurves::G1G2) => {
BlsKeyPair::<G1G2>::from_public_bytes(public).map(R::alloc_key)
}
#[cfg(feature = "ed25519")]
KeyAlg::Ed25519 => Ed25519KeyPair::from_public_bytes(public).map(R::alloc_key),
#[cfg(feature = "ed25519")]
KeyAlg::X25519 => X25519KeyPair::from_p... | Rust | 0 |
a-like routing table to store and manage discovered peers and topics. The
//! protocol allows for external IP discovery in NAT environments through regular PING/PONG's with
//! discovered nodes. Nodes return the external IP address that they have received and a simple
//! majority is chosen as our external IP address. ... | Rust | 0 |
der.push(nx);
}
println!("{:?}", gr);
assert_is_topo_order(&gr, &order);
}
let mut gr2 = gr.clone();
gr.add_edge(e, d, -1.);
assert!(pg::algo::is_cyclic_directed(&gr));
assert!(pg::algo::toposort(&gr, None).is_err());
gr2.add_edge(d, d, 0.);
assert!(pg::algo::is_cycli... | Rust | 0 |
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
use errors::{ParseError, Result};
use errors::ErrorType::Parse;
use position::Pos;
pub trait StrExt<'a> {
fn capitalize(&self) -> String;
fn rsplit_at(&'a self, index: ... | Rust | 0 |
nect(&self.slot_on_mic_spin_change());
self.form
.music_spin
.value_changed()
.connect(&self.slot_on_music_spin_change());
self.form
.sample_spin
.value_changed()
.connect(&self.slot_on_sample_spin_change());
self.form
... | Rust | 0 |
, cx.typeck_results(), expr)?.0;
let which = match (ty.kind(), cv) {
(&ty::Bool, Constant::Bool(false)) | (&ty::Uint(_), Constant::Int(0)) => ExtremeType::Minimum,
(&ty::Int(ity), Constant::Int(i)) if i == unsext(cx.tcx, i128::MIN >> (128 - int_bits(cx.tcx, ity)), ity) => {
ExtremeType:... | Rust | 0 |
# List of favorite modes of transportation
transportation = ["Tesla Model S", "Harley-Davidson motorcycle", "Toyota Tacoma", "Nissan Rogue"]
# Printing statements about each transportation mode
print(f"I would like to own a {transportation[0]}.")
print(f"Riding a {transportation[1]} would be an amazing experience.")
p... | Python | 1 |
#Lógica das páginas, define os dados que serão
from django.shortcuts import render, redirect, get_object_or_404
from .models import Funcionario
#Função para página inicial com formulário de cadastro
def index(request):
if request.method == 'POST':
nome= request.POST.get('nome')
vendas=float(reques... | Python | 1 |
, 75, 76, 77, 78, 79, 80],
[0, 9, 18, 27, 36, 45, 54, 63, 72],
[1, 10, 19, 28, 37, 46, 55, 64, 73],
[2, 11, 20, 29, 38, 47, 56, 65, 74],
[3, 12, 21, 30, 39, 48, 57, 66, 75],
[4, 13, 22, 31, 40, 49, 58, 67, 76],
[5, 14, 23, 32, 41, 50, 59, 68, 77],
[6, 15, 24, 33, 42, 51, 60, 69, 78],
[7,... | Rust | 0 |
(data, NONCE), &secret);
#[allow(non_snake_case)]
let encSecKey = Self.rsa(secret);
// let mut res = Map::new();
// res.insert("params".to_owned(), params.into());
// res.insert("encSecKey".to_owned(), encSecKey.into());
// Value::Object(res)
let meal = &[("params... | Rust | 0 |
, true) && !probably_prime_lucas(n),
vec![
2047, 3277, 4033, 4681, 8321, 15841, 29341, 42799, 49141, 52633, 65281, 74665, 80581,
85489, 88357, 90751,
]
);
test_pseudo_primes!(
test_probably_prime_lucas,
|n| probably_prime_lucas(n) && !probably_prime_mille... | Rust | 0 |
propagateUp = True
else:
propagateUp = True
if propagateUp:
# Propagate 1-element sequences up
opcode.setCommand(subOpcode.getCommand())
opcodes[i] = opcode.asTuple()
if mightReplaceUpSiblings:
# There are entries which might p... | Python | 1 |
/// SPI communication error
Spi(SpiError),
/// CS output pin error
Pin(PinError),
InvalidWhoAmI(u8),
}
impl<SpiError, PinError> From<SpiError> for Error<SpiError, PinError> {
fn from(err: SpiError) -> Self {
Self::Spi(err)
}
}
pub struct Lis2dw12<SPI, CS> {
spi: SPI,
cs: CS,
... | Rust | 0 |
import os
import io
import logging
from flask import Blueprint, render_template_string
from dotenv import load_dotenv
from src.models.sheet import Sheet
from src.services.sheet_service import SheetService
from src.services.rates_service import RatesService
from src.clients.sheets_client import get_sheet_client
class ... | Python | 1 |
import argparse
import os
import pandas as pd
import torch
from toolrag.models.e5 import E5Model
parser = argparse.ArgumentParser()
parser.add_argument("--model", type=str, default="intfloat/e5-base-v2")
parser.add_argument("--output_path", type=str, required=True)
parser.add_argument("--category", type=str, require... | Python | 1 |
pygame.image.load("GameSprites\\2.png").convert_alpha(),
pygame.image.load("GameSprites\\3.png").convert_alpha(),
pygame.image.load("GameSprites\\4.png").convert_alpha(),
pygame.image.load("GameSprites\\5.png").convert_alpha(),
pygame.image.load("GameSprites\\6.png").convert_alpha()... | Python | 1 |
import importlib
from argparse import Namespace
from ast import literal_eval
from util.net import get_timepc
def get_cfg(opt_terminal):
opt_terminal.cfg_path = opt_terminal.cfg_path.split('.')[0].replace('/', '.')
dataset_lib = importlib.import_module(opt_terminal.cfg_path)
cfg = dataset_lib.cfg()
# cfg = dataset... | Python | 1 |
right (C) 2017, <NAME>.
* mozjpeg Modifications:
* Copyright (C) 2014, Mozilla Corporation.
* For conditions of distribution and use, see the accompanying README.ijg file.
*
* This file contains common declarations for the sample applications
* cjpeg and djpeg. It is NOT used by the core JPEG library.
*/
/* def... | Rust | 0 |
await self.connection.close()
if self.gateway_mode:
self.gateway_mode = None
@callback
async def shutdown(self, event: Event) -> None:
"""Shutdown the hub."""
if self.api:
await self.api.stop()
if self.connection and self.available:
... | Python | 1 |
.len(), std::mem::size_of::<Self>());
Ok(bytes)
}
#[allow(unused_variables)]
fn from_asc_bytes(asc_obj: &[u8], api_version: semver::Version) -> Result<Self, DeterministicHostError> {
// Sanity check
match &api_version {
... | Rust | 0 |
#!/usr/bin/env python
from vtkmodules.vtkCommonExecutionModel import vtkCompositeDataPipeline
from vtkmodules.vtkFiltersCore import vtkArrayCalculator
from vtkmodules.vtkFiltersGeometry import vtkGeometryFilter
from vtkmodules.vtkIOEnSight import vtkGenericEnSightReader
from vtkmodules.vtkRenderingCore import (
vtk... | Python | 1 |
string(opts: &Options) -> String {
format!("{}", opts.usage(opts.short_usage(exe_str().as_slice()).as_slice()))
}
/// Construct a version string.
///
/// Intended for use as output in response to `--version` as defined by
/// `cli::versionopt`.
///
/// Version string format:
///
/// ```ignore
/// <program name> ve... | Rust | 0 |
# Databricks notebook source
# MAGIC %run ../../Includes/Copy-Datasets
# COMMAND ----------
from pyspark.sql import functions as F
# COMMAND ----------
def type2_upsert(microBatchDF, batch):
microBatchDF.createOrReplaceTempView("updates")
sql_query = """
MERGE INTO books_silver
USING (
... | Python | 1 |
import os
import sys
root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
sys.path.append(root)
# ----------------------------------------------------------------------------
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# ht... | Python | 1 |
");
let _ = Uuid::parse_str("67e550-4105b1426f9247bb680e5fe0c");
let _ = Uuid::parse_str("F9168C5E-CEB2-4faa-B6BF1-02BF39FA1E4");
});
}
#[bench]
fn bench_parse_invalid_len(b: &mut Bencher) {
b.iter(|| {
let _ = Uuid::parse_str("F9168C5E-CEB2-4faa-BBF-329BF39FA1E4");
})
}
#[bench]
f... | Rust | 0 |
import re
import pytest
# Проверка что тест вызван через pytest ..., а не python ...
from _pytest.assertion.rewrite import AssertionRewritingHook
if not isinstance(__loader__, AssertionRewritingHook):
print(f"Тесты нужно вызывать используя такое выражение:\npytest {__file__}\n\n")
def unified_columns_output(ou... | Python | 1 |
#[doc = "0x2e - eUSCI_Bx Interrupt Vector Register"]
#[inline(always)]
pub fn ucb3iv_mut(&self) -> &mut UCB3IV {
unsafe { &mut *(((self as *const Self) as *mut u8).add(46usize) as *mut UCB3IV) }
}
}
#[doc = "eUSCI_Bx Control Word Register 0\n\nThis register you can [`read`](crate::generic:... | Rust | 0 |
lementation of [`VisitMut::visit_object_mut()`].
pub fn visit_object_mut<Prim, V>(visitor: &mut V, object: &mut Object<Prim>)
where
Prim: PrimitiveType,
V: VisitMut<Prim> + ?Sized,
{
for (_, ty) in object.iter_mut() {
visitor.visit_type_mut(ty);
}
}
/// Default implementation of [`VisitMut::vis... | Rust | 0 |
def rescale_noise_cfg(noise_cfg, noise_pred_text, guidance_rescale=0.0):
"""
Rescale `noise_cfg` according to `guidance_rescale`. Based on findings of [Common Diffusion Noise Schedules and
Sample Steps are Flawed](https://arxiv.org/pdf/2305.08891.pdf). See Section 3.4
"""
std_text = noise_pred_text.... | Python | 1 |
// check aggregation view
let agg_view = get_node(&inc, mig, &format!("q_{:x}_n0", qid));
assert_eq!(agg_view.fields(), &["grp", "count"]);
assert_eq!(agg_view.description(true), "|*| γ[1]");
// check edge view -- note that it's not actually currently possible to read ... | Rust | 0 |
import turtle
from turtle import *
win=Screen()
win.bgcolor("black")
old=Turtle()
old.color("white")
old.speed(10)
old.begin_fill()
old.color("red")
old.penup()
old.setposition(10,-400)
old.pendown()
old.circle(350)
old.end_fill()
old.begin_fill()
old.color("white")
old.penup()
old.setposition(10,-350)
old.pendown()
ol... | Python | 1 |
=> l > r,
Comparator::CLeq => l <= r,
Comparator::CGeq => l >= r,
}
}
fn eval(expr: &Expr, env: &HashMap<String,i32>) -> Result<i32, String> {
match *expr {
Expr::Variable(ref var) => match env.get(var) {
Some(val) => Ok(*val),
None => Err(format!("Undefined var {}", var)),
},
... | Rust | 0 |
import streamlit as st
from datetime import date
import matplotlib.pyplot as plt
from auth import login_ui, create_user_table
from functions import (
create_table,
create_recurring_tables,
apply_due_recurring,
add_income,
add_expense,
get_summary,
get_expense_by_category,
filter_income,... | Python | 1 |
#Group name:[Cas group 305]
#Group Members:
#[Reece Colgan] - S377586
#[Hayden Powell] - S376682
#[Daniel Sales] - S322244
#[Luke Few] - S348831
print("Cas Group 305 - Assignment 2")
print("Question 2 Task 2.1")
print() #Print space
s = '56aAww1984sktr235270aYmn145ss785fsq31D0'
#seperate string into a string of numbe... | Python | 1 |
ufResult<()> {
::protobuf::rt::write_map_with_cached_sizes::<
::protobuf::types::ProtobufTypeString,
::protobuf::types::ProtobufTypeString,
>(1, &self.tags, os)?;
os.write_unknown_fields(self.get_unknown_fields())?;
::std::result::Result::Ok(())
}
fn get_... | Rust | 0 |
)
raise ValueError(msg) # noqa: TRY004
document_embedding_store = EncoderBackedStore[str, list[float]](
document_embedding_cache,
key_encoder,
_value_serializer,
_value_deserializer,
)
if query_embedding_cache is True:
... | Python | 1 |
BorderColor::FLOAT_TRANSPARENT_BLACK
}
wgt::SamplerBorderColor::OpaqueBlack => vk::BorderColor::FLOAT_OPAQUE_BLACK,
wgt::SamplerBorderColor::OpaqueWhite => vk::BorderColor::FLOAT_OPAQUE_WHITE,
}
}
pub fn map_comparison(fun: wgt::CompareFunction) -> vk::CompareOp {
use wgt::CompareFuncti... | Rust | 0 |
# Copyright 2016-2023 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | Python | 1 |
r i, tensor in enumerate(tensor_list):
new_tensor = tensor.flatten(2).permute(0, 2, 1) # 展平成(B,H*W,C)
tensor_flatten.append(new_tensor)
if mask_list is not None:
mask = mask_list[i]
new_mask = mask.flatten(1)
mask_flatten.append(new_mask)
assert t... | Python | 1 |
ument'],
"messages": current_group['messages'],
# 添加模型参数
"model": current_group['model'],
"temperature": current_group['temperature'],
"max_tokens": current_group['max_tokens']
}
# 创建保存目录(如果不存在)
os.maked... | Python | 1 |
nnect to the peer with.
pub fn protocol(&self) -> &Protocol {
&self.prot
}
/// Hash that we are interested in from the peer.
pub fn hash(&self) -> &InfoHash {
&self.hash
}
/// Address that we should connect to for the peer.
pub fn address(&self) -> &SocketAddr {
&se... | Rust | 0 |
import csv
import wfdb
import neurokit2 as nk
import numpy as np
from matplotlib import pyplot as plt
from numpy.ma.extras import average
# Se obtiene los datos del fichero
record_name = "0001"
record = wfdb.rdrecord("0001")
fs = record.fs
#Se guarda la señal del ECG
ecg = record.p_signal[:, 0]
signals, info = nk.ec... | Python | 1 |
from selenium import webdriver
from selenium.webdriver.common.by import By
import time
driver = webdriver.Chrome()
driver.get("https://comic.naver.com/webtoon")
time.sleep(2)
webtoonMenu = driver.find_element(by=By.XPATH, value='//*[@id="wrap"]/header/div[3]/nav/ul/li[10]/a')
webtoonMenu.click()
time.sleep(1)
s... | Python | 1 |
def _move_to_cuda(tensor):
return tensor.cuda()
| Python | 1 |
from discord.ext import commands
import discord
class TestErrorCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.hybrid_command(name='test')
async def test_error_command(self, ctx, error_type: str):
"""test用のコマンドだにぇ"""
if error_type == "CommandNotFound":
... | Python | 1 |
any_group(Group.Twice):
created_items.append(world.create_item(item))
if world_options.coinsanity == Options.CoinSanity.option_coin:
if world_options.coinbundlequantity == -1:
create_coin_piece(created_items, world, 825, 250, Group.DLCQuest)
return
create_coin... | Python | 1 |
ed multiaddr");
println!("Now listening on {:?}", address);
let topic = libp2p::floodsub::TopicBuilder::new("chat").build();
let floodsub_ctl = libp2p::floodsub::FloodSubController::new(&floodsub_upgrade);
floodsub_ctl.subscribe(&topic);
let (tx, rx) = mpsc::channel(1);
let floodsub_rx = flo... | Rust | 0 |
from datetime import datetime
from app.extentions import mongo
def insert_image(file_id: str, url: str, scene: str, voice: str, owner_id: str, session_id: str, status: str, metadata: dict):
"""
Insert an image document into the MongoDB images collection.
Args:
file_id: Unique identifier for th... | Python | 1 |
t u8 as *const libc::c_char,
) == 0 as libc::c_int
{
(*p_j2k).m_specific_param.m_encoder.m_TLM = 0 as libc::c_int
} else {
opj_event_msg(
p_manager,
1 as libc::c_int,
b"Invalid value for option: %s.\n\x00" as *const u8 as *const libc::c_char,
*p_... | Rust | 0 |
co: TypeAlias = (
_ArrayLikeStr_co |
_ArrayLikeBytes_co |
_ArrayLikeString_co
)
# NOTE: This includes `builtins.bool`, but not `numpy.bool`.
_ArrayLikeInt: TypeAlias = _DualArrayLike[
dtype[integer[Any]],
int,
]
# Extra ArrayLike type so that pyright can deal with NDArray[Any]
# Used as the first ... | Python | 1 |
# -*- coding: utf-8 -*-
class QSS():
def __init__(self):
self.White = '''/**********主界面样式**********/
QWidget#MainWindow {
font-family:Microsoft YaHei;
font-size:13px;
border: 0px solid rgb(111, 156, 207);
background: rgb(232, 241, 252);
}
QWidget#messageWidget {
bac... | Python | 1 |
. This function
// takes no arguments.
// `#[bench]` - Indicates a function is a benchmark to be run. This
// function takes one argument (test::Bencher).
// `#[should_panic]` - This function (also labeled with `#[test]`) will only pass if
// ... | Rust | 0 |
ages::from_paths(&paths);
assert_eq!(out.has_warnings(), true);
let (res, warnings) = out.take();
assert_eq!(warnings.len(), 2);
assert_eq!(res.is_ok(), true);
let story = res.ok().unwrap();
assert_eq!(story.title.is_some(), true);
let title_content = story.title.... | Rust | 0 |
x2 - radius, y2,
x1 + radius, y2,
x1, y2,
x1, y2 - radius,
x1, y1 + radius,
x1, y1
], smooth=True, **kwargs)
@staticmethod
def add_glow_effect(widget, canvas, x, y, width, height):
"""Add a layered glow effect around a widge... | Python | 1 |
cf, tag])
.inc_by(count as i64);
});
}
}
// flow statistics group by region
tls_collect_read_flow(region_id, stats);
// scan count
let scan_counter = metrics.scan_counter;
// exec count
let executor_count = metrics.executor_count;
TLS_COP_METRICS... | Rust | 0 |
,
freeze_authority: freeze_authority.unwrap(),
multisigner_pubkeys,
tx_info: create_tx_info(matches, &signer_info, fee_payer_pubkey, nonce_account, nonce_authority_pubkey),
},
signers: signer_info.signers,
})
}
pub fn process_freeze_token_command(
rpc_client:... | Rust | 0 |
(
custom_keys={
'query_embed': embed_multi,
'query_feat': embed_multi,
'level_embed': embed_multi,
'absolute_pos_embed': dict(decay_mult=0.0),
'relative_position_bias_table': dict(decay_mult=0.0),
},
norm_decay_mult=0.0,
),
)
optim... | Python | 1 |
&mut result_size as *mut size_t,
) };
// Make printing certain platform-specific errors less scary looking:
if let Err(err) = eval_errcode(errcode, (), "clGetKernelWorkGroupInfo", None::<String>) {
if let Some(status) = err.api_status() {
// NVIDIA / APPLE (i think):
... | Rust | 0 |
;
v4 = 1 + {2} * {3};
assert_eq!(7, v3);
assert_eq!(7, v4);
let v5 = { 1 + {2} * 3 };
assert_eq!(7, v5);
let v9 = { 1 + if 1 > 2 {1} else {2} * {3} };
assert_eq!(7, v9);
}
use crate::{
error::{ParseError, Reason},
lexer::{Lexer, Token},
ExceptionId, LicenseItem, LicenseReq,
};
... | Rust | 0 |
# Using format method with placeholders {} and positional arguments
str = "Hello {} , This is {}"
print(str.format("World", "Python")) # Output: Hello World , This is Python
print(str.format("Python", "World")) # Output: Hello Python , This is World
print()
# Using format method with placeholders {} and positional ... | Python | 1 |
#!/usr/bin/env python3
import vertexai
from vertexai.reasoning_engines import ReasoningEngine
def test_criterios():
print("🔧 Inicializando Vertex AI...")
vertexai.init(project="gft-bu-gcp", location="us-central1")
print("🤖 Conectando ao agente Feito Conferido...")
engine = ReasoningEngine("41781... | Python | 1 |
ntoIterator for Languages {
type Item = <BTreeMap<LanguageType, Language> as IntoIterator>::Item;
type IntoIter =
<BTreeMap<LanguageType, Language> as IntoIterator>::IntoIter;
fn into_iter(self) -> Self::IntoIter {
self.inner.into_iter()
}
}
impl<'a> IntoIterator for &'a Languages {
... | Rust | 0 |
h_dependency(comp)
.with_image(comp_image),
);
Ok(())
}
}
pub fn choose_format<B: Backend>(
factory: &Factory<B>,
formats: &[Format],
tiling: Tiling,
features: ImageFeature,
) -> Option<Format> {
for format in formats.iter().cloned() {
if format_supporte... | Rust | 0 |
_System_Diagnostics_Debug\"`*"]
pub const DBGPROP_ATTRIB_VALUE_IS_EXPANDABLE: DBGPROP_ATTRIB_FLAGS = 16u32;
#[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"]
pub const DBGPROP_ATTRIB_VALUE_IS_FAKE: DBGPROP_ATTRIB_FLAGS = 32u32;
#[doc = "*Required features: `\"Win32_System_Diagnostics_Debug\"`*"]
pub ... | Rust | 0 |
Lshift(Source, Source),
}
fn source_value<'a>(gates: &'a HashMap<String, Op>, values: &mut HashMap<&'a str, u16>, source: &'a Source) -> u16 {
match source {
&Source::Number(num) => num,
Source::Gate(name) => wire_value(gates, values, name)
}
}
fn wire_value<'a>(gates: &'a HashMap<String, O... | Rust | 0 |
v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);
}
";
// Optimized version for mobile, where dependent texture reads can be a bottleneck
//
// Taken from: https://github.com/mattdesl/glsl-fxaa/blob/master/fxaa.glsl
//
// Basic FXAA implementation based on the code on geeks3d.com with the
// modification that the text... | Rust | 0 |
ow: int, high: int, count: int) -> List[int]:
"""
Credit: https://stackoverflow.com/a/17674783/1144204
"""
values = list()
gap = (math.log(high) - math.log(low)) / count
values.append(low*math.exp(gap))
for ii in range(count)[1:]:
values.append(values[... | Python | 1 |
[derive(Debug, ServiceFactory, ServiceDispatcher)]
#[service_factory(artifact_name = "exonum.test.Migration", artifact_version = "0.5.0")]
pub struct MigrationServiceV05;
impl Service for MigrationServiceV05 {}
/// Service with mixed migrations (data migrations 0.1.0 -> 0.2.0, 0.2.0 -> 0.5.0, and
/// fast-forward mig... | Rust | 0 |
S",
"https://github.com/seed-rs/seed-quickstart-webpack"
),
view_link("Docs.rs", "https://docs.rs/seed/latest/seed"),
view_link("Crates.io", "https://crates.io/crates/seed"),
view_link("Awesome List", "https://github.com/seed-rs/awesome-seed-rs"),
]
}
fn view_link(title:... | Rust | 0 |
le: u16,
p_attr: *const ble_gatts_attr_t,
p_handle: *mut u16,
) -> u32;
}
extern "C" {
pub fn sd_ble_gatts_value_set(
adapter: *mut adapter_t,
conn_handle: u16,
handle: u16,
p_value: *mut ble_gatts_value_t,
) -> u32;
}
extern "C" {
pub fn sd_ble_gatts_valu... | Rust | 0 |
from __future__ import annotations
from typing import Any, Optional, cast
from crowler.ai.ai_client_config import AIConfig
from crowler.ai.aws.anthropic.claude_client_config import (
Claude37ClientConfig,
ClaudeClientConfig,
)
from crowler.ai.aws.bedrock_client import BedrockClient
import typer
class Claud... | Python | 1 |
nstant::now();
let address = socket.peer_addr().unwrap();
let mut socket = Wrapper::new( sigint.clone(), socket )?;
while !sigint.was_sent() {
if ip_lock.is_some() && timestamp.elapsed() > Duration::from_secs( 60 ) {
ip_lock = None;
}
let response = Response::read_from_... | Rust | 0 |
!(z)) *
Mat4::translate(vec3!(0., 4. * T_K, 0.25 * T_K)) *
Mat4::scale(vec3!(0.5, 1., 0.1));
draw!(model, CUBE1_INDEX_START, CUBE1_INDEX_ONE_PAST_END);
}
// This project is not focused on displaying an accurate time. So let's
// just act naively and get something a very app... | Rust | 0 |
cation;
use crate::semantic::nodes::*;
use crate::semantic::types::MonoType;
use std::fmt;
use std::rc::Rc;
/// Represents any structure that can appear in the semantic graph.
#[derive(Debug)]
#[allow(missing_docs)]
pub enum Node<'a> {
Package(&'a Package),
File(&'a File),
PackageClause(&'a PackageClause),... | Rust | 0 |
self) -> i16 {
match self.table.len() {
6 => 320,
5 => 160,
_ => 0,
}
}
fn draw_pile_down_pos(&self) -> Position {
if !self.flipped {
self.origin + Position::new(82, 140)
} else {
self.origin + Position::new(940 + self.... | Rust | 0 |
-759, 761, -763, 765, -767, 769, -771,
773, -775, 777, -779, 781, -783, 785, -787, 789, -791, 793, -795, 797, -799, 801, -803, 805,
-807, 809, -811, 813, -815, 817, -819, 821, -823, 825, -827, 829, -831, 833, -835, 837, -839,
841, -843, 845, -847, 849, -851, 853, -855, 857, -859, 861, -863, 865, -867, 869,... | Rust | 0 |
KE: c_int = 1;
pub const FUTEX_PRIVATE_FLAG: c_int = 128;
pub const FUTEX_PRIVATE: c_int = FUTEX_PRIVATE_FLAG;
// kernel/time/posix-timers.c
#[inline(always)]
pub unsafe fn clock_gettime(which_clock: clockid_t,
tp: *mut timespec)
-> c_int {
syscall!(CLOCK_GET... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.