Dataset Preview
Duplicate
The full dataset viewer is not available (click to read why). Only showing a preview of the rows.
The dataset generation failed
Error code:   DatasetGenerationError
Exception:    TypeError
Message:      Couldn't cast array of type
struct<block: string, title: string, license: string, path: string, repo_name: string, programming_language: string>
to
{'license': Value('string'), 'path': Value('string'), 'repo_name': Value('string'), 'programming_language': Value('string')}
Traceback:    Traceback (most recent call last):
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1827, in _prepare_split_single
                  for key, table in generator:
                                    ^^^^^^^^^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 613, in wrapped
                  for item in generator(*args, **kwargs):
                              ~~~~~~~~~^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 343, in _generate_tables
                  self._cast_table(pa_table, json_field_paths=json_field_paths),
                  ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 132, in _cast_table
                  pa_table = table_cast(pa_table, self.info.features.arrow_schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2378, in table_cast
                  return cast_table_to_schema(table, schema)
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2312, in cast_table_to_schema
                  cast_array_to_feature(
                  ~~~~~~~~~~~~~~~~~~~~~^
                      table[name] if name in table_column_names else pa.array([None] * len(table), type=schema.field(name).type),
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                      feature,
                      ^^^^^^^^
                  )
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 1861, in wrapper
                  return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks])
                                           ~~~~^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/table.py", line 2158, in cast_array_to_feature
                  raise TypeError(f"Couldn't cast array of type\n{_short_str(array.type)}\nto\n{_short_str(feature)}")
              TypeError: Couldn't cast array of type
              struct<block: string, title: string, license: string, path: string, repo_name: string, programming_language: string>
              to
              {'license': Value('string'), 'path': Value('string'), 'repo_name': Value('string'), 'programming_language': Value('string')}
              
              The above exception was the direct cause of the following exception:
              
              Traceback (most recent call last):
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 1369, in compute_config_parquet_and_info_response
                  parquet_operations, partial, estimated_dataset_info = stream_convert_to_parquet(
                                                                        ~~~~~~~~~~~~~~~~~~~~~~~~~^
                      builder, max_dataset_size_bytes=max_dataset_size_bytes
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  )
                  ^
                File "/src/services/worker/src/worker/job_runners/config/parquet_and_info.py", line 948, in stream_convert_to_parquet
                  builder._prepare_split(split_generator=splits_generators[split], file_format="parquet")
                  ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1694, in _prepare_split
                  for job_id, done, content in self._prepare_split_single(
                                               ~~~~~~~~~~~~~~~~~~~~~~~~~~^
                      gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                  ):
                  ^
                File "/usr/local/lib/python3.14/site-packages/datasets/builder.py", line 1880, in _prepare_split_single
                  raise DatasetGenerationError("An error occurred while generating the dataset") from e
              datasets.exceptions.DatasetGenerationError: An error occurred while generating the dataset

Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.

