text string | label_name string | labels int64 |
|---|---|---|
bel='Mie (z)', linewidth=2)
plt.xlabel('Position (nm)')
plt.ylabel('Quantum efficiency')
plt.title('Quantum efficiency comparison')
plt.legend()
plt.grid(True, alpha=0.3)
plt.ylim([0, 1])
# Non-radiative contributions
nonrad_qs = tot - rad
nonrad_mie = tot0 - rad0
plt.s... | Python | 1 |
f not key.key.startswith(os.path.join(self.metrology_path, "activity.")):
continue
contents = key.get()["Body"].read().decode("utf-8")
result = json.loads(contents)
search = ACTIVITY_KEY_RE.search(key.key)
name = search.group(1)
for h in histor... | Python | 1 |
::le_u32, IResult};
#[derive(Debug)]
pub struct MipTexture {
pub name: String,
pub width: u32,
pub height: u32,
pub offset1: u32,
pub offset2: u32,
pub offset4: u32,
pub offset8: u32,
}
pub fn parser(i: &[u8]) -> IResult<&[u8], MipTexture> {
let (i, o) = nom::sequence::tuple((
... | Rust | 0 |
sage: from sage.groups.galois_group import GaloisGroup_ab
sage: Gtest = GaloisGroup_ab(field=None, generator_orders=(2,2,4))
sage: Gtest.transitive_number()
2
"""
return ZZ(self.permutation_group()._gap_().TransitiveIdentification())
class GaloisGroup_c... | Python | 1 |
result.screen(memory).unwrap().get() };
screen.control_mut().reset();
for i in 0..v1::MAX_PALETTES / 4 {
if i < v1::MAX_PALETTES / 8 {
screen.set_palette(i * 4, PackedColor::WHITE);
} else {
screen.set_palette(i * 4, PackedColor::TRANSPARENT);
... | Rust | 0 |
import fire
import os
import yaml
123
def main(list_file, file_out,
phone_file=None, dur_file=None,
emb_dir=None, pitch_dir=None, energy_dir=None,
mel_dir=None,
ref_wav=None):
with open(list_file) as fin:
fids = [x.strip() for x in fin.readlines()]
if phone_file i... | Python | 1 |
AC stream in this file.
pub fn stream_info(&self) -> &StreamInfo {
self.reader.stream_info()
}
/// Reads the next packet and decodes it into `out`.
///
/// Channels are interleaved, e.g. for a stereo packet `out` would contains samples in the
/// order `[left, right, left, right, ..]`.
... | Rust | 0 |
t_os = "windows")]
async fn shutdown_signal() {
tokio::signal::ctrl_c()
.await
.expect("Cannot install CTRL+C signal handler");
}
/// Starts a new instance of an HTTP mock server. You should never need to use this function
/// directly. Use it if you absolutely need to manage the low-level details ... | Rust | 0 |
] + a[{i}]) = max({dp[i-1]}, {dp[i-2]} + {a[i]}) = {dp[i]}")
self._maxv[0] = dp[n-1]
# Backtrack to find chosen indices
indices = []
i = n - 1
while i >= 0:
if i == 0:
if dp[0] > 0:
indices.append(0)
break
... | Python | 1 |
state.undo_stack = BoardUndoStack::new();
state.interface_state.n_key_state = NewGameState::Cooldown;
state.interface_state.status_text = None;
state.interface_state.next_auto_move =
Instant::now() + state.ui_settings.timings().auto_move_secs;
if !state.op... | Rust | 0 |
}
fn write_node(nodes: &[RpnTreeNode], id: usize, fmt: &mut Formatter) -> Result<(), fmt::Error> {
use RpnOp::*;
use RpnTreeNodeType::*;
let node = &nodes[id];
let write_child_node = |id, fmt: &mut Formatter, is_left: bool| {
let child_node: &RpnTreeNode = &nodes[id];
let needs_parens ... | Rust | 0 |
#[derive(PartialEq, Clone, Debug, Hash)]
pub enum Geometry<T>
where
T: CoordinateType,
{
Point(Point<T>),
Line(Line<T>),
LineString(LineString<T>),
Polygon(Polygon<T>),
MultiPoint(MultiPoint<T>),
MultiLineString(MultiLineString<T>),
MultiPolygon(MultiPolygon<T>),
GeometryCollection(G... | Rust | 0 |
og_channel as usize + 16 * complete_chunk_size as usize;
if extra_chunk_size > 8{
// 8th - 1st | 16th - 9th
for i in 0..8{
// Higher bits
values_slice[column_offset+i].push_raw(view[7-i]).unwrap();
}
column_offset+=8;
for i in 0 .. extra_chunk_size - 8{
// Lower... | Rust | 0 |
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from fairseq import utils
from fairseq.modules import TransformerEncoderLayer
from .multihead_linear_attention import MultiheadL... | Python | 1 |
assert_eq!(
::std::mem::align_of::<iox_pub_options_t>(),
8usize,
concat!("Alignment of ", stringify!(iox_pub_options_t))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<iox_pub_options_t>())).historyCapacity as *const _ as usize
},
0usize,
conca... | Rust | 0 |
import random
height = int(input("How tall are you in cm?"))
if height <= 0:
height = random.randrange(50, 200, 1)
print(f"I don't think that's true, I'll guess your height to be {height}.")
age = int(input("How old are you in years?"))
if age <= 0:
age = random.randrange(1, 100, 1)
print(f"I don't think that's ... | Python | 1 |
metadata = {"apiLevel": "2.14"}
requirements = {"apiLevel": "2.15"}
def run(protocol):
protocol.home()
| Python | 1 |
import unittest
import numpy as np
import pandas as pd
from kivi.woe import *
from kivi.datasets import *
class TestWOE(unittest.TestCase):
""""""
def setUp(self):
""""""
self.df_bank = Dataset.bank_data()
print(self.df_bank.shape)
def test_distance_bins(self):
""""""
... | Python | 1 |
er_case_encoding() {
assert_eq!(
parse(b"<?xml version=\"1.0\" ENCODING=\"windows-1251\"?>AAAA"),
None
);
}
#[test]
fn space_before() {
assert_eq!(
parse(b" <?xml version=\"1.0\" encoding=\"windows-1251\"?>AAAA"),
None
);
}
... | Rust | 0 |
key, lookup = split
d = d[key]
return d
def iter_json_file(data: Union[dict, list], lookup: str) -> Generator[Union[dict, list], Any, None]:
"""
Perform lookup and return generator over json list.
Does not open file until iteration is started.
:param data: JSON data
:param lo... | Python | 1 |
"]
pub ram1: RAM,
_reserved15: [u8; 4usize],
#[doc = "0x920 - Unspecified"]
pub ram2: RAM,
_reserved16: [u8; 4usize],
#[doc = "0x930 - Unspecified"]
pub ram3: RAM,
_reserved17: [u8; 4usize],
#[doc = "0x940 - Unspecified"]
pub ram4: RAM,
_reserved18: [u8; 4usize],
#[doc = ... | Rust | 0 |
"""
Created on Thu Apr 27 16:28:36 2017
@author: barnabysandeford
"""
# Currently works for Safari, but just change to whichever
# browser you're using.
import time
# Added pafy to get video length for the user
import pafy
# Changed the method of opening the browser.
# Selenium allows for the page to be refreshed.
f... | Python | 1 |
erves.0 += amount0;
reserves.1 += amount1;
});
// Mint LPtoken to the sender
asset::Module::<T>::mint_from_system(&lpt, &sender, &lptoken_amount)?;
Self::deposit_event(RawEvent::CreatePair(token0, token1, lpt));
... | Rust | 0 |
_id) \
.filter_by(user_id=user_id) \
.filter_by(stop=None) \
.all()
# a regular worker is not allowed to assign start/stop times
if not admin_permissions:
if any(parameters.get(x) for x in ["start", "stop"]):
return {
"... | Python | 1 |
"""poo: programacion orientada a objetos"""
class carro:
"""atributos"""
ruedas = 4
"""constructor"""
def __init__(self, color, aceleracion):
self.color = color
self.aceleracion = aceleracion
self.velocidad = 0
"""metodos y funciones"""
def acelerar (self):
... | Python | 1 |
te {
pos : [f32;2],
state : i32,
time : f64,
}
pub struct IO {
input : [InputState; 259],
size : [f32;2],
mpos : [f32;2],
}
impl IO {
fn lparam_to_pos(lparam : isize) -> [f32;2] {
let x = (lparam & 65535) as i16;
let y = (lparam >> 16) as i16;
[x as f32, ... | Rust | 0 |
impl<'a> PanicVal<'a> {
/// Sets the amount of spaces printed before this to `fmtarg.indentation`.
///
/// Note that only strings can be padded.
pub const fn with_leftpad(self, fmtarg: FmtArg) -> Self {
mutate_strfmt! {self, |strfmt| strfmt.leftpad = fmtarg.indentation}
}
/// Sets the a... | Rust | 0 |
standard_output.resume();
std::thread::sleep(std::time::Duration::from_secs(5));
standard_output.stop();
}
}
<reponame>tyler274/tray_rust
//! The film module provides color types and a render target that the image
//! is written too.
pub use self::animated_color::{AnimatedColor, ColorKeyframe}... | Rust | 0 |
extension_struct() {
assert_eq!(
::std::mem::size_of::<LIBMTP_device_extension_struct>(),
24usize,
concat!("Size of: ", stringify!(LIBMTP_device_extension_struct))
);
assert_eq!(
::std::mem::align_of::<LIBMTP_device_extension_struct>(),
8usize,
concat!("Alignm... | Rust | 0 |
> <<EMAIL>>
// SPDX-License-Identifier: MIT OR Apache-2.0
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified or distribu... | Rust | 0 |
validator: validator_3,
maybe_amount: Some(U512::from(5)),
},
timestamp: BlockTime::new(102),
}];
let got = queue.pop_due(BlockTime::new(105));
for i in 0..expected.len() {
assert_eq!(expected[i].item, got[i].item);
assert_e... | Rust | 0 |
r"""
Reactors with walls and heat transfer
=====================================
Two reactors connected with a piston, with heat loss to the environment
This script simulates the following situation. A closed cylinder with volume 2
m³ is divided into two equal parts by a massless piston that moves with speed
proporti... | Python | 1 |
nn_feature_columns, self.feature_index, self.embedding_dict)
dnn_input = combined_dnn_input(sparse_embedding_list, dense_value_list) # [btz, sparse_feat_cnt*emb_size+dense_feat_cnt]
dnn_output = self.dnn(dnn_input)
dnn_logit = self.dnn_linear(dnn_output)
logit = dnn_logit
y_pr... | Python | 1 |
COMPUTE_SHADER = 6,
}
#[repr(C)]
pub enum D3D11_TRACE_GS_INPUT_PRIMITIVE {
UNDEFINED = 0,
POINT = 1,
LINE = 2,
TRIANGLE = 3,
LINE_ADJ = 6,
TRIANGLE_ADJ = 7,
}
#[repr(C)]
pub enum D3D11_TRACE_REGISTER_TYPE {
OUTPUT_NULL_REGISTER = 0,
INPUT_REGISTER,
INPUT_PRIMITIVE_ID_REGISTER,
... | Rust | 0 |
pub fn pop_front(&mut self) -> Option<T> { self.0.apply_mut(RetValueMut::new(|ghost, token| ghost.pop_front(token))) }
/// Pops the back item of the list, if any.
pub fn pop_back(&mut self) -> Option<T> { self.0.apply_mut(RetValueMut::new(|ghost, token| ghost.pop_back(token))) }
}
impl<T> Default for Linked... | Rust | 0 |
ixStream =
unsafe { ::std::os::unix::io::FromRawFd::from_raw_fd(3) };
sandstorm_stream.set_nonblocking(true)?;
// Hand the socket connection to Tokio
let tokio_stream = tokio::net::UnixStream::from_std(sandstorm_stream)?;
// Cap'n Proto RPC wants the stream split
let... | Rust | 0 |
0, 1, 0]]
)
assert np.allclose(trajdata.scfenergies[0], -324.61300863874163)
assert np.allclose( # final structure
trajdata.atomcoords[-1],
[
[0.06884815, 0.06884815, -0.00000000],
[1.00852115, -0.07736930, 0.00000000],
[-0... | Python | 1 |
/// `43 f32.const z` (mvp_f32)
F32Const = 0x43,
/// `44 f64.const z` (mvp_f64)
F64Const = 0x44,
/// `45 i32.eqz` (mvp)
I32Eqz = 0x45,
/// `46 i32.eq` (mvp)
I32Eq = 0x46,
/// `47 i32.ne` (mvp)
I32Ne = 0x47,
/// `48 i32.lt_s` (mvp)
I32LtS = 0x48,
/// `49 i32.lt_u` (mvp)
... | Rust | 0 |
todos
.iter()
.filter(|todo| {
todo.value
.to_lowercase()
.contains(&query.value.to_lowercase())
})
.cloned()
.collect::<Vec<_>>(),
)
}
pub static count: i32 = 1;
fn main() {
let count: i32 = 1;
... | Rust | 0 |
sert("extends1".into());
set
},
require_implements: {
let mut set = StringSet::new();
set.insert("impl1".into());
set
},
base_types: StringSet::... | Rust | 0 |
ice()
}
pub fn get_lifetime(&self) -> Result<u64, Error> {
let rfc_sk = ReferenceImplPrivateKey::from_binary_representation(&self.bytes)
.map_err(|_| Error::new())?;
let parsed_sk = HssPrivateKey::<H>::from(&rfc_sk, &mut None).map_err(|_| Error::new())?;
Ok(parsed_sk.get_l... | Rust | 0 |
platformID: 1,
encodingID: 0,
languageID: 0,
nameID: 17,
string: "Regular".to_string(),
},
NameRecord {
platformID: 1,
encodingID: 0,
... | Rust | 0 |
rinsicsGuide/#text=_mm256_cvtepu32_epi64)
#[inline]
#[target_feature(enable = "avx2")]
#[cfg_attr(test, assert_instr(vpmovzxdq))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn _mm256_cvtepu32_epi64(a: __m128i) -> __m256i {
transmute::<i64x4, _>(simd_cast(a.as_u32x4()))
}
/// Zero-extend unsigned ... | Rust | 0 |
fication: {e}")
def _find_score_band(score_value, model):
"""
Find band number and the band object given two lists with thresholds.
The first list specifies lower bounds for the score and the function returns the first largest band which is less
than or equal to the score. Band number is positive: 1,... | Python | 1 |
;
let k_is_global: CFString = unsafe { TCFType::wrap_under_get_rule(kIOSurfaceIsGlobal) };
let v_is_global = CFBoolean::true_value();
let pairs: Vec<(CFType, CFType)> = vec!(
(k_width.as_CFType(), v_width.as_CFType()),
(k_height.as_CFType(), v_height.as_CFType()),
(k_bytes_per_row.... | Rust | 0 |
"`
#[regex(r#""(""|[^"])*""#, parse_string_literal)]
StringLiteral(InternalString),
/// Error token indicating an unterminated string literal, e.g. `"foo`
#[regex(r#""(""|[^"])*"#)]
UnterminatedStringLiteral,
}
fn parse_temporal_spread_label(lex: &mut Lexer<RantToken>) -> InternalString {
let slice = le... | Rust | 0 |
secrets file")
.contains(second_label),
"Newly created key should be saved in file"
);
let keyring = keyring_file
.load()
.await
.expect("Should be able to load keyring file");
assert_eq!(keyring.key.len(), 2, "Should have 2 entries in keyring");
assert_eq!... | Rust | 0 |
: self
.dep
.version
.parse()
.map_err(|e| ResolverError::OtherError(Box::new(e)))?,
// TODO - need to do a metadata request if the tarball is empty.
tarball: self.dep.resolved.clone()... | Rust | 0 |
from rest_framework import serializers
from .models import Sale
class SaleSerializer(serializers.ModelSerializer):
class Meta:
model = Sale
fields = ['id', 'customer', 'product', 'user', 'amount', 'date']
| Python | 1 |
", duration);
}<reponame>oftlisp/oftb
use flatanf::Expr;
use interpreter::env::Env;
use interpreter::store::Addr;
use interpreter::value::Value;
/// A continuation on the continuation stack.
#[derive(Debug)]
pub enum Kont<'program> {
/// A continuation for let evaluation.
Let(&'program Expr, Env),
/// A c... | Rust | 0 |
from email.policy import default
from envparse import Env
import os
from datetime import timedelta
env = Env()
REAL_DATABASE_URL = env.str(
"DATABASE_URL",
default="postgresql+asyncpg://postgres:postgres@localhost:5436/auth_db"
)
SECRET_KEY = os.getenv("SECRET_KEY", "your-secret-key-here")
ALGORITHM = "HS25... | Python | 1 |
ta0, data1, data2], expected, self.model_files))
@unittest.skipIf(test_level_0,
"Test level 0 only.")
def test_CNN_LSTM(self):
K.clear_session()
max_len = 20
vocab_size = 50
lstm_output_size = 70
embedding_size = 100
model = Sequential()
... | Python | 1 |
elf.block_valid[block_id] = true;
log::trace!("stored block {}", block_id);
}
}
fn done_and_size(&self, dsm_type: DsmType) -> Option<usize> {
if !self.block_valid[0] {
log::trace!("first block not yet present. DSM size unknown");
return None;
}
... | Rust | 0 |
accessor, &neighbor.varying);
let neighbor_varying = unwrap_leaf_ref (&neighbor_guard);
let corresponding_face = face_by_dimension_and_direction (& neighbor_varying.boundaries, boundary.normal_dimension, other_direction);
//let corresponding_area = neighbor.width*LENGTH_UNIT*DEPTH;
... | Rust | 0 |
block_offset: u64,
) -> Result<()> {
if batch.isDelta() {
return Err(ArrowError::NotYetImplemented(
"delta dictionary batches not supported".to_string(),
));
}
let id = batch.id();
let fields_using_this_dictionary = schema.fields_with_dict_id(id);
let first_field = fie... | Rust | 0 |
num_classes = 21
aspect_ratios = [[2], [2, 3], [2, 3], [2, 3], [2, 3], [2], [2]]
mbox = [4, 6, 6, 6, 6, 4, 4]
variance = [0.1, 0.2]
feature_maps = [65, 33, 17, 9, 5, 3, 1]
min_sizes = [ 20.52, 51.3, 133.38, 215.46, 297.54, 379.62, 461.7 ]
max_sizes = [ 51.3, 133.38, 215.46, 297.54, 379.62, 461.7, 543... | Python | 1 |
ntials::username_and_password(
&shell,
"Username: ",
"Password: ",
),
};
Atcoder::exec(RetrieveSubmissionSummaries {
target: AtcoderRetrieveSubmissionSummariesTarget { contest },
credenti... | Rust | 0 |
# pygame.key module
# https://www.pygame.org/docs/ref/key.html
#
# Two keypresses processed in each frame (pygame snake game)
# https://stackoverflow.com/questions/74249252/two-keypresses-processed-in-each-frame-pygame-snake-game/74326162#74326162
#
# GitHub - Keys and keyboard events
# https://github.com/Rabbid76/PyGa... | Python | 1 |
ith_setting(cov, 'gen50', 'red', '^', ax, 0.6, '--')
draw_experiment1_with_setting(cov, 'gen100', 'green', 'p', ax, 0.5, '-.')
draw_experiment1_with_setting(cov, 'gen150', 'black', 'o', ax, 0.4, (0, (3, 1, 1, 1)))
draw_experiment1_with_setting(cov, 'gen200', 'purple', 's', ax, 0.3, (0, (5, 2)))
draw_experiment1... | Python | 1 |
lled. Additionally no Rust destructors can be on the
/// stack. They will be skipped and not executed.
pub unsafe fn resume_panic(payload: Box<dyn Any + Send>) -> ! {
tls::with(|info| info.unwrap().unwind_with(UnwindReason::Panic(payload)))
}
/// Stores trace message with backtrace.
#[derive(Debug)]
pub enum Trap ... | Rust | 0 |
"""
Testing for Elliptic Envelope algorithm (sklearn.covariance.elliptic_envelope).
"""
import numpy as np
import pytest
from sklearn.covariance import EllipticEnvelope
from sklearn.exceptions import NotFittedError
from sklearn.utils._testing import (
assert_almost_equal,
assert_array_almost_equal,
assert... | Python | 1 |
one,
stripe_account: Optional[str] = None,
**params: Unpack[
"ApplicationFee.ListRefundsParams"
] # pyright: ignore[reportGeneralTypeIssues]
) -> ListObject["ApplicationFeeRefund"]:
"""
You can see a list of the refunds belonging to a specific application fee. No... | Python | 1 |
::{self, AsyncBufReadExt, AsyncRead},
task::{self, JoinHandle},
};
use super::ipc::owned_fd::{OwnedFd, OwnedFdRw};
pub struct ContainerIo {
pub io: [OwnedFd; 3],
/// A handle to the io forwarding task if stdout or stderr is set to `Output::Pipe`
pub log_task: Option<JoinHandle<io::Result<()>>>,
}
///... | Rust | 0 |
.addCallback(self.assertEqual, b"test\n")
return d
class OpenSSHClientRekeyTests(RekeyTestsMixin, OpenSSHClientMixin, TestCase):
"""
Rekeying tests run against the OpenSSL command line client.
"""
class CmdLineClientTests(ForwardingMixin, TestCase):
"""
Connection forwarding tests run ag... | Python | 1 |
open_mut()
}
unsafe fn get(v: &mut Self::Value, i: Index) -> &'a mut T {
// This is horribly unsafe. Unfortunately, Rust doesn't provide a way
// to abstract mutable/immutable state at the moment, so we have to hack
// our way through it.
let value: *mut Self::Value = v as *mut ... | Rust | 0 |
|{{InvSprite|Turtle Shell}} Added Turtle Shells}}
{{History|console}}
{{History||xbox=TU1|xbone=CU1|ps=1.0|wiiu=Patch 1|switch=Patch s1|{{InvSprite|Leather Cap Revision 1}}{{InvSprite|Leather Tunic Revision 1}}{{InvSprite|Leather Pants Revision 1}}{{InvSprite|Leather Boots Revision 1}} Added the leather set.
|{{InvSpri... | Rust | 0 |
derive(Debug)]
pub enum HTMLLinkRelationship {
Stylesheet,
}
impl HTMLLinkElement {
pub fn empty() -> Self {
Self {
href: None,
relationship: None,
}
}
pub fn load_stylesheet(&self, url: &Url, document: NodeRef) {
let cloned_doc = document.clone();
... | Rust | 0 |
ng, file
if not strict and second_lang:
return True, second_lang, second_file
return False, None, None
def __target_subtitle_exists(self, video_file):
"""
目标字幕文件是否存在
:param video_file:
:return:
"""
if self._translate_zh:
prefer... | Python | 1 |
import csv
from svgelements import *
# Canvas size for YouTube Shorts (portrait)
WIDTH, HEIGHT = 1080, 1920
# Input CSV (group, language, percentage)
csv_file = "side_compare.csv"
# Read CSV data
data = []
with open(csv_file, newline='', encoding='utf-8') as f:
reader = csv.DictReader(f)
for row in reader:
... | Python | 1 |
import string
import requests
import asyncio
from collections import defaultdict, Counter
from matplotlib import pyplot as plt
def get_text(url):
"""Fetch text content from a URL."""
try:
response = requests.get(url)
response.raise_for_status()
return response.text
except requests.R... | Python | 1 |
ne();
let res = || -> Result<()> {
match Cmd::parse() {
Cmd::Set { mime, handler } => {
apps.set_handler(mime.0, handler);
apps.save()?;
}
Cmd::Add { mime, handler } => {
apps.add_handler(mime.0, handler);
a... | Rust | 0 |
vc::create_dir_entry(
vmo,
size,
is_exec,
BootfsSvc::get_next_inode(&mut self.next_inode),
) {
Ok(dir_entry) => {
self.tree_builder.add_entry(&path_parts, dir_entry).unwrap_or_else(|error| {
println!(
... | Rust | 0 |
], raw_data[9], raw_data[10], raw_data[11]],
eth_type: ((raw_data[12] as u16) << 8) + raw_data[13] as u16,
}))
}
fn get_proto(&self) -> Protocol {
Protocol::ETH
}
fn get_length(&self) -> u8 {
14
}
fn get_min_length() -> u8 {
14
}
}
use super::{D... | Rust | 0 |
sys::core::PCSTR, commonlyused: i8, status: *mut UErrorCode) -> *mut UEnumeration;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub fn ucol_getKeywords(status: *mut UErrorCode) -> *mut UEnumeration;
#[doc = "*Required features: `\"Win32_Globalization\"`*"]
pub fn ucol_getLocaleByType(coll: ... | Rust | 0 |
f,
V: Clone + Deserialize<'de>,
{
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where
D: Deserializer<'de>,
{
use crate::lib::std::fmt;
struct SecondaryMapVisitor<K, V> {
unused: PhantomData<fn(K) -> V>,
}
impl<'de, K, V> Visitor<'de> ... | Rust | 0 |
ch s {
"MAX_ZONES_BY_REUSABLE_DELEGATION_SET" => {
ReusableDelegationSetLimitType::MaxZonesByReusableDelegationSet
}
other => ReusableDelegationSetLimitType::Unknown(other.to_owned()),
}
}
}
impl std::str::FromStr for ReusableDelegationSetLimitType {
t... | Rust | 0 |
import pytest
import torch
import aphrodite._custom_ops as ops
from tests.kernels.quant_utils import ref_dynamic_per_tensor_fp8_quant
from aphrodite.platforms import current_platform
DTYPES = [torch.bfloat16, torch.float16]
M = [16, 32, 64, 128, 256, 512, 1024, 4096, 8192]
K = [8, 16, 32, 64, 128, 256, 512, 1024, 204... | Python | 1 |
"Generate the quantized multiplication kernels for uint8 operands."""
quantized_mul_static_row_major = QuantizedMulStaticRowMajor(cc_emitter,
asm_emitter)
quantized_mul_static_int32_row_major = QuantizedMulStaticAsInt32RowMajor(
cc_emitter, asm_emi... | Python | 1 |
れたら抜けていく。
app.comm.println(&format!(
"#[No-subject: これは手筋の主体ではありません。 {} != {} || {} != {}. subject_piece_id: '{}', bmove.subject_pid: '{}', bmove.subject_addr: '{}', my_addr_obj: '{}']",
subject_piece_id.get_number(),
bmove.subject_pid.get_number(),
... | Rust | 0 |
ems
def initial_op_quant_mode(items_lst, target_quant_mode, op_item_dtype_dict):
for item in items_lst:
op_item_dtype_dict[item.name] = target_quant_mode
op_item_dtype_dict = OrderedDict()
for quant_mode, quant_mode_items in quant_mode_wise_items.items():
... | Python | 1 |
(cache_file) {
let entries: Result<Vec<Entry>, serde_json::Error> = serde_json::from_str(&file_content);
entries.unwrap_or_default()
} else {
Default::default()
}
}
pub fn flush_mode_cache(mode: &Mode, entries: &[Entry]) {
let entries: Vec<&Entry> = entries.iter().take(50).collect()... | Rust | 0 |
ap")
)
if mibBuilder.loadTexts:
alaDhcpSrvNotificationGroup.setStatus(
"current"
)
# Agent capabilities
# Module compliance
alcatelIND1DhcpSrvMIBCompliance = ModuleCompliance(
(1, 3, 6, 1, 4, 1, 6486, 800, 1, 2, 1, 59, 1, 2, 2, 1)
)
alcatelIND1DhcpSrvMIBCompliance.setObjects(
*(("ALCATEL-... | Python | 1 |
;
}
_ => {}
}
match stmt {
ModuleItem::Stmt(Stmt::Decl(Decl::Fn(..)))
| ModuleItem::ModuleDecl(ModuleDecl::ExportDecl(ExportDecl {
decl: Decl::Fn(..),
..
}))
|... | Rust | 0 |
tware, Inc.
// License:: Apache License, Version 2.0
//
// 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 applica... | Rust | 0 |
t.verify_is_valid_tls_server_cert(ALL_SIGALGS, &anchors,
&inter_vec, time)
.unwrap();
}
#[cfg(feature = "trust_anchor_util")]
#[test]
pub fn ed25519()
{
let ee = include_bytes!("ed25519/ee.der");
let ca = include_bytes!("ed25519/ca.der");
let ee_inp... | Rust | 0 |
import pytest
@pytest.mark.parametrize(
"word,lemma", [("새로운", "새롭"), ("빨간", "빨갛"), ("클수록", "크"), ("뭡니까", "뭣"), ("됐다", "되")]
)
def test_ko_lemmatizer_assigns(ko_tokenizer, word, lemma):
test_lemma = ko_tokenizer(word)[0].lemma_
assert test_lemma == lemma
| Python | 1 |
),
Some(2)
);
}
#[test]
fn test_part2() {
assert_eq!(
part2(
r"
eyr:1972 cid:100
hcl:#18171d ecl:amb hgt:170 pid:186cm iyr:2018 byr:1926
iyr:2019
hcl:#602927 eyr:1967 hgt:170cm
ecl:grn pid:012533040 byr:1946
hcl:dab227 iyr:2012
ecl:brn hgt:182cm pid:021572410 eyr:2020 byr:... | Rust | 0 |
import os
import re
from urllib.parse import quote
# Recolectar y unificar payloads desde archivos .txt
def recolectar_payloads(directorio):
payloads = set()
for archivo in os.listdir(directorio):
if archivo.endswith('.txt') and archivo != 'encoded_variants.txt':
with open(os.path.join(di... | Python | 1 |
import numpy as np
print(np.__version__)
# 1.26.1
a_int64 = np.arange(3)
print(a_int64)
# [0 1 2]
print(a_int64.dtype)
# int64
a_float64 = np.arange(6).reshape(2, 3) / 10
print(a_float64)
# [[0. 0.1 0.2]
# [0.3 0.4 0.5]]
print(a_float64.dtype)
# float64
print(np.zeros_like(a_int64))
# [0 0 0]
print(np.zeros_li... | Python | 1 |
# Copyright 2020 Intel Corporation
#
# 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 wri... | Python | 1 |
value": ".org"
},
]
},
"op": "Equal",
"rhs": "example.org"
}
);
let expr = expr.compile();
let ctx = &mut ExecutionContext::new(&SCHEME);
ctx.set_field_value("http.host", "example").... | Rust | 0 |
import FreeCAD, FreeCADGui
import MagicPanels
translate = FreeCAD.Qt.translate
try:
objects = FreeCADGui.Selection.getSelection()
if len(objects) < 1:
raise
# prepere tenons to avoid double count of copies in Cut
tenons = []
for o in FreeCAD.ActiveDocument.Objects:
if hasattr(o, "Tenon"):
if o.Visibili... | Python | 1 |
x.split_whitespace())
.collect::<String>();
Ok(hex::decode(parts)?)
}
#[test]
fn deep_tree_traversal_no_stack_overflow() -> anyhow::Result<()> {
// traverse a tree on a thread with a tiny stack
// this would fail with recursive traversal
let handle = std::thread::Builder::new()
.name("... | Rust | 0 |
import unittest
from pytest import *
from pykicad.pcb import *
class NetClassTests(unittest.TestCase):
def test_parse(self):
nc_string = "(net_class name description (add_net GND))"
nc = NetClass.parse(nc_string)
assert nc.name == 'name'
assert nc.description == 'description'
... | Python | 1 |
()
value = self.manager.get_owners(BaseDatabaseTest.ROOM_ID)
self.assertTrue(type(value) == str)
def test_get_owners(self):
self._create_channel()
self._create_room()
owners = self.manager.get_owners(BaseDatabaseTest.ROOM_ID)
self.assertTrue(type(owners) == list)
... | Python | 1 |
pub fn anagrams_for<'a>(word: &str, possible_anagrams: &[&'a str]) -> HashSet<&'a str> {
let lowercase_word = word.to_lowercase();
let sorted_chars = get_sorted_chars(&lowercase_word);
let mut anagrams = HashSet::new();
for candidate in possible_anagrams {
if candidate.len() != word.len() {
... | Rust | 0 |
None | str): Logger used for printing
related information during evaluation. Default: None.
Returns:
dict[str, float]: Default metrics.
"""
if isinstance(metric, str):
metric = [metric]
allowed_metrics = ['mIoU', 'mDice']
if not set(metri... | Python | 1 |
", &self.targets);
formatter.field("resource_type", &self.resource_type);
formatter.field("filters", &self.filters);
formatter.field("max_results", &self.max_results);
formatter.field("next_token", &self.next_token);
formatter.finish()
}
}
#[non_exhaustive]
#[derive(std::clo... | Rust | 0 |
/**
* The error code for the last calibration mode.
* Zero represents a successful cal (with solid green LEDs at end of cal)
* and nonzero is a failed calibration (with solid red LEDs at end of cal).
* Different calibration
*/
pub calibration_error: i32,
/**
* After caller requ... | Rust | 0 |
thread_local! {
static CFG_TEST_ATTR: syn::Attribute = {
use syn::parse::Parser as _;
let attrs = syn::Attribute::parse_outer.parse_str("#[cfg(test)]").unwrap();
attrs.into_iter().exactly_one().unwrap()
};
}
CFG_TEST_ATTR.with(|x| attr == x)
}
struct Visi... | Rust | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.