text stringlengths 7.05k 33.9k |
|---|
//! Logic for loading configuration in to an object model
use crate::subscriber::is_global_subscriber_set;
use apollo_router_core::plugins;
use derivative::Derivative;
use displaydoc::Display;
use itertools::Itertools;
use schemars::gen::SchemaGenerator;
use schemars::schema::{ObjectValidation, Schema, SchemaObject};
... |
use cnrd::color::Color;
use cnrd::color::Colorable;
use cnrd::position::Positionable;
use cnrd::position::Sizeable;
use cnrd::widget::button::{Button, Flat, TimesClicked};
use cnrd::widget::canvas::Canvas;
use cnrd::widget::id::{Generator, Id};
use cnrd::widget::primitive::text::Text;
use cnrd::widget::scrollbar::Scrol... |
//! Command line utility for setting, bumping, and reading Rust pacakge versions.
//! This is an extremely thin layer over the [semver crate](https://crates.io/crates/semver)
//! and meant to just serve as a command line glue for tools such as [cargo-make](https://crates.io/crates/cargo-make).
#[macro_use]
extern crate... |
#![allow(unused_imports)]
#![allow(dead_code)]
use std::collections::HashMap;
use std::path::Path;
use std::sync::Arc;
use std::sync::Mutex;
use tokio::sync::mpsc;
use tokio::sync::RwLock;
#[allow(unused_imports, dead_code)]
use tracing::{debug, error, info, trace, warn};
use wasm_bindgen::JsCast;
use wasmer_vfs::FileS... |
/*
MIT License
Copyright (c) 2017 <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, distrib... |
//! Data related to variable trace.
use std::convert::TryInto;
use std::fmt;
use std::hash::{Hash, Hasher};
/// Reference type for [`ValueArena`] container.
///
/// [`ValueArena`]: struct.ValueArena.html
#[derive(Clone, Copy, Debug)]
pub struct ValueRef {
index: u32,
}
/// An arena-like collection for variable v... |
use crate::asynchronous::delayable_stream::ResettableTimer;
use crate::client::{Client, ClientFactory};
use crate::destinations::{
DestinationId, Destinations, InboundMessage, MessageId, OutboundMessage, Sender, Subscriber,
SubscriptionId,
};
use crate::error::StomperError;
use either::Either;
use futures::sin... |
// Copyright 2019 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.
#![warn(missing_docs)]
//! `timekeeper` is responsible for external time synchronization in Fuchsia.
mod diagnostics;
mod network;
mod rtc;
use {
cr... |
use super::{utils::string_null_pad, ElmaError, Position};
use byteorder::{WriteBytesExt, LE};
use nom::le_f32;
use nom::le_f64;
use nom::le_i16;
use nom::le_i32;
use nom::le_u32;
use nom::le_u8;
use nom::verbose_errors::Context::List;
use nom::Err::Failure;
use nom::ErrorKind::Custom;
use std::fs;
use std::path::PathBu... |
use std::collections::BTreeMap;
use std::convert::TryFrom;
use std::io::Read;
use std::str::FromStr;
use displaydoc::Display;
use serde::*;
use serde_json::Value;
use thiserror::Error;
use crate::schema::raw::PacketDefinition;
use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
use std::option::Option::... |
// Copyright 2020 <NAME> <<EMAIL>> and collaborators
// Licensed under the MIT License.
//! State for the Cranko CLI application.
use anyhow::{anyhow, Context};
use log::{error, info, warn};
use std::collections::HashMap;
use thiserror::Error as ThisError;
use crate::{
atry,
config::ConfigurationFile,
er... |
///! This manages the discovery and management of peers.
pub(crate) mod enr;
// Allow external use of the lighthouse ENR builder
pub use enr::{build_enr, CombinedKey, Keypair};
use crate::metrics;
use crate::{error, Enr, NetworkConfig, NetworkGlobals};
use enr::{Eth2Enr, BITFIELD_ENR_KEY, ETH2_ENR_KEY};
use futures::... |
//! A heap-less, interrupt-safe, lock-free memory pool for Cortex-M devices
//!
//! **WARNING** Do not use this on multi-core devices. The implementation has not been revised for
//! multi-core soundness.
//!
//! **NOTE** This is more likely to be merged into `heapless` (once I iterate on it more) than to
//! be publis... |
use lox_bytecode::bytecode::Chunk;
use super::memory::*;
use crate::bettergc::{Gc, Trace, UniqueRoot, gc};
use crate::bytecode::{Module};
use std::{cell::RefCell, io::{Stdout, Write, stdout}};
use std::collections::HashMap;
#[derive(PartialEq)]
enum InterpretResult {
Done,
More,
}
#[derive(Debug)]
pub enum V... |
#![deny(unused_must_use)]
use crate::diagnostics::error::{
invalid_nested_attr, span_err, throw_invalid_attr, throw_invalid_nested_attr, throw_span_err,
SessionDiagnosticDeriveError,
};
use crate::diagnostics::utils::{
report_error_if_not_applied_to_span, type_matches_path, Applicability, FieldInfo, FieldI... |
// Copyright (c) 2020 10X Genomics, Inc. All rights reserved.
extern crate clap;
extern crate csv;
extern crate data_encoding;
extern crate failure;
extern crate rayon;
extern crate ring;
extern crate rust_htslib;
extern crate simplelog;
extern crate tempfile;
extern crate terminal_size;
#[macro_use]
extern crate log;... |
//! Serial Peripheral Interface (SPI) bus
use crate::hal;
pub use crate::hal::spi::{
Mode, Phase, Polarity, MODE_0, MODE_1, MODE_2, MODE_3,
};
use crate::stm32::rcc::{d2ccip1r, d3ccipr};
use crate::stm32::spi1::cfg1::MBRW;
use core::ptr;
use nb;
use crate::stm32::{SPI1, SPI2, SPI3, SPI4, SPI5, SPI6};
use crate::... |
use byteorder::LittleEndian;
use core::convert::TryFrom;
use core::convert::TryInto;
use elf_utils::Elf64;
use elf_utils::reloc::RelaData;
use elf_utils::reloc::Relas;
use elf_utils::reloc::x86_64::X86_64Reloc;
use elf_utils::reloc::x86_64::X86_64RelocError;
const X86_64_RELAS_SIZE: usize = 600;
const X86_64_RELAS: [... |
//! The `twiggy` code size profiler.
#![deny(missing_docs)]
#![deny(missing_debug_implementations)]
extern crate cpp_demangle;
extern crate frozen;
extern crate petgraph;
extern crate rustc_demangle;
mod graph_impl;
use frozen::Frozen;
use std::cmp;
use std::collections::btree_map;
use std::collections::{BTreeMap, ... |
// 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 {
fidl::{client::QueryResponseFut, endpoints::Proxy as _},
fidl_fuchsia_io as fio, fuchsia_zircon_status as zx_status,
futures::io::AsyncRe... |
#![warn(dead_code)]
use core::cell::RefCell;
use crate::error_handling::unwrap_field;
use core::borrow::Borrow;
use tracing::{debug, error};
use std::hash::{Hash, Hasher};
use bytes::Bytes;
use std::net::SocketAddr;
use tokio::sync::mpsc;
use tonic::{Request, Response, Status /*, Streaming*/};
use crate::data_acce... |
use crate::error::Error;
use crate::resolve_import::resolve_import;
use deno_ast::swc::ast::Program;
use deno_ast::swc::common::chain;
use deno_ast::swc::common::comments::SingleThreadedComments;
use deno_ast::swc::common::errors::Diagnostic;
use deno_ast::swc::common::errors::DiagnosticBuilder;
use deno_ast::swc::comm... |
use super::*;
use std::collections::BTreeMap;
use regex::Regex;
use lazy_static::lazy_static;
use std::fs;
mod binding;
pub use binding::*;
mod skeleton;
pub use skeleton::*;
mod translate_doc;
pub use translate_doc::*;
mod translate_type;
pub use translate_type::*;
mod tfidf_gen;
pub use tfidf_gen::*;
pub fn ext... |
use crate::sim::*;
#[cfg(feature = "color_eyre")]
use color_eyre::{
eyre::{bail, ensure, eyre},
Result,
};
#[cfg(not(feature = "color_eyre"))]
use simple_eyre::{
eyre::{bail, ensure, eyre},
Result,
};
use num_traits::FromPrimitive;
use std::collections::HashMap;
use std::io::{Read, Write};
use smallve... |
// Copyright © 2019 piet-dx12 developers.
//
// 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. This file may not be copied, modified, or distributed
// except a... |
use std::iter::FromIterator;
use std::iter::StepBy;
use std::slice::Iter;
use std::slice::IterMut;
use bevy::prelude::*;
use crate::formatting::CharFormat;
use crate::formatting::StringFormat;
use sark_grids::Grid;
/// A single tile of the terminal.
///
/// Defaults to a blank glyph with a black background and a wh... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
//! Attestation Verification Report handling
use alloc::vec;
use super::json::JsonValue;
use crate::{
error::{
IasQuoteError, IasQuoteResult, JsonError, NonceError, PseManifestError,
PseManifestHashError, PseManifestResult, RevocationCause, Ver... |
/* This is dvipdfmx, an eXtended version of dvipdfm by <NAME>.
Copyright (C) 2002-2018 by <NAME> and <NAME>,
the dvipdfmx project team.
Copyright (C) 1998, 1999 by <NAME> <<EMAIL>>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public Li... |
// This file is part of Substrate.
// Copyright (C) 2019-2020 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
/*
* 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.
*/
//! Implement buckification - generate Buck build rules from Cargo metadata
use crate::{
buck::{self, Common, PlatformRustComm... |
pub mod serial;
pub mod stream;
use anyhow::Result;
use bytes::{Buf, BufMut, Bytes, BytesMut};
use std::time::{Duration, Instant};
use stream::Stream;
/// Modbus从设备 寄存器地址
pub(crate) type Address = u16;
/// Modbus从设备 Id
pub(crate) type Id = u8;
/// Modbus使用16位数表示它的数据项(大端模式)
pub(crate) type Word = u16;
/// Modbus需要读... |
#[cfg(test)]
use crate::test_tools::test_item;
use crate::{
codec::{Codec, ParseError, ParseFail, ParseResult, ParseResultExtension, ParseValue},
Enum,
};
#[cfg(test)]
use hex_literal::hex;
/// Encryption algorigthm for over-the-air packets
#[derive(Clone, Copy, Debug, PartialEq)]
pub enum NlsMethod {
None... |
use crate::cli;
use crate::ChannelManager;
use bitcoin::hash_types::{BlockHash, Txid};
use bitcoin::hashes::hex::{FromHex, ToHex};
use bitcoin::secp256k1::key::PublicKey;
use chrono::Utc;
use lightning::chain::chainmonitor;
use std::io::Cursor;
extern crate libc;
use lightning::chain;
use lightning::chain::channelmoni... |
//
// This module contains the main entry point of the library,
// DavHandler.
//
use std::error::Error as StdError;
use std::io;
use std::sync::Arc;
use bytes::{self, buf::Buf};
use futures_util::stream::Stream;
use headers::HeaderMapExt;
use http::{Request, Response, StatusCode};
use http_body::Body as HttpBody;
us... |
use std::fs;
use std::rc::Rc;
use core::fmt::{Debug, Display};
extern crate rustyline;
use rustyline::error::ReadlineError;
use rustyline::Editor;
extern crate nom;
pub mod parser;
const FLAG1: &str = "TODO: Replace with flag here";
const FLAG2: &str = "TODO: Replace with flag here";
const COMMENT_BOL: &str = ";";
... |
/*
* MIT License
*
* Copyright (c) 2020 bonsairobo
* Copyright (c) 2021 <NAME> <<EMAIL>>
*
* 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 limit... |
//
// Copyright 2018 <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 writin... |
use crate::js::exports::Exportable;
use crate::js::externals::Extern;
use crate::js::imports::Imports;
use crate::js::store::Store;
use crate::js::types::{ExportType, ImportType};
// use crate::js::InstantiationError;
#[cfg(feature = "wat")]
use crate::js::error::WasmError;
use crate::js::error::{CompileError, Deserial... |
#[macro_use]
extern crate clap;
extern crate failure;
extern crate handlebars;
extern crate itertools;
extern crate rayon;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate serde_json;
#[macro_use]
extern crate structopt;
#[macro_use]
extern crate lazy_static;
extern crate pretty;
extern crate pu... |
#![feature(i128, i128_type)]
extern crate svg;
extern crate ipnetwork;
extern crate rand;
#[macro_use] extern crate clap;
use clap::{Arg, App};
use svg::*;
use svg::node::Text as Tekst;
use svg::node::element::{Rectangle, Circle, Text, Group};
use ipnetwork::Ipv6Network;
use std::net::Ipv6Addr;
//use num::PrimInt;
... |
use aster::AstBuilder;
use data_structures::indexed_vec::Idx;
use mir::{self, BasicBlock, Local, LocalDecl, Mir, VisibilityScope};
use std::collections::{BTreeMap, HashMap, HashSet};
use std::mem;
use super::builder::Builder;
use syntax::ast;
use syntax::codemap::Span;
use syntax::ext::base::ExtCtxt;
/// `LocalStack` ... |
//! Install tools and build the `esp-idf` using native tooling.
use std::convert::TryFrom;
use std::ffi::OsString;
use std::path::{Path, PathBuf};
use std::str::FromStr;
use std::{env, fs};
use anyhow::*;
use embuild::cmake::file_api::codemodel::Language;
use embuild::cmake::file_api::ObjKind;
use embuild::espidf::In... |
//! Data generator sdk/examples/shamir-secret-sharing
//!
//! # Authors
//!
//! The Veracruz Development Team.
//!
//! # Copyright
//!
//! See the file `LICENSE_MIT.markdown` in the Veracruz root directory for licensing
//! and copyright information.
use rand::Rng;
use std::{convert::TryFrom, error, iter};
use structo... |
use std::convert::TryInto;
use std::ffi::OsStr;
use std::io::{self, Read, Write};
use std::time::Duration;
use log::{debug, trace, warn};
use num_enum::FromPrimitive;
use serialport::prelude::*;
use thiserror::Error;
use crate::bl::bootrom;
pub use crate::error::SerialError;
/// The serial settings expected by the B... |
use std::path;
use std::fs;
use std::io::{self, Seek};
use std::convert::TryFrom;
use crate::{error::Error, error::UnderlyingError, hash};
use super::{types::Snapshot, RepositorySnapshots, FileMetadata, SnapshotId, SnapshotLocation};
use crate::storage::stream::{WriteEggExt, ReadEggExt};
use byteorder::{ReadBytesExt,... |
extern crate cgmath;
extern crate rand;
pub mod geom;
pub mod map;
pub mod db;
pub mod unit;
pub mod dir;
pub mod game_state;
pub mod movement;
pub mod misc;
pub mod types;
pub mod check;
pub mod sector;
pub mod print_info;
pub mod position;
pub mod event;
pub mod player;
pub mod object;
pub mod options;
pub mod attac... |
#![allow(dead_code)]
use crate::errors::*;
use std::convert::From;
/// Size of the main DNS header, that includes flags and the size of each section.
pub const DNS_HEADER_SIZE: usize = 12;
/// Offset to the first (and usually only) record of the question section, from the start of the packet.
pub const DNS_QUESTION_... |
use std::ops::Div;
use bitvec::vec::BitVec;
use chrono::{Datelike, Local};
use crate::bmfont_renderer::BMFontRenderer;
use crate::caret::{Caret, CaretType};
use crate::common::{ControlFlags, Direction, FadeState};
use crate::engine_constants::EngineConstants;
use crate::framework::backend::BackendTexture;
use crate::... |
use crate::codec::{JsonCodec, JsonRpcCodec};
pub use anyhow::{anyhow, Context};
use futures::sink::SinkExt;
extern crate log;
use log::trace;
use std::collections::HashMap;
use std::future::Future;
use std::pin::Pin;
use std::sync::Arc;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::sync::Mutex;
use tokio_stream::S... |
//! This crate offers 2 (wasm-only) websocket clients.
//! The first client offered is the [`EventClient`]. This client is event based and gives you the most control.
//! ```
//! use console_error_panic_hook;
//! use console_log;
//! use log::{error, info, Level};
//! use std::panic;
//! use wasm_sockets::{self, WebSoc... |
use crate::{
event::ChartEvent,
reactive::StreamExt,
stock::Stock,
widgets::{SelectMenuState, TextFieldState},
};
use chrono::{DateTime, Datelike, Duration, Utc};
use derivative::Derivative;
use derive_more::{Display, From, Into};
use derive_new::new;
use math::round;
use once_cell::sync::Lazy;
use reac... |
use common::not_supported;
use cssparser::{
match_ignore_ascii_case, AtRuleParser, AtRuleType, CowRcStr, Parser, ParserState, QualifiedRuleParser,
RuleListParser, SourcePosition, Token, _cssparser_internal_to_lowercase,
};
use html5ever::Prefix;
use selectors::parser::SelectorParseErrorKind;
use selectors::SelectorLi... |
// Documentation for this 6502 implementation came from many sources, but the following
// two guides served as the primary inspiration:
// http://www.llx.com/~nparker/a2/opcodes.html - For opcode decoding structure
// http://nesdev.com/6502_cpu.txt - for information on cycle timings for each addressing mode
use addre... |
use super::ast::*;
use super::lexer::{Source, Token, TokenKind};
use std::error::Error;
use std::fmt;
#[derive(Debug)]
pub enum ParserError {
ExpectedExpressionInIf(Source),
ExpectedExpressionInWhile(Source),
ExpectedExpressionInRepeat(Source),
ExpectedToken(TokenKind),
UnexpectedToken(Token, Toke... |
#![feature(type_alias_impl_trait)]
use anyhow::{anyhow, bail, Context as ErrorContext, Result};
use std::{collections::HashMap, convert::TryFrom, fmt, str::FromStr};
use xmltree::{Element, XMLNode};
type ElementIterator<'a> = impl Iterator<Item = &'a Element>;
trait XmlHelper {
fn get_attribute(&self, attribute:... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Control Register"]
pub cr: CR,
#[doc = "0x04 - Master Mode Register"]
pub mmr: MMR,
#[doc = "0x08 - Slave Mode Register"]
pub smr: SMR,
#[doc = "0x0c - Internal Address Register"]
pub iadr: IADR,
#[doc =... |
use pulldown_cmark::{Alignment, Event, Options, Parser, Tag};
use crate::{Frame, Rect, Point, Align, WidthRelative, Color};
impl Frame {
/**
A text area widget that parses markdown text. Child themes need to be defined for each font / size
combination that you want to be able to render. This norm... |
use crate::wgpu::{self, TextureHandle};
use std::ops::Deref;
pub mod capturer;
pub mod image;
pub mod reshaper;
/// A convenient wrapper around a handle to a texture on the GPU along with its descriptor.
///
/// A texture can be thought of as an image that resides in GPU memory (as opposed to CPU memory).
///
/// Thi... |
//! Defines loss for training.
use super::{
misc::{BoxMetric, MatchGrid},
pred_target_matching::{CyCxHWMatcher, CyCxHWMatcherInit, MatchingOutput},
};
use crate::{common::*, profiling::Timing};
use tch_goodies::detection::{FlatIndex, FlatIndexTensor, MergedDenseDetection};
use tch_modules::{
BceWithLogitsL... |
mod decl;
mod expr;
mod stmt;
use std::collections::VecDeque;
use std::fmt;
use std::iter::Iterator;
use std::mem;
use std::rc::Rc;
use crate::data::{prelude::*, Scope};
type Lexeme = CompileResult<Locatable<Token>>;
pub(crate) type TagScope = Scope<InternedStr, TagEntry>;
type SyntaxResult<T = Expr> = Result<T, Lo... |
use crepe::crepe;
use log::*;
use std::marker::PhantomData;
use crate::bulletinboard::*;
use crate::crypto::base::Element;
use crate::crypto::base::Group;
use crate::crypto::hashing;
use crate::crypto::hashing::*;
use crate::protocol::facts::Act;
use crate::protocol::facts::{AllFacts, InputFact};
use crate::protocol::... |
// Copyright 2019 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::ie::*,
paste,
std::{
cmp::{max, min},
collections::HashSet,
ops::BitAnd,
},
zerocopy::LayoutVerifi... |
extern crate env_logger;
extern crate gfx_corell;
#[cfg(feature = "dx12")]
extern crate gfx_device_dx12ll as back;
#[cfg(feature = "vulkan")]
extern crate gfx_device_vulkanll as back;
#[cfg(feature = "metal")]
extern crate gfx_device_metalll as back;
extern crate winit;
extern crate image;
use gfx_corell::{buffer, co... |
// Copyright © 2021 Intel Corporation
//
// SPDX-License-Identifier: Apache-2.0
//
// bindgen /usr/include/linux/if_tun.h --no-layout-tests
/* automatically generated by rust-bindgen 0.58.1 */
#[repr(C)]
#[derive(Default)]
pub struct __IncompleteArrayField<T>(::std::marker::PhantomData<T>, [T; 0]);
impl<T> __Incompl... |
/*
* Copyright 2019 The Exonum 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 agreed... |
//! This module exists to implement the SHA-512 hash function, which is necessary
//! for Ed25519 signatures.
//!
//! This file tries to follow RFC 6234 (https://datatracker.ietf.org/doc/html/rfc6234).
use std::{convert::TryInto, mem::size_of};
// This is the number of bytes in our 512 bit hash.
pub const HASH_SIZE: ... |
#[derive(Clone, Debug, PartialEq)]
pub struct Ray {
pub pos: Vec3,
pub dir: Vec3,
}
impl Ray {
pub const fn new(pos: Vec3, dir: Vec3) -> Self {
Ray { pos, dir }
}
}
#[derive(PartialEq, Debug, Clone, Copy)]
pub struct Vec3 {
pub x: f32,
pub y: f32,
pub z: f32,
}
impl Vec3 {
pub c... |
//! Shadowsocks Server Context
#[cfg(feature = "local-dns-relay")]
use std::net::IpAddr;
#[cfg(any(feature = "local-dns-relay", feature = "acl-check-cache"))]
use std::time::Duration;
use std::{
io,
net::SocketAddr,
sync::{
atomic::{AtomicBool, Ordering},
Arc,
},
};
use bloomfilter::Bl... |
use crate::dh_installsystemd;
use crate::dh_lib;
use crate::error::*;
use crate::listener::Listener;
use crate::manifest::Config;
use crate::pathbytes::*;
use crate::tararchive::Archive;
use crate::util::{is_path_file, read_file_to_bytes};
use crate::wordsplit::WordSplit;
use dh_lib::ScriptFragments;
use md5::Digest;
u... |
//! Cuboid objects.
use crate::{
coord::{Coord, Direction, Periodic, Translate},
describe::{unwrap_name, Describe},
iterator::{ResidueIter, ResidueIterOut},
system::{Component, Residue},
volume::*,
};
use rand::seq::index::sample;
use serde_derive::{Deserialize, Serialize};
#[derive(Clone, Debug,... |
use common::bytesrepr::{deserialize, BytesRepr, Error as BytesReprError};
use common::key::Key;
use common::value::Value;
use storage::{Error as StorageError, ExecutionEffect, GlobalState, TrackingCopy};
use wasmi::memory_units::Pages;
use wasmi::{
Error as InterpreterError, Externals, FuncInstance, FuncRef, HostEr... |
use std::cmp;
use std::collections::HashMap;
use rand::{Rng, SeedableRng, StdRng};
use base::{Side, Offset};
use room::{Room, Path as RoomPath, Type as RoomType};
use room::door::{Door, Lock as DoorLock};
use entity::chest::Chest;
use entity::item::{Item, Key};
use entity::enemy::{Enemy, Type as EnemyType};
use entity... |
use crate::{
coords::{DeviceCoords, DeviceRect, Rect, ScreenCoords, ScreenRect, XYCoords, XYRect},
gui::AppContext,
};
use cairo::{Context, Format, ImageSurface, Matrix};
use gtk::{prelude::*, DrawingArea};
use std::cell::{Cell, RefCell};
pub trait PlotContext: Sized {
/// Set the width and height of the p... |
use crate::ftw_error::FtwError;
use crate::traits::{ToAppExt, ToCliArg, ToExportName, ToLibExt, ToLibPrefix};
use crate::type_alias::{AppExt, CliArg, ExportName, LibExt, LibPrefix};
use std::fmt;
use std::fmt::{Display, Formatter};
use std::str::FromStr;
use strum_macros::EnumIter;
#[derive(Clone, Copy, Debug, EnumIte... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the "hack" directory of this source tree.
use hhbc_by_ref_local as local;
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum CheckStarted {
IgnoreStarted,
CheckStarte... |
// Copyright 2021 <NAME>.
// Licensed under the MIT license (http://opensource.org/licenses/MIT)
// This file may not be copied, modified, or distributed except according
// to those terms.
extern crate chrono;
extern crate fern;
extern crate log;
extern crate niffler;
extern crate phf;
use anyhow::{anyhow, Context, ... |
//! SASL-based authentication support.
use hmac::{Hmac, Mac, NewMac};
use rand::{self, Rng};
use sha2::digest::FixedOutput;
use sha2::{Digest, Sha256};
use std::fmt::Write;
use std::io;
use std::iter;
use std::mem;
use std::str;
const NONCE_LENGTH: usize = 24;
/// The identifier of the SCRAM-SHA-256 SASL authenticat... |
use super::consts::*;
use super::enemy::Swat;
use crate::{
draw_map_layer, draw_shadowed_text, graphics, px_to_world, settings::Settings, Bulldozer,
Color, Context, Enemy, EnemyDozerBehavior, KeyCode, MainState, Matrix4, MouseButton, Player,
PlayerInput, Point2, Positional, RoundData, Vector2, Vector3, Visu... |
#![doc(html_logo_url = "https://avatars0.githubusercontent.com/u/52050279?s=200&v=4")]
// Copyright 2015-2019 Capital One Services, 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
//
... |
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
#![deny(clippy::disallowed_methods)]
#![deny(clippy::disallowed_types)]
use std::collections::BTreeMap;
use std::collections::HashMap;
use std::collections::HashSet;
use std::path::Path;
use std::path::PathBuf;
use analyze::get_top_level_decl... |
/*
* Copyright 2019 Comcast Cable Communications Management, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicab... |
use futures::{channel::oneshot, StreamExt};
use std::collections::{hash_map::Entry, HashMap, VecDeque};
use crate::{
extender::ExtenderUnit,
member::{NotificationIn, NotificationOut},
nodes::{NodeCount, NodeIndex, NodeMap},
units::{ControlHash, Unit, UnitCoord},
Hasher, Receiver, Round, Sender,
};
... |
use futures::executor::block_on;
use nestadia::Emulator;
use wgpu::util::DeviceExt;
use std::{
convert::TryFrom,
fs::OpenOptions,
io::{Read, Write},
path::Path,
time::{Duration, Instant},
};
use winit::{
event::*,
event_loop::{ControlFlow, EventLoop},
window::WindowBuilder,
};
use bit... |
extern crate quote;
extern crate syn;
extern crate walkdir;
use quote::{ToTokens};
use walkdir::{WalkDir};
use std::env;
use std::fs::{self, File};
use std::io::{Read, Write, BufWriter, Result as IoResult};
use std::path::{PathBuf};
use std::process::{Command};
use std::str::{from_utf8};
pub mod prelude {
pub use ... |
use std::collections::{HashSet};
use ldap3::{Scope, SearchEntry, SearchOptions, Ldap, Mod};
use ldap3::result::{LdapResult};
type CreateLdapAttrs<'a> = Vec<(&'a str, HashSet<&'a str>)>;
use crate::my_types::*;
use crate::my_err::{Result};
use crate::ldap_wrapper::{LdapW};
use crate::ldap_filter;
use crate::remote_quer... |
use std::collections::HashMap;
use std::fs::File;
use std::io::BufWriter;
use regex::Regex;
use svd_parser::encode::Encode;
use crate::common::{
build_svd, file_to_string, BitField, Bits, ChipType, Interrupt, Peripheral, Register, Type,
};
mod doc_input;
mod doc_parse;
pub use doc_parse::parse_doc;
pub const S... |
use crate::{
graph::{GraphWeight, IndexMap},
Graph, Weight,
};
#[derive(Debug, Clone, Default)]
pub struct CritClique {
pub vertices: Vec<usize>,
}
pub struct CritCliqueGraph {
pub cliques: Vec<CritClique>,
pub graph: Graph<Weight>,
}
impl CritCliqueGraph {
pub fn to_petgraph(&self) -> petgra... |
/*
* 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::codegen_ast::*;
use common::WithLocation;
use graphql_ir::{
Argument, Condition, ConditionValue, ConstantValue, Dire... |
use std::collections::{HashMap, HashSet};
use std::fmt::Debug;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use cpal::Sample;
use crossbeam_channel::Receiver;
use crate::alloc::{Alloc, AudioBuffer};
use crate::buffer::{ChannelConfig, ChannelCountMode};
use crate::message::ControlMessage;
use crat... |
use crate::interface::*;
use std::io::{ErrorKind, Read};
use std::net::TcpListener;
use std::net::{SocketAddr, TcpStream};
use std::sync::mpsc;
use std::sync::mpsc::{Receiver, SyncSender};
use std::sync::{Arc, Mutex};
use std::{fs, io, thread, process};
mod handshake;
mod music_exchange;
pub(crate) mod notification;
m... |
use std::collections::HashMap;
use std::fs::{read, File};
use std::io::BufWriter;
use std::io::Write;
use std::path::Path;
use std::sync::Mutex;
use crate::parsers::nom_utils::NomCustomError;
use anyhow::{anyhow, format_err, Context, Result};
use nom::multi::fold_many_m_n;
use nom::IResult;
use super::utils_parsing::... |
#[warn(unused_imports)]
extern crate rust_htslib;
extern crate bio_types;
extern crate libc;
// extern crate hdf5;
use rust_htslib::bam;
use rust_htslib::bam::Read;
use rust_htslib::bam::Record;
use std::io::{self, BufRead, Write};
use std::fs::File;
use std::collections::HashMap;
use std::slice;
use bio_types::strand... |
// 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... |
//! Simple library for build (non-full) REST microservice
//!
//! Is used async tokio runtime.
//!
//! To build runtime use method "get_runtime".
//!
//! To create executor use method "new", borrowing runtime and service.
//!
//! To add functions use functions "add_get_functions" and "add_post_functions".
//!
//! Funct... |
//! Clock configuration.
//!
//! This module provides functionality to configure the RCC to generate the requested clocks.
//!
//! # Example
//!
//! ```
//! let dp = pac::Peripherals::take().unwrap();
//! let clocks = rcc
//! .cfgr
//! .use_hse(8.mhz())
//! .sysclk(168.mhz())
//! .pclk1(24.mhz())
//! ... |
// Copyright (c) Facebook, Inc. and its affiliates.
use clap::{App, AppSettings, ArgMatches};
use serde::{Deserialize, Serialize};
use util::*;
use super::Params;
const HELP_BODY: &str = "\
Resource-control demo hash daemon.
[ OVERVIEW ]
rd-hashd is a workload simulator for resource control demonstration. Its
prima... |
use crate::ty::TypeList;
use parking_lot::RwLock;
use std::collections::HashMap;
use std::sync::Arc;
use dora_parser::ast;
use dora_parser::interner::Name;
use dora_parser::lexer::position::Position;
use crate::bytecode::BytecodeType;
use crate::gc::Address;
use crate::ty::BuiltinType;
use crate::utils::GrowableVec;... |
use failure::{bail, format_err, Error, Fallible};
use filedescriptor::{poll, pollfd, FileDescriptor, POLLIN};
use libc::{self, winsize};
use signal_hook::{self, SigId};
use std::collections::VecDeque;
use std::fs::OpenOptions;
use std::io::{stdin, stdout, Error as IoError, ErrorKind, Read, Write};
use std::mem;
use std... |
use crate::Editable;
use dotrix::{ Color, Camera, Frame, Input, World };
use dotrix::ecs::{ Const, Mut };
use dotrix::egui::{
CollapsingHeader,
DragValue,
Egui,
Grid,
ScrollArea,
SidePanel,
Slider,
};
use dotrix::input::{ Button, State as InputState };
use dotrix::math::Vec3;
use dotrix::ov... |
use cosmwasm_std::testing::{MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR};
use cosmwasm_std::{
from_binary, from_slice, to_binary, Api, CanonicalAddr, Coin, Decimal, Extern, HumanAddr,
Querier, QuerierResult, QueryRequest, SystemError, Uint128, WasmQuery,
};
use cosmwasm_storage::to_length_prefixed;
us... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.