text stringlengths 3.09k 13.9k |
|---|
use crate::{
consts::{ONE_THIRD, TWO_THIRDS},
fitting::{Likelihood, Score},
statistics::{Modes, Quantiles, ShannonEntropy, UnivariateMoments},
ContinuousDistribution,
Distribution,
Probability,
};
use rand;
use spaces::real::Interval;
use special_fun::FloatSpecial;
use std::fmt;
shape_params! {... |
use std::sync::Arc;
use light_arena::Allocator;
use log::{debug, error};
use crate::bounds::Bounds2i;
use crate::bsdf::BxDFType;
use crate::camera::Camera;
use crate::integrator::{uniform_sample_one_light, SamplerIntegrator};
use crate::lightdistrib::{LightDistribution, SpatialLightDistribution, UniformLightDistribut... |
//! Implementation of a CLI debugger for driving the emulator.
use std::io::{stdin, stdout, Write};
use faucon_asm::{get_spr_name, read_instruction, FalconError, RegisterKind};
use faucon_emu::cpu::Cpu;
use rustyline::{error::ReadlineError, Cmd, Config, Editor, KeyPress};
use commands::Command;
mod commands;
mod he... |
use super::algorithms;
use super::{CellId, Mesh, PointId};
use crate::shapes::GeoKind;
use std::collections::{HashMap, HashSet};
/// Aliases (usize,usize) as the key of edges
///
/// **Note:** Since the local numbering scheme runs over "corners" first,
/// we can compare edges using only two points; i.e., the middle p... |
use crate::cli::export::{ExportParams, ExportStrategy};
use crate::cli::import::ImportStrategy;
use crate::sampler::{Sampler, SamplerOutput};
use synth_core::graph::{json::synth_val_to_json, Value};
use synth_core::schema::{MergeStrategy, OptionalMergeStrategy};
use synth_core::{Content, Namespace};
use anyhow::{Cont... |
use crate::Error;
use byteorder::{BigEndian, ReadBytesExt};
use std::convert::TryInto;
use std::{
convert::TryFrom,
io::{BufRead, Read, Seek, SeekFrom},
};
#[derive(Debug, Clone)]
struct PartialAssetBundleHeader {
signature: Signature,
format_version: i32,
unity_version: String,
generator_versi... |
use cosmwasm_std::testing::{mock_env, MockApi, MockQuerier, MockStorage, MOCK_CONTRACT_ADDR};
use cosmwasm_std::{Addr, Decimal, Empty};
use cw20::Cw20ExecuteMsg;
use terra_mocks::TerraMockQuerier;
use terra_multi_test::{
App, AppBuilder, BankKeeper, Contract, ContractWrapper, Executor, TerraApp,
};
use terraswap::a... |
#[derive(Debug)]
pub struct FuzzyMatch {
score: u32,
matches: Vec<MatchedChar>,
}
impl FuzzyMatch {
const PATH_SEPARATORS: [char; 2] = ['/', '\\'];
const REGULAR_SEPARATORS: [char; 7] = ['_', '-', '.', ' ', '\'', '"', ':'];
pub fn new(query: &str, target: &str) -> FuzzyMatch {
if target.le... |
use crate::error::ShogiUtilError::CsaParseError;
use crate::piece::Piece;
use crate::{Color, Move, Result, Square};
use std::str::FromStr;
pub struct ParsedCsa {
pub names: [Option<String>; 2],
pub winner: Option<Color>,
pub moves: Vec<Move>,
}
pub fn parse_csa_string(csa_str: &str) -> Result<ParsedCsa> {... |
use crate::stat_funcs::{kth_stats_recur, mean, median_grouped, partition, pvariance, variance,
harmonic_mean};
use quickcheck::{quickcheck, TestResult};
// round number up to $digits digits, convenient for some tests below
macro_rules! round {
($x: expr, $digits: expr) => {
(($x * 10f64.powi($digits)) as f... |
use std::fmt::{Display, Formatter};
use jpar::characters::{read_none_of0, read_text, UCD_LINE_BREAK_WHITESPACE_CHARS};
use jpar::combinator::verify;
use jpar::helpers::map_result;
use jpar::sequence::preceded;
use jpar::verifiers::interval_verifier;
use jpar::Span;
use crate::parsers::{ParserInput, ParserNode, Parser... |
#![cfg_attr(not(feature = "std"), no_std)]
use codec::{Decode, Encode};
use frame_support::{
decl_error, decl_event, decl_module, decl_storage, dispatch, ensure, fail, traits::Get,
};
use frame_system::ensure_signed;
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
/// Configure the pallet by specifying the paramete... |
// vim: tw=80
#[cfg(not(test))]
use crate::vdev::Vdev;
use crate::{Error, Uuid, cache, database, ddml, idml, label, pool, raid};
use futures::{
Future,
StreamExt,
TryFutureExt,
TryStreamExt,
stream::{self, FuturesOrdered},
};
use std::{
collections::BTreeMap,
path::PathBuf,
sync::{Arc, ... |
//
// Copyright 2019 The Project Oak Authors
//
// 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 o... |
use crate::{
commitment::pedersen::{Commitment, Parameters, Randomness},
crh::pedersen::Window,
Vec,
};
use ark_ec::ProjectiveCurve;
use ark_ff::{
fields::{Field, PrimeField},
to_bytes, Zero,
};
use ark_relations::r1cs::{Namespace, SynthesisError};
use ark_r1cs_std::prelude::*;
use core::{borrow::B... |
// G Sprite Editor - Main Application
// by <NAME>, 2020
use crate::*;
use std::{
rc::Rc,
};
pub struct Application {
_ui: Rc<e::UI>,
edit_canvas: EditCanvas,
// needs collection of open documents with associated edit_canvases in the book
}
impl Application {
pub fn new(ui: &Rc<e::UI>) -> Result<... |
use crate::clean::{self, PrimitiveType};
use crate::html::sources;
use rustc_data_structures::fx::FxHashMap;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::def_id::DefId;
use rustc_hir::intravisit::{self, Visitor};
use rustc_hir::{ExprKind, HirId, Mod, Node};
use rustc_middle::hir::nested_filter;
use rustc_middle:... |
use aoc2019::computer::*;
use aoc2019::*;
use std::collections::{HashSet, VecDeque};
use std::convert::TryFrom;
#[derive(Debug, Copy, Clone, Eq, PartialEq, Hash)]
enum Direction {
N = 1,
S = 2,
W = 3,
E = 4,
}
use Direction::*;
impl Direction {
fn to_move_cmd(self) -> String {
match self {... |
// https://github.com/rust-lang/rust/issues/50297 would hopefully obsolete this approach.
use gag::Redirect;
use map_model::{BuildingID, LaneID};
use rand_xorshift::XorShiftRng;
use sim::{CarID, ParkingSpot, Scenario, Sim};
use std::io::Write;
use termion;
use termion::color;
pub struct Flags {
// Which tests to ... |
use futures_signals::{
map_ref,
signal::{Mutable, ReadOnlyMutable, Signal},
signal_vec::MutableVec,
};
use utils::prelude::TransformExt;
use std::rc::Rc;
use super::{callbacks::Callbacks, sprite::state::Sprite, text::state::Text, video::state::Video};
use crate::{text_editor::state::State as TextEditorSta... |
// 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 {
failure::{format_err, Error, ResultExt},
fidl::endpoints,
fidl_fuchsia_vsock::{
AcceptorMarker, AcceptorRequest, ConnectionMarker... |
//! This is a simple, back-end agnostic analytics client for Rust.
//!
//! There are two main exported entry-points to this crate:
//!
//! * [`AnalyticsWorker`] is a background worker which will report events on a debounced manner
//! (or once a certain batch size is reached ; 20 by default)
//! * [`AnalyticsClient`]... |
use if_chain::if_chain;
use rustc_errors::Applicability;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::{def, BindingAnnotation, Block, Expr, ExprKind, MatchSource, PatKind, StmtKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::sym;
use c... |
pub mod general;
pub mod swd;
pub mod swj;
pub mod swo;
pub mod transfer;
use crate::architecture::arm::DapError;
use crate::DebugProbeError;
use core::ops::Deref;
use std::time::Duration;
use anyhow::{anyhow, Context, Result};
use thiserror::Error;
#[derive(Debug, Error)]
pub enum CmsisDapError {
#[error("Unexp... |
/// A struct `Scan` is defined here which wraps the concept of UTXO-set
/// scanning in a Rust-based struct interface.
use crate::node_interface::NodeInterface;
pub use crate::node_interface::{NodeError, Result};
use crate::{P2PKAddressString, ScanID};
use ergo_lib::ergotree_ir::chain::ergo_box::ErgoBox;
use json;
use ... |
//! Components wrapped with context including properties, state, and link
mod children;
#[cfg(any(feature = "csr", feature = "ssr"))]
mod lifecycle;
mod marker;
mod properties;
mod scope;
use super::{Html, HtmlResult, IntoHtmlResult};
pub use children::*;
pub use marker::*;
pub use properties::*;
#[cfg(feature = "cs... |
// SPDX-License-Identifier: MIT
use byteorder::{ByteOrder, NativeEndian};
use crate::{
traits::{Emitable, Parseable},
DecodeError,
Field,
};
const MASK: Field = 0..4;
const ENABLED: Field = 4..8;
const FAILURE: Field = 8..12;
const PID: Field = 12..16;
const RATE_LIMITING: Field = 16..20;
const BACKLOG_L... |
//! OpenGL Extensions.
#![allow(non_camel_case_types, dead_code, unused_variables, improper_ctypes, non_upper_case_globals)]
use libc::{c_void, size_t};
use cl_h::{cl_context_properties, cl_int, cl_uint};
#[cfg(not(feature="opencl_vendor_mesa"))]
use platform_h::{cl_GLuint, cl_GLint, cl_GLenum};
#[cfg(not(feature="o... |
//! Discover other peers in the same network with UDP broadcast.
//!
//! This module uses a very simple UDP broadcast and reply approach to find a contact addr to a
//! peer-to-peer network. This address can then be used to bootstrap the join process.
//! The probing packet consists of [version, 0x00, 0x00, 0x01], allo... |
//! Contains all structures and methods to create and manage 2D scenes.
//!
//! A `Scene` is a container for graph nodes, animations and physics.
use crate::physics2d::PhysicsPerformanceStatistics;
use crate::physics2d::RigidBodyHandle;
use crate::{
core::{
algebra::{Isometry2, Translation2, Vector2},
... |
use crate::associations::HasTable;
#[cfg(any(feature = "sqlite", feature = "mysql"))]
use crate::associations::Identifiable;
use crate::connection::Connection;
#[cfg(any(feature = "sqlite", feature = "mysql"))]
use crate::dsl::Find;
#[cfg(any(feature = "sqlite", feature = "postgres", feature = "mysql"))]
use crate::dsl... |
//! A modal for showing elements as an overlay on top of another.
//!
//! *This API requires the following crate features to be activated: modal*
use iced_native::{
event, keyboard, layout::Limits, mouse, overlay, renderer, touch, widget::Container, Clipboard,
Color, Element, Event, Layout, Length, Point, Shell... |
use crate::cmd::cache::{cache_exists, send_response_from_cache, SendResponse};
use crate::light_command::{set_current_dir, LightCommand};
use crate::utils::is_git_repo;
use crate::ContentFiltering;
use anyhow::{Context, Result};
use fuzzy_filter::{subprocess::Exec, Source};
use icon::IconPainter;
use std::path::PathBuf... |
//! Utility functions not uniquely related to DLC
use bitcoin::hashes::Hash;
use bitcoin::util::bip143::SigHashCache;
use bitcoin::{
blockdata::script::Builder, hash_types::PubkeyHash, util::address::Payload, Script,
SigHashType, Transaction,
};
use secp256k1::{Message, PublicKey, Secp256k1, SecretKey, Signatu... |
use crate::{CloneCounter, Server};
use std::marker::PhantomData;
use trillium::Handler;
use trillium_http::Stopper;
use trillium_tls_common::Acceptor;
/**
# Primary entrypoint for configuring and running a trillium server
The associated methods on this struct are intended to be chained.
## Example
```rust,no_run
tri... |
use anyhow::{bail, Result};
use clap::{Arg, ArgMatches, Command};
use lazy_static::lazy_static;
use regex::Regex;
use crate::api::{Api, NewRelease, NoneReleaseInfo, OptionalReleaseInfo, UpdatedRelease};
use crate::config::Config;
use crate::utils::args::{validate_int, ArgExt};
use crate::utils::formatting::Table;
use ... |
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
/// Deserialization utilities for certain values in OTP HJSON files.
///
/// The OTP HJSON files have some strange values:
///
/// Integers, sometimes wrapped in strings... |
use std::{collections::HashMap, sync::Arc};
use either::Either;
use locutus_runtime::prelude::ContractKey;
use tokio::sync::mpsc::{self, Receiver};
use super::{
client_event_handling, conn_manager::in_memory::MemoryConnManager,
event_listener::EventListener, handle_cancelled_op, join_ring_request, op_state::O... |
use std::error::Error;
use std::fmt;
use std::fs::{self, File, OpenOptions};
use std::io::{self, BufWriter, Stderr, Write};
use std::path::{Path, PathBuf};
use std::sync::Mutex;
use encode::writer::console::ConsoleWriter;
use encode::writer::simple::SimpleWriter;
use log::{error, Level, LevelFilter, Record};
use log4r... |
use crate::Msg;
use seed::prelude::*;
use std::convert::TryInto;
use num_bigint::{BigUint, ToBigUint};
use num_traits::pow;
mod fermat_utils {
pub struct Fermat<'a> {
pub n: u64,
pub f: u64,
pub digits: u64,
pub prime_factors: &'a str,
pub download: &'a str,
}
pub ... |
use super::recycle_metadata;
use chrono::{DateTime, Utc};
use futures::stream::BoxStream;
use shared::domain::{
category::CategoryId,
image::{Image, ImageId, ImageKind},
meta::{AffiliationId, AgeRangeId, StyleId},
};
use sqlx::{PgConnection, PgPool};
use uuid::Uuid;
pub mod user {
use futures::stream::... |
use std::io::{Error, ErrorKind, Read, stdin, stdout, Write};
use std::net::TcpStream;
use std::process;
use std::process::Stdio;
use std::sync::mpsc::channel;
use std::thread;
use crate::config::{Configuration, PathDefinition, ProcessRole};
use crate::file_transfer::*;
use crate::server::Server;
use crate::tree::Manif... |
use super::transformer::{TransformContext, TransformResult, Transformer, TransformerInitContext};
use serde::{Deserialize, Serialize};
mod none;
pub use none::NoneTransformer;
mod internet;
pub use internet::{EmailKind, EmailTransformer, IpTransformer, PasswordTransformer};
mod phone;
pub use phone::PhoneTransformer... |
use std::ops::{Deref, DerefMut};
use std::os::raw::c_char;
use std::sync::Once;
use crate::declare::{ClassDecl, ProtocolDecl};
use crate::runtime::{self, Class, Object, Protocol, Sel};
use crate::{Encode, Encoding};
pub struct CustomObject {
obj: *mut Object,
}
impl CustomObject {
fn new(class: &Class) -> Se... |
use napi::bindgen_prelude::*;
use napi::sys::{napi_env, napi_value};
use napi_derive::napi;
use serde_json::Value;
use std::collections::HashMap;
use three_em_arweave::arweave::Arweave;
use three_em_arweave::cache::ArweaveCache;
use three_em_arweave::cache::CacheExt;
use three_em_arweave::gql_result::{GQLEdgeInterface,... |
#![deny(warnings)]
#![warn(clippy::all)]
#![allow(clippy::single_match)]
mod painter;
pub use painter::Painter;
use {
clipboard::{ClipboardContext, ClipboardProvider},
egui::*,
glium::glutin::{self, VirtualKeyCode},
};
pub fn init_clipboard() -> Option<ClipboardContext> {
match ClipboardContext::new(... |
use std::collections::{HashMap, HashSet};
use std::fs::{self, File};
use std::io::{prelude::*, SeekFrom};
use std::path::{Path, PathBuf};
use crate::support::git::{repo, Repository};
use crate::support::registry::alt_api_path;
use crate::support::{find_json_mismatch, paths};
use byteorder::{LittleEndian, ReadBytesExt... |
/*
MIT License
Copyright (c) 2021 <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... |
use crate::{
common::code_block,
types::{FullFilter, PanicOnEmpty, Retirable, StringOrArray},
};
use std::collections::{BTreeMap, HashSet};
#[derive(Debug)]
pub struct FilterGenerator<'a> {
name: &'a str,
domain_folder: String,
filters: BTreeMap<String, FullFilter<Vec<String>>>,
begin_with_else... |
use crate::metrics::{AtomicNumber, Descriptor, MetricsError, Number, NumberKind, Result};
use crate::sdk::{
export::metrics::{Count, Distribution, Max, Min, MinMaxSumCount, Points, Quantile, Sum},
metrics::Aggregator,
};
use std::any::Any;
use std::mem;
use std::sync::{Arc, Mutex};
/// Create a new default `Ar... |
//! Functionality for using `serde_qs` with `actix_web`.
//!
//! Enable with the `actix` feature.
use crate::de::Config as QsConfig;
use crate::error::Error as QsError;
#[cfg(feature = "actix")]
use actix_web;
#[cfg(feature = "actix2")]
use actix_web2 as actix_web;
#[cfg(feature = "actixbeta")]
use actix_web_beta as ... |
use super::*;
use crate::{data::*, logging::*, *};
use bytes::Bytes;
use futures::{
prelude::*,
stream::{SplitSink, SplitStream},
};
use serde::{de::DeserializeOwned, Serialize};
use std::{
marker::PhantomData,
net::{IpAddr, Ipv4Addr},
time::Duration,
};
use tokio::{net::*, time};
use tokio_util::co... |
#[macro_use]
extern crate error_chain;
extern crate futures;
extern crate getopts;
extern crate pretty_env_logger;
extern crate tokio_core;
#[macro_use]
extern crate tokio_kafka;
use std::cmp;
use std::collections::HashMap;
use std::env;
use std::path::Path;
use std::process;
use std::rc::Rc;
use getopts::Options;
u... |
use std::{
fmt::{self, Display},
ops::Range,
path::Path,
rc::Rc,
};
use core_extensions::{SelfOps, StringExt};
use proc_macro2::TokenStream as TokenStream2;
use serde::Deserialize;
mod regex_wrapper;
mod text_replacement;
mod vec_from_map;
use self::regex_wrapper::RegexWrapper;
use self::text_repla... |
use crate::{
config::{CONFIGURATION, PROGRESS_PRINTER},
utils::{ferox_print, make_request, open_file},
FeroxChannel, FeroxResponse, FeroxSerialize,
};
use console::strip_ansi_codes;
use std::io::Write;
use std::sync::{Arc, Once, RwLock};
use std::{fs, io};
use tokio::sync::mpsc::{self, UnboundedReceiver, Un... |
use itertools::Itertools;
pub fn best_matches<T>(sequence: &str, values: T) -> Vec<T::Item>
where
T: IntoIterator,
T::Item: AsRef<str> + Clone,
{
let matcher = SequenceMatcher::new(sequence);
matcher.order_by(values, |v| v.to_owned())
}
pub fn best_matches_by<'a, T, F, K>(sequence: &str, values: T, to... |
use std::io::{self, Read};
fn main() {
let mut input = String::new();
io::stdin().read_to_string(&mut input)
.expect("Failed to read input");
let output = decompress(&input);
println!("{}", output.len());
}
fn decompress(input: &str) -> String {
let mut result = String::new();
let mut scanner = Scanner::new(... |
use bytes::{BufMut, IntoBuf};
use futures::{Async, Future, Poll};
use http::HeaderMap;
use hyper::client::connect::Connected;
use io_err;
use std::fmt::{self, Display, Formatter};
use std::io::{self, Cursor};
use tokio_io::{AsyncRead, AsyncWrite};
pub(crate) struct TunnelConnect {
buf: Vec<u8>,
}
impl TunnelConne... |
// Copyright (c) 2016 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
use async_trait::async_trait;
use color_eyre::{eyre::eyre, Result};
use serde::Deserialize;
use tracing::{debug, instrument};
use url::Url;
use super::VersionCheck;
use crate::version::LenientVersion;
use crate::{package::VERSION_PLACEHOLDER, CLIENT};
#[derive(Debug)]
pub struct Github {
github_base_url: String,... |
use std::any::Any;
use std::collections::HashMap;
use criterion::{black_box, criterion_group, criterion_main, Criterion};
use pyo3::prelude::*;
use pyo3::types::*;
type Elements<'a> = (
(&'a str, usize),
(&'a str, &'a str),
(&'a str, &'a str),
(&'a str, Vec<u8>),
(&'a str, usize),
(&'a str, &'... |
use serde::{Deserialize, Serialize};
use strum_macros::EnumIter;
/// Valid ways how `Reedline::read_line()` can return
#[derive(Debug)]
pub enum Signal {
/// Entry succeeded with the provided content
Success(String),
/// Entry was aborted with `Ctrl+C`
CtrlC, // Interrupt current editing
/// Abort ... |
use crate::{Akaze, EvolutionStep, KeyPoint};
use bitarray::BitArray;
impl Akaze {
/// Extract descriptors from keypoints/an evolution
///
/// # Arguments
/// * `evolutions` - the nonlinear scale space
/// * `keypoints` - the keypoints detected.
/// * `options` - The options of the nonlinear sca... |
//! Parameters for the cryptographic primitives supported by the system.
use helpers::Binary;
/// Encryption (or ciphertext).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
pub enum Encryption {
/// Standard sodium encryption (Curve25519, XSalsa20, Poly1305).
Sodium(Binary)
}
/// Encryption key ... |
/*
* Copyright (c) 2021, <NAME>.
*
* 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 discla... |
use crate::{Error, Request, ResponseLazy};
#[cfg(feature = "https")]
use native_tls::{TlsConnector, TlsStream};
use std::env;
use std::io::{self, BufReader, BufWriter, Read, Write};
use std::net::TcpStream;
use std::time::{Duration, Instant};
type UnsecuredStream = BufReader<TcpStream>;
#[cfg(feature = "https")]
type ... |
#![allow(dead_code)]
use serde_json::Value;
use std::error::Error;
use std::time::Duration;
use assert_json_diff::assert_json_eq;
use async_std::io::prelude::*;
use async_std::task::{block_on, sleep};
use http_service::Body;
use http_service_mock::{make_server, TestBackend};
use meilisearch_http::data::Data;
use meil... |
use snake::Snake;
use state::WorldState;
use nalgebra::{Point2, Vector2};
use ncollide::shape::{Cuboid, Ball};
use ncollide::query::{Ray, RayCast};
use nalgebra::Isometry2;
use std;
#[allow(unused)]
/// Return a vector of all senses experienced by snake: &Snake in the world: &WorldState
pub fn get(snake: &Snake, world... |
// Copyright 2017 The Australian National University
//
// 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... |
// SPDX-License-Identifier: Apache-2.0
// Copyright © 2021 <NAME>
use core::convert::TryFrom;
use num_enum::{IntoPrimitive, TryFromPrimitive, TryFromPrimitiveError};
use crate::address_enum_ops;
use crate::common::Address;
/// EEPROM addresses for the MLX90640
// NOTE: To make it easier to compare against the datas... |
extern crate nom;
use nom::{
branch::alt,
bytes::complete::tag,
bytes::complete::take_while,
character::complete::{alpha1, char},
combinator::map,
multi::many0,
number::complete::double,
sequence::{delimited, preceded, tuple},
IResult,
};
#[derive(Debug, PartialEq)]
pub enum ParsedF... |
use chrono::{DateTime, TimeZone, Timelike, Utc};
use nom::types::CompleteStr;
use nom::{alt, call, do_parse, error_position, map_res, named, tag, take_while, value};
use std::collections::HashMap;
use std::str::FromStr;
/* examples:
* [1518-11-01 23:58] Guard #99 begins shift
* [1518-11-02 00:40] falls asleep
* [15... |
use std::{fmt::Debug, iter::Sum};
use num_traits::Float;
use statrs::distribution::{ContinuousCDF, StudentsT};
use crate::{Result, WordleError};
#[allow(dead_code)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub(crate) enum Tails {
One,
Two,
}
impl Tails {
fn factor<N: Float>(&self) -... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
use aes_gcm::Aes256Gcm;
use core::{
cmp::Ordering,
fmt::{Display, Formatter, Result as FmtResult},
hash::{Hash, Hasher},
};
use mc_attest_ake::{AuthResponseInput, ClientInitiate, Ready, Start, Transition};
use mc_attest_api::attest::{AuthMessage, Message... |
// Copyright 2020-2021 The Datafuse Authors.
//
// SPDX-License-Identifier: Apache-2.0.
use std::sync::Arc;
use common_arrow::arrow;
use common_arrow::arrow::array::Array;
use common_arrow::arrow::array::ArrayRef;
use common_arrow::arrow::array::TimestampMicrosecondArray;
use common_arrow::arrow::array::TimestampMill... |
//! Re-exporting x86_64 crate items and some additional definitions
pub use x86_64::instructions::hlt;
pub use x86_64::instructions::interrupts;
pub use x86_64::instructions::port::{Port, PortRead, PortWrite, PortWriteOnly};
pub use x86_64::instructions::segmentation::{Segment, CS, DS, ES, FS, GS, SS};
pub use x86_64:... |
use std::{
collections::{BTreeMap, HashMap},
env, fs,
path::Path,
};
use anyhow::{Context, Result};
use async_recursion::async_recursion;
use bytes::{buf::Reader, Buf, Bytes};
use flate2::read::GzDecoder;
use node_semver::{Range, Version};
use tar::Archive;
use crate::{
definitions::{ResolvedPackage, ... |
#![cfg_attr(not(feature = "std"), no_std)]
use ink_lang as ink;
use ink_env::Environment;
#[ink::chain_extension]
pub trait FetchRandom {
type ErrorCode = RandomReadErr;
/// Note: this gives the operation a corresponding `func_id` (1101 in this case),
/// and the chain-side chain extension will get the `... |
// Copyright 2020 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.
use std::fs::File;
use std::io::Read;
use std::marker::PhantomData;
use std::mem;
use std::os::raw::c_void;
use std::os::unix::io::FromRawFd;
use supe... |
/*
* Copyright 2019 <NAME>
* Copyright 2020 BDK 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 applic... |
extern crate criterion;
extern crate querable;
use std::collections::HashMap;
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion};
use querable::{
default::{DefaultTokenizer, SlashTokenizer},
error::Error,
kind::QueryKind,
types::Queryable,
};
#[derive(Debug, Clone, PartialEq)]
... |
//! Backend for Go
use backend::PackageProcessor;
use core::errors::*;
use core::{Handle, Loc, RelativePathBuf};
use flavored::{
GoFlavor, GoName, RpEnumBody, RpField, RpInterfaceBody, RpPackage, RpTupleBody, RpTypeBody,
};
use genco::go::Go;
use genco::{IntoTokens, Tokens};
use trans::{self, Translated};
use {Enu... |
use dada_collections::Map;
use dada_ir::{
code::bir,
in_ir_db::InIrDbExt,
storage::{Joint, Leased},
};
use salsa::DebugWithDb;
use crate::{
ext::DadaExecuteClassExt,
machine::{
op::MachineOp, Frame, Object, ObjectData, Permission, PermissionData, Reservation, Value,
},
};
use super::Re... |
// Copyright 2015-2019 pam-auth Developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://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 accord... |
use crate::bits::LEFT_MASKS;
use crate::errors::{QCompressError, QCompressResult};
use crate::data_types::UnsignedLike;
use crate::constants::{BITS_TO_ENCODE_N_ENTRIES, MAX_ENTRIES};
/// `BitWriter` builds a `Vec<u8>`, enabling a compressor to write bit-level
/// information and maintain its position in the bytes.
///... |
use chrono::DateTime;
use std::fs;
struct ArgIds {
server_url_temp_id: usize,
genesis_state_path_temp_id: usize,
rpc_url_temp_id: usize,
}
pub enum NodeOptionVariables {
AbciServerUrl,
AbciGenesisStatePath,
AbciRPCUrl,
}
pub struct GenesisInfo {
pub time_seconds: i64,
pub time_nanos: ... |
use super::Parameter;
use ethane_types::Address;
use std::convert::TryFrom;
use std::fmt;
use std::str;
impl fmt::Display for Parameter {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
match self {
// data is stored in a H256 type on 32 bytes, so right padded 20
... |
// Copyright 2018 Developers of the Rand project.
// Copyright 2013 The Rust Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This fil... |
use aoc::prelude::*;
use nom::{
bits::complete::{tag, take},
branch::alt,
combinator::map_opt,
multi::many_till,
sequence::{pair, preceded},
IResult, Parser,
};
#[derive(PartialEq, Eq, Debug)]
struct Packet {
version: u8,
op: Op,
}
impl Packet {
pub fn new(version: u8, op: Op) -> P... |
use crate::utils::{ErrorKind, Result};
use base64;
use dirs::home_dir;
use rpassword::prompt_password_stdout;
use std::collections::HashSet;
use std::io::{stdin, stdout, Write};
use std::net::TcpStream;
/// Create an authenticated `ssh2::Session`.
pub fn create_session(
destination: &str,
username: &str,
p... |
use chrono;
use reqwest::header::{ContentType, Headers};
use super::dav_methods::*;
use super::parser;
use super::{DavClient, DavConfig, StorageType, XmlTag};
use storage::http::HttpConfig;
use storage::utils::generate_href;
use storage::{ConfigurableStorage, Metadata, Storage, StorageConfig};
use errors::*;
use ite... |
use futures::sink;
use futures::sync::mpsc;
use futures::{Async, AsyncSink, Future, Poll, Sink, Stream};
use postgres_protocol::message::backend::Message;
use postgres_protocol::message::frontend;
use state_machine_future::RentToOwn;
use std::error::Error as StdError;
use proto::client::{Client, PendingRequest};
use p... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
use super::{
cache::ArpCache,
pdu::{ArpOp, ArpPdu},
};
use crate::{
prelude::*,
protocols::ethernet2::{self, MacAddress},
};
use fxhash::FxHashMap;
use std::{
cell::RefCell, convert::TryFrom, mem::swap, net::Ipv4Addr, rc::Rc... |
#![allow(non_snake_case, non_upper_case_globals)]
#![allow(non_camel_case_types)]
//! USB on the go high speed
//!
//! Used by: stm32f215, stm32f217
#[cfg(not(feature = "nosync"))]
pub use crate::stm32f2::peripherals::otg_hs_global::Instance;
pub use crate::stm32f2::peripherals::otg_hs_global::{RegisterBlock, ResetVal... |
use std::borrow::Borrow;
use bit_array::BitArray;
use chrono::prelude::*;
use chrono::Duration;
use rand::prelude::SliceRandom;
use rand::Rng;
use rppal::gpio::{Gpio, OutputPin};
use rppal::spi::{Bus, Mode, SlaveSelect, Spi};
use rppal::system::DeviceInfo;
use std::error::Error;
use std::sync::{Arc, RwLock};
use std::t... |
/*
* Copyright 2021 Fluence Labs Limited
*
* 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 a... |
//! Attack of the Blobs
//! Roguelike game binary
//!
//! <NAME> CS410 - June 2021
use rltk::{GameState, Point, Rltk, RGB};
use specs::prelude::*;
mod components;
pub use components::*;
mod map;
pub use map::*;
mod map_index;
pub use map_index::*;
mod player;
use player::*;
mod rect;
pub use rect::Rect;
mod blob;
pub... |
use crate::{control, lines, State, tls};
use ellidri_tokens::Message;
use std::net::SocketAddr;
use std::str;
use tokio::sync::mpsc;
use tokio::{io, net, sync, time};
use tokio::io::{AsyncBufReadExt, AsyncReadExt};
#[cfg(feature = "tls")]
const TLS_TIMEOUT_SECS: u64 = 30;
const MAX_MESSAGE_LENGTH: u64 = 4096;
/// Re... |
use core::cell::RefCell;
use lerp::Lerp;
use std::any::Any;
use std::f64::consts::PI;
use std::rc::Rc;
use crate::constants::{NORMAL_WIDTH, SEGMENTS};
use crate::exit;
use crate::graphics::Graphics;
use crate::types::Point;
use crate::utils::{ease_in_out_quad, get_canvas, get_ctx};
pub struct WaveGraphics {
ctx: ... |
#![allow(dead_code)]
mod definition;
mod diag;
mod hover;
mod inlay_hints;
mod outline;
mod proof;
mod references;
mod rope_ext;
mod server;
mod show_proof;
mod types;
mod util;
mod vfs;
use crate::server::SERVER;
use clap::{App, Arg};
use crossbeam::channel::SendError;
use log::*;
use std::error::Error;
use std::str... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.