<commit_before>""" Decorator ``try_jit`` accelerates computation via Numba, when available
"""
from functools import wraps
import logging

logger = logging.getLogger('yatsm')

has_numba = True
try:
    import numba as nb
except ImportError:
    has_numba = False
else:
    # Check for an adequate version number
    try:
        nb_ver = nb.__version__.split('.')
        if int(nb_ver[0]) == 0 and int(nb_ver[1]) < 0.22:
            has_numba = False
            logger.warning('You have numba installed, but the version is too '
                           'old to be used (%s)' % nb.__version__)
    except:
        logger.warning('Could not parse numba version. Disabling numba.jit')
        has_numba = False


def _doublewrap(f):
    """ Allows decorators to be called with/without args/kwargs

    Allows:
        @decorator
        @decorator()
        @decorator(args, kwargs=values)

    Modification of answer from user "bj0" on StackOverflow:
    http://stackoverflow.com/a/14412901
    """
    @wraps(f)
    def new_dec(*args, **kwargs):<commit_msg>Fix typo<commit_after>""" Decorator ``try_jit`` accelerates computation via Numba, when available
"""
from functools import wraps
import logging

logger = logging.getLogger('yatsm')

has_numba = True
try:
    import numba as nb
except ImportError:
    has_numba = False
else:
    # Check for an adequate version number
    try:
        nb_ver = nb.__version__.split('.')
        if int(nb_ver[0]) == 0 and int(nb_ver[1]) < 22:
            has_numba = False
            logger.warning('You have numba installed, but the version is too '
                           'old to be used (%s)' % nb.__version__)
    except:
        logger.warning('Could not parse numba version. Disabling numba.jit')
        has_numba = False


def _doublewrap(f):
    """ Allows decorators to be called with/without args/kwargs

    Allows:
        @decorator
        @decorator()
        @decorator(args, kwargs=values)

    Modification of answer from user "bj0" on StackOverflow:
    http://stackoverflow.com/a/14412901
    """
    @wraps(f)
    def new_dec(*args, **kwargs):
{'fraction_non_alphanumeric': 0.10449172576832151, 'fraction_numerical': 0.013711583924349883, 'mean_word_length': 2.6545768566493955, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3253834', 'n_tokens_mistral': 677, 'n_tokens_neox': 662, 'n_words': 196}