text
string
source
string
category
string
quality_score
null
token_count
int64
language
string
metadata
dict
from django import forms from django.core.exceptions import ValidationError from django.core.validators import validate_slug from django.db import models from django.utils import simplejson as json from django.utils.text import capfirst from django.utils.translation import ugettext_lazy as _ from philo.forms.fields im...
githubcode_python
code
null
1,157
en
{ "license": "isc", "path": "philo/models/fields/__init__.py", "repo_name": "ithinksw/philo", "programming_language": "python" }
import hashlib import json import logging import os import subprocess import sys import time from collections import defaultdict from shutil import copy from shutil import copyfile from shutil import copystat from shutil import copytree from tempfile import mkdtemp import boto3 import botocore import yaml import sys ...
githubcode_python
code
null
5,903
en
{ "license": "isc", "path": "aws_lambda/aws_lambda.py", "repo_name": "nficano/python-lambda", "programming_language": "python" }
# Copyright (c) 2015, Max Fillinger <[EMAIL]> # # 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 AUTHOR DISC...
githubcode_python
code
null
6,404
en
{ "license": "isc", "path": "getebook/epub.py", "repo_name": "mfil/getebook", "programming_language": "python" }
import numpy as np import pandas as pd from pandas import Series, DataFrame from scipy.spatial import distance import matplotlib.pyplot as plt from sklearn.cluster import DBSCAN from sklearn import metrics from sklearn.datasets.samples_generator import make_blobs from sklearn.preprocessing import StandardScaler from s...
githubcode_python
code
null
333
en
{ "license": "mit", "path": "src/identification/Identifier.py", "repo_name": "banacer/door-wiz", "programming_language": "python" }
""" ******************************************************************** Test file for implementation check of CR3BP library. ******************************************************************** Last update: 21/01/2022 Description ----------- Contains a few sample orbit propagations to test the CR3BP library. ...
githubcode_python
code
null
1,945
en
{ "license": "mit", "path": "contrib/CR3BP/test_run_CR3BP.py", "repo_name": "poliastro/poliastro", "programming_language": "python" }
#!/usr/bin/env python # -*- coding: utf-8 -*- from runner.koan import * class AboutIteration(Koan): def test_iterators_are_a_type(self): it = iter(range(1,6)) total = 0 for num in it: total += num self.assertEqual(15 , total) def test_iterating_with_next(self):...
githubcode_python
code
null
864
en
{ "license": "mit", "path": "python3/koans/about_iteration.py", "repo_name": "bohdan7/python_koans", "programming_language": "python" }
from api_request import Api from util import Util from twocheckout import Twocheckout class Sale(Twocheckout): def __init__(self, dict_): super(self.__class__, self).__init__(dict_) @classmethod def find(cls, params=None): if params is None: params = dict() response = ...
githubcode_python
code
null
703
en
{ "license": "mit", "path": "twocheckout/sale.py", "repo_name": "2Checkout/2checkout-python", "programming_language": "python" }
import json import os from flask import request, g, render_template, make_response, jsonify, Response from helpers.raw_endpoint import get_id, store_json_to_file from helpers.groups import get_groups from json_controller import JSONController from main import app from pymongo import MongoClient, errors HERE = os.pat...
githubcode_python
code
null
977
en
{ "license": "mit", "path": "scinet/views.py", "repo_name": "CenterForOpenScience/scinet", "programming_language": "python" }
from corecat.constants import OBJECT_CODES, MODEL_VERSION from ._sqlalchemy import Base, CoreCatBaseMixin from ._sqlalchemy import Column, \ Integer, \ String, Text class Project(CoreCatBaseMixin, Base): """Project Model class represent for the 'projects' table which is used to store project's basic i...
githubcode_python
code
null
286
en
{ "license": "mit", "path": "corecat/models/project.py", "repo_name": "DanceCats/CoreCat", "programming_language": "python" }
#!/usr/bin/env python from ansible.module_utils.hashivault import hashivault_argspec from ansible.module_utils.hashivault import hashivault_auth_client from ansible.module_utils.hashivault import hashivault_init from ansible.module_utils.hashivault import hashiwrapper ANSIBLE_METADATA = {'status': ['stableinterface'],...
githubcode_python
code
null
404
en
{ "license": "mit", "path": "ansible/modules/hashivault/hashivault_approle_role_get.py", "repo_name": "TerryHowe/ansible-modules-hashivault", "programming_language": "python" }
from flask import Blueprint, request, render_template from ..load import processing_results from ..abbr import get_abbr_map abbr_map = get_abbr_map() liner_mod = Blueprint('liner', __name__, template_folder='templates', static_folder='static') @liner_mod.route('/liner', methods=['GET', 'POST']) def liner(): if r...
githubcode_python
code
null
250
en
{ "license": "mit", "path": "app/liner/views.py", "repo_name": "griimick/feature-mlsite", "programming_language": "python" }
import asyncio import discord import datetime import pytz from discord.ext import commands from Cogs import FuzzySearch from Cogs import Settings from Cogs import DisplayName from Cogs import Message from Cogs import Nullify class Time: # Init with the bot reference, and a reference to the settings var ...
githubcode_python
code
null
2,259
en
{ "license": "mit", "path": "Cogs/Time.py", "repo_name": "TheMasterGhost/CorpBot", "programming_language": "python" }
import unittest from katas.beta.what_color_is_your_name import string_color class StringColorTestCase(unittest.TestCase): def test_equal_1(self): self.assertEqual(string_color('Jack'), '79CAE5') def test_equal_2(self): self.assertEqual(string_color('Joshua'), '6A10D6') def test_equal_3(...
githubcode_python
code
null
161
en
{ "license": "mit", "path": "tests/beta_tests/test_what_color_is_your_name.py", "repo_name": "the-zebulan/CodeWars", "programming_language": "python" }
""" ``editquality generate_make -h`` :: Code-generate Makefile from template and configuration :Usage: generate_make -h | --help generate_make [--config=<path>] [--main=<filename>] [--output=<path>] [--template...
githubcode_python
code
null
509
en
{ "license": "mit", "path": "editquality/utilities/generate_make.py", "repo_name": "wiki-ai/editquality", "programming_language": "python" }
# coding=utf8 """ Parser for todo format string. from todo.parser import parser parser.parse(string) # return an Todo instance """ from models import Task from models import Todo from ply import lex from ply import yacc class TodoLexer(object): """ Lexer for Todo format string. Tokens ID ...
githubcode_python
code
null
638
en
{ "license": "mit", "path": "todo/parser.py", "repo_name": "guori12321/todo", "programming_language": "python" }
import time import pymemcache.client import pytest from limits import RateLimitItemPerMinute, RateLimitItemPerSecond from limits.storage import MemcachedStorage, storage_from_string from limits.strategies import ( FixedWindowElasticExpiryRateLimiter, FixedWindowRateLimiter, ) from tests.utils import fixed_sta...
githubcode_python
code
null
767
en
{ "license": "mit", "path": "tests/storage/test_memcached.py", "repo_name": "alisaifee/limits", "programming_language": "python" }
import os import sys import tempfile from fabric.api import run, sudo, env, local, hide, settings from fabric.contrib.files import append, sed, exists, contains from fabric.context_managers import prefix from fabric.operations import get, put from fabric.context_managers import cd from fabric.tasks import Task from ...
githubcode_python
code
null
1,364
en
{ "license": "mit", "path": "fab_deploy/joyent/postgres.py", "repo_name": "ff0000/red-fab-deploy", "programming_language": "python" }
""" Gauged https://github.com/chriso/gauged (MIT Licensed) Copyright 2014 (c) Chris O'Hara <[EMAIL]> """ from urlparse import urlparse, parse_qsl from urllib import unquote from .mysql import MySQLDriver from .sqlite import SQLiteDriver from .postgresql import PostgreSQLDriver def parse_dsn(dsn_string): """Parse...
githubcode_python
code
null
467
en
{ "license": "mit", "path": "gauged/drivers/__init__.py", "repo_name": "chriso/gauged", "programming_language": "python" }
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "ibtokin.settings") try: from django.core.management import execute_from_command_line except ImportError: # The above import may fail for some other reason. Ensure that the ...
githubcode_python
code
null
156
en
{ "license": "mit", "path": "manage.py", "repo_name": "ibtokin/ibtokin", "programming_language": "python" }
import boto import mock import moto import tempfile import unittest from click.testing import CliRunner from rubberjackcli.click import rubberjack class CLITests(unittest.TestCase): @moto.mock_s3_deprecated @mock.patch('boto.beanstalk.layer1.Layer1.create_application_version') @mock.patch('boto.beansta...
githubcode_python
code
null
1,343
en
{ "license": "mit", "path": "tests/test_cli.py", "repo_name": "laterpay/rubberjack-cli", "programming_language": "python" }
#!/usr/bin/python from noisemapper.mapper import * #from collectors.lib import utils ### Define the object mapper and start mapping def main(): # utils.drop_privileges() mapper = NoiseMapper() mapper.run() if __name__ == "__main__": main()
githubcode_python
code
null
59
en
{ "license": "mit", "path": "scripts/nmcollector.py", "repo_name": "dustlab/noisemapper", "programming_language": "python" }
import numpy as np from numpy import cumsum, sum, searchsorted from numpy.random import rand import math import utils import core.sentence as sentence import core.markovchain as mc import logging logger = logging.getLogger(__name__) # Dialogue making class. Need to review where to return a string, where to return a l...
githubcode_python
code
null
1,415
en
{ "license": "mit", "path": "core/dialogue.py", "repo_name": "dcorney/text-generation", "programming_language": "python" }
# -*- coding: utf-8 -*- from django.contrib.admin import TabularInline from .models import GalleryPhoto class PhotoInline(TabularInline): """ Tabular inline that will be displayed in the gallery form during frontend editing or in the admin site. """ model = GalleryPhoto fk_name = "gallery"
githubcode_python
code
null
72
en
{ "license": "mit", "path": "djangocms_unitegallery/admin.py", "repo_name": "izimobil/djangocms-unitegallery", "programming_language": "python" }
from __future__ import annotations from collections import defaultdict from collections.abc import Generator, Iterable, Mapping, MutableMapping from contextlib import contextmanager import logging import re import textwrap from types import MappingProxyType from typing import TYPE_CHECKING, Any, NamedTuple from markd...
githubcode_python
code
null
5,153
en
{ "license": "mit", "path": "src/mdformat/renderer/_context.py", "repo_name": "executablebooks/mdformat", "programming_language": "python" }
import teca.utils as tecautils import teca.ConfigHandler as tecaconf import unittest class TestFileFilter(unittest.TestCase): def setUp(self): self.conf = tecaconf.ConfigHandler( "tests/test_data/configuration.json", {"starting_path": "tests/test_data/images"} ) self...
githubcode_python
code
null
183
en
{ "license": "mit", "path": "tests/test_utils.py", "repo_name": "alfateam123/Teca", "programming_language": "python" }
#!/usr/bin/env python from hdf5handler import HDF5Handler handler = HDF5Handler('mydata.hdf5') handler.open() for i in range(100): handler.put(i, 'numbers') handler.close()
githubcode_python
code
null
48
en
{ "license": "mit", "path": "examples/opening.py", "repo_name": "iambernie/hdf5handler", "programming_language": "python" }
from decimal import Decimal from django import forms from django.template.loader import render_to_string from django.template.defaultfilters import slugify class BaseWidget(forms.TextInput): """ Base widget. Do not use this directly. """ template = None instance = None def get_parent_id(self,...
githubcode_python
code
null
1,744
en
{ "license": "mit", "path": "ratings/forms/widgets.py", "repo_name": "redsolution/django-generic-ratings", "programming_language": "python" }
from .stats_view_base import StatsViewSwagger, StatsViewSwaggerKeyRequired from .stats_util_dataverses import StatsMakerDataverses class DataverseCountByMonthView(StatsViewSwaggerKeyRequired): """API View - Dataverse counts by Month.""" # Define the swagger attributes # Note: api_path must match the path...
githubcode_python
code
null
1,285
en
{ "license": "mit", "path": "dv_apps/metrics/stats_views_dataverses.py", "repo_name": "IQSS/miniverse", "programming_language": "python" }
import uuid from django.db import models from django.conf import settings from django.contrib.auth.models import AbstractUser from django.contrib.auth.models import BaseUserManager from django.utils import timezone from accelerator_abstract.models import BaseUserRole from accelerator_abstract.models.base_base_profile...
githubcode_python
code
null
1,353
en
{ "license": "mit", "path": "simpleuser/models.py", "repo_name": "masschallenge/django-accelerator", "programming_language": "python" }
from setuptools import setup, find_packages from codecs import open import os def read(*paths): """Build a file path from *paths* and return the contents.""" with open(os.path.join(*paths), 'r') as f: return f.read() setup( name='transposer', version='0.0.3', description='Transposes column...
githubcode_python
code
null
299
en
{ "license": "mit", "path": "setup.py", "repo_name": "keithhamilton/transposer", "programming_language": "python" }
def calc(): h, l = input().split(' ') mapa = [] for i_row in range(int(h)): mapa.append(input().split(' ')) maior_num = 0 for row in mapa: for col in row: n = int(col) if (n > maior_num): maior_num = n qtd = [0 for i in range(maior_num + 1)] for row in mapa: for col in row: n = int(c...
githubcode_python
code
null
166
en
{ "license": "mit", "path": "2016/Main/L/Python/solution_1_wrong.py", "repo_name": "DestructHub/bcs-contest", "programming_language": "python" }
import traceback class EnsureExceptionHandledGuard: """Helper for ensuring that Future's exceptions were handled. This solves a nasty problem with Futures and Tasks that have an exception set: if nobody asks for the exception, the exception is never logged. This violates the Zen of Python: 'Errors s...
githubcode_python
code
null
724
en
{ "license": "mit", "path": "concurrent/futures/cooperative/ensure_exception_handled.py", "repo_name": "mikhtonyuk/rxpython", "programming_language": "python" }
import logging.handlers import os _pabotlog = logging.getLogger('PABot') _pabotlog.setLevel(logging.DEBUG) _logPath = os.path.abspath("./logging/pabot.log") _formatter = logging.Formatter('%(asctime)s - %(levelname)s - %(name)s - %(message)s') _consoleStreamHandler = logging.StreamHandler() _consoleStreamHandler.s...
githubcode_python
code
null
188
en
{ "license": "mit", "path": "modules/plugins/PABot/logging.py", "repo_name": "KevinJMcGrath/Symphony-Ares", "programming_language": "python" }
import ast import heisenberg.library.heisenberg_dynamics_context import heisenberg.library.orbit_plot import heisenberg.option_parser import heisenberg.plot import heisenberg.util import matplotlib import numpy as np import sys # https://github.com/matplotlib/matplotlib/issues/5907 says this should fix "Exceeded cell ...
githubcode_python
code
null
948
en
{ "license": "mit", "path": "heisenberg/plot/__main__.py", "repo_name": "vdods/heisenberg", "programming_language": "python" }
def send_simple_message(): return requests.post( "https://api.mailgun.net/v3/sandbox049ff464a4d54974bb0143935f9577ef.mailgun.org/messages", auth=("api", "key-679dc79b890e700f11f001a6bf86f4a1"), data={"from": "Mailgun Sandbox <[EMAIL]>", "to": "nick <[EMAIL]>", "su...
githubcode_python
code
null
295
en
{ "license": "mit", "path": "pdxpixel/core/mailgun.py", "repo_name": "nicorellius/pdxpixel", "programming_language": "python" }
End of preview.

K-12 Math & Coding Dataset

A ~2 billion token dataset built for K-12 math and coding education use cases: 1,004,991,667 tokens of math content and 1,020,505,114 tokens of code content, both comfortably over the 1B-token target for each category.

Dataset Summary

Category Tokens Rows File
Math 1,004,991,667 676,018 math/final.jsonl
Code 1,020,505,114 937,248 code/final.jsonl

Built via a 6-phase pipeline: source collection → cleaning (PII redaction, boilerplate/spam removal, encoding fixes) → deduplication (exact SHA-256 + fuzzy MinHash LSH) → heuristic quality filtering → budget-controlled final sampling → manual quality audit. Full methodology, per-source breakdowns, and known limitations are in final_report.md.

Schema

Each line is a JSON object:

{
  "text": "...",
  "source": "finemath4plus",
  "category": "math",
  "quality_score": 4.3,
  "token_count": 512,
  "language": "en",
  "metadata": {}
}
  • quality_score: populated only for finemath4plus (has an upstream classifier score); null for all other sources.
  • language: natural-language code (all records verified predominantly English). For code records, the actual programming language is under metadata.programming_language.
  • metadata: source-specific extra fields (URL, license, file path, repo name, exercise name, difficulty, etc. — varies by source).

Sources

Math: FineMath 4+, OpenWebMath, GSM8K, MATH (hendrycks_math). Code: GitHub Code (Python/JavaScript/Java/HTML/CSS via codeparrot/github-code-clean), freeCodeCamp, Exercism, APPS, CodeContests.

Token Counting

All token counts use the tiktoken cl100k_base tokenizer, computed via exact encode_ordinary() calls (not estimates) at every pipeline stage.

Quality Audit

Both categories were manually spot-checked twice (once pre-assembly, once on the final sampled corpus). Code passed cleanly at every check (~90-94% good, 0-2% bad). Math's final spot-check found a 15% "bad" rate (above the 10% target threshold) driven by several low-frequency, hard-to-cheaply-filter patterns (AI-generated SEO filler, off-topic forum comment dumps, one essay-mill advertisement, thin template pages) — documented as an accepted residual limitation rather than silently delivered. See final_audit.md and final_report.md Section 8 for full detail before using this dataset for anything quality-sensitive.

Known Limitations

See final_report.md Section 8 for the complete list, including: math corpus residual bad-rate, AMPS/OpenStax not sourced, The Stack v2 substituted with GitHub Code due to gating, freeCodeCamp/Exercism volume shortfall, and HTML's residual auto-generated-doc contamination.

License

Source licenses vary per record — see metadata.license for code records where available. FineMath 4+ and OpenWebMath are ODC-By. Aggregate dataset provided as-is for research/educational use; verify individual source licenses before redistribution.

Downloads last month
30