text stringlengths 7.05k 33.9k |
|---|
//! # Plot module
//!
//! This module defines the `Plot` struct, which is used to create a 2D plot that will
//! contain all other objects that can be created using this library.
use crate::{Context, PlotLocation, PlotOrientation, PlotUi, YAxisChoice, NUMBER_OF_Y_AXES};
use bitflags::bitflags;
pub use imgui::Condition;... |
//! Authorizer structure and associated functions
use super::builder::{
constrained_rule, date, fact, pred, s, string, var, Binary, Check, Expression, Fact, Op,
Policy, PolicyKind, Rule, Term, Unary,
};
use super::Biscuit;
use crate::datalog::{self, RunLimits};
use crate::error;
use crate::time::Instant;
use pr... |
mod alias {
pub enum Commands {
NewBeacon = 15,
DelBeacon = 17,
RegisterAction = 60,
Action = 62,
ActionTxStatus = 64,
}
}
// Commands
// Do not change order; acts as ABI
pub enum Commands {
Unspec,
GetWiPhy,
SetWiPhy,
NewWiPhy,
DelWiPhy,
Ge... |
use fnv::{FnvHashSet, FnvHashMap};
use simple_symbol::{store, Symbol};
use ast::*;
use ir;
use ty::*;
use operand::Label;
use check::context::{Binding, VarContext, TypeContext};
use check::escape::trap_ast;
use translate::*;
use error::{Error, TypeError};
use span::{Span, IntoSpan};
type Typed = (Ty, ir::Tree);
fn e... |
use crate::{
device::AllowedIp, DeviceConfigBuilder, DeviceInfo, InvalidKey, PeerConfig, PeerConfigBuilder,
PeerInfo, PeerStats,
};
use wgctrl_sys::{timespec64, wg_device_flags as wgdf, wg_peer_flags as wgpf};
use std::{
ffi::{CStr, CString},
io,
net::{IpAddr, SocketAddr},
os::raw::c_char,
... |
#![feature(integer_atomics)]
//! This is a library for Monte Carlo tree search.
//!
//! It is still under development and the documentation isn't good. However, the following example may be helpful:
//!
//! ```
//! use mcts::*;
//! use mcts::tree_policy::*;
//! use mcts::transposition_table::*;
//!
//! // A really sim... |
use std::{collections::HashMap, env, io, io::prelude::*};
fn main() {
let args: Vec<String> = env::args().collect();
let part = args.get(1).cloned().unwrap_or(String::from("1"));
let reader = io::stdin();
let lines = reader.lock().lines();
let values = lines.map(|x| x.unwrap());
match part.as... |
#[cfg(test)]
mod tests;
use crate::ast::*;
use crate::pretty::*;
use crate::typ::{
ModuleValueConstructor, PatternConstructor, ValueConstructor, ValueConstructorVariant,
};
use heck::{CamelCase, SnakeCase};
use itertools::Itertools;
use std::char;
use std::default::Default;
const INDENT: isize = 4;
#[derive(Debu... |
//! Pin Multiplexer (Pinmux) configurations for various I/O controllers.
//!
//! # Description
//!
//! Tegra X1 devices can be configured with different I/O functions to
//! allow use in a variety of different configurations.
//!
//! Many of the pins on Tegra X1 devices are connected to multi-purpose
//! I/O (MPIO) pad... |
#![no_main]
#![no_std]
#![feature(abi_msp430_interrupt)]
use msp430::{asm};
use core::cell::RefCell;
use embedded_hal::digital::v2::OutputPin;
use embedded_hal::prelude::*;
use msp430_rt::entry;
use msp430fr5949_hal::{
clock::{ClockConfig, DcoclkFreqSel, MclkDiv, SmclkDiv, SmclkSel},
fram::Fram,
gpio::{Bat... |
//! A filesystem-backed N5 container.
use std::fs::{
self,
File,
};
use std::io::{
Error,
ErrorKind,
BufReader,
BufWriter,
Read,
Result,
Seek,
SeekFrom,
};
use std::path::{
PathBuf,
};
use std::str::FromStr;
use fs2::FileExt;
use serde_json::{
self,
json,
Value,... |
//! Low-level hardware access library for the Nintendo Switch.
//!
//! **Note:** This code is written specifically for the Switch.
//! If you decide to use it for other Tegra210 platforms, use
//! at own risk.
#![no_std]
#![feature(const_fn)]
#![feature(optimize_attribute)]
#[macro_use]
extern crate bitflags;
#[macr... |
//! The [`Hash`] struct, which provides a hash-join based implementation of
//! [`Join`].
#[cfg(not(feature = "use_hashbrown"))]
use std::collections::hash_map::{HashMap, RandomState as DefaultHashBuilder, RawEntryMut};
use std::mem::MaybeUninit;
use std::pin::Pin;
use std::{
hash::{BuildHasher, Hasher},
ptr::... |
use crate::error::{ErrorKind, LoftyError, Result};
use crate::iff::chunk::Chunks;
use crate::tag::item::{ItemKey, ItemValue, TagItem};
use crate::tag::{Tag, TagType};
use crate::traits::{Accessor, TagExt};
use std::convert::TryFrom;
use std::fs::{File, OpenOptions};
use std::io::{Read, Seek, SeekFrom, Write};
use std:... |
// This file is part of Substrate.
// Copyright (C) 2018-2021 Parity Technologies (UK) Ltd.
// SPDX-License-Identifier: Apache-2.0
// 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
//
// ht... |
use super::index::BodyIndex;
use super::*;
use crate::body::Body;
use crate::util::*;
use gdnative::core_types::*;
use gdnative::godot_error;
use rapier3d::dynamics::{RigidBody, RigidBodyActivation, RigidBodyBuilder, RigidBodyType};
#[derive(Debug)]
enum Type {
Static,
Kinematic,
Rigid,
Character,
}
#[derive(Debu... |
// This file is part of yash, an extended POSIX shell.
// Copyright (C) 2021 <NAME>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) ... |
// Copyright 2019-2021 Thales Inc.
// This file is part of Thales.
// Thales is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
// Th... |
// Copyright 2021 <NAME>
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to tho... |
/// ! Method for creating a new partition entities in the world.
use crate::*;
use disk_types::*;
use loopdev::LoopControl;
use std::path::PathBuf;
/// The default LVM2 header size is 1MiB.
const LVM_DEFAULT_HEADER_SIZE: u64 = 1024 * 1024;
/// The default LVM2 extent size is 4MiB.
const LVM_DEFAULT_EXTENT_SIZE: u64 = ... |
use js_sys::{Array, Error, Object, Reflect, TypeError, Uint8Array};
use wasm_bindgen::prelude::*;
use image::dxt;
use unityfs::Data;
#[wasm_bindgen]
pub struct UnityFs {
input: Vec<u8>,
}
#[wasm_bindgen]
impl UnityFs {
pub fn load(input: Vec<u8>) -> UnityFs {
console_error_panic_hook::set_once();
... |
#![allow(dead_code)]
use bitflags::*;
use kernel_hal::user::*;
pub use linux_object::ipc::*;
use numeric_enum_macro::numeric_enum;
use zircon_object::vm::*;
use super::*;
/// Syscalls of inter-process communication and System V semaphore Set operation.
///
/// # Menu
///
/// - [`semget`](Self::sys_semget)
/// - [`se... |
//! Distribution Handshake implementation.
//!
//! This handshake is used by an Erlang node for connecting to another one.
//!
//! See [12.2 Distribution Handshake]
//! (http://erlang.org/doc/apps/erts/erl_dist_protocol.html#id104553)
//! for more details about distribution handshake.
use futures::{self, Future};
use h... |
//! FLoating point power utilities.
use crate::traits::*;
use super::decimal::*;
// STABLE POWER
/// Stable power implementations for increased numeric stability.
pub trait StablePower: Float + ExactExponent + TablePower {
// /// Calculate pow2 with numeric exponent.
// #[cfg(any(test, not(feature = "... |
use core::mem::{size_of, swap};
use alloc::{
boxed::Box,
collections::{BTreeMap, LinkedList, VecDeque},
vec::Vec,
};
use coap_lite::{CoapOption, CoapRequest, Header, MessageClass, MessageType, Packet};
pub use error::*;
use pal::timer::get_time_ms;
use smoltcp::{
socket::{SocketRef, UdpSocket},
wir... |
use crate::xplatform::protocol::SetKey;
use std::fmt::Display;
use std::net::IpAddr;
use std::net::SocketAddr;
/// Documentation of each field comes from:
/// https://www.wireguard.com/xplatform/#configuration-protocol
#[derive(Debug, Default, PartialEq)]
pub struct Device {
/// The value for this key should be a ... |
// Copyright (c) Facebook, Inc. and its affiliates.
use anyhow::{bail, Result};
use cursive::theme::{Color, Effect, PaletteColor, Style};
use cursive::utils::markup::StyledString;
use cursive::view::{Resizable, ScrollStrategy, Scrollable, SizeConstraint, View};
use cursive::views::{BoxedView, Dialog, LinearLayout, Text... |
/*******************************************************************************
* Copyright 2020 <NAME> <<EMAIL>>
* SPDX-License-Identifier: Apache-2.0
* Refer to the file "LICENSE" for details.
*******************************************************************************/
use crate::common::core::{DecodeArgument, ... |
use crate::b2_body::*;
use crate::b2_broad_phase::*;
use crate::b2_collision::*;
use crate::b2_math::*;
use crate::b2_settings::*;
use crate::b2_shape::*;
use crate::linked_list::*;
use crate::private::dynamics::b2_fixture as private;
use std::cell::RefCell;
use std::rc::{Rc, Weak};
#[cfg(feature="serde_support")]
use... |
// Copyright 2020 Contributors to the Parsec project.
// SPDX-License-Identifier: Apache-2.0
use log::error;
use parsec_interface::operations::psa_algorithm::*;
use parsec_interface::operations::psa_key_attributes::*;
use parsec_interface::requests::{ResponseStatus, Result};
use picky_asn1::wrapper::IntegerAsn1;
use p... |
extern crate nalgebra as na;
use winit::event_loop::EventLoop;
use winit::window::WindowBuilder;
use ash::vk;
use std::mem;
use std::fs::File;
use renderer::CleanupVkObj;
use na::{
Point3,
Vector3,
Matrix4,
Perspective3,
Isometry3,
Translation3,
};
use crate::render::buffers::{SamplerFilte... |
use std::fmt;
use std::ops::Add;
use chrono::{DateTime, Datelike, Duration, NaiveDateTime, TimeZone, Timelike, Utc};
use chrono_humanize::HumanTime;
use chrono_tz::Tz;
use pest::error::ErrorVariant;
use pest::iterators::Pair;
use pest::Parser;
use pest_derive::Parser;
use serde::ser::SerializeMap;
use serde::{Serializ... |
use actix_files::{Files, NamedFile};
use actix_web::{http, rt, web, App, HttpRequest, HttpResponse, HttpServer};
use async_mutex::Mutex;
use std::collections::HashMap;
use std::path::{Path, PathBuf};
use std::sync::Arc;
use tera::{Context, Tera};
use crate::{CONFIG, LOG};
#[derive(Debug, Clone)]
pub struct CachedFil... |
// 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.
// Keep all consts and type defs for completeness.
#![allow(dead_code)]
use {
iota::iota,
zerocopy::{AsBytes, FromBytes, LittleEndian, U32, U64},
... |
use js_sys::Date;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
use web_sys::CanvasRenderingContext2d as Canvas2d;
use web_sys::HtmlCanvasElement;
use yew::services::{RenderService, Task};
use yew::{html, Component, ComponentLink, Html, NodeRef, Properties, ShouldRender};
use shared::game::{GameStateView, Vi... |
//! Allows to read the current temperature from the TSIC temperature sensors.
//!
//! Note that most of this code is ported and heavily modified from C
//! to rust using the code found in [arduino-tsic](https://github.com/Schm1tz1/arduino-tsic)
//! and other places scattered throughout the internet that used the sensor... |
pub use super::{
NoRecv,
RecvErr::{self, *},
};
use owned_alloc::OwnedAlloc;
use ptr::{bypass_null, check_null_align};
use std::{
fmt,
ptr::{null_mut, NonNull},
sync::{
atomic::{AtomicPtr, Ordering::*},
Arc,
},
};
/// Creates an asynchronous lock-free Multi-Producer-Single-Consu... |
//! PyGamer pins
use super::{hal, pac, target_device};
use embedded_hal::{digital::v1_compat::OldOutputPin, timer::CountDown, timer::Periodic};
use gpio::{Floating, Input, Output, Port, PushPull};
use hal::clock::GenericClockController;
use hal::define_pins;
use hal::gpio::{self, *};
use hal::hal::spi;
use hal::prelu... |
use std::ffi::CString;
use std::time::Duration;
use std::{io, net::SocketAddr};
use async_trait::async_trait;
use futures::future::select_ok;
use futures::stream::Stream;
use futures::TryFutureExt;
use lazy_static::lazy_static;
use log::*;
use socket2::SockRef;
use tokio::io::{AsyncRead, AsyncWrite};
use tokio::net::{... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
ChainInfo, FullNode, HealthCheckError, LocalNode, LocalVersion, Node, NodeExt, Swarm, SwarmExt,
Validator, Version,
};
use anyhow::{anyhow, bail, Result};
use diem_config::config::NodeConfig;
use diem_genesis_tool::... |
/*
* Copyright (c) Meta Platforms, Inc. and 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::ast::NodeRc;
use juno_ast::{node_cast, GCLock, Node};
use juno_support::atom_table::Atom;
use juno_support::declare_op... |
#![allow(dead_code)]
#![allow(unused_imports)]
#![allow(clippy::float_cmp, clippy::many_single_char_names, clippy::cast_lossless)]
#[macro_use]
extern crate glium;
use handy::Handle;
use rand;
#[macro_use]
extern crate bad3d;
#[macro_use]
extern crate imgui;
use imgui_glium_renderer;
#[macro_use]
extern crate failure;... |
// 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 2019-2020 Mozilla Foundation. See the COPYRIGHT
// file at the top-level directory of this distribution.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or https://opensource.org/licenses/MIT>, at you... |
/// UTBuddy is a type-safe static buddy allocator for Untyped capabilites.
use core::marker::PhantomData;
use core::ops::{Add, Mul, Sub};
use arrayvec::ArrayVec;
use selfe_sys::*;
use typenum::*;
use crate::arch::{MaxUntypedSize, MinUntypedSize};
use crate::cap::{
memory_kind, role, CNodeRole, Cap, LocalCNode, ... |
// Copyright 2019 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 std::collections::HashSet;
use fuchsia_syslog::fx_log_warn;
use serde::{Deserialize, Serialize};
use thiserror::Error;
use crate::audio::ModifiedTime... |
// 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 _, Error},
fidl_fuchsia_input as input, fidl_fuchsia_ui_input3 as ui_input3,
fidl_fuchsia_ui_views as ui_views,
fu... |
use crate::{
gateway,
router::{self, RouterClient, Routing},
service::{self, gateway::GatewayService},
sync, CacheSettings, Error, KeyedUri, Keypair, Packet, Region, Result, Settings,
};
use exponential_backoff::Backoff;
use futures::{
task::{Context, Poll},
TryFutureExt,
};
use helium_proto::Bl... |
// 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... |
//! Tock core scheduler.
use core::cell::Cell;
use core::ptr::NonNull;
use crate::callback::{AppId, Callback, CallbackId};
use crate::capabilities;
use crate::common::cells::NumericCellExt;
use crate::common::dynamic_deferred_call::DynamicDeferredCall;
use crate::config;
use crate::debug;
use crate::grant::Grant;
use... |
// PS/2 Device Driver
use crate::arch::pic::*;
use crate::io::hid::*;
use crate::task::scheduler::*;
use crate::*;
use arch::cpu::Cpu;
use bitflags::*;
use core::time::Duration;
static mut PS2: Ps2 = Ps2::new();
pub(super) struct Ps2 {
key_state: Ps2KeyState,
key_modifier: Modifier,
mouse_state: MouseSta... |
#[doc = r"Register block"]
#[repr(C)]
pub struct RegisterBlock {
#[doc = "0x00 - Interrupt Enable Clear"]
pub intenclr: INTENCLR,
#[doc = "0x04 - Interrupt Enable Set"]
pub intenset: INTENSET,
#[doc = "0x08 - Interrupt Flag Status and Clear"]
pub intflag: INTFLAG,
#[doc = "0x0c - Power and C... |
// Copyright (c) 2016-2017 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
//
// Unl... |
use std::{borrow::Borrow, collections::HashSet};
use crate::{
header::BitWidth,
name::{EnumVariantName, FunctionName, Name, TypeName},
source::Source,
};
use heck::SnakeCase;
use once_cell::sync::Lazy;
use proc_macro2::{Ident, Literal, TokenStream};
use quote::{format_ident, quote};
use regex::Regex;
use s... |
use crate::{
kdf::Kdf,
kex::{Marshallable, Unmarshallable},
setup::ExporterSecret,
HpkeError,
};
use core::u8;
use aead::{Aead as BaseAead, NewAead as BaseNewAead};
use digest::generic_array::GenericArray;
use hkdf::Hkdf;
/// Represents authenticated encryption functionality
pub trait Aead {
/// ... |
//! Interface to profile data.
//!
//! # Overview
//!
//! Usage of this API starts with applying [`str::parse`] to JSON profiling data, returning a
//! [`Measurement`] which is the root of the hierarchy of profiler outputs.
//!
//! Parsing is robust to changes in the definitions of metadata types; if deserialization of... |
#![allow(dead_code)]
use std::process::{Command, Stdio};
use x11::xss::{XScreenSaverQueryInfo, XScreenSaverInfo};
use winit::window::Window;
use serde::Deserialize;
use crate::config::Color;
use crate::bus::dbus::Notification;
#[derive(Default, Debug, Deserialize, Clone)]
pub struct MinMax {
pub min: i32,
pub... |
use druid::kurbo::{BezPath, Circle, Insets, Point, Rect, Shape, Vec2};
use druid::piet::{RenderContext, StrokeStyle};
use druid::{Data, Env, EventCtx, HotKey, KbKey, KeyEvent, MouseEvent, PaintCtx, RawMods};
use crate::edit_session::EditSession;
use crate::mouse::{Drag, Mouse, MouseDelegate, TaggedEvent};
use crate::p... |
use miniquad::*;
use crate::{sim::*, parser, render_sim::*};
use std::{fs::File, io::BufReader, io::BufWriter, io::prelude::*, path::Path};
/*#[cfg(feature = "color_eyre")]
use color_eyre::{
eyre::{bail, ensure, eyre},
Result,
};
#[cfg(not(feature = "color_eyre"))]
use simple_eyre::{
eyre::{bail, ensure, ey... |
use quote::{quote, format_ident};
use syn::{parenthesized, Token, parse_quote, DeriveInput, Data, Generics, GenericParam, TypeParamBound, DataEnum, DataStruct, DataUnion, Type};
use proc_macro2::{TokenStream, Ident, Span};
use syn::parse::{self, Parse, ParseStream};
use syn::spanned::Spanned;
use indexmap::IndexMap;
u... |
use super::utils::map::Point2D;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::cmp;
#[derive(Copy, Clone, Hash, PartialEq, Eq, Debug)]
enum UnitVariant {
Goblin,
Elf,
}
#[derive(Copy, Clone, Hash, Debug)]
struct CombatUnit {
variant: UnitVariant,
... |
pub extern crate libc;
pub extern crate time;
use std::{
convert::TryFrom,
io::prelude::*,
mem,
ops::{Add, Div, Mul, Rem},
};
pub use time::Timespec;
pub use uuid::Uuid;
pub fn read_uuid(block: &[u8], offset: usize) -> Uuid {
let mut bytes = [0u8; 16];
bytes.copy_from_slice(&block[offset..offs... |
use core_data_structures::{hashmap::HashMap, queue::Queue};
use core_img::Rgba8Image;
use core_renderer::{BackendRenderer, Color, RenderCommand, SpriteTransform, SubImage, TextureId};
use glow::*;
use glutin::{ContextWrapper, PossiblyCurrent};
const DRAW_COMMAND_CAPACITY: usize = 256;
const STATE_COMMAND_CAPACITY: usi... |
use bytes::Bytes;
use failure::{bail, Error};
use futures::prelude::*;
use futures::try_ready;
use futures_timer::{Delay, Interval};
use log::{debug, info, trace, warn};
use crate::loss_compression::decompress_loss_list;
use crate::packet::{
ControlPacket, ControlTypes, DataPacket, Packet, PacketLocation, SrtContr... |
// Copyright (C) 2017-2021 blocktree.
// SPDX-License-Identifier: Apache-2.0
//
// 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 ... |
// * This file is part of the uutils coreutils package.
// *
// * (c) <NAME> <<EMAIL>>
// * (c) <NAME> <<EMAIL>>
// *
// * For the full copyright and license information, please view the LICENSE
// * file that was distributed with this source code.
// *
// spell-checker:ignore (ToDO) seekable seek'd tail'ing r... |
use thiserror::Error;
use crate::constants::*;
use crate::io::Satrec;
use crate::propogation::dpper::*;
use crate::propogation::initl::InitlMethod;
use crate::{Eci, Vec3};
/*----------------------------------------------------------------------------
*
* procedure sgp4
*
* this procedure i... |
#![cfg_attr(feature = "cargo-clippy", warn(clippy::all))]
use cadence::{prelude::*, BufferedUdpMetricSink, QueuingMetricSink, StatsdClient, DEFAULT_PORT};
use chrono::{prelude::Local, Datelike, Duration, Timelike};
use crossbeam_utils::thread::scope;
use flate2::{write::GzEncoder, Compression};
use rusoto_core::{reque... |
// 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::super::NonIdentityEccPoint;
use super::{X, Y, Z};
use crate::utilities::bool_check;
use ff::Field;
use halo2_proofs::{
circuit::Region,
plonk::{
Advice, Column, ConstraintSystem, Constraints, Error, Expression, Selector, VirtualCells,
},
poly::Rotation,
};
use pasta_curves::{arithmet... |
use crate::interpreter::{self, debugger, ErrorKind, Result};
use interpreter::{BlockIndex, InstructionLocation, Register};
use sailar::format::{self, indices, instruction_set};
use sailar_get::loader;
use std::borrow::{Borrow as _, BorrowMut as _};
use std::collections::{hash_map, BTreeSet, VecDeque};
/// Describes a ... |
use std::{cmp::Ordering, fmt};
use lazy_static::lazy_static;
use regex::Regex;
#[cfg(feature = "serde")]
use serde::{
ser::{SerializeStruct, Serializer},
Serialize,
};
lazy_static! {
static ref RELEASE_REGEX: Regex = Regex::new(r#"^(@?[^@]+)@(.+?)$"#).unwrap();
static ref VERSION_REGEX: Regex = Regex... |
extern crate clap;
use clap::{Arg, App, SubCommand, ArgMatches};
use std::{fs};
use std::path::{PathBuf, Component};
use std::process::Command;
use wa1_ast::{Exports, AST, Imports};
extern crate wa1_parser;
use wa1_parser::*;
extern crate wa1_generator;
pub use wa1_generator::prelude::*;
extern crate wa1_errs;
pub us... |
#![feature(test)]
extern crate test;
use test::Bencher;
const INPUT: &str = include_str!("data/aoc_2020_19b.txt");
#[bench]
fn aoc_2020_19b(b: &mut Bencher) -> runestick::Result<()> {
let mut data = runestick::Vec::new();
for line in INPUT.split('\n').filter(|s| !s.is_empty()) {
data.push(line.to_o... |
macro_rules! impl_section_specifics {
(
$name:ident,
$name_str:literal,
$table:ident
) => {
mod __section_specifics {
use super::$table;
use crate::{
error::{Error, Result},
sections::SectionInfo,
};
... |
/*
* MIT License
*
* Copyright (c) 2018 <NAME> <<EMAIL>>
* 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 limitatio... |
use crate::config;
use arrayvec::ArrayVec;
use printpdf::{image, Mm, Pt};
use std::collections::HashMap;
use std::io;
use util::{LineData, PositionArgs, RtFont};
mod error;
mod util;
pub use error::PdfError;
pub use util::Size;
/// a rectangle inside the pdf document
/// with a bottom-left origin
#[derive(Debug, Par... |
// Copyright 2016 LambdaStack 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 required by applicable law... |
use alloc::collections::BTreeMap;
use core::convert::TryFrom;
use core::marker::Copy;
use std::io::Read;
use flate2::read::ZlibDecoder;
use crate::parsers::common::Skip;
use crate::parsers::{extract, Endian, FromSlice};
use crate::record::{StateMetadata, Value};
use crate::EtError;
use crate::{impl_reader, impl_recor... |
use tokterm_core::drawing::point_2d::Point2d;
use tokterm_core::events::event::{
Event, KeyboardEvent, KeyboardEventType, MouseEvent, MouseEventType, WindowEvent,
WindowEventType,
};
use tokterm_core::events::event_queue::EventQueue;
use tokterm_core::input::key::Key;
use tokterm_core::input::keyboard_state::Ke... |
//! Utilities to transform a stevia expression tree.
use crate::{
AnyExpr,
Context,
expr,
iter::{
ChildrenMut,
},
};
use std::{
mem,
ops::BitOrAssign,
};
/// Describes whether the result of a transformation actually transformed
/// the input or did nothing to it.
#[derive(Debug, Cl... |
/*
* Copyright (c) 2021 Arm Limited.
*
* SPDX-License-Identifier: MIT
*
* 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 ... |
use data::*;
use regex::{Regex, RegexSet};
use std::collections::BinaryHeap;
use std::str;
pub struct StatusParse {
re: Regex,
}
impl StatusParse {
#[cfg_attr(feature = "clippy", allow(trivial_regex))]
pub fn new() -> Self {
StatusParse {
re: Regex::new(
r"(?x)
Level:\D*
... |
// The constraint system matrix for an arity-2 Merkle tree of 8 leaves using a mocked hasher (one
// selector/gate `s_hash` and one allocation `digest = (l + GAMMA) * (r + GAMMA)` for a random
// gamma and Merkle left/right inputs `l` and `r`).
// |-----||------------------|------------------|----------|---------|----... |
// Copyright 2021 The BMW 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 agreed... |
use super::resolver::NonFungibleTokenResolver;
use crate::non_fungible_token::core::NonFungibleTokenCore;
use crate::non_fungible_token::metadata::TokenMetadata;
use crate::non_fungible_token::token::{Token, TokenId};
use crate::non_fungible_token::utils::{
hash_account_id, refund_approved_account_ids, refund_depos... |
use crate::witness_rep::{
iota_did::create_and_upload_did::{create_n_dids, Key, RunMode},
implementation::{generate_contract, generate_sigs},
implementation::{
interaction::{interaction, LazyMethod},
user_and_organization::{
UserIdentity, OrganizationIdentity,
IdInfo,... |
//! Code related to tracking what activities a circuit can be used for.
use rand::Rng;
use std::sync::atomic::{AtomicU64, Ordering};
use std::sync::Arc;
use tor_netdir::Relay;
use tor_netdoc::types::policy::PortPolicy;
use crate::path::{dirpath::DirPathBuilder, exitpath::ExitPathBuilder, TorPath};
use crate::{Error... |
//! Contains Configuration Model
//!
#[cfg(feature = "serde_support")]
use serde::{Serialize, Deserialize};
use crate::{traits::*, graph::*, iter::*, GenericGraph};
use std::{borrow::*, convert::*, iter, iter::*};
use rand::seq::*;
use std::mem;
#[derive(Debug, Clone)]
#[cfg_attr(feature = "serde_support", derive(Se... |
// EndBASIC
// Copyright 2021 <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 agre... |
#![allow(clippy::unnecessary_mut_passed)]
#![deny(clippy::unimplemented)]
use crate::config;
use crate::client;
use polyfuse::{
io::{Reader, Writer},
op,
reply::{Reply, ReplyAttr, ReplyEntry, ReplyOpen},
Context, DirEntry, FileAttr, Filesystem, Operation,
};
use slab::Slab;
use crate::client::HTTP;
u... |
use std::collections::HashSet;
use std::fs;
use std::fs::Metadata;
use std::io::{Error, ErrorKind};
#[cfg(unix)]
use std::os::unix::fs::MetadataExt;
#[cfg(windows)]
use std::os::windows::prelude::*;
use std::path::PathBuf;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::{Arc, Mutex, Weak};
use std::thread... |
// Copyright (c) 2017-2018 <NAME> <<EMAIL>>
// Copyright (c) 2017 Maxime “<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/.
/// RFC 6120: Extensibl... |
// Copyright (c) The nextest Contributors
// SPDX-License-Identifier: MIT OR Apache-2.0
//! Configuration support for nextest.
use crate::{
errors::{ConfigParseError, ProfileNotFound},
reporter::{FinalStatusLevel, StatusLevel, TestOutputDisplay},
};
use camino::{Utf8Path, Utf8PathBuf};
use config::{builder::D... |
// 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... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
block_storage::block_store::update_counters_for_committed_blocks,
counters,
logging::{LogEvent, LogSchema},
persistent_liveness_storage::PersistentLivenessStorage,
};
use anyhow::bail;
use consensus_types::{... |
// Copyright (c) 2016 The vulkano developers
// Licensed under the Apache License, Version 2.0
// <LICENSE-APACHE or
// https://www.apache.org/licenses/LICENSE-2.0> or the MIT
// license <LICENSE-MIT or https://opensource.org/licenses/MIT>,
// at your option. All files in the project carrying such
// notice may not be ... |
// Copyright (c) The Diem Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::{
builder::GenesisBuilder, layout::Layout, verify::verify_genesis,
waypoint::create_genesis_waypoint,
};
use anyhow::Result;
use consensus_types::safety_data::SafetyData;
use diem_config::{
config::{
Disco... |
use super::{cluster, liblinear, Model, Settings, TreeNode};
use crate::data::DataSet;
use crate::mat_util::*;
use crate::util::{create_progress_bar, ProgressBar};
use crate::{Index, IndexSet, IndexValueVec};
use hashbrown::HashMap;
use itertools::{izip, Itertools};
use log::info;
use rayon::prelude::*;
use ser... |
//! Insertion Permutation
//!
//! Insert an `AllocatedNum` into a sequence of `AllocatedNums` at an arbitrary position.
//! This can be thought of as a generalization of `AllocatedNum::conditionally_reverse` and reduces to it in the binary case.
use bellperson::gadgets::boolean::{AllocatedBit, Boolean};
use bellperson... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.