text string | label_name string | labels int64 |
|---|---|---|
} else {
false
}
}
}
impl FileMonitor {
/// Create a new [`FileMonitor`] that watches a given filesystem path and add the directory
/// that contains it to an [`Inotify`] to be watched.
pub fn new<P: AsRef<Path>>(inotify: &mut Inotify, watch_path: P) -> Result<FileMonitor> ... | Rust | 0 |
st]
fn empty_results() {
new_ucmd()
.args(&["bench_output_4.txt", "bench_output_5.txt", "--regressions", "--improvements"])
.succeeds()
.no_stdout()
.stderr_is_fixture("empty_results.expected");
}
#[test]
fn within_threshold_1_comparing_4_5() {
new_ucmd()
.args(&["bench_... | Rust | 0 |
"error parsing one of {:?}, found {:?}",
CHARS,
c
))
}
}
None => Err(eyre::eyre!("error parsing one of {:?}, reached EOF", CHARS)),
}
}
fn peek(input: &mut impl Buffer<char>)... | Rust | 0 |
",
"ๆๅจ",
"ๆๅนธ",
"ๆๆ",
"ๆ",
"ๆ่ฝ",
"ๆ",
"ๆไป",
"ๆ",
"ๆๆ",
"ๆฟ",
"ๆ",
"ๆ็
ง",
"ๆขๅฅ่ฏ่ฏด",
"ๆข่จไน",
"ๆฎ",
"ๆฎๆญค",
"ๆฅ็",
"ๆ
",
"ๆ
ๆญค",
"ๆ
่",
"ๆไบบ",
"ๆ ",
"ๆ ๅฎ",
"ๆ ่ฎบ",
"ๆข",
"ๆขๅพ",
"ๆขๆฏ",
"ๆข็ถ",
"ๆถๅ",
"ๆฏ",
"ๆฏไปฅ",
"ๆฏ็",
... | Rust | 0 |
ng context as part of import.
for meth in ('fork', 'spawn', 'forkserver'):
# if a context is available on the host check it can be set as the
# start method in a separate process
try:
multiprocessing.get_context(meth)
except ValueError:
... | Python | 1 |
radial_MLP=ast.literal_eval(args.radial_MLP),
radial_type=args.radial_type,
heads=heads,
)
if args.model == "FoundationMACE":
return modules.ScaleShiftMACE(**model_config_foundation)
if args.model == "ScaleShiftBOTNet":
# say it is deprecated
raise Runtime... | Python | 1 |
#!/usr/bin/env python3
"""
Command-line interface for the Fathom Extractor tool.
"""
import argparse
import sys
from pathlib import Path
from .extractor import HARTranscriptExtractor
def main():
"""Main CLI entry point."""
parser = argparse.ArgumentParser(
description='Extract transcripts from HAR f... | Python | 1 |
)
ReIsCopyrightTypeB = re.compile(r"""(^|\s)\(C\)\s*COPYRIGHT""", re.DOTALL)
if ReIsCopyrightRe.search(LineContent) or ReIsCopyrightTypeB.search(LineContent):
Result = True
return Result
## CleanString2
#
# Split comments in a string
# Remove spaces
#
# @param Line: The string to be ... | Python | 1 |
fs";
let bundle = tempfile::tempdir().with_context(|| "Failed to create tmp test bundle dir")?;
let rootfs_absolute_path = bundle.path().join(rootfs_name);
assert!(
rootfs_absolute_path.is_absolute(),
"rootfs path is not absolute path"
);
fs::create_dir_al... | Rust | 0 |
eq!(output_set, vec![5, 3, 23, 7, 7],);
}
#[test]
fn test_find_subset__subset_exists_and_zero_values_in_input_set__subset_vector() {
let input_set = vec![0, 11, 0, 7, 2, 3, 0, 3, 13];
let input_sum = 13u32;
let output_set = find_subset(&input_sum, &input_set);
assert_eq!(out... | Rust | 0 |
import requests, re, io, time
from requests.adapters import HTTPAdapter, Retry
import pandas as pd
import numpy as np
from proteinshake.utils import progressbar
def uniprot_query(query, columns='', verbosity=2):
columns = 'accession,'+columns
re_next_link = re.compile(r'<(.+)>; rel="next"')
retries = Retry... | Python | 1 |
### CLASES ###
class Animal:
def __init__(self , animal):
self.animal = animal
def caminar (self ):
print(self.animal , "esta caminando")
def comer (self):
print(self.animal , "esta comiendo")
def dormir (self):
print(self.animal, "esta durmiendo")
myanimal = A... | Python | 1 |
syncio
async def test_generate_voice_error_response(self, client):
"""Test generate_voice with error response."""
# Create error response
error_response = MagicMock()
error_response.status_code = 500
error_response.text = "Server Error"
# Create request
reque... | Python | 1 |
ACT != 0 && new_vmo_flags & VMO_FLAG_WRITE != 0 {
return Err(Status::NOT_SUPPORTED);
}
// We use shared mode by default, if the caller did not specify. It should be more
// lightweight, I assume? Except when a writable share is necessary. `VMO_FLAG_EXACT |
// VMO_FLAG_WRI... | Rust | 0 |
finalbody=[],
)
j.body.append(
ast.Raise(
exc=ast.Call(
func=ast.Name(id="MemoryError", ctx=ast.Load()),
args=[],
keywords=[ast.Str(s=[True])],
),
... | Python | 1 |
tle='Timepoint', yaxis_title='{} value'.format(choice))
else:
fig.add_trace(go.Scatter(x=np.arange(seq_len + pred_len),y=pred_data,mode='lines',name="Prediction",line = dict(color='royalblue', width=1.5)))
fig.add_trace(go.Scatter(x=np.arange(seq_len),y=original_data,mode='lines',name="Original Data... | Python | 1 |
mut tracker = tracker.clone();
tracker.visited.push(here.clone());
(true, tracker)
} else {
if tracker.twice {
(false, tracker)
} else {
let mut tracker = tracker.clone();
tracker.twice = true;
(true, tracker)
}
}
} else {
... | Rust | 0 |
h',
'numba/_pymodule.h',
'numba/core/runtime/_nrt_python.c'],
**np_compile_args)
ext_jitclass_box = Extension(name='numba.experimental.jitclass._box',
sources=['numba/expe... | Python | 1 |
o())
),
None => future::Either::B(future::ok(())),
}
};
// evaluate whether the block is actually valid.
// it may be better to delay this until the delays are finished
let evaluated = match self.client.execute_block(&self.parent_id, &unchecked_proposal.clone())
.map_err(Error::from) {
Ok(())... | Rust | 0 |
from kivy.lang.builder import Builder
from kivymd.toast import toast
from kivymd.uix.screen import MDScreen
Builder.load_string(
"""
<MyAKOnboardingItem@AKOnboardingItem>
source: ""
text: ""
title: ""
MDFloatLayout:
Image:
source: root.source
pos_hint: {"center_x":... | Python | 1 |
(method);
if method.is_static {
quote! {
#method_name {
unimplemented();
}
}
} else {
let tokens = gen_jni_call_non_static(method);
quote! {
#method_name {
#tokens
}
}
}
}
fn gen_jni_cal... | Rust | 0 |
IANT");
Ok(())
}
fn generate_readme() {
// Check for environment variable "SKIP_README". If it is set,
// skip README generation
if env::var_os("SKIP_README").is_some() {
return;
}
let mut source = File::open("src/main.rs").unwrap();
let mut template = File::open("README.tpl").unw... | Rust | 0 |
START-ฦ", "START-ฦ", "START-ฦ"], [1,1,0,1,0,0,1,0,0,0,0]), (["START-ฤ", "START-ฤ", "START-ฤ"], [1,1,0,1,0,0,1,1,1,0,0]),
];
// Stop sequence.
const STOP: Encoding = [1,1,0,0,0,1,1,1,0,1,0];
// Termination sequence.
const TERM: [u8; 2] = [1,1];
/// The Code128 barcode type.
#[derive(Debug)]
pub struct Code128(Vec<Un... | Rust | 0 |
).unwrap();
let f = next.chars().next().unwrap();
!char_has_case(l) && !char_has_case(f)
} else {
false
};
(acc + if join { "_" } else { "" } + &next, Some(next))
})
.0
}
impl NonCamelCaseTypes {
fn check_case(&self... | Rust | 0 |
::new(bits))
}
#[doc = r"Get enumerated values variant"]
#[inline(always)]
pub fn variant(&self) -> SRAMLAP_A {
match self.bits {
0 => SRAMLAP_A::SRAMLAP_0,
1 => SRAMLAP_A::SRAMLAP_1,
2 => SRAMLAP_A::SRAMLAP_2,
3 => SRAMLAP_A::SRAMLAP_3,
... | Rust | 0 |
ile_path=False) # internal 404
def test_fetch_js_code_url_unexpected_exception(monkeypatch: MonkeyPatch):
def fake_requests_get(*args, **kwargs) -> str:
raise Exception() # simulate some other exception being raised
from pmp_manip.ext_info_gen import fetch_js as fetch_js_mod
monkeypatch.setatt... | Python | 1 |
Type::Path(ref mut _binding_0, ) => {
_visitor.visit_type_path_mut(_binding_0);
}
Type::TraitObject(ref mut _binding_0, ) => {
_visitor.visit_type_trait_object_mut(_binding_0);
}
Type::ImplTrait(ref mut _binding_0, ) => {
_visitor.visit_type_imp... | Rust | 0 |
trans_language_By_GTP(en_srt,country_srt,whisper)
#ๆง่กๅๅปบๅๆ
# self.run_script(root_path,country, tts,whisper,add_bg_sound,enable_top_video,enable_mark,enable_shu_video)
executor.submit(self.run_script,root_path,country, tts,whisper,add_bg_sound,enable_top_video,enable_mark,add_... | Python | 1 |
// Slight hack: this is just to get a recursion started with some environment.
/// Only use this in tests or at the top level; this discards any non-phase-0-environments!
pub fn new_wrapper(env: ResEnv<Mode::Elt>) -> LazyWalkReses<Mode> {
LazyWalkReses {
env: env.clone(),
prelude... | Rust | 0 |
let genl = Genlmsghdr::deserialize(&mut mem).unwrap();
assert_eq!(genl, genl_mock)
}
#[test]
#[ignore]
pub fn test_resolve_genl_family() {
let mut s = NlSocket::connect(NlFamily::Generic, None, None, true).unwrap();
let id = s.resolve_genl_family("acpi_event").unwrap();
... | Rust | 0 |
est]
fn insert2() {
let mut v = NeighborMap::new();
let addr1: IpAddr = "192.168.55.1".parse::<IpAddr>().unwrap();
let addr2: IpAddr = "192.168.55.1".parse::<IpAddr>().unwrap();
let n1 = Neighbor { ipaddr: addr1 };
let n2 = Neighbor { ipaddr: addr2 };
let ret = v.ins... | Rust | 0 |
t("Please pick 1 points")
picked_points = self.pick_points(pcd_front)
if(len(picked_points)==0):
exit()
picked_coord = np.asarray(pcd_front.select_by_index(picked_points).points)
dist_to_plane = 1000000 #Distance picked point... | Python | 1 |
"""
/*
* Crea una funciรณn que reciba un nรบmero decimal y lo trasforme a Octal
* y Hexadecimal.
* - No estรก permitido usar funciones propias del lenguaje de programaciรณn que
* realicen esas operaciones directamente.
*/
"""
def octal_hexadecimal(number):
table_hexa = {'10':'A', '11':'B', '12':'C', '13':'D', '14... | Python | 1 |
'.format(3), rasterized=True, alpha=0.5)
geon_model.append({'name': 'sphere', 'model': [sphere_coefficients[0:3],
sphere_coefficients[-1],
min_lst[0],
... | Python | 1 |
# -*- coding: utf-8 -*-
import numpy as np
import geatpy as ea # ๅฏผๅ
ฅgeatpyๅบ
class soea_DE_best_1_L_templet(ea.SoeaAlgorithm):
"""
soea_DE_best_1_L_templet : class - ๅทฎๅ่ฟๅDE/best/1/L็ฎๆณ็ฑป.
็ฎๆณๆ่ฟฐ:
ๆฌ็ฎๆณ็ฑปๅฎ็ฐ็ๆฏ็ปๅ
ธ็DE/best/1/Lๅ็ฎๆ ๅทฎๅ่ฟๅ็ฎๆณใ็ฎๆณๆต็จๅฆไธ๏ผ
1) ๅๅงๅๅ้่งฃ็ง็พคใ
2) ่ฅๆปก่ถณๅๆญขๆกไปถๅๅๆญข๏ผๅฆๅ็ปง็ปญๆง่กใ
3) ๅฏนๅฝๅ... | Python | 1 |
initial_records: fn(&SignatureKeyPair) -> Result<Vec<String>>,
) -> Result<()> {
for record in initial_records(key_pair)? {
info!(
"Inserting in collection {} pre-installed record {}",
ds.name(),
record
);
match ds.insert(&record) {
Ok(_) ... | Rust | 0 |
0, 1), 1000, 0.0],
[geom.Vector3d(0, 0,-1), -1000, 0.0],
[geom.Vector3d(0, 0, 1), 1000, 1000],
[geom.Vector3d(0, 0,-1), -1000, -1000]]
error= 0.0
for values, refValues in zip(MzValues,refMzValues):
error+= (values[0]-refValues[0]).getModulus() # Direction vector.
... | Python | 1 |
Size of: " , stringify ! ( _PRIVATE ) ));
assert_eq! (::std::mem::align_of::<_PRIVATE>() , 2usize , concat ! (
"Alignment of " , stringify ! ( _PRIVATE ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const _PRIVATE ) ) . integrityOuter as * const
_ as usize } , 0usize ,... | Rust | 0 |
# f = open("data.txt","r")
# print(f.read())
#if you want to read the file then you have to mention that how much you want to read by passing some digit. or index number.
# f = open("data.txt","r")
# print(f.read(6))
# if you wnat ot add something or write something in your file then you have to write "w" rather tha... | Python | 1 |
lf) -> *mut libc::c_void;
/// Enables or disables mouse and keyboard input to the specified window.
///
/// A window must be enabled before it can be activated.
/// If an application has create a modal dialog box by disabling its owner window
/// (as described in [`WindowBuilderExtWindows::with_own... | Rust | 0 |
ter { str: "12xy" };
assert_eq!(Some(StringElement::Digits("12")), iter.next());
assert_eq!(Some(StringElement::Characters("xy")), iter.next());
assert_eq!(None, iter.next());
let mut iter = StringElementIter { str: "xy12" };
assert_eq!(Some(StringElement::Characters("xy")), ite... | Rust | 0 |
ormeta(system="", code="7", message="Not found.", status_code=404)]
NotFound,
/**
PermissionDenied ๅฎขๆท็ซฏๆฒกๆ่ถณๅค็ๆ้ใ ๅ็่ฟ็งๆ
ๅต็ๅๅ ๅฏ่ฝๆฏOAuthไปค็ๆฒกๆๆญฃ็กฎ็ไฝ็จๅ๏ผๅฎขๆท็ซฏๆฒกๆๆ้๏ผๆ่
APIๅฐๆชไธบๅฎขๆท็ซฏ้กน็ฎๅฏ็จใ
Mapping:
- `google.rpc.Code.PERMISSION_DENIED`
- http status code: 403 Forbidden
The caller does not have permission to execu... | Rust | 0 |
, SecretKey, Signature, Signer, Verifier};
use rand::rngs::OsRng;
use std::convert::TryFrom;
use pkcs8::PrivateKeyInfo;
use ring::rand as rrand;
use ring::signature::KeyPair as rKeyPair;
use ring::signature::{self};
// +-------+---------------------------------------+
// | Value | X.509 Public Key Algorithm ... | Rust | 0 |
import requests
import time
import re
valutes = [
"AUD","AZN","GBP","AMD",
"BYN","BGN","BRL","HUF",
"VND","HKD","GEL","DKK",
"AED","USD","EUR","EGP",
"INR","IDR","KZT","CAD",
"QAR","KGS","CNY","MDL",
"NZD","NOK","PLN","RON",
"XDR","SGD","TJS","THB",
"TRY","TMT","UZS","UAH",
"CZK... | Python | 1 |
mut W {
self.variant(RXINTMSK_A::RXINTMSK_0)
}
#[doc = "Interrupt generated"]
#[inline(always)]
pub fn rxintmsk_1(self) -> &'a mut W {
self.variant(RXINTMSK_A::RXINTMSK_1)
}
#[doc = r"Sets the field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self... | Rust | 0 |
"""
store the current version info of the notebook.
"""
import re
# Version string must appear intact for tbump versioning
__version__ = '6.5.2'
# Build up version_info tuple for backwards compatibility
pattern = r'(?P<major>\d+).(?P<minor>\d+).(?P<patch>\d+)(?P<rest>.*)'
match = re.match(pattern, __version__)
parts... | Python | 1 |
value = data_table[ord(bytecode[pc + 1])]
print(f'0x{pc:05X} PUSH {value}')
stack.append(value)
pc += 2
elif code == 0xe:
if len(stack) == 0:
raise Exception('Stack underflow')
arg0 = stack.pop()
print(f'0x{pc:05X} POP {arg0}')
pc += 1
... | Python | 1 |
// FIXME: we should free the previous vm and set up a new vm
let page_table = unsafe { proc.vm.page_table() };
let mut mapper = unsafe { OffsetPageTable::new(page_table, VirtAddr::new(PAGE_OFFSET_BASE)) };
for ph in image_elf.program_headers {
if ph.p_type == elf::program_header::PT_LOAD {
... | Rust | 0 |
erive(Clone)]
pub struct ListingResults<T> {
page: Arc<Page<T>>,
}
impl<T> std::ops::Deref for ListingResults<T> {
type Target = [Resource<T>];
fn deref(&self) -> &[Resource<T>] {
&self.page.results
}
}
impl<T: Endpoint, A: Borrow<Api>> Listing<T, A> {
/// Creates a new resource listing.
///
/// Thi... | Rust | 0 |
lude = true;
break;
}
}
if should_exclude {
continue;
}
let out_path = &format!("{}/.{}", get_output_dir(), path_name);
links.push((path_str, out_path.to_string()));
}
}
Ok(links)
}
pub fn b... | Rust | 0 |
n: `{}`", @path_glob_source);
let mut path_pages = source.clone();
path_pages.push(dir_pages);
let index_file = config.index.as_ref().map(|index| {
let mut file = path_pages.clone();
file.push(index);
file
});
path_pages.push("**");
path_pages.push("*.md");
write_... | Rust | 0 |
riants_colours_from_detailed_view(source_model_index.as_ref());
// Clone the source colour variant, updating its relevant keys in the process.
let new_colour_variant_name = self.new_colour_variant_name_combobox.current_text();
let new_item = (*self.unit_variants_colours_list_model.i... | Rust | 0 |
# Drakkar-Software OctoBot-Trading
# Copyright (c) Drakkar-Software, All rights reserved.
#
# This library 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 Free Software Foundation; either
# version 3.0 of the License, or (... | Python | 1 |
e.line(),
column: e.column(),
category: format!("{:?}", e.classify()),
}
}
}
impl From<url::ParseError> for CoreError {
fn from(e: ParseError) -> Self {
CoreError::EndpointConfigError(format!("{:?}", e))
}
}
<gh_stars>0
extern crate sl_na;
extern crate sl_la;
exter... | Rust | 0 |
).unwrap();
}
Action::HostDeleteKey => {
let sequence = String::from("\x1b[3~").into_bytes();
writer.write(&sequence).unwrap();
}
_ => (),
}
writer.flush().unwrap();
None
})
}
<reponame>ethereumproject/emerald-r... | Rust | 0 |
#-----------------------------------------------------------------------------
# Copyright (c) 2021-2023, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License (version 2
# or later) with exception for distributing the bootloader.
#
# The full license is in the file COPYING.txt... | Python | 1 |
import pickle
import subprocess
import time
MaxProcesses = 10
Processes = []
def checkrunning():
for p in reversed(range(len(Processes))):
if Processes[p].poll() is not None:
del Processes[p]
return len(Processes)
iterations = 1000 #number of data to generate
#generate
for i in range(i... | Python | 1 |
ningLength;
use crate::v5::error::MqttError;
use crate::v5::error::MqttError::{EndOfStream, UnacceptableProperty};
use crate::v5::property::*;
use crate::v5::types::{ConnAck, ControlPacket, MqttCodec};
pub fn decode_connack(mut reader: Bytes) -> Result<Option<ControlPacket>, MqttError> {
end_of_stream!(reader.rema... | Rust | 0 |
"""Holds different classes to model atmospheric models."""
import astropy.units as u
from poliastro.core.earth_atmosphere.util import (
_check_altitude as _check_altitude_fast,
_get_index as _get_index_fast,
)
class COESA:
"""Class for U.S Standard Atmosphere models."""
def __init__(self, *tables):... | Python | 1 |
let parent_z = to_bytes(&record.parent_z)?;
write_alls!(writer, parent_z.as_slice(), b"+")?;
} else {
let z = -record.parent_z;
let parent_z = to_bytes(&z)?;
write_alls!(writer, parent_z.as_slice(), b"-")?;
}
writer.write_all(b"\n")?;
Ok(())
}
#[inline(always)]
fn... | Rust | 0 |
# Online Python compiler (interpreter) to run Python online.
# Write Python 3 code in this online editor and run it.
numLinha = int(input())
numColuna = int(input())
matriz = []
for i in range(numLinha):
linha = []
for j in range(numColuna):
linha.append(int(input()))
matriz.append(linha)
mess... | Python | 1 |
import streamlit as st
import pandas as pd
import pickle
# Load the trained model
model = pickle.load(open("updated_model_CP.pkl" , 'rb'))
df = pd.read_csv("car data.csv")
# Define the user input interface
st.title("Car Price Prediction")
st.write("Enter the car details below:")
# User inputs
unique_values = df["C... | Python | 1 |
from typing import Any, NamedTuple, cast
import numpy as np
# Subtype of tuple[int, int]
class XYGrid(NamedTuple):
x_axis: int
y_axis: int
# TODO: remove this cast after: https://github.com/numpy/numpy/pull/27171
arr: np.ndarray[XYGrid, Any] = cast(
np.ndarray[XYGrid, Any],
np.empty(XYGrid(2, 2)),
)... | Python | 1 |
W { w: self }
}
#[doc = "Bits 10:11"]
#[inline(always)]
pub fn flash_page_size(&mut self) -> FLASH_PAGE_SIZE_W {
FLASH_PAGE_SIZE_W { w: self }
}
#[doc = "Bit 9"]
#[inline(always)]
pub fn flash_type(&mut self) -> FLASH_TYPE_W {
FLASH_TYPE_W { w: self }
}
#[doc = "B... | Rust | 0 |
_context: &QueryBuildContext, schema: &Schema) -> Query {
let query = Query::MultiTerm {
field: schema.get_field_by_name(&self.field).unwrap(),
term_selector: MultiTermSelector::Prefix(self.prefix.clone()),
scorer: TermScorer::default(),
};
// Add boost
... | Rust | 0 |
"""Plotly
Examples of visualizing plotly plots in Viser."""
import time
import numpy as onp
import plotly.express as px
import plotly.graph_objects as go
from PIL import Image
import viser
def create_sinusoidal_wave(t: float) -> go.Figure:
"""Create a sinusoidal wave plot, starting at time t."""
x_data = ... | Python | 1 |
id: String },
/// How many changes has occurred to this token
ChangeDynamics { token_id: String },
/// With MetaData Extension.
/// Returns metadata about one particular token, based on *ERC721 Metadata JSON Schema*
/// but directly from the contract: `NftInfoResponse`
ImageInfo { img_uri: Strin... | Rust | 0 |
= 0;
let mut de_dw_total:Vec<Vec<Vec<f64>>> = Vec::with_capacity(self.layers.len());
for l in 0..self.units.len() - 1 {
let mut layer:Vec<Vec<f64>> = Vec::with_capacity(self.units[l].0 + 1);
layer.resize(self.units[l].0 + 1,Vec::with_capacity(self.units[l+1].0 + 1));
for e in layer.iter_mut() {
... | Rust | 0 |
tResult {
let mut result = KaramelAstType::None;
loop {
if let Ok(token) = parser.peek_token() {
match token.token_type {
KaramelTokenType::NewLine(_) => {
parser.indentation_check()?;
result = KaramelAstType... | Rust | 0 |
tton(MouseButton::Right).is_pressed() {
color.0 = Color::DARK_GREEN;
} else if mouse.button(MouseButton::Middle).is_pressed() {
color.0 = Color::RED;
}
}
}
struct KeyboardState;
#[singleton]
impl KeyboardState {
fn build() -> impl Built<Self> {
EntityBuilder::ne... | Rust | 0 |
alizes fields for the body of a case class declaration
fn case_class_fields(&self) -> String {
let fs: Vec<String> = self.fields.iter().map(|f| format!("{}:{}", f.name, f.java_type)).collect();
fs.join(",")
}
/// Serializes fields to initialize a case class from a Javolution object
fn ca... | Rust | 0 |
frequencies] 20\n\
! test\n\
[matrix format] Lower\n\
[two-port order] 12_21\n\
! test\n\
[Number of noise frequenCIES] 1\n\
! test\n\
[Reference]\n\
! This on... | Rust | 0 |
nish cancelling
cancel_done_rx.await.unwrap();
// should get an error when trying to send
match substream.send(bytes::Bytes::from_static(res_data)).await {
Err(err) => assert_eq!(io::ErrorKind::BrokenPipe, err.kind()),
res => panic!("listener: Unexpected result: {:?}", r... | Rust | 0 |
/// doc: Foreign<String>,
/// }
///
/// let visitor = anchors!["my-anchor" => "doc in anchor"];
/// let n_doc = node!({"doc" => "my doc"});
/// let n_anchor = node!({"doc" => node!(*"my-anchor")});
/// assert_eq!("my doc", n_doc.with(&visitor, "doc", "error!", Node::as_str).unwrap());
... | Rust | 0 |
fill: Filler) {
// debug!("Draw pixel {} {} {:?}", x, y, fill);
self.rb.print_char(x, y, RB_BOLD, White, fill.into(), PIXEL);
}
fn flush(&mut self) {
self.rb.present();
}
fn clear(&mut self) {
self.rb.clear();
for x in 0..WIDTH {
for y in 0..HEIGHT ... | Rust | 0 |
"""
ๆไปถๅทฅๅ
ทๅฝๆฐ - ็ปไธ็ๆไปถๆไฝๅทฅๅ
ท้
"""
import os
import time
import requests
import hashlib
import json
import shutil
from typing import Optional, Dict, List, Union, Callable
from pathlib import Path
from contextlib import contextmanager
from concurrent.futures import ThreadPoolExecutor, as_completed
from urllib.parse import url... | Python | 1 |
> bool
{
self.lack_of_power
}
#[allow(missing_docs)]
#[inline(always)]
pub const fn no_power_delivery_communication(&self) -> bool
{
self.lack_of_power
}
#[inline(always)]
fn parse(version: Version, device_capability_bytes: &[u8]) -> Option<Self>
{
if version.is_0x0110_or_greater()
{
let bAddit... | Rust | 0 |
# Copyright (c) Streamlit Inc. (2018-2022) Snowflake Inc. (2022)
#
# 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 appl... | Python | 1 |
ale_t,
lvl: iwlog_lvl,
ecode: iwrc,
errno_code: ::std::os::raw::c_int,
werror_code: ::std::os::raw::c_int,
file: *const ::std::os::raw::c_char,
line: ::std::os::raw::c_int,
ts: u64,
opts: *mut ::std::os::raw::c_void,
fmt: *const ::std::os::raw::c_c... | Rust | 0 |
"""แแแฌแแ แแ แจแแแแฎแแแแแแ แ แแชแฎแแแแแก แแแแแ แแขแแ แ Python- แจแ. แแแ แฃแแแ แแแแแแงแแแแก แแแแแแ แแ แคแแแแแฃแ แ แแแแแแแขแ.
แแแก แแแแกแแฎแแ แชแแแแแแแแ แจแแแแซแแแแ แแแแแแงแแแแ แฎแแ, แแแฃแกแแก แแแซแ แแแแ, แแ แแชแแกแแ แแก แกแแฉแฅแแ แ แแ แแแแแกแแแแ แ แกแฎแแ แคแแแแแฃแ แ แกแขแ แฃแฅแขแฃแ แ.
แจแแแแฎแแแแแแ แ แแชแฎแแแก แกแแแ แซแ แฃแแแ แแงแแก 16 แแแขแ. แแแแแแงแแแแ แกแแญแแ แ แแแแแแแแแแแแ.
"""
import time... | Python | 1 |
-8') as rf:
rf.write(f"JavaScript Dev Setup Report - {report_timestamp}\n")
rf.write("\nDetected tool status:\n")
for tool, installed in tools_status.items():
rf.write(f" {tool}: {'Installed' if installed else 'Not found'}\n")
rf.write("\nActions performe... | Python | 1 |
G",
13,
37,
0x40D21,
vec![0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x50, 1, 1, 37, 0]
);
set_pokedex_entry_test!(
set_pokedex_entry_151,
151,
"ABCDEFGHIJ",
13,
37,
0x40746,
vec![0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x50, 1, 1, 37, 0]
);
// Problem 2
/... | Rust | 0 |
here.";
let tcp = TcpTransport::create(&ctx).await?;
tcp.connect(hub).await?;
let vault_address = Vault::create(&ctx, SoftwareVault::default()).await?;
SecureChannel::create_listener(&ctx, "secure_channel", &vault_address).await?;
ctx.start_worker("echo_service", EchoService).await?;
let ... | Rust | 0 |
from ravyn import Include, WebSocket, WebSocketGateway, websocket
from ravyn.applications import Ravyn
@websocket(path="/")
async def websocket_endpoint_switch(socket: WebSocket) -> None:
await socket.accept()
await socket.send_json({"URL": str(socket.path_for("websocket_endpoint"))})
await socket.close()... | Python | 1 |
chc
}
/// Helper function.
///
/// Returns an `AluResult` of the addition of two `u16`s.
pub fn u16_add(first: u16, second: u16) -> AluResult<u16> {
let mut chc = AluResult::default();
let (res, cry) = first.overflowing_add(second);
chc.result = res;
chc.carry = cry;
if chc.result == 0 {
... | Rust | 0 |
,
"i_a": -1 if input_currents.low[0] == -1 else 0,
"i_e": -1 if input_currents.low[0] == -1 else 0,
"u": -1 if input_voltages.low[0] == -1 else 0,
}
high = {
"omega": 1,
"torque": 1,
"i_a": 1,
"i_e": 1,
"u": ... | Python | 1 |
#!/usr/bin/env python
import unittest
from ternip.formats.gate import GateDocument
from ternip.timex import Timex
class GateDocumentTest(unittest.TestCase):
def test_get_sents(self):
t = GateDocument("""This POS B 20101010
is POS I
a POS I
sentence POS I
. . I
And POS B
a POS I
second POS I
sentence ... | Python | 1 |
import numpy as np
import cv2
enc = cv2.imread('enc.png')
size_x, size_y = enc.shape[:2]
dec = np.zeros_like(enc)
dec[0, 0] = [141, 195, 241] #initially decrypted pixel
for j in range(1, size_y):
compare = dec[0, j - 1].astype(int)
perm = np.zeros((6, 8, 3), dtype=int)
for row in range(6):
for... | Python | 1 |
psi.fillna(0))
return df_psi
def add_bins(self, df_psi: pd.DataFrame) -> pd.DataFrame:
""""""
df_psi['min_bin'] = self.cut_bins[: -1]
df_psi['max_bin'] = self.cut_bins[1:]
return df_psi
def _value_decimal(self, psi: pd.DataFrame) -> pd.DataFrame:
""""""
... | Python | 1 |
import csv
import json
from langchain_community.vectorstores import FAISS
from langchain.docstore.document import Document
from langchain.text_splitter import CharacterTextSplitter
def build_documents(filename):
documents = []
# Load playlist.csv
with open(filename, "r", newline="") as csv_file:
c... | Python | 1 |
for i, score in zip(top_k_indices, top_k_scores)
]
return CrossEncoderResult(
total_tokens=total_tokens,
results=results,
)
def _compute_scores(
self, queries: list[str], documents: list[str], batch_size: int, show_progress: bool, **kwargs
) -> tuple... | Python | 1 |
= np.load(precomputed_path, allow_pickle=True).item()
lang = Language(data=train_data, precomputed=precomputed, lang=synthetic_lang)
feat_range_mappings = obtain_feat_range_mappings(train_dataset)
trainer = Trainer_global(lang=lang, train_dataset=train_dataset,
test_dataset = te... | Python | 1 |
class Products(object):
"""The Products class is the main entrypoint for all product related data within soc-faker
Returns:
Products: A class which contains properties about different security products
"""
@property
def azure(self):
"""Azure class contains properties related to Az... | Python | 1 |
path: &warp::path::FullPath, moment: u64) -> String {
format!("{}?after={}", path.as_str(), moment)
}
fn parse_subscription<'a>(params: &'a HashMap<String, Vec<String>>) -> Subscription {
let mut events = match (params.get("events"), params.get("event")) {
(Some(e1), Some(e2)) => e1.iter().chain(e2).ma... | Rust | 0 |
blobstore` in order to have
//! permission to communicate with the store.
//!
//! This generic protocol can be used to support capability providers like local blob storage,
//! Amazon S3, Azure blob storage, Google blob storage, and more.
//!
//! # Example:
//!
//! ```rust
//! extern crate wapc_guest as guest;
//! use ... | Rust | 0 |
odable, Error, Result, Tag, TaggedSlice, TagLike};
use super::{Taggable, Tagged, Container};
// The types [u8; 2], [u8; 3], [u8; 4] stand in here for any types for the fields
// of a struct that are Decodable + Encodable. This means they can decode to/encode from
// a byte slice, but also that thye can... | Rust | 0 |
e field bit"]
#[inline(always)]
pub fn set_bit(self) -> &'a mut W {
self.bit(true)
}
#[doc = r"Clears the field bit"]
#[inline(always)]
pub fn clear_bit(self) -> &'a mut W {
self.bit(false)
}
#[doc = r"Writes raw bits to the field"]
#[inline(always)]
pub fn bit(se... | Rust | 0 |
#[doc = " \\extends vx_reference"]
#[doc = " \\ingroup group_convolution"]
pub type vx_convolution = *mut _vx_convolution;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct _vx_remap {
_unused: [u8; 0],
}
#[doc = " \\brief The remap table Object. A remap table contains per-pixel mapping of"]
#[doc = " output pixe... | Rust | 0 |
}
}
} else {
return Err(e);
}
},
}
}
}
}
/// This function defines errors that are per-connection. Which basically
/// means that if we get this error from `accept()` system call i... | Rust | 0 |
on_checking
)
return success
def block_socket_merge(
socket_1: "BlockSocket", socket_2: "BlockSocket", global_network: "NodeRoadNetwork", positive_merge: False
):
global_network.graph[socket_1.positive_road.start_node][socket_2.negative_road.start_node] = \
global_network.graph[socket_1.positi... | Python | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.