<commit_before>from numba import types
from numba.cuda.stubs import _vector_type_stubs


class SimulatedVectorType:
    attributes = ['x', 'y', 'z', 'w']

    def __init__(self, *args):
        args_flattened = []
        for arg in args:
            if isinstance(arg, SimulatedVectorType):
                args_flattened += arg.as_list()
            else:
                args_flattened.append(arg)
        self._attrs = self.attributes[:len(args_flattened)]
        assert self.num_elements == len(args_flattened), \
            f"{self.num_elements} != {len(args_flattened)}"

        for arg, attr in zip(args_flattened, self._attrs):
            setattr(self, attr, arg)

    @property
    def num_elelments(self):
        raise NotImplementedError()

    def as_list(self):
        return [getattr(self, attr) for attr in self._attrs]


def make_simulated_vector_type(num_elements, name):
    obj = type(name, (SimulatedVectorType,), {
        "num_elements": num_elements,
        "base_type": types.float32,
        "name": name
    })
    obj.user_facing_object = obj
    return obj


def _initialize():
    _simulated_vector_types = {}
    for stub in _vector_type_stubs:
        num_elements = int(stub.__name__[-1])
        _simulated_vector_types[stub.__name__] = (
            make_simulated_vector_type(num_elements, stub.__name__)
        )
        for alias in stub.aliases:
            _simulated_vector_types[alias] = (
                make_simulated_vector_type(num_elements, alias)
            )
    return _simulated_vector_types

<commit_msg>fix typo<commit_after>from numba import types
from numba.cuda.stubs import _vector_type_stubs


class SimulatedVectorType:
    attributes = ['x', 'y', 'z', 'w']

    def __init__(self, *args):
        args_flattened = []
        for arg in args:
            if isinstance(arg, SimulatedVectorType):
                args_flattened += arg.as_list()
            else:
                args_flattened.append(arg)
        self._attrs = self.attributes[:len(args_flattened)]
        assert self.num_elements == len(args_flattened), \
            f"{self.num_elements} != {len(args_flattened)}"

        for arg, attr in zip(args_flattened, self._attrs):
            setattr(self, attr, arg)

    @property
    def num_elements(self):
        raise NotImplementedError()

    def as_list(self):
        return [getattr(self, attr) for attr in self._attrs]


def make_simulated_vector_type(num_elements, name):
    obj = type(name, (SimulatedVectorType,), {
        "num_elements": num_elements,
        "base_type": types.float32,
        "name": name
    })
    obj.user_facing_object = obj
    return obj


def _initialize():
    _simulated_vector_types = {}
    for stub in _vector_type_stubs:
        num_elements = int(stub.__name__[-1])
        _simulated_vector_types[stub.__name__] = (
            make_simulated_vector_type(num_elements, stub.__name__)
        )
        for alias in stub.aliases:
            _simulated_vector_types[alias] = (
                make_simulated_vector_type(num_elements, alias)
            )
    return _simulated_vector_types


{'fraction_non_alphanumeric': 0.09916826615483046, 'fraction_numerical': 0.0019193857965451055, 'mean_word_length': 2.5534090909090907, 'pattern_counts': {'":': 6, '<': 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': '6870879', 'n_tokens_mistral': 991, 'n_tokens_neox': 969, 'n_words': 195}