<commit_before>from cms.tests.base import CMSTestCase
from django.conf import settings
from shutil import rmtree as _rmtree
from sphinx.application import Sphinx
from tempfile import template, mkdtemp, _exists
import os

ROOT_DIR = os.path.join(settings.PROJECT_DIR, '..', '..')
DOCS_DIR = os.path.join(ROOT_DIR, 'docs')

class TemporaryDirectory:
    """Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everthing contained
    in it are removed.
    """

    def __init__(self, suffix="", prefix=template, dir=None):
        self.name = mkdtemp(suffix, prefix, dir)

    def __enter__(self):
        return self.name
<commit_msg>tests should now run under py25 as well<commit_after>from __future__ import with_statement
from cms.tests.base import CMSTestCase
from django.conf import settings
from shutil import rmtree as _rmtree
from sphinx.application import Sphinx
from tempfile import template, mkdtemp, _exists
import os

ROOT_DIR = os.path.join(settings.PROJECT_DIR, '..', '..')
DOCS_DIR = os.path.join(ROOT_DIR, 'docs')

class TemporaryDirectory:
    """Create and return a temporary directory.  This has the same
    behavior as mkdtemp but can be used as a context manager.  For
    example:

        with TemporaryDirectory() as tmpdir:
            ...

    Upon exiting the context, the directory and everthing contained
    in it are removed.
    """

    def __init__(self, suffix="", prefix=template, dir=None):
        self.name = mkdtemp(suffix, prefix, dir)

    def __enter__(self):
        return self.name

{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.0011574074074074073, 'mean_word_length': 3.4107142857142856, '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': '1408971', 'n_tokens_mistral': 511, 'n_tokens_neox': 497, 'n_words': 183}