<commit_before>import pytest
import io
import contextlib
import tempfile
import shutil
import os

from xd.docker.client import *


DOCKER_HOST = os.environ.get('DOCKER_HOST', None)


@pytest.fixture(scope="module")
def docker(request):
    return DockerClient(host=DOCKER_HOST)


class StreamRedirector(object):<commit_msg>tests: Purge images and containers before each test<commit_after>import pytest
import io
import contextlib
import tempfile
import shutil
import os

from xd.docker.client import *


DOCKER_HOST = os.environ.get('DOCKER_HOST', None)


@pytest.fixture(scope="function")
def docker(request):
    os.system("for c in `docker ps -a -q`;do docker rm $c;done")
    os.system("for i in `docker images -q`;do docker rmi $i;done")
    return DockerClient(host=DOCKER_HOST)


class StreamRedirector(object):
{'fraction_non_alphanumeric': 0.10268948655256724, 'fraction_numerical': 0.0, 'mean_word_length': 5.604838709677419, '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': '4486764', 'n_tokens_mistral': 285, 'n_tokens_neox': 274, 'n_words': 75}