text stringlengths 2.5k 6.39M | kind stringclasses 3
values |
|---|---|
use position::Direction::{Backwards, Forwards};
use position::{self, Dimensions, Padding, Place, Position, Range, Rect, Scalar};
use text;
use widget;
use {
Borderable, Color, Colorable, FontSize, Labelable, Positionable, Sizeable, Theme, Ui, UiCell,
Widget,
};
/// **Canvas** is designed to be a "container"-li... | the_stack |
#[cfg(test)]
mod tests;
pub mod types;
use std::collections::HashMap;
use binding_macro::{cycles, genesis, service};
use derive_more::Display;
use rlp::{Decodable, Rlp};
use common_crypto::{Crypto, Secp256k1};
use protocol::traits::{ExecutorParams, ServiceResponse, ServiceSDK};
use protocol::types::{Address, Bytes, ... | the_stack |
use crate::F32;
use core::ops::{Add, AddAssign, Mul, MulAssign, Sub, SubAssign};
#[cfg(feature = "vector")]
use crate::vector::{Component, F32x3, Vector3d};
/// Quaternions are a number system that extends the complex numbers which can
/// be used for efficiently computing spatial rotations.
///
/// They're computed ... | the_stack |
use std::cell::{self, RefCell};
use std::fmt;
use std::ops::{Deref, DerefMut};
use std::rc::{Rc, Weak};
/// A reference to a node holding a value of type `T`. Nodes form a tree.
///
/// Internally, this uses reference counting for lifetime tracking
/// and `std::cell::RefCell` for interior mutability.
///
/// **Note:... | the_stack |
use fxhash::FxHashMap;
use schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use smallvec::SmallVec;
use thiserror::Error;
#[cfg(not(target_family = "wasm"))]
pub use native::*;
use crate::{
actions::{Action, TaskAction},
inputs::Input,
TaskTrigger, TaskValidateError,
};
#[derive(Debug, Error)]
... | the_stack |
use super::bit_cost::BrotliPopulationCost;
use super::histogram::{CostAccessors, HistogramSelfAddHistogram, HistogramAddHistogram,
HistogramClear};
use super::util::FastLog2;
use super::util::brotli_min_size_t;
use alloc;
use alloc::{SliceWrapper, SliceWrapperMut, Allocator};
use core;
#[derive(C... | the_stack |
use std::env;
use std::io;
use std::io::{Error, Read};
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::sync::mpsc::{channel, Receiver};
use std::sync::Arc;
use std::thread;
use regex::Regex;
use lazy_static::lazy_static;
pub use super::super::compiler::*;
use super::super::io::memstream:... | the_stack |
use ui::*;
use crate::na;
use super::presentation::*;
pub struct RustFest {
}
impl RustFest {
pub fn new() -> RustFest {
RustFest {}
}
}
impl Element for RustFest {
fn inflate(&mut self, base: &mut Base) {
base.add(
Presentation::new()
.with_slide(
... | the_stack |
use crate::tokenizer::tag::Tagger;
pub use crate::tokenizer::tag::{PosId, WordId};
pub(crate) use crate::tokenizer::tag::{PosIdInt, SpecialPos, WordIdInt};
use derivative::Derivative;
use lazy_static::lazy_static;
use serde::{Deserialize, Serialize};
use std::{
cmp::Ordering,
collections::{hash_map, HashMap, Ha... | the_stack |
use crate::pairing::ff::{Field, PrimeField, PrimeFieldRepr, ScalarEngine};
use crate::pairing::{Engine, CurveProjective, CurveAffine};
use std::marker::PhantomData;
use crate::sonic::srs::SRS;
use crate::sonic::util::*;
use super::wellformed_argument::{WellformednessArgument, WellformednessProof};
use super::grand_pro... | the_stack |
use std::collections::HashSet;
use std::ffi::OsStr;
/// Tests for the CLI
/// Annotations for testing have the "test_tag" tag
/// This is used to delete and clear created annotations after each test
/// MAKE SURE TO RUN SINGLE-THREADED cargo test -- --test-threads=1
use std::fs;
use std::path::PathBuf;
use std::{thread... | the_stack |
use std::process::Command;
use assert_cmd::prelude::*;
use assert_fs::{prelude::*, TempDir};
use itertools::Itertools;
fn main_binary() -> Command {
Command::cargo_bin("zet").unwrap()
}
#[test]
fn requires_subcommand() {
main_binary().assert().failure();
}
const SUBCOMMANDS: [&str; 5] = ["intersect", "union... | the_stack |
use std::cmp::max;
use super::{indent_level::IndentLevel, BqColumn, BqDataType, BqNonArrayDataType};
use crate::common::*;
use crate::schema::DataType;
/// When does a type require custom exporting?
///
/// This type implements `Ord`, so that `Always > OnlyInsideUdf` and
/// `OnlyInsideUdf > Never`. We use this with ... | the_stack |
use cgmath::Point3;
use cgmath::Vector3;
use cgmath::prelude::*;
use cgmath::Matrix4;
use std::option::Option;
use std::io;
use std::vec::Vec;
use std::collections::HashMap;
use std::collections::HashSet;
use fnv::FnvHashSet;
use fnv::FnvHashMap;
use iterator::FaceHalfedgeIterator;
use iterator::FaceIterator;
use util:... | the_stack |
extern crate rustache;
use rustache::{HashBuilder, Render, VecBuilder};
use std::io::Cursor;
// - name: Truthy
// desc: Truthy sections should have their contents rendered.
// data: { boolean: true }
// template: '"{{#boolean}}This should be rendered.{{/boolean}}"'
// expected: '"This should be rendered."'
#[... | the_stack |
use crate::alphabet::Alphabet;
use crate::engine::fast_portable::{decode_table, encode_table};
use crate::engine::{fast_portable, Config, DecodeEstimate, Engine};
use crate::{DecodeError, PAD_BYTE};
use alloc::ops::BitOr;
use std::ops::{BitAnd, Shl, Shr};
/// Comparatively simple implementation that can be used as som... | the_stack |
use ash::vk;
use vk_sync::AccessType;
use super::device::Device;
pub struct ImageBarrier {
image: vk::Image,
prev_access: vk_sync::AccessType,
next_access: vk_sync::AccessType,
aspect_mask: vk::ImageAspectFlags,
discard: bool,
}
pub fn record_image_barrier(device: &Device, cb: vk::CommandBuffer, ... | the_stack |
use crate::player::{SideMovement, StraightMovement, TurnMovement};
use cache::Picture;
use core::slice::Iter;
use std::time::Instant;
use clap::Parser;
use minifb::{Key, KeyRepeat, Window, WindowOptions};
mod cache;
type ColorMap = [(u8, u8, u8); 256];
mod constants;
mod map;
mod player;
mod ray_caster;
use constan... | the_stack |
use core::panic;
use std::{
convert::TryInto,
fs::File,
io::Write,
marker::PhantomData,
ops::{Add, DivAssign, MulAssign},
};
use anyhow::{bail, Error};
use chrono::{Datelike, Duration, NaiveDate, NaiveDateTime, Timelike};
use log::info;
use num_traits::{FromPrimitive, PrimInt, Signed, ToPrimitive};... | the_stack |
use super::*;
use crate::server_suite::store::*;
use crate::util;
use actix_web::web::{self, Json};
use serde::{Deserialize, Serialize};
use std::collections::BTreeMap;
#[derive(Deserialize)]
pub struct PathId {
keyring_alias: String,
key_alias: String,
}
pub async fn get_customer_key<T: KeyhouseImpl + 'stati... | the_stack |
use std::collections::HashSet;
use std::rc::Rc;
use super::sanitizer::*;
use serde::{Deserialize, Serialize};
use regex::Regex;
use std::collections::HashMap;
use crate::debugger::gdb::*;
use crate::ReportOptions;
use crate::util;
use crate::platform::linux::si_code_to_string;
lazy_static! {
static ref R_CIDENT: R... | the_stack |
use crate::doc::*;
use failure::Error;
// ISSUE Deduplicate v1 and v2 parsing logic
//
// The logic governing these two formats is almost identical, except that in v1
// styles are represented as a hashmap (that supports a value Link(String)) and
// in v2 they are represented as a set. This might be possible to dynami... | the_stack |
// You should have received a copy of the MIT License
// along with the Jellyfish library. If not, see <https://mit-license.org/>.
//! Circuit implementation of a Schnorr signature scheme.
use crate::{
constants::CS_ID_SCHNORR,
signatures::schnorr::{Signature, VerKey},
utils::{challenge_bit_len, field_bit... | the_stack |
use std::cell::Cell;
use std::f32::consts::PI;
use std::sync::Arc;
// pbrt
use crate::core::camera::{Camera, CameraSample};
use crate::core::film::Film;
use crate::core::geometry::{nrm_abs_dot_vec3f, vec3_dot_vec3f};
use crate::core::geometry::{
Bounds2f, Bounds2i, Normal3f, Point2f, Point2i, Point3f, Ray, RayDiffe... | the_stack |
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use std::thread;
use std::time::Instant;
use csv;
use failure::ResultExt;
use memmap::Mmap;
use serde::{Deserialize, Serialize};
use serde_json;
use crate::error::{Error, ErrorKind, Result};
use crate::record::{Episode, Rating, Title, TitleKind};
use crate::sc... | the_stack |
use std::fs::File;
use std::io;
use std::process::Stdio;
/// The reading end of a pipe, returned by [`pipe`](fn.pipe.html).
///
/// `PipeReader` implements `Into<Stdio>`, so you can pass it as an argument to
/// `Command::stdin` to spawn a child process that reads from the pipe.
#[derive(Debug)]
pub struct PipeReader(... | the_stack |
use crate::error::{Error, ErrorKind};
use crate::model::values::Number;
use crate::model::{Identifier, ShapeID};
use std::fmt::{Display, Formatter};
use std::str::FromStr;
// ------------------------------------------------------------------------------------------------
// Public Types
// ----------------------------... | the_stack |
// Copyright (c) 2020-2021 The orion Developers
// 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... | the_stack |
use crate::definitions::Image;
use crate::drawing::Canvas;
use image::{GenericImage, ImageBuffer, Pixel};
use std::f32;
use std::i32;
use std::mem::{swap, transmute};
/// Iterates over the coordinates in a line segment using
/// [Bresenham's line drawing algorithm](https://en.wikipedia.org/wiki/Bresenham%27s_line_algo... | the_stack |
use {
crate::input_device,
crate::input_handler::InputHandler,
crate::touch,
crate::utils::{Position, Size},
anyhow::{format_err, Error},
async_trait::async_trait,
fidl_fuchsia_ui_input as fidl_ui_input, fidl_fuchsia_ui_scenic as fidl_ui_scenic,
fuchsia_scenic as scenic,
std::rc::Rc,... | the_stack |
use std::{
cell::RefCell,
ffi::CString,
os::raw::{c_char, c_int},
ptr,
};
use crate::ffihelper::IntoCString;
use futures::channel::oneshot;
use nix::errno::Errno;
use snafu::{ResultExt, Snafu};
use spdk_sys::{
iscsi_find_tgt_node,
iscsi_init_grp_create_from_initiator_list,
iscsi_init_grp_d... | the_stack |
use std::collections::HashMap;
use std::fs::File;
use std::io::Write;
use std::mem::size_of;
use std::str::FromStr;
use anyhow::Result;
use clap::Clap;
use common::{Cluster, convert_assertion_error, create_account_rent_exempt, create_signer_key_and_nonce, create_token_account, read_keypair_file, send_instructions};
us... | the_stack |
#![allow(rustc::default_hash_types)]
use std::convert::From;
use std::fmt;
use rustc_ast::ast;
use rustc_hir::{def::CtorKind, def_id::DefId};
use rustc_middle::ty::{self, TyCtxt};
use rustc_span::def_id::CRATE_DEF_INDEX;
use rustc_span::Pos;
use rustdoc_json_types::*;
use crate::clean::utils::print_const_expr;
use ... | the_stack |
use ed25519_zebra::{batch, Signature, VerificationKey};
use rand_core::OsRng;
use std::convert::TryFrom;
use std::convert::TryInto;
use crate::errors::{CryptoError, CryptoResult};
/// Length of a serialized public key
pub const EDDSA_PUBKEY_LEN: usize = 32;
/// EdDSA ed25519 implementation.
///
/// This function ver... | the_stack |
use crate::dataset::*;
use crate::stateful::encode::StatefulEncoder;
use dicom_core::{DataElementHeader, Length, VR};
use dicom_encoding::encode::EncodeTo;
use dicom_encoding::text::SpecificCharacterSet;
use dicom_encoding::transfer_syntax::DynEncoder;
use dicom_encoding::TransferSyntax;
use snafu::{Backtrace, OptionEx... | the_stack |
use typed_builder::TypedBuilder;
use std::{fs, net::SocketAddr, path::PathBuf, time::Duration};
use libafl::{
bolts::{
current_nanos,
launcher::Launcher,
rands::StdRand,
shmem::{ShMemProvider, StdShMemProvider},
tuples::{tuple_list, Merge},
},
corpus::{
Cach... | the_stack |
use super::{server::COMMAND_ENDPOINT, *};
use crate::{addr::IntoIpAddrs, prelude::*, socket::*, *};
use serde::{Deserialize, Serialize};
use std::net::{IpAddr, Ipv6Addr};
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub(crate) enum AuthRequest {
AddBlacklist(Ipv6Addr),
RemoveBlacklist(Ipv6A... | the_stack |
use crate::utils::window_content;
use crate::{
load_image,
scene::{
commands::{graph::LinkNodesCommand, ChangeSelectionCommand},
EditorScene, Selection,
},
send_sync_message,
world::{
graph::{
item::{SceneItem, SceneItemBuilder, SceneItemMessage},
menu... | the_stack |
/// Support for virtual sockets.
use std::fmt;
use std::io;
use std::mem::{self, size_of};
use std::num::ParseIntError;
use std::os::raw::{c_uchar, c_uint, c_ushort};
use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd};
use std::result;
use std::str::FromStr;
use libc::{
self, c_void, sa_family_t, size_t, sockaddr,... | the_stack |
use std::collections::HashMap;
use std::pin::Pin;
use crate::AnySocketAddr;
use crate::solicit::frame::GoawayFrame;
use crate::solicit::frame::HttpFrameType;
use crate::solicit::frame::HttpSetting;
use crate::solicit::frame::HttpSettings;
use crate::solicit::frame::RstStreamFrame;
use crate::solicit::frame::SettingsF... | the_stack |
use std::borrow::Cow;
use std::fmt::{self, Debug, Display};
use std::num::{IntErrorKind, ParseIntError};
use std::str::FromStr;
use remain::sorted;
use serde::de;
use serde::Deserialize;
use thiserror::Error;
#[derive(Debug, Error, PartialEq)]
#[sorted]
#[non_exhaustive]
#[allow(missing_docs)]
/// Different kinds of ... | the_stack |
use whitebox_raster::*;
use whitebox_common::structures::Array2D;
use crate::tools::*;
use num_cpus;
use rand::prelude::*;
use rand::rngs::SmallRng;
use rand_distr::Uniform;
use std::env;
use std::f64;
use std::f64::consts::PI;
use std::io::{Error, ErrorKind};
use std::path;
use std::sync::mpsc;
use std::sync::Arc;
use... | the_stack |
#![recursion_limit = "256"]
//! Safe wrappers for enumerating `fuchsia.io.Directory` contents.
use {
fidl::endpoints::ServerEnd,
fidl_fuchsia_io::{self as fio, DirectoryMarker, DirectoryProxy, MAX_BUF, MODE_TYPE_DIRECTORY},
fidl_fuchsia_io2::{UnlinkFlags, UnlinkOptions},
fuchsia_async::{Duration, Durat... | the_stack |
//! [`Peer`] manages a single connection to a remote peer after the initial connection
//! establishment and handshake.
//!
//! Its responsibilities include sending and receiving [`NetworkMessage`]s
//! over-the-wire, maintaining a completion queue of pending RPC requests (through
//! the [`InboundRpcs`] and [`Outbound... | the_stack |
use crate::component::{instantiate_component, Component};
use crate::generic_node::{GenericNode, Html};
use crate::noderef::NodeRef;
use crate::utils::render;
use crate::view::View;
use js_sys::Reflect;
use std::collections::HashMap;
use std::iter::FromIterator;
use sycamore_reactive::{cloned, create_effect, create_mem... | the_stack |
mod util;
use pretty_assertions::assert_eq;
use rocksdb::{ColumnFamilyDescriptor, MergeOperands, Options, DB, DEFAULT_COLUMN_FAMILY_NAME};
use util::DBPath;
use std::fs;
use std::io;
use std::path::Path;
fn dir_size(path: impl AsRef<Path>) -> io::Result<u64> {
fn dir_size(mut dir: fs::ReadDir) -> io::Result<u64... | the_stack |
use whitebox_raster::*;
use whitebox_common::structures::Array2D;
use crate::tools::*;
use std::cmp::Ordering;
use std::collections::BinaryHeap;
use std::env;
use std::f64;
use std::i32;
use std::io::{Error, ErrorKind};
use std::path;
/// This tool can be used to perform cost-distance or least-cost pathway analyses. S... | the_stack |
macro_rules! impl_secret_key {
($name:ident, $tag:expr, $details:ident) => {
#[derive(Debug, PartialEq, Eq, Clone)]
pub struct $name {
pub(crate) details: $crate::packet::$details,
pub(crate) secret_params: $crate::types::SecretParams,
}
impl zeroize::Zeroize... | the_stack |
use std::path::{Path, PathBuf};
use std::fs::File;
use std::collections::HashMap;
use std::slice;
use tokio_core::reactor::Handle;
use crate::error::{Result, Error};
use crate::convert::{UploadState, download::{DownloadState}};
use hex_database::{self, Track, Token, Reader, Writer, Playlist};
use hex_music_containe... | the_stack |
//! Network tests for Honey Badger.
use std::collections::BTreeMap;
use std::sync::{Arc, Mutex};
use hbbft::honey_badger::{Batch, EncryptionSchedule, HoneyBadger, MessageContent};
use hbbft::sender_queue::{self, SenderQueue, Step};
use hbbft::transaction_queue::TransactionQueue;
use hbbft::{threshold_decrypt, util, C... | the_stack |
use lv2_core::extension::ExtensionDescriptor;
use lv2_core::feature::*;
use lv2_core::plugin::{Plugin, PluginInstance};
use std::fmt;
use std::marker::PhantomData;
use std::mem;
use std::mem::ManuallyDrop;
use std::os::raw::*; //get all common c_type
use std::ptr;
use urid::*;
/// Errors potentially generated by the
/... | the_stack |
use super::super::octets::{
Compose, FormError, OctetsBuilder, ParseError, ShortBuf,
};
use super::builder::{parse_escape, LabelFromStrError};
use core::str::FromStr;
use core::{borrow, cmp, fmt, hash, ops};
//------------ Label ---------------------------------------------------------
/// An octets slice with th... | the_stack |
mod support;
macro_rules! impl_vec3_tests {
($t:ident, $const_new:ident, $new:ident, $vec3:ident, $mask:ident) => {
glam_test!(test_const, {
const V: $vec3 = $const_new!([1 as $t, 2 as $t, 3 as $t]);
assert_eq!($vec3::new(1 as $t, 2 as $t, 3 as $t), V);
});
glam_tes... | the_stack |
use core;
use alloc::{Allocator, SliceWrapper, SliceWrapperMut};
use super::slice_util;
use slice_util::AllocatedMemoryRange;
pub use interface::{StreamID, StreamMuxer, StreamDemuxer, NUM_STREAMS, STREAM_ID_MASK, ReadableBytes, WritableBytes};
enum BytesToDeserialize {
None,
Some(StreamID, u32),
Header0(Str... | the_stack |
use crate::cassandra::consistency::Consistency;
use crate::cassandra::util::Protected;
use crate::cassandra::value::ValueType;
use crate::cassandra::write_type::WriteType;
use crate::cassandra_sys::cass_error_desc;
use crate::cassandra_sys::cass_error_result_code;
use crate::cassandra_sys::cass_error_result_free;
use ... | the_stack |
use crate::prelude::*;
use ast::crumbs::*;
use crate::node;
use ast::opr::ArgWithOffset;
use ast::Ast;
use ast::Shifted;
/// ==============
/// === Errors ===
/// ==============
/// Error returned when tried to perform an action which is not available for specific SpanTree
/// node.
#[derive(Copy, Clone, Debug, F... | the_stack |
use super::{ColDemand, Demand, Demand2D, RenderingHints, RowDemand, Widget};
use base::basic_types::*;
use base::{GraphemeCluster, StyleModifier, Window};
use std::cmp::Ord;
use std::fmt::Debug;
/// Compute assigned lengths for the given demands in one dimension of size `available_space`.
///
/// Between each length, ... | the_stack |
use crate::{kubeapi::ShipKube, slack::short_ver, Result};
use chrono::{Duration, Utc};
use k8s_openapi::api::{
apps::v1::{Deployment, ReplicaSet, StatefulSet},
core::v1::Pod,
};
use kube::api::{Meta, ObjectList};
use shipcat_definitions::{Manifest, PrimaryWorkload};
use std::{
convert::{TryFrom, TryInto},
... | the_stack |
use std::cmp::min;
use std::hint::unreachable_unchecked;
use std::mem::MaybeUninit;
use crate::sound::fir::FIR;
use crate::sound::fir::FIR_STEP;
use crate::sound::organya::{Song as Organya, Version};
use crate::sound::stuff::*;
use crate::sound::wav::*;
use crate::sound::wave_bank::SoundBank;
use crate::sound::Interpo... | the_stack |
use crate::tokens::{CommentKind, Keyword, NumberKind, Punct};
use crate::{is_line_term, OpenCurlyKind};
mod buffer;
mod tokens;
mod unicode;
pub use self::tokens::{RawToken, StringKind, TemplateKind};
use crate::error::RawError;
use unicode::{is_id_continue, is_id_start};
pub(crate) type Res<T> = Result<T, RawError>;
... | the_stack |
use std::sync::Arc;
use std::collections::HashMap;
use std::any::Any;
use std::ops::Deref;
use data::volsurface::RcVolSurface;
use data::forward::Forward;
use data::curves::RcRateCurve;
use data::bump::Bump;
use dates::Date;
use instruments::Instrument;
use instruments::PricingContext;
use risk::dependencies::Dependenc... | the_stack |
use ansi_term::Style;
use crate::fs::File;
use crate::output::file_name::Colours as FileNameColours;
use crate::output::render;
mod ui_styles;
pub use self::ui_styles::UiStyles;
pub use self::ui_styles::Size as SizeColours;
mod lsc;
pub use self::lsc::LSColors;
mod default_theme;
#[derive(PartialEq, Debug)]
pub s... | the_stack |
use std::borrow::Cow;
use std::error;
use fvm_ipld_encoding::repr::*;
use fvm_ipld_encoding::{de, ser, serde_bytes, Cbor, Error as EncodingError};
use num_derive::FromPrimitive;
use num_traits::FromPrimitive;
use thiserror::Error;
use crate::address::Error as AddressError;
/// BLS signature length in bytes.
pub cons... | the_stack |
use crate::cshadow as c;
use crate::host::context::{ThreadContext, ThreadContextObjs};
use crate::host::descriptor::pipe;
use crate::host::descriptor::{
CompatDescriptor, Descriptor, DescriptorFlags, FileMode, FileState, FileStatus, PosixFile,
};
use crate::host::syscall::{self, Trigger};
use crate::host::syscall_c... | the_stack |
use crate::{
config::{RetryConfig, SERVER_NAME},
error::{
Close, ConnectionError, RecvError, RpcError, SendError, SerializationError, StreamError,
},
wire_msg::WireMsg,
};
use bytes::Bytes;
use futures::{
future,
stream::{self, StreamExt, TryStreamExt},
};
use std::{fmt, net::SocketAddr,... | the_stack |
#![cfg_attr(feature = "cargo-clippy", allow(just_underscores_and_digits))]
use super::{UnknownUnit, Angle};
#[cfg(feature = "mint")]
use mint;
use crate::num::{One, Zero};
use crate::point::{Point2D, point2};
use crate::vector::{Vector2D, vec2};
use crate::rect::Rect;
use crate::box2d::Box2D;
use crate::transform3d::T... | the_stack |
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use std::{
cell::RefCell,
collections::BTreeSet,
fmt::{self, Write},
};
use crate::{
err::Error,
ir::{WriteInput, FormatStrFragment, ArgRefKind, Style, Color, Expr, FormatSpec, Align, Sign, Width, Precision},
};
impl WriteInput {
p... | the_stack |
use piston::input::Input;
use slog::Logger;
use specs;
use specs::{Read, ReadStorage, Write, WriteStorage};
use std::sync::mpsc;
use super::{ActiveCellDweller, CellDweller, CellDwellerMessage, SendMessageQueue, SetPosMessage};
use crate::globe::chunk::Material;
use crate::globe::Globe;
use crate::input_adapter;
use cr... | the_stack |
//
// Copyright (c) 2019-2020 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, publ... | the_stack |
extern crate proc_macro;
use proc_macro::{TokenStream, TokenTree as Tt, Punct, Group, Spacing,
Delimiter};
#[proc_macro]
pub fn postfix_macros(stream :TokenStream) -> TokenStream {
let mut vis = Visitor;
let res = vis.visit_stream(stream);
//println!("{}", res);
res
}
struct Visitor;
impl Visitor {
fn visit_st... | the_stack |
use num_traits::Float;
use super::algebra::{Combine, Cross, Dot, Vector};
use super::LaplaceExpansion3D;
use crate::linalg::{Quaternion3D, Transform3D};
/// This represents the decomposition of a 3D transformation matrix into
/// three-component translation, scale and skew vectors, a four-component
/// perspective ve... | the_stack |
use std::cell::RefCell;
use std::collections::HashMap;
use std::io::Error;
use std::rc::Rc;
use crate::save_state::ActorSaveState;
use crate::{
ability_state::DisabledReason, AbilityState, ChangeListenerList, Effect, EntityState,
GameState, Inventory, PStats,
};
use sulis_core::image::{Image, LayeredImage};
us... | the_stack |
use super::images;
use super::Dispatch;
use super::GtkWidget;
use crate::image_util;
use crate::widget::attribute::util::get_layout;
use crate::widget::event::{InputEvent, KeyEvent, MouseEvent};
use crate::{
widget::attribute::{find_callback, find_value, util::is_scrollable},
AttribKey, Attribute, Widget,
};
us... | the_stack |
use anyhow::Result;
use log::{debug, warn};
use std::fs;
use std::io::prelude::*;
use rd_util::*;
use rd_agent_intf::{
OomdKnobs, OomdReport, OomdSliceMemPressureKnobs, OomdSliceSenpaiKnobs, Slice, OOMD_SVC_NAME,
};
use super::Config;
const OOMD_RULE_HEAD: &str = r#"{
"rulesets": ["#;
const _OOMD_RULE_OVER... | the_stack |
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::fs::File;
use std::ptr;
use std::sync::atomic::{AtomicU16, AtomicU64, AtomicUsize, Ordering};
use std::sync::{Mutex, RwLock};
use crossbeam_channel::Sender;
use smallvec::{smallvec, SmallVec};
use syscall::error::{Error, Result, EINVAL};
use syscall:... | the_stack |
use super::ControlContext;
use super::{default_copy_getter, default_copy_setter, Control, ControlFieldGenerator};
use crate::ast::{ControlField, ControlType, FormType, GraphField};
use crate::codegen::data_analyzer::PointerSource;
use crate::codegen::values::NumValue;
use crate::codegen::{
build_context_function, g... | the_stack |
use std::any::TypeId;
use std::collections::HashMap;
use std::rc::Rc;
use num_traits::cast::ToPrimitive;
use libeir_intern::Ident;
use libeir_ir::constant::{AtomicTerm, Const, ConstKind};
use libeir_ir::operation::binary_construct::{
BinaryConstructFinish, BinaryConstructPush, BinaryConstructStart,
};
use libeir_... | the_stack |
extern crate timely_sort as haeoua;
use bencher::{Bencher, benchmark_main, benchmark_group};
use rand::{Rng, SeedableRng};
use rand::distributions::{Distribution, Standard};
use rand::rngs::StdRng;
use haeoua::*;
use haeoua::{RadixSorter, RadixSorterBase};
fn rsort_lsb_u32_10(bencher: &mut Bencher) { radix_sort::<u3... | the_stack |
use std;
use std::time::Duration;
use slog;
use specs;
use super::*;
// Nothing interesting in here!
#[derive(Serialize, Deserialize, Debug, Eq, PartialEq, Clone)]
struct TestMessage {
disposition: String,
}
impl GameMessage for TestMessage {}
// Network node helper. Contains all the network
// server bits and ... | the_stack |
use std::marker::PhantomData;
use std::collections::HashMap;
use std::error::Error;
use std::io::Read;
use std::io::Cursor;
use std::iter::FromIterator;
use http::{StreamId, OwnedHeader, Header, HttpResult, ErrorCode, HttpError, ConnectionError};
use http::frame::{HttpSetting, PingFrame};
use http::connection::HttpConn... | the_stack |
//! Sensor app that reads sensor data from a temperature sensor and sends the sensor data to a CoAP server over NB-IoT.
//! Note that we are using a patched version of apps/my_sensor_app/src/vsscanf.c that
//! fixes AT response parsing bugs. The patched file must be present in that location.
//! This is the Rust v... | the_stack |
use core;
use alloc::{
Allocator,
SliceWrapper,
SliceWrapperMut
};
use core::default::Default;
use core::{mem, cmp};
use probability::{CDF16, BaseCDF, Prob, LOG2_SCALE, ProbRange};
use super::interface::{
ArithmeticEncoderOrDecoder,
NewWithAllocator,
BillingCapability,
};
use super::DivansResult... | the_stack |
use crate::{
continuous_syncer::ContinuousSyncer,
driver::DriverConfiguration,
error::Error,
notification_handlers::ConsensusSyncRequest,
tests::{
mocks::{
create_mock_db_reader, create_mock_streaming_client, create_ready_storage_synchronizer,
MockStorageSynchronizer,... | the_stack |
//! Version 1 of the two-phase commit (2PC) consensus algorithm
//!
//! This is a bully algorithm where the coordinator for a proposal is determined as the node with
//! the lowest ID in the set of verifiers. Only one proposal is considered at a time. A proposal
//! manager can define its own set of required verifiers ... | the_stack |
use matrix::{Matrix, MatrixSliceMut, BaseMatrix, BaseMatrixMut};
use norm::Euclidean;
use error::{Error, ErrorKind};
use std::cmp;
use std::any::Any;
use libnum::{Float, Signed};
use libnum::{cast, abs};
impl<T: Any + Float + Signed> Matrix<T> {
fn balance_matrix(&mut self) {
let n = self.rows();
... | the_stack |
use super::*;
use crate::io::OutputFile;
use std::sync::Arc;
use pretty_assertions::assert_eq;
#[test]
fn compile_test() {
struct Case {
input: Vec<Input>,
expected: Result<Vec<OutputFile>, Error>,
}
let cases = vec![
Case {
input: vec![],
expected: Ok(vec!... | the_stack |
// Stream management for a connection.
use crate::fc::{LocalStreamLimits, ReceiverFlowControl, RemoteStreamLimits, SenderFlowControl};
use crate::frame::Frame;
use crate::packet::PacketBuilder;
use crate::recovery::{RecoveryToken, StreamRecoveryToken};
use crate::recv_stream::{RecvStream, RecvStreams};
use crate::send... | the_stack |
use crate::Distribution;
use rand::Rng;
use rand::distributions::uniform::Uniform;
use core::fmt;
#[derive(Clone, Copy, Debug)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
enum SamplingMethod {
InverseTransform{ initial_p: f64, initial_x: i64 },
RejectionAcceptance{
m:... | the_stack |
#![allow(unsafe_code)]
use crate::dependency::DependencyClone;
use crate::{container::InstanceContainer, Resolver, ServiceProvider};
use actix_web::dev::*;
use actix_web::web::Data;
use actix_web::Responder;
use actix_web::{http, FromRequest, HttpRequest};
use frunk::hlist::Selector;
use frunk::{HCons, HNil};
use std:... | the_stack |
use std::fmt::Debug;
use std::pin::Pin;
use futures::channel::mpsc::{unbounded, UnboundedSender};
use futures::future::BoxFuture;
use futures::stream::BoxStream;
use futures::task::{Context, Poll};
use futures::{ready, select, FutureExt, Sink, Stream, StreamExt};
use tokio::task::JoinHandle;
use tokio::time::{interval... | the_stack |
pub use raylib::prelude::*;
pub mod example;
type SampleOut = Box<dyn for<'a> FnMut(&'a mut RaylibHandle, &'a RaylibThread) -> ()>;
type Sample = fn(&mut RaylibHandle, &RaylibThread) -> SampleOut;
use std::cell::RefCell;
thread_local! (static APP: RefCell<Option<Box<dyn FnMut() -> bool>>> = RefCell::new(None));
pub... | the_stack |
use super::*;
use serde_with::serde_as;
#[serde_as]
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)]
pub struct LinkHash {
pub from: Endpoint,
#[serde_as(as = "Vec<(_, _)>")]
pub to: HashMap<Endpoint, u64>,
}
#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq)]
pub ... | the_stack |
extern crate libc;
extern crate serde;
extern crate serde_json;
extern crate swiboe;
use libc::c_char;
use std::ffi::{CStr, CString};
use std::mem;
use std::path;
use std::ptr;
use std::str;
use swiboe::{client, rpc};
/// Local results.
#[allow(non_camel_case_types)]
#[repr(i32)]
pub enum CApiResult {
SUCCESS = 0... | the_stack |
use crate::ast::{
container::ContainerAttributes, prop::NamedProp, r#enum::EnumProp, r#enum::FieldKind,
DeriveItem,
};
use proc_macro2::Span;
use proc_macro2::TokenStream;
use quote::{format_ident, quote, ToTokens};
use std::str::FromStr;
use syn::punctuated::Punctuated;
use syn::Ident;
use syn::LitInt;
use syn... | the_stack |
use crate::dns::aardvark::Aardvark;
use crate::error::NetavarkError;
use crate::firewall;
use crate::firewall::iptables::MAX_HASH_SIZE;
use crate::network;
use crate::network::core_utils::CoreUtils;
use crate::network::internal_types::{PortForwardConfig, SetupNetwork};
use crate::network::types::Subnet;
use crate::netw... | the_stack |
use crate::prelude::*;
use crate::model::suggestion_database;
// ==============
// === Export ===
// ==============
pub mod builder;
pub mod group;
pub use group::Group;
// ====================
// === Type Aliases ===
// ====================
/// A component identifier.
pub type Id = suggestion_database::entry:... | the_stack |
use color_eyre::eyre::WrapErr;
use color_eyre::Report;
use fantoch_plot::plot::pyplot::PyPlot;
use pyo3::prelude::*;
use std::collections::{BTreeMap, HashMap};
use std::fmt;
// file with the output of simulation
const SIM_OUTPUT: &str = "sim.out";
// folder where all plots will be stored
const PLOT_DIR: Option<&str> ... | the_stack |
mod errors;
mod typesystem;
pub use self::errors::MsSQLSourceError;
pub use self::typesystem::{FloatN, IntN, MsSQLTypeSystem};
use crate::constants::DB_BUFFER_SIZE;
use crate::{
data_order::DataOrder,
errors::ConnectorXError,
sources::{PartitionParser, Produce, Source, SourcePartition},
sql::{count_que... | the_stack |
use std::collections::HashMap;
use std::env::current_dir;
use std::fs::{self, DirEntry, File, OpenOptions};
use std::io::{self, Read, Seek, Write};
use std::path::Path;
use anyhow::{anyhow, Result};
use bytes::Bytes;
use clap::{Arg, App, AppSettings, SubCommand};
use reqwest::Client;
use serde::{Deserialize, Serialize... | the_stack |
use tiny_skia::*;
#[test]
fn horizontal_line() {
let mut paint = Paint::default();
paint.set_color_rgba8(50, 127, 150, 200);
let mut pb = PathBuilder::new();
pb.move_to(10.0, 10.0);
pb.line_to(90.0, 10.0);
let path = pb.finish().unwrap();
let mut pixmap = Pixmap::new(100, 100).unwrap();
... | the_stack |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.