hexsha stringlengths 40 40 | size int64 4 1.05M | content stringlengths 4 1.05M | avg_line_length float64 1.33 100 | max_line_length int64 1 1k | alphanum_fraction float64 0.25 1 |
|---|---|---|---|---|---|
146123b14b9fb358008d1ec85f6c0f14c944faa3 | 106 | //! All HTTP handlers dealing with the assignments.
pub mod edit;
pub mod file;
pub mod get;
pub mod new;
| 17.666667 | 51 | 0.735849 |
9cedf86f35056aaed7b313a2fe03b9a6575bb651 | 771 | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | 27.535714 | 133 | 0.661479 |
6254eb7c41eb487da9b76e587ac52241f9b8daf0 | 2,968 | use ra_syntax::{
ast::{self, AstNode, AttrsOwner},
SyntaxKind::{COMMENT, WHITESPACE},
TextSize,
};
use crate::{Assist, AssistCtx, AssistId};
// Assist: add_derive
//
// Adds a new `#[derive()]` clause to a struct or enum.
//
// ```
// struct Point {
// x: u32,
// y: u32,<|>
// }
// ```
// ->
// ``... | 24.528926 | 75 | 0.507412 |
91d96adb0eb5d46c23445f7695096b38b503d490 | 3,714 | use alloc::vec::Vec;
use core::time::Duration;
/// Erase plan of (opcode, size, base address, typical duration) to erase a range of memory.
#[derive(Clone, Debug)]
pub(crate) struct ErasePlan(pub Vec<(u8, usize, u32, Option<Duration>)>);
impl ErasePlan {
pub fn new(insts: &[(usize, u8, Option<Duration>)], start: ... | 37.897959 | 95 | 0.530964 |
7932f114204d9150fb92f8c1254c971354d13baa | 1,887 | use iron::error::HttpError;
use iron::Listening;
use iron::prelude::*;
use persistent::State;
use router::Router;
use provider::Provider;
use routes;
use utils;
use types::ProviderState;
pub fn start_server<T>(prov: Box<T>) -> Result<Listening, HttpError>
where
T: Provider + 'static + Send + Sync,
{
// create... | 36.288462 | 96 | 0.657658 |
089dbc9084a454f09248d3f229e1366099f95a85 | 2,094 | //! Utility module for converting between hir_def ids and code_model wrappers.
//!
//! It's unclear if we need this long-term, but it's definitelly useful while we
//! are splitting the hir.
use hir_def::{AdtId, EnumVariantId, ModuleDefId};
use crate::{Adt, EnumVariant, ModuleDef};
macro_rules! from_id {
($(($id... | 32.71875 | 80 | 0.586437 |
716b0bbe77294deed07ef1166d3f0cb5aa80bf3c | 1,061 | // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | 26.525 | 68 | 0.62017 |
71c32dafa676f47a5f612dc2c842d7f50d24cdff | 812 | /*
*
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
///
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserializ... | 19.804878 | 109 | 0.607143 |
cc094aeef02f3b82815a981b903cd9af4bcc5d43 | 5,116 | // Copyright 2018-2019 Joe Neeman.
//
// 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 accordin... | 31.580247 | 99 | 0.560399 |
fb66f240d405a537f6ff0a9fac8634841a60d06e | 14,021 | // 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.
//! Test utilities for starting a pkgfs server.
use {
anyhow::{Context as _, Error},
fdio::{SpawnAction, SpawnOptions},
fidl::endpoints::Clien... | 35.31738 | 104 | 0.603167 |
91d6f168413466e0962eaeb3e3d243e4d651470a | 3,899 | use std::cmp::Ordering::{Less, Equal, Greater};
use std::collections::HashMap;
use std::collections::VecDeque;
use std::rc::Rc;
pub struct Promise {
id: u32,
generator: fn () -> u32,
}
impl Promise {
// https://users.rust-lang.org/t/three-way-comparison-in-rust/2648
pub fn compare(left: [u32; 2], righ... | 25.154839 | 100 | 0.489613 |
fb2ed53e5b0e81c288637ff501c5b6f910eae8b5 | 52 | codeblockutil.SliderBlueprint
codeblockutil.CSlider
| 17.333333 | 29 | 0.923077 |
b9a413efcd5b4111945b92368acb343dbb907755 | 5,980 | #![cfg(feature = "serialization")]
extern crate futures;
extern crate env_logger;
extern crate serde_json;
extern crate serde_state as serde;
extern crate gluon;
use std::fs::File;
use std::io::Read;
use futures::Future;
use serde::ser::SerializeState;
use gluon::vm::api::{Hole, OpaqueValue};
use gluon::vm::seri... | 29.458128 | 98 | 0.578428 |
e9bebadeb7cd753249f881ea6f3467a243e2f888 | 1,299 | const NULL_DATA_PACKET: [u8; 24] = [
0x48, 0x11, 0x02, 0x01, 0x00, 0x01, 0xe3, 0x41, 0xbd, 0x6e, 0x00, 0x16, 0xbc, 0x3d, 0xaa, 0x57,
0x00, 0x01, 0xe3, 0x41, 0xbd, 0x6e, 0xf0, 0x03,
];
#[test]
fn test_null_data_packet() {
// Receiver address: Siemens_41:bd:6e (00:01:e3:41:bd:6e)
// Transmitter address: NokiaDan... | 33.307692 | 97 | 0.661278 |
4851e637d3a62eeb3f440bba63776549497b7107 | 25,753 | use crate::infer::type_variable::{TypeVariableOrigin, TypeVariableOriginKind};
use crate::infer::{InferCtxt, InferOk};
use crate::traits;
use rustc_data_structures::sync::Lrc;
use rustc_data_structures::vec_map::VecMap;
use rustc_hir as hir;
use rustc_hir::def_id::LocalDefId;
use rustc_middle::ty::fold::BottomUpFolder;... | 40.051322 | 128 | 0.551975 |
1143e9b264b793658aa5b9990f6267132f3cf796 | 1,902 | use necsim_core::cogs::{
DispersalSampler, EmigrationExit, Habitat, MathsCore, PrimeableRng, SpeciationProbability,
TurnoverRate,
};
use necsim_core::lineage::{GlobalLineageReference, Lineage};
use necsim_core_bond::NonNegativeF64;
use crate::cogs::{
active_lineage_sampler::singular::SingularActiveLineage... | 31.180328 | 94 | 0.656677 |
113c48f22eeaf8a5636d7f18bcb9212e3e585934 | 6,331 | //! [`egui`] bindings for [`glow`](https://github.com/grovesNL/glow).
//!
//! The main type you want to use is [`EguiGlow`].
//!
//! This library is an [`epi`] backend.
//! If you are writing an app, you may want to look at [`eframe`](https://docs.rs/eframe) instead.
// Forbid warnings in release builds:
#![cfg_attr(n... | 31.497512 | 109 | 0.650134 |
ccf564408461b11c0e5a0b5780367f5727dd0dfb | 79,204 | use crate::msgs::enums::{ProtocolVersion, HandshakeType};
use crate::msgs::enums::{CipherSuite, Compression, ExtensionType, ECPointFormat};
use crate::msgs::enums::{HashAlgorithm, SignatureAlgorithm, ServerNameType};
use crate::msgs::enums::{SignatureScheme, KeyUpdateRequest, NamedGroup};
use crate::msgs::enums::{Clien... | 31.89851 | 149 | 0.598884 |
f79dc421ff75964b2f8a368f233521e8fac703f3 | 3,751 | #![allow(unused_imports)]
use cursive::direction::Orientation;
use cursive::event::{AnyCb, Event, EventResult, Key};
use cursive::traits::{Boxable, Finder, Identifiable, View};
use cursive::view::{IntoBoxedView, Selector, ViewNotFound, ViewWrapper};
use cursive::views::{EditView, NamedView, ViewRef};
use cursive::{Cur... | 29.769841 | 97 | 0.575047 |
8a07c6f21e9488aff54d3b6aa52a6452062fb041 | 2,791 | // Copyright 2020 Datafuse Labs.
//
// 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 ... | 35.329114 | 102 | 0.713723 |
f851e0d8cd3c5f51e97c47ab4c7ff9059d8aab2e | 2,622 | // SPDX-License-Identifier: MIT OR Apache-2.0
//
// Copyright (c) 2018-2022 Andre Richter <andre.o.richter@gmail.com>
//! A panic handler that infinitely waits.
use crate::{bsp, cpu};
use core::{fmt, panic::PanicInfo};
//------------------------------------------------------------------------------------------------... | 30.488372 | 100 | 0.588482 |
091614b6bc74c17163d408d67d07925afbb8cbc1 | 83,975 | // Copyright 2012 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | 37.255989 | 98 | 0.487919 |
0a30e4d48c5b3dd68ebc300df56a19fa9164f527 | 1,320 | // This file is part of security-keys-rust. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/raphaelcohn/security-keys-rust/master/COPYRIGHT. No part of security-keys-rust, including this file, may be copied, modified... | 28.085106 | 411 | 0.733333 |
d9dd0ff9736c54b2968b9f0bb109c05fb1c17ed2 | 202 | #[cfg(target_os = "windows")]
#[path = "win32/mod.rs"]
pub mod api;
#[cfg(target_os = "linux")]
#[path = "linux/mod.rs"]
pub mod api;
#[cfg(target_os = "macos")]
#[path = "cocoa/mod.rs"]
pub mod api;
| 16.833333 | 29 | 0.60396 |
6786b47c441828894ff7e0272932f1f40a205228 | 21,429 | use {
crate::{broadcast_stage::BroadcastStage, retransmit_stage::RetransmitStage},
itertools::Itertools,
lru::LruCache,
rand::{seq::SliceRandom, Rng, SeedableRng},
rand_chacha::ChaChaRng,
solana_gossip::{
cluster_info::{compute_retransmit_peers, ClusterInfo},
contact_info::Contac... | 34.2864 | 90 | 0.547156 |
cc021da30b8b9072510b7cd946c5440f43461285 | 15,486 | #![warn(missing_docs)]
use crate::architecture::{
arm::{
communication_interface::{
ApInformation::{MemoryAp, Other},
ArmProbeInterface, MemoryApInformation,
},
core::{debug_core_start, reset_catch_clear, reset_catch_set},
memory::Component,
SwoConfig... | 35.036199 | 139 | 0.555469 |
eda1242cd41d56c8d17615fbe11efa8c0b2cc0de | 9,998 | use crate::contact_info::ContactInfo;
use bincode::serialize;
use solana_sdk::pubkey::Pubkey;
use solana_sdk::signature::{Keypair, Signable, Signature};
use solana_sdk::transaction::Transaction;
use std::borrow::Cow;
use std::collections::BTreeSet;
use std::fmt;
/// CrdsValue that is replicated across the cluster
#[de... | 31.341693 | 97 | 0.585517 |
f985260a76e6567ebd06e7f8e16f8a64e42d3460 | 245 | // Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
// SPDX-License-Identifier: Apache-2.0
use config::defaults::DENOM;
use cosmwasm_std::Coin;
pub mod events;
pub mod messages;
pub fn one_ucoin() -> Coin {
Coin::new(1, DENOM)
}
| 20.416667 | 61 | 0.710204 |
4a2a7e293fc7f10e316cb431f595703420666bf4 | 8,569 | // Copyright (c) 2018 Alexander Færøy. 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::cmp::Ordering;
use std::collections::HashMap;
pub type GuardID = u32;
#[derive(Debug, Eq, PartialEq)]
pub enum EventType {
// Our guard wake... | 23.736842 | 99 | 0.560859 |
1e8d1574d2b02aec590591a4e89bb590a586db4f | 12,427 | // Copyright 2017 GFX developers
//
// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
// http://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 according to tho... | 30.309756 | 98 | 0.628148 |
2272bb1ceb71c429b01620be42fcb9e4cdc46216 | 8,170 | #![allow(non_snake_case)]
#![allow(dead_code)]
use crate::mlutils;
use crate::map2d;
use crate::map2d::{Map2d,writeAt,readAt,map2dDrawCircle};
use crate::Misc::{flattenVec2Map, Vec2};
// TODO< draw a object in motion and display result maxima classifications >
// TODO< print visualization of the result with the high... | 32.68 | 146 | 0.543819 |
dd8ffeae8c3f7a954d5def7faaad8e21e97d49fc | 4,389 | extern crate mithril;
use std::f64;
use std::num::Float;
use self::mithril::math::{ Vector, Quaternion };
pub struct Camera {
position: Vector,
focus_point: Vector,
up: Vector,
field_of_view: f64,
aspect_ratio: f64,
far: f64,
near: f64,
anchor_point: Option<[f64; 2]>,
control_point... | 31.804348 | 120 | 0.494874 |
fc2ac0163ce3a60c592f5853e91f71a22afb1723 | 10,362 | // DO NOT EDIT !
// This file was generated automatically from 'src/mako/api/lib.rs.mako'
// DO NOT EDIT !
//! This documentation was generated from *datastore* crate version *1.0.14+20200524*, where *20200524* is the exact revision of the *datastore:v1* schema built by the [mako](http://www.makotemplates.org/) code g... | 47.751152 | 784 | 0.68674 |
fbea68cb7f2ff069dc4c58ca83e3c990511263c7 | 9,779 | use crate::interactive::{
sorted_entries,
widgets::{MainWindow, MainWindowProps},
ByteVisualization, CursorDirection, CursorMode, DisplayOptions, EntryDataBundle, MarkEntryMode,
SortMode,
};
use anyhow::Result;
use crosstermion::input::{key_input_channel, Key};
use dua::{
traverse::{Traversal, TreeI... | 31.85342 | 99 | 0.472032 |
399ea131934d302b9bf692822f178ae75f1b00df | 2,768 | use super::context::Context;
use super::timer;
use crate::process::PROCESSOR;
use crate::kernel::syscall_handler;
use crate::memory::*;
use crate::sbi::console_getchar;
use crate::fs::STDIN;
use riscv::register::{
scause::{Exception, Interrupt, Scause, Trap},
stvec, sie
};
global_asm!(include_str!("../asm/inte... | 27.959596 | 94 | 0.620303 |
ff40e20e535ce26ec6f1a61024b09a257cfdd17d | 46,379 | use crate::POOL;
use num::{Bounded, Num, NumCast, ToPrimitive, Zero};
use rayon::prelude::*;
use arrow::types::{simd::Simd, NativeType};
#[cfg(feature = "object")]
use crate::chunked_array::object::extension::create_extension;
use crate::frame::groupby::GroupsIdx;
#[cfg(feature = "object")]
use crate::frame::groupby:... | 41.189165 | 109 | 0.413722 |
f5b01aeec7a3b20f8791654c07344c1e69733b70 | 17,120 | //! Provides the core configuration functionality.
use crate::config::extended_hashmap::ExtendedMap;
use crate::config::tree::{parse_conf, ConfigNode};
use crate::logger::LogLevel;
use crate::proxy::{EqMutex, LoadBalancer};
use crate::rand::Lcg;
use std::collections::HashMap;
use std::env::{args, var};
use std::fs::F... | 33.307393 | 204 | 0.571437 |
728678873a1e17e49f4bf7f02de0645de1f74356 | 10,962 | //! Service and ServiceFactory implementation. Specialized wrapper over substrate service.
#![allow(clippy::all)]
use basilisk_runtime::{self, RuntimeApi};
use cumulus_client_consensus_aura::{build_aura_consensus, BuildAuraConsensusParams, SlotProportion};
use cumulus_client_consensus_common::ParachainConsensus;
use ... | 30.281768 | 117 | 0.740011 |
718fb98c39966797a310b055afb439cbc808382a | 624 | // Copyright 2020-2021 IOTA Stiftung
// SPDX-License-Identifier: Apache-2.0
mod primitives;
mod types;
pub use primitives::{
AeadAlg, AeadDecrypt, AeadEncrypt, BIP39Generate, BIP39Recover, Chain, ChainCode, Ed25519Sign, GenerateKey, Hash,
HashType, Hkdf, Hmac, KeyType, MnemonicLanguage, Pbkdf2Hmac, PrimitiveP... | 36.705882 | 119 | 0.775641 |
1c6842b8b006a86934ef527f092997609517d66d | 3,027 | /*
* Terra Contract Addresses
*
*/
use serde_json::{json, Value};
use serde::Deserialize;
use serde::Serialize;
#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AssetWhitelist {
pub contracts: Value,
pub pairs_dex: Value,
pub pairs: Value,
pub tokens: Value,
pub cu... | 42.041667 | 137 | 0.642881 |
28fd0d3c2fb4d97c2b699c5cf201533d3ed7face | 27,925 | // 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 according to those terms.
// Tracking of rece... | 31.805239 | 99 | 0.558496 |
9ccdb6a81b2eb0f6d353a119eec17b8347b4549e | 5,716 | use crate::errors::*;
use crate::notifications::*;
use crate::toml_utils::*;
use crate::utils::utils;
use std::cell::RefCell;
use std::collections::BTreeMap;
use std::path::{Path, PathBuf};
pub const SUPPORTED_METADATA_VERSIONS: [&str; 2] = ["2", "12"];
pub const DEFAULT_METADATA_VERSION: &str = "12";
#[derive(Clone,... | 30.566845 | 90 | 0.561057 |
752b1fa821f7f9cf59fcaa1610c3ef3d833028de | 678 | // Copyright 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-MIT or ... | 35.684211 | 73 | 0.70059 |
d9d2fc2fa4783fa8daa1e40760597fdba2eda335 | 2,215 | use datamodel_connector::{connector_error::ConnectorError, Connector, ConnectorCapability};
use dml::model::Model;
use dml::native_type_constructor::NativeTypeConstructor;
use dml::native_type_instance::NativeTypeInstance;
use dml::{field::Field, scalars::ScalarType};
pub struct SqliteDatamodelConnector {
capabili... | 28.397436 | 117 | 0.667269 |
64cf1422877af3bdd6dc6a1caf46412ba5e27f13 | 2,641 | #![allow(clippy::module_inception)]
#![allow(clippy::upper_case_acronyms)]
#![allow(clippy::large_enum_variant)]
#![allow(clippy::wrong_self_convention)]
#![allow(clippy::should_implement_trait)]
#![allow(clippy::blacklisted_name)]
#![allow(clippy::vec_init_then_push)]
#![allow(rustdoc::bare_urls)]
#![warn(missing_docs... | 36.178082 | 122 | 0.749337 |
38cd5059eefe7c981904494798f6c2bb785eeb13 | 14,260 | // Copyright 2016 TiKV Project Authors. Licensed under Apache-2.0.
use std::i32;
use std::net::{IpAddr, SocketAddr};
use std::str::FromStr;
use std::sync::{Arc, RwLock};
use std::time::{Duration, Instant};
use futures::{Future, Stream};
use grpcio::{ChannelBuilder, EnvBuilder, Environment, Server as GrpcServer, Serve... | 34.527845 | 100 | 0.591304 |
f738fca40e3c34b769efa1f7b298b839d1b81e4a | 5,602 | //! Types and traits for working with asynchronous tasks.
//!
//! This module is similar to [`std::thread`], except it uses asynchronous tasks in place of
//! threads.
//!
//! [`std::thread`]: https://doc.rust-lang.org/std/thread
//!
//! ## The task model
//!
//! An executing asynchronous Rust program consists of a col... | 34.795031 | 99 | 0.665834 |
3354f99c8579917b77641d04db616217e6958ed4 | 1,768 | // This file is part of simple-http-server. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/simple-http-server/master/COPYRIGHT. No part of simple-http-server, including this file, may be copied, modified, ... | 35.36 | 409 | 0.754525 |
267c7d041fdcb11e7da2b6d5be3dcd0ae9d27436 | 100 | pub mod graphics;
pub mod interface;
pub mod window;
#[cfg(all(feature = "d3d11"))]
pub mod d3d11;
| 14.285714 | 30 | 0.7 |
4a07acf020ae33b89c7c3902490fc3fcd5b27ee2 | 3,405 | use std::io::Write;
use nimiq_hash::{
argon2kdf, Argon2dHash, Argon2dHasher, Blake2bHash, Blake2bHasher, Blake2sHash, Blake2sHasher, Hasher, Sha256Hash, Sha256Hasher, Sha512Hash, Sha512Hasher,
};
mod hmac;
mod pbkdf2;
#[test]
fn it_can_compute_sha256() {
// sha256('test') = '9f86d081884c7d659a2feaa0c55ad015a... | 33.058252 | 158 | 0.718649 |
f4b2caef8cc0d6508c9579acb36bf97f15214335 | 2,028 | // This file is part of cpu-affinity. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/cpu-affinity/master/COPYRIGHT. No part of cpu-affinity, including this file, may be copied, modified, propagated, or dis... | 28.971429 | 391 | 0.705621 |
7a98a9a6dd88d3de0f06b51564195ed8cc9a43d4 | 19,498 | use anyhow::Result;
use std::{fmt, future::Future, path::Path, pin::Pin};
use tokio::io::AsyncRead;
mod demux;
mod jlink;
mod kflash;
mod openocd;
mod probe_rs;
mod qemu;
mod rp_pico;
mod serial;
mod slip;
pub trait Target: Send + Sync {
/// Get the target architecture.
fn target_arch(&self) -> Arch;
///... | 28.381368 | 95 | 0.445994 |
28c46a12a885afd3f6c55100a71b2b8a60dfab95 | 2,141 | #[doc = "Reader of register T1CNTR"]
pub type R = crate::R<u32, super::T1CNTR>;
#[doc = "Writer for register T1CNTR"]
pub type W = crate::W<u32, super::T1CNTR>;
#[doc = "Register T1CNTR `reset()`'s with value 0"]
impl crate::ResetValue for super::T1CNTR {
type Type = u32;
#[inline(always)]
fn reset_value() ... | 31.028986 | 133 | 0.590845 |
7ac85f18553b04f908aab5a6963b24187cc2102b | 373 | pub mod models;
pub mod schema;
use diesel::prelude::*;
use dotenv::dotenv;
use std::env;
pub fn establish_connection() -> SqliteConnection {
dotenv().ok();
let database_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set");
SqliteConnection::establish(&database_url)
.unwrap_or_else(|... | 24.866667 | 83 | 0.69437 |
f9054cdb1c553aa11d55fd02ceec66a0078f80d0 | 8,041 | //! Module for items related to aggregating validation_receipts
use futures::Stream;
use futures::StreamExt;
use futures::TryStreamExt;
use holo_hash::AgentPubKey;
use holo_hash::DhtOpHash;
use holochain_keystore::AgentPubKeyExt;
use holochain_keystore::MetaLairClient;
use holochain_serialized_bytes::prelude::*;
use h... | 30.926923 | 98 | 0.602164 |
61aa822a993f8834a3108c69ad1a3bf7a62802e1 | 6,554 | /*
Copyright 2017 Takashi Ogura
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 writing... | 24.364312 | 91 | 0.585597 |
6139eed0956c2f5bc762436c6974ad067ea8de52 | 12,693 | use crate::prelude::*;
use nu_engine::whole_stream_command;
use std::error::Error;
pub fn create_default_context(interactive: bool) -> Result<EvaluationContext, Box<dyn Error>> {
let context = EvaluationContext::basic();
{
use crate::commands::*;
context.add_commands(vec![
// Fund... | 41.753289 | 95 | 0.628614 |
6764d9530775078ae45c8937d6ab509984041c87 | 4,143 | use crate::node_keys;
use libra_wallet::{Mnemonic, key_factory::{
Seed, KeyFactory, ChildNumber
}};
use libra_types::{waypoint::Waypoint};
use libra_types::{account_address::AccountAddress, transaction::authenticator::AuthenticationKey};
use libra_crypto::{
test_utils::KeyPair,
ed25519::{Ed25519PrivateKey,... | 32.622047 | 190 | 0.646633 |
7680767edbb977998317f7a070dbdfe3541f8f8c | 11,973 | /*
* Licensed to Elasticsearch B.V. under one or more contributor
* license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright
* ownership. Elasticsearch B.V. licenses this file to you under
* the Apache License, Version 2.0 (the "License"); you may
* not u... | 36.84 | 188 | 0.59417 |
1a3bbc5ecc49ed3bce7c9f370efa8a65059f5860 | 13,655 | use crate::hir::map::definitions::*;
use crate::hir::def_id::{CRATE_DEF_INDEX, DefIndex, DefIndexAddressSpace};
use crate::session::CrateDisambiguator;
use syntax::ast::*;
use syntax::ext::hygiene::Mark;
use syntax::visit;
use syntax::symbol::keywords;
use syntax::symbol::Symbol;
use syntax::parse::token::{self, Token... | 38.792614 | 99 | 0.51483 |
1645abf754d140fafb7dfde729aecd2a4f58be63 | 1,542 | use super::{Registers, RawOp};
pub fn addr(raw: RawOp, regs: &mut Registers) {
regs[raw.c] = regs[raw.a] + regs[raw.b];
}
pub fn addi(raw: RawOp, regs: &mut Registers) {
regs[raw.c] = regs[raw.a] + raw.b;
}
pub fn mulr(raw: RawOp, regs: &mut Registers) {
regs[raw.c] = regs[raw.a] * regs[raw.b];
}
pub fn... | 23.363636 | 54 | 0.59144 |
fe85e5a222dad8d22ef015df28510156d75239ed | 15,817 | // Generated from definition io.k8s.api.admissionregistration.v1.RuleWithOperations
/// RuleWithOperations is a tuple of Operations and Resources. It is recommended to make sure that all the tuple expansions are valid.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct RuleWithOperations {
/// APIGroups is the... | 60.834615 | 562 | 0.530695 |
fb084afe960de8d478130f801a6dfea4e50049de | 1,491 | use crate::spec::{LinkerFlavor, PanicStrategy, RelocModel};
use crate::spec::{Target, TargetOptions};
pub fn target() -> Target {
Target {
data_layout: "e-m:e-p:32:32-i64:64-n32-S128".to_string(),
llvm_target: "riscv32".to_string(),
pointer_width: 32,
arch: "riscv32".to_string(),
... | 39.236842 | 118 | 0.589537 |
337ec8dbb96135c50e8e71b4cadab88761263352 | 2,041 | #[doc = "Writer for register TASKS_STARTEPIN[%s]"]
pub type W = crate::W<u32, super::TASKS_STARTEPIN>;
#[doc = "Register TASKS_STARTEPIN[%s] `reset()`'s with value 0"]
impl crate::ResetValue for super::TASKS_STARTEPIN {
type Type = u32;
#[inline(always)]
fn reset_value() -> Self::Type {
0
}
}
#[... | 30.924242 | 159 | 0.594317 |
69e156a4f4020c50d49d4bd4934d2b009bffedf4 | 4,052 | /*
* Ory Kratos API
*
* Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the adminis... | 52.623377 | 431 | 0.702863 |
e2c4c2f744c9b67a56e184b4efe2ceabf719667d | 1,633 | //! Model evaluation metrics for ARIMA forecasting models.
use crate::model::arima_fitting_metrics::ArimaFittingMetrics;
use crate::model::arima_order::ArimaOrder;
use crate::model::arima_single_model_forecasting_metrics::ArimaSingleModelForecastingMetrics;
#[derive(Debug, Serialize, Deserialize)]
#[serde(rename_all =... | 39.829268 | 110 | 0.733007 |
9b98939c97d4eb289f6dc70645202a8c0b3e00b4 | 13,032 | use legion::prelude::*;
#[derive(Clone, Copy, Debug, PartialEq)]
struct Pos(f32, f32, f32);
#[derive(Clone, Copy, Debug, PartialEq)]
struct Rot(f32, f32, f32);
#[derive(Clone, Copy, Debug, PartialEq)]
struct Scale(f32, f32, f32);
#[derive(Clone, Copy, Debug, PartialEq)]
struct Vel(f32, f32, f32);
#[derive(Clone, Copy,... | 29.219731 | 91 | 0.570826 |
891e9f88656a1158b5f21df7227b3ca17180aa8f | 126 | #![no_main]
use libfuzzer_sys::fuzz_target;
fuzz_target!(|data: &[u8]| {
let _ = lofty::FileType::from_buffer(data);
});
| 18 | 47 | 0.65873 |
e924ef703f0ca765ae9692abbb75915811497ac2 | 71,623 | #![feature(async_await)]
#![deny(warnings)]
extern crate bytes;
extern crate hyper;
#[macro_use] extern crate matches;
extern crate net2;
extern crate pretty_env_logger;
extern crate tokio;
extern crate tokio_io;
extern crate tokio_tcp;
extern crate tokio_timer;
use std::io::{Read, Write};
use std::net::{SocketAddr, T... | 32.437953 | 150 | 0.509669 |
bbd97ab2a53ab360b65cf20b5a9a0b52e1693dcc | 5,499 | use std::{fmt, iter::Sum};
use num::Zero;
use casper_types::U512;
use crate::shared::motes::Motes;
#[derive(Debug, Default, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)]
pub struct Gas(U512);
impl Gas {
pub fn new(value: U512) -> Self {
Gas(value)
}
pub fn value(&self) -> U512 {
self.0... | 26.694175 | 75 | 0.571013 |
879f37427f82d0b82d3d0b4f11bb54a67ec9ad5d | 106 | //! Map alias.
use std::collections::BTreeMap;
/// Map alias type.
pub type Map<T, S> = BTreeMap<T, S>;
| 15.142857 | 36 | 0.632075 |
22cd2228df4f3ff31330e7b7ddb94ca6fe5568f0 | 1,046 | use graphql_client::Response;
use seed::prelude::fetch;
use serde::{Deserialize, Serialize};
use super::ErrorPayload;
use crate::operations::authentication;
pub struct AttemptLoginPayload {
pub username: String,
pub password: String,
}
pub struct LoginSuccessPayload {
pub username: String,
pub token:... | 23.244444 | 89 | 0.748566 |
ed982accc0b25979dfee1d592f1519fd1e23ee92 | 601 | //! Re-exports for low-level, efficient APIs.
//!
//! In order for high-performance processing of large documents,
//! We must use parsers that lazily read and write items to and from
//! documents. The writers accept both by-value and by-reference
//! iterators, allowing you to easily chain lazy readers and writers
//... | 35.352941 | 72 | 0.72213 |
904534112acbb70d1ac8991a6b0500d199ad2ba0 | 60 | mod user;
mod post;
pub use post::Post;
pub use user::User; | 12 | 19 | 0.7 |
285db7aada879d1b38258b4324bc183d12c39d76 | 1,381 | #[doc = "Reader of register SCMPR0"]
pub type R = crate::R<u32, super::SCMPR0>;
#[doc = "Writer for register SCMPR0"]
pub type W = crate::W<u32, super::SCMPR0>;
#[doc = "Register SCMPR0 `reset()`'s with value 0"]
impl crate::ResetValue for super::SCMPR0 {
type Type = u32;
#[inline(always)]
fn reset_value() ... | 33.682927 | 186 | 0.625634 |
099cdc5ca51d40c7b8d47f6d021d8ed8c4141f6f | 448 | use std::collections::HashMap;
impl Solution {
pub fn longest_palindrome(s: String) -> i32 {
let mut map = HashMap::new();
for c in s.chars() {
*map.entry(c).or_insert(0) += 1;
}
let mut has_odd = 0;
let mut ans = 0;
for v in map.values() {
if... | 22.4 | 49 | 0.419643 |
29eea394d4584f99ac8a86a2657689588192d31a | 15,757 | #![allow(dead_code)]
use crate::reference_tables;
use crate::structs::*;
use crate::transformation::TransformationMatrix;
use doc_cfg::doc_cfg;
#[cfg(feature = "rayon")]
use rayon::prelude::*;
use std::cmp::Ordering;
use std::fmt;
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(De... | 33.740899 | 143 | 0.583169 |
2ff186f0719a4cddfb3d3741bd00f10c850e5f72 | 28,702 | pub type c_char = u8;
pub type wchar_t = u32;
pub type stat64 = ::stat;
s! {
pub struct stat {
pub st_dev: ::dev_t,
pub st_ino: ::c_ulonglong,
pub st_mode: ::c_uint,
pub st_nlink: ::c_uint,
pub st_uid: ::c_uint,
pub st_gid: ::c_uint,
pub st_rdev: ::c_ulonglo... | 35.8775 | 57 | 0.686956 |
9b54af1692d85913e701eb01c8a4b16980c7bdd6 | 3,004 | //! Identifies each shard by an integer identifier.
use crate::{AttestationData, ChainSpec, CommitteeIndex, EthSpec, Slot};
use safe_arith::{ArithError, SafeArith};
use serde_derive::{Deserialize, Serialize};
use std::ops::{Deref, DerefMut};
const MAX_SUBNET_ID: usize = 64;
lazy_static! {
static ref SUBNET_ID_TO_... | 26.584071 | 92 | 0.626165 |
560844332a128d4718362b8a7debb61deb7436a0 | 663 | // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or ... | 24.555556 | 68 | 0.656109 |
2f78db2c9053c023f42692f0b0628a526d22b93d | 119 | mod admin_key_guard;
mod authorization_token_guard;
pub use admin_key_guard::*;
pub use authorization_token_guard::*;
| 19.833333 | 37 | 0.823529 |
64e7ac19ea7a05873f3ebd85eaa1a36acc786c20 | 3,067 | // This file is part of Substrate.
// Copyright (C) 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
//
// http://w... | 33.336957 | 86 | 0.703293 |
e8da01126f321f1c4259035493aecc35f81fe880 | 40,302 | //! Implementation of the SAM4L ADCIFE.
//!
//! This is an implementation of the SAM4L analog to digital converter. It is
//! bare-bones because it provides little flexibility on how samples are taken.
//! Currently, all samples:
//!
//! - are 12 bits
//! - use the ground pad as the negative reference
//! - use a VCC/2... | 37.042279 | 99 | 0.551983 |
efcce4e52fd3c4967a770c5bec430d21e3fbc69e | 6,047 | use super::rocket;
use rocket::http::ContentType;
use rocket::http::Status;
use rocket::local::blocking::Client;
use serde_json::Value;
#[test]
fn test_create() {
let client = Client::tracked(rocket()).unwrap();
let response = client.get("/create").dispatch();
assert_eq!(response.status(), Status::Ok);
... | 37.09816 | 81 | 0.626261 |
8ff1cb5d2ba3c6c700379eb58ef006bc1e1e7d02 | 256 | use crate::error::DatabaseError;
use crate::mysql::protocol::ErrPacket;
pub struct MySqlError(pub(super) ErrPacket);
impl DatabaseError for MySqlError {
fn message(&self) -> &str {
&*self.0.error_message
}
}
impl_fmt_error!(MySqlError);
| 19.692308 | 44 | 0.703125 |
6188d0643b64357d92f3b7e8845f5119a7e78a35 | 1,040 | use crate::sound::wav;
use std::io;
use std::fmt;
pub struct SoundBank {
pub wave100: Box<[u8; 25600]>,
pub samples: Vec<wav::WavSample>
}
impl fmt::Display for SoundBank {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
writeln!(f, "WAVE100: {:2X?}...", &self.wave100[..8])?;
... | 23.636364 | 71 | 0.496154 |
5040aa4c7bd2ff03aa2233a16d6236c21f8c397e | 1,242 | use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct OSFingerprint {
pub id: String,
pub os_name: String,
pub version: String,
pub icmp_echo_code: u8,
pub icmp_ip_ttl: u8,
pub icmp_echo_ip_df: bool,
pub icmp_unreach_ip_df: bool,
pub icmp_unreach_ip_le... | 28.883721 | 67 | 0.609501 |
67c3ff25d3cf3c219b93e6441dbdbe7bbd698275 | 4,098 | mod annotation;
pub use annotation::annotate;
mod bbh_factory;
pub use bbh_factory::*;
mod bitmap;
pub use bitmap::*;
mod blend_mode;
pub use blend_mode::*;
mod blender;
pub use blender::*;
mod blur_types;
pub use blur_types::*;
pub mod canvas;
pub use canvas::{AutoCanvasRestore, Canvas, OwnedCanvas};
mod clip_o... | 16.326693 | 89 | 0.74939 |
8f420f34a8a5a5629b79e41faa1c989e7ca019da | 33,973 | #![doc = "generated by AutoRust 0.1.0"]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(unused_imports)]
use crate::models::*;
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub mod operations {
use crate::models::*;
use reqwest::StatusCode;
use snafu::{ResultExt, Snafu};
pub async f... | 49.740849 | 266 | 0.62479 |
50046917924735f70894e88874f61189867e3a51 | 4,235 | // Copyright (c) The Libra Core Contributors
// SPDX-License-Identifier: Apache-2.0
use crate::vote_data::VoteData;
use failure::prelude::*;
use libra_crypto::{hash::CryptoHash, HashValue};
use libra_types::{
block_info::BlockInfo,
crypto_proxies::{LedgerInfoWithSignatures, ValidatorVerifier},
ledger_info:... | 33.346457 | 99 | 0.606612 |
d958dfc681b00fe0703c2770dbf5ef78807a3033 | 751 | //! HIR datatypes. See the [rustc guide] for more info.
//!
//! [rustc guide]: https://rust-lang.github.io/rustc-guide/hir.html
#![feature(crate_visibility_modifier)]
#![feature(const_fn)] // For the unsizing cast on `&[]`
#![feature(in_band_lifetimes)]
#![feature(specialization)]
#![recursion_limit = "256"]
#[macro_... | 23.46875 | 67 | 0.744341 |
f8b0865f26321c7b68e8ed9f9ae0e1147b4641f9 | 2,017 | use crossbeam_channel as cc;
use serde::Serialize;
#[derive(Serialize, Debug, PartialEq)]
pub enum Severity {
WARNING,
ERROR,
}
impl Severity {
pub fn as_str(&self) -> &str {
match self {
Severity::WARNING => "WARNING",
Severity::ERROR => "ERROR",
}
}
}
pub type... | 27.630137 | 91 | 0.599405 |
0a863c01845ee9f785eaf6c6c30aedcc597568fa | 23,273 | use crate::avm1::activation::Activation;
use crate::avm1::error::Error;
use crate::avm1::function::{Executable, FunctionObject};
use crate::avm1::object::shared_object::SharedObject;
use crate::avm1::property::Attribute;
use crate::avm1::{AvmString, Object, TObject, Value};
use crate::avm_warn;
use crate::display_objec... | 31.238926 | 107 | 0.566837 |
1e6993199427d911f8e90344c062e7ae94308073 | 1,335 | // enum IpAddrKind {
// V4(String),
// V6(String)
// }
enum IpAddrKind {
V4(u8, u8, u8, u8),
V6(String),
}
struct IpAddr {
kind: IpAddrKind,
address: String,
}
enum Message {
Quit,
Move { x: i32, y: i32 },
Write(String),
ChangeColor(i32, i32, i32),
}
impl Message {
fn cal... | 16.898734 | 60 | 0.53633 |
eb2a3b787ad72ac6a9c354fd6d2d6d71bcaad763 | 2,387 | use std::ops::Deref;
use std::rc::Rc;
#[derive(Debug)]
pub enum List {
Cons(i32, Box<List>),
Nil
}
#[derive(Debug)]
pub enum List2 {
Cons(i32, Rc<List2>),
Nil
}
#[derive(Debug)]
pub struct MyBox<T>(T);
impl<T> MyBox<T> {
pub fn new(x: T) -> MyBox<T> {
MyBox(x)
}
}
impl<T> Deref for ... | 22.308411 | 95 | 0.56305 |
f5b15f807fedef2041b0bcfb31cc706cd9d56746 | 753 | extern crate oro_semver;
#[test]
fn test_regressions() {
use oro_semver::ReqParseError;
use oro_semver::VersionReq;
let versions = vec![
(".*", VersionReq::any()),
("0.1.0.", VersionReq::parse("0.1.0").unwrap()),
("0.3.1.3", VersionReq::parse("0.3.13").unwrap()),
("0.2*", V... | 27.888889 | 71 | 0.553785 |
768cab3b6a9bb1955da90af3c54c423ed7c25b95 | 12,903 | use crate::app::App;
use crate::colors::ColorScheme;
use crate::game::{ChooseSomething, State, Transition};
use aabb_quadtree::QuadTree;
use abstutil::{prettyprint_usize, Parallelism};
use geom::{Circle, Distance, PolyLine, Polygon, Pt2D, Ring};
use kml::ExtraShapes;
use map_model::BuildingID;
use std::collections::{BT... | 35.841667 | 98 | 0.43145 |
22b153237883e2c4961a95cade9f0ae4e7fcc117 | 5,681 |
use std::sync::Arc;
use std::sync::Mutex;
use std::path::PathBuf;
use async_trait::async_trait;
use tantivy::Index;
use tantivy::space_usage::SearcherSpaceUsage;
use tantivy::IndexWriter;
use tantivy::merge_policy::*;
use tantivy::{Document};
use serde::{Deserialize, Serialize};
use crate::Result;
/// Defines the ... | 29.9 | 88 | 0.525436 |
9015724a8b3025dc137be6755706620f935c34c1 | 2,763 | use header::{Header, HeaderFormat};
use std::fmt;
use header::parsing::from_one_raw_str;
/// The `Host` header.
///
/// HTTP/1.1 requires that all requests include a `Host` header, and so hyper
/// client requests add one automatically.
///
/// Currently is just a String, but it should probably become a better type,
/... | 27.356436 | 77 | 0.452407 |
c1c5f87129defeb5ea4aaf486aeae8875b045772 | 7,478 | use ffi::{
self, BIO_clear_retry_flags, BIO_new, BIO_set_retry_read, BIO_set_retry_write, BIO,
BIO_CTRL_FLUSH,
};
use libc::{c_char, c_int, c_long, c_void, strlen};
use std::any::Any;
use std::io;
use std::io::prelude::*;
use std::mem;
use std::panic::{catch_unwind, AssertUnwindSafe};
use std::ptr;
use std::sli... | 27.094203 | 100 | 0.503343 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.