text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
#[cfg(feature = "alloc")]
use alloc::borrow::ToOwned;
use core::{
cmp,
convert::TryFrom,
fmt::{
self,
Binary,
Debug,
Display,
Formatter,
LowerHex,
Octal,
Pointer,
UpperHex,
},
hash::{
Hash,
Hasher,
},
str,
};
use wyz::fmt::FmtForward;
use super::BitSlice;
#[cfg(feature = "alloc")]
use cra... | the_stack |
use freedesktop_entry_parser::{parse_entry, Entry as FreeDesktopEntry};
use once_cell_regex::{byte_regex, exports::regex::bytes::Regex};
use std::{
env,
ffi::{OsStr, OsString},
io,
os::unix::ffi::{OsStrExt, OsStringExt},
path::{Path, PathBuf},
};
// Detects which .desktop file contains the data on ... | the_stack |
use iml_postgres::{sqlx, PgPool};
use iml_service_queue::service_queue::ImlServiceQueueError;
use iml_wire_types::high_availability::{Ban, Node, Resource};
use std::{collections::HashMap, fmt};
use thiserror::Error;
#[derive(Debug, Clone, Ord, PartialOrd, Eq, PartialEq, sqlx::Type)]
#[sqlx(rename = "corosync_node_key"... | the_stack |
use crate::dirs::home_dir;
use std::io::{ErrorKind, Read, Write};
use std::{fs, io, path};
#[derive(Debug, Eq, PartialEq)]
pub enum ConfigType {
Branch,
Repo,
}
pub trait ConfigManagement {
fn config_dir_create(&self) -> io::Result<()>;
fn config_dir_exists(&self) -> bool;
fn config_read(&self, c... | the_stack |
use crate::syncerd::opts::Coin;
use std::convert::TryInto;
use std::fmt::{self, Display, Formatter};
use std::str::FromStr;
use bitcoin::hashes::hex::{self, ToHex};
use internet2::{zmqsocket, NodeAddr, ZmqType};
// use lnp::{TempChannelId as TempSwapId};
#[cfg(feature = "node")]
use microservices::node::TryService;
us... | the_stack |
use {
fuchsia_async as fasync,
fuchsia_zircon::{self as zx, AsHandleRef, Duration},
futures::{
channel::mpsc::Receiver,
future::{Fuse, FutureExt},
select,
sink::SinkExt,
stream::StreamExt,
},
parking_lot::Mutex,
};
use crate::{
control_plane::{ControlPlan... | the_stack |
//! An example application that uses the command family workload to generate
//! transactions and run them with Sabre
#[macro_use]
extern crate log;
mod error;
use std::io::Read;
use clap::{App, Arg};
use cylinder::{secp256k1::Secp256k1Context, Context, Signer};
use flexi_logger::{DeferredNow, LogSpecBuilder, Logge... | the_stack |
use {
anyhow::{format_err, Context as _, Error},
fidl::endpoints::Proxy as _,
fidl_fuchsia_net,
fidl_fuchsia_netemul_network::{EndpointManagerMarker, NetworkContextMarker},
fuchsia_async as fasync,
fuchsia_component::client,
fuchsia_zircon as zx,
std::convert::TryFrom as _,
structopt... | the_stack |
extern crate serde;
extern crate serde_json;
extern crate strum;
extern crate strum_macros;
use serde::{Deserialize, Serialize};
pub use serde_json::Value as Any;
use strum_macros::{EnumIter, EnumString, EnumVariantNames};
use super::Version;
use crate::qmp::{Command, Empty, TimeStamp};
/// A error enum for qmp
#[al... | the_stack |
use core::marker::PhantomData;
use core::mem::size_of;
use core::mem::MaybeUninit;
use core::ops::{Deref, DerefMut};
use core::alloc::{Layout, GlobalAlloc};
use core::sync::atomic::{AtomicU64, AtomicPtr, Ordering};
use alloc::boxed::Box;
use alloc::collections::BTreeMap;
use crate::acpi::MAX_CORES;
use rangeset::Rang... | the_stack |
use crate::{
contexts::{OnTransmitError, WriteContext},
stream::{
incoming_connection_flow_controller::IncomingConnectionFlowController,
outgoing_connection_flow_controller::OutgoingConnectionFlowController,
receive_stream::ReceiveStream,
send_stream::SendStream,
stream_e... | the_stack |
use futures::{
channel::{mpsc as async_mpsc, oneshot},
future::{abortable, AbortHandle},
prelude::*,
stream,
};
use gettextrs::gettext;
use gtk::prelude::*;
use log::debug;
use std::{
collections::HashSet,
fmt,
path::Path,
rc::Rc,
sync::{Arc, RwLock},
time::Duration,
};
use m... | the_stack |
use constants::*;
use utils::*;
use crypto_types::*;
use cipherstate::*;
use symmetricstate::*;
use patterns::*;
use handshakecryptoowner::*;
#[derive(Debug)]
pub enum NoiseError {DecryptError}
pub struct HandshakeState<'a> {
rng : &'a mut RandomType, /* for generating ephemerals */
symmetr... | the_stack |
use crate::{
cargo_cli::{CargoCli, CargoOptions},
output::{OutputContext, OutputOpts, OutputWriter},
reuse_build::{make_path_mapper, ArchiveFormatOpt, ReuseBuildOpts},
ExpectedError, ReuseBuildKind,
};
use camino::{Utf8Path, Utf8PathBuf};
use clap::{ArgEnum, Args, Parser, Subcommand};
use color_eyre::ey... | the_stack |
use crate::{
binaries,
formats::{format_type, FormatType},
methods::{coerce::coerce, encode::txt::ToTxt},
};
use eyre::{bail, Result};
use pandoc_types::definition::{self as pandoc};
use std::{collections::HashMap, io::Write, path::PathBuf, process::Stdio};
use stencila_schema::{
Article, AudioObjectSim... | the_stack |
use binaryninjacore_sys::BNLowLevelILInstruction;
use std::marker::PhantomData;
use std::mem;
use super::*;
pub struct Operation<'func, A, M, F, O>
where
A: 'func + Architecture,
M: FunctionMutability,
F: FunctionForm,
O: OperationArguments,
{
pub(crate) function: &'func Function<A, M, F>,
pu... | the_stack |
use super::sample::*;
use std::{io, thread};
use std::sync::{Arc, Mutex};
use websocket::sync::Server;
use websocket::OwnedMessage;
use websocket::sync::sender::Sender;
use websocket::sender::Writer;
use websocket::server::upgrade::WsUpgrade;
use websocket::server::upgrade::sync::Buffer;
use serde::Serialize;
... | the_stack |
use crate::collections::cache::CacheTable;
use crate::ArenaString;
use crate::storage::{ArenaStorage, ArrayLike, Capacity, LayoutSpec};
use core::alloc::Layout;
use core::cmp::Ordering;
use core::fmt::{self, Debug, Display, Formatter, Pointer, Write};
use core::hash::{BuildHasher, Hash, Hasher};
use core::marker::Phan... | the_stack |
use std::borrow::Borrow;
use std::collections::hash_map::DefaultHasher;
use std::hash::{Hash, Hasher};
use std::mem;
/// A hash map implemented with separate chaining collision resolution strategy.
///
/// This implementation is focused on hash map functionalities, so we choose to
/// adopt Rust `DefaultHasher` to avo... | the_stack |
use lalrpop;
use proc_macro2::{Literal, TokenStream};
use quote::{format_ident, quote, ToTokens};
use std::env;
use std::fs::File;
use std::io::Write;
use std::path::Path;
use yaml_rust::Yaml;
mod common;
#[derive(Default)]
struct Guc {
name: String,
context: String,
short_desc: String,
vartype: Strin... | the_stack |
use std::{cmp::Ordering, convert::TryFrom, iter::FromIterator};
use crossterm::{
cursor::MoveToColumn,
queue,
style::Print,
terminal::{Clear, ClearType},
};
use unicode_segmentation::UnicodeSegmentation;
use crate::Span;
/// A `Line` is an abstraction for a collection of stylized or unstylized string... | the_stack |
#![allow(non_camel_case_types)]
use alloc::string::String;
use alloc::collections::btree_map::BTreeMap;
use alloc::vec::Vec;
fn is_false(b: &bool) -> bool {
!b
}
#[derive(Debug)]
pub struct Platform {
pub os: String,
pub arch: String,
}
#[derive(Default, PartialEq, Debug)]
pub struct Box {
pub heigh... | the_stack |
use std::collections::VecDeque;
use std::time::{Duration, Instant};
use bytes::{Bytes, BytesMut};
use log::info;
use take_until::TakeUntilExt;
use crate::packet::{CompressedLossList, PacketLocation};
use crate::protocol::receiver::time::SynchronizedRemoteClock;
use crate::protocol::{TimeSpan, TimeStamp};
use crate::{... | the_stack |
use chrono::NaiveDate;
use console::Style;
use uuid::Uuid;
use serde_json;
use crate::db_connection::{
establish_postgres_connection,
// Use Model or separate it from db_connection.rs
query_list_of_users,
};
use tonic::{Request, Response, Status};
use crate::user::{
user_service_server::UserService... | the_stack |
extern crate bootloader;
extern crate log;
extern crate spin;
use crate::boot_proto::BootProtocol;
use crate::mm;
use crate::mm::paging::{PageSize, PagingError};
use crate::mm::MemorySizes;
use bootloader::boot_info::{MemoryRegionKind, MemoryRegions};
use lazy_static::lazy_static;
use spin::{Mutex, MutexGuard};
#[de... | the_stack |
use byteorder::{BigEndian, ByteOrder};
use bytes::{Buf, Bytes, BytesMut};
use futures::stream::{Stream, StreamExt};
use std::cmp::{Ord, Ordering};
use std::convert::TryInto;
use std::error::Error;
use std::fmt;
use std::hash::{Hash, Hasher};
use std::io;
use tokio::io::{AsyncRead, AsyncReadExt, AsyncWriteExt};
use toki... | the_stack |
use std::cell::RefCell;
use std::collections::BTreeMap;
use std::str;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::time::{SystemTime, UNIX_EPOCH};
use syscall::data::{Map, Stat, StatVfs, TimeSpec};
use syscall::error::{
Error, Result, EACCES, EBADF, EEXIST, EINVAL, EISDIR, ELOOP, ENOENT, ENOTDIR, ENOTE... | the_stack |
use crate::cliargsparser::CliArgsParser;
use crate::logger::{self, Level};
use crate::utils;
use gettextrs::gettext;
use std::fs::{self, DirBuilder};
use std::io;
use std::os::unix::fs::DirBuilderExt;
use std::path::{Path, PathBuf};
use strprintf::fmt;
pub const NEWSBOAT_SUBDIR_XDG: &str = "newsboat";
pub const NEWSBO... | the_stack |
//! Constant Folding
use crate::ir::prelude::*;
use crate::opt::prelude::*;
use crate::{ir::InstData, ty::*, value::IntValue};
use std::cmp::min;
/// Constant Folding
///
/// This pass implements constant folding. It replaces instructions with
/// constant arguments with the corresponding result.
pub struct ConstFold... | the_stack |
use ton_block::{Number5, StateInit, StateInitLib, TickTock};
use ton_types::{BuilderData, Cell, SliceData};
use crate::boc::internal::{deserialize_cell_from_boc, deserialize_object_from_boc, serialize_cell_to_boc, serialize_object_to_boc};
use crate::boc::Error;
use crate::client::ClientContext;
use crate::error... | the_stack |
use std::io;
use std::io::ErrorKind::WouldBlock;
#[cfg(any(feature = "ssl", feature = "nativetls"))]
use std::mem::replace;
use std::net::SocketAddr;
use bytes::{Buf, BufMut};
use mio::tcp::TcpStream;
#[cfg(feature = "nativetls")]
use native_tls::{
HandshakeError, MidHandshakeTlsStream as MidHandshakeSslStream, Tl... | the_stack |
use crate::types::get_string;
use crate::types::CroStakedState;
use crate::types::{CroAddress, CroAddressPtr, CroResult};
use chain_core::init::coin::Coin;
pub use chain_core::init::network::Network;
use chain_core::state::account::{
StakedState, StakedStateAddress, StakedStateOpAttributes, StakedStateOpWitness, Un... | the_stack |
use cosmwasm_std::entry_point;
use cosmwasm_std::{
from_binary, to_binary, Addr, Binary, CanonicalAddr, CosmosMsg, Decimal, Deps, DepsMut, Env,
MessageInfo, Response, StdError, StdResult, Uint128, WasmMsg,
};
use anchor_token::staking::{
ConfigResponse, Cw20HookMsg, ExecuteMsg, InstantiateMsg, MigrateMsg,... | the_stack |
use super::weather::Weather;
use super::{Camera, GameContext, SimpleCull};
use base::math::*;
use glium;
use glium::backend::Facade;
use glium::draw_parameters::DrawParameters;
use glium::framebuffer::SimpleFrameBuffer;
use glium::framebuffer::ToColorAttachment;
use glium::index::PrimitiveType;
use glium::texture::text... | the_stack |
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct OrganizationConfiguration {
/// <p>Enables Organizations integration.</p>
pub enable_integration: bool,
}
impl OrganizationConfiguration {
/// <p>Enables Organizations integration.</p>
pub fn enable_integration(&self) -> bool... | the_stack |
use shared::minwindef::USHORT;
pub type USAGE = USHORT;
pub type PUSAGE = *mut USAGE;
pub const HID_USAGE_PAGE_UNDEFINED: USAGE = 0x00;
pub const HID_USAGE_PAGE_GENERIC: USAGE = 0x01;
pub const HID_USAGE_PAGE_SIMULATION: USAGE = 0x02;
pub const HID_USAGE_PAGE_VR: USAGE = 0x03;
pub const HID_USAGE_PAGE_SPORT: USAGE = 0x... | the_stack |
use crate::net::ipv6::ip_utils::IPAddr;
use crate::net::ipv6::ipv6_send::{IP6SendClient, IP6Sender};
use crate::net::ipv6::TransportHeader;
use crate::net::network_capabilities::{NetworkCapability, UdpVisibilityCapability};
use crate::net::udp::udp_port_table::UdpPortBindingTx;
use crate::net::udp::UDPHeader;
use core... | the_stack |
use super::keycode_to_key;
use super::{virtual_key_code_to_scan, BACKEND};
use crate::consoles::Console;
use crate::prelude::{
to_char, BEvent, BTerm, GameState, SimpleConsole, SparseConsole, VirtualKeyCode,
BACKEND_INTERNAL,
};
use crate::{clear_input_state, BResult};
use bracket_color::prelude::*;
use crosste... | the_stack |
//! # Poi
//! a pragmatic point-free theorem prover assistant
//!
//! [Standard Library](./assets/std.md)
//!
//! ```text
//! === Poi Reduce 0.23 ===
//! Type `help` for more information.
//! > and[not]
//! and[not]
//! or
//! ∵ and[not] => or
//! <=> not · nor
//! ∵ not · nor <=> or
//! ∴ or
//! ```
//!
//! To r... | the_stack |
#![allow(clippy::type_complexity)]
use bigdecimal::{BigDecimal, FromPrimitive};
use binary::BinaryValue;
use data_manipulation_query_result::QueryExecutionError;
use data_manipulation_typed_tree::TypedTree;
use definition::ColumnDef;
use query_response::QueryEvent;
use scalar::ScalarValue;
use std::collections::HashMa... | the_stack |
use std::collections::{BTreeSet, HashMap, HashSet};
use std::fmt;
use redscript::ast::{Expr, Ident, Seq, SourceAst, Span};
use redscript::bundle::{ConstantPool, PoolError, PoolIndex};
use redscript::bytecode::{Code, Instr};
use redscript::definition::*;
use redscript::mapper::{MultiMapper, PoolMapper};
use redscript::... | the_stack |
use super::Cells;
use super::Cell;
use super::Range;
use super::Row;
use super::Columns;
use super::Column;
use super::drawing::spreadsheet::WorksheetDrawing;
use super::PageSetup;
use super::PageMargins;
use super::HeaderFooter;
use super::SheetView;
use super::Protection;
use super::ConditionalSet;
use super::Style;
... | the_stack |
mod buffer;
mod num;
mod parser;
mod protocol;
mod socket_pool;
use socket_pool::SocketPool;
use crate::traits::{
ip::{IpAddress, IpProtocol, SocketAddress},
tcp::{TcpError, TcpStack},
wifi::{Join, JoinError, WifiSupplicant},
};
use atomic_polyfill::{AtomicBool, Ordering};
use buffer::Buffer;
use core::{f... | the_stack |
// Read what you wrote.
use flexbuffers::*;
#[cfg(not(miri))] // slow.
use quickcheck;
use serde::{Deserialize, Serialize};
// TODO(cneo): Upstream this to the quickcheck crate. Also, write a macro to derive Arbitrary.
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug, Serialize, Deserialize)]
pub struct NonNullS... | the_stack |
use std::ops;
use std::mem::swap;
use cgmath::{num_traits, Vector2};
use accessor::SliceAccessor;
use cubemap::CubeFace;
/// Faster alternative for the standard `f32::round` function.
#[inline(always)]
fn roundf32(x: f32) -> f32 {
(x + 0.5).floor()
}
pub fn gaussian_kernel(radius: usize, sigma: f32) -> Vec<f32> ... | the_stack |
use super::*;
use crate::{
messaging::SerialisedFrame,
net::{
buffers::{BufferChunk, BufferPool, DecodeBuffer},
frames::{Frame, FramingError, Hello, Start, FRAME_HEAD_LEN},
},
};
use bytes::{Buf, BytesMut};
use mio::{net::TcpStream, Token};
use network_thread::*;
use std::{
cell::RefCell... | the_stack |
use super::super::contextual_block_verifier::{EpochVerifier, TwoPhaseCommitVerifier};
use crate::contextual_block_verifier::{RewardVerifier, VerifyContext};
use ckb_chain::chain::{ChainController, ChainService};
use ckb_chain_spec::consensus::{Consensus, ConsensusBuilder};
use ckb_error::assert_error_eq;
use ckb_launch... | the_stack |
use super::error::{ParseError, ParseErrorKind, Result};
use crate::server::controlchan::{
command::Command,
commands::{AuthParam, ModeParam, Opt, StruParam},
line_parser::parser::parse,
};
use pretty_assertions::assert_eq;
#[test]
fn parse_user_cmd_crnl() {
let input = "USER Dolores\r\n";
assert_e... | the_stack |
use std::iter::Peekable;
use std::mem::replace;
use std::rc::Rc;
use treewalk::ast::*;
use treewalk::scanner::{Lexeme, Position, Token, TokenWithContext};
/// This behave exactly as try! but wraps the returned result in a Some.
/// It's useful to remove some boilerplate in the code introduced by
/// the use of Option<... | the_stack |
use core::any::TypeId;
use core::convert::TryInto;
use core::fmt;
use core::marker::PhantomData;
use core::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Sub, SubAssign};
use approx::{AbsDiffEq, RelativeEq, UlpsEq};
use num_traits::Zero;
#[cfg(feature = "random")]
use rand::distributions::uniform::{SampleBorrow... | the_stack |
//! Service for interacting with a [Clyde Space 3G EPS](https://www.aac-clyde.space/satellite-bits/eps)
//!
//! # Configuration
//!
//! The service can be configured in the `/etc/kubos-config.toml` with the following fields:
//!
//! ```toml
//! [clyde-3g-eps-service]
//! bus = "/dev/i2c-1"
//!
//! [clyde-3g-eps-service... | the_stack |
use bitflags::bitflags;
use derive_more::{Constructor, Display};
use std::convert::{TryFrom, TryInto};
use std::io::{Cursor, Error as IoError, Read};
use crate::error;
use crate::error::Error;
use crate::frame::events::SchemaChange;
use crate::frame::{FromBytes, FromCursor, Serialize};
use crate::types::rows::Row;
use... | the_stack |
use crate::game::ChessGame;
use crate::game::Player as PlecoPlayer;
pub use crate::game::{ChessOutcome, SQ};
use crate::{Player, Square};
use anyhow::{Context, Result};
use pleco::tools::Searcher;
use serde::{Deserialize, Serialize};
use std::thread;
use std::time::{Duration, SystemTime};
use tokio::stream::StreamExt;
... | the_stack |
use std::collections::HashSet;
use std::fmt;
use std::fs::read_to_string;
use std::path::{Path, PathBuf};
use log::{debug, warn};
use once_cell::sync::Lazy;
use regex::Regex;
use url::Url;
use cached::cached_key_result;
use cached::SizedCache;
use super::CheckContext;
use crate::{
parse::{parse_fragments, parse... | the_stack |
use serde_derive::{Serialize, Deserialize};
use itertools::Itertools;
use fancy_regex::Regex;
use rayon::prelude::*;
use unicase::UniCase;
use std::{fmt, fmt::Display};
use std::cmp::Ordering;
use std::collections::{BTreeMap, HashMap, HashSet};
use crate::DB;
use crate::dependencies::Dependencies;
use crate::games::V... | the_stack |
extern crate ocl;
use ocl::core::{self, PlatformInfo, DeviceInfo, ContextInfo,
CommandQueueInfo, MemInfo, ImageInfo, SamplerInfo, ProgramInfo,
ProgramBuildInfo, KernelInfo, KernelArgInfo, KernelWorkGroupInfo,
EventInfo, ProfilingInfo, Status};
use ocl::{Platform, Device, Context, Queue, Buffer, Image, Samp... | the_stack |
//! Shortcut matching
use crate::event::{Command, ModifiersState, VirtualKeyCode};
use linear_map::LinearMap;
#[cfg(feature = "config")]
use serde::de::{self, Deserialize, Deserializer, MapAccess, Unexpected, Visitor};
#[cfg(feature = "config")]
use serde::ser::{Serialize, SerializeMap, Serializer};
use std::collectio... | the_stack |
#![allow(clippy::too_many_lines, unused_qualifications)]
mod chain;
mod cloned;
mod filter;
mod filter_map_sync;
mod flat_map;
mod flat_map_sync;
mod identity;
mod inspect;
mod join;
mod map;
mod map_sync;
mod sum_type;
mod update;
use async_trait::async_trait;
use either::Either;
use futures::{future, pin_mut, strea... | the_stack |
use std::fmt;
use std::time::{Instant,Duration};
use itertools::Itertools;
use buffer::*;
use hash::*;
use script::context;
use ffi;
use store;
use store::TxPtr;
use store::Record;
use store::HashIndexGuard;
use store::TxIndex;
const MAX_TRANSACTION_SIZE: usize = 1_000_000;
#[derive(Debug)]
pub enum TransactionEr... | the_stack |
use std::{
collections::HashMap,
io::{Read, Seek, SeekFrom},
path::Path,
sync::Mutex,
};
use byteorder::{LittleEndian, ReadBytesExt};
use libc::c_char;
use crate::{call_original, hook, targets};
fn zero_memory(ptr: *mut u8, bytes: usize) {
for i in 0..bytes {
unsafe {
ptr.add(... | the_stack |
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(unused_mut)]
use snowball::SnowballEnv;
use snowball::Among;
static A_0: &'static [Among<Context>; 10] = &[
Among("pa", -1, 1, None),
Among("sti", -1, 2, None),
Among("kaan", -1, 1, None),
Among("han", -1, ... | the_stack |
use {
super::{util::*, *},
crate::fidl::*,
anyhow::Error,
std::collections::HashSet,
std::io,
std::iter,
};
pub struct CppBackend<'a, W: io::Write> {
w: &'a mut W,
}
impl<'a, W: io::Write> CppBackend<'a, W> {
pub fn new(w: &'a mut W) -> Self {
CppBackend { w }
}
}
fn get_i... | the_stack |
use std::collections::{BTreeSet, HashMap};
use byteorder::{ByteOrder, LittleEndian};
use encoding::all::UTF_16LE;
use encoding::{DecoderTrap, Encoding};
use serde::{Deserialize, Serialize};
use crate::error::LinderaErrorKind;
use crate::LinderaResult;
const DEFAULT_CATEGORY_NAME: &str = "DEFAULT";
fn ucs2_to_unicod... | the_stack |
use amethyst::{
animation::{
get_animation_set, AnimationCommand, AnimationControlSet, AnimationSet, EndControl,
},
ecs::{Entities, Join, ReadStorage, System, WriteStorage},
renderer::SpriteRender,
};
use crate::components::{
Animation, AnimationId, BulletImpact, Explosion, Flier, Marine, M... | the_stack |
use std::convert::TryFrom;
use std::fmt;
use std::str::FromStr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use arc_swap::ArcSwap;
use bech32::{self, FromBase32, ToBase32};
use bytes::Bytes;
use hasher::{Hasher, HasherKeccak};
use lazy_static::lazy_static;
use muta_codec_derive::RlpFixedCodec;
u... | the_stack |
extern crate bufstream;
extern crate confy;
extern crate libc;
extern crate rand;
extern crate redis;
extern crate secp256k1;
extern crate serde;
extern crate sha2;
extern crate structopt;
extern crate time;
extern crate zkchan_tx;
extern crate zkchannels;
use bufstream::BufStream;
use libc::{c_int, c_void};
use rand:... | the_stack |
use xcbgen::defs as xcbdefs;
use super::{ename_to_rust, to_rust_variable_name, NamespaceGenerator};
#[inline]
pub(super) fn expr_to_str(
generator: &NamespaceGenerator<'_, '_>,
expr: &xcbdefs::Expression,
mut wrap_field_ref: impl FnMut(&str) -> String,
panic_on_overflow: bool,
cast_to_type: Option... | the_stack |
//! A ScabbardClient instance backed by the reqwest library.
mod builder;
use std::time::{Duration, Instant, SystemTime};
use reqwest::{
blocking::{Client, RequestBuilder, Response},
Url,
};
use serde::{Deserialize, Serialize};
use transact::{protocol::batch::Batch, protos::IntoBytes};
use crate::hex::parse... | the_stack |
#![feature(alloc)]
#![feature(allocator_api)]
extern crate alloc;
extern crate elfmalloc;
extern crate num_cpus;
use std::marker;
use alloc::heap;
use std::mem;
use std::thread;
use std::time;
use std::ptr::write_volatile;
// use elfmalloc::slag::{AllocBuilder, LocalAllocator, MagazineAllocator};
// use elfmalloc::gen... | the_stack |
use std::collections::HashMap;
use std::convert::{TryFrom, TryInto};
use std::fmt;
use std::fmt::{Debug, Formatter};
use chrono::{DateTime, FixedOffset, Utc};
use itertools::Itertools;
use lazy_static::lazy_static;
use crate::data;
use crate::operator::EvalError;
/// Enum used to capture a static function that can b... | the_stack |
pub mod plugin {
use std::sync::{Arc, Mutex};
use duktape::*;
use duktape::types::*;
use duktape::errors::*;
use config::Players;
use unicorn::info::Info;
use unicorn::noise::Noise;
use sound::sound::Sound;
use gfx::Screen;
/*
# GFX # Javascript ... | the_stack |
mod iter;
mod range;
mod prefix;
pub use self::iter::{RoIter, RoRevIter, RwIter, RwRevIter};
pub use self::range::{RoRange, RoRevRange, RwRange, RwRevRange};
pub use self::prefix::{RoPrefix, RoRevPrefix, RwPrefix, RwRevPrefix};
fn advance_key(bytes: &mut Vec<u8>) {
match bytes.last_mut() {
Some(&mut 255) ... | the_stack |
use std::ffi::OsString;
use std::fs::File;
use std::path::{Component, Path};
use faccess::PathExt;
/// Special filenames which cannot be used for real files under Win32
///
/// (Unless your app uses the `\\?\` path prefix to bypass legacy Win32 API compatibility
/// limitations)
///
/// **NOTE:** These are still rese... | the_stack |
use super::{CargoConfig, Fix, Patterns, PotentialWaste, Report, TarHeader, WastedFile};
use std::{collections::BTreeSet, path::Path, path::PathBuf};
lazy_static! {
static ref COMPILE_TIME_INCLUDE: regex::bytes::Regex =
regex::bytes::Regex::new(r##"include_(str|bytes)!\("(?P<include>.+?)"\)"##)
... | the_stack |
use {
crate::{
format::CodeStr,
state::{self, State},
Settings,
},
byte_unit::Byte,
chrono::DateTime,
regex::RegexSet,
scopeguard::guard,
serde::{Deserialize, Serialize},
std::{
cmp::max,
collections::{hash_map::Entry, HashMap, HashSet},
io... | the_stack |
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use wasm_bindgen::convert::FromWasmAbi;
use std::collections::{HashMap, HashSet};
use std::sync::Mutex;
use web_sys::{
AddEventListenerOptions,
Blob,
Element,
Event,
EventTarget,
FileReader,
Document,
KeyboardEvent,
HtmlButtonE... | the_stack |
use failure::Error;
use rocksdb::DB as rocks_db;
use rocksdb::{Options, SliceTransform, WriteOptions, ColumnFamilyDescriptor};
use std::path::{Path, PathBuf};
use common_u::errors::{DBErr, DBErrKind};
use db::primitives::SplitKey;
// These are global variables for Reade/Write/Create Options
const SYNC: bool = true;
c... | the_stack |
//
// Copyright (c) 2018 Stegos AG
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, ... | the_stack |
use std::future::Future;
use std::io::{self, IoSlice};
use std::mem::MaybeUninit;
use std::pin::Pin;
use std::process::{ChildStderr, ChildStdin, ChildStdout};
use std::task::{self, Poll};
use mio::unix::pipe;
use mio::Interest;
use crate::bytes::{Bytes, BytesVectored, MaybeUninitSlice};
use crate::{actor, rt};
/// C... | the_stack |
use std::fs;
use std::fs::File;
use std::io::{Error, ErrorKind, Read, Write};
use std::net::SocketAddr;
use std::path::PathBuf;
use std::str::FromStr;
use std::sync::{Arc, RwLock};
use std::time::{Duration, Instant};
use log::{trace, warn};
use reqwest::blocking::Client;
use reqwest::StatusCode;
use crate::cache::Fil... | the_stack |
use super::{
file_manager::{AssetCache, AssetError, AssetHandle},
material::{BindMaterial, Material},
texture_manager::TextureManager,
};
use crate::graphics::resources::GPUResourceManager;
use futures::executor::{ThreadPool, ThreadPoolBuilder};
use std::{convert::TryFrom, fmt::Debug, path::PathBuf, sync::A... | the_stack |
use crate::tree::binary::node::Node;
use crate::tree::binary::tree::Tree;
use std::collections::{HashSet, LinkedList};
use std::ptr::NonNull;
/// Binary Tree Preorder Traversal
/// Given a binary tree, return the preorder traversal of its nodes’ values.
/// For example: Given binary tree {1, #, 2, 3},
/// 1
/// ... | the_stack |
use af;
use af::{Array, Backend, HasAfEnum};
use std::cmp::max;
use num::Zero;
use itertools::Zip;
use std::default::Default;
use std::collections::HashMap;
use loss;
use utils;
use layer::{Layer, Dense, RNN, Unitary};//, LSTM};
use data::{DataSource};
use device::{Device, DeviceManager, DeviceManagerFactory};
use mod... | the_stack |
use super::{
receipt,
stream,
Async,
Pair,
Stream,
Cancel,
Receipt,
AsyncResult,
AsyncError
};
use super::core::{self, Core};
use std::fmt;
/* TODO:
* - Add AsyncVal trait that impls all the various monadic fns
*/
#[must_use = "futures are lazy and do nothing unless consumed"]
pu... | the_stack |
fn fmt_style(plain: &String) -> String {
let span_begin = String::from(
"<span style="font-family: 'Source Code Pro',
Consolas, 'Ubuntu Mono', Menlo, 'DejaVu Sans Mono',
monospace, monospace !important;">"
);
let span_end = "</span>";
span_begin + plain + s... | the_stack |
use core::convert::TryFrom;
use core::convert::TryInto;
use core::fmt::Debug;
use core::fmt::Display;
use core::fmt::Formatter;
use core::fmt::Result as FmtResult;
use serde::Serialize;
use identity_core::common::Object;
use identity_core::common::Timestamp;
use identity_core::common::Url;
use identity_core::convert:... | the_stack |
use std::collections::{BTreeMap, HashMap};
use super::*;
use tile::*;
mod neighborhood;
mod tile;
#[cfg(feature = "parallel")]
mod scheduler;
pub use neighborhood::*;
pub use tile::TileView;
/// Unordered map of entities identified by their IDs, where all the entities
/// belongs to the same Kind.
type Entities<'e... | the_stack |
mod variables;
use anyhow::Context as ErrorContext;
use thiserror::Error;
use tree_sitter::QueryCursor;
use tree_sitter::QueryMatch;
use tree_sitter::Tree;
use crate::ast::AddEdgeAttribute;
use crate::ast::AddGraphNodeAttribute;
use crate::ast::Assign;
use crate::ast::Call;
use crate::ast::Capture;
use crate::ast::Cr... | the_stack |
use std::io;
use types::{Input, ParseResult};
use primitives::IntoInner;
use buffer::{
Buffer,
DataSource,
RWDataSource,
FixedSizeBuffer,
InputBuf,
Stream,
StreamError,
};
use buffer::data_source::{IteratorDataSource, ReadDataSource};
bitflags!{
flags ParserState: u64 {
/// Th... | the_stack |
use std::fs::OpenOptions;
#[cfg(unix)]
use std::os::unix::fs::OpenOptionsExt;
#[cfg(windows)]
use std::os::windows::fs::OpenOptionsExt;
use std::path::Path;
use memmap2::MmapOptions;
use crate::error::Error;
use crate::{MmapFile, MmapFileMut};
use crate::raw::{DiskMmapFile, DiskMmapFileMut};
declare_and_impl_options!(... | the_stack |
use rand;
use rand::prelude::*;
use crate::color3::Color3;
use crate::vec3::Vec3;
use crate::hitable::Hitable;
use crate::list_hitable::ListHitable;
use crate::sphere_hitable::SphereHitable;
use crate::material::{LambertMaterial, MetalMaterial};
use crate::camera::Camera;
use crate::scene::Scene;
use crate::util;
use... | the_stack |
#![feature(extern_in_paths)]
#![feature(proc_macro_hygiene)]
#[macro_use]
extern crate oatie;
#[macro_use]
extern crate rouille;
#[macro_use]
extern crate failure;
#[macro_use]
extern crate serde_json;
use crypto::digest::Digest;
use crypto::md5::Md5;
use edit_common::{
doc_as_html,
markdown::{
doc_to... | the_stack |
mod inner;
mod inner_states;
use either::Either;
use log::trace;
use nix::sys::socket;
use notifier::{Notifier, Triggerer};
use serde::{de::DeserializeOwned, Deserialize, Serialize};
use std::{
borrow::Borrow, collections::{hash_map, HashMap}, convert::Infallible, error::Error, fmt, marker, mem, net::{IpAddr, SocketA... | the_stack |
use std::{
collections::BTreeMap,
fmt::{Display, Error, Formatter},
fs::read_to_string,
path::PathBuf,
process::exit,
};
use crate::{
mir::{
MirDeclaration, MirExpression, MirFunction, MirProgram, MirStatement, MirStructure, MirType,
},
parse, Identifier, StringLiteral,
};
#[de... | the_stack |
use std::sync::MutexGuard;
use anyhow::{anyhow, bail, Result};
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use syn::{ItemFn, Signature, Type};
use crate::{
class::{Class, Property},
function::{Arg, Function},
startup_function, State, STATE,
};
pub fn parser(input: ItemFn) -> Result<Tok... | the_stack |
use std::collections::HashSet;
use protobuf::descriptor::*;
use super::code_writer::*;
use super::customize::Customize;
use crate::inside::protobuf_crate_path;
use crate::rust::EXPR_NONE;
use crate::rust_name::RustIdent;
use crate::rust_name::RustIdentWithPath;
use crate::scope::EnumValueWithContext;
use crate::scope... | the_stack |
#[allow(deprecated, unused_imports)]
use std::ascii::AsciiExt;
use std::fmt::Display;
// Internal
use app::parser::{ParseResult, Parser};
use app::settings::AppSettings as AS;
use app::usage;
use args::settings::ArgSettings;
use args::{AnyArg, ArgMatcher, MatchedArg};
use errors::Result as ClapResult;
use errors::{Err... | the_stack |
use crate::common::*;
use core::{alloc::{Layout, GlobalAlloc}, ops::{Index, IndexMut}};
pub fn init(kernel_tt: usize, kernel_text_end: usize) {
// initialize virtual memory translation
unsafe {
// Outer-sharable
// Normal memory, Outer Write-Back Read-Allocate Write-Allocate Cacheable
/... | the_stack |
use std::env::VarError;
use std::io::prelude::*;
use std::io::BufReader;
use std::path::{Path, PathBuf};
use std::{env, fs, io};
use cmake::Config as CmakeConfig;
use pkg_config::{Config as PkgConfig, Library};
use walkdir::WalkDir;
const GRPC_VERSION: &str = "1.38.0";
/// Following two arrays are generated by runni... | the_stack |
use serde::{Deserialize, Serialize};
/// Shiika types
///
/// ```text
/// ^ : superclass-subclass relationship
/// ~ : class-instance relationship
///
/// Object
/// ^
/// Class ~ Class
/// ^
/// Object ... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.