text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
//
// Copyright (c) 2019 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 super::*;
use crate::{
ast::*,
token::{self, Token},
visitor::{self, *},
};
use std::{borrow::Cow, collections::HashMap, convert::TryFrom, fmt};
use chrono::{TimeZone, Utc};
use ciborium::value::Value;
use serde_json;
#[cfg(feature = "additional-controls")]
use crate::validator::control::{
abnf_from_comp... | the_stack |
use crate::common_utils::common::macros::{fx_err_and_bail, with_line};
use crate::kernel::types::{SerializableCpuStats, SerializableMemoryStats};
use anyhow::Error;
use fidl_fuchsia_kernel::{StatsMarker, StatsProxy};
use fuchsia_syslog::macros::*;
use parking_lot::{RwLock, RwLockUpgradableReadGuard};
/// Perform Kerne... | the_stack |
use {
anyhow::Error,
bt_a2dp::permits::{Permit, Permits},
core::pin::Pin,
core::task::{Context, Poll},
fidl::endpoints::RequestStream,
fidl_fuchsia_bluetooth_internal_a2dp::{
ControllerRequest, ControllerRequestStream, ControllerSuspendResponder,
StreamSuspenderRequestStream,
... | the_stack |
use crate::arena::*;
use crate::atom_table::*;
use crate::parser::ast::*;
use crate::parser::char_reader::*;
use crate::parser::lexer::*;
use rug::ops::NegAssign;
use std::cell::Cell;
use std::mem;
use std::rc::Rc;
#[derive(Debug, Clone, Copy, PartialEq)]
enum TokenType {
Term,
Open,
OpenCT,
OpenList... | the_stack |
use rle::{HasLength, MergableSpan, SplitableSpan};
use crate::rle::{RleVec, KVPair, RleSpanHelpers};
use crate::list::Time;
use crate::order::TimeSpan;
/// Sometimes the same item is removed by multiple peers. This is really rare, but necessary to
/// track for correctness when we're activating and deactivating entrie... | the_stack |
use bio::stats::{LogProb, Prob};
use chrono::prelude::*;
use clap::ArgMatches;
use errors::*;
use rust_htslib::bam;
use rust_htslib::bam::Read;
pub static INDEX_FREQ: usize = 1000;
pub static MAX_VCF_QUAL: f64 = 500.0;
pub fn print_time() -> String {
Local::now().format("%Y-%m-%d %H:%M:%S").to_string()
}
// use ... | the_stack |
// need to test cloning, these are deliberate.
clippy::redundant_clone,
// yep, we create owned instance just for comparison, to test comparison
// with owned instacnces.
clippy::cmp_owned,
// Deliberate
clippy::redundant_slicing,
)]
#![cfg(feature = "substr")]
use arcstr::{ArcStr, Substr};
#[t... | the_stack |
//! Based on https://github.com/tomaka/glutin/blob/1b2d62c0e9/src/api/egl/mod.rs
#![cfg(windows)]
#![allow(unused_variables)]
use std::cell::Cell;
use std::ffi::{CStr, CString};
use std::os::raw::c_int;
use std::ptr;
use glutin::Api;
use glutin::ContextError;
use glutin::CreationError;
use glutin::GlAttributes;
use g... | the_stack |
use camera::Camera;
use camera_controller::*;
use cgmath::{InnerSpace, Zero};
use futures::executor::block_on;
use model::Model;
use rendering::gpu_resources::GpuResources;
use voxel_tools::chunks::Chunks;
use wgpu::util::DeviceExt;
use winit::{
event::*,
event_loop::{ControlFlow, EventLoop},
window::{Windo... | the_stack |
//! A slider widget.
use crate::debug_state::DebugState;
use crate::kurbo::{Circle, Line};
use crate::theme::TEXT_COLOR;
use crate::widget::prelude::*;
use crate::widget::Axis;
use crate::{theme, Color, KeyOrValue, LinearGradient, Point, Rect, UnitPoint, Vec2, WidgetPod};
use druid::kurbo::{PathEl, Shape};
use druid::... | the_stack |
use std::{
cell::RefCell,
error::Error,
ffi::CStr,
fs::File,
io::Write,
os::unix::prelude::FromRawFd,
os::unix::prelude::RawFd,
process::exit,
rc::Rc,
sync::atomic::{AtomicBool, Ordering},
time::{SystemTime, UNIX_EPOCH},
};
use nix::{
fcntl,
sys::{memfd, mman, stat},... | the_stack |
use cpu::cpu::*;
use cpu::global_pointers::mxcsr;
pub unsafe fn mov_r_m64(addr: i32, r: i32) {
// mov* m64, mm
let data = read_mmx64s(r);
return_on_pagefault!(safe_write64(addr, data));
transition_fpu_to_mmx();
}
pub unsafe fn movl_r128_m64(addr: i32, r: i32) {
// mov* m64, xmm
let data = read_... | the_stack |
use crate::protocol::Protocol::{Atlas, EPaxos, FPaxos};
use crate::protocol::{ClientPlacement, ProtocolStats};
use crate::Bote;
use fantoch::elapsed;
use fantoch::metrics::{Histogram, Stats, F64};
use fantoch::planet::{Planet, Region};
use permutator::Combination;
use rayon::prelude::*;
use serde::{Deserialize, Seriali... | the_stack |
use {
crate::{
num2, num4, value_key::ValueRef, value_map::ValueMap, ExternalData, ExternalFunction,
ExternalValue, IntRange, MetaKey, ValueIterator, ValueList, ValueNumber, ValueString,
ValueTuple, ValueVec,
},
koto_bytecode::Chunk,
std::{cell::RefCell, fmt, rc::Rc},
};
/// The... | the_stack |
use bevy::{ecs::schedule::ShouldRun, prelude::*, transform::TransformSystem};
use bevy_mod_picking::{
self, PickingBlocker, PickingCamera, PickingSystem, Primitive3d, Selection,
};
use bevy_mod_raycast::RaycastSystem;
use gizmo_material::GizmoMaterial;
use normalization::*;
mod gizmo_material;
mod mesh;
mod normal... | the_stack |
use std::assert_matches::assert_matches;
use crate::utils::{FtpServer, HttpServer};
use chrono::prelude::*;
use chrono::Utc;
use indoc::indoc;
use kamu::domain::*;
use kamu::infra::ingest::*;
use opendatafabric::*;
use url::Url;
///////////////////////////////////////////////////////////////////////////////
// URL: ... | the_stack |
use std::hash::Hash;
use crate::error::Result;
use crate::{
array::*,
bitmap::Bitmap,
compute::arity::unary,
datatypes::{DataType, TimeUnit},
temporal_conversions::*,
types::NativeType,
};
use super::CastOptions;
/// Returns a [`BinaryArray`] where every element is the binary representation o... | the_stack |
#[non_exhaustive]
#[derive(std::clone::Clone, std::cmp::PartialEq)]
pub struct FailureInfo {
/// <p>The HTTP status code of the common error.</p>
pub status_code: i32,
/// <p>The code of the common error. Valid values include <code>InternalServiceException</code>, <code>InvalidParameterException</code>, and... | the_stack |
use anyhow::{anyhow, Context};
use http::uri::Uri;
use log::{debug, warn};
use oak_attestation_common::{
get_sha256,
report::{AttestationInfo, TEE_EXTENSION_OID},
};
use tokio_rustls::{
rustls::{self, ServerCertVerifier},
webpki::DNSNameRef,
};
use tonic::transport::{Channel, ClientTlsConfig};
use x509_... | the_stack |
#[cfg(test)]
mod test;
use crate::{
basic::mapx_ord_rawkey::{MapxOrdRawKey, MapxOrdRawKeyIter, ValueIterMut, ValueMut},
common::{
ende::{KeyEnDeOrdered, ValueEnDe},
RawKey,
},
};
use ruc::*;
use serde::{Deserialize, Serialize};
use std::{
borrow::Cow,
marker::PhantomData,
ops::{... | the_stack |
pub mod command_parser;
use std;
use std::fs::File;
use std::io;
use std::io::Read;
use std::net::TcpStream;
use std::num::ParseIntError;
use std::path::Path;
use std::sync::mpsc;
use std::sync::mpsc::{Receiver, Sender};
use nom::types::CompleteStr;
use assembler::program_parsers::program;
use assembler::Assembler;
... | the_stack |
use std::collections::HashSet;
use crate::error::Result;
// ------------------------------------------------------------------------------------------------
// Macros
// ------------------------------------------------------------------------------------------------
use crate::model::{Identifier, NamespaceID, ShapeI... | the_stack |
use std::collections::HashMap;
use crate::{
ProofOptions, Program, ProgramInputs, OpCode, OpHint,
blocks::{ ProgramBlock, Span, Group },
math::field, utils::hasher
};
mod branches;
mod comparisons;
#[test]
fn execute_verify() {
let program = build_program(vec![
OpCode::Begin, OpCode::Swap, OpC... | the_stack |
use casper_engine_test_support::{
internal::{
ExecuteRequestBuilder, InMemoryWasmTestBuilder, DEFAULT_ACCOUNT_PUBLIC_KEY,
DEFAULT_RUN_GENESIS_REQUEST,
},
AccountHash, Code, SessionBuilder, TestContextBuilder, DEFAULT_ACCOUNT_ADDR,
DEFAULT_ACCOUNT_INITIAL_BALANCE, MINIMUM_ACCOUNT_CREATION... | the_stack |
#[cfg(feature = "alloc")]
use alloc::string::String;
/// A DNS Name suitable for use in the TLS Server Name Indication (SNI)
/// extension and/or for use as the reference hostname for which to verify a
/// certificate.
///
/// A `DnsName` is guaranteed to be syntactically valid. The validity rules are
/// specified in... | the_stack |
use arrow::array::ArrayRef;
use data_types::partition_metadata::{ColumnSummary, TableSummary};
use datafusion::{
logical_plan::{Column, Expr},
physical_optimizer::pruning::{PruningPredicate, PruningStatistics},
};
use observability_deps::tracing::{debug, trace};
use predicate::predicate::Predicate;
use crate::... | the_stack |
use std::{cell::RefCell, cmp::Ordering, mem, ptr, rc::Rc, slice};
use super::comparator::Comparator;
use crate::util::{
arena::{Arena, ArenaRef},
atomic::{AtomicPointer, AtomicUsize},
random::Random,
};
/// A lockless concurrent skiplist implementation. This is mostly
/// a direct translation from the CPP... | the_stack |
use std::collections::HashMap;
use std::env;
use std::fs::File;
use std::fs::OpenOptions;
use std::io::Write;
use std::os::unix::io::IntoRawFd;
use std::path::{Path, PathBuf};
use chrono::prelude::{Local, Datelike, Timelike};
use libc;
use regex::Regex;
use crate::execute;
use crate::libs::re::re_contains;
use crate:... | the_stack |
use crate::prelude::*;
use enso_text::unit::*;
use crate::application::tooltip;
use crate::application::tooltip::Placement;
use crate::component::node;
use crate::component::type_coloring;
use crate::view;
use crate::Type;
use enso_frp as frp;
use ensogl::data::color;
use ensogl::display;
use ensogl::display::shape::... | the_stack |
use fnv::FnvHashMap;
use smallvec::SmallVec;
use std::sync::atomic::Ordering;
use std::sync::atomic::{AtomicU32, AtomicUsize};
use std::sync::Arc;
use std::time::{Duration, Instant};
use futures::channel::mpsc;
use futures::channel::mpsc::UnboundedReceiver;
use futures::lock::Mutex;
use futures::prelude::*;
use libp2... | the_stack |
use crate::{idl::{JS_AST, JS_Schema}, memory::NP_Memory, schema::{NP_Parsed_Schema, NP_Portal_Data, NP_Value_Kind}};
use alloc::{sync::Arc, vec::Vec};
use crate::json_flex::{JSMAP, NP_JSON};
use crate::schema::{NP_TypeKeys};
use crate::{pointer::NP_Value, error::NP_Error};
use alloc::string::String;
use alloc::boxed... | the_stack |
use crate::object::builtin;
use std::collections::HashMap;
use std::mem;
#[derive(Debug, PartialEq, Clone, Copy)]
pub enum SymbolScope {
Global,
Local,
Free,
Builtin,
}
#[derive(Debug, PartialEq, Clone, Copy)]
pub struct Symbol {
pub scope: SymbolScope,
pub index: u16,
}
// TODO: Better namin... | the_stack |
use crate::NP_Size_Data;
use crate::{memory::NP_Memory_Writable, utils::opt_err};
use crate::collection::tuple::NP_Tuple;
use crate::{pointer::{NP_Scalar}};
use crate::{collection::map::NP_Map};
use crate::{pointer::NP_Value};
use crate::pointer::NP_Cursor;
use crate::{schema::NP_Parsed_Schema, collection::table::NP_T... | the_stack |
#![allow(
clippy::all,
improper_ctypes,
non_upper_case_globals,
non_snake_case,
non_camel_case_types
)]
// Hidden module for stuff used by init_metric!
#[doc(hidden)]
pub mod export {
pub use ccommon;
pub use ccommon_sys;
}
#[allow(unused_imports)]
#[macro_use]
extern crate memoffset;
con... | the_stack |
use bstr::ByteSlice;
use itertools::Itertools;
pub trait Repo {
fn user(&self) -> Option<std::rc::Rc<str>>;
fn is_dirty(&self) -> bool;
fn merge_base(&self, one: git2::Oid, two: git2::Oid) -> Option<git2::Oid>;
fn find_commit(&self, id: git2::Oid) -> Option<std::rc::Rc<Commit>>;
fn head_commit(&s... | the_stack |
//! Provides actual deriving logic for the crate.
use proc_macro2::{TokenStream, Span};
use syn::{Type, Path, Expr, Field, Ident, Variant, DeriveInput};
use syn::spanned::Spanned;
use crate::util::{is_unit_type, self_ty, fields_to_vec};
use crate::void::IsUninhabited;
use crate::error::{self, Ctx, Context, DeriveResu... | the_stack |
#![forbid(overflowing_literals)]
#![deny(missing_copy_implementations)]
#![deny(missing_debug_implementations)]
#![deny(missing_docs)]
#![deny(intra_doc_link_resolution_failure)]
#![deny(path_statements)]
#![deny(trivial_bounds)]
#![deny(type_alias_bounds)]
#![deny(unconditional_recursion)]
#![deny(unions_with_drop_fie... | the_stack |
use {
super::{
common::Common,
define,
define::SessionType,
errors::{SessionError, SessionErrorValue},
},
crate::{
amf0::Amf0ValueType,
channels::define::ChannelEventProducer,
chunk::{
define::CHUNK_SIZE,
unpacketizer::{ChunkUnp... | the_stack |
use crate::exc::*;
use crate::ffi::PyDict_GET_SIZE;
use crate::ffi::*;
use crate::opt::*;
use crate::serialize::datetime::*;
use crate::serialize::serializer::pyobject_to_obtype;
use crate::serialize::serializer::*;
use crate::serialize::uuid::*;
use crate::typeref::*;
use crate::unicode::*;
use inlinable_string::Inlin... | the_stack |
use log::{debug, trace};
use serde::Deserialize;
use serde_repr::*;
/// The maximum travel before a tap is considered a swipe, in millimeters.
const MAX_TAP_DISTANCE: f64 = 100f64;
/// The maximum number of tools (fingers) that are tracked and reported on simultaneously.
const MAX_SLOTS: usize = 5;
/// How long before... | the_stack |
use std::{
borrow::Borrow,
cell::UnsafeCell,
collections::hash_map::Entry,
fmt,
hash::Hash,
iter::IntoIterator,
mem,
ops::{Index, IndexMut},
};
use crate::fnv::FnvMap;
use vec_map::VecMap;
// NOTE: transmute is used to circumvent the borrow checker in this module
// This is safe since ... | the_stack |
#![feature(io, exit_status)]
#[macro_use] extern crate log;
extern crate env_logger;
use std::char;
use std::io;
use std::env;
use std::io::{Read, Write};
use std::collections::VecDeque;
fn main() {
env_logger::init().unwrap();
let mut stdin = io::stdin().chars();
let mut ungetced = None;
macro_rul... | the_stack |
extern crate more_asserts;
#[macro_use]
extern crate log;
#[macro_use]
extern crate strum_macros;
#[macro_use]
mod wgpu_utils;
mod camera;
mod global_bindings;
mod global_ubo;
mod gui;
mod render_output;
mod renderer;
mod scene;
mod simulation;
mod simulation_controller;
mod timer;
mod utils;
use wgpu_profiler::{wgpu_... | the_stack |
use crate::{
protosext::TryIntoOrNone,
prototype_rust_sdk::{
conversions::anyhow_to_fail, workflow_context::WfContextSharedData, CancellableID,
RustWfCmd, TimerResult, UnblockEvent, WfContext, WfExitValue, WorkflowFunction,
WorkflowResult,
},
workflow::CommandID,
};
use anyhow::{... | the_stack |
use super::BuildCache;
use anyhow::{anyhow, Context};
use log::*;
use std::collections::HashSet;
use std::path::PathBuf;
use zap_core::*;
/// A build Sandbox.
///
/// This is a spot where we isolate build nodes to execute them.
///
/// By the time we have created a Sandbox for a particular ComputedTarget, the node
///... | the_stack |
pub fn fuzz_diff_parsing(data: &[u8]) {
let a = parity_wasm::parity_wasm_deserialize(&data);
let b = wasmer::fuzz_wasmer_compile_clif(&data);
let c = wasmer::fuzz_wasmer_compile_singlepass(&data);
let d = wasmtime::fuzz_wasmtime_compile_all_cranelift(&data);
let e = wasmparser::fuzz_wasmparser_valid... | the_stack |
use crate::{
TARGET, StorageAlloc, StorageTelemetry, db_impl_serializable, db::traits::KvcWriteable,
node_state_db::NodeStateDb, traits::Serializable, types::BlockMeta
};
use adnl::{
declare_counted,
common::{
add_counted_object_to_map, add_unbound_object_to_map_with_update,
CountedOb... | the_stack |
// std
use std::sync::Arc;
// pbrt
use crate::blockqueue::BlockQueue;
use crate::core::camera::{Camera, CameraSample};
use crate::core::geometry::{pnt2_inside_exclusivei, vec3_abs_dot_nrmf};
use crate::core::geometry::{Bounds2i, Point2f, Point2i, Ray, Vector2i, Vector3f};
use crate::core::interaction::{Interaction, Int... | the_stack |
use super::dialogs::dialog_helpers;
use super::dialogs::server_database_add_edit_dlg::Msg as MsgServerDatabaseAddEditDialog;
use super::dialogs::server_extra_user_add_edit_dlg::Msg as MsgServerExtraUserAddEditDialog;
use super::dialogs::server_note_add_edit_dlg::Msg as MsgServerNoteAddEditDialog;
use super::dialogs::se... | the_stack |
use super::code_builder_helpers::{is_comment, is_multiline_comment, is_newline_incoming};
use crate::code_builder_helpers::clean_all_whitespace;
use crate::constants::{ALREADY_FORMATTED_LINE_PATTERN, NEW_LINE_PATTERN};
use std::iter::{Enumerate, Peekable};
use std::slice::Iter;
use std::str::Chars;
/// Performs the fo... | the_stack |
use super::vector::*;
use super::properties::*;
use super::control_point::*;
use super::transformation::*;
use super::vector_element::*;
use super::path_conversion_options::*;
use super::super::path::*;
use super::super::edit::*;
use crate::raycast::*;
use flo_canvas::*;
use flo_canvas_animation::*;
use flo_canvas_ani... | the_stack |
macro_rules! prepare_svm {
($raw_model:expr, $k:ty, $m32:ty, $svm:tt) => {
// To quickly check what broke again during parsing ...
// println!("{:?}", raw_model);
{
let header = &$raw_model.header;
let vectors = &$raw_model.vectors;
// Get basic info
... | the_stack |
use glob;
use lua;
use regex::{Captures, Regex};
use rule::Rule;
use runtime::{Runtime, ScriptResult};
use std::env;
use std::io::prelude::*;
use std::path::PathBuf;
use std::process::{Command, Stdio};
use std::str;
use task::NamedTask;
/// Expands global and environment variables inside a given string.
pub fn expand... | the_stack |
use super::universal::{Category, category::*};
const USE_TABLE: &[Category] = &[
/* Basic Latin */
O, O, O, O, O, GB, O, O,
/* 0030 */ B, B, B, B, B, B, B, B, B, B, O, ... | the_stack |
use regex::{Regex};
use std::str::{FromStr};
use super::super::metrics::*;
/// Reader that takes a log line string and returns any metrics found in it.
pub trait LogLineReader: Send + Sync {
fn read(&self, line: &str) -> Vec<Metric>;
}
/// Reads metrics from log lines in the standard formats:
///
/// - Measures:... | the_stack |
use crate::cargo;
use crate::error::{TracersError, TracersResult};
use crate::gen;
use crate::gen::NativeLib;
use crate::TracingImplementation;
use failure::ResultExt;
use serde::{Deserialize, Serialize};
use std::env;
use std::fs::File;
use std::io::Write;
use std::io::{BufReader, BufWriter};
use std::path::{Path, Pat... | the_stack |
use cgmath::{Matrix as Matrix_, Matrix4, SquareMatrix, Transform as Transform_, Vector3};
use froggy;
use gfx;
use gfx::format::I8Norm;
use gfx::handle as h;
use gfx::memory::Typed;
use gfx::traits::{Factory as Factory_, FactoryExt};
#[cfg(feature = "opengl")]
use gfx_device_gl as back;
#[cfg(feature = "opengl")]
use g... | the_stack |
use rustler::{
resource::ResourceArc,
types::{binary::Binary, tuple::make_tuple},
Atom, NifResult, OwnedBinary, Term,
};
use std::{collections::HashMap, sync::Mutex};
use wasmer::{
wat2wasm, ExternType, FunctionType, GlobalType, MemoryType, Module, Store, TableType,
};
use crate::atoms;
pub struct Mo... | the_stack |
use std::fmt;
use std::cmp::Ordering;
use std::collections::{hash_map, HashMap};
use loc::{Unit, Pos, Span, Spanned, span_from_u32};
/// An efficient mapping from spans to values.
//
// segment-point interval tree (self-balanced as like AVL), used to make a mapping
// from the pos/span to a list of overlapping spans a... | the_stack |
use std::path::PathBuf;
use generic_array::typenum::{Unsigned, U2};
use merkletree::{merkle::get_merkle_tree_len, store::StoreConfig};
use rayon::prelude::*;
use storage_proofs_core::{
cache_key::CacheKey,
error::Result,
hasher::{Domain, Hasher},
merkle::{split_config, BinaryMerkleTree, MerkleTreeTrait... | the_stack |
use super::widget::*;
use super::widget_data::*;
use super::scroll_size::*;
use super::basic_widget::*;
use super::flo_fixed_widget::*;
use super::super::gtk_event::*;
use super::super::gtk_action::*;
use super::super::gtk_thread::*;
use super::super::gtk_event_parameter::*;
use super::super::gtk_widget_event_type::*;
... | the_stack |
use crate::config::CONFIG;
use defaults::Defaults;
use eyre::{bail, Result};
use itertools::Itertools;
use once_cell::sync::Lazy;
use regex::Regex;
use serde::{Deserialize, Serialize};
use std::{
cmp::Ordering,
collections::HashMap,
env::{
self,
consts::{ARCH, OS},
},
fs, io,
pat... | the_stack |
// https://github.com/Manishearth/rust-clippy/issues/702
#![allow(unknown_lints)]
#![allow(clippy::all)]
#![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... | the_stack |
extern crate libc;
extern crate rust_media as media;
extern crate sdl2;
#[macro_use]
extern crate log;
use libc::c_long;
use media::audioformat::{ConvertAudioFormat, Float32Interleaved, Float32Planar};
use media::container::VideoTrack;
use media::pixelformat::{ConvertPixelFormat, PixelFormat};
use media::playback::Pl... | the_stack |
use crate::{
compositional_analysis::{CompositionalAnalysis, SummaryCache},
dataflow_analysis::{DataflowAnalysis, TransferFunctions},
dataflow_domains::{AbstractDomain, JoinResult, SetDomain},
function_target::{FunctionData, FunctionTarget},
function_target_pipeline::{FunctionTargetProcessor, Functi... | the_stack |
use std::{iter, mem};
use crate::internal::{
basic::Repetition, column::reader::{get_typed_column_reader, ColumnReader, ColumnReaderImpl}, data_type::*, errors::{ParquetError, Result}, record::{reader::ValueReader, ParquetData, Reader}, schema::types::{ColumnDescPtr, ColumnPath}
};
use amadeus_types::Value;
/// High... | the_stack |
//! Tests of our shutdown and closing_signed negotiation logic.
use chain::keysinterface::KeysInterface;
use chain::transaction::OutPoint;
use ln::channelmanager::PaymentSendFailure;
use routing::router::{PaymentParameters, get_route};
use ln::features::{InitFeatures, InvoiceFeatures};
use ln::msgs;
use ln::msgs::{Cha... | the_stack |
use crate::common::{Field, YaSerdeAttribute, YaSerdeField};
use crate::ser::{element::*, implement_serializer::implement_serializer};
use proc_macro2::TokenStream;
use quote::quote;
use syn::DataStruct;
use syn::Ident;
pub fn serialize(
data_struct: &DataStruct,
name: &Ident,
root: &str,
root_attributes: &YaS... | the_stack |
//! Facilities for sending log message to syslog.
//!
//! Every function exported by this module is thread-safe. Each function will silently fail until
//! `syslog::init()` is called and returns `Ok`.
//!
//! # Examples
//!
//! ```
//! use log::{error, warn};
//! use base::syslog;
//!
//! if let Err(e) = syslog::init()... | the_stack |
mod utils;
inject_indy_dependencies!();
extern crate indyrs as indy;
extern crate indyrs as api;
extern crate indy_sys;
#[cfg(feature = "local_nodes_pool")]
use crate::utils::callback;
use crate::utils::constants::{WALLET_CREDENTIALS, PROTOCOL_VERSION};
use crate::utils::{pool as pool_utils, timeout};
use crate::uti... | the_stack |
use std::collections::HashSet;
use std::convert::TryFrom;
use std::fmt::{Display, Formatter};
use std::fs::read_to_string;
use std::net::{IpAddr, SocketAddr, ToSocketAddrs};
use std::sync::Arc;
use anyhow::Context;
use boringtun::crypto::{X25519PublicKey, X25519SecretKey};
use clap::{App, Arg};
#[derive(Clone, Debug)... | the_stack |
use crate::WitIdsToIndices;
use crate::{ImportId, TypeId, ValType, WasmInterfaceTypes, WitIndicesToIds};
use anyhow::Result;
use id_arena::{Arena, Id};
use walrus::IndicesToIds;
#[derive(Debug, Default)]
pub struct Funcs {
arena: Arena<Func>,
}
#[derive(Debug)]
pub struct Func {
id: FuncId,
pub ty: TypeId... | the_stack |
use slog::info;
use std::convert::TryFrom;
use std::ffi::CStr;
use std::fmt::{Debug, Formatter};
use std::os::raw::{c_int, c_short, c_uchar, c_uint, c_ulong};
use crate::bpf::constant::{bpf_prog_type, BPF_OBJ_NAME_LEN};
use crate::error::OxidebpfError;
use crate::ProgramType;
use crate::LOGGER;
pub(crate) mod constan... | the_stack |
macro_rules! from {
($(@$f: ident
$( ?> $i1: ident = $e1: tt )*
$( => $t: ident )*
$( -> $i2: ident = $e2: tt )* )*) => (
$($(
impl <'g> From<$f<'g>> for $t<'g> {
fn from(f: $f<'g>) -> Self {
Self {
request: f.request,
... | the_stack |
use std::collections::HashMap;
use lexer::*;
pub use self::ASTNode::{
ExternNode,
FunctionNode
};
pub use self::Expression::{
LiteralExpr,
VariableExpr,
BinaryExpr,
ConditionalExpr,
LoopExpr,
CallExpr
};
use self::PartParsingResult::{
Good,
NotComplete,
Bad
};
#[derive(P... | the_stack |
use ast;
use runtime::PAGE_SIZE;
use types;
use types::Value::*;
use types::Int::*;
use types::Float::*;
use std::collections::HashSet;
static EMPTY_TYPE: [types::Value; 0] = [];
pub fn is_valid(module: &ast::Module) -> bool {
check_module(module).is_some()
}
#[derive(PartialEq, Clone, Copy)]
/// Represent the typ... | the_stack |
#![warn(missing_docs)]
use std::collections::BTreeMap;
use std::ffi::{OsString, OsStr};
use std::fs::{File, OpenOptions};
use std::hash::{Hash, Hasher};
use std::io::{self, BufReader, ErrorKind, BufWriter, Write};
use std::path::{PathBuf, Path};
use std::process::{Command};
use std::time::{Duration, Instant, SystemTim... | the_stack |
use crate::ast::{Message, QmiType, Service, ServiceSet, Structure, SubParam, TLV};
use anyhow::{format_err, Error};
use std::io;
pub struct Codegen<'a, W: io::Write> {
w: &'a mut W,
depth: usize,
}
fn type_fmt(ty: QmiType, optional: bool) -> String {
let ty = ty.to_rust_str();
if optional {
f... | the_stack |
use crate::deposit::deposit_request::DepositRequest;
use crate::leaf::{make_leaf_content, LeafWitness};
use bellman::{Circuit, ConstraintSystem, SynthesisError};
use ff::{Field, PrimeField};
use models::plasma::circuit::utils::{allocate_audit_path, append_packed_public_key};
use models::plasma::params as plasma_constan... | the_stack |
use std::fmt;
use std::hash::{Hash, Hasher};
use std::io;
/// The decoded contents of a frame.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum Content {
/// A value containing the parsed contents of a text frame.
Text(String),
/// A value containing the parsed contents of a user defined text frame (T... | the_stack |
use std::{
cmp,
cmp::Ordering,
collections::{btree_map, BTreeMap},
ops::{
Bound::{Excluded, Included},
Range,
},
};
/// A set of u64 values optimized for long runs and random insert/delete/contains
#[derive(Debug, Default, Clone)]
pub struct RangeSet(BTreeMap<u64, u64>);
impl Range... | the_stack |
#[cfg(feature = "dbus_mpris")]
extern crate dbus;
use super::app::App;
#[cfg(feature = "dbus_mpris")]
use super::model::playlist::Track;
#[cfg(feature = "dbus_mpris")]
use super::app::RepeatState;
#[cfg(feature = "dbus_mpris")]
use super::handlers::TrackState;
#[cfg(feature = "dbus_mpris")]
use super::player::MetaInfo;... | the_stack |
use std::env;
use std::ffi::OsStr;
use clap::{arg, builder::FalseyValueParser, Arg, ArgAction, Command};
#[test]
fn env() {
env::set_var("CLP_TEST_ENV", "env");
let r = Command::new("df")
.arg(arg!([arg] "some opt").env("CLP_TEST_ENV").takes_value(true))
.try_get_matches_from(vec![""]);
... | the_stack |
use core::convert::TryFrom;
use core::{char, fmt, iter, mem, str};
#[allow(unused_macros)]
macro_rules! write {
($($ignored:tt)*) => {
compile_error!(
"use `self.print(value)` or `fmt::Trait::fmt(&value, self.out)`, \
instead of `write!(self.out, \"{...}\", value)`"
)
}... | the_stack |
use alloc::string::String;
use alloc::string::ToString;
use alloc::collections::btree_map::BTreeMap;
use std::fs;
use std::fs::File;
use std::fs::OpenOptions;
use std::io::{BufRead, BufReader};
use std::io::Write;
use std::path::Path;
use std::{thread, time};
use super::super::qlib::common::*;
use super::super::qlib::... | the_stack |
use crate::common::{self as common, KeyAttributes, KeyRequestType, KeyType, KmsKey};
use crate::crypto_provider::{AsymmetricProviderKey, CryptoProvider};
use fidl_fuchsia_kms::{
AsymmetricKeyAlgorithm, AsymmetricPrivateKeyRequest, Error, KeyOrigin, KeyProvider, PublicKey,
Signature, MAX_DATA_SIZE,
};
use fidl_f... | the_stack |
use csml_interpreter::data::CsmlBot;
use rand::{distributions::Alphanumeric, Rng};
use tui::{
buffer::Buffer,
layout::Rect,
style::{Color, Modifier, Style},
text::{Span, Spans, Text},
widgets::{Block, StatefulWidget, Widget},
};
use crate::init_package::{DataBase, DynamoRegion, Env, S3Region};
use... | the_stack |
use prost::{DecodeError, Message};
use std::io::Read;
use crate::proto::tensorboard::Event;
use crate::tf_record::{ChecksumError, ReadRecordError, TfRecordReader};
/// A reader for a stream of `Event` protos framed as TFRecords.
///
/// As with [`TfRecordReader`], an event may be read over one or more underlying read... | the_stack |
use super::{cache::Cache, CacheBuilder, ConcurrentCacheExt, Weigher};
use crate::PredicateError;
use std::{
borrow::Borrow,
collections::hash_map::RandomState,
error::Error,
hash::{BuildHasher, Hash, Hasher},
sync::Arc,
time::Duration,
};
/// A thread-safe concurrent in-memory cache, with mult... | the_stack |
use std::borrow::Cow;
use std::sync::atomic::{AtomicU64, AtomicU8, Ordering};
use std::sync::Arc;
use std::time::{Duration, Instant};
use std::{fmt, io};
use crate::draw_target::ProgressDrawTarget;
use crate::style::ProgressStyle;
pub(crate) struct BarState {
pub(crate) draw_target: ProgressDrawTarget,
pub(cr... | the_stack |
use minifb::{Window, WindowOptions, MouseMode, MouseButton, Scale, ScaleMode, Key, KeyRepeat};
use std::time::Instant;
use std::mem;
use std::cmp;
pub mod time;
pub mod color;
pub mod gfx2d;
pub mod gfx3d;
// TODO: ordering on this is format dependent?
#[derive(Debug, Clone, Copy)]
pub struct Pixel {
pub b: u8... | the_stack |
use std::str::FromStr;
use neon::prelude::*;
use emerald_wallet_state::access::transactions::{Filter, Transactions, WalletRef};
use emerald_wallet_state::access::pagination::{PageQuery, PageResult};
use emerald_wallet_state::proto::transactions::{BlockchainId, Change, Change_ChangeType, State, Status, Transaction};
use... | the_stack |
#[allow(unused_imports)]
use futures::{future, Stream, stream};
#[allow(unused_imports)]
use petstore_with_fake_endpoints_models_for_testing::{Api, ApiNoContext, Client, ContextWrapperExt, models,
TestSpecialTagsResponse,
Call123exampleResponse,
FakeOute... | the_stack |
extern crate test;
#[cfg(test)]
mod tests {
use test::Bencher;
use l2::tensor::*;
// Pytorch: 3.8us
// L2: 748ns
#[bench]
fn bench_allocate_1d_tensor(b: &mut Bencher) {
b.iter(|| {
let _t = Tensor::zeros(&[64 * 64]).unwrap();
});
}
#[bench]
fn bench_al... | 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 under th... | the_stack |
use whitebox_raster::*;
use crate::tools::*;
use num_cpus;
use std::env;
use std::f64;
use std::io::{Error, ErrorKind};
use std::path;
use std::sync::mpsc;
use std::sync::Arc;
use std::thread;
/// This tool can be used to measure the length of the perimeter of polygon features in a raster layer. The user must
/// spec... | the_stack |
use crate::http::{BinaryResponse, JsonResponse};
use crate::utils::hex_to_uint256;
use crate::{BlockHeaderData, BlockSourceError};
use bitcoin::blockdata::block::{Block, BlockHeader};
use bitcoin::consensus::encode;
use bitcoin::hash_types::{BlockHash, TxMerkleNode, Txid};
use bitcoin::hashes::hex::{FromHex, ToHex};
u... | the_stack |
#[derive(Clone)]
pub enum FlightSerde {
/// A rather slower option using Protobuf to serialise and deserialise.
///
/// Reliable is the default serde option.
Reliable,
#[cfg(feature = "unsafe_flight")]
#[allow(dead_code)]
/// Unsafe, but highly performant option
///
/// For Unsafe to... | the_stack |
use crate::controller::ControllerMessage;
use crate::element::Element;
use crate::exit;
use crate::store::ItemList;
use crate::{Message, Scheduler};
use std::cell::RefCell;
use std::rc::Rc;
use wasm_bindgen::JsCast;
use crate::template::Template;
const ENTER_KEY: u32 = 13;
const ESCAPE_KEY: u32 = 27;
use wasm_bindge... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.