text string | label_name string | labels int64 |
|---|---|---|
'Should return a list of tests that occur in a certain order'
self.on_tier = tier
print 'Retrieving Tests: Tier %d' % tier
if self.fail_tier is not None:
if tier == self.fail_tier:
print '> Fail Tier'
yield {'test': lambda x, y: x.fail_tier(),
... | Python | 1 |
s://some-random-api.ml/canvas/color?avatar={member.avatar.url}&color={color.lower()}"
embed.set_image(url=image_url)
await ctx.send(embed=embed)
@commands.command()
async def invert(self, ctx: commands.Context, *, member: discord.Member = None):
"""Invert an image's col... | Python | 1 |
#!/usr/bin/env python3
"""
Silero VAD Model Download Script
Downloads the Silero VAD model for offline use
"""
import os
import torch
import logging
logging.basicConfig(level=logging.INFO)
logger = logging.getLogger(__name__)
def download_silero_vad():
"""Download Silero VAD model for offline use."""
try:
... | Python | 1 |
import pytest
from hamcrest import assert_that, has_length
from hmt.sources.kafka import KafkaSource, KafkaSourceConfig
from ..util import read_recordings_as_dict
exchanges = read_recordings_as_dict()
kafkaSourceConfig = KafkaSourceConfig(broker="'kafka://localhost:9092", topic="example")
@pytest.fixture()
def ka... | Python | 1 |
k.cuda()
batch_size = input_ids.size(0)
idx_list = []
# parse idx from torch.Tensor to List[List[str]]
for i in range(batch_size):
idx_list.append(_pre_process_inputs(tokenizer.pad_token_id, input_ids[i]))
outputs = llm.generate(prompt_token_ids=idx_list, sampling_params=sampling_params, us... | Python | 1 |
class Solution:
def longestCommonPrefix(self, arr1: List[int], arr2: List[int]) -> int:
s = set()
for x in arr1:
while x:
s.add(x)
x //= 10
ans = 0
for x in arr2:
w... | Python | 1 |
# -*- coding: utf-8 -*- #
# Copyright 2024 Google LLC. 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 requir... | Python | 1 |
if let Some(edited_timestamp) = update.edited_timestamp {
msg.edited_timestamp = Some(edited_timestamp);
}
if let Some(author) = update.author {
msg.author = author;
}
if let Some(mention_everyone) = update.mention_everyone {
msg.mention_everyone = mention_everyone;
}
... | Rust | 0 |
ExtraLarge,
Padding,
}
impl Default for Spacing {
fn default() -> Spacing {
Spacing::Default
}
}
impl Spacing {
pub fn is_default(spacing: &Spacing) -> bool {
match spacing {
Spacing::Default => true,
_ => false,
}
}
pub fn is_none(spacing: &Spa... | Rust | 0 |
mage = "testdata/images/save.png"
hotkey = HotKey("F11", ctrl=True)
action = ExampleCheckAction()
self.actionController.register(action, None)
self.actionController.appendMenuCheckItem(action.stringId, menu)
self.actionController.appendToolbarCheckButton(action.stringId,
... | Python | 1 |
rcle
### preform radon transform for each image
queuelist = []
if msg is True:
apDisplay.printMsg("Performing Radon transforms with multiprocessor")
for imageid in range(len(imagelist)):
if msg is True and imageid % 50 == 0:
### FUTURE: add time estimate
sys.stderr.write(".")
image = imagelist[imageid]... | Python | 1 |
est| { &mut m.publishedfileids },
));
::protobuf::reflect::MessageDescriptor::new_pb_name::<CPublishedFile_GetUserVoteSummary_Request>(
"CPublishedFile_GetUserVoteSummary_Request",
fields,
file_descriptor_proto()
)
})
}
... | Rust | 0 |
stitution,
initial_environment: C::Environment,
initial_hh_goal: HhGoal<C>,
) -> Fallible<ExClause<C>> {
let mut ex_clause = ExClause {
subst,
ambiguous: false,
constraints: vec![],
subgoals: vec![],
delayed_subgoals: vec![],
... | Rust | 0 |
}
}
#[cfg(feature = "instr_info")]
impl Default for CpuidFeature {
#[cfg_attr(has_must_use, must_use)]
#[inline]
fn default() -> Self {
CpuidFeature::INTEL8086
}
}
// GENERATOR-END: CpuidFeature
// GENERATOR-BEGIN: RflagsBits
// ⚠️This was generated by GENERATOR!🦹♂️
/// `RFLAGS` bits supported by the instruct... | Rust | 0 |
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
# Read the CSV file
df = pd.read_csv('results.csv')
# Calculate means for each size
means = df.groupby('Size').mean().reset_index()
# Set style
sns.set_style("whitegrid")
plt.rcParams['figure.figsize'] = [15, 12]
# Create a figure with subplo... | Python | 1 |
nx
from backend.utils import load_model_state_only
with open(os.path.join(args.load, 'latest_iteration.txt')) as f:
for line in f:
folder = line.strip()
break
load_checkpoint_name = os.path.join(args.load, folder, "rank_00_model_states.pt")
data = mock_data()
cuda_de... | Python | 1 |
res = res[0]
else:
res = res[:1] if res else ''
with open(output_file, "a") as resfile:
resfile.write(f"{idx} {res}\n")
processed_count += 1
if processed_count % 50 == 0:
print(f"Processed {pro... | Python | 1 |
import unittest
if __name__ == "__main__":
name = "a1q3.coverage_tests"
suite = unittest.defaultTestLoader.loadTestsFromNames([name])
result = unittest.TextTestRunner().run(suite)
| Python | 1 |
import time
import openai
import sys
if len(sys.argv) < 4:
print("Usage: python open_cli.py <server> <prompt> <stream> <img_url>")
exit(1)
server = sys.argv[1]
prompt = sys.argv[2]
stream = False
if sys.argv[3].lower() == "true" or sys.argv[3].lower() == "1":
stream = True
img_url = ""
if len(sys.argv) =... | Python | 1 |
im_doing")))]
debug_assert!(v == 0);
debug_assert!(v <= 25);
// If S is set, the user has indicated they will never be
// dealing with foreign pointers, so we can check that
// too. We need only really check the sign bit because of
// canonicalisation, but it's actually c... | Rust | 0 |
bustype: u16,
pub vendor: u16,
pub product: u16,
pub version: u16,
}
pub const BUS_USB: u16 = 0x03;
<reponame>Co-Epi/app-backend-rust<gh_stars>10-100
use super::database::Database;
use crate::{
errors::ServicesError,
expect_log,
reporting::{
public_symptoms::{CoughSeverity, FeverSeveri... | Rust | 0 |
MetricEvent {
metric_id,
event_codes: vec![event_code_2],
payload: MetricEventPayload::IntegerValue(5000), // 1/2 = 50.00%
},
],
);
}
#[fuchsia::test]
fn test_log_establish_connection_cobalt_metrics_user_wait_ti... | Rust | 0 |
_vec_recycling() {
let mut bytes = LocalBytesMut::from(Vec::with_capacity(16));
assert_eq!(bytes.capacity(), 16);
bytes.put("0123456789012345");
bytes.advance(10);
assert_eq!(bytes.capacity(), 6);
bytes.reserve(8);
assert_eq!(bytes.capacity(), 16);
}
#[test]
fn reserve_in_arc_unique_does_no... | Rust | 0 |
"""
URL configuration for my_blog_api project.
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/5.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='... | Python | 1 |
process: OcclumProcess {
default_stack_size: occlum_config.process.default_stack_size,
default_heap_size: occlum_config.process.default_heap_size,
default_mmap_size: occlum_config.process.default_mmap_size,
},
entry_points: occlum_config... | Rust | 0 |
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from statsmodels.tsa.arima.model import ARIMA
from sklearn.model_selection import train_test_split
from sklearn.metrics import mean_absolute_error, mean_squared_error
# Load the cleaned dataset
def load_data(file_path):
df... | Python | 1 |
import random
# Player setup
player = {
"name": "Hero",
"hp": 100,
"attack": (10, 20)
}
# Monster setup
monsters = [
{"name": "Goblin", "hp": 30, "attack": (5, 10)},
{"name": "Skeleton", "hp": 40, "attack": (7, 12)},
{"name": "Orc", "hp": 60, "attack": (10, 15)},
{"name": "Dragon", "hp": 1... | Python | 1 |
aligned address <= original address
"""
return ea
# Overridden base function
def isLegalInsn(self, line):
"""Check if the given code line represents a legal instruction.
Args:
line (sark line): sark code line
Return Value:
True iff all supporte... | Python | 1 |
res = merge_option::<&str>("test", None, None, None, None, true);
assert!(res.is_err());
}
}
use indexmap::IndexMap;
use serde::{Deserialize, Serialize};
/// This is the root document object for an example.
/// https://github.com/Azure/azure-rest-api-specs/blob/master/documentation/x-ms-examples.md
/// ht... | Rust | 0 |
let uref = random_uref_key(&mut rng, AccessRights::READ);
let known_urefs = extract_access_rights_from_keys(vec![uref]);
let query_result = test(known_urefs, |mut rc| {
let base_key = rc.base_key();
let uref_name = "NewURef".to_owned();
let named_key = Value::NamedKey... | Rust | 0 |
import pika, time
def publish(body):
connection = pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
channel = connection.channel()
channel.queue_declare(queue='bingx')
channel.basic_publish(exchange='', routing_key='bingx', body=body)
print(" [x] Sent 'Hello World!'")
con... | Python | 1 |
)
aliases = [row[0] for row in cursor.fetchall()]
cursor.execute("SELECT key, value FROM fields WHERE contact_id = ?", (contact_id,))
fields_dict = {row[0]: row[1] for row in cursor.fetchall()}
result = {
"id": contact_id,
"aliases": alia... | Python | 1 |
x00&\xf4\x15=\xc9\x18\xef\
G~\x14\xd9f7&\xf3}\xac\xf8\x90\xd5P\x90s\
Hf\xb7\x13\xc1\xb3\xf7\xf7\x830\x03\xd9\xaeT\x07\xa1\
\x88^\x08\xe6\x85!\xa3f\x03\xad\xe6\xea\xef\x02\xb4\x81\
\xe5\xc5\xb40\x8c\xbd\xb8\xecT\x19\x12#\xd9\xb6\x0er\
\x9a\xb5\xdc\x88\x86\xe2t=\xcb^\x9c\x89\xa11R\x88\
O\xf8b\xa3b\x8a6\x1dF\x8e\x8dw\x97\... | Python | 1 |
nPrint => match order.direction {
Direction::Asc => query = query.order(dsl::issn_print.asc()),
Direction::Desc => query = query.order(dsl::issn_print.desc()),
},
SeriesField::IssnDigital => match order.direction {
Direction::Asc => query = query.o... | Rust | 0 |
, Self::R::make_elseif_clause(arg0, arg1, arg2, arg3, arg4))
}
fn make_else_clause(s: State::T, arg0 : Self::R, arg1 : Self::R) -> (State::T, Self::R) {
let s = State::next(s, vec![&arg0, &arg1]);
(s, Self::R::make_else_clause(arg0, arg1))
}
fn make_alternate_if_statement(s: State::T, ... | Rust | 0 |
wait_for_drivers(&instance, &DRIVERS_TO_WAIT_ON).await?;
let device_infos = get_device_info(&driver_dev, &DEVICE_FILTER).await?;
let device_nodes = test_utils::create_device_topology(device_infos);
assert_eq!(device_nodes.len(), 1);
let root_sys_test = &device_nodes[0];
assert_eq!(
root_s... | Rust | 0 |
let iter = self.chunk_slice(slice);
thread::spawn(move || {
for chunk in iter {
// If we are here, and sending to the channel fails, we have no sensible way to
// recover, as we have lost communication with the outside world
block_on(input.sen... | Rust | 0 |
istance(x, y, *ax, *ay);
((*ax, *ay), angle, distance)
})
.sorted_by(|(_, ang1, dist1), (_, ang2, dist2)| {
// We need to sort by angle, then by distance
if ang1 == ang2 {
Ord::cmp(dist1, dist2)
} else {
... | Rust | 0 |
[`GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR`]
/// * [`GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6`]
/// * [`GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR`]
/// * [`GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8`]
/// * [`GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR`]
/// * [`GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC`]
/// * [`GL_COMPRESSED_SRGB8_ETC2`]
//... | Rust | 0 |
ase state
missing_items = db.session.query(Inventory).filter(
(Inventory.MSDS == None) | (Inventory.MSDS == "")
).all()
assert len(data) == len(missing_items)
def test_get_missing_msds_no_missing_items(client):
"""
Test retrieving all inventory items missing an MSDS URL when none are missi... | Python | 1 |
[1., 0., 0.],
]);
let K: Array1<f64> = arr1(&[1., 0.3, 0.5]);
let param_opt: Array1<f64> = arr1(&[0., -0.524869316, 0.487525860]);
let param_init: Array1<f64> = arr1(&[0.0, 0.0, 0.0]);
MaxEntropy {
F,
K,
param_opt,
param... | Rust | 0 |
b>> {
let len = self.string.len();
if buf.len() >= len && &buf[..len] == self.string {
*buf = &buf[len..];
Ok(self.string)
} else {
Err(ParseError {
position: slice_some(buf),
})
}
}
}
/// 解析指定字符串
pub fn string(expected:... | Rust | 0 |
from abc import ABC, abstractmethod
import queue
class AbstractGraph:
@abstractmethod
def connnect(self, x, y):
pass
@abstractmethod
def get_adjacent_nodes(self, x):
pass
def find_path_bfs(self, source, target):
visited = [-1 for _ in range(self.num_nodes)]
... | Python | 1 |
from typing import List, Union
from app import db
from sqlalchemy import text
from sqlalchemy.engine.row import Row
ARXIV_ENDPOINT_ID = "ca8f8d56758a80a4f86"
def query_pmh_record_by_arxiv_id(arxiv_id: str) -> List[Row]:
arxiv_id_short = arxiv_id.split(":")[-1]
pmh_id = f"oai:arXiv.org:{arxiv_id_short}"
s... | Python | 1 |
ltage| {
let number_of_arrangements =
sum_possible_arrangements(*possible_joltage, adapters, memo);
memo.insert(*possible_joltage, number_of_arrangements);
number_of_arrangements
})
.sum();
results
}
fn find_distinct_possible_adapter_arrangements... | Rust | 0 |
self.base.inner().title_bar_size();
border_g.origin.x -= edge_thickness as i32;
border_g.origin.y -= edge_thickness as i32;
border_g.origin.y -= title_size as i32;
border_g.size.w += thickness;
border_g.size.h += thickness;
border_g.size.h += title_size;
self.ba... | Rust | 0 |
d `call` module.
//!
use std::collections::HashMap;
use actix_web::http::StatusCode;
use actix_web::web;
use num::BigInt;
use crate::contract::Contract;
use crate::database::model;
use crate::error::Error;
use crate::response::Response;
use crate::storage::Storage;
use zksync_types::Address;
///
/// The HTTP request... | Rust | 0 |
is(frame, bbox, landmarks_mem, get_detail=True) # TODO: 添加功能
# ################################################ 转头的yolo判断
# side_results = side_model(frame)
# side_boxes = side_results[0].boxes
#
# # 获取所有类别
# side_classes = side_boxes.cls
# # 获取所有的置信... | Python | 1 |
from alttpr.scanners import DunkaScanner
from alttpr.config_dunka_compact_tests import ITEMTRACKER_POINTS, LIGHTWORLD_MAP_POINTS, DARKWORLD_MAP_POINTS
from alttpr.config_dunka_compact_tests import ITEMTRACKER_BOX, LIGHTWORLD_MAP_BOX, DARKWORLD_MAP_BOX
from alttpr.utils import pprint
import os
def main():
# Exampl... | Python | 1 |
}
}
impl R {
#[doc = "Bits 8:15 - Analog watchdog high threshold flag"]
#[inline(always)]
pub fn awhtf(&self) -> AWHTF_R {
AWHTF_R::new(((self.bits >> 8) & 0xff) as u8)
}
#[doc = "Bits 0:7 - Analog watchdog low threshold flag"]
#[inline(always)]
pub fn awltf(&self) -> AWLTF_R {
... | Rust | 0 |
prefix_and_length("terravalconspub", tendermint_public_key, len)
.and_then(|vu5| {
let vu8 = Vec::from_base32(vu5.as_slice()).map_err(|source| {
TerraRustAPIError::Conversion {
key: tendermint_public_key.into(),
... | Rust | 0 |
loader in enumerate(train_loaders):
for X_batch, y_batch in loader:
print(f"\nTraining Loader {idx+1} - Input Batch Shape: {X_batch.shape}") # (100, 4, 20)
print(f"Training Loader {idx+1} - Label Batch Shape: {y_batch.shape}") # (100,)
break # Only one batch per loader
# Verify the sha... | Python | 1 |
rl-C handler");
// Start the stream pipeline
println!("Streaming {} to {}:{}... (Use Ctrl-C to end stream)", device, ip, port);
pipeline
.set_state(gst::State::Playing)
.expect("Unable to set the pipeline to the `Playing` state");
let bus = pipeline.get_bus().unwrap();
for msg in bu... | Rust | 0 |
# WAP to print 2nd and 3rd character of string.
str = "Python is very esey programming language"
print(str[1:3])
# WAP to print length and last character of string.
str1 = "Python is very esey programming language"
print(len(str1),str1[39])
# WAP to print 4 multiline string.
str2 = "\nPython is very esey programming ... | Python | 1 |
pub fn parallel(&self) -> i8 {
self.0.parallel as c_int as i8
}
}
impl_PartialEq_repr_fields!(Tms320c64xInsnDetail<'a> [ 'a ];
is_condition_zero, condition_reg, functional_unit, functional_unit_side,
functional_unit_cross_path, parallel
);
/// TMS320C64X operand
#[derive(Clone, Debug, Eq, PartialE... | Rust | 0 |
async fn index_ws(
schema: web::Data<DvSchema>,
req: HttpRequest,
payload: web::Payload,
) -> Result<HttpResponse> {
WSSubscription::start_with_initializer(Schema::clone(&*schema), &req, payload, |value| async {
#[derive(serde_derive::Deserialize)]
struct Payload {
token: S... | Rust | 0 |
end")(fn)
def skipHPU(fn):
return skipHPUIf(True, "test doesn't work on HPU backend")(fn)
def skipPRIVATEUSE1(fn):
return skipPRIVATEUSE1If(True, "test doesn't work on privateuse1 backend")(fn)
# TODO: the "all" in the name isn't true anymore for quite some time as we have also have for example XLA and MP... | Python | 1 |
handles_to_values.iter().map(|(h, e)| (h, &e.data))
}
/// Iterate over mutable entries in the constant pool in insertion order.
pub fn entries_mut(&mut self) -> impl Iterator<Item = &mut ConstantPoolEntry> {
self.handles_to_values.values_mut()
}
/// Return the number of constants in the po... | Rust | 0 |
"""Codec for serializing and deserializing a hash field with a width
of 192 bits (24 bytes).
`See Hash Fields <https://xrpl.org/serialization.html#hash-fields>`_
"""
from __future__ import annotations
from typing import Type
from typing_extensions import Self
from xrpl.core.binarycodec.types.hash import Hash
HASH1... | Python | 1 |
as usize) % circular_list_len];
range.push(val);
}
for index in cur_pos..(cur_pos + length) {
circular_list[(index as usize) % circular_list_len] = range.pop().unwrap();
}
cur_pos = (cur_pos + length + cur_skip_size) % circular_list_len;
cur_skip_size +=... | Rust | 0 |
= 'InstrumentID' #产品代码, char[31]
self.QuoteCurrencyID = 'CurrencyID' #报价币种类型, char[4]
self.ExchangeRate = '' #汇率, double
class QryProductExchRate(BaseStruct): #产品报价汇率查询
def __init__(self, ProductID=''):
self.ProductID = 'InstrumentID' #产品代码, char[31]
class MarketData(BaseStruct): #市场行情
... | Python | 1 |
# src/metrics/league_metrics.py
import pandas as pd
import numpy as np
def add_advanced_metrics(df):
"""
Aggiunge metriche calcolate che descrivono lo stile di gioco di una squadra.
"""
df_new = df.copy()
# --- METRICHE DI STILE ---
if 'Total Passes' in df_new.columns and 'Successful Dribbles'... | Python | 1 |
T: Ord
+ Add<Output = T>
+ AddAssign
+ Sub<Output = T>
+ SubAssign
+ Copy,
{
match change {
Change::Inc => {
base += delta;
if base > max {
max
} else {
... | Rust | 0 |
e_args_2 = BTreeMap::new();
runtime_args_2.insert(String::from("bar"), CLValue::from_t("Foo").unwrap());
runtime_args_2.insert(String::from("foo"), CLValue::from_t(1i32).unwrap());
runtime_args_2.insert(String::from("qwer"), CLValue::from_t(Some(1i32)).unwrap());
assert_eq!(tagless, run... | Rust | 0 |
{
let f: &&(Fn(&P, &cairo::Context) -> Inhibit + 'static) = transmute(f);
f(&Widget::from_glib_borrow(this).downcast_unchecked(), &from_glib_borrow(cr)).to_glib()
}
unsafe extern "C" fn enter_notify_event_trampoline<P>(this: *mut ffi::GtkWidget, event: *mut gdk_ffi::GdkEventCrossing, f: glib_ffi::gpointer) ->... | Rust | 0 |
".to_string())
.spawn(move || bindgen_grpc(&f))
.unwrap()
.join()
.unwrap();
}
println!(
"cargo:rustc-env=BINDING_PATH={}",
file_path.to_str().unwrap()
);
}
fn main() {
println!("cargo:rerun-if-changed=grpc_wrap.cc");
println!("cargo:... | Rust | 0 |
import datetime
import time
from selenium.webdriver.common.by import By
from selenium.webdriver.chrome.options import Options
from selenium import webdriver
import cv2
def Init():
ch_options = Options()
ch_options.add_argument("--headless")
global TargetTime
TargetTime = "2023-07-12 23:00:00.00000000" ... | Python | 1 |
on_weights[t, r] = \lambda_{t} w_{t, r}
# adaptive_weights转化为对角阵,矩阵相乘
# [[2 0 0] [[0 1 4] [[0 2 8]
# [0 2 0] * [1 0 1] = [2 0 2]
# [0 0 2]] [4 1 0]] [8 2 0]]
combined_adaptive_regularization_weights = np.matmul(np.diag(adaptive_weights), regularization_weights)... | Python | 1 |
.progress_percent.parse().unwrap_or(0_u8);
print_horizontal_line(&mut handle, Style::Top, len)?;
writeln!(
handle,
"{} {} {} {}",
VERTICAL_LINE,
media_type,
style(&session.full_title).bold().underlined(),
VERTICAL_LINE
)?;
print_horizontal_line(&mut handl... | Rust | 0 |
# -*- coding: utf-8 -*-
from PyQt4.QtCore import *
from PyQt4.QtGui import *
from facerec import recognize, train
from facerec import face
from camera import VideoStream
from configure import config, userManager
from soft_keyboard import *
import os
import cv2
try:
_fromUtf8 = QtCore.QString.fromUtf8
except At... | Python | 1 |
h custom kwargs, so we don't pass it in
criterion(concatenated, sparsity)
if sparsity > 0.0
else torch.ones_like(concatenated, dtype=torch.bool)
)
# Split the masks into chunks and compute the sparsity of each chunk
sizes = [t["tensor"].numel() for t in tensors.values()]
masks = ... | Python | 1 |
EW::_3_CLOCK_CYCLES => 3,
}
}
}
#[doc = r" Proxy"]
pub struct _S_MODEW<'a> {
w: &'a mut W,
}
impl<'a> _S_MODEW<'a> {
#[doc = r" Writes `variant` to the field"]
#[inline]
pub fn variant(self, variant: S_MODEW) -> &'a mut W {
{
self.bits(variant._bits())
}
}
... | Rust | 0 |
pi::value::*;
/// # use crate::libhaystack::c_api::number::*;
/// # unsafe {
/// let val = haystack_value_make_number(100.0);
/// # let val = Box::<Value>::leak(val);
/// assert!(haystack_value_is_number(val));
/// assert_eq!(haystack_value_get_number_value(val), 100.0);
/// # }
/// ```
/// # Safety
/// Panics on inval... | Rust | 0 |
::default();
Dec8Operation(Register::B).act(&mut state).unwrap();
assert!(state.cpu.has_flag(Flags::SUBTRACTION));
}
#[test]
fn it_should_set_the_half_carry_flag() {
let mut state = State::default();
state.cpu.set(Register::B, 0x10);
... | Rust | 0 |
use std::fmt;
use base64 as bs64;
use crypto::hashes::sha::SHA256_LEN;
use prost::{bytes::BytesMut, DecodeError, EncodeError, Message};
use crate::{local::salt::Salt, proto, request::Request};
#[derive(Clone)]
pub(crate) struct PeeringRequest {
timestamp: u64,
salt: Salt,
}
impl PeeringRequest {
pub(c... | Rust | 0 |
<div class="metric">
<span>代码质量</span>
<span class="metric-value">78.5</span>
</div>
<div class="metric">
<span>安全评分</span>
<span class="metric-value">85.3</span>
</div>
... | Python | 1 |
import tkinter as tk
from tkinter import filedialog as fd
from tkinter import messagebox as mb
from tkinter.scrolledtext import ScrolledText
class Tela:
def __init__(self, master):
self.janela = master
self.btn = tk.Button(self.janela, text='Abrir Arquivo')
self.btn.bind('<Button-1>', self.a... | Python | 1 |
torrent_task = self.__convert_torrent_info_to_task(torrent)
torrent_tasks[torrent_hash] = torrent_task
added_tasks.append(torrent_task)
logger.info(f"站点 {torrent_task.get('site_name')},"
f"刷流任务种子加入:{torrent_tas... | Python | 1 |
体
#-----------------------------------------#
rpn_scores = self.score(x)
rpn_scores = rpn_scores.permute(0, 2, 3, 1).contiguous().view(n, -1, 2)
#--------------------------------------------------------------------------------------#
# 进行softmax概率计算,每个先验框只有两个判别结果
# 内部... | Python | 1 |
::mr() * K::nr());
let mut v = c.to_vec();
let mut c = mmm_stride_storage(&mut v, K::nr());
let mut ops = ops.to_vec();
ops.insert(0, FusedKerSpec::AddC);
ops.push(FusedKerSpec::Done);
let err = K::kernel(&MatMatMulKerSpec {
a: &nul... | Rust | 0 |
ocation proof and validate the given key ownership proof
/// against the extracted offender. If both are valid, the offence
/// will be reported.
#[weight = T::WeightInfo::report_equivocation(key_owner_proof.validator_count())]
fn report_equivocation(
origin,
equivocation_proof: EquivocationProof<T::Hash,... | Rust | 0 |
# This file is part of Buildbot. Buildbot is free software: you can
# redistribute it and/or modify it under the terms of the GNU General Public
# License as published by the Free Software Foundation, version 2.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without eve... | Python | 1 |
na5Base {
fn arbitrary<G: Gen>(g: &mut G) -> Self {
let rand = g.next_u32();
Dna5Base(match rand % 5 {
0 => b'A',
1 => b'C',
2 => b'G',
3 => b'T',
4 => b'N',
_ => unreachable!(),
})
}
fn shrink(&self) -> Box<It... | Rust | 0 |
,label,'img') + prototype(skt_p,label,'skt')
loss = tri_loss + cls_loss + ca_loss
if stage>1:
skt_old = model_old(sketches,'sk').detach()
img_old = model_old(images,'im').detach()
# matrix_new = skt_fea @ img_fea.T
# matrix_old =... | Python | 1 |
"(gint) GST_ITERATOR_ITEM_END", "2"),
("(gint) GST_ITERATOR_ITEM_PASS", "1"),
("(gint) GST_ITERATOR_ITEM_SKIP", "0"),
("(gint) GST_ITERATOR_OK", "1"),
("(gint) GST_ITERATOR_RESYNC", "2"),
("(gint) GST_LEVEL_COUNT", "10"),
("(gint) GST_LEVEL_DEBUG", "5"),
("(gint) GST_LEVEL_ERROR", "1"),
... | Rust | 0 |
ve(os.path.join('./local_explain_result', str(i1), 'original_image_act.jpg'), feature_maps_c_sali_maps)
plt.imsave(os.path.join('./local_explain_result', str(i1), 'I_prototype.jpg'), I_prototype)
plt.imsave(os.path.join('./local_explain_result', str(i1), 'I_prototype_mask.jpg'), I_prototype_mask)
... | Python | 1 |
ware/camera2/CameraMetadata.html#SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB)
pub const SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGB : i32 = 4;
/// public static final [SENSOR_INFO_COLOR_FILTER_ARRANGEMENT_RGGB](https://developer.android.com/reference/android/hardware/camera2/CameraMetadata.html#SENSOR_INFO_C... | Rust | 0 |
num_covered) / float(len(model.graph.node))))
# Iterate through attrs, print
f.write('<details>\n')
f.write('<summary>nodes</summary>\n\n')
for op in sorted(attrs):
f.write('<details>\n')
# Get total number of attributes for node schema
f.writ... | Python | 1 |
params),
"::",
stringify!(sq_thread_cpu)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<io_uring_params>())).sq_thread_idle as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(io_uring_params),
":... | Rust | 0 |
# -*- coding: utf-8 -*-
''' Home made test.'''
from __future__ import print_function
__author__= "Luis C. Pérez Tato (LCPT)"
__copyright__= "Copyright 2014, LCPT"
__license__= "GPL"
__version__= "3.0"
__email__= "l.pereztato@gmail.com"
import math
import geom
import xc
from model import predefined_spaces
from materi... | Python | 1 |
let mut jv = Point::zeros();
jv[j] = j_sgn;
let kv = iv.cross(&jv);
*it.next().unwrap() = Transformation::from_columns(&[iv, jv, kv]);
}
}
}
}
let scanner_positions = vec![... | Rust | 0 |
shape": image shape after padding
- "img_norm_cfg": a dict of normalization information:
- mean - per channel mean subtraction
- std - per channel std divisor
- to_rgb - bool indicating if bgr was converted to rgb
Args:
keys (Sequence[str]): Keys of results to ... | Python | 1 |
#!/usr/bin/env python3
# chuk_mcp_math/arithmetic/comparison/__init__.py
"""
Comparison and Ordering Operations Module
Functions for comparing numbers, finding extrema, and handling floating-point precision issues.
Essential for decision making, sorting, and tolerance-based comparisons.
Submodules:
- relational: equa... | Python | 1 |
e-6) -> Tensor:
"""Calculate overlap between two set of boxes with their types
converted to ``HorizontalBoxes``.
Args:
boxes1 (:obj:`BaseBoxes`): BaseBoxes with shape of (m, box_dim)
or empty.
boxes2 (:obj:`BaseBoxes`): BaseBoxes with shape of (n, box_dim... | Python | 1 |
}
// fixed ascii vs fixed ascii
(PT::Char(lhs_bytes, Collation::Ascii), PT::Char(rhs_bytes, Collation::Ascii)) => {
match lhs_bytes.cmp(&rhs_bytes) {
Ordering::Greater => cast_arg(&mut args[1], PT::Char(lhs_bytes, Collation::Ascii)),
Ordering::Less => cast_... | Rust | 0 |
cy = t + &h / 2.0;
let cx = l + &w / 2.0;
Self { cy, cx, h, w }
}
}
impl<T, U> TryFrom<&CyCxHWTensor> for Vec<CyCxHW<T, U>>
where
T: Float,
U: Unit,
{
type Error = Error;
fn try_from(from: &CyCxHWTensor) -> Result<Self, Self::Error> {
let bboxes: Option<Vec<_>> = izip!(
... | Rust | 0 |
, git2::Error> {
let obj = repo.head()?.resolve()?.peel(ObjectType::Commit)?;
obj.into_commit()
.map_err(|_| git2::Error::from_str("Couldn't find commit"))
}
fn add_and_commit(repo: &Repository, path: &Path, message: &str) -> Result<Oid, git2::Error> {
let mut index = repo.index()?;
index.add_p... | Rust | 0 |
always)]
pub fn edacen(&self) -> EDACEN_R {
EDACEN_R::new((self.bits & 0x00ff_ffff) as u32)
}
}
impl W {
#[doc = "Bits 25:31 - 31:25\\]
Internal. Only to be used through TI provided API."]
#[inline(always)]
pub fn reserved25(&mut self) -> RESERVED25_W {
RESERVED25_W { w: self }
}... | Rust | 0 |
#==========================================================================
#
# Copyright NumFOCUS
#
# 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
#
# https://www.apache.org/... | Python | 1 |
b mod interrupt;
pub mod mailbox;
pub mod mini_uart;
pub mod pwm;
pub mod qa7_control;
pub mod timer;
<gh_stars>1-10
use crate::commands::to_delimited_data::to_delimited_data;
use crate::commands::WholeStreamCommand;
use crate::prelude::*;
use nu_errors::ShellError;
use nu_protocol::Signature;
pub struct ToTSV;
#[der... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.