<commit_before>##
# Copyright (c) 2014 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##


from distutils.command import build_ext as _build_ext


class cython_build_ext(_build_ext.build_ext):
    def __init__(self, *args, **kwargs):
        self._ctor_args = args
        self._ctor_kwargs = kwargs
        self._cython = None

    def __getattribute__(self, name):
        cython = object.__getattribute__(self, '_cython')
        if cython is None:
            from Cython.Distutils import build_ext

            _ctor_args = object.__getattribute__(self, '_ctor_args')
            _ctor_kwargs = object.__getattribute__(self, '_ctor_kwargs')
            cython = build_ext(*_ctor_args, **_ctor_kwargs)
            object.__setattr__(self, '_cython', cython)
        return getattr(cython, name)<commit_msg>utils.distutils: Create build_ext command class dynamically instead of proxying it<commit_after>##
# Copyright (c) 2014 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##


import types

from setuptools.command import build_ext as _build_ext


class cython_build_ext(_build_ext.build_ext):
    def __new__(cls, *args, **kwargs):
        # Since Cython availability is not guaranteed at top level,
        # we have to resort to injecting cython build_ext into
        # our mro here.
        #
        from Cython.Distutils import build_ext as _cython_build_ext

        _ns = cls.__dict__

        _cls = types.new_class('build_ext',
                                bases=(_cython_build_ext,),
                                exec_body=lambda ns: _ns)

        result = _cls.__new__(_cls, *args, **kwargs)
        result.__init__(*args, **kwargs)

        return result
{'fraction_non_alphanumeric': 0.08688046647230321, 'fraction_numerical': 0.004664723032069971, 'mean_word_length': 2.6824034334763946, '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': '5605782', 'n_tokens_mistral': 519, 'n_tokens_neox': 497, 'n_words': 138}