text stringlengths 9.08k 47.9k |
|---|
/*
Copyright 2020 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
//! A sqlite based block store for content-addressed data that tries to do as much as possible
//! in the database.
//!
//! This module is for all interactions with the database, so all SQL statements go in here.
//!
//! Tables:
//! cids: mapping from cid (blob < 64 bytes) to id (u64)
//! refs: m:n mapping from block i... |
//! These are the docs for the crate `bunt-macros`. This is just implementation
//! detail, please see the crate `bunt` for the real docs.
use proc_macro::TokenStream as TokenStream1;
use proc_macro2::{Ident, Span, TokenStream};
use quote::quote;
use syn::{
Error,
LitStr,
Token,
parse::{Parse, ParseStr... |
//! This program shows how to use cubemaps to implement the concept of skyboxes. It expects as
//! single CLI argument the path to a texture that encodes a skybox. The supported scheme is
//! the following:
//!
//! ```text
//! |<--- width --->|
//! – ┌───┬───┬───────┐
//! ^ │ │ U │ │
/... |
//! The `execution` module contains state for an instance's execution, and exposes functions
//! building that state into something appropriate for safe use externally.
//!
//! So far as state tracked in this module is concerned, there are two key items:
//! "execution domain" and "terminability".
//!
//! ## Execution ... |
// Copyright 2017-2020 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... |
use crate::{io, log_error};
use anyhow::{anyhow, Context};
use arguments::{
ReconstructionRunnerArgs, ReconstructionRunnerPathCollection, ReconstructionRunnerPaths,
};
use log::info;
use rayon::prelude::*;
use splashsurf_lib::mesh::{MeshAttribute, MeshWithData, PointCloud3d};
use splashsurf_lib::nalgebra::Vector3;
... |
// Copyright 2020 <NAME>
// SPDX-License-Identifier: Apache-2.0
use std::convert::TryFrom;
use serde::de::EnumAccess;
use serde::{Deserialize, Serialize};
use wasmlib::*;
use crate::contract::*;
use crate::structs::*;
use crate::utility_funcs::*;
use crate::*;
// Defining default configuration parameters
// The de... |
use super::*;
/// The lead byte of each instruction is the opcode.
///
/// This determines all the info we need to find out how many more bytes to read
/// to get the full instruction information.
#[derive(Clone, Copy)]
#[repr(transparent)]
pub struct Opcode(pub u8);
impl Opcode {
/// The operation specified by this... |
// Copyright 2021-2022 <NAME>.
// This file is part of ConcreteSTV.
// ConcreteSTV is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// ... |
// Copyright 2018 The Frown Developers
//
// 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... |
//! A stage to broadcast data from a leader node to validators
#![allow(clippy::rc_buffer)]
use self::{
broadcast_fake_shreds_run::BroadcastFakeShredsRun, broadcast_metrics::*,
fail_entry_verification_broadcast_run::FailEntryVerificationBroadcastRun,
standard_broadcast_run::StandardBroadcastRun,
};
use crat... |
//! A pure-rust implementation of a connection to an X11 server.
use std::convert::{TryFrom, TryInto};
use std::io::IoSlice;
use std::sync::{Condvar, Mutex, MutexGuard, TryLockError};
use crate::connection::{
compute_length_field, Connection, DiscardMode, ReplyOrError, RequestConnection, RequestKind,
Sequence... |
use clap::{App, Arg};
use git_testament::{git_testament, render_testament};
use ipfs_api::IpfsClient;
use lazy_static::lazy_static;
use prometheus::Registry;
use std::collections::HashMap;
use std::env;
use std::str::FromStr;
use std::time::Duration;
use tokio::sync::mpsc;
use graph::components::forward;
use graph::lo... |
#[macro_use]
mod macros;
mod arithmetic;
mod bitwise;
mod misc;
use core::ops::{BitAnd, BitOr, BitXor};
use primitive_types::{H256, U256};
use crate::{ExitReason, ExitSucceed, ExitError, Machine, Opcode};
#[derive(Clone, Eq, PartialEq, Debug)]
pub enum Control {
Continue(usize),
Exit(ExitReason),
Jump(usize),
Tra... |
// Constants and types used in `*-*-linux-gnu` targets. These are
// checked against `libc` by the parent mod.rs.
#![allow(dead_code)]
use std::ffi::c_void;
use std::os::raw::{c_char, c_int, c_long, c_ulong, c_ulonglong};
pub(crate) const F_SETFD: c_int = 2;
pub(crate) const F_GETFL: c_int = 3;
pub(crate) const F_DU... |
use crate::game;
use crate::progress::Ticker;
use crate::prove::dfpn;
use crate::prove::node_pool;
use crate::prove::node_pool::{NodeID, Pool};
use crate::prove::{Bounds, Evaluation, INFINITY};
use crate::table;
use crate::util;
use crossbeam;
use crossbeam::channel;
use hdrhistogram::Histogram;
use parking_lot::RwLoc... |
use crate::math;
use crate::platform::{Buffer, Frame};
use crate::world::{JumpType, World};
use super::{
font, CircleVertex, DataEvent, GraphicsContext, InputState, LineVertex, MapEvent, MouseButton,
QueryEvent, SystemData, UserEvent, VirtualKeyCode, Widget,
};
use std::rc::Rc;
use std::time::Duration;
use a... |
//---------------------------------------------------------------------------//
// Copyright (c) 2017-2020 <NAME>. All rights reserved.
//
// This file is part of the Rusted PackFile Manager (RPFM) project,
// which can be found here: https://github.com/Frodo45127/rpfm.
//
// This file is licensed under the MIT license... |
#![deny(warnings)]
use std::collections::HashMap;
use std::env;
use std::io::{self, ErrorKind};
use std::sync::{
atomic::{AtomicUsize, Ordering},
Arc,
};
use futures::SinkExt;
use futures::StreamExt;
use serde::{Deserialize, Serialize};
use slog::{debug, error, info, o, Drain, Logger};
use tokio::io::{AsyncRe... |
use bulletproofs::r1cs;
use core::iter;
use core::iter::FromIterator;
use curve25519_dalek::ristretto::CompressedRistretto;
use curve25519_dalek::scalar::Scalar;
use merlin::Transcript;
use musig::{BatchVerification, Signature};
use spacesuit;
use spacesuit::BitRange;
use std::mem;
use crate::constraints::{Commitment,... |
// Copyright 2019-2021 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, mod... |
//! Fast wrapper for v4l2.
//!
//! ```no_run
//! # use std::fs;
//! # use std::io::Write;
//! use rscam::{Camera, Config};
//!
//! let mut camera = Camera::new("/dev/video0").unwrap();
//!
//! camera.start(&Config {
//! interval: (1, 30), // 30 fps.
//! resolution: (1280, 720),
//! format: b"MJPG",
//!... |
// Copyright 2020-2021, The Tremor Team
//
// 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 agr... |
use std::cmp::min;
use std::fmt::{Display, Write};
use std::fs::File;
use std::io;
use std::io::BufWriter;
use std::ops::Range;
use std::str::{from_utf8_unchecked, FromStr};
use anyhow::{bail, Context, Result};
use clap::{App, Arg, ArgMatches};
use colored::Colorize;
use ion_rs::result::IonResult;
use ion_rs::text::wr... |
#![doc = include_str!("../crate-docs.md")]
#![forbid(unsafe_code)]
#![warn(
clippy::cargo,
missing_docs,
// clippy::missing_docs_in_private_items,
clippy::nursery,
clippy::pedantic,
future_incompatible,
rust_2018_idioms,
)]
#![allow(
clippy::missing_errors_doc, // TODO clippy::missing_er... |
mod download;
mod log;
mod log_source;
mod metadata;
mod raw_log_ext;
mod render;
mod report_output;
mod review;
mod state;
mod tactics;
mod tehai;
use crate::render::Layout;
use self::log_source::LogSource;
use self::metadata::Metadata;
use self::raw_log_ext::RawLogExt;
use self::render::{Language, View};
use self::... |
use super::child::{child_output::OutputMode, Config};
use super::client;
use super::keys_handler::*;
use super::kindergarten::*;
use super::logger;
use super::timer::*;
use chrono::prelude::*;
use openssl::rsa::*;
use std::collections::HashSet;
use std::fs;
use std::fs::{File, OpenOptions};
use std::io::{Error as ioEr... |
const BLOCK_SIZE: usize = 64;
const RESULT_SIZE: usize = 32;
const STATE_SIZE: usize = 8;
const INIT_STATE: [u32; STATE_SIZE] = [0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19];
const K256: [u32; 64] = [
0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f11... |
// Copyright 2019. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclai... |
// Copyright 2022 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::{
keys::{
EnrolledKey, Key, KeyEnrollment, KeyEnrollmentError, KeyRetrieval, KeyRetrievalError,
KEY_LEN,
... |
use crate::common::*;
use crate::instruction_generator::{Instruction, InstructionGeneratorResult, Path, PrinterType};
use crate::interpreter::context::*;
use crate::interpreter::data_segment::DataSegment;
use crate::interpreter::default_stdlib::DefaultStdlib;
use crate::interpreter::interpreter_trait::InterpreterTrait;... |
// Copyright © Spelldawn 2021-present
// 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
// https://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to i... |
use std::{
cmp::{Ord, Ordering, PartialOrd},
fmt::{Display, Formatter, Result as FmtResult},
io::{Read, Result as IoResult, Write},
marker::PhantomData,
ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign},
str::FromStr,
};
use crate::{
biginteger::{arithmetic as fa, B... |
// Copyright (c) 2017-2018, The rav1e contributors. All rights reserved
//
// This source code is subject to the terms of the BSD 2 Clause License and
// the Alliance for Open Media Patent License 1.0. If the BSD 2 Clause License
// was not distributed with this source code in the LICENSE file, you can
// obtain it at ... |
/*!
On `Android`, we can only share maps between processes by serializing fds over sockets.
On `MacOS`, we cannot rely on reference counting for Maps.
Hence, the `unix_shmem_server` keeps track of existing maps, creates new maps for clients,
and forwards them over unix domain sockets.
*/
use crate::{
bolts::shmem:... |
use crate::{
config::{NodeConfigHandler, TonNodeConfig},
engine_traits::{OverlayOperations, PrivateOverlayOperations},
network::{
catchain_client::CatchainClient,
full_node_client::{NodeClientOverlay, FullNodeOverlayClient},
neighbours::{self, Neighbours}
},
types::awaiters_p... |
// Copyright © 2015, <NAME>
// Licensed under the MIT License <LICENSE.md>
pub const WAVE_FORMAT_UNKNOWN: ::WORD = 0x0000;
pub const WAVE_FORMAT_PCM: ::WORD = 0x0001;
pub const WAVE_FORMAT_ADPCM: ::WORD = 0x0002;
pub const WAVE_FORMAT_IEEE_FLOAT: ::WORD = 0x0003;
pub const WAVE_FORMAT_VSELP: ::WORD = 0x0004;
pub const ... |
//! # Algexenotation
//!
//! Algexenotation is a way to represent multisets
//! as natural numbers with algebraic compression.
//! Inspired by [Tic Xenotation](https://mvupress.net/tic-xenotation/).
//! For more information, see [paper](https://github.com/advancedresearch/path_semantics/blob/master/papers-wip2/algexeno... |
use num_traits::FromPrimitive;
use std::collections::HashMap;
use crate::enums::PtraceOp;
use crate::syscall::Direction;
use crate::value::Value;
use crate::Ident;
use crate::SyscallParameters;
use crate::{from_c, TraceError, TraceOptions, TraceOutput, Tracer};
/// Implementation of tracing loop; internal struct, use... |
//! Multi-file iterator, which keeps track of the current file being iterated. See
//! [`FragmentIterator`] for usage.
//!
//! [`FragmentIterator`]: struct.FragmentIterator.html
//!
//! For proper error handling in C, due to `#include` and friends, one needs to keep track of the
//! origin for various identifiers.
//!
... |
use bankless_bft::{Index, KeyBox as _, NodeIndex, SignatureSet};
use codec::{Codec, Decode, Encode};
use futures::{channel::mpsc, stream::Stream, FutureExt, StreamExt};
use parking_lot::Mutex;
use sc_network::{multiaddr, Event, ExHashT, NetworkService, PeerId as ScPeerId, ReputationChange};
use sp_runtime::traits::Bloc... |
/*
* Copyright 2018-2019 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License. You may obtain a copy of the
* License at:
*
* https://www.ton.dev/licenses
*
* Unless required by applicable law or agreed to ... |
use serde_xml_rs::from_reader;
#[test]
fn test() {
parse_jigg();
}
#[derive(Debug, Deserialize)]
pub struct Token {
pub reading: String,
pub base: String,
#[serde(rename = "inflectionForm", default)]
pub inflection_form: String,
#[serde(rename = "inflectionType", default)]
pub inflection_t... |
use std::cell::RefCell;
use std::rc::Rc;
use std::sync::Arc;
use cita_trie::DB;
use ethereum_types::{Address, H256, U256};
use hashbrown::{HashMap, HashSet};
use rlp::RlpStream;
use crate::common;
use crate::err::Error;
use crate::evm;
use crate::evm::native;
use crate::riscv;
use crate::state::{self, State, StateObj... |
use crate::{
testsuite::{BatchTestSuite, Match, PartialBatchTestCase, TestSuite},
web::{
codeforces::api::SessionMutExt as _, CookieStorage, Exec, Login, LoginOutcome, Participate,
ParticipateOutcome, Platform, ProblemInContest, ProblemsInContest, ResponseExt as _,
RetrieveLanguages, Ret... |
use itertools::Itertools;
use seed::{prelude::*, *};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::ops::Not;
#[global_allocator]
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
/// Every possible card in their order of precendence.
const ALL_CARDS: [Card; 8] = [
Card::Guard,
Card... |
use rand::{Rng, SeedableRng};
use bevy::{
diagnostic::{Diagnostics, FrameTimeDiagnosticsPlugin},
prelude::*,
window::{WindowMode, WindowResizeConstraints, WindowResized},
ui::Val::Px, app::Events,
};
use heron::prelude::*;
fn main() {
App::new()
.insert_resource(ClearColor(Color::rgba(0.... |
use std::{convert::TryFrom, fs};
use std::{convert::TryInto, env, str::FromStr};
use anyhow::{bail, Context, Result};
use fdo_data_formats::{
constants::{HashType, HeaderKeys, KeyStorageType, MfgStringType, PublicKeyType},
devicecredential::{file::KeyStorage, FileDeviceCredential},
enhanced_types::X5Bag,
... |
use std::fmt;
use std::path::{
Path,
PathBuf,
};
use std::fs;
use std::io;
use std::io::Write;
use itertools::multizip;
use colored::Colorize;
use vasp_poscar::{self, Poscar};
use log::info;
use crate::outcar::{
Outcar,
IonicIteration,
Vibration,
Mat33,
MatX3,
};
fn _save_as_xsf_helper(fn... |
use std::{sync::Arc, time::Duration};
use chrono::Utc;
use diesel::prelude::*;
use fnv::FnvHashMap as HashMap;
use reqwest::{self, StatusCode};
use rocket::http::RawStr;
use serde::{Deserialize, Serialize};
use tokio::{
sync::{mpsc::channel, Mutex},
task::block_in_place,
};
use crate::{
conf::CONF,
db... |
use crate::{
AgentID, CarID, Command, CreateCar, DrawCarInput, DrawPedCrowdInput, DrawPedestrianInput,
DrivingGoal, DrivingSimState, Event, FinishedTrips, GetDrawAgents, IntersectionSimState,
ParkedCar, ParkingSimState, ParkingSpot, PedestrianID, Router, Scheduler, TransitSimState,
TripID, TripLeg, Trip... |
// Copyright 2018 The Grin Developers
//
// 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 agree... |
mod block_proposal_process;
mod block_transactions_process;
mod block_transactions_verifier;
mod block_uncles_verifier;
mod compact_block_process;
mod compact_block_verifier;
mod get_block_proposal_process;
mod get_block_transactions_process;
mod get_transactions_process;
#[cfg(test)]
mod tests;
mod transaction_hashes_... |
//! The Substrate Node Template runtime. This can be compiled with `#[no_std]`, ready for Wasm.
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]
// Make the WASM binary available.
#[cfg(feature = "std")... |
//! Darwinia chain configurations.
pub use node_primitives::{AccountId, Balance, Signature};
pub use node_runtime::GenesisConfig;
use std::{env, fs::File, path::Path};
use grandpa_primitives::AuthorityId as GrandpaId;
use hex_literal::hex;
use node_runtime::{
constants::currency::*, AuthorityDiscoveryConfig, BabeCo... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::{
atomic_arena::{self, AtomicArena},
idhasher::BuildIdHasher,
sharded_set::ShardedSet,
};
use once_cell::syn... |
//! Module containing functions for interacting with gluon's primitive types.
use crate::real_std::{
ffi::OsStr,
fs, io,
path::{self, Path},
result::Result as StdResult,
str::FromStr,
string::String as StdString,
};
use crate::base::types::ArcType;
use crate::{
api::{
generic::{sel... |
//! Driver for the Taos TSL2561 light sensor.
//!
//! <http://www.digikey.com/product-detail/en/ams-taos-usa-inc/TSL2561FN/TSL2561-FNCT-ND/3095298>
//!
//! > The TSL2560 and TSL2561 are light-to-digital converters that transform
//! > light intensity to a digital signal output capable of direct I2C
//! > interface. Eac... |
use std::convert::TryInto;
use std::env;
use std::process::Command;
use std::{collections::BTreeMap, fmt::Write, path::Path};
use anyhow::{bail, Context, Result};
use clap::{IntoApp, Parser};
use clap_complete::{generate, Shell};
use csv::{ReaderBuilder, WriterBuilder};
use serde::{Deserialize, Serialize};
use time::e... |
//! This module implements the global `Function` object as well as creates Native Functions.
//!
//! Objects wrap `Function`s and expose them via call/construct slots.
//!
//! The `Function` object is used for matching text with a pattern.
//!
//! More information:
//! - [ECMAScript reference][spec]
//! - [MDN docume... |
use std::io;
use crate::model::{Buffer, Position, SauceString, Color, BitFont, Layer, DosChar, TextAttribute, BitFontType, BufferType};
const MDF_HEADER: &[u8] = b"MDf";
const MDF_VERSION: u16 = 0;
const ID_SIZE: usize = 4;
const HEADER_SIZE: usize = 83;
const CRC32_SIZE: usize = 4;
pub fn read_mdf(result: &mut Buffe... |
// 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 writi... |
//! # Collada parser
//!
//! This is a parser for the Collada (`.dae`) format, used for interchange between 3D renderers
//! and games. Compared to the [`collada`](https://crates.io/crates/collada) crate,
//! this crate attempts to more directly represent the Collada data model, and it is also
//! significantly more co... |
// Copyright 2018-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) a... |
// SID chip
extern crate rand;
#[cfg(not(target_os = "redox"))]
extern crate sdl2;
#[cfg(not(target_os = "redox"))]
use self::sdl2::audio::{ AudioCallback, AudioSpecDesired };
use c64::memory;
use c64::sid_tables::*;
use std::cell::RefCell;
use std::f32;
use std::rc::Rc;
pub type SIDShared = Rc<RefCell<SID>>;
const ... |
//! The semantics of the language
//!
//! Here we define the rules of normalization, type checking, and type inference.
//!
//! For more information, check out the theory appendix of the Pikelet book.
use codespan::ByteSpan;
use moniker::{Binder, BoundPattern, BoundTerm, Embed, FreeVar, Nest, Scope, Var};
use pikelet... |
// Copyright 2019 by <NAME> <<EMAIL>>
//
// 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 t... |
use std::path::PathBuf;
use std::sync::Arc;
use crate::{
data::{Data, LN},
scrape::{self, Search},
state::State,
Res,
};
use cursive::theme::{Effect, Style};
use cursive::utils::markup::StyledString;
use cursive::views::NamedView;
use cursive::{
align::{Align, HAlign},
direction::Orientation,
... |
pub use BinOpToken::*;
pub use DelimToken::*;
pub use LitKind::*;
pub use Nonterminal::*;
pub use TokenKind::*;
use crate::ast;
use crate::ptr::P;
use crate::tokenstream::TokenTree;
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
use rustc_data_structures::sync::Lrc;
use rustc_macros::HashStable... |
use super::{
common::{format_hex, render_nullability, IteratorJoin, Quoted, SQL_INDENTATION},
SqlRenderer,
};
use crate::{
flavour::PostgresFlavour,
pair::Pair,
sql_migration::{AlterColumn, AlterEnum, AlterTable, RedefineTable, TableChange},
sql_schema_differ::{ColumnChange, ColumnChanges},
};
u... |
//! `flapigen` is a Rust Simplified Wrapper and Interface Generator used
//! to connect other programming languages to Rust.
//! It is designed to be used from
//! [cargo build scripts](https://doc.rust-lang.org/cargo/reference/build-scripts.html).
//! The idea of this softwared based on [swig](http://www.swig.org).
//... |
//! Parser to convert from a string into the tree AST.
//!
//! The parser works in two passes. The first pass builds up an internal
//! representation of `Node` objects for each block in the document. Each node
//! is added to a list of nodes and any sub-nodes are then tracked as indices
//! into the main list. This ma... |
#![deny(clippy::unimplemented, clippy::unwrap_used, clippy::ok_expect)]
use log::{debug, Level};
use winapi::shared::winerror;
use winapi::um::d3d12;
mod cond_pub_mod {
pub trait AbstractWinapiPtr<T> {
fn as_winapi(&self) -> &T;
fn as_winapi_mut(&mut self) -> &mut T;
}
}
#[cfg(feature = "public... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use itertools::Itertools;
use pretty::RcDoc;
use std::rc::Rc;
use move_model::{
ast::{Condition, ConditionKind, Exp, ExpData, Operation, QuantKind, SpecBlockTarget, Value},
model::{AbilityConstraint, AbilitySet, GlobalEnv, Type... |
// Part of this file is an adaptation of test_utils from rust-lightning's lightning_block_sync crate.
// The original piece of software can be found at https://github.com/rust-bitcoin/rust-lightning/blob/main/lightning-block-sync/src/test_utils.rs
/* This file is licensed under either of
* Apache License, Version 2.... |
/// Source information collected at parse time.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SourceInfo {
/// The location name. All position information attached to an expression is
/// relative to this location.
///
/// The location could be a file, UI element, or similar. For example,
... |
use std::collections::HashMap;
use std::fmt::{Debug, Formatter};
use std::io::SeekFrom;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use std::time::{Duration,SystemTime, UNIX_EPOCH};
use anyhow::{bail, Context, Result};
use bytes::{Buf, BufMut, Bytes, BytesMut};
use dashmap::DashMap;
use futures_util::future::Fu... |
// NIST Special Publication 800-38B
// Recommendation for Block Cipher Modes of Operation: The CMAC Mode for Authentication
// https://nvlpubs.nist.gov/nistpubs/specialpublications/nist.sp.800-38b.pdf
//
// The AES-CMAC Algorithm
// https://tools.ietf.org/html/rfc4493
//
// Synthetic Initialization Vector (SIV) Authe... |
/*
This tool is part of the WhiteboxTools geospatial analysis library.
Authors: Dr. <NAME>
Created: 18/02/2020
Last Modified: 05/03/2020
License: MIT
*/
use whitebox_common::algorithms::is_clockwise_order;
use whitebox_raster::*;
use whitebox_common::structures::{Array2D, Point2D};
use crate::tools::*;
use whitebox_ve... |
#[macro_use]
extern crate log;
extern crate env_logger;
extern crate clap;
use clap::{App, Arg};
extern crate pest;
#[macro_use]
extern crate pest_derive;
extern crate asts;
extern crate dwarf_ctx;
extern crate rv_model;
extern crate utils;
extern crate topological_sort;
pub mod disassembler;
use disassembler::dis... |
//! Job control.
//!
//! We use a channel to send Events from different futures to a job monitor,
//! which coordinates the display of progress onto the terminal.
use std::collections::HashMap;
use std::fmt::{self, Display};
use std::future::Future;
use std::sync::Arc;
use std::time::Duration;
use tokio::sync::mpsc::... |
//! Information parsed from an input and format description.
use core::convert::{TryFrom, TryInto};
use core::num::{NonZeroU16, NonZeroU8};
use crate::error::TryFromParsed::InsufficientInformation;
use crate::format_description::modifier::{WeekNumberRepr, YearRepr};
use crate::format_description::{Component, FormatIt... |
use bazelfe_protos::*;
use std::sync::atomic::Ordering;
use std::{
collections::{HashMap, HashSet},
ops::{Add, Sub},
path::PathBuf,
sync::atomic::{AtomicU32, AtomicUsize},
time::Duration,
};
use dashmap::DashMap;
use std::{error::Error, sync::Arc};
use tarpc::serde_transport as transport;
use tarpc... |
use bio::alphabets::dna;
use bstr::BString;
use crate::{
handle::{Direction, Edge, Handle, NodeId},
handlegraph::*,
mutablehandlegraph::*,
pathgraph::PathHandleGraph,
};
pub mod graph;
pub mod node;
pub mod path;
pub use self::graph::HashGraph;
pub use self::node::Node;
pub use self::path::{Path, Pat... |
use num_derive::FromPrimitive;
use crate::attribute::Attribute;
use crate::character::character_common_data::CharacterCommonData;
use crate::character::character_sub_stat::CharacterSubStatFamily;
use crate::character::{CharacterConfig, CharacterName, CharacterStaticData};
use crate::character::skill_config::CharacterSk... |
//! Defines functionality for querying and retrieving data from a Google Cloud Pubsub subscription
//!
//! Contains functions for establishing a connection to a Google Cloud Pubsub subscription which
//! contains messages for starting test runs. Should poll the subscription on a schedule and
//! process any messages i... |
pub mod record_builder;
use log::{error, warn, debug};
use self::record_builder::{RecordBuilder, RecordBuilderError, SessionHead, Record};
use crate::store::VslStore;
use crate::store::Config as StoreConfig;
use crate::vsl::record::VslRecord;
use crate::access_log::record::AccessRecord;
use std::num::Wrapping;
use crat... |
// Copyright 2021 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.
//! Minimal type-safe definitions of the virtio data structures.
//!
//! Contains definitions and type-safe accessors and manipulators of the virtio data st... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
use vint32::iterator::VintArrayIterator;
pub use crate::metadata::*;
use crate::{
error::VelociError,
indices::*,
search::*,
type_info,
util::{self, get_file_path, *},
};
use colored::*;
use fnv::FnvHashMap;
use fst::Map;
use lru_time_cache::LruCache;
use memmap::{Mmap, MmapOptions};
use num::{self... |
//! Describes all meta data possible in an exr file.
//! Contains functionality to read and write meta data from bytes.
//! Browse the `exr::image` module to get started with the high-level interface.
pub mod attribute;
pub mod header;
use crate::io::*;
use ::smallvec::SmallVec;
use self::attribute::*;
use crate::b... |
// Author:
// - Yuzo <<EMAIL>>
// This code provides field arithmetic arithmetic modulo p.
use core::ops::Add;
use core::ops::Mul;
use core::ops::Sub;
use std::cmp::{Eq, PartialEq};
use super::constants::{Reduce51Mask, TwoP0, TwoP1234};
use super::utils::{load_8, m6464};
use subtle::{Choice, ConditionallySelectable... |
use std::collections::{HashMap, HashSet};
use std::sync::{Arc, Mutex};
use buffers::channel::BufferSender;
use event::Event;
use futures::{future, Future, FutureExt, SinkExt};
use tokio::sync::{mpsc, watch};
use tokio::time::{interval, sleep_until};
use tokio::time::{Duration, Instant};
use tracing::Instrument;
use c... |
//! Compilation.
use super::*;
use astgraph::{AstGraph, AstNode};
use graphs::*;
use locals_graph::LocalsGraph;
use tygraph::TypeGraph;
mod infer;
mod params;
mod resolve_tg;
pub use params::CallsiteParam;
/// Compile an expression.
///
/// `input_ty` is optional. If not specified, `Nil` is
/// used.
pub fn compile... |
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit="256"]
// Make the WASM binary available.
#[cfg(feature = "std")]
include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs"));
use sp_std::prelude::*;
use sp_core::{cry... |
// Miniscript
// Written in 2019 by
// <NAME> <<EMAIL>>
//
// To the extent possible under law, the author(s) have dedicated all
// copyright and related and neighboring rights to this software to
// the public domain worldwide. This software is distributed without
// any warranty.
//
// You should have received a ... |
// 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... |
#![allow(non_snake_case)]
use crate::ahp::indexer::*;
use crate::ahp::verifier::*;
use crate::ahp::*;
use crate::ahp::constraint_systems::{
make_matrices_square_for_prover, pad_input_for_indexer_and_prover, unformat_public_input,
};
use crate::{ToString, Vec};
use ark_ff::{Field, PrimeField, Zero};
use ark_poly::... |
#![feature(split_inclusive)]
#![feature(option_result_contains)]
#![feature(iter_partition_in_place)]
use num_derive::FromPrimitive;
use num_traits::FromPrimitive;
use std::fs::File;
use std::io::prelude::*;
use clap::{Arg, App, AppSettings, SubCommand};
use std::ffi::CStr;
use itertools::Itertools;
use std::path... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.