text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
use shared::*;
use spirv_std::glam::{vec2, vec3, Mat3, Vec2, Vec2Swizzles, Vec3, Vec3Swizzles, Vec4};
// Note: This cfg is incorrect on its surface, it really should be "are we compiling with std", but
// we tie #[no_std] above to the same condition, so it's fine.
#[cfg(target_arch = "spirv")]
use spirv_std::num_trait... | the_stack |
use super::{Semaphore, SemaphorePermit, TryAcquireError};
use crate::loom::cell::UnsafeCell;
use std::error::Error;
use std::fmt;
use std::future::Future;
use std::mem::MaybeUninit;
use std::ops::Drop;
use std::ptr;
use std::sync::atomic::{AtomicBool, Ordering};
// This file contains an implementation of an OnceCell. ... | the_stack |
#[macro_export]
macro_rules! parse {
( $($t:tt)* ) => { __parse_internal!{ $($t)* } };
}
/// Internal rule to create an or-combinator, separate macro so that tests can override it.
///
/// Cannot make a method on `Input` due to type-inference failures due to the exact implementation
/// of `or` not being fully spe... | the_stack |
use ff::{Field, PrimeField, PrimeFieldRepr};
use bigdecimal::{BigDecimal, Num};
use models::abi::TEST_PLASMA_ALWAYS_VERIFY;
use models::plasma::params;
use models::plasma::tx::{DepositTx, ExitTx};
use models::plasma::{Engine, Fr};
use models::{ProtoBlock, StateKeeperRequest};
use std::collections::{HashMap, HashSet};
... | the_stack |
use glib::prelude::*;
use glib::subclass::prelude::*;
use glib::translate::*;
use std::ptr;
use crate::RTSPMedia;
use crate::RTSPThread;
#[derive(Debug)]
pub struct SDPInfo(ptr::NonNull<ffi::GstSDPInfo>);
impl SDPInfo {
pub fn is_ipv6(&self) -> bool {
unsafe { from_glib(self.0.as_ref().is_ipv6) }
}
... | the_stack |
mutable_transmutes,
non_camel_case_types,
non_snake_case,
non_upper_case_globals
)]
use crate::dpx_error::{Result, ERR};
use crate::warn;
use std::cmp::Ordering;
use std::fmt::Write;
use std::ptr;
use super::dpx_dpxutil::{
ht_append_table, ht_clear_iter, ht_clear_table, ht_init_table, ht_iter_getval,... | the_stack |
use std::cmp::Ordering;
use std::collections::BinaryHeap;
use std::ops::IndexMut;
use ::{SMF,Event,SMFFormat,MetaEvent,MidiMessage,Track,TrackEvent};
/// An AbsoluteEvent is an event that has an absolute time
/// This is useful for apps that want to store events internally
/// with absolute times and then quickly bui... | the_stack |
// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy)]
#![cfg_attr(rustfmt, rustfmt_skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_case_globals)]
#![allow(trivial_cast... | the_stack |
// https://github.com/rust-lang/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![allow(unused_attributes)]
#![cfg_attr(rustfmt, rustfmt::skip)]
#![allow(box_pointers)]
#![allow(dead_code)]
#![allow(missing_docs)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(non_upper_cas... | the_stack |
use proc_macro2::{Span, TokenStream};
use quote::quote;
use std::{cmp::Ordering, fmt};
use syn::{
ext::IdentExt,
parenthesized,
parse::{Parse, ParseStream},
spanned::Spanned,
token::Paren,
Error, Expr, Ident, LitStr, Token,
};
/// The custom keywords used by the precondition kinds.
mod custom_k... | the_stack |
use std::ops::Range;
use crate::debug_info;
use crate::llvm::{self, Bool, True, Type, Value};
use libc::{c_char, c_uint};
use rustc_codegen_ssa::traits::{
BaseTypeMethods, ConstMethods, DerivedTypeMethods, MiscMethods, StaticMethods,
};
use rustc_hir::def_id::DefId;
use rustc_middle::mir::interpret::{
read_tar... | the_stack |
use crate::basic::clocks::{check_clock, me};
use shuttle::sync::atomic::*;
use shuttle::{asynch, check_dfs, thread};
use std::collections::HashSet;
use std::sync::Arc;
use test_log::test;
macro_rules! int_tests {
($name:ident, $ty:ident) => {
mod $name {
use super::*;
use test_log::... | the_stack |
use crate::{
geometry::{Point, PointExt},
primitives::{
common::{LineSide, LinearEquation, StrokeOffset},
line::intersection_params::{Intersection, IntersectionParams},
Line,
},
};
/// Join kind
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)]
pub enum JoinKind {
... | the_stack |
use crate::controller::sql::mir::SqlToMirConverter;
use crate::controller::sql::query_graph::{QueryGraph, QueryGraphEdge};
use mir::{Column, MirNodeRef};
use nom_sql::FunctionExpression::*;
use nom_sql::{
self, CaseWhenExpression, ColumnOrLiteral, ConditionExpression, FunctionArguments,
FunctionExpression,
};
u... | the_stack |
use std::sync::Arc;
// others
// use time::PreciseTime;
// pbrt
use crate::core::bssrdf::compute_beam_diffusion_bssrdf;
use crate::core::bssrdf::BssrdfTable;
use crate::core::bssrdf::TabulatedBssrdf;
use crate::core::interaction::SurfaceInteraction;
use crate::core::material::{Material, TransportMode};
use crate::core:... | the_stack |
#[allow(missing_docs)] // documentation missing in model
#[non_exhaustive]
#[derive(
std::clone::Clone,
std::cmp::Eq,
std::cmp::Ord,
std::cmp::PartialEq,
std::cmp::PartialOrd,
std::fmt::Debug,
std::hash::Hash,
)]
pub enum DialogState {
#[allow(missing_docs)] // documentation missing in m... | the_stack |
use super::{help_view::*, story_view, text_view::EditableTextView};
use crate::prelude::*;
#[derive(Copy, Clone, PartialEq, Eq)]
enum SearchViewMode {
Navigation,
Search,
}
struct MatchedStories {
pub query: String,
pub page: usize,
pub by_date: bool,
pub stories: Vec<client::Story>,
}
/// Se... | the_stack |
use std;
use crate::memory_bus::{OAM_SIZE, VRAM_BEGIN, VRAM_SIZE};
const NUMBER_OF_OBJECTS: usize = 40;
#[cfg_attr(feature = "serialize", derive(Serialize))]
#[derive(Copy, Clone, Debug, PartialEq)]
pub enum Color {
White = 255,
LightGray = 192,
DarkGray = 96,
Black = 0,
}
impl std::convert::From<u8>... | the_stack |
use super::element_wrapper::*;
use super::stream_animation_core::*;
use super::pending_storage_change::*;
use crate::traits::*;
use crate::editor::*;
use flo_curves::bezier::path::*;
use futures::prelude::*;
use std::sync::*;
use std::time::{Duration};
///
/// The output of the layer cut operation
///
#[derive(Clon... | the_stack |
pub(crate) mod filters;
mod handlers;
pub(crate) mod reply;
mod routes;
use std::net::SocketAddr;
use std::path::PathBuf;
use tracing::debug;
use super::provider::Provider;
use crate::signature::KeyRing;
use crate::{search::Search, signature::SecretKeyStorage};
pub(crate) const TOML_MIME_TYPE: &str = "application/... | the_stack |
use rand::{
distributions::{Distribution, Uniform},
Rng, SeedableRng,
};
use rand_chacha::ChaCha20Rng;
use crate::types::Step;
/// A [reservoir sampling] data structure, with support for preemption and deferred "commits" of
/// records to a separate destination for better concurrency.
///
/// This structure a... | the_stack |
use crate::sql::symbol;
use std::fmt;
#[derive(Debug, Clone)]
pub struct Scanner {
message: String,
tokens: Vec<symbol::Symbol>,
pos: Pos,
}
#[derive(Debug, Clone)]
struct Pos {
cursor_l: usize,
cursor_r: usize,
}
#[derive(Debug)]
pub enum LexerError {
NotAllowedChar,
QuoteError,
}
impl ... | the_stack |
use futures::{AsyncReadExt, AsyncWriteExt};
use async_std::{fs::File, io::{self, prelude::SeekExt}, net::{TcpStream}};
use chrono::DateTime;
use chrono::offset::Utc;
use path_absolutize::*;
use crate::{common::{YaftpError, error_retcode}, utils::{calc_md5, check_support_methods}};
use std::{fs, io::{SeekFrom}, net::Sh... | the_stack |
//! NB: This code is changing so please do not depend on it at this time!
use std::{slice, mem, fmt};
use byteorder::ByteOrder;
use http2::kind::*;
use http2::flag::*;
use http2::frame::*;
use http2::Error;
use http2::ErrorCode;
use http2::SizeIncrement;
use http2::StreamIdentifier;
use http2::ParserSettings;
use h... | the_stack |
use proc_macro::{TokenStream};
use crate::macro_lib::*;
use crate::id::*;
pub fn live_derive_impl(input: TokenStream) -> TokenStream {
let mut parser = TokenParser::new(input);
let mut tb = TokenBuilder::new();
parser.eat_ident("pub");
if parser.eat_ident("struct") {
if let Some(name) = p... | the_stack |
extern crate ini;
use self::ini::Ini;
use super::http;
use super::AlarmRepeat;
use super::AlarmConfig;
use super::ConnectDeviceList;
use super::Scrobbler;
extern crate time;
extern crate fruitbasket;
use std::path;
use std::str::FromStr;
use std::collections::BTreeMap;
const INIFILE: &'static str = "connectr.ini";
c... | the_stack |
use std::collections::HashMap;
use std::path::Path;
use regex::Regex;
use toml::{self, Value};
use crate::definition::TemplateDefinition;
use crate::errors::{new_error, ErrorKind, Result};
use crate::utils::read_file;
/// Validate that the struct doesn't have bad data in it
/// and that it doesn't have obvious logic... | the_stack |
use std::fmt;
use std::iter::{once, repeat, empty, FromIterator};
use std::ops::Index;
use memory::{MemoryLayout, MemoryBlock, CellIndex, MemSize};
use operations::{Operation, Operations};
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct Instructions(Vec<Instruction>);
impl Instructions {
pub fn len(&self) -> u... | the_stack |
// TODO: keep around messages. Add an iterator over messages.
// Add set_timestamp and set_access_context to State.
use std::{
collections::BTreeMap,
ops::Bound::{Excluded, Unbounded},
};
use crate::dataflow::Timestamp;
/// Trait that must be implemented by stream state.
pub trait State: 'static + Clone {}
im... | the_stack |
#![doc(html_logo_url = "https://pngquant.org/pngquant-logo.png")]
#![warn(missing_docs)]
extern crate imagequant_sys as ffi;
pub use crate::ffi::liq_error;
pub use crate::ffi::liq_error::*;
use std::fmt;
use std::marker;
use std::mem;
use std::os::raw::c_int;
use std::ptr;
/// 8-bit RGBA. This is the only color form... | the_stack |
use {
crate::{
identifier::Identifier,
schema::{self, relativize_namespace},
},
std::{
collections::BTreeMap,
fmt::{self, Write},
path::PathBuf,
},
};
// The string to be used for each indentation level.
const INDENTATION: &str = " ";
// The generated types w... | the_stack |
use crate::bls::arch::Chunk;
use crate::bls::bls12381::big::NLEN;
// Base Bits= 58
// bls12381 Modulus
pub const MODULUS: [Chunk; NLEN] = [
0x1FEFFFFFFFFAAAB,
0x2FFFFAC54FFFFEE,
0x12A0F6B0F6241EA,
0x213CE144AFD9CC3,
0x2434BACD764774B,
0x25FF9A692C6E9ED,
0x1A0111EA3,
];
pub const ROI: [Chun... | the_stack |
pub mod shaders;
use log::info;
use nalgebra as na;
use glium::{Surface, Texture2d};
use crate::shader::{self, InstanceInput, ToUniforms};
use crate::{
basic_obj, screen_quad, BasicObj, Camera, Context, DrawError, Drawable, Instancing, Light,
Mesh, ScreenQuad,
};
use crate::pipeline::render_pass::{
Com... | the_stack |
use std::{
os,
cell::{RefCell, Ref, RefMut},
ops::{Deref, DerefMut},
rc::Rc,
mem,
marker::PhantomData,
};
use emacs::{defun, Env, Value, Result, IntoLisp, FromLisp, Vector, ErrorKind};
use tree_sitter::{Tree, Node, TreeCursor, Parser, Query, QueryCursor};
pub fn shared<T>(t: T) -> Shared<T> {... | the_stack |
use std::collections::{HashMap, HashSet};
use anyhow::bail;
use log::{debug, info, warn};
use semver::Version;
use structopt::StructOpt;
use crate::{crate_selection::Crate, release::ReleaseWorkspace, CommandResult, Fallible};
#[derive(StructOpt, Debug)]
pub(crate) struct CrateArgs {
#[structopt(subcommand)]
... | the_stack |
use std::io::Write;
use std::os::unix::io::{AsRawFd, RawFd};
use std::sync::mpsc::{channel, Receiver, Sender};
use std::sync::{Arc, Mutex};
use std::{cmp, mem};
use address_space::AddressSpace;
use machine_manager::{
config::{ConfigCheck, NetworkInterfaceConfig},
event_loop::EventLoop,
};
use migration::{Devic... | the_stack |
use anyhow::{bail, Context, Result};
use itertools::Itertools;
use log::debug;
use regex::Regex;
use std::ffi::CStr;
use std::iter;
use std::thread::sleep;
use std::time::{Duration, Instant};
use xcb::ffi::xcb_visualid_t;
use crate::args::AppConfig;
use crate::{DesktopWindow, RenderWindow};
/// Given a list of `curre... | the_stack |
use std::cmp::min;
use std::error::Error;
use std::ffi::c_void;
use std::fmt;
use std::ptr::null_mut;
use std::slice::from_raw_parts_mut;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::thread;
use std::time;
use mem::VirtMemError;
use whvp_sys::*;
use rewind_core::mem;
pub type GuestVirtualAddress = u64;
p... | the_stack |
use csv;
use log::*;
use std::collections::HashMap;
use std::collections::HashSet;
use std::fs;
use std::fs::{File, Metadata};
use std::io;
use std::io::prelude::*;
use std::path::Path;
use std::path::PathBuf;
use std::process;
use std::str::FromStr;
use toml;
use crate::util::*;
use perfcnt::linux::perf_file::PerfFi... | the_stack |
use itertools::Itertools;
use std::error::Error;
use std::fmt;
use std::rc::Rc;
use super::literal::{LiteralIntro, LiteralType};
use crate::domain::{AppClosure, Type, Value};
use crate::syntax::{Item, Module, Term};
use crate::{meta, nbe, prim, var, AppMode, Label, UniverseLevel};
/// Local type checking context.
#[d... | the_stack |
use anyhow::Result;
use liquid::Object;
use liquid_core::model::map::Entry;
use liquid_core::Value;
use regex::Regex;
use thiserror::Error;
use crate::config::{Config, TemplateSlotsTable};
#[derive(Debug)]
pub struct TemplateSlots {
pub(crate) var_name: String,
pub(crate) var_info: VarInfo,
pub(crate) pro... | the_stack |
use crate::{
connection::{
connection_id_mapper::ConnectionIdMapperState,
peer_id_registry::{
PeerIdRegistrationError::{
ExceededActiveConnectionIdLimit, ExceededRetiredConnectionIdLimit,
InvalidNewConnectionId,
},
PeerIdStatus::{
... | the_stack |
use std::env;
use std::fmt;
use std::io::{self, Read};
use std::fs::File;
use std::path::{Path, PathBuf};
use std::os::unix::io::FromRawFd;
use libc::{getuid, kill, c_int, pid_t};
use unshare::Signal::{SIGINT, SIGTERM, SIGCHLD, SIGTTIN, SIGTTOU, SIGCONT};
use unshare::Signal::{self, SIGQUIT, SIGTSTP, SIGSTOP};
use nix... | the_stack |
use derive_new::new;
use lark_debug_with::DebugWith;
use lark_span::{CurrentFile, Span, Spanned};
use std::fmt::{self, Debug};
use std::marker::PhantomData;
/// This enum describes which state to transition into next.
/// The LexerEmit nested inside of the LexerNext describes
/// what happens before the transition
#[d... | the_stack |
use std::borrow::Borrow;
use std::cell::{Cell, RefCell};
use std::marker::PhantomData;
use std::ops::{CoerceUnsized, Deref, DerefMut};
use std::rc::Rc;
use std::sync::Arc;
use crate::atn::ATN;
use crate::atn_simulator::IATNSimulator;
use crate::error_listener::{ConsoleErrorListener, ErrorListener, ProxyErrorListener};... | the_stack |
use super::*;
/// A 1-dimensional list of tiles that represents a grid of given dimension with
/// squared tiles of the same side length.
/// Only entities that have a defined location will be stored in this data
/// structure.
#[derive(Debug)]
pub struct Tiles<'e, K, C> {
dimension: Dimension,
tiles: Vec<Tile... | the_stack |
pub mod api_key;
pub mod error;
pub mod middleware;
pub mod password;
pub use error::*;
use std::{
future::{ready, Ready},
rc::Rc,
str::FromStr,
};
pub use api_key::ApiKey;
use actix_web::{dev::ServiceRequest, FromRequest, HttpRequest};
use chrono::{DateTime, Utc};
use ergo_database::{
object_id::{O... | the_stack |
use crate::println;
pub const SIGBLOCK_SIZE: usize = 0x1000;
const VERSION_STR: &'static str = "Xous OS Loader v0.9.1\n\r";
// v0.9.0 -- initial version
// v0.9.1 -- booting with hw acceleration, and "simplest signature" check on the entire xous.img blob
pub const STACK_LEN: u32 = 8192 - (7 * 4); // 7 words for back... | the_stack |
use std::collections::{HashMap, HashSet};
use std::iter;
use std::ops::Deref;
use itertools::{Either, Itertools};
use syntax::ast::{self, NodeId};
use rustc::hir;
use rustc::hir::def::CtorKind;
use rustc::hir::def_id::DefId;
use rustc::ty::subst::{Subst, Substs};
use rustc::traits::*;
use rustc::ty::{self, Lift, Ty};... | the_stack |
use crate::input::{Input, InputState};
use crate::rom::Rom;
use crate::video::Video;
use cpu::{Cpu, CpuStep};
use mapper::Mapper;
use ppu::{Ppu, PpuStep};
use std::cell::Cell;
use std::ops::{Generator, GeneratorState};
use std::pin::Pin;
use std::u8;
pub mod cpu;
pub mod mapper;
pub mod ppu;
#[derive(Clone)]
pub stru... | the_stack |
use fs3::FileExt;
use proc_macro2::TokenStream;
use std::fs::{File, OpenOptions};
use std::io::{Error, ErrorKind, Read, Write};
use std::path::{Path, PathBuf};
use syn::{Ident, Type};
use cargo_toml::Value::String as TomlString;
use cargo_toml::Value::Table as TomlTable;
use toml::value::Value as TomlValue;
#[derive(... | the_stack |
//! Group of primary expression rules.
//!
//! The list of all primary expressions is provided by the PHP Language
//! Specification in the [Grammar chapter, Expressions
//! section](https://github.com/php/php-langspec/blob/master/spec/19-grammar.md#primary-expressions).
use smallvec::SmallVec;
use std::result::Result... | the_stack |
pub struct Extent {
pub minx: f64,
pub miny: f64,
pub maxx: f64,
pub maxy: f64,
}
/// Min and max grid cell numbers
#[derive(Debug, PartialEq)]
pub struct ExtentInt {
pub minx: u32,
pub miny: u32,
pub maxx: u32,
pub maxy: u32,
}
#[derive(Debug, PartialEq)]
pub enum Origin {
TopLeft... | the_stack |
#[derive(Debug, PartialEq)]
pub struct Field {
ident: syn::Ident,
ty: Type,
is_a_byte_buf: bool,
third_party_type: Option<ThirdPartyType>,
}
/// Use third party libraries, detected
/// at compile time. These libraries will
/// be written to parquet as their preferred
/// physical type.
///
/// Chrono... | the_stack |
#![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)]
#![allow(
clippy::approx_constant,
clippy::type_complexity,
clippy::unreadable_literal,
clippy::upper_case_acronyms
)]
#![cfg_attr(feature = "dox", feature(doc_cfg))]
use glib_sys as glib;
use gobject_sys as gobject;
#[allow(unuse... | the_stack |
use super::grammars::VariableType;
use smallbitvec::SmallBitVec;
use std::iter::FromIterator;
use std::{collections::HashMap, fmt};
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub(crate) enum SymbolType {
External,
End,
EndOfNonTerminalExtra,
Terminal,
NonTerminal,
}
#[deri... | the_stack |
use std::{
borrow::{Borrow, Cow},
collections::HashMap,
hash::{BuildHasher, Hash, Hasher},
mem,
};
use firestorm::{profile_fn, profile_method, profile_section};
use regex::{escape, Regex, RegexSet};
use tracing::error;
use crate::{path::PathItem, IntoPatterns, Patterns, Resource, ResourcePath};
const... | the_stack |
use crate::bsdf::*;
use crate::camera::*;
use crate::film::*;
use crate::integrator::*;
use crate::light::*;
use crate::sampler::*;
use crate::scene::*;
use crate::shape::*;
use crate::*;
use crate::texture::ShadingPoint;
#[derive(Clone, Copy)]
pub struct VertexBase {
pdf_fwd: Float,
pdf_rev: Float,
delta: ... | the_stack |
use super::ValueMut;
use crate::{bmap_bytes, init_sized_vec, nodes_for_height, Error};
use cid::{Cid, Code::Blake2b256};
use encoding::{serde_bytes, BytesSer};
use ipld_blockstore::BlockStore;
use once_cell::unsync::OnceCell;
use serde::{
de::{self, DeserializeOwned},
ser, Deserialize, Serialize,
};
use std::er... | the_stack |
// Note the following terms are in use in this module:
// - the "unpacked" image refers to the fully blown up metal image (as it'd be read from a block
// device)
// - extents for which we already have a mapping are "skipped"
// - the "packed" image refers to the metal image with all the extents for which we already ... | the_stack |
use crate::error::{ErrorKind, Result as ModelResult};
use crate::model::shapes::{HasTraits, NonTraitEq, ShapeKind, TopLevelShape};
use crate::model::values::{Value, ValueMap};
use crate::Version;
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
// ---------------------------------------------------------... | the_stack |
extern crate deroleru;
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn conflicts_2_1_23_0f6_0f9_as16637() {
let params = deroleru::Parameters {
prefixes_peak_min_value: 2,
conflicts_peak_min_value: 1,
max_nb_peaks: 23,
similarity: 0.6,
... | the_stack |
use crate::utils::ptr::get_spans;
use crate::utils::{
get_trait_def_id, implements_trait, in_macro, is_copy, is_self, match_type, multispan_sugg, paths, snippet,
snippet_opt, span_lint_and_then,
};
use if_chain::if_chain;
use matches::matches;
use rustc::hir::intravisit::FnKind;
use rustc::hir::*;
use rustc::li... | the_stack |
use std::{cmp::Ordering, slice::Iter};
use strum_macros::{Display, EnumString};
use tari_crypto::tari_utilities::bit::*;
use crate::{
diacritics::*,
error::{KeyManagerError, MnemonicError},
mnemonic_wordlists::*,
};
/// The Mnemonic system simplifies the encoding and decoding of a secret key into and fro... | the_stack |
// Copyright 2019 The Druid Authors.
//
// 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... | the_stack |
use std::cell::RefCell;
use std::collections::HashMap;
use std::fs::Permissions;
use std::io::{Read, Seek, SeekFrom, Write};
use std::os::unix::fs::PermissionsExt;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use crate::{DirEntry, File, FileSystem, FileType};
use crate::error::ChiconError;
/// Structure implement... | the_stack |
use crate::boc::internal::deserialize_cell_from_base64;
use crate::error::ClientError;
use serde_json::Value;
use std::fmt::Display;
use ton_block::{AccStatusChange, ComputeSkipReason, MsgAddressInt};
use ton_types::{ExceptionCode, Cell};
#[derive(ApiType)]
pub enum ErrorCode {
CanNotReadTransaction = 401,
Can... | the_stack |
use anyhow::{anyhow, bail, Context, Result};
use nix::sched::CloneFlags;
use nix::NixPath;
use passfd::FdPassingExt;
use std::ffi::{OsStr, OsString};
use std::fs::{self, File};
use std::ops::{Deref, DerefMut};
use std::os::unix::io::AsRawFd;
use std::os::unix::net::UnixStream;
use std::path::{Path, PathBuf};
use std::p... | the_stack |
use super::*;
use std::{collections::BTreeMap, fmt::Debug, iter::IntoIterator};
//**************************************************************************************************
// UniqueMap
//**************************************************************************************************
/// Unique wrapper arou... | the_stack |
use std::fmt::{self, Debug};
use std::mem::MaybeUninit;
use std::ops::Deref;
use std::ptr;
#[allow(deprecated)]
use hdf5_sys::h5o::H5Oset_comment;
#[cfg(feature = "1.12.0")]
use hdf5_sys::h5o::{
H5O_info2_t, H5O_token_t, H5Oget_info3, H5Oget_info_by_name3, H5Oopen_by_token,
};
#[cfg(not(feature = "1.10.3"))]
use h... | the_stack |
#![allow(unused_variables, unused_imports, missing_docs)]
use std::convert::{TryFrom, TryInto};
use std::iter::Peekable;
use std::marker::PhantomData;
use rand::Rng;
use serde::{
de::{
EnumAccess as SerdeEnumAccess, MapAccess as SerdeMapAccess, SeqAccess as SerdeSeqAccess,
VariantAccess as SerdeV... | the_stack |
use std::{
fmt::{self, Display},
str::FromStr,
};
/// HTTP request methods.
///
/// See also [Mozilla's documentation][Mozilla docs], the [RFC7231, Section 4][] and
/// [IANA's Hypertext Transfer Protocol (HTTP) Method Registry][HTTP Method Registry].
///
/// [Mozilla docs]: https://developer.mozilla.org/en-US... | the_stack |
extern crate cgmath;
extern crate find_folder;
extern crate modulator;
extern crate num_complex;
extern crate rand;
extern crate draw_state;
extern crate gfx_device_gl;
extern crate gfx_graphics;
extern crate gfx_texture;
extern crate graphics;
extern crate piston_window;
extern crate shader_version;
extern crate shad... | the_stack |
use std::cell::RefCell;
use std::f64;
use std::fmt::Debug;
#[derive(Clone, Debug)]
struct Centroid {
sum: f64,
count: f64,
}
impl Centroid {
fn fuse(&self, other: &Centroid) -> Self {
Self {
count: self.count + other.count,
sum: self.sum + other.sum,
}
}
fn... | the_stack |
use crate::api;
use crate::api::spotify::{FullTrack, PrivateUser};
use crate::bus;
use crate::db;
use crate::injector;
use crate::player::{
convert_item, AddTrackError, ConnectDevice, ConnectPlayer, DuplicateBy, Event,
IntegrationEvent, Item, Mixer, PlaybackMode, PlayerKind, Song, Source, State, Track,
YouT... | the_stack |
use std::{
fmt::{Display, Formatter},
result,
};
use crate::vmm_config::machine_config::CpuFeaturesTemplate;
use crate::vstate::{
vcpu::{VcpuConfig, VcpuEmulation},
vm::Vm,
};
use cpuid::{c3, filter_cpuid, t2, VmSpec};
use kvm_bindings::{
kvm_debugregs, kvm_lapic_state, kvm_mp_state, kvm_regs, kvm_... | the_stack |
use crate::models;
#[cfg(any(feature = "client", feature = "server"))]
use crate::header;
// Methods for converting between header::IntoHeaderValue<GetKeychainEntryRequest> and hyper::header::HeaderValue
#[cfg(any(feature = "client", feature = "server"))]
impl std::convert::TryFrom<header::IntoHeaderValue<GetKeychai... | the_stack |
use crate::ndarray_ext::{NdArrayView, NdArrayViewMut};
use crate::smallvec::SmallVec;
use crate::tensor::{Tensor, TensorInternal};
use crate::{Float, NdArray};
use std::any::type_name;
use std::fmt;
use std::marker::PhantomData;
use std::mem;
// Properties for op's `compute` method.
// Actual number of inout/output no... | the_stack |
use std::path::Path;
/// Wrapper around [`Error`]
pub type Result<T> = std::result::Result<T, Error>;
/// Error types for this crate
#[derive(Debug)]
pub enum Error {
/// Failed to read FELF from disk
FelfRead(std::io::Error),
/// FELF had a malformed header
InvalidFelf,
/// FELF could not be lo... | the_stack |
use super::ExtractorResult::{Match, MatchNull, NoMatch};
use super::*;
use crate::Value;
use halfbrown::hashmap;
use matches::assert_matches;
#[test]
fn test_reg_extractor() {
let ex = Extractor::new("rerg", "(?P<key>[^=]+)=(?P<val>[^&]+)&").expect("bad extractor");
match ex {
Extractor::Rerg { .. } =>... | the_stack |
extern crate cli_test_dir;
extern crate sit_core;
extern crate which;
extern crate remove_dir_all;
use std::process;
use sit_core::{Repository, record::RecordOwningContainer, path::ResolvePath};
use cli_test_dir::*;
use remove_dir_all::*;
include!("includes/config.rs");
/// Should list no records if there are none... | the_stack |
pub mod circle;
mod util;
use super::app::{ActiveBlock, App, RepeatState, RouteId, RECOMMEND_OPTIONS};
use tui::backend::Backend;
use tui::layout::{Alignment, Constraint, Direction, Layout, Rect};
use tui::style::{Color, Modifier, Style};
use tui::widgets::{
canvas::Canvas, Block, Borders, Gauge, Paragraph, Row, S... | the_stack |
use super::super::parse_ast as past;
use super::nodes::*;
use super::scope::{ClosureScope, FuncScope, ModuleScope, Scope, ScopeLike};
use super::typ::{Generic, Type, Variable};
use super::{unify, Builtins, Closable, RecursionTracker, TypeError, TypeResult};
pub fn translate_module(pmodule: past::Module) -> TypeResult<... | the_stack |
//! Provides common methods needed in test code.
#![deny(broken_intra_doc_links)]
use generic_array::typenum::Unsigned;
use p256::elliptic_curve;
use serde::{Deserialize, Serialize};
use std::convert::TryInto;
use tink_core::{subtle::random::get_random_bytes, utils::wrap_err, Aead, TinkError};
use tink_proto::{prost,... | the_stack |
use std::ffi::c_void;
use std::marker::PhantomData;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;
use cocoa::appkit::{
NSApp, NSApplication, NSApplicationActivationPolicyRegular, NSBackingStoreBuffered, NSWindow,
NSWindowStyleMask,
};
use cocoa::base::{id, nil, NO};
use cocoa::foundation::... | the_stack |
#![cfg(feature = "encoding-ply")]
use num::cast;
use num::NumCast;
use ply_rs::parser::Parser;
use ply_rs::ply::KeyMap;
use smallvec::SmallVec;
use std::io::{self, Read, Write};
use std::iter::FromIterator;
use std::marker::PhantomData;
use theon::space::{EuclideanSpace, FiniteDimensional};
use thiserror::Error;
use t... | the_stack |
use super::Options;
use eyre::Result;
use html_escape::{encode_double_quoted_attribute, encode_safe};
use inflector::cases::camelcase::to_camel_case;
use serde::Serialize;
use std::any::type_name;
use stencila_schema::*;
/// Encode a `Node` to a HTML document
pub fn encode(node: &Node, options: Option<Options>) -> Res... | the_stack |
use std::convert::{TryFrom, TryInto};
use std::io::Cursor;
use std::marker::PhantomData;
use svm_types::{
Account, Address, BytesPrimitive, Context, Envelope, Gas, Layer, SectionKind, SpawnAccount,
State, TemplateAddr, Transaction, TransactionId,
};
use crate::{ParseError, ReadExt, WriteExt};
/// Ability to ... | the_stack |
mod compiler;
mod ir;
mod module_decls;
use compiler::*;
use ir::*;
use module_decls::*;
use crate::code_writer;
use crate::graph;
use crate::validation::*;
use std::collections::HashMap;
use std::io::{Result, Write};
// TODO: Note that mutable writer reference can be passed, see https://rust-lang.github.io/api-gui... | the_stack |
use crate::header_integrity::HeaderIntegrityFetcher;
use crate::http_parser::{link::Link, parse_link_header};
use futures::{stream, stream::StreamExt};
use once_cell::sync::Lazy;
use std::cell::RefCell;
use std::collections::{HashMap, HashSet};
use url::{Origin, Url};
// Filters the link header to comply with
// https... | the_stack |
pub struct GetServerDetailsPaginator<
C = aws_smithy_client::erase::DynConnector,
M = crate::middleware::DefaultMiddleware,
R = aws_smithy_client::retry::Standard,
> {
handle: std::sync::Arc<crate::client::Handle<C, M, R>>,
builder: crate::input::get_server_details_input::Builder,
}
impl<C, M, R> G... | the_stack |
#![crate_name = "compiletest"]
// The `test` crate is the only unstable feature
// allowed here, just to share similar code.
#![feature(test)]
extern crate test;
use crate::common::{output_base_dir, output_relative_path, PanicStrategy};
use crate::common::{Config, Mode, TestPaths};
use crate::util::{logv, top_level};... | the_stack |
use core::mem::size_of;
use core::sync::atomic::{AtomicU32, Ordering, AtomicU8};
use core::convert::TryInto;
use alloc::vec::Vec;
use alloc::collections::BTreeMap;
use crate::mm;
use rangeset::{RangeSet, Range};
use page_table::PhysAddr;
/// Maximum number of cores allowed on the system
pub const MAX_CORES: usize = 1... | the_stack |
use crate::constants::{MAX_I32_SCALE, MAX_PRECISION_I32, POWERS_10};
use crate::Decimal;
#[derive(Debug)]
pub struct Buf12 {
pub data: [u32; 3],
}
impl Buf12 {
pub(super) const fn from_dec64(value: &Dec64) -> Self {
Buf12 {
data: [value.low64 as u32, (value.low64 >> 32) as u32, value.hi],
... | the_stack |
use crate::target::metadata::Metadata;
use crate::target::{NameableKind, OptionalPropertyHandlingStrategy, Target};
use jtd::form::TypeValue;
use jtd::{Form, Schema};
use std::collections::BTreeMap;
use teeter_inflector::string::singularize::to_singular;
#[derive(Debug)]
pub struct SchemaAst {
pub root: Ast,
p... | the_stack |
use {Packer, PackerResult, SpriteAnchor, SpriteData};
pub struct MaxrectsPacker;
#[derive(Copy, Clone)]
pub struct MaxrectsOptions {
max_width: u32,
max_height: u32,
}
impl Default for MaxrectsOptions {
fn default() -> Self {
MaxrectsOptions {
max_width: 4096,
max_height: ... | the_stack |
use num::Zero;
use simba::scalar::{RealField, SubsetOf, SupersetOf};
use simba::simd::{PrimitiveSimdValue, SimdRealField, SimdValue};
use crate::base::{Matrix3, Matrix4, Scalar, Vector4};
use crate::geometry::{
AbstractRotation, Isometry, Quaternion, Rotation, Rotation3, Similarity, SuperTCategoryOf,
TAffine,... | the_stack |
#![deny(missing_docs)]
use failure::{bail, Fallible};
use log::{debug, info, warn, LevelFilter};
use std::{cmp::max, convert, fmt, iter, u8};
use termion::color::{self, Fg, LightBlack, Reset};
/// The graph drawing structure
pub struct Graph<V> {
lines_to_be_removed: Vec<String>,
columns: Vec<Column<V>>,
... | the_stack |
use crate::core::ann_index;
use crate::core::metrics;
use crate::core::neighbor::Neighbor;
use crate::core::node;
use crate::index::hnsw_params::HNSWParams;
use crate::into_iter;
use fixedbitset::FixedBitSet;
use rand::prelude::*;
#[cfg(not(feature = "no_thread"))]
use rayon::prelude::*;
use serde::de::DeserializeOwned... | the_stack |
pub mod vox;
use crate::{
block::{Block, BlockMesh, BlockType},
registry::Registry,
};
use crate::data::vox::{load_voxel_model, VoxelModel};
use crate::item::{Item, ItemMesh, ItemType};
use anyhow::{Context, Result};
use image::{ImageBuffer, Rgba};
use log::info;
use std::fs;
use std::io::Read;
use std::path:... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.