text string | label_name string | labels int64 |
|---|---|---|
7", Fail(("main1_7", 3, "align")));
test_fileserver(&fileserver, "main2_1", Fail(("main2_1", 3, "align")));
test_fileserver(&fileserver, "main2_2", Fail(("main2_2", 3, "align")));
test_fileserver(&fileserver, "main2_3", Fail(("main2_3", 2, "invalid character")));
test_fileserver(&fileserver, "main2_4", Fail(("mai... | Rust | 0 |
43 => WU4_EVR::JTAG,
42 => WU4_EVR::RTC_UPD,
41 => WU4_EVR::RTC_COMB_DLY,
40 => WU4_EVR::RTC_CH2_DLY,
39 => WU4_EVR::RTC_CH1_DLY,
38 => WU4_EVR::RTC_CH0_DLY,
37 => WU4_EVR::RTC_CH2,
36 => WU4_EVR::RTC_CH1,
35 => WU4_EVR::R... | Rust | 0 |
sion.query(application).filter(application.c.Date_actual_deadline != None, application.c.Date_actual_deadline >= start_dat, application.c.Date_actual_deadline <= date, application.c.ID_Class_application == 4).count()
text += f"Количеcтво заявок по общей форме: <b>{countGener_App if countGener_App !=... | Python | 1 |
_job = habitat_builder_db::models::jobs::Job::get(job_id as _, &conn).unwrap();
// // Test the thing we inserted
assert_eq!(job_id, raw_job.id as u64);
assert_eq!(JobState::Pending,
raw_job.job_state.parse::<JobState>().unwrap());
assert_eq!(Some(job.get_channel().to_... | Rust | 0 |
neat!"));
sub_page.add(Label::new("Wouldn't you say?"));
sub_page.add(TextBox::new("Done now?", "input", "Enter yes to stop"));
page.add(sub_page);
page.render().unwrap();
}
<gh_stars>0
#[macro_use]
extern crate linear_map;
use linear_map::LinearMap;
use linear_map::Entry::{Occupied, Vacant};
const ... | Rust | 0 |
from libs.utils.config import Config
import torch.utils.data as data
from libs.dataset.openlane.perprocess import Preprocessing
def loadDataOL():
opt = Config.fromfile('./options4OL.py')
from libs.dataset.openlane.datasetOL import Dataset_TrainV1, multibatch_collate_fn
dataset = Dataset_TrainV1(cfg=opt.... | Python | 1 |
# [02] START: src/rag/engine_hash.py
from __future__ import annotations
import math
from dataclasses import dataclass
from hashlib import blake2b
from typing import Iterable, List, Tuple
from .engine import RagDoc, RagEngine, RagHit
_DIM = 256 # 고정 차원(결정적)
_SNIPPET_LEN = 160
def _tokenize(text: str) -> List[str]... | Python | 1 |
from enum import StrEnum
class ErrorCode(StrEnum):
INTERNAL_SERVER_ERROR = "A001"
LOGIN_ERROR = "A002"
UNAUTHORIZED = "A003"
FORBIDDEN_ROLE_ERROR = "A004"
CREATE_API_TOKEN_ERROR = "A005"
DELETE_API_TOKEN_ERROR = "A006"
REQUESTED_TOKEN_NOT_FOUND = "A007"
FIND_ALL_API_TOKENS_ERROR = "A00... | Python | 1 |
# Copyright 2023 The Google Earth Engine Community Authors
#
# 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/licenses/LICENSE-2.0
#
# Unless required by applicable... | Python | 1 |
}
}
}<reponame>zxscn/flatbuffers
/*
* Copyright 2018 Google 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/L... | Rust | 0 |
e, Copy, Debug, DeepSizeOf)]
pub struct Variant<'a>(pub ty::Expr<'a>, pub VariantType<'a>);
/// An argument declaration for a function.
pub type Arg<'a> = (ty::ArgAttr, ArgKind<'a>);
/// An argument declaration for a function.
#[derive(Debug, DeepSizeOf)]
pub enum ArgKind<'a> {
/// A standard argument of the form `... | Rust | 0 |
use DBusInterfaceInfo;
use DBusObject;
glib_wrapper! {
pub struct DBusInterface(Interface<gio_sys::GDBusInterface>);
match fn {
get_type => || gio_sys::g_dbus_interface_get_type(),
}
}
pub const NONE_DBUS_INTERFACE: Option<&DBusInterface> = None;
pub trait DBusInterfaceExt: 'static {
fn get... | Rust | 0 |
import numpy as np
from src.features.base import forward_fill
from src.config import cfg, td_usbr_sites, td_usgs_sites
def scale_prediction(df, factor=[0.95, 1, 1.05]):
df = df.copy()
df = df.assign(
pred_volume_10=lambda x: x["pred_volume_10"] * factor[0],
pred_volume_50=lambda x: x["pred_vol... | Python | 1 |
fg(debug_assertions)]
pub const DEFAULT_LE: usize = 4;
#[cfg(not(debug_assertions))]
pub const DEFAULT_LE: usize = 32;
/// Simple empty helper trait naming all the properties needed by ContentTree.
pub trait ContentTraits: SplitAndJoinSpan + Copy + Debug + Default {}
impl<T: SplitAndJoinSpan + Copy + Debug + Default> ... | Rust | 0 |
from typing import TYPE_CHECKING, Any
from litestar import Controller, Litestar, Response, Router, get
from litestar.testing import create_test_client
if TYPE_CHECKING:
from litestar.types import Serializer
def create_mock_encoder(name: str) -> tuple[type, "Serializer"]:
mock_type = type(name, (type,), {})
... | Python | 1 |
ithout_king_side(self) -> CastleRights {
match self {
CastleRights::Both => CastleRights::QueenSide,
CastleRights::KingSide => CastleRights::None,
_ => panic!(format!(
"Cannot remove king side castle rights from {}",
self
)),
... | Rust | 0 |
erNodeHandle(pub RawSlabKey<MeshRenderNode>);
impl Into<GenericRenderNodeHandle> for MeshRenderNodeHandle {
fn into(self) -> GenericRenderNodeHandle {
GenericRenderNodeHandle::new(
<MeshRenderFeature as RenderFeature>::feature_index(),
self.0.index(),
)
}
}
#[derive(Def... | Rust | 0 |
import unittest
import importlib
utils = importlib.import_module("extensions.sd-webui-controlnet.tests.utils", "utils")
from scripts.infotext import parse_unit
from scripts.external_code import ControlNetUnit
class TestInfotext(unittest.TestCase):
def test_parsing(self):
infotext = (
"Module... | Python | 1 |
.
// See: https://docs.oasis-open.org/kmip/spec/v1.0/os/kmip-spec-1.0-os.html#_Toc262581227
Revoke(
#[serde(skip_serializing_if = "Option::is_none")] Option<UniqueIdentifier>,
RevocationReason,
#[serde(skip_serializing_if = "Option::is_none")] Option<CompromiseOccurrenceDate>,
),
... | Rust | 0 |
own(world_data.currency)
st.subheader("🗣️ Languages")
for lang in world_data.languages:
st.markdown(f"- {lang}")
st.subheader("⚔️ Major Wars & Conflicts")
for war in world_data.wars:
st.mar... | Python | 1 |
ode_name.clone(), target_id : verdict_node_name.clone(), style : tran_gv_options};
let gv_node = GraphVizNode{id : verdict_node_name, style : node_gv_options};
let mut string_to_write = gv_node.to_dot_string();
string_to_write.push_str("\n");
string_to_write.push_str(&gv_edge.to_dot_stri... | Rust | 0 |
extern crate libc;
// extern crate hdf5;
use rust_htslib::bam;
use rust_htslib::bam::Format;
use rust_htslib::bam::Header;
use rust_htslib::bam::Writer;
use rust_htslib::bam::Read;
use rust_htslib::bam::Record;
use rust_htslib::bam::record::CigarString;
use std::io::{self, BufRead, Write};
use std::fs::File;
use std:... | Rust | 0 |
percomputing Systems AG
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 agreed to in writing, software
distri... | Rust | 0 |
let val: Option<&str> = None;
//if !Option::<&str>::accepts(ty) { return Err(Box::new(WrongType::new::<Self>(ty.clone()))); }
if !Option::<&str>::accepts(ty) { return Err(BasicError::boxed(format!("Cannot convert SQLParam::Value_Null to pg type \"{ty}\"."))); }
val... | Rust | 0 |
class Solution:
def findMaxAverage(self, nums: List[int], k: int) -> float:
temp = sum(nums[:k])
ans = temp
for i in range(k, len(nums)):
temp += nums[i] - nums[i - k]
ans = max(ans, temp)
return ans / k | Python | 1 |
nal `else {..}`
if !blocks.is_empty() {
if let ExprKind::Block(block, _) = expr.kind {
blocks.push(block);
}
}
(conds, blocks)
}
/// Checks if the given function kind is an async function.
pub fn is_async_fn(kind: FnKind<'_>) -> bool {
matches!(kind, FnKind::ItemFn(_, _, he... | Rust | 0 |
add the mean and std to the cal_data
# add_data = {"algorithm":alg, "env":env,"mean":mean,"std":std}
# add_data = pd.DataFrame(add_data, index=[0])
# final_df = pd.concat([final_df, add_data], ignore_index=True)
# # save the data to excel, the sheet names are mean and std the ... | Python | 1 |
TypeReference {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub(crate) lifetime: Option<Lifetime>,
#[serde(rename = "mut")]
#[serde(default, skip_serializing_if = "not")]
pub(crate) mutability: bool,
pub(crate) elem: Box<Type>,
}
/// An adapter for [`struct@syn::TypeSlice`].
#[der... | Rust | 0 |
= r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(self, value: bool) -> &'a mut W {
self.w.bits &= !(1 << 1);
self.w.bits |= ((value as u32) & 1) << 1;
self.w
}
}
#[doc = r"Value of the field"]
pub struct SYSCTL_SCGCTIMER_S2R {
bits: bool,
}
impl SYSCTL_SCGCTIMER_S... | Rust | 0 |
from urllib.parse import urlencode
from playwright.async_api import async_playwright
from ..settings import settings
from .models import BackendInfo, CommonResponse
async def getViewRaw(
shot_front: bool,
shot_back: bool,
skinUrl: str | None,
capeUrl: str | None,
nameTag: str | None,
device_... | Python | 1 |
import torch
import random
from PIL import Image
import matplotlib.pyplot as plt
from torchvision import transforms
# --- RandomMasking class (as you defined) ---
class RandomMasking:
def __init__(self, mask_ratio=0.75, patch_size=16):
self.mask_ratio = mask_ratio
self.patch_size = patch_size
... | Python | 1 |
aining from scratch!!!', logger='Transformer')
self.apply(self._init_weights)
def _init_weights(self, m):
if isinstance(m, nn.Linear):
trunc_normal_(m.weight, std=.02)
if isinstance(m, nn.Linear) and m.bias is not None:
nn.init.constant_(m.bias, 0)
... | Python | 1 |
"""
在这个文件中会定义 OffSampler 类,继承自 base.py 模块中的 BaseSampler 类(基类,且是一个抽象类)
"""
from typing import List
from Multi_RL.trainer.sampler.base import BaseSampler, Experience
class OffSampler(BaseSampler):
# sample_batch_size 和 noise_params 在构造 sampler 时传入的参数 kwargs 中就有
# 因此这里不需要再额外指定
def __init__(self, **kwargs):
... | Python | 1 |
# builtin imports
import os
import shutil
from typing import Annotated
from fastapi import APIRouter, UploadFile, File, Depends
# custom imports
from opendrive.account.dependencies import upload_file_loggedin_user
upload_router = APIRouter(
prefix="/upload",
tags=["Upload Files"]
)
BASE_DIR = os.path.dirnam... | Python | 1 |
images/sample2.png)
//! ```rust
//! extern crate umya_spreadsheet;
//!
//! let mut book = umya_spreadsheet::new_file();
//!
//! // insert rows
//! book.insert_new_row("Sheet1", 2, 3);
//!
//! // insert columns
//! book.insert_new_colmun("Sheet1", "B", 3);
//! // or
//! book.insert_new_colmun_by_index("Sheet1", 2, 3)... | Rust | 0 |
ced_market_rsi = PARAMS['market_bottom_rsi'] + fear_rsi_bonus + crash_rsi_bonus
if (df.loc[i, 'breadth_bottom'] and
df.loc[i, 'rsi'] < enhanced_market_rsi):
buy_signals.append('市场宽度底部极值')
# 牛市卖出信号(完全保持v1.1逻辑)
sell_signals = []
... | Python | 1 |
va/security/Key;)Ljava/security/Key;\0");
// __jni_env.call_object_method_a(self.0.object, __jni_method, __jni_args.as_ptr())
// }
// }
}
}
<reponame>jhessin/rusty-screeps
use screeps::{
find,
objects::{HasPosition, RoomObjectProperties, StructureTower},
};
pub fn run(tower:... | Rust | 0 |
er::new().init().unwrap();
let options = Options::from_args();
let mut fs = Fs::new(options.rom.parent());
let rom_key = Fs::path_to_key(&options.rom)?;
let game_pak = GamePak::from_storage(&mut fs, &rom_key)?;
let save_state = options.save_state.map(read_save_state).transpose()?;
let renderi... | Rust | 0 |
rmion::color::$color),
)
};
}
#[macro_export]
macro_rules! log_debug {
($message: tt) => {
println!(
"{}{:?}",
termion::color::Fg(termion::color::Reset),
$message,
);
};
($message: tt, $color: ident) => {
print!(
"{}{:?}",... | Rust | 0 |
eFilter {
let time = (i.U2Info.GbSize * 1024.0 / 5.0 / 3600.0).floor() as i32 + 1;
let x = agentRef.applyMagic(&i.uid, time, 5).await;
if x.is_err() {
return x;
} else {
... | Rust | 0 |
set(key: &[u8], value: &[u8]) -> Result<()>;
/// Set expiration time for a key in the local cache.
#[ocall(id = 232)]
fn local_cache_set_expiration(key: &[u8], expire_after_secs: u64) -> Result<()>;
/// Remove a value from the local cache.
///
/// Returns the previous value if it existed.
... | Rust | 0 |
# Clase abstracta que define la interfaz común para todas las notificaciones
from abc import ABC, abstractmethod
class Notificacion(ABC):
@abstractmethod
def enviar(self, mensaje):
pass
# Clases concretas que implementan la interfaz Notificacion
class Email(Notificacion):
def enviar(self, mensaje... | Python | 1 |
oder.stop()
'''
# automatic thresholding
if prob_history and len(bar_dirs) == 2:
total = sum(len(prob_history[c]) for c in prob_history)
fout = open(probs_logfile, 'a')
msg = 'Automatic threshold optimization.\n'
max_acc = 0
max_bias = 0
for bias in np.arange... | Python | 1 |
s: true,
max_length: None,
},
r#"
//- minicore: iterators
use core::iter;
struct MyIter;
impl Iterator for MyIter {
type Item = ();
fn next(&mut self) -> Option<Self::Item> {
None
}
}
fn main() {
let _x = MyIter.by_ref()
.take(5)
.by_ref... | Rust | 0 |
ake_colour!(0xFF, 0xFF, 0xFF),
make_colour!(0xFF, 0x84, 0x84),
make_colour!(0x94, 0x3A, 0x3A),
make_colour!(0x00, 0x00, 0x00)
],
obj0: [
make_colour!(0xFF, 0xFF, 0xFF),
make_colour!(0x7B, 0xFF, 0x31),
make_colour!(0x00, 0x84, 0x00),
make_colour!(0x00, 0x00... | Rust | 0 |
# Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-present Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the F... | Python | 1 |
value
pub new_chat_title: Option<String>,
/// A chat photo was change to this value
#[serde(default)]
pub new_chat_photo: Vec<PhotoSize>,
/// Service message: the chat photo was deleted
#[serde(default = "falsum")]
pub delete_chat_photo: bool,
/// Service message: the group has been cre... | Rust | 0 |
::new();
/// // Returns Cowboy Bebop latest updates
/// let last_updates = jikan.find_user_updates(SourceType::Anime(1), 1)
/// .await
/// .unwrap();
///
/// if let UserUpdates::Anime(anime_updates) = last_updates {
/// let last_updates = anime_updates;
/// }
/// # }
... | Rust | 0 |
rows)?;
}
func.merge(place1, place2)?;
let result = func.merge_result(place1)?;
assert_eq!(&t.expect, &result, "{}", t.name);
assert_eq!(t.display, format!("{:}", func), "{}", t.name);
Ok(())
};
if let Err(e) = func() {
... | Rust | 0 |
`position`: The location where the ray hit.
///
/// * `normal`: The normal at the intersection point.
///
/// * `rid`: The RID of the parent object.
///
/// * `object_id`: The `ObjectID` of the parent, which is a Body or an `Area´.
///
/// * `shape`: The index of the shape in the body/area.
///
/// * `time_o... | Rust | 0 |
co.set("a", List::value([1, 2, 3, 4])).await?;
let a: Vec<i64> = co.get("a").await?;
println!("a = {:?}", a);
let a: Vec<i64> = co.mutate("a", List::lpop(2)).await?;
println!("a.lpop(2) = {:?}", a);
co.mutate("a", List::lpush([1, 2])).await?;
let a: Vec<i64> = co.get("a").await?;
println!("... | Rust | 0 |
}
pub fn on_request_items_dat(self, peer: &mut enet::Peer<()>, _: Option<HashMap<String, String>>) {
let packet: crate::GamePacket = crate::GamePacket::from(self.items_dat.unwrap());
packet.send(0, peer, None);
}
pub fn on_enter_game(self, peer: &mut enet::Peer<()>, _: Option<HashMap<... | Rust | 0 |
import io
import pickle
import pytest
from copy import copy, deepcopy
from .base import FrozendictTestBase
class FrozendictOnlyTest(FrozendictTestBase):
def test_empty(self, fd_empty):
fd_empty_set = self.FrozendictClass({})
fd_empty_list = self.FrozendictClass([])
fd_empty_dict = self.Fro... | Python | 1 |
############################################################################
# $Id: 16c715.py 70 2004-08-23 01:34:19Z estyler $
#
# Description: PIC 16C715 definition. Pyastra project.
# Author: Alex Ziranov <estyler _at_ users _dot_ sourceforge _dot_ net>
#
# Copyright (c) 2004 Alex Ziranov. All rights reserved.
... | Python | 1 |
# TestCGTypes.py
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS... | Python | 1 |
// 2. fail if no retries left
self.state.pin_blocked()?;
// 3. generate shared secret
let shared_secret = self.state.runtime.generate_shared_secret(&mut self.trussed, platform_kek)?;
// 4. decrement retires
self.state.decrem... | Rust | 0 |
method = 'PredNet'
stack_sizes = (3, 32, 64, 128, 256) # 3 refer to num of channel(input)
R_stack_sizes = stack_sizes
A_filt_sizes = (3, 3, 3, 3)
Ahat_filt_sizes = (3, 3, 3, 3, 3)
R_filt_sizes = (3, 3, 3, 3, 3)
pixel_max = 1.0
weight_mode = 'L_0'
error_activation = 'relu'
A_activation = 'relu'
LSTM_activation = 'tanh'
... | Python | 1 |
pub const INVALID_STR: &str = "str is not valid UTF-8: surrogates not allowed";
pub const RECURSION_LIMIT_REACHED: &str = "Recursion limit reached";
pub const DATETIME_LIBRARY_UNSUPPORTED: &str = "datetime's timezone library is not supported: use datetime.timezone.utc, pendulum, pytz, or dateutil";
pub const TIME_HAS... | Rust | 0 |
reset_value() -> Self::Type {
0
}
}
#[doc = "Stop edge for RTC clock output on AOUT\n\nValue on reset: 0"]
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum RTC_CLOCK_DIO0_STOP_EDGE_A {
#[doc = "0: Stop to output RTC clock on rising edge"]
DIO0_RTC_CLK_STOP_RISING = 0,
#[doc = "1: Stop to outpu... | Rust | 0 |
lf_sections_tag()
.expect("Memory map tag required");
// Map kernel sections
for section in elf_sections_tag.sections() {
if !section.is_allocated() { continue; }
assert_eq!(
section.start_address() % 4096,
0,
"Section... | Rust | 0 |
path).unwrap();
assert_eq!(contents, s);
}
#[test]
fn test_limit_reader() {
let mut buf = Vec::with_capacity(512);
let bytes_per_sec = 10 * 1024 * 1024; // 10MB/s
for c in 0..1024usize {
let mut source = std::io::repeat(b'7').take(c as _);
let mut lim... | Rust | 0 |
f map_constant(self, expr):
# Some constants (Python ints notably) are shared among small (and
# common) values. While accurate, this doesn't make for pretty
# trees. So we generate our own unique IDs for them.
node_id = self.generate_unique_id()
self.lines.append(
... | Python | 1 |
r where each module is a type of scan/tool
Parameters:
- targets (str): The IP address, hostname, or network to scan, separated by commas.
Returns:
- str: The results of the Nettacker scan or an error message.
"""
# TODO: make this into a function parameter
verbose_mode = False
cmd = ... | Python | 1 |
# -*- coding: utf-8 -*-
"""
Bounding box intersection over union calculation.
Borrowed from pytorch SSD implementation : https://github.com/amdegroot/ssd.pytorch/blob/master/layers/box_utils.py
and adapted to numpy.
"""
import numpy as np
def intersect_area(box_a, box_b):
"""
Compute the area of i... | Python | 1 |
from itertools import chain, combinations
import scipy.io
import os
import matplotlib.pyplot as plt
import numpy as np
import csv
import glob
import random
import re
from ECGtools import *
#place for UQ files
#output_dir = "/Users/jess/CIBC/FP/segmentation_error/Dalhousie_seg/UQ_data/Forward/vent_MD_cheat/11sam... | Python | 1 |
);
logger_view.set_vexpand(true);
let scrollview = ScrolledWindow::new(None, None);
scrollview.add(&logger_view);
hbox.set_margin_top(5);
hbox.set_margin_bottom(5);
hbox.pack_start(&scrollview, true, true, 5);
hbox.show_all();
RequestLogger {
... | Rust | 0 |
import pandas as pd
from openpyxl import Workbook
from openpyxl.styles import Font, PatternFill
from datetime import datetime
def process_dates(df, date_column):
"""Processa as datas em um DataFrame pandas."""
try:
# Remover datas especificadas
dates_to_remove = ['04/08/24', '11/08/24', '18/08... | Python | 1 |
import pytest
from apps.notion.tasks import update_cache, update_cache_for_all_pages
pytestmark = [
pytest.mark.django_db,
]
@pytest.fixture
def mock_fetch_page(mocker, page):
return mocker.patch(
"apps.notion.client.NotionClient.fetch_page",
return_value=page,
)
@pytest.fixture
def mo... | Python | 1 |
import matplotlib.pyplot as plt
import pandas as pd
from utils import save_plot
class Histogram:
def __init__(self, path):
self.df = pd.read_csv(path)
self.df.dropna(inplace=True)
self.df_only_nb = self.df.iloc[:, 6:]
def render(self):
nb_col = 4
nb_row = 4
plt.... | Python | 1 |
from typing import List, Dict
async def stopping_words(normalized_array: List[Dict[str, object]]) -> List[Dict[str, object]]:
stop_words = {
"a", "about", "above", "after", "again", "against", "all", "am", "an",
"and", "any", "are", "as", "at", "be", "because", "been", "before",
"being", "b... | Python | 1 |
s() {
let descriptor = Descriptor::<bitcoin::PublicKey>::from_str("multi");
assert_eq!(
descriptor.unwrap_err().to_string(),
"unexpected «no arguments given»"
)
}
#[test]
fn empty_thresh() {
let descriptor = Descriptor::<bitcoin::PublicKey>::from_str(... | Rust | 0 |
eplot(
x=[int(k.split('_')[1]) for k in percentiles.keys()],
y=list(percentiles.values()),
ax=ax2
)
ax2.set_title('Percentile Distribution', fontsize=self.config['title_fontsize'])
ax2.set_xlabel('Percentile')
ax2.set_ylabel('Value')
p... | Python | 1 |
<T>], &mut [Option<T>], &mut [Option<T>], &mut [Option<T>], &mut [Option<T>], &mut [Option<T>], &mut [Option<T>]) {
let slice = &mut self.chunks;
let (s0 , slice) = slice.split_at_mut(256);
let (s1 , slice) = slice.split_at_mut(256);
let (s2 , slice) = slice.split_at_mut(256);
let (s3 , slice) = slice.split_... | Rust | 0 |
"""Use case for syncing a schedule once."""
from jupiter.core.domain.concept.schedule.service.external_sync_service import (
ScheduleExternalSyncService,
)
from jupiter.core.domain.core.adate import ADate
from jupiter.core.domain.features import WorkspaceFeature
from jupiter.core.framework.base.entity_id import En... | Python | 1 |
3 = value.into();
let value: u32 = value.into();
self.0 &= !(0x7 << 14);
self.0 |= value << 14;
self
}
}
impl From<u32> for Af {
#[inline]
fn from(other: u32) -> Self {
Af(other)
}
}
impl ::core::fmt::Display for Af {
fn fmt(&self, f: &mut ::core::fmt::For... | Rust | 0 |
1] == ord('s'): # 判断消息是否来自自己
direction, end = "self", end + 5 # 如果是自己发送的消息,方向标记为 "self"
else:
direction, end = self.read_float(end + 1) # 如果是队友发送的消息,解析方向信息
msg, end = self.read_bytes(end + 1) # 解析消息内容
self.h... | Python | 1 |
width,
height]
bbox16 = [self.cx16 - self.width16 / 2,
self.cy16 - self.height16 / 2,
self.width16,
self.height16]
return {
'bbox': bbox,
'bbox16': bbox16,
'best_score': ... | Python | 1 |
self.i == self.message.len() {
None
} else {
let context = self.message.builder.field_locators[self.i];
let field = self.message.builder.fields.get(&context).unwrap();
self.i += 1;
Some((field.0, field.1))
}
}
}
impl<'a, T> RandomFieldAcc... | Rust | 0 |
ated<Pat<I>>>>, Option<Loc>),
/// requires pats.len() != 1
Tuple(Vec<Located<Pat<I>>>),
List(Vec<Located<Pat<I>>>),
Ctor(Long<I>, Box<Located<Pat<I>>>),
InfixCtor(Box<Located<Pat<I>>>, Located<I>, Box<Located<Pat<I>>>),
Typed(Box<Located<Pat<I>>>, Located<Ty<I>>),
As(Located<I>, Option<Located<Ty<I>>>, Bo... | Rust | 0 |
fn simd_or<T>(x: T, y: T) -> T;
fn simd_xor<T>(x: T, y: T) -> T;
fn simd_eq<T, U>(x: T, y: T) -> U;
fn simd_ne<T, U>(x: T, y: T) -> U;
fn simd_lt<T, U>(x: T, y: T) -> U;
fn simd_le<T, U>(x: T, y: T) -> U;
fn simd_gt<T, U>(x: T, y: T) -> U;
fn simd_ge<T, U>(x: T, y: T) -> U;
fn simd_cast<T, U>(x: T) ->... | Rust | 0 |
_vid = cv2.VideoWriter(out_vid_name, fourcc, fps, (width, height))
for i, pred in enumerate(smooth_predictions):
perc = (i + 1) * 100 / n_frames
print('\rWriting video: {0:.2f}%'.format(perc), end='')
tmo_img = tone_map(
pred, opt.tone_map, **create_tmo_param_from_args(opt)
... | Python | 1 |
st_elem.text if artist_elem is not None else "Unknown Artist",
'bpm': float(tempo_elem.get("BPM", "0")) if tempo_elem is not None else 0.0,
'key': key_elem.get("VALUE", "") if key_elem is not None else "",
'file_path': location_elem.get... | Python | 1 |
digest: HmacSha1 = todo!();
/// digest.truncate::<5>(digest);
/// ```
///
/// Codes of length 6, 7, 8, and 9 are allowed:
///
/// ```rust,no_run
///# use rfc_4226::digest::{Digest, HmacSha1};
///# let digest: HmacSha1 = todo!();
/// digest.truncate::<6>();
/// digest.truncate::<... | Rust | 0 |
REST API.
fn project_id(&self) -> &str;
/// An access token. If a refresh token is known and the access token expired,
/// the implementation should try to refresh the access token before returning.
async fn access_token(&self) -> String;
/// The access token, unchecked. Might be expired or in oth... | Rust | 0 |
import os
CM_FILEPATH = os.environ.get('CM_FILEPATH', 'CableInfo.txt')
MODEM_PW = os.environ.get('MODEM_PW')
# assert MODEM_PW, "MODEM_PW environment variable not set"
MODEM_HOST= os.environ.get("MODEM_HOST", "192.168.100.1")
LOG_FILE = os.environ.get('LOG_FILE', 'cable_modem.log')
PG_PASSWORD = os.environ.get('PG_... | Python | 1 |
);
}
}
}
Self::salvage => {
Skill::growth(1, 1).proc(ctx, c, t, data);
let owner = ctx.get_owner(c);
if ctx.turn != owner
&& !data.salvaged && !ctx.hasskill(c, Event::Turnstart, Skill::salvageoff)
{
ctx.fx(c, Fx::Salvage);
data.salvaged = true;
let inst = ctx.new_thing... | Rust | 0 |
#[doc = "*Required features: `\"Win32_Devices_WebServicesOnDevices\"`*"]
pub const WSDAPI_SSL_CERT_IGNORE_UNKNOWN_CA: u32 = 8u32;
#[doc = "*Required features: `\"Win32_Devices_WebServicesOnDevices\"`*"]
pub const WSDAPI_SSL_CERT_IGNORE_WRONG_USAGE: u32 = 4u32;
#[doc = "*Required features: `\"Win32_Devices_WebServicesO... | Rust | 0 |
e_unaligned_hi_lo_m256(hi_addr: &mut [f32; 4], lo_addr: &mut [f32; 4], a: m256) {
unsafe { _mm256_storeu2_m128(hi_addr.as_mut_ptr(), lo_addr.as_mut_ptr(), a.0) }
}
/// Store data from a register into memory.
///
/// * **Intrinsic:** [``]
/// * **Assembly:**
#[inline(always)]
#[cfg_attr(docs_rs, doc(cfg(target_featur... | Rust | 0 |
# Copyright HeteroCL authors. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
"""Test user-defined primitives"""
import heterocl as hcl
import heterocl.ir.transform as hir
@hcl.register_primitive()
class BufferRootPrimitive(hcl.Primitive):
name = "buffer_root"
@staticmethod
def apply(sch):
... | Python | 1 |
RtValue + RtExpand> RtValue for RtSyntax<T>
where
T::Native: SyntaxBody,
{
type Native = Syntax<T::Native>;
fn size_align() -> (usize, usize) {
RtSyntax::size_align()
}
fn into_native(self) -> Self::Native {
let buffer = unsafe { std::ptr::read(self.0) };
let meta = buffer... | Rust | 0 |
name: &str, r1: u32, r2: u32) {
// Make a copy to avoid aliasing problems: Called function expects a reg128, which must not
// alias with memory
codegen::gen_read_reg_xmm128_into_scratch(ctx, r1);
let dest = global_pointers::sse_scratch_register;
ctx.builder.const_i32(dest as i32);
ctx.builder.... | Rust | 0 |
w0);
rnm2 = match svd_ddot(&wrk.w3, &wrk.w3) {
dot if dot <= f64::EPSILON * rnm2 => 0.0,
dot => dot,
}
}
Ok(rnm2.sqrt())
}
/***********************************************************************
* *
... | Rust | 0 |
ashJoin;
pub trait JoinOp<T> {
fn inner(left: &[T], right: &[T]) -> (Vec<T>, Vec<usize>, Vec<usize>);
fn left(left: &[T], right: &[T]) -> (Vec<T>, Vec<usize>, Vec<usize>);
fn right(left: &[T], right: &[T]) -> (Vec<T>, Vec<usize>, Vec<usize>);
fn outer(left: &[T], right: &[T]) -> (Vec<T>, Vec<usize>, Ve... | Rust | 0 |
│ │ ├── sorbet.rbi
│ │ ├── t.rbi
│ │ ├── tprivate.rbi
│ │ ├── tprops.rbi
│ │ └── ttypes.rbi
│ ├── stdlib
│ │ ├── abbrev.rbi
│ │ ├── base64.rbi
│ │ ├── benchmark.rbi
│ │ ├── big_math.rbi
│ │ ├── bigdecimal.rbi
│ │ ├── cgi.rbi
│ │ ├── coverage.rbi
│ │ ├── csv.rbi
│ ... | Rust | 0 |
cvabijtm-lgm-apqxxqvo-512[dinjm]
oaxadrgx-nmewqf-qzsuzqqduzs-456[oevtg]
vehmsegxmzi-veffmx-wepiw-880[emfiv]
fruurvlyh-fubrjhqlf-fdqgb-frdwlqj-ghvljq-413[cgkzy]
otzkxtgzoutgr-inuiurgzk-sgxqkzotm-774[gtzko]
hwbba-eqpuwogt-itcfg-tcddkv-ujkrrkpi-154[ktbcd]
pynffvsvrq-cynfgvp-tenff-ynobengbel-37... | Rust | 0 |
d\x22\xfb\x05\xbd\xc6\x9b\xb5b\xdb\xba=\
\x9e\xfc\xfeu\xaf\xe0\xdbF\xd0|F\xba\xcd\xd4q5\
\xc5\x9d\xbb$w\x0e\xa3z\x821\x8c\xf5\xc7\xb5O\xb3\
\xd7\x9e\x0c%V:QkE\xd7\xb9\xceK\xa35\xaf\
\xcc\xdfu[\xe6\xaa\x16\xda\xebK\xac\xc5\x05\x85\xbbM\
\xb5\xbfy#|\xaa\xbfOZ\xea\x22\x8a\x7f\x19_\xcb\
q\x14^U\x9e\xef\x97\xe5\xdb\xe6\x9f\... | Python | 1 |
p());
// Color chunk starts with [0, 1]
let mut head_chunk = vec![0, 1];
// Append size of the chunk body
head_chunk.append(&mut structure!(">I").pack(chunk.len() as u32).unwrap());
// Append the chunk body
head_chunk.append(&mut chunk);
return head_chunk;
}
fn chunk_for_swatch(obj: &Obje... | Rust | 0 |
in x + 1..101 {
if x + y + y != target as usize {
continue;
}
if count[y] > 1 {
res += count[x] * count[y] * (count[y] - 1) / 2;
res %= MOD;
}
}
}
for (x, &cx) in count.iter().enumerate().take(101) {
... | Rust | 0 |
m200_exports.fs_entrypoints():
y = cx.disass(a)
j = getattr(y, 'dstadr', None)
i = list(cx.m.get_labels(a))
if len(i) > 0 and j:
cx.m.set_label(j, "_" + i[0])
def round_0_6176fa9c7c3f0972(self):
''' Things to do before the disassembler is let ... | Python | 1 |
_BOOL)(self.handle(), opt, val) };
rv2res!(rv)
}
/// Set the value of an integer option.
fn setopt_int(&self, opt: *const c_char, val: i32) -> Result<()>
{
let rv = unsafe { (Self::SETOPT_INT)(self.handle(), opt, val) };
rv2res!(rv)
}
/// Set the duration to the option.
fn setopt_ms(&self, opt: *const ... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.