<commit_before>"""
See README.rst for further information

"""
try:
    # Use LXML: the Pythonic binding for the C libraries libxml2 and libxslt.
    # Known as the fastest XML library in python
    import ixml.backends.lxmliterparse as _backend
except ImportError: # pragma: no cover
    # Awaiting a real fallback backend, this makes pip installing works.
    class FakeFallbackBackend(object):
        @staticmethod
        def parse(*args, **kwargs):
            raise Exception(
                'There is currently only a lxml backend so you must install lxml to use it.')
        @staticmethod
        def items(*args, **kwargs):
            raise Exception(
                'There is currently only a lxml backend so you must install lxml to use it.')

    _backend = FakeFallbackBackend

    # TODO: direct binding to the C libraries to avoid unused intermediate Element objects?
    # TODO: Fallback to some other backends: standard library ElementTree,
    # etc.?

parse = _backend.parse
items = _backend.items<commit_msg>Explicitely defined the API with __all__<commit_after>"""
See README.rst for further information

"""

# Define the API
__all__ = ['parse', 'items']


try:
    # Use LXML: the Pythonic binding for the C libraries libxml2 and libxslt.
    # Known as the fastest XML library in python
    import ixml.backends.lxmliterparse as backend
except ImportError: # pragma: no cover
    # Awaiting a real fallback backend, this makes pip installing works.
    class FakeFallbackBackend(object):
        @staticmethod
        def parse(*args, **kwargs):
            raise Exception(
                'There is currently only a lxml backend so you must install lxml to use it.')
        @staticmethod
        def items(*args, **kwargs):
            raise Exception(
                'There is currently only a lxml backend so you must install lxml to use it.')

    backend = FakeFallbackBackend

    # TODO: direct binding to the C libraries to avoid unused intermediate Element objects?
    # TODO: Fallback to some other backends: standard library ElementTree,
    # etc.?

parse = backend.parse
items = backend.items
{'fraction_non_alphanumeric': 0.06688493919550982, 'fraction_numerical': 0.0009354536950420954, 'mean_word_length': 2.882032667876588, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 14}, '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': '3334485', 'n_tokens_mistral': 571, 'n_tokens_neox': 557, 'n_words': 248}