<commit_before>import io

from .fields import Field
from .base import StructureMeta, Structure
from .fields.strings import Bytes


class ChunkMeta(StructureMeta):
    def __init__(cls, name, bases, attrs, **options):
        cls.structure = StructureMeta(name, (Structure,), attrs, **options)


class Chunk(metaclass=ChunkMeta):
    def __init__(self, id):
        self.id = id

    def __call__(self, cls):
        cls._chunk = self
        if not issubclass(cls, ChunkMixin):
            cls.__bases__ = (ChunkMixin,) + cls.__bases__
        return cls

    @classmethod
    def extract(cls, obj):<commit_msg>Stub out an API for supporting multiple instances of a chunk in a stream<commit_after>import io

from .fields import Field
from .base import StructureMeta, Structure
from .fields.strings import Bytes


class ChunkMeta(StructureMeta):
    def __init__(cls, name, bases, attrs, **options):
        cls.structure = StructureMeta(name, (Structure,), attrs, **options)


class Chunk(metaclass=ChunkMeta):
    def __init__(self, id, multiple=False):
        self.id = id
        self.multiple = multiple

    def __call__(self, cls):
        cls._chunk = self
        if not issubclass(cls, ChunkMixin):
            cls.__bases__ = (ChunkMixin,) + cls.__bases__
        return cls

    @classmethod
    def extract(cls, obj):
{'fraction_non_alphanumeric': 0.09924812030075188, 'fraction_numerical': 0.0, 'mean_word_length': 3.1987381703470033, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6497825', 'n_tokens_mistral': 403, 'n_tokens_neox': 397, 'n_words': 121}