<commit_before>class LazyObject(object):
    def __init__(self, factory):
        self._factory = factory

    def __getattribute__(self, name):
        factory = object.__getattribute__(self, '_factory')
        obj = factory()
        self.__class__ = obj.__class__
        self.__dict__ = obj.__dict__
        return object.__getattribute__(obj, name)<commit_msg>check for the factory being None<commit_after>class LazyObject(object):
    def __init__(self, factory):
        self._factory = factory

    def __getattribute__(self, name):
        factory = object.__getattribute__(self, '_factory')

        obj = factory()
        if not obj:
            raise RuntimeError('Unable to create lazy object from %s' % factory)
        self.__class__ = obj.__class__
        self.__dict__ = obj.__dict__

        return object.__getattribute__(obj, name)
{'fraction_non_alphanumeric': 0.09250585480093677, 'fraction_numerical': 0.0, 'mean_word_length': 2.8687782805429864, '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': '311085', 'n_tokens_mistral': 228, 'n_tokens_neox': 222, 'n_words': 60}