<commit_before># -*- encoding: utf-8 -*-
# ! python2

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import

from contextlib import contextmanager
import sys

from StringIO import StringIO


@contextmanager
def captured_output():
    """
    From: http://stackoverflow.com/a/17981937/752142
    """<commit_msg>Python3 StringIO fix<commit_after># -*- encoding: utf-8 -*-
# ! python2

from __future__ import unicode_literals
from __future__ import print_function
from __future__ import absolute_import

from contextlib import contextmanager
import sys

try:
    from StringIO import StringIO
except ImportError:
    from io import StringIO


@contextmanager
def captured_output():
    """
    From: http://stackoverflow.com/a/17981937/752142
    """
{'fraction_non_alphanumeric': 0.08148148148148149, 'fraction_numerical': 0.040740740740740744, 'mean_word_length': 4.554794520547945, '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': '5201499', 'n_tokens_mistral': 254, 'n_tokens_neox': 230, 'n_words': 71}