text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
use std::{
collections::HashMap,
convert::{TryFrom, TryInto},
fmt,
str::FromStr,
sync::Arc,
};
use anyhow::{Context, Result};
use reqwest::{
header::{HeaderMap, HeaderName, HeaderValue},
Response, StatusCode, Url,
};
use serde::ser::SerializeStruct;
use serde::{Deserialize, Deserializer, Se... | the_stack |
//! Physics and collision detection.
use crate::{
common::{bsp::BspLeafContents, math::Hyperplane},
server::progs::EntityId,
};
use bitflags::bitflags;
use cgmath::{InnerSpace, Vector3, Zero};
/// Velocity in units/second under which a *component* (not the entire
/// velocity!) is instantly reduced to zero.
... | the_stack |
use crate::{ math::field };
use super::{ AssemblyError, HintMap, OpCode, OpHint };
// CONSTANTS
// ================================================================================================
const PUSH_OP_ALIGNMENT: usize = 8;
const HASH_OP_ALIGNMENT: usize = 16;
// CONTROL FLOW OPERATIONS
// ===================... | the_stack |
use std::{
collections::{BTreeMap, BTreeSet},
convert::TryFrom,
fmt::Display,
fs,
io::{self, BufRead},
net::{SocketAddr, SocketAddrV4},
path::{Path, PathBuf},
str::FromStr,
};
use anyhow::{bail, Context, Result};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use structopt::... | the_stack |
//! Update related operations for Messages
use std::fmt::Debug;
use crate::client::async_client::MAX_PAYLOAD_LEN;
use crate::op::{Message, MessageType, OpCode, Query};
use crate::rr::rdata::{NULL, SOA};
use crate::rr::{DNSClass, Name, RData, Record, RecordSet, RecordType};
/// To reduce errors in using the Message s... | the_stack |
#[macro_export]
macro_rules! impl_unary_op_test {
{ $scalar:ty, $trait:ident :: $fn:ident, $scalar_fn:expr } => {
test_helpers::test_lanes! {
fn $fn<const LANES: usize>() {
test_helpers::test_unary_elementwise(
&<core_simd::Simd<$scalar, LANES> as core::ops::$... | the_stack |
use crate::fdenum::EnumerateInnerFileDescriptors;
use crate::frame_decoder::FrameDecoder;
use crate::rpc::MessageSink;
use bytes::{
buf::{Buf, BufMut},
BytesMut,
};
use serde::de::DeserializeOwned;
use serde::Serialize;
use std::convert::TryInto;
use std::marker::PhantomData;
use std::os::unix::{io::AsRawFd, ... | the_stack |
use alloc::rc::Rc;
use alloc::vec::Vec;
use core::cell::RefCell;
use core::mem;
use kernel::errno::Result;
use kernel::device::{ConfigOption, Device, DeviceOps, CONFIG_ETHERNET_MAC_ADDRESS, CONFIG_IO_QUEUE};
use kernel::event::{Event, EventListener, EventNotifier};
use kernel::ioport::IOPort;
use kernel::ioqueue::{IOCm... | the_stack |
use std::rc::Rc;
use std::cell::{RefCell, Ref};
use std::sync::Arc;
use parking_lot::RwLock;
use std::ops::{
DerefMut,
Deref
};
use std::cmp;
use std::i64::MAX;
use std::time::Instant;
use crate::metrics::LatencyStats;
use futures::{
Stream,
Future,
Sink
};
use futures::sync::oneshot::Sender as OneshotSen... | the_stack |
use crate::config::dfinity::{Config, Profile};
use crate::config::dfx_version_str;
use crate::lib::canister_info::CanisterInfo;
use crate::lib::environment::Environment;
use crate::lib::error::DfxResult;
use crate::lib::models::canister::CanisterPool;
use crate::lib::provider::get_network_context;
use crate::util::{se... | the_stack |
#![warn(unused_extern_crates)]
#![forbid(unsafe_code)]
#![allow(clippy::implicit_hasher)]
// `error_chain!` can recurse deeply
#![recursion_limit = "1024"]
#[macro_use]
extern crate error_chain;
#[macro_use] extern crate indexmap;
use std::collections::{HashMap, HashSet};
use std::iter::FromIterator;
use indexmap::m... | the_stack |
use crate::approx::AbsDiffEq;
use crate::math::{Isometry, Point, Real, Vector};
use crate::query::{ContactManifold, TrackedContact};
use crate::shape::{Segment, Triangle};
use crate::utils::WBasis;
use na::Point2;
/// A polygonal feature representing the local polygonal approximation of
/// a vertex, face, or edge of ... | the_stack |
use std::{collections::HashMap, convert::TryInto, ffi::OsStr, str::FromStr, sync::Arc};
use anyhow::{bail, Result};
use chrono::{NaiveDate, TimeZone, Utc};
use chrono_humanize::HumanTime;
use cio_api::{
analytics::NewPageView,
applicants::{get_docusign_template_id, get_role_from_sheet_id, Applicant, NewApplica... | the_stack |
use crate::{
collections::{FillVecMap, FullP2ps, HoleVecMap, P2ps, TypedUsize, VecMap},
crypto_tools::{hash::Randomness, k256_serde, mta::Secret, paillier, vss, zkp::pedersen},
gg20::{
keygen::{KeygenShareId, SecretKeyShare},
sign::{
r3::{
self,
co... | the_stack |
#![allow(non_snake_case)]
use core::ops::{Add, Mul, Neg};
use packed_simd::{u64x4, IntoBits};
use backend::serial::u64::field::FieldElement51;
/// A wrapper around `vpmadd52luq` that works on `u64x4`.
#[inline(always)]
unsafe fn madd52lo(z: u64x4, x: u64x4, y: u64x4) -> u64x4 {
use core::arch::x86_64::_mm256_mad... | the_stack |
use crate::prelude::*;
use crate::controller::ExecutedGraph;
use crate::executor::global::spawn;
use crate::model::execution_context::Visualization;
use crate::model::execution_context::VisualizationId;
use crate::model::execution_context::VisualizationUpdateData;
use crate::sync::Synchronized;
use futures::channel::... | the_stack |
mod build_props;
mod cache_dir;
mod convert_element;
mod convert_slot_outlet;
mod v_bind;
mod v_for;
mod v_if;
pub mod v_model;
pub mod v_on;
mod v_slot;
use crate::{
flags::{HelperCollector, RuntimeHelper},
ir::{ConvertInfo, IRNode, IRRoot, JsExpr, TextIR},
parser::{SourceNode, TextNode},
util::{get_c... | the_stack |
//! Tests of the onion error messages/codes which are returned when routing a payment fails.
//! These tests work by standing up full nodes and route payments across the network, checking the
//! returned errors decode to the correct thing.
use chain::channelmonitor::{CLTV_CLAIM_BUFFER, LATENCY_GRACE_PERIOD_BLOCKS};
u... | the_stack |
extern crate log;
use futures::prelude::*;
use futures::ready;
use headers::{self, HeaderMapExt};
use hyper::header::{self, AsHeaderName, HeaderMap, HeaderValue};
use hyper::upgrade;
use hyper::{Body, Request, Response, StatusCode};
use std::io;
use std::pin::Pin;
use std::sync::Arc;
use std::task::{Context, Poll};
us... | the_stack |
// these warnings are unavoidable with names like `uid` and `gid`, and
// such names are natural to use for this problem domain so should not
// be avoided
#![allow(clippy::similar_names)]
use std::ffi::CString;
use std::fs;
use std::io::{Read, Write, Result, Error, ErrorKind};
use std::net::Shutdown;
use std::os::uni... | the_stack |
use ash::vk;
use ash::version::DeviceV1_0;
use std::sync::{Arc, Mutex};
use crate::vulkan::{RafxDeviceContextVulkan, VkQueueFamilyIndices};
use crossbeam_channel::{Receiver, Sender};
use fnv::FnvHashMap;
/// Has the indexes for all the queue families we will need. It's possible that a single queue
/// family will n... | the_stack |
use chrono::Utc;
use crate::{core_editor::LineBuffer, HistoryItem, Result};
use super::{HistoryItemId, HistorySessionId};
/// Browsing modes for a [`History`]
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum HistoryNavigationQuery {
/// `bash` style browsing through the history. Contained `LineBuffer` is used to ... | the_stack |
use crate::real_std::{
fmt,
fs::{self, File},
io::{self, Read, Write},
sync::Mutex,
};
use futures::prelude::*;
use futures::Future;
use crate::vm::{
self,
api::{
generic::{A, B},
Getable, OpaqueValue, OwnedFunction, RuntimeResult, TypedBytecode, WithVM, IO,
},
interna... | the_stack |
use shared::basetsd::{ULONG32, ULONG_PTR};
use shared::minwindef::{UCHAR, ULONG, USHORT};
use shared::ntdef::{LARGE_INTEGER, LONG, LONGLONG, PVOID, ULONGLONG, VOID, WCHAR};
use um::winioctl::{
DEVICE_TYPE, FILE_ANY_ACCESS, FILE_DEVICE_CONTROLLER, FILE_READ_ACCESS,
FILE_WRITE_ACCESS, METHOD_BUFFERED
};
use um::w... | the_stack |
use std::sync::mpsc::{channel, Sender};
use std::thread;
use crate::context::manager::sync::ContextManager;
use crate::context::manager::ContextManagerError;
use crate::context::ContextId;
use crate::execution::adapter::{ExecutionAdapter, ExecutionAdapterError, ExecutionOperationError};
use crate::execution::{Executio... | the_stack |
use std::cell::Ref;
use std::ops::Deref;
use bit_set::BitSet;
use crate::atn_config_set::ATNConfigSet;
use crate::dfa::DFA;
use crate::errors::ANTLRError;
use crate::parser::Parser;
use crate::recognizer::Recognizer;
use crate::token_factory::TokenFactory;
use std::borrow::Cow;
use std::fmt::Debug;
/// Describes i... | the_stack |
use std::rc::Rc;
use super::{AppUI, slots::AppUISlots};
/// This function connects all the actions from the provided `AppUI` with their slots in `AppUISlots`.
///
/// This function is just glue to trigger after initializing both, the actions and the slots. It's here
/// to not pollute the other modules with a ton of ... | the_stack |
use ctypes::{c_int, c_void};
use shared::basetsd::{DWORD_PTR, PSIZE_T, PULONG_PTR, SIZE_T, ULONG_PTR};
use shared::guiddef::LPCGUID;
use shared::minwindef::{
BOOL, DWORD, LPBYTE, LPCVOID, LPDWORD, LPFILETIME, LPVOID, PBOOL, PDWORD, PULONG, UINT, WORD
};
use um::minwinbase::{LPCONTEXT, LPSECURITY_ATTRIBUTES, LPTHREA... | the_stack |
use crate::config::CFG;
use crate::config::FILENAME_COPY_COUNTER_MAX;
use crate::config::FILENAME_LEN_MAX;
use crate::error::FileError;
use std::path::Path;
use std::path::PathBuf;
/// Shortens the stem of a filename so that
/// `file_stem.len()+file_extension.len() <= FILENAME_LEN_MAX`.
/// If stem ends with a patter... | the_stack |
mod macros;
mod arithmetic;
mod bitwise;
mod control;
mod host;
mod host_env;
mod i256;
mod memory;
pub mod opcode;
mod stack;
mod system;
pub use opcode::{OpCode, OPCODE_JUMPMAP};
use crate::{interpreter::Interpreter, CallScheme, Host, Spec, SpecId::*};
use core::ops::{BitAnd, BitOr, BitXor};
use primitive_types::U2... | the_stack |
use std::{fs, io, net, path, time};
use bitcoin::{Address, Network};
use bitcoincore_rpc::Auth as RpcAuth;
use crate::error::{Context, OptionExt, Result};
use crate::query::QueryConfig;
use crate::types::RescanSince;
use crate::util::auth::AuthMethod;
use crate::util::descriptor::ExtendedDescriptor;
use crate::util::... | the_stack |
use core::{
convert::{Infallible, TryFrom},
fmt,
ops::Deref,
};
use crate::{
gpio::{gpioa, gpiob, gpioc, AF7},
hal::{blocking, serial, serial::Write},
pac::{
self,
rcc::cfgr3::USART1SW_A,
usart1::{cr1::M_A, cr1::PCE_A, cr1::PS_A, RegisterBlock},
Interrupt, USART1... | the_stack |
use std::{collections::HashMap, sync::Arc, time::Duration};
use super::{
comms::{
sim_status::{SimStatusRecv, SimStatusSend},
simulation::SimCtlSend,
},
sim_configurer::SimConfigurer,
Error, Result,
};
use crate::{
config::{PersistenceConfig, StoreConfig},
datastore::prelude::Sh... | the_stack |
use crate::densemap;
use crate::densemap::DenseMap;
use crate::graph::BuildId;
use crate::graph::FileId;
use crate::graph::Graph;
use crate::graph::Hash;
use crate::graph::Hashes;
use anyhow::{anyhow, bail};
use std::collections::HashMap;
use std::fs::File;
use std::io::BufReader;
use std::io::Read;
use std::io::Write;... | the_stack |
use futures::{AsyncReadExt, AsyncSeekExt, AsyncWriteExt};
use async_std::{fs::{self, File}, net::{TcpListener, TcpStream}};
use indicatif::{ProgressBar, ProgressStyle};
use std::{io::{Error, SeekFrom}, net::Shutdown};
use crate::{common::{YaftpError, retcode_error}, println_err, println_info, utils::*};
pub struct Cl... | the_stack |
use crate::{DeserializeError, Sbp};
/// An [Iterator] blanket implementation that provides extra adaptors for iterators of [Sbp] messages.
pub trait SbpIterExt: Iterator {
/// Lift an `Iterator<Item = Result<Sbp>>` into an `Iterator<Item = Sbp>` by ignoring all the errors.
/// The iterator will terminate if an... | the_stack |
use crate::imp::{core::*, prelude::*};
use std::{
io,
process::{Child, Command, Stdio},
sync::{
atomic::{AtomicBool, Ordering},
TryLockError
}
};
#[derive(Debug)]
pub(crate) struct Context {
objects: HashMap<Str<Guid>, RemoteArc>,
ctx: Wm<Context>,
id: i32,
callbacks: Ha... | the_stack |
use crate::engine::*;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
const LOG_INPUT_EVENTS: bool = false;
const MAX_TOUCHES_TRACKED: usize = 10;
#[derive(Clone)]
struct LastTouchCoords {
pub x: i32,
pub y: i32,
}
pub struct InputManager {
last_touches: Rc<RefCell<Vec<LastTouchCoords>>>,
touch_index... | the_stack |
use std::cmp::{self, Ordering};
use std::mem::swap;
use crate::scope;
#[cfg(feature="experimental_pointer_ranges")]
use crate::pointer::zip;
// for debugging -- like println during debugging
/*
#[cfg(debug_assertions)]
macro_rules! puts {
($($t:tt)*) => {
println!($($t)*)
}
}
#[cfg(not(debug_assertio... | the_stack |
use std::os::unix::fs::MetadataExt;
use std::time::{SystemTime, UNIX_EPOCH};
use crate::error::{Error, ErrorKind, Result};
use crate::MetaData;
use crate::metadata::{DiskMetaData, EmptyMetaData, MemoryMetaData};
/// Utility methods to MetaData
#[enum_dispatch]
pub trait MetaDataExt {
/// Returns the last access ti... | the_stack |
use crate::{
internal::{
is_attr,
new_attribute,
remove_attr,
},
metadata,
};
use heck::CamelCase as _;
use proc_macro::TokenStream;
use quote::{
format_ident,
quote,
ToTokens,
};
use std::collections::HashMap;
use syn::{
parse_macro_input,
ItemTrait,
};
pub(crat... | the_stack |
use alloc::vec::Vec;
use core::{
mem::ManuallyDrop,
ops::RangeBounds,
};
use tap::Pipe;
use wyz::{
comu::{
Const,
Mut,
},
range::RangeExt,
};
use super::{
BitVec,
Drain,
Splice,
};
use crate::{
boxed::BitBox,
index::BitEnd,
mem,
order::BitOrder,
ptr::{
AddressExt,
BitPtr,
BitSpan,
},
slice::B... | the_stack |
use super::{
config::Config,
error::Error,
pipe::{self, ConditionNotify, ConditionWait},
ContainerEvent, Event, EventTx, ExitStatus, NotificationTx, Pid, ENV_NAME, ENV_VERSION,
};
use crate::{
common::{container::Container, non_null_string::NonNullString},
npk::manifest::{Manifest, RLimitResourc... | the_stack |
use crate::block_utils::RefBlockChoice;
use crate::cli_utils::setup_ctrlc_handler;
use crate::data_block_buffer::{
BlockArrangement, DataBlockBuffer, InputType, OutputType, Slot, SlotView,
};
use crate::file_reader::{FileReader, FileReaderParam};
use crate::file_utils;
use crate::file_writer::{FileWriter, FileWrite... | the_stack |
use gantz::node::{self, SerdeNode, WithPullEval, WithPushEval};
use gantz::Edge;
use serde::{Deserialize, Serialize};
fn node_push() -> node::Push<node::Expr> {
node::expr("()").unwrap().with_push_eval_name("push")
}
fn node_int(i: i32) -> node::Expr {
node::expr(&format!("{{ #push; {} }}", i)).unwrap()
}
fn... | the_stack |
use super::StateBit;
use crate::dev_prelude::*;
use building_blocks_core::{prelude::*, Sphere};
use float_ord::FloatOrd;
use std::collections::BinaryHeap;
impl<Ni, Nf, T, Usr, Bldr, Store> ChunkTree<Ni, T, Bldr, Store>
where
PointN<Ni>: std::hash::Hash + IntegerPoint<FloatPoint = PointN<Nf>>,
PointN<Nf>: Fl... | the_stack |
use nom::{be_u8, be_u16, be_u32};
use nom;
use dns::dns::*;
/// Parse a DNS header.
named!(pub dns_parse_header<DNSHeader>,
do_parse!(
tx_id: be_u16 >>
flags: be_u16 >>
questions: be_u16 >>
answer_rr: be_u16 >>
authority_rr: be_u16 >>
additional_... | the_stack |
//! Pseudo-random number generators.
//!
//! Pseudo-random number generators are algorithms to produce apparently random
//! numbers deterministically, and usually fairly quickly. See the documentation
//! of the [`rngs` module] for some introduction to PRNGs.
//!
//! As mentioned there, PRNGs fall in two broad categor... | the_stack |
extern crate tokio_reactor;
extern crate tokio_uds;
extern crate libc;
use futures;
use futures::stream::Stream;
use std;
use std::io::Result as IoResult;
use std::io::{Read, Write};
use tokio_io::{AsyncRead, AsyncWrite};
use std::cell::RefCell;
use std::rc::Rc;
use std::path::{Path, PathBuf};
use self::tokio_uds:... | the_stack |
use query_engine_tests::*;
#[test_suite]
mod delete_inside_update {
use query_engine_tests::{assert_error, run_query, run_query_json, DatamodelWithParams};
use query_test_macros::relation_link_test;
// "a P1 to C1 relation " should "work through a nested mutation by id"
#[relation_link_test(on_parent... | the_stack |
use crate::wrap::{Wrap, WrapVariant};
use crate::{Chain, Error, Track};
use serde::de::{self, Deserialize, DeserializeSeed, Visitor};
use serde::serde_if_integer128;
use std::fmt;
/// Entry point. See [crate documentation][crate] for an example.
pub fn deserialize<'de, D, T>(deserializer: D) -> Result<T, Error<D::Erro... | the_stack |
// emacs: to insert a glyph, use insert-char (bind:: C-x 8 Ret)
// eg: 'Edit'-Glyph ""
// - dec code point => (insert-char 57848 1)
// - hex code_point => C-x 8 Ret #xe1f8 Ret
// - oct code_point => C-x 8 Ret #o377 Ret
//
// michal w. sieron <michalwsieron@gmail.com> wrote a python script
// that takes a fonts baselin... | the_stack |
use std::sync::Arc;
use anyhow::anyhow;
use futures::future::TryFutureExt;
use futures::stream::{FuturesUnordered, StreamExt};
use tokio::sync::oneshot;
use tokio::time::{timeout, Duration};
use crate::core::{LeaderState, State};
use crate::error::{ClientReadError, ClientWriteError, RaftError, RaftResult};
use crate:... | the_stack |
use super::Scene;
use crate::canvas::*;
use crate::CLI_OPTS;
use chessmarkable::{Square};
use fxhash::{FxHashMap, FxHashSet};
use libremarkable::image;
use libremarkable::input::{multitouch, InputEvent, gpio};
use pleco::{Board, Piece};
use std::time::{Duration, SystemTime};
use chess_pgn_parser::Game;
use chessmarkabl... | the_stack |
use std::collections::BTreeMap;
use std::io;
use std::mem;
use std::os::unix::io::RawFd;
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc, Mutex, MutexGuard,
};
use std::task::{Poll, Waker};
use std::thread;
use std::time::{Duration, Instant};
use futures_util::future::poll_fn;
use once_cell::sync::Lazy;
... | the_stack |
use codespan::ByteSpan;
use std::rc::Rc;
use name::Name;
use syntax::core::{Binop, Context, Expr, Field, FloatType, Kind, Module, RcExpr, RcKind, RcType,
Scope, SignedType, Type, TypeConst, UnsignedType};
use var::{Named, Var};
#[cfg(test)]
mod tests;
mod errors;
pub use self::errors::{KindError, ... | the_stack |
use core::convert::TryFrom;
use crate::{aat, ot, fallback, normalize, Direction, Face, Feature, GlyphBuffer, UnicodeBuffer};
use crate::buffer::{
glyph_flag, Buffer, BufferClusterLevel, BufferFlags, BufferScratchFlags, GlyphInfo,
GlyphPropsFlags,
};
use crate::complex::ZeroWidthMarksMode;
use crate::plan::Shap... | the_stack |
use crate::{
apple::{
config::{Config, Metadata},
device::{Device, RunError},
ios_deploy, rust_version_check,
target::{ArchiveError, BuildError, CheckError, CompileLibError, ExportError, Target},
NAME,
},
config::{
metadata::{self, Metadata as OmniMetadata},
... | the_stack |
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed ... | the_stack |
use crate::{
error::NokhwaError,
mjpeg_to_rgb888,
utils::{CameraFormat, CameraIndex, CameraInfo},
yuyv422_to_rgb888, CameraControl, CaptureAPIBackend, CaptureBackendTrait, FrameFormat,
KnownCameraControlFlag, KnownCameraControls, Resolution,
};
use image::{ImageBuffer, Rgb};
use std::{borrow::Cow, c... | the_stack |
use std::arch::x86::*;
#[cfg(target_arch = "x86_64")]
use std::arch::x86_64::*;
pub type Simd = __m256i;
pub type HalfSimd = __m128i;
pub type TraceType = i32;
/// Number of 16-bit lanes in a SIMD vector.
pub const L: usize = 16;
pub const L_BYTES: usize = L * 2;
pub const HALFSIMD_MUL: usize = 1;
pub const ZERO: i16 ... | the_stack |
use core::{
fmt,
ops::Mul,
};
use super::prp::{
Inner,
PRP,
};
use crate::{
prelude::{
digest::Digest,
generic_array::{
typenum::{
Unsigned as _,
U2,
},
ArrayLength,
GenericArray,
},
Vec,... | the_stack |
//****************************************************************************
// Automatically generated from yaml/swiftnav/sbp/tracking.yaml
// with generate.py. Please do not hand edit!
//****************************************************************************/
//! Satellite code and carrier-phase tracking messa... | the_stack |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate text_io;
extern crate case;
extern crate colored;
extern crate dirs;
extern crate git2;
extern crate project_init;
extern crate rustache;
extern crate tempdir;
extern crate time;
extern crate toml;
use case::*;
use clap::{App, AppSettings};
use colored::*;
use... | the_stack |
use super::{Function, FunctionContext, VarArgs};
use crate::ast::FormType;
use crate::codegen::values::{NumValue, TupleValue};
use crate::codegen::{
build_context_function, globals, math, util, BuilderContext, TargetProperties,
};
use crate::mir::block;
use inkwell::context::Context;
use inkwell::module::{Linkage, ... | the_stack |
use anyhow::{Result, Context};
use std::{
io::{BufReader, BufWriter},
collections::HashSet,
ffi::OsString,
fs,
path::{Path, PathBuf},
time::{SystemTime, Duration}
};
use nix::{
sys::signal,
unistd::Pid,
};
use structopt::StructOpt;
use serde::{Serialize, Deserialize};
use crate::{
co... | the_stack |
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use std::cmp;
use std::io;
use std::io::{Read, Write};
use super::{TReadTransport, TReadTransportFactory, TWriteTransport, TWriteTransportFactory};
/// Default capacity of the read buffer in bytes.
const READ_CAPACITY: usize = 4096;
/// Default capacity of the... | the_stack |
use crate::{
core_mempool::CoreMempool,
network::{MempoolNetworkEvents, MempoolNetworkSender, MempoolSyncMsg},
shared_mempool::start_shared_mempool,
tests::common::TestTransaction,
ConsensusRequest, MempoolClientRequest, MempoolClientSender,
};
use aptos_config::{
config::NodeConfig,
network... | the_stack |
use crate::regexp::feature::Feature;
use crate::regexp::{RegExp, RegExpConfig};
use itertools::Itertools;
use std::io::ErrorKind;
use std::path::PathBuf;
/// This struct builds regular expressions from user-provided test cases.
pub struct RegExpBuilder {
test_cases: Vec<String>,
config: RegExpConfig,
}
impl R... | the_stack |
use crate::prelude::*;
use crate::config;
use crate::ide::Ide;
use crate::transport::web::WebSocket;
use engine_protocol::project_manager;
use engine_protocol::project_manager::ProjectName;
use ensogl::application::Application;
use ensogl::system::web;
use uuid::Uuid;
// =================
// === Constants ===
// =... | the_stack |
#![deny(missing_docs)]
use std::{
cmp::Ord,
error::Error,
fmt::{Debug, Display, Formatter},
iter::{once, repeat},
mem::{align_of, size_of},
ops::Range,
str::FromStr,
sync::{
atomic::{AtomicBool, Ordering},
mpsc, Arc,
},
thread::{spawn, JoinHandle},
};
#[cfg(feat... | the_stack |
use std::{
collections::HashMap,
error::Error,
fs, io, iter, str,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
time::Duration,
};
use assert_json_diff::assert_json_eq;
use futures::{join, StreamExt};
use http::StatusCode;
use pretty_assertions::assert_eq;
use reqwest::Respons... | the_stack |
//! Weighted index sampling
//!
//! This module provides two implementations for sampling indices:
//!
//! * [`WeightedIndex`] allows `O(log N)` sampling
//! * [`alias_method::WeightedIndex`] allows `O(1)` sampling, but with
//! much greater set-up cost
//!
//! [`alias_method::WeightedIndex`]: alias_me... | the_stack |
#![allow(clippy::float_cmp)]
use libc::{c_double, c_long};
use num_traits::cast::cast;
use super::exc;
use super::object::PyObject;
use crate::conversion::{FromPyObject, ToPyObject};
use crate::err::{self, PyErr, PyResult};
use crate::ffi;
use crate::python::{PyClone, PyDrop, Python, PythonObject};
/// Represents a ... | the_stack |
pub trait Context: Sized {
fn state_mut( &mut self ) -> &mut State;
fn state( &self ) -> &State;
fn dummy_fetch( &mut self, address: u16 ) {
let _ = self.fetch( address );
}
fn fetch( &mut self, address: u16 ) -> u8;
fn is_on_odd_cycle( &self ) -> bool;
fn write_sprite_list_ram( &... | the_stack |
pub mod subscription_list;
pub mod client_list;
use std::collections::HashMap;
use std::fmt::{self, Debug};
use std::net::SocketAddr;
use futures::sync::mpsc::{self, Receiver};
use rand::{self, Rng};
use mqtt3::*;
use error::{Result, Error};
use client::{ConnectionStatus, Client};
use self::subscription_list::Subsc... | the_stack |
use super::{link, SessionAcl};
use crate::actors::provider_session::link as plink;
use crate::actors::router::Router;
use crate::actors::supervisor::link as supervisor_link;
use crate::actors::supervisor::{ClientAssistant, Supervisor, SupervisorLink};
use crate::registry::{Registry, ValidPath};
use anyhow::{anyhow, Err... | the_stack |
use super::*;
use whitebox_common::utils::Endianness;
use std::convert::TryInto;
use std::f64;
use std::fs::File;
use std::io::prelude::*;
use std::io::{BufReader, BufWriter, Error, SeekFrom};
pub fn read_esri_bil(
file_name: &String,
configs: &mut RasterConfigs,
data: &mut Vec<f64>,
) -> Result<(), Error>... | the_stack |
use crate::nymd::cosmwasm_client::client::CosmWasmClient;
use crate::nymd::cosmwasm_client::helpers::{compress_wasm_code, CheckResponse};
use crate::nymd::cosmwasm_client::logs::{self, parse_raw_logs};
use crate::nymd::cosmwasm_client::types::*;
use crate::nymd::error::NymdError;
use crate::nymd::wallet::DirectSecp256k... | the_stack |
use super::bus::Bus;
#[derive(Default, Clone)]
#[allow(non_snake_case)]
pub struct Flags {
pub C: bool, // Carry Flag
pub Z: bool, // Zero Flag
pub I: bool, // Interrupt Disable
pub D: bool, // Decimal Mode
pub B: bool, // Break Command
pub U: bool, // Unused
pub O: bool, // Overflow Flag
... | the_stack |
#[allow(unused)]
fn runner() -> crate::TestRunner {
super::runner()
}
#[test]
#[ignore] // wrong result
fn complex() {
assert_eq!(
runner().ok("a {b: selector-replace(\"c d\", \"d\", \"e f\")}\n"),
"a {\
\n b: c e f, e c f;\
\n}\n"
);
}
#[test]
#[ignore] // wrong result
f... | the_stack |
use arrow::{
self,
array::{Array, DictionaryArray, StringArray},
datatypes::{DataType, Int32Type},
record_batch::RecordBatch,
};
use datafusion::physical_plan::SendableRecordBatchStream;
use observability_deps::tracing::trace;
use snafu::{OptionExt, ResultExt, Snafu};
use std::sync::Arc;
use tokio::syn... | the_stack |
use crate::time::Timestamp;
use core::{cmp::max, time::Duration};
use num_rational::Ratio;
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)]
/// Bandwidth-related data tracked for each sent packet
pub struct PacketInfo {
/// [Estimator::delivered_bytes] at the time this packet was sent.
pub delivered_bytes: u... | the_stack |
mod tests {
extern crate kaze;
mod modules {
include!(concat!(env!("OUT_DIR"), "/modules.rs"));
}
use modules::*;
use kaze::runtime::tracing::*;
use std::cell::RefCell;
use std::collections::BTreeMap;
use std::fmt;
use std::io;
use std::rc::Rc;
struct CodeWriter<... | the_stack |
use etherparse::*;
use byteorder::{ByteOrder, BigEndian};
use super::super::*;
proptest! {
#[test]
fn read_write(ref input in udp_any()) {
use std::io::Cursor;
//serialize
let mut buffer: Vec<u8> = Vec::with_capacity(UdpHeader::SERIALIZED_SIZE + 1);
input.write(&mut buffer).u... | the_stack |
// === Non-Standard Linter Configuration ===
#![allow(missing_docs)]
use crate::data::function::traits::*;
use crate::prelude::*;
use rustc_hash::FxHashSet;
use std::hash::Hash;
use std::mem;
// ==================
// === Operations ===
// ==================
pub mod traits {
use super::*;
// === Arg ===
... | the_stack |
use smart_default::SmartDefault;
use std::iter::Peekable;
use std::str::CharIndices;
use nu_errors::ParseError;
use nu_source::{HasSpan, Span, Spanned, SpannedItem};
use super::token_group::TokenBuilder;
use super::tokens::{
CommandBuilder, CommentsBuilder, GroupBuilder, LiteBlock, LiteCommand, LiteComment,
... | the_stack |
use anyhow::{anyhow, bail, Context, Result};
use bytes::Buf;
use cpio::{write_cpio, NewcBuilder, NewcReader};
use nix::unistd::isatty;
use openat_ext::FileExt;
use serde::{Deserialize, Serialize};
use std::convert::TryInto;
use std::fs::{read, write, File, OpenOptions};
use std::io::{self, copy, BufReader, BufWriter, C... | the_stack |
use serde::{de, de::Visitor, Deserialize, Deserializer, Serialize, Serializer};
use std::{
convert::TryInto, fmt::{self, Display}, ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign}, str::FromStr
};
#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)]
pub struct Mem(pub(super) u64);
... | the_stack |
use crate::emitter::InstructionWriter;
use ast::source_atom_set::SourceAtomSetIndex;
use std::collections::HashMap;
use std::iter::Iterator;
use stencil::env_coord::{EnvironmentHops, EnvironmentSlot};
use stencil::frame_slot::FrameSlot;
use stencil::scope::{BindingKind, GlobalScopeData, LexicalScopeData, ScopeDataMap, ... | the_stack |
use crate::chase::*;
use either::Either;
use itertools::Itertools;
use razor_fol::{
syntax::{formula::Atomic, term::Complex, Formula, FOF},
transform::GNF,
};
use std::{
collections::{HashMap, HashSet},
fmt, iter,
};
// Is a *positive* literal apearing in the body and the head of sequents
pub type Lite... | the_stack |
use crate::statistics::ops::C;
use crate::traits::{
num::{ExpLogOps, PowOps, TrigOps},
stable::StableFn,
fp::FPVector,
math::Vector,
sugar::VecOps,
};
use std::iter::{FromIterator, DoubleEndedIterator, ExactSizeIterator};
use std::ops::{Add, Div, Index, IndexMut, Mul, Neg, Sub};
use self::AD::{AD0, ... | the_stack |
use core::sync::atomic::{Ordering};
#[repr(usize)]
#[allow(dead_code)]
#[derive(Debug)]
pub enum Regs
{
HcRevision = 0,
HcControl,
HcCommandStatus,
HcInterruptStatus,
HcInterruptEnable,
HcInterruptDisable,
HcHCCA,
HcPeriodCurrentED,
HcControlHeadED,
HcControlCurrentED,
HcBulkHeadED,
HcBulkCurrentED,
HcDo... | the_stack |
use crate::types::*;
use crate::protocol::types::{RedisCommandKind, ResponseKind, RedisCommand, ValueScanInner, KeyScanInner};
use futures::{Future, Stream, IntoFuture};
use crate::error::{
RedisError,
RedisErrorKind
};
use crate::utils;
use crate::protocol::utils as protocol_utils;
use crate::protocol::types::Va... | the_stack |
use crate::error::InvalidPathError;
use crate::{default, deref};
use std::collections::{hash_map, HashMap};
use std::convert::TryFrom;
use std::fmt;
use std::iter::{FromIterator, Iterator, Map};
use std::path::PathBuf as StdPathBuf;
use std::str::FromStr;
// Custom PathBuf for managing custom url queries and variables... | the_stack |
use crate::file_formats::EventDecoder;
use crate::{file_formats, Event, LightweightEvent};
use decodeme::{read_file_header, Metadata};
use measureme::file_header::{
write_file_header, FILE_EXTENSION, FILE_MAGIC_EVENT_STREAM, FILE_MAGIC_TOP_LEVEL,
};
use measureme::{
EventId, PageTag, RawEvent, SerializationSink... | the_stack |
#![deny(missing_docs)]
use fallible_collections::FallibleVec;
use std::sync::Arc;
use fallible_collections::TryHashMap;
use std::f32;
use std::fmt;
use std::num::NonZeroUsize;
/// See [Error]
pub type Result<T, E = Error> = std::result::Result<T, E>;
/// Pixel format from the [rgb] crate.
pub mod px;
pub use px::Pix... | the_stack |
use crate::tools::*;
use whitebox_vector::*;
use std::env;
use std::io::{Error, ErrorKind};
use std::path;
/// This tool smooths a vector coverage of either a POLYLINE or POLYGON base ShapeType. The algorithm
/// uses a simple moving average method for smoothing, where the size of the averaging window is specified
///... | the_stack |
use std::{char, collections::HashSet, ops::Range};
use ir::CharacterClass;
use crate::{
ir::{self, AssertionKind, Node},
unicode::*,
Error, Result, Span,
};
// I know you may be tempted to get out your swords and condemn my use of inline everywhere,
// but *trust* me i actually backed this up with benchm... | the_stack |
use super::*;
#[tokio::test]
async fn csv_query_group_by_int_min_max() -> Result<()> {
let mut ctx = ExecutionContext::new();
register_aggregate_csv(&mut ctx).await?;
let sql = "SELECT c2, MIN(c12), MAX(c12) FROM aggregate_test_100 GROUP BY c2";
let actual = execute_to_batches(&mut ctx, sql).await;
... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.