text string | label_name string | labels int64 |
|---|---|---|
return confidence value for each location
/// ## Parameters
/// * img: Matrix of the type CV_8U or CV_8UC3 containing an image where objects are detected.
/// * locations: Vector of Point
/// * foundLocations: Vector of Point where each Point is detected object's top-left point.
/// * confidences: confidences
//... | Rust | 0 |
# n, m, k = data.shape
# data_reshape = data.reshape((n*m, k))
# data_reshape = min_max_scaler.fit_transform(data_reshape)
# data = data_reshape.reshape((n, m, k))
# return data
#
# min_max_scaler = preprocessing.MinMaxScaler()
# # min_... | Python | 1 |
532},
{0x265e095ec1aa0f5f, "4tg0krq1p87p", -57.572304925, -63.085916506},
{0x3403f04e5e875f66, "6h1z0mkyhxgq", -21.2396195, -87.521355399},
{0x667d4665071f43de, "dtyndt873x1x", 33.51713725, -58.952226683},
{0x45a4df5ae7d6f02c, "8qkeyqr7uvs2", 35.850435317, -162.137050721},
{0x091... | Rust | 0 |
/// inp: `&VipsImage` -> Image to save
/// filename: `&str` -> Filename to save to
pub fn matrixsave(inp: &VipsImage, filename: &str) -> Result<()> {
unsafe {
let inp_in: *mut bindings::VipsImage = inp.ctx;
let filename_in: CString = utils::new_c_string(filename)?;
let vips_op_response = ... | Rust | 0 |
={}", child_pid, waited_pid);
Ok(child)
},
other => Err(
std::io::Error::new(
ErrorKind::Other,
format!("Got incorrect child status: {:?}", other),
))
}
}
fn pin_process_to_cpu(pid: u32, cpu: u16) {
let mut cpuset = CpuSet::new... | Rust | 0 |
20
static V1_29: [u64; 42] = [
0x48a9e2, 0x9cf043, 0x155ca30, 0x18f4783, 0x248f86c, 0x2629a64, 0x5bad752, 0x72e3569,
0x93db760, 0x97d3b37, 0x9e05670, 0xa315d5a, 0xa3571a1, 0xa48db46, 0xa7796b6, 0xac43611,
0xb64912f, 0xbb6c71e, 0xbcc8be1, 0xc38a43a, 0xd4faa99, 0xe018a66, 0xe37e49c, 0xfa975fa,
0x11786035, 0x124... | Rust | 0 |
::Yellow => apply_color(x, &ConfigColor::Yellow),
ConfigColumnStyle::Blue => apply_color(x, &ConfigColor::Blue),
ConfigColumnStyle::Magenta => apply_color(x, &ConfigColor::Magenta),
ConfigColumnStyle::Cyan => apply_color(x, &ConfigColor::Cyan),
ConfigColumnStyle::White => apply_color(x, ... | Rust | 0 |
ound its center.
let main_result = close_off_polygon(Pt2D::approx_dedupe(endpoints, Distance::meters(0.1)));
let mut deduped = main_result.clone();
deduped.pop();
deduped.sort_by_key(|pt| pt.to_hashable());
deduped = Pt2D::approx_dedupe(deduped, Distance::meters(0.1));
let center = Pt2D::center(... | Rust | 0 |
operties to make a distinction between
/// properties and methods. However, the property/method distinction is little more than a
/// convention. A method is simply a property that can be called (for example, if it has a
/// reference to a Function instance as its value).
///
/// More information:
/// - [ECMAScript re... | Rust | 0 |
(expected)
actual, _ = expr.outputReducer(reducer).__teal__(options)
actual.addIncoming()
actual = pt.TealBlock.NormalizeBlocks(actual)
with pt.TealComponent.Context.ignoreExprEquality():
assert actual == expected
@pytest.mark.parametrize(
"op",
[
pt.Op.app_global_get_ex,
... | Python | 1 |
_owner, group_for_function)
members = group_for_function.members.list()
assert len(members) == 3
for member in members:
if member.username == f"{users_for_function[0].username}":
assert member.access_level == AccessLevel.DEVELOPER.value # only developer now
... | Python | 1 |
e, self)
shortcut_button.url = url
view = QWebEngineView()
view.load(QUrl(url))
view.iconChanged.connect(lambda icon, button=shortcut_button: button.setIcon(icon))
shortcut_button.triggered.connect(lambda: self.tabs.currentWidget().setUrl(QUrl(url)))
shortcut_button.trigg... | Python | 1 |
import uuid
import json
from typing import Optional, List
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy import select, func
from sqlalchemy.dialects.mysql import JSON as MySQLJSON
from app.infra.models.keyword_models import XhsKeywordGroup
from app.utils.logger import app_logger as logger
from app.con... | Python | 1 |
AST_QUERIER_INTVL: u16 = constants::IFLA_BR_MCAST_QUERIER_INTVL as u16;
pub const IFLA_BR_MCAST_QUERY_INTVL: u16 = constants::IFLA_BR_MCAST_QUERY_INTVL as u16;
pub const IFLA_BR_MCAST_QUERY_RESPONSE_INTVL: u16 = constants::IFLA_BR_MCAST_QUERY_RESPONSE_INTVL as u16;
pub const IFLA_BR_MCAST_STARTUP_QUERY_INTV... | Rust | 0 |
# ***************************************************************************
# * Copyright (c) 2021-2025 David Carter <dcarter@davidcarter.ca> *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it... | Python | 1 |
s clouds in Landsat 8 imagery.
# maskClouds = function(image) {
# scored = ee.Algorithms.Landsat.simpleCloudScore(image)
# return image.updateMask(scored.select(['cloud']).lt(20))
# }
# # This function masks clouds and adds quality bands to Landsat 8 images.
# addQualityBands = function(image) {
# return maskClo... | Python | 1 |
stream_type, e)),
}
}
Ok(descriptors)
}
}
impl PiiAttachmentsProcessor<'_> {
/// Applies PII rules to the given minidump.
///
/// This function selectively opens minidump streams in order to avoid destroying the stack
/// memory required for minidump processing. It visi... | Rust | 0 |
import argparse
import os
import json
from pathlib import Path
from typing import List
from tqdm import tqdm
import numpy as np
from PIL import Image
import cv2
import torch
from torchvision import transforms
import library.model_util as model_util
import library.train_util as train_util
DEVICE = torch.device("cuda"... | Python | 1 |
from collections import Counter
class Solution(object):
def pathSum(self, root, sum):
def helper(node, sum_from_root, record):
sum_from_root += node.val
sum_to_p = sum_from_root-sum
self.ans += record[sum_to_p]
record[sum_from_root] += 1 #1
if no... | Python | 1 |
<a href="https://www.trading212.com" target="_blank" style="color: #00D4AA; text-decoration: none; font-weight: 600;">
📱 Trading 212
</a>
<p style="color: #ddd; margin: 5px 0; font-size: 0.9rem;">Commission-free trading</p>
</div>
... | Python | 1 |
path (relative to the main script) or an st.Page indicating
the page to switch to. Alternatively, this can be the URL to an
external page (must start with "http://" or "https://").
label : str
The label for the page link. Labels are required for external pages.
T... | Python | 1 |
id);
let versions = serde_json::to_value(versions).expect("Could not serialize versions");
let (tx_core_to_api, mut rx_core_to_api) = futures::channel::mpsc::unbounded();
let (tx_api_to_core, rx_api_to_core) = futures::channel::mpsc::unbounded();
{
/* Spawn the main loop */
let appid = ... | Rust | 0 |
"].f32_()?,
},
rating: etterna::Skillsets8 {
overall: json["attributes"]["user"]["Overall"].f32_()?,
stream: json["attributes"]["skillsets"]["Stream"].f32_()?,
jumpstream: json["attributes"]["skillsets"]["Jumpstream"].f32_()?,
handstream: json["attributes"]["skillsets"]["Handstream"].f... | Rust | 0 |
('隣', "lín"),
('隤', "tuí"),
('隥', "dèng"),
('隦', "jiǎo,pí"),
('隧', "suì,zhuì"),
('隨', "suí"),
('隩', "ào,yù"),
('險', "xiǎn,jiǎn,yán"),
('隫', "fén"),
('隬', "nǐ"),
('隭', "ér"),
('隮', "jī"),
('隯', "dǎo"),
('隰', "xí,xiè"),
('隱', "yǐn,yìn"),
('隲', "zhì"),
('... | Rust | 0 |
::Expr),
DSpecial(Special),
}
impl Dval_ {
pub fn is_special(&self) -> bool {
matches!(self, Dval_::DSpecial(_))
}
}
pub type Dval = Arc<Dval_>;
unsafe impl Send for Dval_ {}
unsafe impl Sync for Dval_ {}
#[derive(Debug)]
pub enum DType {
TList(Arc<DType>),
TLambda,
TBool,
NamedType(String),
}
im... | Rust | 0 |
se frame transmission of priority 2."]
#[inline(always)]
pub fn quantp2(&self) -> QUANTP2_R { QUANTP2_R::new((self.bits & 0xffff) as u16) }
#[doc = "Bits 16:31 - Transmit pause quantum - written with the pause quantum value for pause frame transmission of priority 3."]
#[inline(always)]
pub fn quant... | Rust | 0 |
# 문제 풀이
n = int(input())
for i in range(2 * n + 1):
for j in range(2 * n + 1):
if i % 2 == 0 or j % 2 == 0:
print("*", end = " ")
else:
print(" ", end = " ")
print()
# n = 5
# 처음에 생각한 규칙 (첫행과 마지막행에 *을 출력하고, 그렇지 않은 행은 다르게)
# for i in range(n):
# if i == 0 or i == (... | Python | 1 |
expr.into()
}
}
});
// for when you call Builder::build
let build_fields = fields.iter().map(|f| {
let name = &f.ident;
if ty_inner_type("Option", &f.ty).is_some() || builder_of(f).is_some() {
quote! {
#name: self.#name.clone()... | Rust | 0 |
open(path, "rb")
else:
continue
with file:
alias = self.writeResource(file, obj.filepath, object_uniqpath(obj))
engine.report({'INFO'}, "Successfully bundled {} resource {} = {}".... | Python | 1 |
dead: false,
jumping: false,
grounded: false,
collision: None,
}
}
}
pub fn init(
commands: &mut Commands,
materials: &mut ResMut<Assets<ColorMaterial>>,
asset_server: AssetServer,
) {
let texture_on = asset_server.load("sprites/player_on.png");
... | Rust | 0 |
e for Disabled {
fn disabled(&self) -> bool {
self.disabled
}
}
/// Unused marker trait to enable #[derive(AppConfig)].
pub trait AppConfig {}
<filename>examples/landing_pages.rs
///
/// Dependencies:
///
/// # This library is meant to be used on development or testing environments
/// # in which setti... | Rust | 0 |
ame:
print('/' + '/'.join(path))
pos += 4 + roundup4(len(node.name) + 1)
pos = enum_fdt_nodes(img, hdr, pos, target_path, target_name, res, path)
if pos == 0:
return 0 # EOF
continue
if tag == FDT_PROP:
prop = fdt_prope... | Python | 1 |
from django.db import models
from django.core.urlresolvers import reverse
class Category(models.Model):
name = models.CharField(max_length=200, db_index=True)
slug = models.SlugField(max_length=200, db_index=True, unique=True)
class Meta:
ordering = ('name',)
verbose_name = 'category'
... | Python | 1 |
ix` - Correlation matrix (dimensions: num_var x num_var)
///
/// # Returns
///
/// Matrix in vector form (row by row) of dimensions: sample_size x num_var
/// To retrieve variable j for sample i in the matrix: matrix[i*num_var+j]
pub fn simulate_normal_variates(num_var:usize, sample_size:usize, correlation_matrix: &... | Rust | 0 |
ptr::null_mut()
}
}
}
#[cfg(any(ossl101, ossl102))]
pub unsafe extern "C" fn raw_tmp_ecdh_ssl<F>(
ssl: *mut ffi::SSL,
is_export: c_int,
keylength: c_int,
) -> *mut ffi::EC_KEY
where
F: Fn(&mut SslRef, bool, u32) -> Result<EcKey<Params>, ErrorStack> + 'static + Sync + Send,
{
let callba... | Rust | 0 |
from caffe2.python.models.seq2seq import seq2seq_model_helper
from caffe2.python import scope, test_util
class Seq2SeqModelHelperTest(test_util.TestCase):
def testConstuctor(self):
model_name = 'TestModel'
m = seq2seq_model_helper.Seq2SeqModelHelper(name=model_name)
self.assertEqual(... | Python | 1 |
ward_spacetodepth()
test_forward_reverse_sequence()
test_forward_sparse_to_dense()
test_forward_select()
test_forward_quantize_dequantize()
test_forward_arg_min_max()
test_forward_expand_dims()
test_forward_reverse_v2()
test_forward_matrix_set_diag()
test_forward_matrix_diag()
#... | Python | 1 |
action="store",
default=None,
dest="predicate",
help="Store the predicate. i.e. -p 'execname == \"launchd\"' will produce provider:module:function:name / execname == \"launchd\"")
parser.add_option("-a", "--action",
... | Python | 1 |
for x in range(0, 16):
if int('33', x+4) - int('33', 4) == int('33', 10):
print(x)
| Python | 1 |
"""Per-chunk summarization service (Step 5).
Responsibilities:
* Provide an async API to summarize a list of Chunk objects to ~20% length each.
* Use Markdown output requirement consistently.
* Leverage central length planning (validator.calculate_max_tokens) for token budgeting when explicit constraint supplied... | Python | 1 |
offsets as their native
/// u8 values.
#[cfg(memchr_runtime_simd)]
pub(crate) fn as_rare_ordered_u8(&self) -> (u8, u8) {
if self.rare1i <= self.rare2i {
(self.rare1i, self.rare2i)
} else {
(self.rare2i, self.rare1i)
}
}
/// Return the rare offsets as... | Rust | 0 |
# total
trainer_train_count = task_manager.get_trainer("train")
s += f",{trainer_train_count:>8s}tr"
s += f",{q_recv_count:8d}recv"
print(s)
# --- actor
for idx in range(actor_num):
aid = task_manager.get_actor(idx, "id")
... | Python | 1 |
ion.borrow().x
{ write!(out, "{:>w$} reduce {:<7}", self.symbols.array[action.borrow().symbol_index].name, self.rules[n_rule].index, w=indent)?;
Self::rule_print(out, &self.rules[n_rule], std::usize::MAX)?;
result = true;
}
}
ActionType::ShiftReduce =>
{ if let StateOrRule::Rule(n_rule)... | Rust | 0 |
IMM8 = 5))] //should be vpshldd
#[rustc_legacy_const_generics(3)]
pub unsafe fn _mm512_maskz_shrdi_epi32<const IMM8: i32>(
k: __mmask16,
a: __m512i,
b: __m512i,
) -> __m512i {
static_assert_imm8!(IMM8);
let shf: i32x16 = vpshrdvd(
a.as_i32x16(),
b.as_i32x16(),
_mm512_set1_ep... | Rust | 0 |
r word, freq in tf_dict.items():
if word in self.word_df_cache:
word_df = self.word_df_cache[word]
if word_df == 0:
continue
else:
query_df_sql = "select out(label2document).size() from label where name = '{}'".format(word)
... | Python | 1 |
<< OFFSET);
self.w.bits |= ((value & MASK) as u32) << OFFSET;
self.w
}
}
#[doc = "Values that can be written to the field `FTM3CLKSEL`"]
pub enum FTM3CLKSELW {
#[doc = "FTM3 external clock driven by TCLK0 pin."]
_00,
#[doc = "FTM3 external clock driven by TCLK1 pin."]
_01,
#[doc... | Rust | 0 |
t = beg;
*select = *caret;
*pip = adj_edge(caret);
}
Key::Delete if !readonly => {
let (beg, end) = caret_range(lines, *caret, *select);
let end = end.or_val(beg != end, setx(end, 1));
let (b, e) = range(beg, end, text);
let drained = text.str().drain(b..e);
... | Rust | 0 |
"""Support for Flick Electric Pricing data."""
import asyncio
from datetime import timedelta
import logging
from typing import Any
from pyflick import FlickAPI, FlickPrice
from homeassistant.components.sensor import SensorEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CURR... | Python | 1 |
import numpy as np
# filename = "high_priority_perf_governor.txt"
# filename = "higher_freq.txt"
filename = "std_sleep_2.txt"
# Load the timestamps from the file
with open(filename, "r") as file:
timestamps = np.array([float(line.strip()) for line in file])
# Calculate differences between sequential timestamps
... | Python | 1 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 13 19:14:51 2020
@author: mtslazarin
"""
# %% Importando bibliotecas
import pytta
import os
import time
import numpy as np
import copy as cp
import gc
# %% Muda o current working directory do Python para a pasta onde este script
# se encontra
cwd ... | Python | 1 |
{
super::generic::block_string(slice_storage(BLOCK_SIZE), pool_storage(PAGE_4K), 10, 1);
}
pub(super) fn full_no_realloc<'block, F, P, S>(slice_storage: F, pool_storage: P)
where
F: Fn(usize) -> S,
P: Fn(usize) -> S,
S: 'block + Storage<'block,... | Rust | 0 |
plorer700 {
expander: Box<Pcf8574<I2cdev>>,
}
impl Default for Explorer700 {
/// Creates a shield representation
///
/// # Panics
///
/// The builder function panics in case the hardware access fails
fn default() -> Self {
let i2cbus = I2cdev::new("/dev/i2c-1").expect("i2c-1 to be ... | Rust | 0 |
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
使用Moonshot API为视频创建标题的脚本
这个脚本将替代原始的标注脚本,使用Moonshot视觉API而不是本地模型
"""
import os
import sys
import json
import argparse
import time
from pathlib import Path
import requests
from PIL import Image
import cv2
from rich.console import Console
from rich.progress import (
B... | Python | 1 |
len)?;
self.write_word(f, map(thousands), len)?;
Ok(())
}
fn write_word(&self, f: &mut Fmt<'_>, word: &str, len: &mut usize) -> Result {
if *len > 0 {
f.write_str(" ")?;
*len += " ".len();
}
f.write_str(word)?;
*len += word.len();
... | Rust | 0 |
rged_df[merged_df['trial_id'] == 3].reset_index()
# import matplotlib.pyplot as plt
# # plt.plot(trial_i['frame_z_position'], label='position')
# plt.plot(trial_i['lick'], alpha=.5, label='lick')
# plt.plot(trial_i['reward'], alpha=.5, label='reward')
# plt.legend()
# plt.show()
# exit()
#... | Python | 1 |
too long"));
}
generated_powers.push(generated_powers.last().unwrap().mul(root));
}
Ok(generated_powers)
}<filename>runtime/src/items.rs
#![cfg_attr(not(feature = "std"), no_std)]
use sp_std::prelude::*;
use crate::{AccountId, BlockNumber};
pub const MAX_CLASS_METADATA: u32 = 1024;
pub cons... | Rust | 0 |
yn Shape,
light: PointLight,
point: Point,
eyev: Vector,
normalv: Vector,
in_shadow: bool,
) -> Color {
let color = match self.pattern.as_ref() {
Some(pattern) => pattern.pattern_at_object(object, point),
None => self.color,
};
... | Rust | 0 |
, 6.1, -8.5, 4.1, 1.3], dtype=np.float64)
/// stds = np.array([6.2, 5.3, 3.8, 3.2, 4.7], dtype=np.float64)
/// entropy_model1 = constriction.stream.model.QuantizedGaussian(-50, 50)
/// entropy_model2 = constriction.stream.model.Categorical(np.array(
/// [0.2, 0.5, 0.3], dtype=np.float64)) # Probabilities of ... | Rust | 0 |
te_with_zero`](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 avaliable fields see [apbspppcexp3](apbspppcexp3) module"]
pub type APBSPPPCEXP3 = crate::Reg<u32, _APBSPPPCEXP3>;
#[allow(missing_docs)]
... | Rust | 0 |
table = transmute::<VAddr, *mut PML4>(paddr_to_kernel_vaddr(pml4));
PageTable {
pml4: Box::into_pin(Box::from_raw(pml4_table)),
da: None,
}
}
/// Construct the driver object to manipulate the interrupt controller (XAPIC)
fn init_apic() -> x2apic::X2APICDriver {
let mut apic = x2apic::X2APIC... | Rust | 0 |
import logging
from pydantic import Field
from typing import List
import os
import json
from alibabacloud_cms20190101.client import Client as cms20190101Client
from alibabacloud_cms20190101 import models as cms_20190101_models
from alibaba_cloud_ops_mcp_server.alibabacloud.utils import create_config
END_STATUSES = ... | Python | 1 |
per class
for i in np.arange(precision.shape[1]):
index_sort = np.argsort(recall[:,i])
precision[:,i] = precision[index_sort,i]
recall[:,i] = recall[index_sort,i]
return precision, recall
def compute_mAP(precision, recall):
# Array for storing the AP per class
AP = np.array([... | Python | 1 |
the global
// allocator.
#[cfg(feature = "wee_alloc")]
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
fn default_font_details() -> FontDetails {
FontDetails::from_str("", "Arial")
}
fn default_font(params: &MouseClickParams) -> Rc<Font> {
let renderer = params.manager.get_... | Rust | 0 |
ilter.
"""
# Guarantee that the inputs are floats
w0 = float(w0)
Q = float(Q)
w0 = 2*w0/fs
# Checks if w0 is within the range
if w0 > 1.0 or w0 < 0.0:
raise ValueError("w0 should be such that 0 < w0 < 1")
# Get bandwidth
bw = w0/Q
# Normalize inputs
bw = bw*np.pi
... | Python | 1 |
, '10.10.10.10')
############################################################################
# Test plugin
############################################################################
# Bind as Root DN
if args is None:
_rootdn_restart(inst)
else:
with pytest.raises(ldap.LDAPErr... | Python | 1 |
self._ratio_clip, 1.0 + self._ratio_clip)
policy_loss = -torch.min(surrogate, surrogate_clipped).mean()
# compute value loss
predicted_values, _, _ = self.value.act({"obs": self._state_preprocessor(teacher_obs, train=not epoch)}, role="value")
if self._... | Python | 1 |
}
}
<gh_stars>0
pub mod state;
pub mod dom;
pub mod actions;
<reponame>bfsgr/rusty_gb<gh_stars>0
#![allow(non_snake_case)]
use super::interrupt::{*};
use super::bit_utils::{*};
use super::cpu::registers::{Response};
const OAM_SEARCH: usize = 80;
const TRANSFER_CYCLES: usize = 252;
const HBLANK_CYCLES: usize = 456;
co... | Rust | 0 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import random
eps = 1e-8
class Similarity(nn.Module):
"""
cosine similarity
"""
def __init__(self, temp=0.1):
super().__init__()
self.temp = temp
def forward(self, x, y):
x = x / (x.norm(dim=1, keepdim=Tr... | Python | 1 |
4/6R1/5PPP/5RK1 b - - 0 1",
"r4rk1/4bp2/1Bppq1p1/4p1n1/2P1Pn2/3P2N1/P2Q1PBK/1R5R b - - 0 1",
"4r1k1/pQ3pp1/7p/4q3/4r3/P7/1P2nPPP/2BR1R1K b - - 0 1",
"rnb1k2r/pp3ppp/1qp2B2/2bPp3/4P3/2N5/PPP3PP/R2QKBNR b KQkq - 0 1",
"r2r4/pp2ppkp/2P3p1/q1p5/4PQ2/2P2b2/P4PPP/2R1KB1R b - - 0 1",
"1b2r1k1/3n2p1/p3p2p/1... | Rust | 0 |
de: vec![0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa],
exception_table: vec![],
attributes: vec![]
};
let bytes = b"\x00\x01\x00\x00\x00\x16\x00\x00\x00\x00\x00\x00\x00\x0a\x11\x22\x33\x44\x55\x66\x77\x88\x99\xaa\x00\x00\x00\x00";
let constants = utf8_cons... | Rust | 0 |
.as_wire_message().write_to_bytes()?;
Ok(bytes)
}
/// Builds a wire message.
pub fn as_wire_message(&self) -> wire::CastMessage {
let mut message = wire::CastMessage::new();
message.set_protocol_version(PROTOCOL_VERSION);
message.set_source_id(self.source.0.clone());
... | Rust | 0 |
xporter in exporters]
set_tracer_provider(TracerProvider(resource=resource))
attach(set_value("workflow_name", workflow_name))
tracer_provider_default = trace.get_tracer_provider()
provider_type = type(tracer_provider_default).__name__
is_proxy_provider = "Proxy" in provider_type
for processor i... | Python | 1 |
an title="0.10393s from github-fe164-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></... | Python | 1 |
from pyrogram import filters
from pyrogram.types import Message
from TGNowPlaying import bot
from TGNowPlaying.tasks import task_scheduler
from TGNowPlaying.settings import settings
from TGNowPlaying.logging import LOGGER
"""
Start listening on a provider task.
cmd: /listen_on <provider>
"""
@bot.on_message(filters.co... | Python | 1 |
collect_vec();
let queue_handle = QueueHandle::new(stealers);
let workers = workers.into_iter().map(AtomicTake::new).collect_vec();
WorkerGroup::<T> {
queue_handle,
workers,
}
}
}
/// Static worker group registry as to batch loads across groups of thread local [`DataLoader`] instances
... | Rust | 0 |
reserved40: [u32; 3],
/// device endpoint-4 control register
pub OTG_FS_DOEPCTL4: RWRegister<u32>,
_reserved41: [u32; 1],
/// device endpoint-4 interrupt register
pub OTG_FS_DOEPINT4: RWRegister<u32>,
_reserved42: [u32; 1],
/// device OUT endpoint-4 transfer size register
pub OTG_FS... | Rust | 0 |
ne_add_with_extra_norm_args",
vec!["add_with_extra_norm_args", "add"],
&inline_add_with_extra_norm_args
);
unsafe {
let add_twice: libloading::Symbol<unsafe extern "C" fn(u64, u64, u64) -> u64> =
lib.get(b"add_with_extra_norm_args").unwrap();
let res = add_twice(1, ... | Rust | 0 |
ENCODING_GROUP: u32 = 14012;
pub const ERROR_SXS_UNKNOWN_ENCODING: u32 = 14013;
pub const ERROR_SXS_INVALID_XML_NAMESPACE_URI: u32 = 14014;
pub const ERROR_SXS_ROOT_MANIFEST_DEPENDENCY_NOT_INSTALLED: u32 = 14015;
pub const ERROR_SXS_LEAF_MANIFEST_DEPENDENCY_NOT_INSTALLED: u32 = 14016;
pub const ERROR_SXS_INVALID_ASSEMB... | Rust | 0 |
"keywords": ["performing", "arts", "theatre", "entertainment", "culture"]
},
"91020": {
"description": "Museum activities",
"keywords": ["museum", "cultural", "heritage", "exhibition"]
},
"93110": {
"description": "Operation of sports facilities",
"keywords": ["sports",... | Python | 1 |
T2);
define_tuple_transpose!(v0: T0, v1: T1, v2: T2, v3: T3);
define_tuple_transpose!(v0: T0, v1: T1, v2: T2, v3: T3, v4: T4);
define_tuple_transpose!(v0: T0, v1: T1, v2: T2, v3: T3, v4: T4, v5: T5);
define_tuple_transpose!(v0: T0, v1: T1, v2: T2, v3: T3, v4: T4, v5: T5, v6: T6);
define_tuple_transp... | Rust | 0 |
_rhs += dpos.scaled_axis() * stiffness;
}
}
if damping != 0.0 {
let curr_vel = rb2.angvel - rb1.angvel;
motor_rhs += (curr_vel - joint.motor_target_vel) * damping;
}
#[cfg(feature = "dim2")]
if stiffness != 0.0... | Rust | 0 |
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | Python | 1 |
nput.len()
}
fn dedup(input: &mut Vec<(usize, usize)>) {
let mut set = HashSet::new();
let mut remove = vec![];
for index in 0..input.len() {
let e = input[index];
if set.contains(&e) {
remove.push(index);
continue;
}
set.insert(e);
}
for ... | Rust | 0 |
auth as session_key FROM account a LEFT JOIN account_access aa ON a.id = aa.AccountID LEFT JOIN account_banned ab ON ab.id = a.id AND ab.active = 1 WHERE a.username = ? AND a.session_key_auth IS NOT NULL",
username
).fetch_one(&self.pool).await.map_err(|_| LoginFailure::DatabaseError)?;
le... | Rust | 0 |
def printc(texte,color="orange"):
colored_text = color_text(texte,color)
display(HTML(colored_text))
def nettoyer_chaine(chaine):
# Remplacer les espaces et tabulations multiples par un seul espace
chaine_propre = re.sub(r'\s+', ' ', chaine)
return chaine_propre
class SafeDict(dict):
def __mi... | Python | 1 |
r"Register block"]
#[repr(C)]
pub struct CH {
#[doc = "0x00 - Channel event end-point."]
pub eep: crate::Reg<self::ch::eep::EEP_SPEC>,
#[doc = "0x04 - Channel task end-point."]
pub tep: crate::Reg<self::ch::tep::TEP_SPEC>,
}
#[doc = r"Register block"]
#[doc = "PPI Channel."]
pub mod ch;
#[doc = "CHEN r... | Rust | 0 |
reader.read_u16::<BigEndian>()?; // reserved
let matrix = Matrix {
a: reader.read_i32::<byteorder::LittleEndian>()?,
b: reader.read_i32::<BigEndian>()?,
u: reader.read_i32::<BigEndian>()?,
c: reader.read_i32::<BigEndian>()?,
d: reader.read_i32::<BigEn... | Rust | 0 |
from django.contrib.auth.models import User
from django.db import models
class Installation(models.Model):
"""Установки на оборудование"""
to_equipment = models.ForeignKey(
to='equipments.Equipment',
related_name='%(class)ss',
on_delete=models.CASCADE,
verbose_name='Куда',
... | Python | 1 |
}
}
}
#[derive(PartialEq, Eq, Hash, Clone, Copy, Debug)]
struct Pos {
x: usize,
y: usize
}
impl Pos {
fn adjacent(&self) -> Vec<Pos> {
[(-1i32, 0i32), (0, -1), (1, 0), (0, 1)].iter()
.filter(|(mx, my)| !((self.x as i32 + mx) < 0) && !((self.y as i32 + my) < 0))
.map(|(m... | Rust | 0 |
v_scale,
b_start_loc,
b_seq_len,
v_cache.shape[3],
k_cache.shape[4],
o,
b_loc.stride(0),
b_loc.stride(1),
q.stride(0),
q.stride(1),
q.stride(2),
k.stride(0),
k.stride(1)... | Python | 1 |
# to ensure that test binaries can find the FlexiBLAS library
ld_library_path = ':'.join([
os.path.join(self.obj_builddir, 'lib'),
os.path.join(self.obj_builddir, 'lib64'),
'$LD_LIBRARY_PATH'
])
self.cfg['pretestopts'] = ('expor... | Python | 1 |
", ]),
("sports", &["⚽", "⚾", "🏀", "🏈", "🎾", ]),
("spring", &["🌸", ]),
("squid", &["🦑", ]),
("sri_lanka", &["🇱🇰", ]),
("st_barthelemy", &["🇧🇱", ]),
("st_helena", &["🇸🇭", ]),
("st_kitts_nevis", &["🇰🇳", ]),
("st_lucia", &["🇱🇨", ]),
("st_martin", &["🇲🇫", ]),
("st_pierre_miquelon", &["�... | Rust | 0 |
env = DynamicEnvironment::new();
let define_tool = dynamic_env.get_typed_tool("define-tool").unwrap();
// Then a static environment to copy our tool from
let new_env = StaticEnvironment::from_toolset(BasicToolSet::from(vec![
("test", make_pure_tool(|x: i32| x+1))
]), &Em... | Rust | 0 |
#db/requests/salle.py
"""Fonctions d'accès aux données des salles"""
from db.database import get_db_cursor
from typing import List, Dict, Any
def get_all_salles() -> List[Dict[int, Any]]:
"""Récupère toute les salles"""
with get_db_cursor() as cursor:
query = "SELECT * FROM salle"
cursor.exec... | Python | 1 |
that hasn't been used yet.
2. Assign indexes based on these rules:
a. If a match is found and the groundtruth index hasn't been used, assign that index.
b. If no match is found, or if all matching indexes have already been used, assign -1.
3. Always use the earliest matching index from the groundtruth l... | Python | 1 |
pub use crate::Resource;
/// Mutable reference to a resource.
pub struct RefMut<'a, R: 'a> {
inner: rt_map::RefMut<'a, Box<dyn Resource>>,
phantom: PhantomData<&'a R>,
}
impl<'a, R> fmt::Debug for RefMut<'a, R>
where
R: Resource + fmt::Debug + 'a,
{
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Resu... | Rust | 0 |
_case("[1.23.4] [5678 ] 1234-01-23 12:34:56.789 GMT+01:00 I abc: Log message\ncontinues here!" => LogEntry {
timestamp: FixedOffset::east(1 * 3600).ymd(1234, 1, 23).and_hms_milli(12, 34, 56, 789).to_string(),
level: Some(LogLevel::Info),
meta: PlatformMetadata::AndroidLogger { version: "1.23.4".... | Rust | 0 |
s=NumberButtons.TwoButton,
anchor_entity=1040531700,
display_distance=2.0,
left_flag=1040532141,
right_flag=1040532142,
cancel_flag=1040532142,
)
if FlagDisabled(1040532141):
Wait(1.0)
Restart()
OR_11.Add(PlayerHasGood(111))
GotoIfConditionTrue(Lab... | Python | 1 |
-> Self {
AsepriteCel {
x,
y,
opacity,
raw_cel,
}
}
}
/// The frames contained in an aseprite
pub struct AsepriteFrames<'a> {
aseprite: &'a Aseprite,
}
impl<'a> AsepriteFrames<'a> {
/// Get a range of frames
pub fn get_for(&self, range: &... | Rust | 0 |
, or deletes that
/// can be included in a write batch. If more than this number of writes are included, the
/// server cannot guarantee space in the response document to reply to the batch.
pub(crate) max_write_batch_size: i64,
}
impl StreamDescription {
/// Constructs a new StreamDescription from an... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.