<commit_before>__doc__ = """Utilities to read and write images in various formats.

The following plug-ins are available:

"""

from ._plugins import use as use_plugin
from ._plugins import available as plugins
from ._plugins import info as plugin_info
from ._plugins import configuration as plugin_order
available_plugins = plugins()

for preferred_plugin in ['matplotlib', 'pil', 'qt', 'null']:
    if preferred_plugin in available_plugins:
        try:
            use_plugin(preferred_plugin)
            break
        except ImportError:
            pass
<commit_msg>BUG: Use PIL as default imread plugin, since MPL imread is still somewhat broken.<commit_after>__doc__ = """Utilities to read and write images in various formats.

The following plug-ins are available:

"""

from ._plugins import use as use_plugin
from ._plugins import available as plugins
from ._plugins import info as plugin_info
from ._plugins import configuration as plugin_order
available_plugins = plugins()

for preferred_plugin in ['matplotlib', 'pil', 'qt', 'null']:
    if preferred_plugin in available_plugins:
        try:
            use_plugin(preferred_plugin)
            break
        except ImportError:
            pass

# Use PIL as the default imread plugin, since matplotlib (1.2.x)
# is buggy (flips PNGs around, returns bytes as floats, etc.)
try:
    use_plugin('pil', 'imread')
except ImportError:
    pass

{'fraction_non_alphanumeric': 0.07254623044096728, 'fraction_numerical': 0.001422475106685633, 'mean_word_length': 3.5533980582524274, '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': '3063072', 'n_tokens_mistral': 385, 'n_tokens_neox': 384, 'n_words': 155}