text stringlengths 7.05k 33.9k |
|---|
// Copyright 2015 <NAME>
//
// 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, ... |
/*!
# wheel_writer
This library produces Python wheels according to
<https://www.python.org/dev/peps/pep-0491/>.
Create a [`WheelBuilder`], providing the dynamic library and the package metadata file.
Optionally set the platform tag, typing interface file, and output directory.
When ready, use [`WheelBuilder::build`]... |
//! Implements parsing IRC formatting characters. Reference:
//! <https://modern.ircdocs.horse/formatting.html>
#![allow(clippy::single_match)]
const CHAR_BOLD: char = '\x02';
const CHAR_ITALIC: char = '\x1D';
const CHAR_UNDERLINE: char = '\x1F';
const CHAR_STRIKETHROUGH: char = '\x1E';
const CHAR_MONOSPACE: char = '... |
use crate::jcli_app::utils::io;
use bech32::{self, u5, FromBase32, ToBase32};
use chain_crypto::{
bech32::Bech32 as _, AsymmetricKey, AsymmetricPublicKey, Curve25519_2HashDH, Ed25519,
Ed25519Bip32, Ed25519Extended, SecretKey, SigningAlgorithm, SumEd25519_12, Verification,
VerificationAlgorithm,
};
use ed255... |
//! Adjacency list construction for graphs
use crate::edges::{Edge, Vertex};
use itertools::EitherOrBoth::{Both, Right};
use itertools::Itertools;
use rayon::iter::{IntoParallelIterator, IntoParallelRefIterator, ParallelIterator};
use rayon::slice::ParallelSliceMut;
use std::convert::TryInto;
use std::iter;
use std::s... |
use crate::{
io::{Read, Result as IoResult, Write},
serialize::{Flags, SWFlags},
UniformRand, Vec,
};
use core::{
fmt::{Display, Formatter, Result as FmtResult},
marker::PhantomData,
ops::{Add, AddAssign, MulAssign, Neg, Sub, SubAssign},
};
use num_traits::{One, Zero};
use rand::{
distributi... |
//! librsync bindings for Rust.
//!
//! This library contains bindings to librsync [1], encapsulating the algorithms of the rsync
//! protocol, which computes differences between files efficiently.
//!
//! The rsync protocol, when computes differences, does not require the presence of both files.
//! It needs instead t... |
use crate::decode::lzbuffer::{LzBuffer, LzCircularBuffer};
use crate::decode::lzma::{new_circular, new_circular_with_memlimit, DecoderState, LzmaParams};
use crate::decode::rangecoder::RangeDecoder;
use crate::decompress::Options;
use crate::error::Error;
use std::fmt::Debug;
use std::io::{self, BufRead, Cursor, Read, ... |
//! The [`Core`] struct, supported [`Event`]s, and
//! handler / tester types.
use crate::{context::Context, request::CallbackAPIRequest};
use regex::Regex;
use rvk::APIClient;
use serde_json::Value;
use std::{
collections::{hash_map::Entry, HashMap},
convert::TryFrom,
fmt::{Debug, Display, Error, Formatte... |
#![allow(clippy::len_zero)]
use crate::command::Command;
use crate::context::Context;
use crate::error::{Error, ErrorKind, Result};
use crate::parser::Parser;
use crate::suggestion::SuggestionSource;
use crate::{Argument, ParseResult, CommandOption, OptionList};
use std::borrow::Borrow;
use std::fmt::Debug;
use crate::... |
#![allow(dead_code)]
// #![allow(unused_variables)]
use cortex_m::peripheral::DWT;
use log::info;
use core::{mem, slice};
use stm32h7xx_hal::adc;
use stm32h7xx_hal::delay::Delay;
use stm32h7xx_hal::prelude::*;
use stm32h7xx_hal::rcc;
use stm32h7xx_hal::sai::*;
use stm32h7xx_hal::stm32;
use stm32h7xx_hal::stm32::rcc:... |
use std::collections::HashMap;
use std::io::{Read, Write, Cursor};
use std::char;
use std::borrow::Cow;
use std::ops::Deref;
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use Jid;
use errors::*;
const LIST_EMPTY: u8 = 0;
#[allow(dead_code)]
const STREAM_END: u8 = 2;
const DICTIONARY_0: u8 = 236;
const DIC... |
/* -- Lots of reuse from: https://github.com/alexcrichton/git2-rs/blob/master/libgit2-sys/build.rs */
extern crate rustc_serialize;
use std::env;
use std::fs;
use rustc_serialize::json;
use std::fs::OpenOptions;
use std::io::{ErrorKind, Read, Write};
use std::path::PathBuf;
use std::process::Command;
use std::convert:... |
macro_rules! assert_approx_eq {
($a:expr, $b:expr) => {{
let eps = 1.0e-6;
let (a, b) = (&$a, &$b);
assert!(
(*a - *b).abs() < eps,
"assertion failed: `(left !== right)` \
(left: `{:?}`, right: `{:?}`, expect diff: `{:?}`, real diff: `{:?}`)",
... |
// Copyright 2012-2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
//! Broadword operations treating `u64` as a parallel vector.
//!
//! From [<NAME>, “Broadword Implementation of
//! Rank/Select Queries.”](http://sux.di.unimi.it/paper.pdf) Changes from
//! that work:
//!
//! - It uses a 17-digit (68-bit) constant “0x0F0F0F0F0F0F0F0F0.” I believe
//! the correct constant is thes... |
//! The nodes.
use std::borrow::Cow;
use std::collections::hash_map::DefaultHasher;
use std::collections::HashMap;
use std::fmt;
use std::iter::once;
pub use parser::error::Error;
use crate::events;
use crate::events::Event;
use crate::node::element::GenericElement;
use crate::node::parser::Parser;
pub use self::va... |
use crate::db::{extract_user_key, pack_sequence_and_type, MAX_SEQUENCE_NUMBER};
use crate::db::{InternalKey, ValueType};
use crate::utils::coding::{decode_u64_le, put_fixed_64};
use std::cmp::{min, Ordering};
use std::sync::Arc;
pub trait BaseComparator {
fn compare(&self, a: &[u8], b: &[u8]) -> Ordering;
///... |
// This implements a simple Runge-Kutta method, more specifically the variant
// known as DOPRI5(4), cf. https://en.wikipedia.org/wiki/Dormand%E2%80%93Prince_method
// supplemented by the adaptive step size algorithm outlined in the paper
// https://www.researchgate.net/publication/226932720.
use ndarray::Array1;
use ... |
/*
src/menu/menu.rs
Copyright (c) 2019-2022 <NAME> All rights reserved.
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
... |
use alloc::{string::String, vec::Vec};
use core::{fmt, marker::PhantomData};
use serde::{Deserialize, Serialize};
pub const CURRENT_VERSION: u8 = 1;
pub struct MacAddress(pub [u8; 6]);
impl fmt::Display for MacAddress {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
for (i, x) in self.0.iter(... |
use std::ops::Add;
use bitflags::_core::ops::AddAssign;
#[derive(Debug)]
pub struct RunningStats {
min: f64,
max: f64,
count: usize,
m: f64,
s: f64,
}
impl Default for RunningStats {
fn default() -> Self {
RunningStats {
min: f64::NAN,
max: f64::NAN,
... |
// TODO: remove once this module is used
#![allow(dead_code)]
use aztec_backend::barretenberg_rs::Barretenberg;
use noir_field::FieldElement;
use std::{convert::TryInto, path::Path};
// This impl should be redone in a more efficient and readable way.
// We should have a separate impl for SparseMerkle and regular merkl... |
use super::{ContainerEvent, Event, NotificationTx, RepositoryId};
use crate::{
api::{self, codec::Framed, VERSION as API_VERSION},
common::container::Container,
runtime::{token::Token, EventTx, ExitStatus},
};
use api::model;
use async_stream::stream;
use bytes::Bytes;
use futures::{
future::join_all,
... |
/// ChartScale represents options to configure chart scale.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChartScale {
/// One of the available scale kinds.
#[prost(enumeration = "chart_scale::ChartScaleKind", tag = "1")]
pub kind: i32,
/// Start of the scale range.
#[prost(message, optio... |
use super::*;
use crate::util::*;
use crate::persistent::*;
use crate::controls::*;
use crate::buttons::*;
use mirror::{Remote, Client};
use tetris_model::instance::*;
use std::time::Duration;
use rand::thread_rng;
use rand::seq::SliceRandom;
use quicksilver::{
Future,
Result,
geom::{Rectangl... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
use bytes::{Bytes, BytesMut};
use core::{ffi::c_void, marker::PhantomData};
use s2n_quic_core::{
application::ServerName,
crypto::{tls, CryptoError, CryptoSuite},
endpoint, transport,
};
use s2n_qui... |
use libp2p::{PeerId, identity};
use crate::{command_proto, gossip_proto, request_proto};
use prost::Message;
use log::{info, debug};
use super::{whitenoise_behaviour::{GetMainNets}};
use super::protocols::proxy_protocol::{ProxyRequest};
use super::protocols::ack_protocol::{AckRequest};
use crate::models::client_info:... |
// Copyright 2017 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... |
//! Regular Expression Constructor - the recreational version of regular expressions
//!
//! `rec` is a Rust library that simplifies the process of reading and writing regular expressions.
//! This library is intended for all users working with regular expressions, no matter their
//! familiarity with regular expressio... |
// Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
use std::fs;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc::{self, Sender};
use std::sync::{Arc, Mutex, RwLock};
use std::time::{Duration, Instant};
use kvproto::raft_serverpb::*;
use raft::eraftpb::{Message, MessageType};
use en... |
use crate::Handle;
use crate::gl;
use smallvec::SmallVec;
/// Represents the current OpenGL state.
///
/// The current state is passed to each function and can be freely updated.
pub struct GlState {
/// Whether we have detected that the context has been lost.
///
/// Even when this is `false`, the context... |
use alloc::string::{String, ToString};
use alloc::vec::Vec;
use crate::Client;
use hex;
use rpc_codegen::Fetch;
use chain::{SerializeData, SignedTransaction};
use serde::{Deserialize, Serialize};
#[derive(Fetch, Debug, Clone, Serialize)]
#[api(path="v1/chain/push_transaction", http_method="POST", returns="PushTransac... |
//! # Known Answer Tests for the encoding and decoding of various structs of the
//! MLS spec
//!
//! See https://github.com/mlswg/mls-implementations/blob/master/test-vectors.md
//! for more description on the test vectors.
use crate::{
ciphersuite::signable::Signable,
group::{create_commit::Proposals, GroupE... |
use heck::{MixedCase, SnakeCase};
use proc_macro::TokenStream;
use proc_macro2::{Span, TokenStream as TokenStream2};
use quote::{quote, ToTokens};
use std::string::ToString;
use syn::{
Attribute, Data, DeriveInput, Error, Fields, FieldsNamed, GenericArgument, Ident, Lit, Meta,
NestedMeta, PathArguments, Type,
}... |
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::{ArrayContent, Bucket, DiagnosticsHierarchy, Property},
lazy_static::lazy_static,
paste,
serde::{
de::{self, MapAccess... |
use std::collections::HashMap;
use cranelift::prelude::*;
use cranelift_module::{DataContext, Linkage, Module};
use cranelift_simplejit::{SimpleJITBackend, SimpleJITBuilder};
use frontend::*;
use std::slice;
/// The basic JIT class.
pub struct JIT {
/// The function builder context, which is reused across multipl... |
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//! Small system utility modules for usage by other modules.
mod alloc;
#[cfg(target_os = "android")]
mod android;
#[cfg(target_os = "android")]
use a... |
use crate::{
config::get_configuration,
error::{InquireError, InquireResult},
formatter::StringFormatter,
input::Input,
terminal::get_default_terminal,
ui::{Backend, Key, KeyModifiers, PasswordBackend, RenderConfig},
validator::{ErrorMessage, StringValidator, Validation},
};
/// Display mod... |
use cssparser::*;
use crate::values::{
length::LengthPercentageOrAuto,
position::*,
color::CssColor,
image::Image
};
use crate::targets::Browsers;
use crate::prefixes::{Feature, is_webkit_gradient};
use crate::traits::{Parse, ToCss, PropertyHandler};
use crate::macros::*;
use crate::properties::{Property, Prope... |
//! b(byte): 8bit
//! h(half word): 16bit
//! w(word): 32bit
use crate::analyser::sym_resolver::VarKind;
use crate::ast::expr::BinOperator;
use crate::code_gen::{create_allocator, Allocator};
use crate::ir::cfg::{CFG, CFGIR};
use crate::ir::var_name::{branch_name, FP, RA};
use crate::ir::{IRInst, IRType, Jump, Operand,... |
//! `Driver` is a stateful compiler frontend that enables incremental compilation by retaining state
//! from previous compilation.
use crate::{
compute_source_relative_path, db::CompilerDatabase, ensure_package_output_dir, is_source_file,
PathOrInline, RelativePath,
};
use hir::{
AstDatabase, DiagnosticSi... |
use crate::{
collections::TypedUsize,
crypto_tools::{
constants, k256_serde,
paillier::{
secp256k1_modulus, to_bigint, to_scalar,
utils::{member_of_mod, member_of_mul_group},
zk::ZkSetup,
Ciphertext, EncryptionKey, Plaintext, Randomness,
},... |
//! Asynchronous interface to WebGL GLSL shader program compilation.
//!
//! # Performance
//!
//! In order to maximize parallelism and avoid blocking, follows
//! [best practices](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/WebGL_best_practices).
//!
//! In particular, these items from that document are... |
use crate::utils::{
cargo, change_versions, info, ChangeData, ChangeOpt, Error, GitOpt, Pkg, Result, INTERNAL_ERR,
TERM_ERR,
};
use cargo_metadata::Metadata;
use clap::Clap;
use console::Style;
use dialoguer::{theme::ColorfulTheme, Confirm, Input, Select};
use semver::{Identifier, Version};
use std::collections... |
//! Pathfinding for pedestrians using contraction hierarchies, as well as figuring out if somebody
//! should use public transit.
use std::cell::RefCell;
use fast_paths::{deserialize_32, serialize_32, FastGraph, InputGraph, PathCalculator};
use serde::{Deserialize, Serialize};
use thread_local::ThreadLocal;
use geom... |
use arraydeque::ArrayDeque;
use lru_time_cache::LruCache;
use two_lock_queue::{Sender, RecvTimeoutError, unbounded};
use uuid;
use std::cmp::{min, max, Ordering};
use std::iter::{self, FromIterator};
use std::time::{Instant, Duration};
use std::thread;
use std::mem::uninitialized;
use consumer::*;
use util::*;
use slo... |
#![feature(rustc_private)]
#![allow(clippy::cast_lossless)]
#[macro_use]
extern crate log;
// From rustc.
extern crate syntax;
extern crate rustc_apfloat;
#[macro_use] extern crate rustc;
extern crate rustc_data_structures;
extern crate rustc_mir;
extern crate rustc_target;
mod fn_call;
mod operator;
mod intrinsic;
... |
// 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 in the LICENSE-APACHE file or at:
// https://www.apache.org/licenses/LICENSE-2.0
//! Font library
use super::{selector::Database, FaceRef, ... |
// Copyright 2020 Alibaba Cloud. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
use std::collections::HashMap;
use std::fs::{self, remove_file, File, OpenOptions};
use std::io::{Error, Result};
use std::mem::{size_of, ManuallyDrop};
use std::os::unix::io::{AsRawFd, RawFd};
use std::path::{Path, PathBuf... |
use std::convert::TryInto;
use super::constraints::get_max_constraint;
use super::constraints::get_min_constraint;
use super::helper::*;
use super::{ColumnDisplayInfo, DisplayInfos};
use crate::style::*;
use crate::utils::formatting::content_split::split_line;
use crate::{Column, Table};
/// Try to find the best fit ... |
// Claxon -- A FLAC decoding library in Rust
// Copyright 2014 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// A copy of the License has been included in the root of the repository.
extern crate claxon;
extern crate hou... |
use influxdb_line_protocol::ParsedLine;
use chrono::{DateTime, TimeZone, Utc};
use serde::{Deserialize, Serialize};
use snafu::Snafu;
#[derive(Debug, Snafu)]
pub enum Error {
#[snafu(display("Error in {}: {}", source_module, source))]
PassThrough {
source_module: &'static str,
source: Box<dyn ... |
use std::mem::size_of;
use bitflags::bitflags;
use serde::{Deserialize, Serialize};
pub const MAGIC: u32 = 0x20534444;
bitflags! {
#[derive(Default, Serialize, Deserialize)]
pub struct PixelFormatFlags: u32 {
const ALPHAPIXELS = 0x00000001;
const ALPHA = 0x00000002;
const FOURCC = 0x0... |
//! Retrieving the results of a RING Job
use std::fmt::{ Display, Formatter, Result as FmtResult };
use std::str::FromStr;
use std::borrow::Cow;
use serde::{
ser::{ Serialize, Serializer },
de::{ Deserialize, Deserializer, Visitor, Error as DeError },
};
use serde_json::{ self, Value };
use super::Request;
use... |
use interpreter::RuntimeResult;
use log::error;
use parking_lot::Mutex;
use std::{
ffi::c_void, ffi::CString, sync::atomic::AtomicBool, sync::atomic::Ordering,
sync::mpsc::channel, sync::mpsc::Receiver, sync::mpsc::Sender, sync::Arc, thread,
time::Duration,
};
use thread::JoinHandle;
use winapi::um::wingdi:... |
use cosmwasm_std::{
entry_point, from_binary, to_binary, Addr, Binary, CosmosMsg, Decimal, Deps, DepsMut, Env,
MessageInfo, Response, StdError, StdResult, Uint128, WasmMsg,
};
use cw20::{Cw20ExecuteMsg, Cw20ReceiveMsg};
use white_whale::tokenomics::lp_emissions::{
ConfigResponse, Cw20HookMsg, ExecuteMsg, I... |
use crate::col_usage::{
collect_top_level_cols, compute_delete_schema, compute_update_schema, free_external_cols,
};
use crate::common::{
lookup, mk_qid, CoreIOCtx, KeyBound, OrigP, QueryESResult, QueryPlan, ReadRegion, Timestamp,
WriteRegion, WriteRegionType,
};
use crate::expression::{compress_row_region, compu... |
// TODO many routines should be "generic" enough to be refactored
// notes on the Gideros class system:
//
// it is an "archetypal" Lua class system that shares many other features with
// most "naive" class systems for Lua. it distinguishes the prototype and the instance
// (thus the enum structure of `Class` type) a... |
//!
//! # A*算法--抽象实现
//!
use heap::slab_heap::SlabHeap;
use num_traits::Zero;
use std::cmp::{Ordering, PartialOrd};
/// ## A* 寻路的抽象寻路主体代理约束
///
/// 通过代理将不同寻路能力主体的寻路情况交由上层逻辑决定,增加导航图的通用性及寻路能力的动态性
///
/// 需要实现主体在两点间是否可达、及两点间的代价
///
/// ### 对`N`的约束,连加减乘除都不需要的数字集合
///
/// + 算术运算,可拷贝,可偏序比较;
/// + 实际使用的时候就是数字... |
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use std::fmt::{self, Debug, Display, Formatter};
use std::hash::Hash;
use byteorder::{ByteOrder, NetworkEndian};
use zerocopy::{AsBytes, FromBytes, Unalig... |
use std::ffi::{CStr, CString, OsStr, OsString};
use std::os::unix::ffi::OsStrExt;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::{fmt, io, mem, ptr};
use lazy_static::lazy_static;
#[cfg(any(all(target_os = "linux", target_env = "gnu"), target_os = "macos",))]
use libc::c_char;
#[cfg(not(any(target_os = "... |
//! Holmes/Datalog Execution Engine
//!
//! This module contains the logic for rule execution and non-persistent state
//! maintenance.
pub mod types;
use std::collections::hash_map::HashMap;
use pg::dyn::{Type, Value};
use pg::dyn::values;
use self::types::{BindExpr, Clause, Expr, Fact, Func, MatchExpr, Predicate, R... |
use std::ffi::OsStr;
use std::path::{Path, PathBuf};
use std::sync::{
atomic::{AtomicBool, AtomicUsize},
Arc,
};
use std::time::SystemTime;
use futures::future::Either;
use futures::prelude::*;
use futures::task::AtomicWaker;
use log::{info, warn};
use mysql_async::prelude::*;
use super::{Asagi, AsagiInner, A... |
//! Experimental rewriting of yield, await, async blocks.
use verilog::VerilogState;
use ast;
use std::mem;
use CountWalker;
use Walkable;
use std::collections::BTreeSet;
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, PartialOrd, Ord)]
struct FsmId(i32);
impl FsmId {
fn value(&self) -> i32 {
self.0
... |
//! query, assert, or retract triplets
use std::collections::BTreeMap;
use std::error::Error;
use std::path::PathBuf;
use owoof::{
disperse::zip_with_keys,
driver::just,
either,
network::TriplesField,
retrieve::{self, Pattern, Variable},
sql::PushToQuery,
AttributeRef, BorrowedParse, DontW... |
/*
*MIT License
*
*Copyright (c) 2020 <NAME>
*
*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,... |
mod expr;
mod symbol_table;
use hir::{
visit::Visitor, BinOp, Block, Expression, ExpressionKind, Identifier, Item, ItemKind, Local, Path, Statement,
StatementKind, UnaryOp,
};
use std::{
collections::HashMap,
fmt::{self, Debug, Formatter},
};
use symbol_table::SymbolTable;
use typecheck::{Context, Type... |
// Copyright 2021 Chiral Ltd.
// Licensed under the Apache-2.0 license (https://opensource.org/licenses/Apache-2.0)
// This file may not be copied, modified, or distributed
// except according to those terms.
//! Case cyclic
use crate::core;
use super::mapping_ops;
fn filter_cyclic_orbits<T: core::graph::Vertex>(
... |
// Copyright (c) 2021 <NAME>
//
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. All files in the project carrying such notice may not be copied,
// modified, ... |
extern crate easycurses;
use std::io::Read;
use std::fs::File;
use std::env::args;
use easycurses::*;
use easycurses::Color::*;
trait Interpret {
fn interpret(&self, &mut EasyCurses, bool);
fn compile_rust(&self) -> String;
}
trait Language {
fn is_red(&self) -> bool;
fn is_green(&self) -> bool;
fn is_magenta(... |
use std::cmp::max;
use std::cmp::Ordering;
use std::collections::hash_map::Entry;
use std::collections::HashMap;
use std::collections::HashSet;
use std::marker::PhantomData;
use anyhow::Result;
use binary_heap_plus::BinaryHeap;
use stable_bst::TreeMap;
use crate::algorithms::encode::EncodeType;
use crate::algorithms:... |
extern crate termion;
extern crate mu_backend as backend;
extern crate clap;
extern crate failure;
extern crate chrono;
extern crate itertools;
// TODO: Add help page for formatting of .mu files.
use std::io::{self, Read, Write};
use std::{path, fs, fmt, env, process};
use failure::Error;
use termion::{color, style}... |
extern crate fallible_iterator;
extern crate log;
extern crate mimir;
extern crate mimirsbrunn;
extern crate postgres;
extern crate slog;
#[macro_use]
extern crate slog_scope;
extern crate itertools;
extern crate num_cpus;
extern crate par_map;
use fallible_iterator::FallibleIterator;
use mimir::rubber::{IndexSettings... |
extern crate clap;
extern crate fnv;
extern crate rand;
extern crate timely;
extern crate nexmark;
extern crate streaming_harness;
extern crate hdrhist;
extern crate dynamic_scaling_mechanism;
extern crate abomonation;
use std::alloc::System;
#[global_allocator]
static GLOBAL: System = System;
use std::cell::RefCell... |
use hex;
use ring::digest;
use serde::{Serialize, Deserialize};
use chrono::prelude::DateTime;
use chrono::Utc;
use std::time::{UNIX_EPOCH, Duration};
use std::collections::HashMap;
use crate::crypto::hash::{H256, H160, Hashable};
use crate::transaction::{SignedTransaction, TxInput, PrintableTransaction, PrintableTxInp... |
use std::collections::HashSet;
use log::{debug, trace};
use crate::core::registry::PackageRegistry;
use crate::core::resolver::{self, Method, Resolve};
use crate::core::{PackageId, PackageIdSpec, PackageSet, Source, SourceId, Workspace};
use crate::ops;
use crate::sources::PathSource;
use crate::util::errors::{CargoR... |
/*
* Copyright 2018 Intel Corporation
*
* 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 agre... |
#![cfg_attr(not(feature = "std"), no_std)]
/// Edit this file to define custom logic or remove it if it is not needed.
/// Learn more about FRAME and the core library of Substrate FRAME pallets:
/// https://substrate.dev/docs/en/knowledgebase/runtime/frame
pub use pallet::*;
pub mod interface;
pub use crate::... |
// Copyright 2019 Parity Technologies (UK) Ltd.
//
// 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, mer... |
//! Provides a `thread_local!()` macro, a helper to instantiate lazily-initialized
//! thread-local storage (TLS) variables.
//!
//! The primary difference between using this crate's `thread_local!()` macro
//! and directly using the `#[thread_local]` attribute is that `static` items
//! tagged with the `#[thread_loc... |
#![allow(unused)]
use serde::Deserialize;
use enum_map::{Enum, EnumMap};
macro_rules! decl_elevators {
($($name:ident => { $($contents:tt)* },)*) => {
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Deserialize, Enum)]
#[serde(rename_all = "camelCase")]
pub enum Elevator
{
... |
use crate::cache::maildir_flags_from_imap;
use crate::cache::Cache;
use crate::cache::MessageMeta;
use crate::cache::SyncFlags;
use crate::config::Account;
use crate::imapw::{FetchResult, Imap, UidResult};
use crate::maildirw::Maildir;
use chrono::prelude::*;
use imap::types::{Fetch, Mailbox, Uid, UnsolicitedResponse, ... |
use datafusion::{
error::Result,
logical_plan::{binary_expr, Expr, ExprRewriter, Operator},
};
/// Special purpose `Expr` rewrite rules for IOx
///
/// DataFusion has many `Expr` rewrite / simplification rules that are
/// generally useful. However, there are several that (currently)
/// only seem to make sen... |
extern crate schannel;
use self::schannel::cert_context::{CertContext, HashAlgorithm, KeySpec};
use self::schannel::cert_store::{CertAdd, CertStore, Memory, PfxImportOptions};
use self::schannel::schannel_cred::{Direction, Protocol, SchannelCred};
use self::schannel::crypt_prov::{AcquireOptions, ProviderType};
use sel... |
use crate::csv::CsvEncoding;
#[cfg(any(feature = "decompress", feature = "decompress-fast"))]
use crate::csv_core::parser::next_line_position_naive;
use crate::csv_core::parser::{
next_line_position, skip_bom, skip_line_ending, SplitFields, SplitLines,
};
use crate::mmap::{MmapBytesReader, ReaderBytes};
use crate::... |
use std::convert::{TryFrom, TryInto};
use super::{
private::{SealedContainer, SealedItem},
Container, Encoding, ParseError, Typecode,
};
/// The set of known IVKs for Unified IVKs.
#[derive(Clone, Debug, PartialEq, Eq, Hash)]
pub enum Ivk {
/// The raw encoding of an Orchard Incoming Viewing Key.
///
... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
//! This module implements a simple debugger to detect exceptions in an application.
use std::{
self,
collections::HashMap,
ffi::{OsStr, OsString},
fs,
io::Write,
path::Path,
process::{Command, Output},
time::{Du... |
//! # Lockin
//!
//! THe `lockin` application implements a lock-in amplifier using either an external or internally
//! generated
//!
//! ## Features
//! * Up to 800 kHz sampling
//! * Up to 400 kHz modulation frequency
//! * Supports internal and external reference sources:
//! 1. Internal: Generate reference inte... |
//! Implements fuzzing primitives for everything.
use arbitrary::{Arbitrary, Result, Unstructured};
use std::collections::{HashMap, HashSet};
use std::iter::FromIterator;
use crate::test_framework::{self as ir, *};
use regalloc::*;
pub const NUM_REAL_REGS_PER_RC: u8 = 4;
const NUM_REG_CLASSES: u32 = 5;
/// Maximum ... |
use num_derive::FromPrimitive;
use crate::attribute::Attribute;
use crate::character::character_common_data::CharacterCommonData;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::common::{ChangeAttribute, Element, SkillType, StatName, WeaponType};
use crate::character::character_s... |
use gtk::prelude::*;
use crate::agenda::Msg::Complete as AgendaComplete;
use crate::agenda::Msg::Edit as AgendaEdit;
use crate::agenda::Widget as AgendaWidget;
use crate::done::Msg::Complete as DoneComplete;
use crate::done::Msg::Edit as DoneEdit;
use crate::done::Widget as DoneWidget;
use crate::edit::Msg::{Cancel, D... |
//! A crate for the Marlin preprocessing zkSNARK for R1CS.
//!
//! # Note
//!
//! Currently, Marlin only supports R1CS instances where the number of inputs
//! is the same as the number of constraints (i.e., where the constraint
//! matrices are square). Furthermore, Marlin only supports instances where the
//! public ... |
// A simple type checker for better diagnostics.
// (Z3 and the Z3 crate will also type-check, but their type errors are uninformative panics)
use crate::ast::{
BinaryOp, BindX, Binder, BinderX, Binders, Constant, Decl, DeclX, Expr, ExprX, Ident, MultiOp,
Query, Stmt, StmtX, Typ, TypX, TypeError, Typs, UnaryOp... |
// Copyright 2019 Parity Technologies (UK) Ltd.
// This file is part of Substrate.
// Substrate is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any la... |
use Symbol;
pub fn from_table(table: u8, code: u8) -> Symbol {
match (table, code) {
(0x2f, 0x21) => Symbol::Sheriff, // /! BB Police, Sheriff
(0x5c, 0x21) => Symbol::Emergency, // \! OBO EMERGENCY (and overlays)
(0x2f, 0x24) => Symbol::Phone, ... |
use super::*;
use std::io::prelude::*;
use std::io::BufReader;
use std::process::Stdio;
use std::str::FromStr;
fn test_rpm_file_path() -> std::path::PathBuf {
let mut rpm_path = cargo_manifest_dir();
rpm_path.push("test_assets/389-ds-base-devel-1.3.8.4-15.el7.x86_64.rpm");
rpm_path
}
fn cargo_manifest_dir... |
use std::collections::HashMap;
use crate::{BString, BStringLc, Entry, Parser};
use crate::citation_list::{CitationList, CrossrefList};
use crate::error::{DatabaseWarningKind, ProblemReporter};
/// A `DatabaseBuilder` creates a collection of [`Entry`]s by reading one or more `bib` files.
/// Compared to the simple `bi... |
#[cfg(test)]
#[path = "../../../tests/unit/format/solution/writer_test.rs"]
mod writer_test;
use crate::format::coord_index::CoordIndex;
use crate::format::solution::activity_matcher::get_job_tag;
use crate::format::solution::model::Timing;
use crate::format::solution::*;
use crate::format::*;
use crate::{format_time,... |
/// Templates: Base strings, into which nouns can be inserted.
pub const TEMPLATES: &[(&str, Option<&[&str]>)] = &[
// Warning
("Beware of \x1F ahead.", Some(&[
"a trap",
"the ceiling",
"the floor",
"the rear area",
"a fall",
"the bloodstain",
"the messag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.