text stringlengths 9.08k 47.9k |
|---|
use std::collections::BTreeMap;
use std::fs::Metadata;
use std::path::{Path, PathBuf};
use std::sync::atomic::{AtomicBool, AtomicUsize, Ordering};
use std::sync::Arc;
use std::thread::sleep;
use std::time::{Duration, SystemTime, UNIX_EPOCH};
use std::{fs, thread};
use crossbeam_channel::Receiver;
use rayon::prelude::*... |
//! Contains methods to generate many symmetry groups.
pub mod cyclic;
pub mod gen_iter;
pub mod group_item;
pub mod pairs;
pub mod permutation;
pub use gen_iter::*;
use std::{
array, iter,
iter::{Filter, Map, Once},
vec,
};
use crate::{
cox::{cd::CdResult, Cox},
float::Float,
geometry::Matr... |
/// This module responsible to write given data to specify object store and
/// read them back
use arrow::{
datatypes::{Schema, SchemaRef},
error::{ArrowError, Result as ArrowResult},
record_batch::RecordBatch,
};
use bytes::Bytes;
use data_types::chunk_metadata::ChunkAddr;
use datafusion::physical_plan::Se... |
use crate::chess_errors::*;
use crate::pieces::*;
use crate::positions::*;
use array_init::array_init;
use std::fmt::{self, Display};
use std::ops;
// ---------------------------------------------
// General
// ---------------------------------------------
pub const BOARD_SIZE: u8 = 8;
// This is very wasteful, only... |
use std::{
boxed::Box,
collections::BTreeMap,
io::{Read, Seek, SeekFrom, Write},
pin::Pin,
ptr::NonNull,
};
use byteordered::{Endianness, Endian};
mod counter;
mod traits;
pub mod builder;
pub mod error;
pub mod section;
pub mod updater;
use self::{
counter::Counter,
error::{Error, Result},
section::... |
// 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 std::alloc::Layout;
use std::any::Any;
use std::ffi::c_void;
use std::fmt::{self, Debug};
use std::mem;
use std::ptr::{self, NonNull};
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use anyhow::anyhow;
use log::info;
use liblumen_core::locks::RwLock;
use liblumen_core::sys::dynamic_call::Dynam... |
// 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... |
pub mod metrics;
pub mod qty;
pub mod tree;
// mod human_format;
use chrono::prelude::*;
use core::convert::TryFrom;
use itertools::Itertools;
use k8s_openapi::api::core::v1::{Node, Pod};
use kube::api::{Api, ListParams, ObjectList, Request};
#[cfg(prettytable)]
use prettytable::{cell, format, row, Cell, Row, Table};
... |
use crate::binary_parser::IonBinaryParser;
use crate::binary_parser_types::*;
use crate::ion_parser_types::*;
use crate::symbol_table::*;
use bigdecimal::BigDecimal;
use chrono::{naive::NaiveDate, DateTime, FixedOffset, Utc};
use log::trace;
use num_bigint::{BigInt, BigUint};
use num_traits::ops::checked::CheckedSub;
u... |
use super::layout::*;
use super::widget_data::*;
use super::layout_settings::*;
use crate::gtk_action::*;
use flo_ui::*;
use gtk;
use gtk::prelude::*;
use gdk::prelude::*;
use std::rc::*;
use std::collections::HashSet;
///
/// Indicates the floating position of a widget (used when laying it out again)
///
pub stru... |
#![no_std]
#![no_main]
#![feature(asm,const_fn,drop_types_in_const,lang_items,compiler_builtins_lib)]
extern crate capsules;
extern crate compiler_builtins;
#[macro_use(debug, static_init)]
extern crate kernel;
extern crate sam4l;
use capsules::rf233::RF233;
use capsules::timer::TimerDriver;
use capsules::virtual_ala... |
use iced::{
canvas::{self, event::{self, Event}, Cursor, Path, Stroke, Text},
mouse, keyboard, Color, Point, Rectangle, Size, HorizontalAlignment, VerticalAlignment,
};
use crate::central_ui;
use crate::puzzle_backend;
struct SquareUIInfo {
x: u32,
y: u32,
center: Point,
content_to... |
use std::collections::HashMap;
use std::sync::mpsc::{Receiver, RecvTimeoutError};
use std::sync::{Arc, Mutex};
use std::thread;
use std::time;
use gdk;
use glib;
use gtk;
use neovim_lib::neovim::Neovim;
use neovim_lib::neovim_api::NeovimApi;
use neovim_lib::NeovimApiAsync;
use neovim_lib::Value;
use gtk::prelude::*;
... |
use crate::configuration::{Configuration, Cors, ListenAddr};
use crate::http_server_factory::{HttpServerFactory, HttpServerHandle, Listener, NetworkStream};
use crate::FederatedServerError;
use apollo_router_core::http_compat::{Request, RequestBuilder, Response};
use apollo_router_core::prelude::*;
use apollo_router_co... |
#![allow(clippy::rc_buffer)]
use super::{
broadcast_utils::{self, ReceiveResults},
*,
};
use crate::{broadcast_stage::broadcast_utils::UnfinishedSlotInfo, cluster_nodes::ClusterNodes};
use solana_ledger::{
entry::Entry,
shred::{
ProcessShredsStats, Shred, Shredder, MAX_DATA_SHREDS_PER_FEC_BLOCK... |
// 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... |
mod license;
use crate::{process::ProcessBuilderExt as _, shell::Shell, toolchain, User};
use anyhow::{bail, Context as _};
use camino::{Utf8Path, Utf8PathBuf};
use cargo_metadata as cm;
use cargo_util::ProcessBuilder;
use if_chain::if_chain;
use indoc::indoc;
use itertools::Itertools as _;
use krates::PkgSpec;
use ra... |
// Copyright 2020 The Grin Developers
//
// 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 2022 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::Result,
argh::{from_env, FromArgs},
fidl::endpoints::{create_endpoints, create_proxy, ServerEnd},
fidl_fuchsia_io as fio,
... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::ChainInfo;
use anyhow::{format_err, Result};
use cluster_test::atomic_histogram::*;
use diem_client::{views::AmountView, Client as JsonRpcClient, MethodRequest};
use diem_logger::*;
use diem_sdk::{
move_types::account_add... |
// Copyright (c) 2016 Chef Software Inc. and/or applicable contributors
//
// 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 r... |
//! Contains device specific options of AVRA-rs
use lazy_static::lazy_static;
use maplit::{btreeset, hashmap};
use std::collections::{BTreeSet, HashMap};
#[derive(Clone, PartialEq, Eq, PartialOrd, Ord, Debug)]
pub enum DisabledOptions {
NoMul,
/// No JMP, CALL
NoJmp,
/// No X register
NoXreg,
... |
//! The module with the [`Graph`] presenter. See [`crate::presenter`] documentation to know more
//! about presenters in general.
use crate::prelude::*;
use enso_web::traits::*;
use crate::controller::upload::NodeFromDroppedFileHandler;
use crate::executor::global::spawn_stream_handler;
use crate::presenter::graph::s... |
use super::math_utilities::get_bit_width_from;
use crate::errors::CalyxResult;
use crate::ir::traversal::ConstructVisitor;
use crate::ir::GetAttributes;
use crate::{build_assignments, guard, passes, structure};
use crate::{
errors::Error,
ir::{
self,
traversal::{Action, Named, VisResult, Visitor... |
// 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 std::time::Duration;
use bevy::prelude::*;
use easy_cast::*;
use crate::{
debug::{spawn_collision_debug_box, DebugAssets},
joyride::{JoyrideInput, JoyrideInputState, FIELD_WIDTH, TIME_STEP},
racer::{
get_turning_sprite_desc, make_racer, OverlayOffsets, Racer, RacerAssets, RacerOverlay,
... |
#![cfg_attr(feature = "simd", feature(portable_simd))]
use glium::texture::SrgbTexture2d;
use glium::{glutin, implement_vertex, uniform, DrawParameters, Program, Surface};
use glutin::event_loop::EventLoopProxy;
use winit::dpi::PhysicalSize;
use winit::event::{Event, KeyboardInput, VirtualKeyCode, WindowEvent};
use wi... |
use std::cell::RefCell;
use std::cmp::{Ordering, Reverse};
use std::collections::BinaryHeap;
use crate::sdl2::rect::Rect;
use crate::sdl2::render::TextureCreator;
use crate::sdl2::video::WindowContext;
use rand::Rng;
use crate::animation::Animation;
use crate::character::{Action, Character, CharacterKind, CharacterPo... |
#![cfg_attr(docsrs, feature(doc_cfg))]
//! A rust runtime for Tencent Cloud Serverless Compute Function
//!
//! This library provides a basic custom runtime for a rust application
//! on Tencent Cloud as Serverless Compute Function. For complete setup,
//! see [Setup].
//!
//! # `start` vs `start_uncatched`
//! There ... |
pub mod charsets;
pub mod seq_parser;
use self::charsets::{CODE_PAGE_0, CODE_PAGE_1};
use self::seq_parser::{Action, ClearType, CodePage, LineSize, SeqParser};
use std::{char, f64, mem};
#[derive(Debug, PartialEq, Eq, Clone, Copy)]
pub struct CellStyle {
attrs: u16,
fg: u32,
bg: u32,
}
impl CellStyle {
... |
//! # mauth-client
//!
//! This crate allows users of the Hyper crate for making HTTP requests to sign those requests with
//! the MAuth protocol, and verify the responses. Usage example:
//!
//! **Note**: This crate and Rust support within Medidata is considered experimental. Do not
//! release any code to Production ... |
// Copyright 2012-2014 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 2016 TiKV Project Authors. Licensed under Apache-2.0.
use std::path::Path;
use std::sync::{Arc, Mutex, RwLock};
use std::time::Duration;
use std::{thread, usize};
use futures::executor::block_on;
use grpcio::{ChannelBuilder, EnvBuilder, Environment, Error as GrpcError, Service};
use kvproto::deadlock::cr... |
use crate::FileSpec;
use crate::{Age, Cleanup, Criterion, FlexiLoggerError, Naming};
use chrono::{DateTime, Datelike, Local, Timelike};
use std::cmp::max;
use std::fs::{File, OpenOptions};
use std::io::{BufRead, BufReader, BufWriter, Write};
use std::ops::Add;
use std::path::{Path, PathBuf};
use super::{Confi... |
//! The global part of a plan implementation.
use super::controller_collector_context::ControllerCollectorContext;
use super::PlanConstraints;
use crate::mmtk::MMTK;
use crate::plan::transitive_closure::TransitiveClosure;
use crate::plan::Mutator;
use crate::policy::immortalspace::ImmortalSpace;
use crate::policy::lar... |
pub use crate::gui::{GuiContext, ScreenFader};
use crate::*;
const PONGI_RADIUS: f32 = 7.5;
const PONGI_BASE_SPEED: f32 = 15.0 * UNIT_SIZE;
const WALL_THICKNESS: f32 = 0.5 * UNIT_SIZE;
const PADDLE_SIZE: f32 = 3.0 * UNIT_SIZE;
const FIELD_BOUNDS: Rect = Rect {
left: -10.0 * UNIT_SIZE,
right: 10.0 * UNIT_SIZE... |
// Copyright 2015-2016 <NAME>.
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL... |
// Copyright 2014 <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 writi... |
#![deny(rust_2018_idioms)]
#![warn(clippy::pedantic)]
mod error;
mod transport;
use crate::error::Result;
use crate::transport::{HttpQueryTransport, QueryParams};
use bottlerocket_release::BottlerocketRelease;
use chrono::Utc;
use model::modeled_types::FriendlyVersion;
use semver::Version;
use serde::{Deserialize, Se... |
//! This module contains abstracted versions of bytecode primitives that the compiler uses to
//! ensure correctness and safety.
//!
//! These ops are different from [VirtualOp]s in that they contain allocated registers, i.e. at
//! most 48 free registers plus reserved registers. These ops can be safely directly conver... |
use regex::Regex;
use thiserror::Error;
use chrono::Timelike;
use crate::{CrcError, calc_crc};
/// `BIPM` tracking duration specifications.
/// `Cggtts` tracks must respect that duration
/// to be BIPM compliant, which is not mandatory
pub const BIPM_SPECIFIED_TRACKING_DURATION: std::time::Duration = std::time::Dura... |
use std::net::{IpAddr,Ipv4Addr,Ipv6Addr};
use std::fmt;
use ikev2_transforms::*;
use ikev2_notify::NotifyType;
/// Payload exchange type: SA, Auth, CreateChildSA, etc.
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct IkeExchangeType(pub u8);
impl IkeExchangeType {
pub const IKE_SA_INIT : IkeExchangeType = Ike... |
//! Utilities for working with colors and color palettes.
use num_traits::{Bounded, FromPrimitive, NumCast};
use std::fmt;
/// A construct that can be treated as encoding a solid color.
pub trait SolidColor<T: NumCast + Bounded>: Color<T> + Into<Rgb<T>> + Into<Hsl<T>> {
/// Converts the color to RGB.
fn to_rg... |
// Copyright (c) The cargo-guppy Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
use crate::{
errors::RulesError,
rules::{
DeterminatorPostRule, DeterminatorRules, MarkChangedImpl, PathMatch, PathRuleImpl,
RulesImpl,
},
};
use globset::Candidate;
use guppy::{
graph::{
... |
//! # Non Fungible Token
//! The module provides implementations for non-fungible-token.
//!
//! - [`Config`](./trait.Config.html)
//! - [`Call`](./enum.Call.html)
//! - [`Module`](./struct.Module.html)
//!
//! ## Overview
//!
//! This module provides basic functions to create and manager
//! NFT(non fungible token) su... |
use anyhow::{anyhow, Result};
use cookie::Expiration;
use cookie::{Cookie, CookieJar};
use lazy_static::lazy_static;
use log::debug;
use reqwest::blocking::{Client, Response};
use reqwest::{header, redirect, StatusCode, Url};
use scraper::{Html, Selector};
use serde::{Deserialize, Deserializer, Serialize};
use std::col... |
use crate::dijkstra::potentials::cch_parallelization_util::{
ForEachIter, ParIter, SeparatorBasedParallelCustomization, SeparatorBasedPerfectParallelCustomization, SeqIter,
};
use crate::dijkstra::potentials::corridor_lowerbound_potential::shortcut::{PartialShortcutWrapperGraph, ShortcutWrapper};
use crate::dijkstr... |
use std::cmp::Ordering;
use std::string::FromUtf8Error;
#[cfg(not(feature = "library"))]
use cosmwasm_std::entry_point;
use cosmwasm_std::{
to_binary, Addr, Binary, CosmosMsg, Decimal, Deps, DepsMut, Empty, Env, MessageInfo, Order,
Reply, Response, StdResult, SubMsg, Uint128, WasmMsg,
};
use cw2::set_contract... |
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq)]
pub struct TradingSessionListUpdateReport {
/// MsgType = BS
#[serde(flatten)]
pub standard_message_header: super::super::standard_message_header::StandardMessageHeader<'B', 'S'>,
/// ApplicationSequenceContro... |
// taken from here: https://github.com/mjaakkol/sgp40-rs
/// This work is a port of Sensirion VOC indexing algorithm from
/// https://github.com/Sensirion/embedded-sgp/tree/master/sgp40_voc_index
/*
* Copyright (c) 2020, Sensirion AG
* All rights reserved.
*
* Redistribution and use in source and binary forms, wit... |
// Copyright (c) 2017 <NAME> <<EMAIL>>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
use crate::iq::IqSetPayload;
use crate::jingle_grouping::Group;
use crate::... |
/*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
use crate::cl::CommandLine;
use std::cell::{Cell, UnsafeCell};
use std::collections::HashSet;
use std::ops::Deref;
use std::rc::Rc;... |
use std::cell::Cell;
use std::convert::TryFrom;
use std::io::Write;
use std::ops::{Add, Deref, DerefMut, Index};
use std::rc::Rc;
use std::sync::Arc;
use std::usize;
use crate::atn::ATN;
use crate::atn_config::{ATNConfig, ATNConfigType};
use crate::atn_config_set::ATNConfigSet;
use crate::atn_simulator::{BaseATNSimula... |
use crate::ast::*;
use crate::error;
use crate::error::Error;
use crate::hir::hir_maker::HirMaker;
use crate::hir::hir_maker_context::*;
use crate::hir::*;
use crate::parser::token::Token;
use crate::type_checking;
/// Result of looking up a lvar
#[derive(Debug)]
enum LVarInfo {
/// Found in the current scope
... |
// Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
// Licensed under the Apache License, Version 2.0 (see LICENSE).
#![deny(warnings)]
// Enable all clippy lints except for many of the pedantic ones. It's a shame this needs to be copied and pasted across crates, but there doesn't appear to be a way to... |
#[cfg(test)]
mod tests;
use crate::{
ast::*,
error::GleamExpect,
pretty::*,
project::{self, Analysed, OutputFile},
typ::{
ModuleValueConstructor, PatternConstructor, Type, ValueConstructor, ValueConstructorVariant,
},
};
use heck::{CamelCase, SnakeCase};
use itertools::Itertools;
use st... |
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.
//! The documentation for the inspector API is sparse, but these are helpful:
//! <https://chromedevtools.github.io/devtools-protocol/>
//! <https://hyperandroid.com/2020/02/12/v8-inspector-from-an-embedder-standpoint/>
use crate::error::gener... |
// 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 syn::Type;
use makepad_render::*;
use makepad_widget::*;
use makepad_hub::*;
use makepad_microserde::*;
use makepad_http::channel::WebSocketChannels;
use crate::makepadwindow::*;
use crate::filetree::*;
use crate::fileeditor::*;
use crate::buildmanager::*;
use std::collections::{HashMap, HashSet, BTreeSet};
use c... |
use std::collections::HashMap;
use std::str::FromStr;
use std::sync::{atomic, Arc};
use std::time::Duration;
use async_trait::async_trait;
use async_tungstenite::{
tokio::{connect_async, ConnectStream},
tungstenite::Message as WsMessage,
WebSocketStream,
};
use derive_more::Display;
use futures_util::{
... |
use digest::Digest;
use sha2::{Sha512};
use curve25519::{GeP2, GeP3, ge_scalarmult_base, sc_reduce, sc_muladd, curve25519, Fe};
use util::{fixed_time_eq};
use std::ops::{Add, Sub, Mul};
static L: [u8; 32] =
[ 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
... |
use crate::errors::{YdbError, YdbResult};
use std::collections::HashMap;
use std::convert::TryInto;
use std::fmt::Debug;
use std::ops::Deref;
use std::time::Duration;
use strum::{EnumDiscriminants, EnumIter, IntoStaticStr};
use ydb_grpc::ydb_proto;
const SECONDS_PER_DAY: u64 = 60 * 60 * 24;
/// Internal represent da... |
#![forbid(unsafe_code)]
#![deny(clippy::unwrap_used)]
use serde::{ser::SerializeSeq, Deserialize, Serialize, Serializer};
use serde_bytes::Bytes;
use std::convert::{TryFrom, TryInto};
use std::fmt;
use std::iter::FromIterator;
use std::ops::Deref;
use std::ops::DerefMut;
#[cfg(test)]
pub(crate) mod arbitrary;
#[cfg(t... |
// Copyright (c) 2017 <NAME>
//
// 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. All files in the project carrying such notice may not be copied,
// modified, ... |
use std::collections::VecDeque;
use std::mem;
use std::sync::Arc;
use std::time::Duration;
use eyre::WrapErr;
use vulkano::descriptor::pipeline_layout::PipelineLayoutAbstract;
use vulkano::image::{attachment::AttachmentImage, view::ImageView};
use vulkano::image::{
ImageAccess, ImageLayout, ImageUsage, ImmutableIm... |
//! # Lightweight Directory Access Protocol V3 (LDAPv3)
//! `rasn-ldap` is an implementation of the data types defined in IETF
//! [RFC 4511] also known LDAPv3. This does not provide
//! an implementation of a client or server, but provides a shared
//! implementation to build your own clients and servers.
//!
//! [RFC... |
//! This is a simple yet expressive router for http requests, abstract enough to be used with any http library on stable Rust.
//!
//! ### Key features:
//! - Very expressive routes with fully typed parameters
//! - Can be used with any http lib
//! - Few dependencies (only `regex` and `lazy_static`)
//!
//! ### Gettin... |
const MCCMNC_CODES_HAVING_3DIGITS_MNC: &'static [&'static str] = &[
"001001", "242017", "330110", "350000", "352030", "352050", "352110", "354860", "356110",
"358110", "360050", "360100", "360110", "362630", "362951", "364390", "366020", "366050",
"366110", "374120", "374130", "374140", "376050", "376350",... |
//! From http://burtleburtle.net/bob/hash/spooky.html
//!
//! Quoted comments are from http://burtleburtle.net/bob/c/SpookyV2.h or
//! http://burtleburtle.net/bob/c/SpookyV2.cpp
use std::hash::Hasher;
use std::mem;
use std::num::Wrapping;
use std::ptr;
/// number of uint64's in internal state
const SC_NUM_VARS: usize... |
// Copyright 2021 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
use {
crate::app::EventProxy,
crate::args::{MAX_FONT_SIZE, MIN_FONT_SIZE},
crate::colors::{ColorScheme, DARK_COLOR_SCHEME, LIGHT_COLOR_SCHEME, ... |
use core::cmp;
use std::collections::HashMap;
use std::ops::Range;
use ab_poa::abpoa_wrapper::{AbpoaAligner, AbpoaAlignmentResult};
use handlegraph::handle::Handle;
use itertools::Itertools;
//use rayon::prelude::*;
use crate::chain::Chain;
use crate::index::Index;
use log::{info, warn};
use std::env;
use std::time:... |
#![cfg_attr(not(feature = "std"), no_std)]
pub mod weights;
mod tests;
pub use pallet::*;
use sp_std::prelude::*;
use frame_support::pallet_prelude::*;
use frame_system::pallet_prelude::*;
use scale_info::TypeInfo;
use sp_std::fmt::Debug;
use sp_runtime::{
DispatchResult, RuntimeDebug, traits::{Zero, BadOrigin},
};... |
use std::{
any::{Any, TypeId},
cell::RefCell,
collections::{hash_map::Entry, HashMap, HashSet},
convert::TryInto,
fmt::Write,
io::{self, ErrorKind},
rc::Rc,
sync::Arc,
};
use async_io::block_on;
use fdo::{DBusProxy, RequestNameFlags};
use futures_util::StreamExt;
use scoped_tls::scoped_... |
use std::collections::{BTreeMap, VecDeque};
use std::pin::Pin;
use std::task::{Context, Poll};
use ethers::prelude::Middleware;
use ethers::types::{Address, TxHash, U256};
use futures::{future, Future, FutureExt, Stream, StreamExt};
use rust_decimal::prelude::*;
use thiserror::Error;
use tokio_postgres::{config::Confi... |
// std
use std::borrow::Borrow;
use std::cell::Cell;
use std::f32::consts::PI;
use std::iter::once;
use std::sync::{Arc, RwLock};
mod nn_v2;
use crate::blockqueue::BlockQueue;
// pbrt
// use crate::core::bssrdf::Bssrdf;
use crate::core::camera::{Camera, CameraSample};
use crate::core::geometry::{
pnt2_inside_exclu... |
#![allow(clippy::needless_range_loop)]
/// Defines a trait to chain two types of CRHs.
use crate::crh::{MMRTwoToOneCRHScheme};
use crate::{CRHScheme, Error};
use ark_ff::ToBytes;
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
use ark_std::borrow::{Borrow, Cow};
use ark_std::hash::Hash;
use ark_std::ve... |
use super::{
flservice::flservice_server::Flservice,
params::{EncModelParamType, EncModelParams, PlainParams},
};
use super::{
flservice::{
model_parameters, server_model_data, status_message, train_request, train_response,
},
params::GlobalModel,
};
use super::{
flservice::{
Con... |
//! Type-checking for the rust-intrinsic and platform-intrinsic
//! intrinsics that the compiler exposes.
use rustc::traits::{ObligationCause, ObligationCauseCode};
use rustc::ty::{self, TyCtxt, Ty};
use rustc::ty::subst::Subst;
use crate::require_same_types;
use rustc_target::spec::abi::Abi;
use syntax::symbol::Inte... |
#![no_std]
#![no_main]
use core::f32::consts::{PI, FRAC_PI_2, FRAC_PI_3, FRAC_PI_4, FRAC_PI_6};
use cortex_m::interrupt::{free as disable_interrupts, CriticalSection};
use cortex_m::peripheral::NVIC;
use heapless::consts::{U8, U16};
use heapless::spsc::Queue;
use micromath::F32Ext;
use vl53l0x::VL53L0x;
use xca9548a:... |
// Copyright (c) 2018-2021 The MobileCoin Foundation
//! MobileCoin Client Object
use crate::{
cached_tx_data::{CachedTxData, OwnedTxOut},
error::{Error, Result},
TransactionStatus,
};
use core::{convert::TryFrom, str::FromStr};
use fog_api::ledger::TxOutResultCode;
use fog_ledger_connection::{
FogKey... |
use crate::*;
use core::sync::atomic::{AtomicU64, Ordering};
/// A trait defining bitfield operations we need for tracking allocated objects within a page.
pub(crate) trait Bitfield {
fn initialize(&mut self, for_size: usize, capacity: usize);
fn first_fit(
&self,
base_addr: usize,
layo... |
// Copyright © 2015, <NAME>
// Licensed under the MIT License <LICENSE.md>
//! Mappings for the contents of OAIdl.h
pub type wireBRECORD = *mut _wireBRECORD;
pub type wireVARIANT = *mut _wireVARIANT;
STRUCT!{struct SAFEARRAYBOUND {
cElements: ::ULONG,
lLbound: ::LONG,
}}
STRUCT!{struct SAFEARR_BSTR {
Size: ... |
//! This module contains Yew's implementation of a reactive virtual DOM.
#[doc(hidden)]
pub mod key;
#[doc(hidden)]
pub mod listeners;
#[doc(hidden)]
pub mod vcomp;
#[doc(hidden)]
pub mod vlist;
#[doc(hidden)]
pub mod vnode;
#[doc(hidden)]
pub mod vportal;
#[doc(hidden)]
pub mod vtag;
#[doc(hidden)]
pub mod vtext;
us... |
// unfortunately there are two conflicting memory maps in use for these registers
#[cfg(feature = "fdcan_g0_g4_l5")]
pub use ie_g0_g4_l5 as ie;
#[cfg(feature = "fdcan_g0_g4_l5")]
pub use ile_g0_g4_l5 as ile;
#[cfg(feature = "fdcan_g0_g4_l5")]
pub use ils_g0_g4_l5 as ils;
#[cfg(feature = "fdcan_g0_g4_l5")]
pub use ir_g0... |
// Copyright 2017 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-M... |
use crate::alsa;
use std::ffi::{CStr, CString};
use super::error::*;
use super::mixer::MilliBel;
use super::Round;
use std::{ptr, mem, fmt, cmp};
use crate::{Card, poll};
use std::cell::UnsafeCell;
use libc::{c_uint, c_void, size_t, c_long, c_int, pollfd, c_short};
/// We prefer not to allocate for every ElemId, Elem... |
macro_rules! elf_dyn {
($size:ty) => {
#[repr(C)]
#[derive(Copy, Clone, PartialEq, Default)]
#[cfg_attr(feature = "alloc", derive(Pread, Pwrite, SizeWith))]
/// An entry in the dynamic array
pub struct Dyn {
/// Dynamic entry type
pub d_tag: $size,
... |
use std::io;
use std::fs::File;
use std::io::{Read, BufReader};
use std::ffi::CString;
use std::cell::Cell;
use std::path::Path;
use std::time::Instant;
use gl::types::*;
use cgmath::{Matrix4, Point3, Vector3, Deg, perspective};
use sdl2::mouse::MouseButton;
use sdl2::event::{Event, WindowEvent};
use sdl2::video::Sw... |
// Copyright (c) 2019 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
use fnv::{FnvHashMap, FnvHashSet};
use std::fmt;
use std::rc::Rc;
use crate::ast::*;
use crate::store::*;
use crate::value::*;
#[derive(Debug)]
pub struct Error<'a> {
pub messa... |
//! Utilities to deal with rewritten commits. See `Event::RewriteEvent` for
//! specifics on commit rewriting.
use std::collections::{HashMap, HashSet};
use anyhow::Context;
use cursive::utils::markup::StyledString;
use fn_error_context::context;
use indicatif::{ProgressBar, ProgressStyle};
use crate::core::formatti... |
//! Provides an allocator for virtual memory pages.
//! The minimum unit of allocation is a single page.
//!
//! This also supports early allocation of pages (up to 32 individual chunks)
//! before heap allocation is available, and does so behind the scenes using the same single interface.
//!
//! Once heap allocat... |
use crate::{utils::clamp, Line, Size};
use std::{
fmt,
ops::{Add, Div, Mul, Sub},
};
/// Scalar type
pub type Scalar = f64;
/// Epsilon value
pub const EPSILON: f64 = std::f64::EPSILON;
/// Square root of the epsilon value
pub const EPSILON_SQRT: f64 = 1.490_116_119_384_765_6e-8;
/// Mathematical pi constant
p... |
use crate::{def::*, file::*, global::*, log::Log, model::*};
#[cfg(target_os = "linux")]
use anyhow::Context;
use crossterm::terminal::size;
#[cfg(target_os = "linux")]
use std::io::Read;
use std::{self, fs, path::*, process::*, *};
use unicode_width::*;
pub fn get_str_width(msg: &str) -> usize {
let msg... |
use crate::evaluation::*;
use crate::move_generation::MoveGenerator;
use crate::moves::Move;
use crate::position::{Position, HALFMOVE_CLOCK_AT_DRAW};
use crate::transposition_table::TranspositionTable;
use crossbeam_channel::{Receiver, Sender};
use rand::seq::SliceRandom;
use std::cmp::{max, min, Ordering};
use std::co... |
use std::ops::{Deref, DerefMut};
use base::ast::{Literal, TypedIdent};
use base::fnv::FnvSet;
use base::merge::merge_iter;
use base::kind::{ArcKind, KindEnv};
use base::types::{Alias, ArcType, RecordSelector, TypeEnv};
use base::scoped_map::ScopedMap;
use base::symbol::{Symbol, SymbolRef};
use core::{self, Allocator, C... |
/*
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0.
*/
//! Ecs Credentials Provider
//!
//! This credential provider is frequently used with an AWS-provided credentials service (e.g.
//! [IAM Roles for tasks](https://docs.aws.amazon.com/AmazonECS/latest/dev... |
//! A custom lexer for AWK for use with LALRPOP.
//!
//! This lexer is fairly rudamentary. It ought not be too slow, but it also has not been optimized
//! very aggressively. Various edge cases still do not work.
use hashbrown::HashMap;
use lazy_static::lazy_static;
use regex::Regex;
use unicode_xid::UnicodeXID;
use c... |
// Copyright (C) 2020-2022 <NAME>.
// note: this module is very slow and may need a lot of space
// and it still has many bugs
use super::{display, fash, game_config, klv, kwg, move_picker, movegen};
// move one tile at a time from rack
#[derive(Clone, Eq, Hash, PartialEq)]
struct PlacedTile {
tile: u8, // 0x01... |
use crate::utils::{self, CliEnv};
use actix_web::{
http::{self, uri::Uri},
web,
};
use awc::Client;
use failure::Error;
use futures::stream::Stream;
use futures::{
future::{self, Either},
Future,
};
use graphql_client::*;
use serde::{Deserialize, Serialize};
use std::fmt;
use std::io;
use std::path::{Pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.