text stringlengths 3.09k 13.9k |
|---|
//!
//! The contract resource POST method `initialize` module.
//!
pub mod error;
pub mod request;
pub mod response;
use std::sync::Arc;
use std::sync::RwLock;
use std::time::Duration;
use actix_web::http::StatusCode;
use actix_web::web;
use zksync::operations::SyncTransactionHandle;
use zksync_eth_signer::PrivateK... |
//! Example that definitely works on Raspberry Pi.
//! Make sure you have "SPI" on your Pi enabled and that MOSI-Pin is connected
//! with DIN-Pin. You just need DIN pin, no clock. WS2818 uses one-wire-protocol.
//! See the specification for details
use std::ops::Add;
use std::time::{Duration, Instant};
use ws2818_exa... |
mod events;
mod focus;
mod highlight;
mod mouse;
mod selection;
use std::marker::PhantomData;
pub use crate::{
events::{event_debug_system, mesh_events_system, HoverEvent, PickingEvent, SelectionEvent},
focus::{mesh_focus, pause_for_picking_blockers, Hover, PickingBlocker},
highlight::{
get_initia... |
use crate::regex;
use crate::sysinfo;
use crate::mlua;
use crate::errors;
use crate::assets;
use crate::assets::defaults;
pub(crate) mod kernel;
pub(crate) mod context;
pub(crate) mod distro;
pub(crate) mod uptime;
pub(crate) mod package_managers;
pub(crate) mod shell;
pub(crate) mod resolution;
pub(crate) mod wm;
pub... |
use crate::TrainOptions;
use itertools::Itertools;
use num::ToPrimitive;
use rayon::prelude::*;
use std::{cmp::Ordering, collections::BTreeMap};
use tangram_finite::Finite;
use tangram_table::{NumberTableColumnView, TableColumnView, TableView};
use tangram_zip::zip;
/*
This struct specifies how to produce a binned fea... |
use crate::pk::PrimaryKey;
use crate::*;
use itertools::Itertools;
use once_cell::sync::OnceCell;
use std::{
collections::BTreeSet,
sync::{Arc, Weak},
};
#[derive(Debug, Clone)]
pub struct Fields {
pub all: Vec<Field>,
primary_key: Option<PrimaryKey>,
scalar: OnceCell<Vec<ScalarFieldWeak>>,
rel... |
// 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_fuchsia_bluetooth as btfidl, fidl_fuchsia_bluetooth_sys as sys,
fuchsia_bluetooth::types::{Peer, PeerId},
log::{info, warn},
par... |
use super::conversion_error::ConversionError;
use graphql_parser::schema::{Field, ObjectType, Text, Type, Value};
// use rustc_hash::FxHashMap;
use crate::implicit_model::{ImplicitField, Type as ImplicitType};
use std::rc::Rc;
pub fn convert_field<'a, T: Text<'a>>(
field: &Field<'a, T>,
object: &ObjectType<'a, T>... |
use crate::config::Response;
use crate::error::{Error, ErrorResponse, RequestError};
use crate::params::Headers;
use futures::future::{self, Future};
use futures::stream::Stream;
use reqwest::header::{HeaderMap, HeaderName, HeaderValue};
use reqwest::r#async::RequestBuilder;
use serde::de::DeserializeOwned;
#[derive(C... |
mod defines;
pub use defines::*;
/// (*mut AflState) Contains the state that most afl plugins need to function
pub const STORE_AFL_GLOBALS: &str = "afl_globals";
/// (*mut Vec<AflQueueEntry>) Holds AFL specific information about the current inputs
pub const STORE_AFL_QUEUE: &str = "afl_queue";
/// (*mut [u8; MAP_SIZE]... |
use compiler::{Config, DisplayColor, Driver, PathOrInline, RelativePathBuf};
use runtime::{Runtime, RuntimeBuilder};
use std::{
cell::{Ref, RefCell},
path::{Path, PathBuf},
rc::Rc,
thread::sleep,
time::{Duration, Instant},
};
/// Implements a compiler that generates and temporarily stores a `*.munl... |
use std::env;
use std::ffi::OsString;
use std::path::Path;
use std::process::Command;
use crate::Error;
static DEFAULT_TRASH: &str = "gio";
pub fn is_implemented() -> bool {
true
}
/// This is based on the electron library's implementation.
/// See: https://github.com/electron/electron/blob/34c4c8d5088fa183f56baea... |
// (c) 2016-2018 <NAME> <<EMAIL>>
#![feature(specialization, const_fn, try_from)]
extern crate cairo;
extern crate chrono;
extern crate clap;
extern crate env_logger;
extern crate gdk_pixbuf;
extern crate gio;
extern crate glib;
extern crate gtk;
extern crate inotify;
#[macro_use]
extern crate lazy_static;
#[macro_us... |
use std::path::Path;
use sdl2::render::Texture as SdlTexture;
use crate::{Color, Point, Rect, Surface, TextureValueError, ENGINE, NOT_INIT};
#[cfg(not(feature = "image"))]
mod error;
#[cfg(not(feature = "image"))]
use error::LoadTextureError;
/// A (potentially hardware accelerated) renderable texture.
pub struct T... |
//! Language specialization for genco
//!
//! This module contains sub-modules which provide implementations of the [Lang]
//! trait to configure genco for various programming languages.
//!
//! This module also provides a dummy [Lang] implementation for `()`.
//!
//! This allows `()` to be used as a quick and dirty wa... |
#![recursion_limit = "128"]
// TODO update to Rust 2018
// TODO update to syn and quote >= 1.0
extern crate proc_macro;
#[macro_use]
extern crate quote;
#[macro_use]
extern crate syn;
use proc_macro::TokenStream;
use quote::Tokens;
use syn::{Attribute, Data, DataEnum, DataStruct, DeriveInput, Field, Fields, Ident, ... |
// Copyright (c) 2018-2022 The MobileCoin Foundation
//! Utilities that help with testing the transaction builder and related objects
use crate::{EmptyMemoBuilder, InputCredentials, MemoPayload, TransactionBuilder, TxBuilderError};
use core::convert::TryFrom;
use mc_account_keys::{AccountKey, PublicAddress, DEFAULT_S... |
// Copyright 2015-2018 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law o... |
mod bytepacket;
use crate::UniResult;
use bytepacket::*;
use std::net::Ipv4Addr;
// pub enum RCode {
// NoError = 0,
// FormErr = 1,
// SevFail = 2,
// NameErr = 3,
// NotImpl = 4,
// Refused = 5,
// }
#[derive(Debug)]
pub struct DnsHeader {
pub id: u16,
pub qr: bool,
pub opcode: ... |
//!
//! The block expression parser.
//!
use std::cell::RefCell;
use std::rc::Rc;
use zinc_lexical::Lexeme;
use zinc_lexical::Symbol;
use zinc_lexical::Token;
use zinc_lexical::TokenStream;
use crate::error::Error as SyntaxError;
use crate::error::ParsingError;
use crate::parser::statement::local_fn::Parser as Funct... |
use crate::components::Pos;
use crate::levels::LevelSave;
use crate::resources::{TileDefinition, TileDefinitions, WorldBounds};
use serde::{Deserialize, Serialize};
use std::collections::HashMap;
#[derive(Debug, Default, Clone)]
pub struct TileMap {
pub world_bounds: WorldBounds,
pub tiles: HashMap<Pos, Tile>,... |
use shuttle::scheduler::PctScheduler;
use shuttle::sync::{mpsc::channel, RwLock};
use shuttle::{check, check_random, thread, Runner};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
use test_env_log::test;
#[test]
fn reader_concurrency() {
let saw_concurrent_reads = Arc::new(AtomicB... |
use crate::{error, Result};
use itertools::join;
use snafu::{ensure, OptionExt, ResultExt};
use std::collections::{HashMap, HashSet};
use std::path::Path;
use std::process::Command;
// TODO: thar-be-settings isn't used as a library; declare its modules in main rather than lib so
// we don't have to expose helper types... |
// Lumol, an extensible molecular simulation engine
// Copyright (C) Lumol's contributors — BSD license
use toml::value::Table;
use log::{self, Record, info};
use log4rs;
use log4rs::append::Append;
use log4rs::append::console;
use log4rs::append::console::ConsoleAppender;
use log4rs::append::file::FileAppender;
use ... |
/*
* 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... |
// DISCLAIMER:
// Do not modify this file arbitrarily.
// The contents are borrowed from:
// dfinity-lab/dfinity@25999dd54d29c24edb31483801bddfd8c1d780c8
// https://github.com/dfinity-lab/dfinity/blob/master/rs/rosetta-api/canister/src/account_identifier.rs
use candid::CandidType;
use ic_types::principal::Principal;
u... |
//!
//! The `solc --standard-json` output representation.
//!
pub mod contract;
pub mod error;
pub mod source;
use std::collections::BTreeMap;
use serde::Deserialize;
use serde::Serialize;
use crate::dump_flag::DumpFlag;
use crate::evm::assembly::instruction::Instruction;
use crate::evm::assembly::Assembly;
use cra... |
#![crate_type="dylib"]
#![feature(plugin_registrar, rustc_private)]
#[macro_use]
extern crate rustc;
extern crate rustc_plugin;
extern crate syntax;
use syntax::codemap::Span;
use rustc_plugin::Registry;
//////////////////////////////////////////////////////////////////////
// Derive custom implementations where all... |
use super::*;
use {BString, CString, Error, CommandHandle, StorageHandle};
extern {
#[no_mangle]
pub fn indy_register_wallet_storage(command_handle: CommandHandle,
type_: CString,
create: Option<WalletCreate>,
... |
#[doc = "Reader of register STAT"]
pub type R = crate::R<u32, super::STAT>;
#[doc = "Reader of field `DONE0`"]
pub type DONE0_R = crate::R<bool, bool>;
#[doc = "Reader of field `DONE1`"]
pub type DONE1_R = crate::R<bool, bool>;
#[doc = "Reader of field `DONE2`"]
pub type DONE2_R = crate::R<bool, bool>;
#[doc = "Reader ... |
use crate::engine::{
ExecutionContext, InitializedVectorOperator, Operator, QueryContext, QueryProcessor,
TypedVectorQueryProcessor, VectorOperator, VectorQueryProcessor, VectorResultDescriptor,
};
use crate::error;
use crate::util::input::StringOrNumberRange;
use crate::util::Result;
use crate::{adapters::Feat... |
mod args;
mod components;
mod config_parser;
mod debug_config;
mod emoji;
mod icons;
mod notification_bar;
mod path_manager;
mod rule;
mod template;
use args::Args;
use clap::Clap;
use components::NotificationComponent;
use emoji::EmojiMode;
use i3_bar_components::{components::Label, ComponentManagerBuilder};
use log:... |
pub mod xor;
pub trait FromHex: Sized {
type Error;
fn from_hex<T: AsRef<[u8]>>(s: T) -> Result<Self, Self::Error>;
}
#[derive(Debug, Clone, Copy, PartialEq)]
pub enum FromHexError {
InvalidHexCharacter { c: char, index: usize },
InvalidHexLength,
}
impl FromHex for Vec<u8> {
type Error = FromHe... |
//! A mapping of component ids to glyphs that contain that id
//!
//! this is used to invalidate glyphs appropriately when components change
use std::borrow::Cow;
use std::collections::HashMap;
use std::sync::Arc;
use druid::kurbo::{Affine, BezPath};
use druid::Data;
use norad::{Glyph, GlyphName, Ufo};
const PRE_CAC... |
use std::error::Error;
use sp_lib::datastore::{datastore, history, dividends};
use sp_lib::stats::{description, hist_desc, hist_ftns};
use sp_lib::util::datetime;
use crate::arguments::Arguments;
const DESC: &str = "desc";
const DIVDESC: &str = "divdesc";
const VWAP: &str = "vwap";
const MVWAP: &str = "mvwap";
const R... |
use clap::crate_version;
use crossterm::event::{KeyCode, KeyEvent, KeyModifiers};
use tui::{
backend::Backend,
layout::{
Alignment::{Center, Right},
Constraint,
Direction::{Horizontal, Vertical},
Layout, Rect,
},
style::{Color, Modifier, Style},
symbols::line::VERTICA... |
/*
* Copyright 2020 <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... |
// Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause
use std::sync::{Arc, Mutex};
use std::thread;
use event_manager::utilities::subscribers::{
CounterInnerMutSubscriber, CounterSubscriber, CounterSubscriberWithData,
};
use event_manager... |
mod pair_position;
pub use self::pair_position::PairPosition;
use std::{
collections::{hash_map::Drain, HashMap},
io,
};
use noodles::bam;
use tokio::io::AsyncRead;
use tracing::warn;
type RecordKey = (
Vec<u8>,
PairPosition,
Option<i32>,
Option<i32>,
Option<i32>,
Option<i32>,
i3... |
use crate::*;
use serde_json::json;
use serde_json::value::Value::Null;
pub struct Info;
impl PhabRespond for Info {
fn respond(&self, server: &PhabMockServer, params: &Params, _: &Request) -> ResponseTemplate {
let id = params
.get(&["task_id"])
.expect("Expected a task id")
... |
// Copyright Materialize, Inc. and contributors. All rights reserved.
//
// Use of this software is governed by the Business Source License
// included in the LICENSE file.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by ... |
use super::{isample, frequency_to_discrete, Complex, Chunk};
use std::convert::TryInto;
use std::fs;
use std::error::Error;
use std::io::{Write};
extern crate half;
use half::{bf16};
mod fft;
mod riff;
use riff::RiffChunk;
pub struct EncodeOptions {
pub chunk_size: usize,
pub out_size: usize,
pub storage_type: ... |
use super::{Config, ENDPOINT_HEADER_KEY};
use crate::{endpoint::Endpoint, io::Io, simplex::io::into_io, Result};
use anyhow::{anyhow, bail, ensure, Context};
use bytes::{Buf, Bytes};
use chrono::Utc;
use futures::{Future, FutureExt};
use hyper::{server::conn::Http, service::service_fn, Body, Request, Response};
use hyp... |
//! Builtin sh task.
use sha2::Digest;
use std::collections::HashMap;
use std::path::Path;
use tokio::{fs, io, io::AsyncReadExt, process};
use crate::{TaskEntity, TaskError};
enum Sha256Set {
Each(HashMap<String, String>),
All(String),
}
impl Sha256Set {
fn get(&self, key: &str) -> Option<&String> {
... |
//! Test file tree sync artifact manager.
//!
//! Use this artifact pool *ONLY* for representing and testing pools backed by a
//! filesystem tree like layout.
use ic_interfaces::artifact_manager::{
ArtifactAcceptance, ArtifactClient, ArtifactProcessor, ProcessingResult,
};
use ic_interfaces::artifact_pool::{Artif... |
//! Constrain the set of types that you can reason about in a particular
//! context.
use crate::state::State;
use crate::value::{LVar, Val};
use im_rc::HashMap;
use std::fmt::Debug;
/** Manage values for a set of specific types.
Works with the [`DomainType<T>`](DomainType) trait to allow access to actual
values.
D... |
use super::AnyError;
use crate::wt_error::WTError;
use magic_crypt::MagicCryptTrait;
use reqwest::header::HeaderMap;
use reqwest::{Client, Method};
use serde::Deserialize;
use serde::Serialize;
use std::io::Write;
type ApiResult = Result<serde_json::Value, AnyError>;
const PC_CLIENT_JSON_ENCRYPTION_KEY: &'static str ... |
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub enum AbsSign {
Forall,
Fun,
Exists,
}
impl Display for AbsSign {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_char(match self {
AbsSign::Forall => '∀',
AbsSign::Fun => 'λ',
AbsSi... |
use super::engine;
use super::packet;
use super::link;
use super::lib;
use std::cell::RefCell;
use std::ffi;
use std::mem;
use std::ptr;
// RAW socket app: interface with Linux network devices
#[derive(Clone,Debug)]
pub struct RawSocket { pub ifname: String }
impl engine::AppConfig for RawSocket {
fn new(&self) ... |
#[macro_use]
extern crate tracing;
mod cli;
use cli::{Color, LogFormat, Opts, SubCommand};
use futures::{
compat::{Future01CompatExt, Stream01CompatExt},
StreamExt,
};
use futures01::Future;
use std::cmp::max;
use tokio::select;
use vector::{
config::{self, Config, ConfigDiff},
event, generate, list, ... |
//! Connection statistics
use crate::{frame::Frame, Dir};
use std::time::Duration;
/// Statistics about UDP datagrams transmitted or received on a connection
#[derive(Default, Debug, Copy, Clone)]
#[non_exhaustive]
pub struct UdpStats {
/// The amount of UDP datagrams observed
pub datagrams: u64,
/// The ... |
use byteorder::{LittleEndian, WriteBytesExt};
use std::borrow::Cow;
use std::io::{self, Write};
use crate::color::ColorType;
use crate::error::{ImageError, ImageResult, ParameterError, ParameterErrorKind};
use crate::image::ImageEncoder;
use crate::codecs::png::PngEncoder;
// Enum value indicating an ICO image (as o... |
use anyhow::{anyhow, bail, ensure, Context, Result};
use fuzzy_matcher::skim::SkimMatcherV2;
use fuzzy_matcher::FuzzyMatcher;
use serde::{Deserialize, Serialize};
use std::collections::{BTreeMap, BTreeSet};
use std::fs::{copy, read, File};
use std::path::{Path, PathBuf};
use crate::book::{Book, BookHash};
use crate::... |
#[macro_use]
extern crate log;
extern crate config;
use influxdb::{Client, Query, Timestamp};
use simplelog::{Config, LevelFilter, TermLogError, TermLogger, TerminalMode};
use snafu::{ResultExt, Snafu};
use tokio::stream::StreamExt as _;
#[derive(Debug, Snafu)]
enum Error {
#[snafu(display("Initializing TermLogge... |
// Copyright (c) The dgc.network
// SPDX-License-Identifier: Apache-2.0
use protobuf;
use protobuf::Message;
use protobuf::RepeatedField;
use std::str;
use std::fmt;
use sawtooth_sdk::processor::handler::ApplyError;
#[derive(Copy, Clone)]
pub enum Action {
/*
ApplyCredit(payload::ApplyCreditAction),
Transfe... |
use std::{
borrow::Cow,
collections::{HashMap, HashSet},
sync::Arc,
};
use async_lock::RwLock;
use bonsaidb_core::{
connection::Connection,
keyvalue::Timestamp,
schema::{view, CollectionName, ViewName},
};
use bonsaidb_utils::{fast_async_read, fast_async_write};
use crate::{
database::{key... |
//Copyright 2021-2023 WHTCORPS INC
/// An internal temporary struct to pass between the projection 'walk' and the
/// resultant projector.
/// Projection accumulates four things:
/// - Two BerolinaSQL projection lists. We need two because aggregate queries are nested
/// in order to apply DISTINCT to values prior... |
use super::constants::{
relocations::CoffRelocationType, Characteristics, Machine, StorageClass, SymbolType,
};
use crate::{
error::{Error, Result},
sections::SectionNumber,
util::next_different_sizes,
};
use core::convert::TryFrom;
use segsource::TryFromSegment;
#[derive(TryFromSegment, Debug, Clone)]... |
use std::{
fs::File,
io::{BufRead, BufReader, BufWriter, Write},
net::Ipv4Addr,
path::Path,
process::{Child, Command, Stdio},
};
use anyhow::{Context, Result};
use askama::Template;
use serde::{Deserialize, Serialize};
use serde_json::from_reader;
use tempfile::{NamedTempFile, TempPath};
use util::{ConnectionProt... |
use std::collections::LinkedList;
use std::rc::Rc;
use std::cell::RefCell;
use wasm_bindgen::{JsCast, JsValue};
use wasm_bindgen::closure::Closure;
use web_sys::{
Document,
HtmlCanvasElement,
CanvasRenderingContext2d
};
/// A struct that represents a point of the world.
#[derive(Debug)]
pub struct Point {... |
use super::*;
use super::mediums::AIR;
const BACKGROUND: Vector = Vector {
x: 0.0,
y: 0.05,
z: 0.05,
};
const AMBIENT: Vector = Vector {
x: 1.0,
y: 1.0,
z: 1.0,
};
pub struct Environment<'a> {
lights: Vec<&'a LightSource>,
solids: Vec<&'a GObject>,
eye: Vector,
eye_dir: Vect... |
//! Types for EPP requests
pub mod contact;
pub mod domain;
pub mod host;
pub mod message;
use serde::{ser::SerializeStruct, ser::Serializer, Deserialize, Serialize};
use std::error::Error;
use std::time::SystemTime;
use crate::epp::object::{
ElementName, EmptyTag, EppObject, Extension, Options, ServiceExtension... |
use crate::config::ApiList;
use crate::equity::Equity;
use serde_json::Value;
use std::collections::HashMap;
use std::error;
use std::io;
// Stores a HashMap of all the platforms and their JSON API pairings.
// Fetcher is the object to interact with external API interfaces.
#[derive(Debug)]
pub struct Fetcher {
//... |
// Copyright (c) 2018 Intel Corporation. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
extern crate libzfs_sys as sys;
use nvpair;
use std::ffi::CStr;
use libzfs_error::{LibZfsError, Result};
use std::io::{Error, ErrorKind};
/// Represent... |
use async_recursion::async_recursion;
use crate::types::{
Comment, StoryItem, StoryPageData, StorySorting, UserData,
};
use futures::future::join_all;
use lazy_static::lazy_static;
use lru::LruCache;
use std::sync::Mutex;
use thiserror::Error;
const BASE_URL: &str = "https://hacker-news.firebaseio.com/v0";
const T... |
//! For project structure and debugging boilerplate, see the `synax_overview` example.
#![no_main]
#![no_std]
use core::cell::{Cell, RefCell};
use cortex_m::{
interrupt::{free, Mutex},
peripheral::NVIC,
};
use cortex_m_rt::entry;
use stm32_hal::{
adc::{Adc, AdcChannel, AdcDevice},
clocks::Clocks,
... |
//! Utilities to make work with PSBTs easier
use bitcoin::util::psbt::PartiallySignedTransaction as Psbt;
use bitcoin::{TxIn, TxOut};
use bitcoin::util::psbt;
use std::convert::TryInto;
use std::fmt;
pub(crate) trait PsbtExt {
type Iterator;
fn input_pairs(self) -> Self::Iterator;
fn validate_input_utxos... |
//extern crate clap;
#[macro_use]
extern crate log;
mod parser;
mod permission;
//use clap::{Arg, App, SubCommand,AppSettings,ArgSettings};
use std::time::{Duration,Instant};
use parser::*;
use std::io::{self, Read,Write};
fn callback(cmd: &AppCommand, args: MatchedArgs) -> CmdResult {
println!("cmd run");
E... |
use web_sys::WebGlProgram;
use web_sys::WebGlRenderingContext;
use web_sys::WebGlShader;
pub fn link_program(
webgl_context: &WebGlRenderingContext,
vertex_shader_source: &str,
fragment_shader_source: &str,
) -> Result<WebGlProgram, String> {
let program = webgl_context
.create_program()
... |
use std::collections::HashSet;
use std::hash::{
BuildHasher,
Hash,
};
use std::io::BufRead;
use std::usize;
use regex::Regex;
use utils;
type Position = (usize, usize);
type TileSet = HashSet<Position>;
type Map = (TileSet, TileSet, TileSet);
type BoundingBox = (Position, Position);
pub fn hashset_take_arb... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
use anyhow::{Context, Result};
use futures::StreamExt;
use onefuzz::{
asan::AsanLog,
blob::{BlobClient, BlobUrl},
fs::exists,
monitor::DirectoryMonitor,
syncdir::SyncedDir,
};
use onefuzz_telemetry::{
Event::{new_report,... |
use super::dataset::Dataset;
use super::errors::*;
use super::Database;
use super::{
dead_list_max_key, dead_list_max_key_ds, dead_list_min_key, ds_data_key, fetch_ds_data,
fetch_ss_data, offset_from_dead_list_key, ss_data_key, ss_data_key_max, ss_key,
};
use super::{DatasetData, DatasetId, DeadListData};
use s... |
mod error;
mod subcommand;
use crate::error::CliError;
use anyhow::Result;
use clap::{App, AppSettings, Arg};
use fs_err as fs;
use log::debug;
use fs::metadata;
use std::path::{Path, PathBuf};
const BIN_NAME: &'static str = env!("CARGO_BIN_NAME");
const PKG_NAME: &'static str = env!("CARGO_PKG_NAME");
const PKG_VER... |
use crate::extensions::{
ckb_balance, special_cells, udt_balance, DetailedCells, CKB_EXT_PREFIX, SP_CELL_EXT_PREFIX,
UDT_EXT_PREFIX,
};
use crate::rpc::rpc_impl::{address_to_script, MercuryRpcImpl};
use crate::rpc::types::GetBalanceResponse;
use crate::{error::MercuryError, stores::add_prefix, utils::to_fixed_a... |
use std::convert::TryInto;
use std::fmt;
use actix_http::body::{AnyBody, BodySize};
use actix_web::body::MessageBody;
use actix_web::http::{header, HeaderName, HeaderValue, StatusCode};
use actix_web::{HttpRequest, HttpResponse, Responder, ResponseError};
use serde::Serialize;
use super::*;
use crate::errors;
use cra... |
extern crate cfg_if;
extern crate wasm_bindgen;
mod utils;
use std::mem;
use std::slice;
use std::os::raw::c_void;
use wasm_bindgen::prelude::*;
fn round_to_int(v: f32) -> u8 {
return v.round() as u8
}
fn clip255(v: f32) -> u8 {
if (v > 255.0) { return 255; }
if (v < 0.0) { return 0; }
return v.round() as u... |
use std::sync::{atomic::AtomicBool, Arc};
use std::time::Duration;
use actix::{Actor, Addr, Handler, SyncArbiter, SyncContext};
use actix_storage::dev::actor::{
ExpiryRequest, ExpiryResponse, ExpiryStoreRequest, ExpiryStoreResponse, StoreRequest,
StoreResponse,
};
use crate::SledConfig;
mod delay;
mod flags;... |
// Copyright 2019 Zhizhesihai (Beijing) Technology 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 a... |
extern crate asi_core0 as asi;
extern crate piston;
extern crate glutin_window;
extern crate opengl_graphics;
extern crate graphics;
extern crate vecmath;
extern crate rand;
extern crate bee_challenge;
use opengl_graphics::*;
use glutin_window::GlutinWindow;
use piston::window::*;
use piston::input::*;
use graphics::*... |
use crate::models::{Board, Comment};
use crate::schema::{comments, topics};
use anyhow::Result;
use chrono::{DateTime, NaiveDateTime, Utc};
use diesel::prelude::*;
use std::{
convert::TryInto,
hash::Hash,
net::{IpAddr, Ipv4Addr, Ipv6Addr},
};
#[derive(Serialize, Deserialize, Queryable, Identifiable, Debug)... |
#[cfg(test)]
mod tests {
use std::{
process::{Command, Stdio},
sync::Arc,
thread::{self, JoinHandle},
};
use crossbeam::channel::{Receiver, Sender};
use crate::sub_process::{SubProcess, SubProcessResult};
#[test]
fn it_sub_process_result_error_msg() {
let cmd =... |
use std::collections::VecDeque;
use rand::prelude::*;
use rand_pcg::Pcg64;
use shared::{MemoryManager, Node, NodePointer, Stack};
type Result<T> = std::result::Result<T, Box<dyn std::error::Error>>;
pub mod shared;
pub mod mark_compact;
pub mod stop_copy;
// testing stuff below
#[cfg(test)]
pub mod tests;
pub fn... |
use crate::resources::common::currency::Currency;
use crate::resources::common::object::Object;
use crate::resources::common::path::UrlPath;
use crate::util::{Deleted, List, Expandable};
use crate::Client;
use std::collections::HashMap;
use crate::resources::connect::account::Account;
use crate::resources::core::custo... |
// Copyright 2020-2022 <NAME>
// SPDX-License-Identifier: Apache-2.0
use core::fmt::Display;
use core::fmt::Formatter;
use serde::de;
use serde::Deserialize;
use serde::Serialize;
use identity_core::common::KeyComparable;
use identity_core::common::Object;
use identity_core::convert::FmtJson;
use identity_core::cryp... |
// ---------------------------------------------------------------------------------------
// Ruthenium, an ack-like searcher, (c) 2015 <NAME>.
// Licensed under the MIT license.
// ---------------------------------------------------------------------------------------
use std::borrow::Cow;
use std::collections::BTree... |
// Refer https://github.com/gpg/gnupg/blob/master/agent/gpg-agent.c#L2528
use crate::bindings::Windows::Win32::Foundation::{
CloseHandle, HANDLE, INVALID_HANDLE_VALUE, LPARAM, WPARAM,
};
use crate::bindings::Windows::Win32::System::DataExchange::COPYDATASTRUCT;
use crate::bindings::Windows::Win32::System::Memory::... |
pub(crate) const SERVER_NAME_CODEC: &str = "_Low-level Audio Codec Server_";
#[allow(dead_code)]
#[derive(num_derive::FromPrimitive, num_derive::ToPrimitive, Debug)]
pub(crate) enum Opcode {
/// TODO just play
//PutPlayFrames,
/// TODO just record
//GetRecFrames,
/// play and record
SwapF... |
#![feature(test)]
extern crate test;
extern crate cfg;
extern crate gearley;
macro_rules! trace(($($tt:tt)*) => ());
#[path = "../tests/helpers/mod.rs"]
mod helpers;
use cfg::sequence::Separator::Proper;
use cfg::earley::Grammar;
use gearley::forest::{Bocage, NullForest};
use gearley::grammar::InternalGrammar;
use ... |
use std::str::FromStr;
pub struct Cpu {
pub registers: [usize; 6],
instructions: Vec<Instruction>,
instruction_pointer: usize,
}
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub struct Instruction {
opcode: OpCode,
input_a: usize,
input_b: usize,
output: usize,
}
#[derive(Clone, Copy, Deb... |
use serde::Serialize;
/*
DEBUG maws2iotcore > LOG 19.0 9.8 55 984.4 1001.7 125 0.0 331 0.5
DEBUG maws2iotcore > PTU 19.0 10.3 20.2 9.8 8.8 13.0 55 50 99 984.4 983.8 986.7 1001.7 1001.1 1004.4 125 0 871 0.0 0... |
#![recursion_limit="128"]
#[macro_use] extern crate helix;
#[macro_use] extern crate serde_json;
extern crate indyrs as indy;
use indy::pool;
use indy::wallet;
use std::string::String;
use indy::future::Future;
use std::env;
use std::fs;
use std::io::Write;
use std::path::PathBuf;
ruby! {
class IndyWallet {
... |
use std::str;
use golang_parser::tree_sitter::Node;
use golang_struct_tag::{StructTag, StructTagParseError};
use crate::{golang_type_name_core::TypeName, PointerType, Type, TypeParseError};
#[derive(PartialEq, Eq, Debug, Clone)]
pub struct StructType {
pub field_decls: Vec<FieldDecl>,
}
#[derive(PartialEq, Eq, ... |
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
from_binary, to_binary, Addr, Binary, Deps, DepsMut, Env, MessageInfo, Response, StdResult,
Uint128, CosmosMsg, BankMsg, Coin, WasmMsg, wasm_execute, QueryRequest,
QuerierWrapper, AllBalanceResponse, BankQuery,
};
use cw2::s... |
use std::fmt;
use num_traits::FromPrimitive;
use crate::utils::Cycle;
use crate::gba::{Gba, IrqFlags };
use crate::log::*;
#[derive(Clone, Copy, PartialEq, Eq, Primitive)]
enum TimerScale {
Div1 = 0,
Div64 = 1,
Div256 = 2,
Div1024 = 3,
}
impl fmt::Display for TimerScale {
fn fmt(&self, f: &mut f... |
// Copyright 2020 Chaos Mesh 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 or agree... |
// Copyright 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-MIT or ... |
use num_traits::pow::Pow;
use std::ops::Rem;
/// Circle y∘x
/// Calls a circle function y on x
///
/// ## Notation for the Circle Functions
/// | A+ Expression | Meaning || A+ Expression | Meaning |
/// |----------------------|-------------||----------------------|-------------|
/// | `sinarccos ... |
use anyhow::{anyhow, Error};
use duct::cmd;
use git2::{ErrorCode, FetchOptions, Repository, StatusOptions};
use std::{env, path::Path};
use crate::repository_status::RepositoryStatus;
use crate::{
git::{self, get_gitflow_branches_refs, get_remote},
DEVELOP_BRANCH, MASTER_BRANCH,
};
pub struct System<'a> {
... |
//
// SPDX-License-Identifier: Apache-2.0
//
// Copyright (C) 2021 <NAME>
//
mod cli;
mod config;
mod convert;
mod macros;
mod value;
use std::ffi::OsStr;
use std::fs;
use std::io::{self, Read, Write};
use std::str;
use anyhow::{bail, ensure, Context, Result};
use bat::PrettyPrinter;
use clap::{ArgEnum, Parser};
use... |
use crate::{util::globals::AVATAR_URL, Guilds, MySQL};
use failure::Error;
use image::{
imageops::FilterType, png::PNGEncoder, ColorType, DynamicImage, GenericImage, GenericImageView,
};
use regex::Regex;
use reqwest::Client;
use serenity::{
async_trait,
cache::Cache,
model::{
channel::{EmbedFi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.