<commit_before>from __future__ import absolute_import

import chainer
from chainer.configuration import config


_ideep_version = None
_error = None

try:
    import ideep4py as ideep  # NOQA
    from ideep4py import mdarray  # NOQA
    _ideep_version = 0
except ImportError as e:
    _error = e

    class mdarray(object):
        pass  # for type testing


# ------------------------------------------------------------------------------
# ideep configuration
# ------------------------------------------------------------------------------
_SHOULD_USE_IDEEP = {
    '==always': {'always': True, 'auto': False, 'never': False},
    '>=auto':   {'always': True, 'auto': True,  'never': False},
}


def is_ideep_available():
    return _ideep_version is not None


def check_ideep_available():
    """Checks if iDeep is available.

    When iDeep is correctly set up, nothing happens.
    Otherwise it raises ``RuntimeError``.
    """
    if _ideep_version is None:
        # If the error is missing shared object, append a message to<commit_msg>add docs to is_ideep_available<commit_after>from __future__ import absolute_import

import chainer
from chainer.configuration import config


_ideep_version = None
_error = None

try:
    import ideep4py as ideep  # NOQA
    from ideep4py import mdarray  # NOQA
    _ideep_version = 0
except ImportError as e:
    _error = e

    class mdarray(object):
        pass  # for type testing


# ------------------------------------------------------------------------------
# ideep configuration
# ------------------------------------------------------------------------------
_SHOULD_USE_IDEEP = {
    '==always': {'always': True, 'auto': False, 'never': False},
    '>=auto':   {'always': True, 'auto': True,  'never': False},
}


def is_ideep_available():
    """Returns if iDeep is available.

    Returns:
        bool: ``True`` if iDeep is installed.
    """

    return _ideep_version is not None


def check_ideep_available():
    """Checks if iDeep is available.

    When iDeep is correctly set up, nothing happens.
    Otherwise it raises ``RuntimeError``.
    """
    if _ideep_version is None:
        # If the error is missing shared object, append a message to
{'fraction_non_alphanumeric': 0.22202166064981949, 'fraction_numerical': 0.002707581227436823, 'mean_word_length': 1.9209486166007905, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '635256', 'n_tokens_mistral': 618, 'n_tokens_neox': 590, 'n_words': 208}