text string | label_name string | labels int64 |
|---|---|---|
RIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* Apache license, Version 2.0
*
* Copyright (c) 2018-2022 <NAME>os Software
*
* L... | Rust | 0 |
, 3]),
("b1", &vec![4, 5, 7]),
("c1", &vec![7, 8, 9]),
);
let right = build_table(
("a2", &vec![10, 20, 30]),
("b1", &vec![4, 5, 6]), // 6 does not exist on the left
("c2", &vec![70, 80, 90]),
);
let on = &[("b1", "b1")];
... | Rust | 0 |
foob");
let fooo = InvertIndex::from(baar.clone());
assert_eq!(baar.query("oof"), fooo.query("oof"));
}
#[test]
fn test_start_end_sensitive() {
let mut baar = InvertIndex::<&str>::default();
baar.insert_bounded("blazed", "Adiaeresis");
baar.insert_bounded("crazed"... | Rust | 0 |
self) -> bool {
*self == EVOBS_SEL_A::AUXIO25
}
#[doc = "Checks if the value of the field is `AUXIO24`"]
#[inline(always)]
pub fn is_auxio24(&self) -> bool {
*self == EVOBS_SEL_A::AUXIO24
}
#[doc = "Checks if the value of the field is `AUXIO23`"]
#[inline(always)]
pub fn ... | Rust | 0 |
KNNAlgorithm::CoverTree(ref cover) => cover.find_radius(from, radius),
}
}
}
<gh_stars>1-10
pub mod mem;
use libbarrelfish::pci::*;
use libbarrelfish::*;
use libc;
/// Has to be > 0xffff
pub const PCI_DONT_CARE: u32 = 0x10000;
#[derive(Debug)]
pub struct PciDriver {
bus: u32,
dev: u32,
fu... | Rust | 0 |
elf.surface_config.width,
physical_height: self.surface_config.height,
scale_factor: self.window.scale_factor() as f32,
};
self.render_pass.update_texture(
&self.device,
&self.queue,
&self.platform.context().texture(),
);
self.r... | Rust | 0 |
Yc @` ss d d l m Z m Z m Z m Z d d l Z d d l m Z m Z d Z d Z
d e j e f d YZ d S( i ( t absolute_importt divisiont print_functiont unicode_literalsN( t ABCMetat abstractmethodu Kiran Mathewu kmathew@lbl.govt AbstractBuilder... | Python | 1 |
get_pointer_width = "64")]
#[test]
#[should_panic]
fn bsl64_ll32_empty() { BitSlice::<Lsb0, u64>::empty().load_le::<u32>(); }
#[cfg(target_pointer_width = "64")]
#[test]
#[should_panic]
fn bsl64_ll64_empty() { BitSlice::<Lsb0, u64>::empty().load_le::<u64>(); }
#[cfg(target_pointer_width = "64")]
#[test]
#[should_pani... | Rust | 0 |
OUR_WIRE_1 = 1,
}
impl From<DETECT_FOUR_WIRE_A> for bool {
#[inline(always)]
fn from(variant: DETECT_FOUR_WIRE_A) -> Self {
variant as u8 != 0
}
}
#[doc = "Reader of field `DETECT_FOUR_WIRE`"]
pub type DETECT_FOUR_WIRE_R = crate::R<bool, DETECT_FOUR_WIRE_A>;
impl DETECT_FOUR_WIRE_R {
#[doc = r"G... | Rust | 0 |
able and unsuitable for comparing as test outputs.
if not verbose:
_m5.core.setLogLevel(_m5.core.LogLevel.WARN)
# instantiate configuration
m5.instantiate()
# Determine the switching period, this has to be done after
# instantiating the system since the time base must be fixed.
period ... | Python | 1 |
let fields: Vec<quote::Tokens> = fields.iter().map(|ref fld| {
let id = fld.ident.as_ref().unwrap().clone();
quote!{ #id }
}).collect();
let fields2 = fields.clone();
let fields3 = fields.clone();
quote! {... | Rust | 0 |
t(num_batches * batch_size - len(idx))
idx += idx[:add_for_full_batches]
preds = np.zeros(([int(num_batches * batch_size)] + list(self.output_layer.output_shape[1:])))
for b in range(num_batches):
preds[idx[b*batch_size : (b+1) * batch_size]] = self.pred_proba(X[idx[b*batch_size : (b... | Python | 1 |
scribe<Observer>(self, observer: Observer)
where
Observer: core::Observer<Cancellable, Item, Error> + Send + 'static,
{
let observable = self.observable;
self.scheduler.schedule(async move {
observable.subscribe(observer).await;
});
}
}
#[cfg(test)]
mod tests {
... | Rust | 0 |
e_using_json_rpc(&config);
verify_init_and_basic_rotation(node);
}
fn verify_init_and_basic_rotation<T: LibraInterface>(mut node: Node<T>) {
// Verify correct initialization (on-chain and in storage)
assert!(node.key_manager.compare_storage_to_config().is_ok());
assert!(node.key_manager.compare_info_to... | Rust | 0 |
glium::index::NoIndices(glium::index::PrimitiveType::TrianglesList),
&program,
&glium::uniform! {
matrix : matrix,
perspective: perspective,
view: view,
u_light: ligh... | Rust | 0 |
ta.bytecode_runtime.hex()}"
def build_opcodes_output(compiler_data: CompilerData) -> str:
return _build_opcodes(compiler_data.bytecode)
def build_opcodes_runtime_output(compiler_data: CompilerData) -> str:
return _build_opcodes(compiler_data.bytecode_runtime)
def _build_opcodes(bytecode: bytes) -> str:
... | Python | 1 |
<a href="/blogdata/feed.xml">{"RSS"}</a>
</div>
</div>
</div>
<div class="col-auto">
<div class="form-row">
<div cl... | Rust | 0 |
::record::RecordSet;
use dataplane::Offset;
use fluvio_storage::{FileReplica, StorageError, ReplicaStorage};
use fluvio_types::SpuId;
use crate::replication::leader::ReplicaOffsetRequest;
use crate::core::DefaultSharedGlobalContext;
use crate::storage::SharableReplicaStorage;
use super::group::FollowerGroups;
pub typ... | Rust | 0 |
/// the result is zero
fn logical_shift_right8(&mut self, data: u8) -> u8 {
self.p.c = data & 0x01 > 0;
let result = data >> 1;
self.p.n = result > 0x7F;
self.p.z = result == 0;
result
}
/// Returns the data shifted right by one
///
/// Low bit is shifted to ... | Rust | 0 |
{
ldfp ufp1, seg, sib, "DISPLACEMENT", dataSize=8
ldfp ufp2, seg, sib, "DISPLACEMENT + 8", dataSize=8
pack xmml, xmml, xmmh, ext=0, srcSize=2, destSize=1
pack xmmh, ufp1, ufp2, ext=0, srcSize=2, destSize=1
};
def macroop PACKUSWB_XMM_P {
rdip t7
ldfp ufp1, seg, riprel, "DISPLACEMENT", dataSize... | Python | 1 |
′ are IORs
// we can have in some cases e.g.
// $ sin(θ′) = 1.5 * sin(θ)
// which for some values of θ has no solution.
// e.g. when θ=90dgr the right side is 1.5 and sin(θ′) will never have this value
let cannot_refract = etai_over_etat * sin_theta > 1.0;
if cannot_refract {
return None;
}
let r... | Rust | 0 |
def checkTriangle(a,b,c):
if(a==b==c):
print ("equilateral triangle.")
elif ((a==b and a!=c) or (a!=b and b==c) or (a==c and a!=b)):
print("Isosceles triangle.")
elif(a!=b!=c):
print("Scalene triangle.")
checkTriangle(1,2,3)
checkTriangle(2,2,3)
checkTriangle(3,3,3)
x,y=10,20
prin... | Python | 1 |
_type: stringify!($name).into()
}),
}
}
}
impl<'s> ::std::convert::TryFrom<&::segsource::Segment<'s, u8>> for $name {
type Error = crate::Error;
fn try_from(segment: &::segsource::Segment<'s, u8>)
-> ::std::res... | Rust | 0 |
def déchiffrement_vigenere(texte: str, cle: str) -> str:
"""Fonction qui déchiffre un texte avec la méthode de Vigenère .
Args:
texte (str): Texte chiffré
cle (str): clef de chiffrement
Returns:
str: Texte déchiffré
"""
texte_dechiffre = []
longueur_cle = len(cle)
i... | Python | 1 |
_ns: nanotime(),
..Event::default()
}
}
/// atomically count up from 0 to a given max
/// and fail incrementing further if that max is reached.
struct AtomicMaxCounter {
counter: AtomicUsize,
max: usize,
}
impl AtomicMaxCounter {
fn new(max: usize) -> Self {
Self {
counter:... | Rust | 0 |
mHiF)
setup_freq_power(sdrHiF, synthStreamHiF, freq_KHz, pwr)
else:
setup_freq_power(sdrHiF, synthStreamHiF, freq_KHz, pwr)
sdrHiF.deactivateStream(synthStreamHiF)
window["ActiveHiF"].Update(value=activeHiF)
if (activeHiF):
freq_KHz = freq_KHz + step_Hz
if (freq_KHz > freq_end*1000):
f... | Python | 1 |
, etc.
thread::spawn(|| console::connection::listen(grpc_handle, "http://[::1]:50051"));
let mut app = ui::App::new(app_handle)?;
app.run()?;
Ok(())
}
<gh_stars>0
use input::Input;
use ncurses;
use ncurses::ll::{attr_t, chtype, mmask_t};
use ncurses::NCURSES_ATTR_SHIFT;
pub use ncurses::{ACS_LLCORNER... | Rust | 0 |
tive.str.html#method.parse) method
//! on a string) can be used for parsing `DateTime<FixedOffset>`, `DateTime<Utc>` and
//! `DateTime<Local>` values. This parses what the `{:?}`
//! ([`std::fmt::Debug`](https://doc.rust-lang.org/std/fmt/trait.Debug.html))
//! format specifier prints, and requires the offse... | Rust | 0 |
import math
import traceback
import numpy as np
# TODO use Decimal not floats
# for get_dist_on_earth
GEO_R1 = 6378.137
GEO_R2 = 6356.752314140
GEO_R1_2 = (GEO_R1 * 1000) ** 2
GEO_R2_2 = (GEO_R2 * 1000) ** 2
GEO_E2 = (GEO_R1_2 - GEO_R2_2) / GEO_R1_2
G_DISTANCE_BY_LAT1S = GEO_R2 * 1000 * 2 * np.pi / 360 / 60 / 60 # ... | Python | 1 |
#!/usr/bin/python3
"""module json"""
import json
def to_json_string(my_obj):
"""
Returns:
str: The JSON representation of the object as a string.
"""
return json.dumps(my_obj)
| Python | 1 |
"""
Write a function to count bidirectional tuple pairs.
assert count_bidirectional([(5, 6), (1, 2), (6, 5), (9, 1), (6, 5), (2, 1)] ) == 3
"""
def count_bidirectional(tuples):
"""
:param tuples: list of tuples
:return: number of bidirectional pairs
"""
count = 0
for i in range(len(tuples)):
... | Python | 1 |
s = ['Open', 'High', 'Low', 'Close', 'Volume']
missing_columns = [col for col in required_columns if col not in ohlcv_data.columns]
if missing_columns:
return {'error': f'필수 컬럼 누락: {missing_columns}'}
# 데이터 타입 보장
print(f"🔍 데이터 타입 확인 및 변환...")... | Python | 1 |
ngsButton.setToolTip(
"Enable plugin and then click to configure")
if item.category in self.__pluginManager.inactivePlugins:
self.__pluginManager. \
inactivePlugins[item.category].append(item.plugin)
else:
self.__pluginMana... | Python | 1 |
}
}
pub(crate) fn message(&self, request: Request<Body>) -> ResponseFuture {
let flight_counter = Arc::clone(&self.in_flight);
self.in_flight.fetch_add(1, atomic::Ordering::SeqCst);
let (reply, response): (HttpResponseSender, HttpResponseReciever) = oneshot::channel();
... | Rust | 0 |
nuationEventArgs = _ns_module.WebUIFileSavePickerContinuationEventArgs
WebUIFolderPickerContinuationEventArgs = _ns_module.WebUIFolderPickerContinuationEventArgs
WebUILaunchActivatedEventArgs = _ns_module.WebUILaunchActivatedEventArgs
WebUILockScreenActivatedEventArgs = _ns_module.WebUILockScreenActivatedEventArgs
WebU... | Python | 1 |
app_dirs = ["/Applications", "/System/Applications"]
# app_paths = []
# for app_dir in app_dirs:
# for root, dirs, files in os.walk(app_dir):
# for item in dirs:
# if item.endswith('.app'):
# app_path = os.path.join(root, item)... | Python | 1 |
self.assertIn(book1, books_language, "Книга 'Изучаем Python' не найдена по языку Python")
# Тестирование поиска книг по ключевому слову в названии
def test_search_by_keyword(self):
library = Library()
book1 = Book("Изучаем Python", "Иван Иванов", 2021)
book2 = Book("Основы Python", "И... | Python | 1 |
val']:
eval(os.path.join(args.work_dir, 'tracking_result.json'),
args.version,
args.work_dir,
args.data_root
)
else:
print('Only support for v1.0-mini or v1.0-trainval')
def eval(res_path, version="v1.0-trainval", output_dir=None, root_path=None):
fro... | Python | 1 |
tType.SSTRING, ArgumentType.USTRING):
name = 'bytes'
elif type in (ArgumentType.WSTRING, ArgumentType.ASCII_STRING, ArgumentType.LATIN1_STRING, ArgumentType.UTF8_STRING):
name = 'bytes' if self.object.array is ArrayArgument.ARRAY else 'str'
elif type in (ArgumentType.BYTE, Argu... | Python | 1 |
a, O, I, E>> {
let Self { owner, inner, .. } = self;
Some(BoxOwned {
owner,
inner: inner?,
_phantom: PhantomData,
})
}
}
impl<'a, O, Ok, Err, E> BoxOwned<'a, O, Result<Ok, Err>, E>
where
O: ?Sized,
E: EqKind,
{
/// Transpose an [BoxOwned] of a... | Rust | 0 |