text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
use crate::block::DecompressError;
use crate::block::MINMATCH;
use crate::sink::{Sink, SliceSink, VecSink};
use alloc::vec::Vec;
/// Copies data to output_ptr by self-referential copy from start and match_length
#[inline]
unsafe fn duplicate(
output_ptr: &mut *mut u8,
output_end: *mut u8,
start: *const u8,... | the_stack |
use std::collections::HashSet;
use std::sync::{Arc, Mutex};
use address_space::Region;
use crate::errors::{ErrorKind, Result, ResultExt};
use crate::msix::Msix;
use crate::{
le_read_u16, le_read_u32, le_read_u64, le_write_u16, le_write_u32, le_write_u64, BDF_FUNC_SHIFT,
};
/// Size in bytes of the configuration ... | the_stack |
//! Group of function rules.
//!
//! The list of all function rules is provided by the PHP Language
//! Specification in the [Chapter chapter, Function Definition
//! section](https://github.com/php/php-langspec/blob/master/spec/19-grammar.md#function-definition).
use std::result::Result as StdResult;
use super::compo... | the_stack |
use libc::{c_int, c_uint, c_ulonglong, c_char, c_void, c_float, c_ushort, c_uchar};
use std::ffi::CString;
use std::fmt;
use ffi::ObjectType;
use ffi;
use bitmap::{IntHwlocBitmap, CpuSet, NodeSet};
#[repr(C)]
pub struct TopologyObject {
object_type: ObjectType,
os_index: c_uint,
name: *mut c_char,
me... | the_stack |
use std::fmt::{Display, Formatter};
use std::ops::Add;
use std::path::{Path, MAIN_SEPARATOR};
use nom::branch::alt;
use nom::bytes::complete::tag;
use nom::character::complete::{anychar, none_of};
use nom::combinator::{cond, map};
use nom::multi::{many0, separated_list};
use nom::sequence::tuple;
use nom::IResult;
use... | the_stack |
use std::borrow::Borrow;
pub use atty::Stream;
use lazy_static::lazy_static;
use crate::delta_e::ciede2000;
use crate::{Color, Lab};
lazy_static! {
static ref ANSI_LAB_REPRESENTATIONS: Vec<(u8, Lab)> = (16..255)
.map(|code| (code, Color::from_ansi_8bit(code).to_lab()))
.collect();
}
#[derive(Deb... | the_stack |
use regex_automata::DFA;
use crate::ext_slice::ByteSlice;
use crate::unicode::fsm::grapheme_break_fwd::GRAPHEME_BREAK_FWD;
use crate::unicode::fsm::grapheme_break_rev::GRAPHEME_BREAK_REV;
use crate::unicode::fsm::regional_indicator_rev::REGIONAL_INDICATOR_REV;
use crate::utf8;
/// An iterator over grapheme clusters i... | the_stack |
use crate::types::{self, Descriptor, DescriptorHeader, EndpointDescriptor};
use crate::{Error, Result};
use base::warn;
use data_model::DataInit;
use std::collections::BTreeMap;
use std::mem::size_of;
use std::ops::Deref;
#[derive(Clone)]
pub struct DeviceDescriptorTree {
// Full descriptor tree in the original fo... | the_stack |
use crate::{
counters,
pending_votes::{PendingVotes, VoteReceptionResult},
util::time_service::{SendTask, TimeService},
};
use consensus_types::{common::Round, sync_info::SyncInfo, vote::Vote};
use diem_logger::{prelude::*, Schema};
use diem_types::validator_verifier::ValidatorVerifier;
use futures::future:... | the_stack |
//! # Micro VM
//!
//! Micro VM is a extremely light machine type.
//! It has a very simple machine model, which benefits to a very short
//! boot-time and tiny memory usage.
//!
//! ## Design
//!
//! This module offers support for:
//! 1. Create and manage lifecycle for `Micro VM`.
//! 2. Set cmdline arguments paramet... | the_stack |
use std::collections::HashSet;
use std::fs::{File, OpenOptions};
use std::io::{Read, Write};
#[cfg(unix)]
use std::os::unix::fs::PermissionsExt;
use std::sync::Arc;
use itertools::Itertools;
use jujutsu_lib::backend::{Conflict, ConflictPart, TreeValue};
use jujutsu_lib::commit_builder::CommitBuilder;
use jujutsu_lib::... | the_stack |
use std::{net::IpAddr, str::FromStr};
use fancy_regex::Regex;
use serde_json::{Map, Value};
use url::Url;
use uuid::Uuid;
use crate::{
compilation::{context::CompilationContext, JSONSchema},
error::{error, no_error, ErrorIterator, ValidationError},
keywords::{pattern, CompilationResult},
paths::{Insta... | the_stack |
pub(crate) mod krate {
pub(crate) fn available(_: &str) -> &'static [&'static str] {
&["reverse", "oneshot", "prebuilt", "oneshotiter", "prebuiltiter"]
}
pub(crate) mod fwd {
use memchr::memmem;
pub(crate) fn oneshot(haystack: &str, needle: &str) -> bool {
memmem::find(... | the_stack |
use failure::_core::ops::{Deref, DerefMut};
use super::error::WalletError;
use mav::ma::{MEeeChainTx, MEeeTokenxTx};
use primitive_types::{U256, H160};
use eth::transaction::{Action, TypedTxId, TypedTransaction, EIP1559TransactionTx, AccessListTx};
use std::convert::TryInto;
#[derive(Debug, Default, Clone)]
pub struc... | the_stack |
use crate::mcasapi_wrapper::*;
use std::ffi::CString;
use std::os::raw::{c_char, c_void};
use std::slice;
type Status = status_t;
/*< error codes. see common/errors.h */
static S_OK: Status = 0;
static E_FAIL: Status = -1;
static E_INVAL: Status = -2;
static E_NOT_FOUND: Status = -4;
static E_BUSY: Status = -9;
// ... | the_stack |
use crate::{
bindings::kernel::user_regs_struct as native_user_regs_struct,
gdb_register::*,
kernel_abi::{x64, x86, SupportedArch, RD_NATIVE_ARCH},
kernel_supplement::{ERESTARTNOHAND, ERESTARTNOINTR, ERESTARTSYS, ERESTART_RESTARTBLOCK},
log::LogLevel::{LogError, LogInfo, LogWarn},
remote_code_pt... | the_stack |
use core::{
cmp::{self, Ordering},
fmt::{
Alignment, Binary, Debug, Display, Formatter, LowerHex, Octal, Result as FmtResult,
UpperHex,
},
str,
};
use super::{neg_abs, Fixed, FRAC_NBITS, MSB, NBITS};
// We need 130 bytes: 128 digits, one radix point, one leading zero.
//
// The leading... | the_stack |
use {
itertools::Itertools,
num_traits::{CheckedAdd, FromPrimitive, ToPrimitive},
rand::{
distributions::uniform::{SampleUniform, UniformSampler},
Rng, SeedableRng,
},
rand_chacha::ChaChaRng,
std::{
borrow::Borrow,
iter,
ops::{AddAssign, Div, Sub, SubAssig... | the_stack |
use std::{
borrow::{Borrow,BorrowMut},
error::Error as StdError,
future::Future,
hash::Hasher,
iter::FusedIterator,
io::{self, BufRead, IoSlice, IoSliceMut, Read, Seek, Write},
marker::{PhantomData, Unpin},
mem::ManuallyDrop,
ops::DerefMut,
pin::Pin,
ptr,
task::{Context... | the_stack |
use super::super::c;
use super::super::conv::ret;
#[cfg(feature = "time")]
#[cfg(any(target_os = "android", target_os = "fuchsia", target_os = "linux"))]
use super::super::time::types::LibcItimerspec;
use super::super::time::types::LibcTimespec;
use super::types::Timespec;
#[cfg(not(target_os = "wasi"))]
use super::typ... | the_stack |
use super::duration_histogram::DurationHistogram;
use apollo_spaceport::{ReferencedFieldsForType, ReportHeader, StatsContext};
use itertools::Itertools;
use serde::Serialize;
use std::collections::HashMap;
use std::ops::AddAssign;
use std::time::{Duration, SystemTime};
impl Report {
#[cfg(test)]
fn new(reports... | the_stack |
use super::{
address_space::{kernel_mapping::KernelMapping, MappingFlags},
on_create_task_common,
session_common::kill_all_tasks_common,
session_inner::{is_singlestep, PtraceSyscallSeccompOrdering},
task::{
replay_task::ReplayTaskIgnore,
task_common::{read_mem, read_val_mem},
... | the_stack |
use curl::http;
use crypto::hmac::Hmac;
use crypto::mac::Mac;
use crypto::digest::Digest;
use crypto::sha2::Sha512;
use std::io;
use std::io::Read;
use std::thread::sleep;
use std::time::Duration;
use std::io::{BufRead};
use std::ptr::null;
use rustc_serialize::hex::ToHex;
use rustc_serialize::{Decodable, Decoder};
... | the_stack |
use std::sync::Arc;
use std::fmt::Debug;
use tracing::{debug, error, instrument};
use fluvio_controlplane_metadata::partition::Replica;
use fluvio_types::SpuId;
use fluvio_storage::{ReplicaStorage};
use crate::config::SpuConfig;
use crate::replication::follower::FollowersState;
use crate::replication::follower::Shar... | the_stack |
use std::{
collections::HashMap,
fmt::{Debug, Display},
ops::RangeBounds,
};
use byteorder::{BigEndian, ByteOrder, ReadBytesExt, WriteBytesExt};
use super::{
btree::BTreeEntry,
by_id::{ByIdStats, UnversionedByIdIndex},
modify::Modification,
serialization::BinarySerialization,
PagedWrit... | the_stack |
#![feature(rustc_attrs, conservative_impl_trait, associated_consts, custom_derive, test, slice_patterns)]
// #![allow(unused_variables, dead_code,)]
extern crate tickgrinder_util;
extern crate rand;
extern crate futures;
extern crate uuid;
extern crate redis;
extern crate postgres;
extern crate serde;
extern crate ser... | the_stack |
mod cursor;
mod token;
mod token_kind;
use std::slice::Iter;
use crate::{lexer::cursor::Cursor, Error};
pub use token::Token;
pub use token_kind::TokenKind;
/// Parses tokens into text.
/// ```rust
/// use apollo_parser::Lexer;
///
/// let query = "
/// {
/// animal
/// ...snackSelection
/// ... on Pet {... | the_stack |
mod init;
pub mod config;
pub mod network;
pub mod runtime;
#[derive(Clone, Debug, serde::Deserialize, serde::Serialize)]
pub struct Settings {
#[serde(flatten)]
pub base: crate::base::Settings<config::DockerConfig>,
pub moby_runtime: runtime::MobyRuntime,
}
pub const CONFIG_FILE_DEFAULT: &str = "/etc/a... | the_stack |
use std::borrow::Cow;
use std::cmp::max;
use std::collections::HashMap;
use crate::builtins::Builtin;
use crate::error::{ErrorBuilder, TypeError};
use crate::operations::{BinOp, OpKind};
use crate::semantics::{
merge_maps, mk_span_err, mkerr, Binder, Closure, Hir, HirKind, Nir,
NirKind, Tir, TyEnv, Type,
};
us... | the_stack |
use crate::crypto;
use hex_literal::hex;
/// Types for which are able to perform initial cryptography.
///
/// This marker trait ensures only Initial-level keys
/// are used with Initial packets. Any key misuses are
/// caught by the type system.
pub trait InitialKey: crypto::Key + Sized {
type HeaderKey: crypto::... | the_stack |
//! virgl_renderer: Handles 3D virtio-gpu hypercalls using virglrenderer.
//! External code found at https://gitlab.freedesktop.org/virgl/virglrenderer/.
#![cfg(feature = "virgl_renderer")]
use std::cell::RefCell;
use std::ffi::CString;
use std::mem::{size_of, transmute};
use std::os::raw::{c_char, c_void};
use std::... | the_stack |
use json::JsonValue;
use log::{debug, warn};
use std::collections::HashMap;
use std::net::{Ipv4Addr, Ipv6Addr, SocketAddr, ToSocketAddrs};
#[derive(Debug, Clone)]
pub struct ServerConfig {
pub server_address: SocketAddr,
pub use_iptables: bool,
pub target_configs: TargetConfigs,
}
#[derive(Debug, Clone)]... | the_stack |
use std::fmt;
use crate::frame::{util, Error, Frame, FrameSize, Head, Kind, StreamId};
use bytes::{BufMut, BytesMut};
#[derive(Clone, Default, Eq, PartialEq)]
pub struct Settings {
flags: SettingsFlags,
// Fields
header_table_size: Option<u32>,
enable_push: Option<u32>,
max_concurrent_streams: Opt... | the_stack |
// === Features ===
#![allow(incomplete_features)]
#![feature(trait_alias)]
#![feature(negative_impls)]
#![feature(specialization)]
#![feature(auto_traits)]
#![feature(unsize)]
// === Standard Linter Configuration ===
#![deny(non_ascii_idents)]
#![warn(unsafe_code)]
// === Non-Standard Linter Configuration ===
#![warn(... | the_stack |
use std::{
cmp::{max, Ordering},
iter::FromIterator,
mem,
ops::Not,
};
/// An internal node of an `AVLTree`.
struct AVLNode<T: Ord> {
value: T,
height: usize,
left: Option<Box<AVLNode<T>>>,
right: Option<Box<AVLNode<T>>>,
}
/// A set based on an AVL Tree.
///
/// An AVL Tree is a self-... | the_stack |
use alloc::boxed::Box;
use alloc::rc::Rc;
use alloc::vec;
use alloc::vec::Vec;
use core::ops::Range;
use error::{Error, ErrorVariant};
use iterators::{pairs, QueueableToken};
use position::{self, Position};
use span::Span;
use stack::Stack;
use RuleType;
/// The current lookahead status of a [`ParserState`].
///
/// ... | the_stack |
use crate::catch_unwind::CatchUnwind;
use crate::layout_helpers::extend;
use crate::lightproc::LightProc;
use crate::proc_data::ProcData;
use crate::proc_layout::ProcLayout;
use crate::proc_stack::ProcStack;
use crate::proc_vtable::ProcVTable;
use crate::state::*;
use std::alloc::{self, Layout};
use std::cell::Cell;
us... | the_stack |
extern crate abomonation_derive;
extern crate abomonation;
extern crate rand;
extern crate timely;
extern crate differential_dataflow;
use rand::{Rng, SeedableRng, StdRng};
use timely::dataflow::ProbeHandle;
use timely::dataflow::operators::unordered_input::UnorderedInput;
use differential_dataflow::AsCollection;
... | the_stack |
use std::collections::{BTreeMap, BTreeSet};
use std::fmt;
use std::path::{Path, PathBuf};
use std::time::{SystemTime, UNIX_EPOCH};
use anyhow::{format_err, Context, Result};
use log::warn;
use regex::Regex;
use xml::writer::{EmitterConfig, XmlEvent};
use crate::{SrcLine, SrcView};
#[derive(Clone, Debug, Eq, Hash, Pa... | the_stack |
use bitflags::bitflags;
use x86::bits64::vmx;
use x86_64::instructions::interrupts;
use self::{VmcsField32::*, VmcsField64::*};
use super::utils::{invept, InvEptType};
use crate::memory::{HostPhysAddr, PAGE_SIZE};
use crate::{RvmError, RvmResult};
/// 16-Bit VMCS Fields.
#[repr(u32)]
#[allow(dead_code)]
#[derive(Clon... | the_stack |
use std::{
io::{self, Write},
ops::Range,
};
use unicode_segmentation::UnicodeSegmentation;
use crate::{
backend::Backend,
events::{KeyCode, KeyEvent, KeyModifiers, Movement},
layout::Layout,
};
/// A widget that inputs a string.
///
/// A `filter_map` function can optionally be provided to limit... | the_stack |
#[non_exhaustive]
#[derive(std::fmt::Debug)]
pub struct PutEventsError {
/// Kind of error that occurred.
pub kind: PutEventsErrorKind,
/// Additional metadata about the error, including error code, message, and request ID.
pub(crate) meta: aws_smithy_types::Error,
}
/// Types of errors that can occur f... | the_stack |
use {
anyhow::Error,
cm_rust::{
CapabilityName, CapabilityTypeName, ProtocolDecl, StorageDecl, StorageDirectorySource,
},
fidl_fuchsia_sys2 as fsys,
matches::assert_matches,
moniker::{AbsoluteMoniker, AbsoluteMonikerBase, ExtendedMoniker},
routing::{
capability_source::{Capab... | the_stack |
//! A crate with a few single-typed arenas that work exclusively with indexes.
//! The indexes are sized with the arena. This can reduce memory footprint when
//! changing pointers to indices e.g. on 64-bit systems.
//!
//! The arenas use a variant of "branded indices": The indices contain an
//! invariant lifetime tag... | the_stack |
use std::collections::HashMap;
use std::fs::File;
use std::io::Result;
use std::mem;
use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::atomic::{AtomicBool, AtomicU32, AtomicU64, Ordering};
use std::sync::{Arc, Condvar, Mutex, MutexGuard};
use std::time::{Duration, Instant};
use nix::sys::select::{select, FdSet};... | the_stack |
use std::convert::TryFrom;
use std::io::Read;
use std::os::unix::prelude::ExitStatusExt;
use std::path::{Path, PathBuf};
use std::process::ExitStatus;
use std::sync::mpsc::{Receiver, SyncSender};
use std::sync::Arc;
use log::{debug, error};
use nix::sys::signal::kill;
use nix::sys::stat::Mode;
use nix::unistd::{mkdir,... | the_stack |
use dashmap::mapref::entry::Entry as DashMapEntry;
use dashmap::mapref::one::{Ref, RefMut};
use dashmap::DashMap;
use tracing::warn;
use std::hash::Hash;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::oneshot::{channel, Receiver, Sender};
// Clippy isn't re... | the_stack |
#![no_std]
extern crate spin;
extern crate port_io;
extern crate irq_safety;
use core::{convert::TryFrom, fmt, str::FromStr};
use port_io::Port;
use irq_safety::MutexIrqSafe;
/// The base port I/O addresses for COM serial ports.
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
#[repr(u16)]
pub enum SerialPortAddress {
... | the_stack |
use crate::tracker::inflights::Inflights;
use crate::tracker::state::StateType;
use crate::tracker::state::StateType::{Probe, Replicate, Snapshot};
use nom::lib::std::option::IterMut;
use std::collections::hash_map::{Iter, Keys};
use std::collections::HashMap;
use std::fmt::{self, Display, Error, Formatter};
// Progr... | the_stack |
use crate::xetex_scaledmath::Scaled;
const S_72_27: Scaled = Scaled(4736287);
use std::io::Write;
use crate::node::{Kern, List, TxtNode, BOX_NODE_SIZE, MEDIUM_NODE_SIZE, RULE_NODE_SIZE};
use crate::xetex_consts::{get_int_par, set_int_par, IntPar};
use crate::xetex_ini::{
cur_h, cur_v, input_state_t, job_name, rul... | the_stack |
use derive_new::new;
use ordered_float::OrderedFloat;
use std::collections::BTreeMap;
pub use crate::ast::builtin::{CapturedUse, Sexp, Syntax, SyntaxBody, SyntaxMetadata};
#[derive(PartialEq, Eq, PartialOrd, Ord, Debug, Clone, Copy, Hash)]
pub struct CtId(u32);
impl CtId {
pub fn index(self) -> u32 {
sel... | the_stack |
use std::{
cell::RefCell,
rc::Rc,
sync::{atomic::Ordering, Mutex},
};
use smithay::{
reexports::{
wayland_protocols::xdg_shell::server::xdg_toplevel,
wayland_server::protocol::{wl_pointer::ButtonState, wl_shell_surface, wl_surface},
},
utils::{Logical, Point, Rectangle, Size},
... | the_stack |
use std::{
fs,
path::{Path, PathBuf},
};
use anyhow::{bail, Context, Result};
use oci_spec::runtime::{
LinuxBlockIo, LinuxBlockIoBuilder, LinuxBuilder, LinuxResourcesBuilder,
LinuxThrottleDeviceBuilder, LinuxWeightDeviceBuilder, Spec, SpecBuilder,
};
use test_framework::{test_result, ConditionalTest, T... | the_stack |
AFLTriage is a tool to process a target program's crashing input files using a debugger.
When fuzzing a target program, one or more crashes may be found. It is up to a developer or
researcher to understand their root cause and impact in order to take the appropriate action.
Depending on the program and platform,... | the_stack |
pub use pallet::*;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
#[frame_support::pallet]
pub mod pallet {
use core::convert::{TryFrom, TryInto};
use frame_support::{debug, ensure};
use frame_support::{dispatch::DispatchResultWithPostInfo, pallet_prelude::*};
use frame_system::pallet_prelude::*;
... | the_stack |
// TODO: Lowerings
// Interesting reading: https://internals.rust-lang.org/t/tryfrom-for-f64/9793/35
// A useful starting point is that all possible down-cast through up-cast round trips
// must preserve bit-for-bit the original value. That's not quite enough though, since this
// is true for some values due to saturat... | the_stack |
use lazy_static::lazy_static;
use p256::{elliptic_curve::generic_array::typenum::Unsigned, pkcs8::FromPublicKey};
use serde::Deserialize;
use std::collections::HashSet;
use tink_core::TinkError;
use tink_hybrid::subtle;
use tink_proto::{EcPointFormat, EllipticCurveType};
use tink_tests::{expect_err, hex_string, Wychepr... | the_stack |
use voile_util::level::{Level, LevelType, LiftEx};
use voile_util::loc::*;
use voile_util::meta::MetaSolution;
use voile_util::tags::{PiSig::*, Plicit, VarRec, VarRec::*};
use crate::syntax::abs::{Abs, LabAbs};
use crate::syntax::core::{CaseSplit, Closure, Fields, Neutral, Val, Variants, TYPE_OMEGA};
use super::eval:... | the_stack |
use std::cmp;
use std::iter;
use std::result;
use crate::ty;
use crate::ty::list_iter::ListIterator;
use crate::ty::purity;
use crate::ty::purity::Purity;
use crate::ty::record;
use crate::ty::ty_args::TyArgs;
use crate::ty::var_usage::Variance;
use crate::ty::Ty;
#[derive(PartialEq, Debug)]
pub enum Error {
Disj... | the_stack |
use crate::{config::QuorumSet, Ballot, NodeId};
use bytes::Bytes;
use std::cmp::max;
/// Encoding of Acceptor (persistent Paxos memory) role
pub struct Acceptor {
/// last accepted ballot/value pair within this instance
state: AcceptorState,
}
impl Acceptor {
/// New acceptor with last promised ballot and... | the_stack |
use clap::{App, Arg, SubCommand};
use dorea::client::DoreaClient;
use dorea::network::NetPacketState;
use dorea::value::DataValue;
use doson::binary::Binary;
use rustyline::Editor;
use std::io::{Read, Write};
use std::path::PathBuf;
use std::process::exit;
#[tokio::main]
pub async fn main() {
// let matches = clap... | the_stack |
use darling::Error as DarlingError;
use failure::{Error, Fail};
use proc_macro2::Span;
use proc_macro2::TokenStream;
use quote::ToTokens;
use std::fmt;
use std::fmt::Display;
use std::path::PathBuf;
use std::sync::{Arc, Mutex};
#[derive(Debug, Fail)]
pub enum TracersError {
InvalidProvider {
message: Strin... | the_stack |
use platform::time::sleep_secs;
use platform::time::time_now;
use super::Cache;
use super::CacheError;
use super::Key;
use super::Value;
#[test]
fn test_cas_id() {
let mut value = value!(1);
assert_eq!(0, *value.get_cas_id());
value.set_item(vec![2]);
assert_eq!(1, *value.get_cas_id());
value.s... | the_stack |
pub mod cube;
pub mod decompose;
pub mod generate;
pub mod sphere;
use arrayvec::ArrayVec;
use decorum::Real;
use itertools::izip;
use itertools::structs::Zip as OuterZip; // Avoid collision with `Zip`.
use num::{Integer, One, Signed, Unsigned, Zero};
use smallvec::{smallvec, SmallVec};
use std::array;
use std::conver... | the_stack |
use std::fmt;
use std::rc::Rc;
use std::collections::HashMap;
use std::io;
use std::time::Duration;
use mio::{Evented, Token, Ready, PollOpt};
use mio_extras::timer::{Timer, Timeout};
use core::context;
use core::device;
use core::probe;
use core::network::Network;
use core::{BuildIdHasher, SocketId, EndpointId, Devi... | the_stack |
extern crate image;
extern crate freetype;
use image::Rgba;
use image::Pixel;
use image::ImageBuffer;
use freetype::Bitmap;
use freetype::Library;
use freetype::face::Face;
use freetype::face::RENDER;
use std::fs::File;
use std::path::Path;
// Customizable parameters
static LARGE_KEY_SIZE: u32 = 40; // pixels
static ... | the_stack |
use futures::sync::oneshot::{
channel as oneshot_channel
};
use futures::sync::mpsc::{
UnboundedSender
};
use futures::future::{
self,
Future,
Either,
FutureResult
};
use futures::Poll;
use futures::stream::{
self,
Stream
};
use rand;
use rand::Rng;
use std::time::Duration;
use std::i64;
use std::f64... | the_stack |
use std::fmt;
use crate::ty;
use crate::ty::purity::Purity;
use crate::ty::record;
use crate::ty::Ty;
#[derive(PartialEq, Eq, Debug, Clone, Hash)]
pub enum TestTy {
Sym,
Str,
Bool,
Num,
Int,
Float,
Char,
List,
Vector,
Set,
Map,
Fun,
Nil,
TopRecord,
RecordCla... | the_stack |
use crate::errors::{Error, Result};
use crate::token::{Keyword, Token};
/// Lexer for reproto IDL.
use core::RpNumber;
use num_bigint::BigInt;
use num_traits::Zero;
use std::borrow::Cow;
use std::result;
use std::str::CharIndices;
pub struct Lexer<'input> {
source: CharIndices<'input>,
source_len: usize,
s... | the_stack |
mod support;
macro_rules! impl_vec2_tests {
($t:ty, $const_new:ident, $new:ident, $vec2:ident, $vec3:ident, $mask:ident) => {
glam_test!(test_const, {
const V: $vec2 = $const_new!([1 as $t, 2 as $t]);
assert_eq!($vec2::new(1 as $t, 2 as $t), V);
});
glam_test!(test_... | the_stack |
#![allow(clippy::cast_ptr_alignment)]
use std::iter::FusedIterator;
use std::marker;
use std::mem;
use std::net::Ipv4Addr;
use std::net::Ipv6Addr;
use std::ptr;
use std::slice;
use chrono::prelude::*;
use chrono::Date;
use chrono_tz::Tz;
use crate::errors::Error;
use crate::errors::FromSqlError;
use crate::errors::R... | the_stack |
// Similar in from to the `baseline` clocks module, but includes notable differendes.
use crate::{
clocks::SpeedError,
pac::{FLASH, PWR, RCC, SYSCFG},
rcc_en_reset,
};
use cfg_if::cfg_if;
#[derive(Clone, Copy, PartialEq)]
pub enum PllSrc {
None,
Csi,
Hsi(HsiDiv),
Hse(u32),
}
impl PllSrc ... | the_stack |
use crate::{
transport::{ListenerEvent, TransportError},
Transport,
};
use fnv::FnvHashMap;
use futures::{
channel::mpsc,
future::{self, Ready},
prelude::*,
task::Context,
task::Poll,
};
use lazy_static::lazy_static;
use multiaddr::{Multiaddr, Protocol};
use parking_lot::Mutex;
use rw_stream... | the_stack |
use swc_common::{chain, Mark};
use swc_ecma_parser::Syntax;
use swc_ecma_transforms_base::resolver::resolver;
use swc_ecma_transforms_compat::{
es2015,
es2015::{
block_scoping,
destructuring::{destructuring, Config},
parameters, spread,
},
es2018::object_rest_spread,
};
use swc_e... | the_stack |
use std::sync::Arc;
use std::sync::Mutex;
use imgui::sys as imgui_sys;
pub use imgui;
use imgui::{DrawCmdParams, DrawCmd};
pub struct ImguiFontAtlas {
pub width: u32,
pub height: u32,
pub data: Vec<u8>,
}
impl ImguiFontAtlas {
pub fn new(texture: &imgui::FontAtlasTexture) -> Self {
ImguiFontA... | the_stack |
use crate::module_group::ModuleGroup;
use crate::{intrinsics::Intrinsic, ir::function, ir::ty::HirTypeCache, type_info::TypeInfo};
use hir::{Body, Expr, ExprId, HirDatabase, InferenceResult};
use inkwell::values::CallableValue;
use inkwell::{
context::Context,
module::Module,
targets::TargetData,
types:... | the_stack |
mod init;
mod topics;
mod xadd;
mod xread;
pub use init::*;
pub use xadd::*;
pub use xread::*;
use crate::components::*;
use crate::service::{choose, game_color_prefs};
use color_model::api::*;
use color_model::*;
use log::{error, info};
use redis_streams::XReadEntryId;
#[derive(Clone)]
pub enum StreamInput {
G... | the_stack |
#[macro_export]
macro_rules! format_args {
($($value:expr),+ $(,)?) => {
$crate::Arguments::new(&[
$(
$crate::Argument::new(&$value)
),+
])
}
}
/// Writes formatted data into a buffer.
///
/// This macro accepts a 'buffer' and a list of format arguments. ... | the_stack |
use crate::math::{Isometry, Point, Vector, DIM};
use crate::query::{PointProjection, PointQuery, PointQueryWithLocation};
use crate::shape::{FeatureId, Triangle, TrianglePointLocation};
use na::{self, RealField};
#[inline]
fn compute_result<N: RealField + Copy>(pt: &Point<N>, proj: Point<N>) -> PointProjection<N> {
... | the_stack |
use std::fs::OpenOptions;
use std::time::Duration;
use std::{io, u32};
use anyhow::bail;
use bellperson::Circuit;
use chrono::Utc;
use log::info;
use merkletree::store::StoreConfig;
use paired::bls12_381::Bls12;
use rand::Rng;
use serde::Serialize;
use fil_proofs_tooling::{measure, FuncMeasurement, Metadata};
use sto... | the_stack |
use {
crate::errors::CreationManifestError,
serde::{Deserialize, Serialize},
std::{
collections::{btree_map, BTreeMap, HashSet},
fs,
io::{self, Read},
path::Path,
},
};
/// A `CreationManifest` lists the files that should be included in a Fuchsia package.
/// Both `exter... | the_stack |
missing_docs,
unused_extern_crates,
unused_import_braces,
unused_qualifications
)]
//! This crate provides macros to generate bitfield-like struct.
//!
//! See the documentation of the macros for how to use them.
//!
//! Examples and tests are also a great way to understand how to use these macros.
///... | the_stack |
pub const RDO_NUM_BINS: usize = 50;
#[allow(unused)]
pub const RDO_MAX_BIN: usize = 10000;
pub const RATE_EST_MAX_BIN: usize = 100_000;
pub const RDO_QUANT_BINS: usize = 8;
pub const RDO_QUANT_DIV: usize = 256 / RDO_QUANT_BINS;
#[allow(unused)]
pub const RDO_BIN_SIZE: u64 = (RDO_MAX_BIN / RDO_NUM_BINS) as u64;
pub cons... | the_stack |
use std::env::temp_dir;
use std::fs;
use std::io::Write;
use common_exception::Result;
use databend_query::Config;
use pretty_assertions::assert_eq;
// Default.
#[test]
fn test_default_config() -> Result<()> {
let actual = Config::default();
let tom_expect = r#"config_file = ""
[query]
tenant_id = "admin"
c... | the_stack |
use crate::client::{AppObject, ClientContext, Error};
use crate::error::ClientResult;
use crate::json_interface::runtime::Runtime;
use api_info::{ApiType, Field, Type};
use futures::Future;
use serde::de::DeserializeOwned;
use serde::Serialize;
use serde_json::Value;
use std::marker::PhantomData;
use std::sync::Arc;
us... | the_stack |
use super::DeviceCopy;
use crate::device::Device;
#[allow(unused_imports)]
use crate::device::DeviceAttribute;
use crate::error::*;
use crate::memory::malloc::{cuda_free_unified, cuda_malloc_unified};
use crate::memory::UnifiedPointer;
use crate::prelude::Stream;
use crate::sys as cuda;
use std::borrow::{Borrow, Borrow... | the_stack |
use crate::consts::*;
use crate::ram;
use anyhow::{anyhow, Result};
pub const OP_CYCLES: [u32; 0x100] = [
// 1 2 3 4 5 6 7 8 9 A B C D E F
1, 3, 2, 2, 1, 1, 2, 1, 5, 2, 2, 2, 1, 1, 2, 1, // 0
0, 3, 2, 2, 1, 1, 2, 1, 3, 2, 2, 2, 1, 1, 2, 1, // 1
2, 3, 2, 2, 1, 1, 2, 1, 2, 2, 2, 2, 1, 1, 2,... | the_stack |
mod tests {
extern crate futures;
extern crate hyper;
extern crate fruitbasket;
extern crate time;
extern crate chrono;
use webapi::chrono::TimeZone;
use super::super::*;
use super::super::super::SpotifyEndpoints;
use std;
use std::thread;
use std::thread::sleep;
use s... | the_stack |
// Our and the author's own implementation (tsan11) of the paper have some deviations from the provided operational semantics in §5.3:
// 1. In the operational semantics, store elements keep a copy of the atomic object's vector clock (AtomicCellClocks::sync_vector in miri),
// but this is not used anywhere so it's omit... | the_stack |
use num_traits::{FromPrimitive, ToPrimitive};
use xous::{send_message, Message, CID};
use xous_ipc::{Buffer, String};
#[derive(Debug, rkyv::Archive, rkyv::Serialize, rkyv::Deserialize)]
pub struct Prediction {
pub index: u32,
pub valid: bool,
pub string: String<1000>,
}
#[derive(Debug, Default, Copy, Clon... | the_stack |
use crate::datasources::{Datasource, Datasources};
use elementtree::Element;
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::io;
use std::io::BufReader;
use std::path::Path;
use std::str::FromStr;
use t_rex_core::core::layer::Layer;
#[cfg(test)]
use t_rex_core::core::Config;
#[cfg(not(feature =... | the_stack |
use std::hash::Hash;
use ndarray::ArrayD;
use smartnoise_validator::{Float, proto};
use smartnoise_validator::base::{Array, IndexKey, Jagged, ReleaseNode, Value};
use smartnoise_validator::errors::*;
use smartnoise_validator::utilities::{standardize_categorical_argument, standardize_null_candidates_argument, standard... | the_stack |
use crate::ids::{
DefWithBodyId, FunctionId, ItemDefinitionId, Lookup, ModuleId, StructId, TypeAliasId,
};
use crate::item_scope::BUILTIN_SCOPE;
use crate::module_tree::LocalModuleId;
use crate::package_defs::PackageDefs;
use crate::primitive_type::PrimitiveType;
use crate::visibility::RawVisibility;
use crate::{
... | the_stack |
mod common;
mod shape;
#[cfg(test)]
mod syriac_tests {
use crate::common;
use crate::shape;
use allsorts::binary::read::ReadScope;
use allsorts::gsub::RawGlyph;
use allsorts::scripts::syriac::gsub_apply_syriac;
use allsorts::tables::cmap::CmapSubtable;
use allsorts::tables::OpenTypeFont;
... | the_stack |
//! An implementation of TLS variant 2 (but we currently support only static linking)
//!
//! This is a pretty simple case:
//!
//! 1. We determine the TLS size (by computing offset from linker section symbols)
//! (we could also do this by parsing the relevant ELF section)
//! 2. We allocate a block of memory which... | the_stack |
use crate::multiplexer::utils as multiplexer_utils;
use crate::utils as client_utils;
use crate::error::*;
use crate::protocol::types::*;
use crate::types::RedisValue;
use std::sync::Arc;
use parking_lot::RwLock;
use std::ops::{
DerefMut,
Deref
};
use redis_protocol::types::{
Frame as ProtocolFrame,
FrameKin... | the_stack |
use std::{mem, cmp};
use std::io::{self, Write};
use termion::event::Key;
use KeyMap;
use Editor;
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum CharMovement {
RightUntil,
RightAt,
LeftUntil,
LeftAt,
Repeat,
ReverseRepeat,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum MoveType {
... | the_stack |
mod utils;
use smallvec::SmallVec;
use wasm_bindgen::prelude::*;
// use serde_wasm_bindgen::Serializer;
// use serde::{Serialize};
use diamond_types_positional::{AgentId, ROOT_TIME};
use diamond_types_positional::list::{ListCRDT, Time, Branch as DTBranch, OpLog as DTOpLog};
use diamond_types_positional::list::encoding... | the_stack |
use core::result;
use core::fmt;
//
// sgx_error.h
//
impl_enum! {
#[repr(u32)]
#[derive(Copy, Clone, PartialEq, Eq, Ord, PartialOrd, Debug)]
pub enum sgx_status_t {
SGX_SUCCESS = 0x0000_0000,
SGX_ERROR_UNEXPECTED = 0x0000_0001, /* Unexpected er... | the_stack |
use crate::Integer;
use crate::IntoSafeIntegral;
use crate::SafeI16;
use crate::SafeI32;
use crate::SafeI64;
use crate::SafeI8;
use crate::SafeIdx;
use crate::SafeIntegral;
use crate::SafeU16;
use crate::SafeU32;
use crate::SafeU64;
use crate::SafeU8;
use crate::SafeUMx;
use crate::UnsignedInteger;
// ----------------... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.