text stringlengths 3.09k 13.9k |
|---|
use super::Which;
use playwright::api::{
browser::RecordVideo, Browser, BrowserContext, BrowserType, Cookie, LocalStorageEntry,
OriginState, StorageState
};
pub async fn all(
browser: &Browser,
persistent: &BrowserContext,
port: u16,
_which: Which
) -> BrowserContext {
let c = launch(browse... |
//! Repos represent any self-contained repository of artifacts.
//!
//! A repo can be directory of files or a git repository, or, as a degenerate
//! case, a single flat file.
use {
anyhow::Result,
git2, log,
serde::{Deserialize, Serialize},
std::{fmt, path::PathBuf},
};
const GIT_SSH_PREFIX: &str = "... |
use super::lexer::{CommentType, Lexer, TokenType};
use crate::rc_string::RcString;
use crate::utils::parsing::{CharPos, ParsingError};
use std::borrow::Cow;
use std::iter;
#[derive(Debug)]
pub struct ParsedMessage<'src> {
pub translator_comments: Vec<Cow<'src, str>>,
pub automatic_comments: Vec<Cow<'src, str>>,
... |
use crate::{
app::ProxyMidiArguments,
table::{ParametersTable, ParametersTableEntry},
};
use std::{
collections::HashMap,
sync::mpsc::{channel, Receiver, Sender},
time::Duration,
};
use anyhow::{bail, Result};
use async_std::{
fs::read_to_string,
net::UdpSocket,
sync::Arc,
task::{s... |
#[macro_use]
mod log_dbg;
mod buffer_mixer;
mod print_buffer;
use buffer_mixer::BufferMixer;
use buffer_mixer::MixerLayer;
use print_buffer::PrintBuffer;
use structopt::StructOpt;
use unicode_segmentation::UnicodeSegmentation;
use unicode_width::UnicodeWidthStr;
#[derive(Debug, StructOpt)]
#[structopt(about, author)]... |
use chess::Color;
use num_traits::{
Bounded, Num, NumAssign, NumAssignOps, NumCast, NumOps, PrimInt, Signed, WrappingAdd,
WrappingMul, WrappingSub,
};
use std::cmp::{PartialEq, PartialOrd};
use std::fmt::Debug;
pub trait Eval:
Num
+ NumAssign
+ NumAssignOps
+ NumOps
+ Signed
+ Bounded
... |
use crate::monster_engine_config::MonsterEngineConfig;
use hyper::{Body, Request, Response, Server, Version};
use hyper::header::{HeaderMap, HeaderValue};
use hyper::http::method::Method;
use hyper::http::uri::Scheme;
use hyper::service::{make_service_fn, service_fn};
use plamo::*;
use std::ffi::CString;
use std::net::... |
use super::tess::{fill_lyon_path, stroke_lyon_path, TessMode};
use crate::builder::DrawProcess;
use crate::draw::{Draw, ShapeInfo};
use crate::transform::DrawTransform;
use lyon::math::point;
use lyon::path::path::Builder;
use lyon::tessellation::*;
use notan_graphics::color::Color;
use notan_graphics::pipeline::BlendM... |
use crate::cart::Mirroring;
#[derive(Clone)]
pub struct MMC3 {
bank_select: BankSelectRegister,
bank_data: [u8; 8],
mirroring: Mirroring,
irq_latch: u8,
irq_counter: u8,
// TODO: implement scanline IRQs
irq_enable: bool,
prg_ram: [u8; 0x2000],
}
impl MMC3 {
pub fn new() -> Self... |
extern crate assert_cmd;
extern crate clap;
use clap::*;
use std::fs::File;
use std::io::Read;
use std::io::Seek;
use std::io::SeekFrom;
use std::io::Write;
use std::path::Path;
const FIRST_PHOTO_POSITION: usize = 0x2000;
const PHOTO_OFFSET: usize = 0x1000;
const PHOTO_TILE_WIDTH: usize = 16;
const PHOTO_TILE_HEIGHT:... |
//! Convert sdf files to other formats.
use std::iter::repeat;
use peakbag::{PeakDetector, Peak};
use Result;
use error::Error;
use file::{Block, Channel, FileInfo, Record};
const HIGH_WIDTH: usize = 2;
const HIGH_FLOOR: u16 = 15;
const HIGH_CEILING: u16 = 255;
const LOW_WIDTHS: (usize, usize) = (3, 2);
const LOW_F... |
extern crate doryen_rs;
extern crate rand;
use doryen_fov::{FovAlgorithm, FovRecursiveShadowCasting, FovRestrictive, MapData};
use doryen_rs::{App, AppOptions, Color, DoryenApi, Engine, TextAlign};
use rand::Rng;
const CONSOLE_WIDTH: u32 = 80;
const CONSOLE_HEIGHT: u32 = 50;
const FOV_NAMES: [&str; 2] = ["recursive sh... |
//! Handles UEFI status codes.
use core::ops::Try;
/// Represents the successful status.
pub const SUCCESS: Status = Status(0);
/// The hig bit of a status code to indicate an error.
#[cfg(target_pointer_width = "128")]
pub const ERROR_BIT: usize = 1 << 127;
/// The high bit of a status code to indicate an error.
#... |
#![recursion_limit = "256"]
use anyhow::{anyhow, Context, Error};
use dapla_yew::{JsonFetcher, MsgError, RawHtml};
use libp2p_core::{identity::ed25519::Keypair, PeerId, PublicKey};
use web_sys::HtmlElement;
use yew::{
html, initialize, run_loop, services::console::ConsoleService, App, Component, ComponentLink, Htm... |
#![allow(clippy::new_without_default)]
use crate::parser::Token;
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct Interpreter {
cells: Vec<u8>,
pointer: usize,
}
impl Interpreter {
pub fn new() -> Self {
Self {
cells: vec![0],
pointer: 0,
}
}
#[must_use]
... |
use super::super::machine::register::RegisterId;
use crate::codegen::common::machine::{basic_block::MachineBasicBlockId, function::*, liveness::*};
use rustc_hash::FxHashSet;
use std::collections::VecDeque;
pub fn coalesce_function(matrix: &mut LiveRegMatrix, f: &mut MachineFunction) {
let mut worklist = VecDeque:... |
extern crate pung;
extern crate gj;
extern crate gjio;
extern crate capnp;
extern crate getopts;
extern crate time;
use getopts::Options;
use pung::client::PungClient;
use pung::db;
use time::PreciseTime;
fn print_usage(program: &str, opts: Options) {
let brief = format!("Usage: {} [options]", program);
prin... |
//! Elliptic arc related maths and tools.
use std::f32::*;
use core::ArcFlags;
use core::math_utils::*;
use core::math::*;
use PathBuilder;
/// Build an svg arc by approximating it with cubic bezier curves.
///
/// Angles are expressed in radians.
pub fn arc_to_cubic_beziers<Builder: PathBuilder>(
from: Vec2,
... |
use std::fmt::Display;
use std::fmt::Formatter;
use std::fmt::Result as FmtResult;
use std::fmt::Write;
use std::iter::FromIterator;
use std::ops::Deref;
use std::ops::DerefMut;
use fastobo_derive_internal::FromStr;
use pest::iterators::Pair;
use crate::ast::*;
use crate::error::SyntaxError;
use crate::parser::Cache;... |
// 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 {
anyhow::{Context as _, Result},
simplelog::{CombinedLogger, Config, ConfigBuilder, LevelFilter, SimpleLogger, WriteLogger},
std::fs::{cre... |
use actix::{Actor, Handler, Message, SyncContext};
use failure::{Error, ResultExt};
use slog::Logger;
use std::fmt::{self, Display, Formatter};
use std::path::{Path, PathBuf};
use std::process::Command;
#[derive(Debug, Clone)]
pub(crate) struct GitClone {
logger: Logger,
root: PathBuf,
}
impl GitClone {
p... |
#![no_std]
#![feature(nll)]
#![cfg_attr(feature = "cargo-clippy", allow(needless_range_loop, assign_op_pattern))]
#[macro_use] extern crate arrayref;
extern crate subtle;
#[macro_use] mod module;
pub mod traits;
use core::iter;
use subtle::ConstantTimeEq;
use traits::{ KEY_LENGTH, BLOCK_LENGTH };
use traits::BlockCi... |
//! Test Various helpers for Actix applications to use during testing.
use std::str::FromStr;
use bytes::Bytes;
use cookie::Cookie;
use http::header::HeaderName;
use http::{HeaderMap, HttpTryFrom, Method, Uri, Version};
use crate::header::{Header, IntoHeaderValue};
use crate::payload::Payload;
use crate::Request;
//... |
#![forbid(unsafe_code)]
extern crate num_rational;
use std::convert::TryInto;
use std::io::{Read, Seek, BufReader};
use std::sync::{Arc, Mutex};
use types::Endianness;
use subfile::Subfile;
use error::ParseError;
mod types;
mod subfile;
pub mod error;
#[derive(Debug)]
pub struct TiffReader<R> {
endianness: End... |
// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MI... |
// Copyright Rivtower Technologies 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 or agreed ... |
use crate::{
buffer::{StagingFactory, VertexBuffer, VertexTypedBuffer},
vertex::FlatVertex,
GlobalState,
};
use super::Scene;
const VERTICES_3: &[FlatVertex] = &[
FlatVertex {
position: [0.3, 0.3, 0.0],
color: [1.0, 0.0, 0.0],
},
FlatVertex {
position: [-0.5, 0.0, 0.0],... |
#![allow(clippy::type_complexity)]
#![allow(unused_imports)]
#![allow(dead_code)]
use std::cmp::Ordering;
use std::collections::{BTreeMap, HashMap, HashSet};
use std::fs;
use std::path::Path;
use walkdir::WalkDir;
use create_main_file::*;
use create_project_file::*;
use generate_reproducer_file::*;
use crate::autom... |
use bevy::{
diagnostic::FrameTimeDiagnosticsPlugin, prelude::*, render::pass::ClearColor, ui::Val::Px,
};
mod addons;
mod config;
mod input;
mod player;
mod ui;
mod world;
use world::{
block::Block,
chunk::{Chunk, ChunkOffset, CHUNKSIZE},
directions::Direction,
};
pub const ROOT_PATH: &str = "assets";
... |
//! `ClientSession` is an actor, it manages peer tcp connection and
//! proxies commands from peer to `ChatServer`.
use std::{io, net};
use std::str::FromStr;
use std::time::{Instant, Duration};
use futures::Stream;
use tokio_io::AsyncRead;
use tokio_io::io::WriteHalf;
use tokio_io::codec::FramedRead;
use tokio_core::n... |
use std::env;
use std::fs::File;
use std::io::{Read, Write};
use std::path::Path;
use codegen::{Block, Function, Scope};
use roxmltree::{Document, Node};
const ALLOW_LINTS: &str = r###"
#[allow(clippy::unreadable_literal)]
#[allow(clippy::match_same_arms)]
#[allow(clippy::too_many_lines)]
"###;
/// EAN.UCC prefix or... |
use std::fmt;
use serde_derive::{Deserialize, Serialize};
/// The `Conversion` enum defines what type of run-time conversion of types is to be done
#[derive(Deserialize, Serialize, Clone, PartialEq, Debug)]
pub enum Conversion {
/// Take value and send it wrapped in an array
WrapAsArray,
/// Serialize an ... |
use std::time::{Duration, SystemTime};
use std::mem;
use std::io;
use byteorder::{BigEndian, LittleEndian, ByteOrder};
use tokio::codec::{Decoder, Encoder};
use tokio::reactor::Handle;
use bytes::{BytesMut, BufMut};
use tokio_serial::{Serial, SerialPort, SerialPortSettings, Parity, DataBits, StopBits, FlowControl};
use... |
/*
* Copyright 2020 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... |
// Generated from definition io.k8s.apimachinery.pkg.apis.meta.v1.ListMeta
/// ListMeta describes metadata that synthetic resources must have, including lists and various status objects. A resource may have only one of {ObjectMeta, ListMeta}.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct ListMeta {
/// co... |
use collections::str::{from_utf8};
pub use self::Receiver::*;
/// Checks if the nickname is valid
pub fn valid_nick(nick: &str) -> bool {
// <nick> ::= <letter> { <letter> | <number> | <special> }
//<special> ::= '-' | '[' | ']' | '\' | '`' | '^' | '{' | '}'
//
// As of http://tools.ietf.org... |
//! `HttpService` server that uses AWS Lambda Rust Runtime as backend.
//!
//! This crate builds on the standard http interface provided by the
//! [lambda_http](https://docs.rs/lambda_http) crate and provides a http server
//! that runs on the lambda runtime.
//!
//! Compatible services like [tide](https://github.com/... |
//! # Logical States
//!
//! A logical state is a collection of variable bindings.
//!
use std::clone::Clone;
/// A collection of possible states.
pub type PossibleStates<T> = Vec<State<T>>;
/// Values used in a state must be unifiable. Unifying two values produces
/// zero or more possible states, where variables ... |
use super::item::Item;
use super::common::{envelope, as_elements};
use super::common::errors::Result;
use super::lister;
use super::lister::Lister;
use std::fmt;
use maplit::hashmap;
use preferences::{AppInfo, PreferencesMap, Preferences};
use reqwest::Url;
const USER_AGENT: &str = "SKY_skyplus";
const CONTENT_TYPE:... |
use std::error::Error;
use std::fmt;
use std::io::{self, Write};
use std::time::{Duration, SystemTime};
use clap::{App, AppSettings, Arg};
use num_cpus;
use rayon::prelude::*;
use wireguard_vanity_lib::trial;
fn estimate_one_trial(prefix: &str, end: usize, case_sensitive: bool) -> Duration {
let start = SystemTim... |
//! This module implements lexing for regex literals used in the JavaScript programing language.
use super::{Cursor, Error, Span, Tokenizer};
use crate::syntax::{
ast::Position,
lexer::{Token, TokenKind},
};
use bitflags::bitflags;
use boa_interner::{Interner, Sym};
use boa_profiler::Profiler;
use std::{
i... |
use proc_macro2::TokenStream;
use proc_macro_crate::{crate_name, FoundCrate};
use quote::{format_ident, quote};
use syn::{
Attribute, FnArg, Ident, Lit, Meta, MetaList, NestedMeta, Pat, PatIdent, PatType, Result,
};
pub fn zbus_path() -> TokenStream {
if let Ok(FoundCrate::Name(name)) = crate_name("zbus") {
... |
mod data;
mod state;
mod widgets;
use crate::data::Profile;
use crate::state::{AppState, BankAccountState, Nav, ProfileState};
use crate::widgets::{NavController, OutlineButton, NAVIGATE};
use clipboard::{ClipboardContext, ClipboardProvider};
use druid::widget::{
CrossAxisAlignment, Flex, Label, List, MainAxisAlig... |
use crate::ast::{Typ, UnaryOpr};
use crate::def::Spanned;
use crate::sst::{Dest, Exp, ExpX, Stm, StmX, Stms, UniqueIdent};
use std::collections::{HashMap, HashSet};
use std::sync::Arc;
fn to_ident_set(input: &HashSet<UniqueIdent>) -> HashSet<Arc<String>> {
let mut output = HashSet::new();
for item in input {
... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Start resolving addresses based on IRKs specified in the IRK data structure"]
pub tasks_start: crate::Reg<tasks_start::TASKS_START_SPEC>,
_reserved1: [u8; 0x04],
#[doc = "0x08 - Stop resolving addresses"]
pub tasks_stop... |
use std::{
convert::{TryFrom, TryInto},
fmt::Display,
};
use crate::{
db::Cf,
error::{Error, Result},
};
const METRICS_CF_PREFIX: &str = "metrics";
pub struct DataPoint {
pub metric_name: String,
pub period: MetricPeriod,
pub tick: Tick,
pub value: f64,
}
pub const _METRIC_PERIOD_AND... |
//! Target configuration
use crate::error::ParseCpuFeatureError;
use crate::lib::std::str::FromStr;
use crate::lib::std::string::{String, ToString};
use enumset::{EnumSet, EnumSetType};
pub use target_lexicon::{
Architecture, BinaryFormat, CallingConvention, Endianness, OperatingSystem, PointerWidth,
Triple,
};... |
#![crate_name = "uu_head"]
/*
* This file is part of the uutils coreutils package.
*
* (c) <NAME> <<EMAIL>>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Synced with: https://raw.github.com/avsm/src/master/usr.bin/head/head.c
... |
// 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 schemars::JsonSchema;
use serde::{Deserialize, Serialize};
use serde_json::{from_value, json, Value};
use std::collections::BTreeMap;
use std::time::Duration;
use super::{Collection, Lambda, PartitionSelector, Schema, ShardTemplate, Shuffle, Transform};
/// A derivation specifies how a collection is derived from ... |
// This file contains the logic for a universal interface to fecth `Translator` instances for given locales
// At simplest, this is just a filesystem interface, but it might be something like a database in production
// This has its own error management logic because the user may implement it separately
use thiserror:... |
use std::vec;
use anyhow::Result;
use tree_sitter::{Node, Parser};
use crate::ast::Ast;
pub fn parse(path: &str, function_name: Option<String>) -> Result<Vec<Ast>> {
let mut parser = Parser::new();
let language = tree_sitter_cpp::language();
parser.set_language(language)?;
let content = std::fs::read... |
//! Utilities for finding and installing binaries that we depend on.
use curl;
use error::Error;
use failure;
use flate2;
use slog::Logger;
use std::collections::HashSet;
use std::ffi;
use std::fs;
use std::io;
use std::path::{Path, PathBuf};
use tar;
use target;
use which::which;
use zip;
/// Get the path for a crat... |
// Copyright (c) 2019 <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, distri... |
use building_blocks_core::{num::Zero, prelude::*, Point};
use core::cmp::Ordering;
use core::hash::Hash;
use indexmap::map::Entry::{Occupied, Vacant};
use indexmap::IndexMap;
use pathfinding::directed::astar::astar;
use std::collections::BinaryHeap;
/// Uses the given heuristic to do an a-star search from `start` to ... |
use std::sync::Arc;
use vulkano::buffer::BufferUsage;
use vulkano::buffer::CpuAccessibleBuffer;
use vulkano::command_buffer::AutoCommandBufferBuilder;
use vulkano::command_buffer::CommandBufferUsage;
use vulkano::descriptor_set::layout::DescriptorSetLayout;
use vulkano::descriptor_set::PersistentDescriptorSet;
use vulk... |
//! Defines the address of each town and city on the map.
use n18map::HexAddress;
/// Defines the address of each town and city on the map.
pub enum Location {
Akron,
Albany,
Allentown,
Altoona,
AtlanticCity,
Baltimore,
Barre,
Boston,
Buffalo,
Burlington,
CanadianWestE,
... |
use ark_ff::Zero;
use ark_std::log2;
use core::cmp;
use zkp_curve::Curve;
use crate::evaluate::eval_eq;
use crate::Vec;
///operation
/// 0. add
/// 1. multiple
/// 2. dummy
/// 3. input
pub struct Gate {
pub g: usize,
pub op: u8,
pub left_node: usize,
pub right_node: usize,
}
impl Gate {
pub fn n... |
#![cfg(test)]
use frame_support::traits::Nothing;
use frame_support::{construct_runtime, ord_parameter_types, parameter_types, PalletId};
use frame_system::EnsureSignedBy;
use orml_traits::parameter_type_with_key;
use sp_core::H256;
use sp_runtime::{testing::Header, traits::IdentityLookup, Perbill};
use primitives::s... |
use crate::helpers::*;
use proc_macro2::*;
use proc_quote::*;
use syn::*;
pub mod filter_reflection;
pub mod parse;
/// Struct that contains information to generate the necessary code for `ParseFilter`.
struct ParseFilter<'a> {
name: &'a Ident,
meta: ParseFilterMeta,
generics: &'a Generics,
}
impl<'a> Pa... |
/*
* Copyright (c) 2017 <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 limitation the rights to
* use, copy, modify, merge, pu... |
use std::fmt::Display;
use std::fmt::Debug;
use array_init;
pub struct Node<T> {
pub elem: T,
pub priority: i32,
}
pub type ArrEntry<T> = Option<Box<Node<T>>>;
pub struct PriorityQueue<T> {
size: usize,
heap: [ArrEntry<T>; 64],
}
impl<T: Display> PriorityQueue<T> {
pub fn new() -> Self {
... |
use {
super::{
err_into,
error::StorageError,
key,
lock::{self, Lock},
tx_err_into, SledStorage, Snapshot, State,
},
crate::{
data::{Row, Schema},
result::MutResult,
result::{Error, Result},
store::Transaction,
},
async_trait::a... |
use crate::{
path,
constants,
error,
ok,
vprintln,
httpfetch
};
use std::str::FromStr;
use std::collections::HashMap;
use std::path::Path;
use std::fs::File;
use std::io::Write;
use serde::{
Serialize
};
pub fn string_is_valid_num<T:FromStr>(s:&str) -> bool {
let num = s.parse::<T>()... |
use std::sync::Arc;
use bytes::Bytes;
use httpbis;
use httpbis::Header;
use httpbis::Headers;
use stream_item::ItemOrMetadata;
use result::Result;
use tls_api;
use tls_api_stub;
use futures::stream;
use futures::stream::Stream;
use futures::Future;
use error::*;
use grpc::*;
use grpc_frame::*;
use httpbis::AnySo... |
use anyhow::{anyhow, Result};
use cnx::text::{Attributes, Text};
use cnx::widgets::{WidgetStream, WidgetStreamI};
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
use std::time::Duration;
use tokio::time;
use tokio_stream::wrappers::IntervalStream;
use tokio_stream::{StreamExt, Stream};
/// Represents ... |
use amethyst::{
assets::{AssetStorage, Loader, Handle},
core::transform::Transform,
input::{get_key, is_close_requested, is_key_down, VirtualKeyCode},
prelude::*,
renderer::{Camera, ImageFormat, SpriteRender, SpriteSheet, SpriteSheetFormat, Texture},
window::ScreenDimensions,
ecs::prelude::{... |
use crate::image::search::state::{ImageSearchCheckboxKind, RECENT_COUNT};
use crate::image::tag::ImageTag;
use super::super::upload::upload_image;
use super::state::State;
use dominator::clone;
use futures::future::join;
use shared::api::endpoints::image;
use shared::domain::image::{user::UserImageCreateRequest, recen... |
//! Types for GPIO input/output simulated in software.
//!
//! These types can be used to simulate GPIO for unit tests.
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::{Arc, Condvar, Mutex};
use std::time::Duration;
pub struct SimInputPin {
env: Arc<SimEnvironmentState>,
index: usize,
}
impl sup... |
// A module named `my_mod`
mod my_mod {
// Items in modules default to private visibility.
fn private_function() {
println!("called `my_mod::private_function()`");
}
// Use the `pub` modifier to override default visibility.
pub fn function() {
println!("called `my_mod::function()`")... |
//! A simple adaptive threadpool that returns a oneshot future.
use std::{
collections::VecDeque,
sync::atomic::{
AtomicBool,
Ordering::{Acquire, Relaxed, Release, SeqCst},
},
thread,
time::{Duration, Instant},
};
use parking_lot::{Condvar, Mutex};
use crate::{
debug_delay, wa... |
use actix_web::{delete, Error, get, HttpResponse, post, put, Responder, web};
use actix_web::error::BlockingError;
use actix_web::web::Json;
use futures::TryFutureExt;
use log::error;
use serde::{Deserialize, Serialize};
use uuid::Uuid;
use crate::core::{CreateMovieParams, HasId, Movie, Page, PaginationParameters, Upd... |
use crate::ast;
use crate::token::{HeaderKey as H, Keyword as K, Kind as T, Token};
use super::{PResult, Parser};
impl<'a, I> Parser<'a, I>
where
I: Iterator<Item = Token>,
{
/// Parse a file until EoF.
pub fn parse_file(&mut self) -> PResult<'a, ast::File> {
// Skip outermost indentations
... |
use futures::{executor::block_on, stream, StreamExt};
use governor::{Jitter, Quota, RateLimiter};
use log::*;
use regex::Regex;
use reqwest::{Client, StatusCode};
use std::num::NonZeroU32;
use std::sync::Arc;
use std::time::Duration;
use std::{collections::HashSet, error::Error, fs::File};
use vtex::model::{Sku, SkuFil... |
extern crate daemonize;
extern crate difference;
use std::process::Command;
use std::io::{self, Write};
use difference::{Difference, Changeset};
use std::{thread, time};
use std::fs::File;
use daemonize::Daemonize;
use std::sync::atomic::{AtomicU32, Ordering};
static GLOBAL_VERIFICATION_WORD: AtomicU32 = AtomicU32... |
// Copyright 2019 Cargill Incorporated
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agre... |
#[cfg(test)]
mod test;
use array_macro::array;
use num_format::{Buffer, Locale};
use rand::{thread_rng, Rng};
use rayon::prelude::*;
use std::{
cmp::Ordering,
sync::atomic::{AtomicUsize, Ordering::SeqCst},
};
use structopt::StructOpt;
const NUM_INNINGS_DEFAULT: u8 = 9;
const NUM_EXTRA_INNING_LENGTHS: usize =... |
use crate::solved;
use num_format::{Locale, ToFormattedString};
use once_cell::sync::Lazy;
use regex::Regex;
use solved::ClassDecoration;
use tgbot::types::{InputFile, Message, ParseMode};
use tgbot::{
methods::{SendMessage, SendPhoto},
Api,
};
pub async fn answer_plain_message(bot: &Api, message: &Message, te... |
/*
* Copyright 2018-2020 TON DEV SOLUTIONS LTD.
*
* Licensed under the SOFTWARE EVALUATION License (the "License"); you may not use
* this file except in compliance with the License.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASI... |
// Copyright 2022 <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 writ... |
use std::fs::File;
use std::io::{BufReader, BufRead};
struct Notes {
now: i32,
bus_ids: Vec<i32>,
}
impl Notes {
/// Loads notes from the given file. Notes have the current time on one line,
/// followed by a comma-separated list of bus ids on the next. Bus ids are either 'x'
/// or how often th... |
use std::{
sync::{Arc, Weak},
time::Duration,
};
use super::{
description::server::ServerDescription,
state::{server::Server, Topology, WeakTopology},
ServerUpdate,
ServerUpdateReceiver,
};
use crate::{
cmap::{Connection, Handshaker},
error::{Error, Result},
hello::{hello_command, r... |
use std::collections::HashMap;
use std::str::Split;
use anyhow::anyhow;
use open_air::domain::viewer::Colour;
#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord)]
pub struct Statement {
contents: String,
}
impl Statement {
/// Construct a statement from a string.
pub fn from_str(src: impl Into<String>... |
use shared::account::{create_and_serialize_account_verify_with_bump, get_account_data, MaxSize};
use crate::{
accounts::AccountType, error::GovernanceError, state::scopes::scope::VotePowerUnit,
PROGRAM_AUTHORITY_SEED,
};
use borsh::{BorshDeserialize, BorshSchema, BorshSerialize};
use solana_program::{
acc... |
//! accounts
//!
//! The accounts module handles the basic manipulation
//! of accounts such as login and creation / deletion.
use async_trait::async_trait;
use chrono::{DateTime, Utc};
use derive_more::Display;
use rand::Rng;
use sha1::Digest;
use sqlx::Type;
use thiserror::Error;
use wow_srp::{Salt, Verifier, WowSRP... |
// Copyright 2019 The Druid 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 agreed... |
use crate::core::object::Object;
use crate::core::HitRecord;
use crate::geometry::{Geometry, Visitor};
use crate::material::Material;
use crate::math::{Ray, AABB};
use crate::random;
use crate::types::{FSize, TextureCoordinate, Vector3};
use std::error::Error;
use std::ops::Range;
use std::sync::Arc;
pub struct XYRect... |
#![deny(
unsafe_code,
missing_debug_implementations,
missing_copy_implementations,
elided_lifetimes_in_paths,
rust_2018_idioms,
clippy::fallible_impl_from,
clippy::missing_const_for_fn
)]
use image::{GenericImageView, Pixel};
use num_traits::cast::NumCast;
use tensorflow::{
Graph, Impor... |
#![allow(dead_code, unused_macros, unused_variables, unused_mut)]
use async_std::task;
use dotenv;
use kv_log_macro as log;
use serde::{Deserialize, Serialize};
use serde_json;
use std::env;
use std::fs::File;
use std::io;
use std::io::prelude::*;
use std::io::Write;
use std::path::Path;
// use chrono::{DateTime, Fixe... |
use fantoch::command::Command;
use fantoch::config::Config;
use fantoch::executor::{
ExecutionOrderMonitor, Executor, ExecutorMetrics, ExecutorResult,
};
use fantoch::id::{ProcessId, ShardId};
use fantoch::kvs::KVStore;
use fantoch::protocol::MessageIndex;
use fantoch::time::SysTime;
use fantoch::HashMap;
use serde... |
#[macro_use]
extern crate gfx;
extern crate rand;
mod shaders;
pub mod spawn;
use gfx::traits::FactoryExt;
// As in the ggez gfx example:
// https://github.com/ggez/ggez/blob/master/examples/cube.rs
// ColorFormat and DepthFormat are hardwired into ggez's drawing code,
// and there isn't a way to easily change t... |
pub mod hash_map_publisher_store;
/// The find service protobuf back end. Use this when writing a Meetup service.
pub mod proto;
pub mod server;
use super::PublisherDesc;
use convert::{TryFrom, TryInto};
use proto::find_me_client::FindMeClient;
use std::fmt::Write;
use std::{convert, error, fmt, result, time};
use ton... |
use rand::Rng;
use std::time::{self, Duration};
use crate::get_worker_id;
use crate::goose::{GooseUser, GooseUserCommand, Scenario, TransactionFunction};
use crate::logger::GooseLog;
use crate::metrics::{GooseMetric, TransactionMetric};
pub(crate) async fn user_main(
thread_number: usize,
thread_scenario: Sce... |
use std::collections::{HashMap,HashSet};
#[derive(Debug,Clone,PartialEq)]
pub enum MemberRole {
Inner(),
Outer(),
Unused(),
}
#[derive(Debug,Clone,PartialEq)]
pub enum MemberType {
Node(),
Way(),
Relation(),
}
#[derive(Debug,Clone,PartialEq)]
pub struct Member {
pub id: u64,
pub role:... |
use crate::{
game::{self, EntityId, Point},
Game as _,
};
use futures::prelude::*;
use log::{debug, error, info};
use once_cell::sync::OnceCell;
use piston_window::{Event, EventLoop, EventSettings, Events, Loop, NoWindow, WindowSettings};
use std::{
io,
net::SocketAddr,
sync::{Arc, Mutex},
time:... |
use std::collections::{BTreeSet, HashSet};
use std::slice::Iter;
use proc_macro2::TokenStream;
use quote::quote;
use syn::{
parse::{Parse, ParseBuffer},
parse2,
punctuated::Punctuated,
Field, FieldValue, Ident, Member, Token, Type, VisPublic, Visibility,
};
use indexmap::map::IndexMap;
use yarte_dom:... |
use log::{debug, info};
use std::{
mem,
sync::{Arc, Mutex},
};
use metadata::Duration;
use super::{
AudioBuffer, AudioChannel, SampleExtractor, SampleIndex, SampleIndexRange, INLINE_CHANNELS,
QUEUE_SIZE,
};
const EXTRACTION_THRESHOLD: SampleIndexRange = SampleIndexRange::new(4096);
// The DoubleBuf... |
use crate::text::parsers::text_support::{escaped_char, escaped_newline, StringFragment};
use crate::text::parsers::whitespace;
use crate::text::text_value::TextValue;
use nom::branch::alt;
use nom::bytes::streaming::{is_not, tag, take_until};
use nom::character::streaming::char;
use nom::combinator::{map, not, opt, pee... |
use crate::core::Method;
use crate::core::{Error, PeriodType, ValueType, Window, OHLCV};
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
/// [Accumulation Distribution Index](https://en.wikipedia.org/wiki/Accumulation/distribution_index) of specified `length` for timeseries of [`OHLCV`]
///
/// [`CLV`]... |
use std::sync::{Arc, Mutex};
use std::collections::VecDeque;
use std::pin::Pin;
use std::{io, mem};
use std::task::{Waker, Context};
use util::slice::{SlicePair, vec_as_slice_raw, raw_split_at_mut, raw_split_at, Slice};
use std::sync::atomic::{AtomicUsize, AtomicBool};
use std::sync::atomic::Ordering::{Acquire, Relaxed... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.