text stringlengths 9.08k 47.9k |
|---|
use crate::common::{
error::{inv_arg, Error, Result},
util::log_2,
};
use integer_sqrt::IntegerSquareRoot;
use num_complex::Complex64;
use serde::{Deserialize, Serialize};
#[cfg(feature = "bindings")]
use std::os::raw::c_double;
use std::{
collections::HashSet,
convert::TryFrom,
f64::consts::FRAC_1_... |
//! Server service aka receiving process
use std::mem::replace;
use super::deflocal::{
LocalDest,
GlobalCommand,
};
use super::peermgmt::{
PeerMgmtCommand,
};
use super::mainloop::{
MainLoopCommand,
};
use super::client2::{
WriteCommand,
};
use readwrite_comp::{
ExtRead,
};
use utils::{
Proto,
Ref,
SR... |
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use std::net::Ipv6Addr;
use crate::{
decoder::{Decodable, Decoder},
encoder::{Encodable, Encoder},
error::{DecodeResult, EncodeResult},
v6::MessageType,
};
// server can send multiple IA_NA options to request multiple addresses
// this me... |
use super::{MessageParams, ParseError};
use std::result::Result;
use std::str::FromStr;
#[derive(PartialEq, Debug)]
pub struct Reply {
pub reply_type: ReplyType,
pub params: MessageParams,
}
impl FromStr for Reply {
type Err = ParseError;
fn from_str(raw: &str) -> Result<Self, Self::Err> {
if... |
use crate::msg::WrappedRegistryResponse;
use cosmwasm_std::{
log,
to_binary,
Api,
Binary,
CanonicalAddr,
Coin,
CosmosMsg,
Env,
Extern,
HandleResponse,
HumanAddr,
InitResponse,
Querier,
QueryRequest,
StdError,
StdResult,
Storage,
Uint128,
WasmMs... |
/* Copyright (C) 2018 <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, publish, distribute... |
use regex::Regex;
use std::fmt;
#[macro_use]
extern crate lazy_static;
///The regexes used to identify specific parts of the magnet
const DISPLAY_NAME_RE_STR: &str = r"dn=([A-Za-z0-9!@#$%^:*<>,?/()_+=.{}\{}\-]*)(&|$|\s)";
const EXACT_TOPIC_RE_STR: &str = r"xt=urn:(sha1|btih|ed2k|aich|kzhash|md5|tree:tiger):([A-Fa-f0-... |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* 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 ... |
extern crate amcl;
#[cfg(feature = "std")]
extern crate hex;
extern crate rand;
extern crate ring;
use self::amcl::arch::Chunk;
use self::ring::digest::{digest, SHA256};
use super::errors::DecodeError;
use BLSCurve::big::BIG;
use BLSCurve::big::{MODBYTES as bls381_MODBYTES, NLEN};
use BLSCurve::ecp::ECP;
use BLSCurve:... |
extern crate csv;
use serde::{Serialize};
use chrono::{NaiveDateTime, Timelike};
use std::cmp;
use chrono::Datelike;
use std::path::{Path};
use csv::{ReaderBuilder, WriterBuilder};
use std::env;
const EXPECTED_CSV_COLUMNS: usize = 8;
//CSV COLUMNS
const COMMIT_HASH: usize = 0;
const PARENT_HASHES: usize = 1;
const AU... |
/*!
This crate provides a fast implementation of agglomerative
[hierarchical clustering](https://en.wikipedia.org/wiki/Hierarchical_clustering).
The ideas and implementation in this crate are heavily based on the work of
<NAME>, and in particular, his 2011 paper,
[Modern hierarchical, agglomerative clustering algorith... |
use crate::collections::ScopedSection;
use crate::protocol::ast::*;
use crate::protocol::input_source::{
InputSource as InputSource,
InputPosition as InputPosition,
InputSpan,
ParseError,
};
use super::tokens::*;
use super::symbol_table::*;
use super::{Module, PassCtx};
// Keywords
pub(crate) const KW_... |
//! Unbuffered terminal display mode
//!
//! This mode uses the 7x7 pixel [MarioChrome](https://github.com/techninja/MarioChron/) font to
//! draw characters to the display without needing a framebuffer. It will write characters from top
//! left to bottom right in an 8x8 pixel grid, restarting at the top left of the d... |
/**
* If you use the VADER sentiment analysis tools, please cite:
* <NAME>. & <NAME>. (2014). VADER: A Parsimonious Rule-based Model for
* Sentiment Analysis of Social Media Text. Eighth International Conference on
* Weblogs and Social Media (ICWSM-14). Ann Arbor, MI, June 2014.
**/
#[macro_use] extern crate map... |
#[macro_use]
extern crate clap;
#[macro_use]
extern crate log;
extern crate loggerv;
extern crate openssl_probe;
extern crate lal;
use lal::*;
use clap::{Arg, App, AppSettings, SubCommand, ArgMatches};
use std::process;
use std::ops::Deref;
fn is_integer(v: String) -> Result<(), String> {
if v.parse::<u32>().is_o... |
use std::{
collections::{HashMap, HashSet},
fmt::{self, Display, Formatter},
hash::Hash,
};
use crate::{
data_filtering::{PartialResults, Type},
error::{df_field_missing, df_unsupported_op, invalid_state, PolarResult},
normalize::*,
terms::*,
};
use serde::Serialize;
type TypeName = Strin... |
use std::{
path::{Path, PathBuf},
sync::{Arc, RwLock},
io,
net::Shutdown,
borrow::Cow,
fmt::Display,
pin::Pin
};
use crate::{
cache::{CacheRef, ReferencedCommit},
overlay::{self, Overlay, WorkspaceController},
types::RepoRef
};
use futures::{
future::{self, AbortHandle},
... |
use crate::backend::{Backend, Color, Effect};
use serde::{Deserialize, Serialize};
use unicode_width::UnicodeWidthStr;
const MIDDLE_PAD: &str = " |";
const ADDR_SIZE: usize = 11;
/// Contains 8 digits of an address, with a space in between and at the front and end
fn disp_addr(maddr: Option<usize>) -> String {
ma... |
//! Real-life loadtest scenario does not measure the TPS nor simulated the high load,
//! but rather simulates the real-life use case of zkSync:
//!
//! 1. Funds are deposited from one Ethereum account into one new zkSync account.
//! 2. Once funds are deposited, this account split the funds between N accounts
//! u... |
//! Main entry point for getting data. This module provides a simple API surface for getting data. You can always use any of the sub-modules to
//! get more granular access to the API, however, this will do all the work of piecing everything together.
//!
//!
use crate::boxscore::{BoxScoreDe, BoxScoreData, fix_boxsc... |
use std::ffi::CString;
use std::collections::HashMap;
use std::ptr;
use llvm;
use llvm::prelude::*;
use ir;
use ty;
use common;
use interner::{Interner, InternerId};
use trans;
mod helper;
pub mod execution_module;
mod utils;
use self::helper::*;
use self::execution_module::ExecutionModule;
pub fn llvm_codegen_prog... |
mod tests;
pub mod state;
pub mod msg;
pub mod error;
pub mod queries;
mod local_cw721_base;
pub use local_cw721_base::state::{TokenInfo};
use cosmwasm_std::{Empty,DepsMut,Addr, Coin, Uint128, to_binary, Decimal,BankMsg,SubMsg,StdError};
pub use local_cw721_base::{ContractError as Cw721ContractError,InstantiateMsg... |
/*
* Copyright (c) 2020-2022 <NAME>, <NAME>, <NAME>, <NAME>, <NAME>.
*
* This file is part of alevin-fry
* (see https://github.com/COMBINE-lab/alevin-fry).
*
* License: 3-clause BSD, see https://opensource.org/licenses/BSD-3-Clause
*/
use anyhow::{anyhow, bail};
use bio_types::strand::Strand;
use clap::{arg, cr... |
//! Structures and traits for transforming optimization models to standard form.
use std::collections::{HashSet, HashMap};
use crate::matrix::coo::CooMat;
use crate::problem::base::Problem;
use crate::problem::minlp::ProblemMinlp;
use crate::problem::milp::ProblemMilp;
use crate::problem::nlp::ProblemNlp;
use crate::... |
//! Hubcaps provides a set of building blocks for interacting with the Github API
//!
//! # Examples
//!
//! Typical use will require instantiation of a Github client. Which requires
//! a user agent string, a `hyper::Client`, and set of `hubcaps::Credentials`.
//!
//! The hyper client should be configured with tls.
/... |
#![cfg_attr(feature = "external_doc", feature(external_doc))]
// This tests the README to ensure code snippets work.
#![cfg_attr(feature = "external_doc", doc(include = "../README.md"))]
//!
#![deny(missing_docs)]
extern crate rand;
use ansi_escapes::EraseLines;
use colored::*;
use image::{DynamicImage, FilterType, ... |
// Copyright Materialize, Inc. 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 the Apache License... |
#![allow(clippy::many_single_char_names)]
use crate::{
ec::{GTPoint, Pairing},
poly::Field,
};
use super::{
constraints::*,
ec::{G1Point, G2Point},
matrix::Matrix,
poly::Poly,
};
pub trait PlonkTypes: PartialEq {
type GF: Field;
type SF: Field;
type G1: G1Point<S = Self::GF>;
... |
extern crate av1parser;
extern crate clap;
mod ivf;
mod level;
mod obu;
use av1parser as av1p;
use clap::{App, Arg};
use level::*;
use std::collections::VecDeque;
use std::fmt;
use std::fmt::{Display, Formatter};
use std::fs::{File, OpenOptions};
use std::io;
use std::io::{BufReader, BufWriter, Read, Seek, SeekFrom, ... |
use heck::CamelCase as _;
use proc_macro2::TokenStream;
use quote::{format_ident, quote};
use std::collections::{HashMap, HashSet};
use miniserde::Deserialize;
miniserde::make_place!(Place);
pub struct Api {
pub classes: Vec<GodotClass>,
pub api_underscore: HashSet<String>,
}
impl Api {
/// Construct an ... |
use std::any::Any;
use std::convert::{TryFrom, TryInto};
use std::fmt::{self, Debug};
use std::future::Future;
use std::io;
use std::ops::Range;
use std::pin::Pin;
use std::task::{Context, Poll};
use std::time::Duration;
use crate::article::Article;
use crate::arttype::ArtTypeScanner;
use crate::bus::Notification;
use... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
//! FIXME[everyone] Modules should be documented.
use crate::prelude::*;
use enso_text::unit::*;
use crate::application::tooltip;
use crate::application::tooltip::Placement;
use crate::component::node;
use crate::component::type_coloring;
use crate::view;
use crate::Type;
use enso_frp as frp;
use ensogl::data::color... |
// Copyright 2018 The proptest developers
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except a... |
mod cm;
#[cfg(feature = "inline")]
mod inline;
#[cfg(target_os = "macos")]
mod macos;
mod remote;
use crate::common::SOFTWARE_UPDATE_URL;
use crate::ipc;
use hbb_common::{
allow_err,
config::{self, Config, Fav, PeerConfig, APP_NAME, ICON},
log, sleep,
tokio::{self, time},
};
use sciter::Value;
use std::... |
//! Represents a Chunk of data (a collection of tables and their data within
//! some chunk) in the mutable store.
use arrow_deps::{
arrow::record_batch::RecordBatch,
datafusion::{
error::{DataFusionError, Result as DatafusionResult},
logical_plan::{Expr, ExpressionVisitor, Operator, Recursion},... |
use super::layer_state::*;
use super::render_entity::*;
use super::stroke_settings::*;
use super::renderer_core::*;
use super::renderer_layer::*;
use super::renderer_worker::*;
use super::renderer_stream::*;
use flo_render as render;
use flo_render::{RenderTargetId, TextureId, RenderTargetType};
use flo_canvas as canv... |
// Instructions
use crate::{
core::{ARMCondition, ARMv4},
memory::Mem32
};
use std::fmt;
#[derive(Clone)]
pub struct ARMv4Instruction {
pub cond: ARMCondition,
pub instr: ARMv4InstructionType,
}
impl ARMv4Instruction {
pub fn new(cond: ARMCondition, instr: ARMv4InstructionType) -> Self {
... |
use crate::ast::*;
use crate::resolve::gensym;
use crate::resolve::Ns;
use crate::Error;
use std::collections::{HashMap, HashSet};
/// Runs an expansion process on the fields provided to elaborate and expand
/// features from the module-linking proposal. Namely this handles>
///
/// * Injection of child `alias` direct... |
//! Radiotap field definitions and parsers.
pub mod ext;
use bitops::BitOps;
use byteorder::{ReadBytesExt, LE};
use std::io::{Cursor, Read};
use crate::{field::ext::*, Error, Result};
type OUI = [u8; 3];
/// The type of Radiotap field.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum Kind {
TSFT,
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.