Dataset Viewer
Auto-converted to Parquet Duplicate
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
fe711453e5de0906f307c1df4e550e1d5f6f946a
13,760
//! Core traits for rule definitions and rule context. //! As well as an internal prelude to make imports for rules easier. #![allow(unused_variables, unused_imports)] use crate::autofix::Fixer; use crate::Diagnostic; use dyn_clone::DynClone; use rslint_errors::Severity; use rslint_parser::{SyntaxNode, SyntaxNodeExt,...
33.891626
153
0.605596
1cfef2eee17feaab71f83fdc40ff3b1f44ca95f4
3,201
#![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...
43.849315
411
0.768822
ed68b198b84f7e44051fee6fa59cc53e8140da5f
18,688
extern crate serde; extern crate rltk; use rltk::{Console, GameState, Rltk, Point}; extern crate specs; use specs::prelude::*; use specs::saveload::{SimpleMarker, SimpleMarkerAllocator}; #[macro_use] extern crate specs_derive; mod components; pub use components::*; mod map; pub use map::*; mod player; use player::*; mo...
38.691511
156
0.552012
38687c7900268eaf889979a4f49c0a3669d6b03a
950
use super::{identification, producer::Control, protocol, scope::AnonymousScope, Context}; use crate::stat::Alias; use crate::test::samples; use clibri::server; use std::str::FromStr; use uuid::Uuid; type BroadcastStructA = (Vec<Uuid>, protocol::StructA); type BroadcastStructB = (Vec<Uuid>, protocol::StructB); #[allow...
32.758621
89
0.635789
ac383dfb4f4993c83f5f985e214a8f4cb3aa4258
411
pub mod activity; pub mod alert; pub mod app; pub mod completion; pub mod editor; pub mod explorer; pub mod find; pub mod hover; pub mod keymap; mod logging; pub mod palette; pub mod panel; pub mod picker; pub mod plugin; pub mod problem; pub mod scroll; pub mod search; pub mod settings; pub mod source_control; pub mod...
15.222222
23
0.754258
ebe3fd86bd134d594f5ef6f9211f7d0361234ac0
2,138
use num_derive::{FromPrimitive, ToPrimitive}; use solana_sdk::decode_error::DecodeError; use snafu::Snafu; /// Reasons the evm execution can fail. #[derive(Debug, Clone, PartialEq, FromPrimitive, ToPrimitive, Snafu)] pub enum EvmError { #[snafu(display("Cross-Program EVM execution disabled."))] CrossExecution...
30.985507
131
0.718896
5d96357610c9de4567981909e67b18fe7942884d
11,966
use rand::Rng; use rust_hdl::core::prelude::*; use rust_hdl::hls::prelude::*; use rust_hdl::widgets::prelude::*; #[derive(LogicBlock, Default)] struct ControllerTest { to_cpu: FIFOReadController<Bits<16>>, from_cpu: FIFOWriteController<Bits<16>>, to_cpu_fifo: SyncFIFO<Bits<16>, 6, 7, 1>, from_cpu_fifo:...
36.932099
96
0.544209
1a397e3540733e6be43879128d695f2775e83620
3,198
// // Copyright 2021 The Project Oak Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
32.30303
96
0.678549
fed4829e76a2c6f014b06fb8078419d1d527e89b
2,535
use rand::prelude::*; use crate::math::Point; /// Perlin noise generator. pub struct Perlin { rand_f: [f64; Self::POINT_COUNT], perm_x: [usize; Self::POINT_COUNT], perm_y: [usize; Self::POINT_COUNT], perm_z: [usize; Self::POINT_COUNT], } impl Perlin { const POINT_COUNT: usize = 256; pub fn n...
24.852941
89
0.413018
8f156bd8d4b4fef589ea307a817946182b6468f9
2,101
#[doc = "Register `FsinEXTCFG` reader"] pub struct R(crate::R<FSINEXTCFG_SPEC>); impl core::ops::Deref for R { type Target = crate::R<FSINEXTCFG_SPEC>; #[inline(always)] fn deref(&self) -> &Self::Target { &self.0 } } impl From<crate::R<FSINEXTCFG_SPEC>> for R { #[inline(always)] fn from(...
32.323077
445
0.63446
f7e3fb1ab02362068baa0c69d530e87a99ecaff4
4,487
#[doc = r" Value read from the register"] pub struct R { bits: u32, } #[doc = r" Value to write to the register"] pub struct W { bits: u32, } impl super::IFLAG2 { #[doc = r" Modifies the contents of the register"] #[inline] pub fn modify<F>(&self, f: F) where for<'w> F: FnOnce(&R, &'w mu...
26.708333
110
0.530198
896cd301b9b6f5955f0e1e4e5e3e280995d8c0f1
12,471
//! A typed high-level pipeline interface. use std::borrow::Borrow; use std::mem; use std::marker::PhantomData; use {hal, format, handle}; use hal::image::Layout; use hal::pass::{AttachmentOps, AttachmentLoadOp, AttachmentStoreOp}; use {Backend, Device, Primitive, Supports, Transfer, Graphics, Encoder}; pub use hal...
29.622328
110
0.553043
8a3bdcbd3d5ed4df4d8c4bf1b0557a09569d2c90
2,421
use libc; pub type __uint32_t = libc::c_uint; pub type uint32_t = __uint32_t; pub type size_t = libc::c_ulong; // https://www.geeksforgeeks.org/move-zeroes-end-array/ pub unsafe fn push_zeroes_to_end(mut arr: *mut uint32_t, mut n: size_t) -> size_t { let mut count: size_t = 0i32 as ...
35.086957
70
0.570838
395f56e110f052ff76b6383796269220e5f911b2
2,635
use crate::flows; use crate::flows::core::Variant; use crate::structures::config::Command::{Alfred, Best, Fn, Preview, Query, Repo, Search, Widget}; use crate::structures::config::{AlfredCommand, Config, RepoCommand}; use anyhow::Context; use anyhow::Error; pub fn handle_config(config: Config) -> Result<(), Error> { ...
43.916667
97
0.528273
ed4e36cc3dd031a3da7a2f910c976cde6b8042e5
2,821
use std::os::raw::{c_float, c_int}; use skia_safe::{AlphaType, ColorType, ImageInfo, IPoint, ISize, IVector, Rect}; use crate::common::context::Context; use crate::common::context::pixel_manipulation::image_data::ImageData; pub mod image_data; impl Context { pub fn create_image_data(width: c_int, height: c_int)...
26.613208
79
0.458703
26ce8bd7b74c4efa7dc34da105763405419eb463
1,678
// Copyright (c) SimpleStaking, Viable Systems and Tezedge Contributors // SPDX-License-Identifier: MIT use crate::protocol_runner::init::context::{ ProtocolRunnerInitContextErrorAction, ProtocolRunnerInitContextState, }; use crate::protocol_runner::init::ProtocolRunnerInitState; use crate::protocol_runner::Protoc...
39.023256
93
0.678188
71ad86def4f874b069ec8a48dba8f4456491dd50
1,710
#![forbid(unsafe_code)] // #![forbid(rust_2018_idioms)] #![allow(dead_code)] use std::ops::Range; /// A span is a range into a set of bytes - see it as a selection into a Git config file. /// /// Similar to [`std::ops::RangeInclusive`], but tailor made to work for us. /// There are various issues with std ranges, whi...
32.264151
154
0.681871
acbf73bf62a244f544190caa265074fe96f4381d
28,443
pub mod color_format; pub mod error; mod iter; pub mod options; mod utils; use crate::geometry::{ color::Color, mesh::{Face, Mesh, Vertex}, position::Position, }; use self::{ error::{Error, Kind}, iter::OffLines, options::Options, utils::{ConvertVec, StrParts}, }; pub type Result<T = ()> ...
28.846856
139
0.440741
1460635557fe0c572e41cc835ccdb97bb1f10c67
1,458
#[cfg(test)] mod process_token_tests { use super::jwt::JwtToken; use super::process_token; use actix_web::test::TestRequest; #[test] fn no_token_process_token() { let mock_request = TestRequest::with_header("test", "test").to_srv_request(); match process_token(&mock_request) { ...
29.16
98
0.615912
e223aa7bc765621233d07465ab0865da9a849f4c
36,877
//! Formatters for logging `tracing` events. use super::time::{self, FormatTime, SystemTime}; use crate::{ field::{MakeOutput, MakeVisitor, RecordFields, VisitFmt, VisitOutput}, fmt::fmt_subscriber::FmtContext, fmt::fmt_subscriber::FormattedFields, registry::LookupSpan, }; use std::{ fmt::{self, Wr...
30.227049
129
0.551997
d68f4c9d23c701a33085a9ea03fbb6eb7e4ddfe2
20,287
// Musium -- Music playback daemon with web-based library browser // Copyright 2021 Ruud van Asseldonk // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // A copy of the License has been included in the root of the repository. use st...
36.885455
115
0.567063
e9f26cb39169caa782a8bd6b96c353a68a6befe5
279
// compile-flags: -Z parse-only // ignore-tidy-linelength struct Foo; impl Foo { fn foo() {} #[stable(feature = "rust1", since = "1.0.0")] } //~ ERROR expected one of `async`, `const`, `crate`, `default`, `existential`, `extern`, `fn`, `pub`, `type`, or fn main() {}
21.461538
114
0.584229
8a2f83e83d9cca779c0cd8e02eeab8db2661fd6c
65
pub mod rpm_tape; pub mod rpm_tape_box; pub mod rpm_tape_tracks;
16.25
24
0.815385
8ab384f8e324f0187ce30718a16aded1ddf16719
440
pub fn part1(_input: &str) -> ! { todo!() } pub fn part2(_input: &str) -> ! { todo!() } #[allow(unreachable_code)] #[cfg(test)] #[test] fn part1_test() { assert_eq!( part1(&std::fs::read_to_string("input/day07.txt").unwrap()), () ); } #[allow(unreachable_code)] #[cfg(test)] #[test] fn ...
16.296296
68
0.540909
End of preview. Expand in Data Studio

Dataset 1: TheStack - Rust - Cleaned

Description: This dataset is drawn from TheStack Corpus, an open-source code dataset with over 3TB of GitHub data covering 48 programming languages. We selected a small portion of this dataset to optimize smaller language models for Rust, a popular statically typed language.

Target Language: Rust

Dataset Size:

  • Training: 900,000 files
  • Validation: 50,000 files
  • Test: 50,000 files

Preprocessing:

  1. Selected Rust as the target language due to its popularity on GitHub.
  2. Filtered out files with average line length > 100 characters, maximum line length > 1000 characters, and alphabet ratio < 25%.
  3. Split files into 90% training, 5% validation, and 5% test sets.

Tokenizer: Byte Pair Encoding (BPE) tokenizer with tab and whitespace tokens. GPT-2 vocabulary extended with special tokens.

Training Sequences: Sequences constructed by joining training data text to reach a context length of 2048 tokens (1024 tokens for full fine-tuning).

Downloads last month
198

Models trained or fine-tuned on ammarnasr/the-stack-rust-clean