<commit_before>import os

import numpy

import chainer
from chainer.dataset import download
from chainer.datasets._mnist_helper import make_npz
from chainer.datasets._mnist_helper import preprocess_mnist


_kmnist_labels = [('o', u'\u304A'), ('ki', u'\u304D'),
                  ('su', u'\u3059'), ('tsu', u'\u3064'),
                  ('na', u'\u306A'), ('ha', u'\u306F'),
                  ('ma', u'\u307E'), ('ya', u'\u3084'),
                  ('re', u'\u308C'), ('wo', u'\u3092')]


def get_kmnist_labels():
    """Provide a list of labels for the KMNIST dataset.

    Returns:
        List of labels in the form of tuples. Each tuple contains the 
        character name in romaji as a string value and the unicode codepoint 
        for the character.

    """
    return list(_kmnist_labels)


def get_kmnist(withlabel=True, ndim=1, scale=1., dtype=None,
               label_dtype=numpy.int32, rgb_format=False):
    """Gets the KMNIST dataset.

    `Kuzushiji-MNIST (KMNIST) <http://codh.rois.ac.jp/kmnist/>`_ is a set of<commit_msg>flake8 to remove trailing whitespace<commit_after>import os

import numpy

import chainer
from chainer.dataset import download
from chainer.datasets._mnist_helper import make_npz
from chainer.datasets._mnist_helper import preprocess_mnist


_kmnist_labels = [('o', u'\u304A'), ('ki', u'\u304D'),
                  ('su', u'\u3059'), ('tsu', u'\u3064'),
                  ('na', u'\u306A'), ('ha', u'\u306F'),
                  ('ma', u'\u307E'), ('ya', u'\u3084'),
                  ('re', u'\u308C'), ('wo', u'\u3092')]


def get_kmnist_labels():
    """Provide a list of labels for the KMNIST dataset.

    Returns:
        List of labels in the form of tuples. Each tuple contains the
        character name in romaji as a string value and the unicode codepoint
        for the character.

    """
    return list(_kmnist_labels)


def get_kmnist(withlabel=True, ndim=1, scale=1., dtype=None,
               label_dtype=numpy.int32, rgb_format=False):
    """Gets the KMNIST dataset.

    `Kuzushiji-MNIST (KMNIST) <http://codh.rois.ac.jp/kmnist/>`_ is a set of
{'fraction_non_alphanumeric': 0.14238253440911247, 'fraction_numerical': 0.036544850498338874, 'mean_word_length': 2.798198198198198, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5255341', 'n_tokens_mistral': 786, 'n_tokens_neox': 709, 'n_words': 199}