<commit_before>"""Classes to interact with the Docker Engine (using the package docker-py)"""
# Author: <NAME> <<EMAIL>>

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
import functools
import threading

import docker
import requests


def docker_is_running(client):
    """Return true if Docker server is responsive.

    Parameters
    ----------
    client : docker.client.DockerClient
        The Docker client. E.g., `client = docker.from_env()`.

    Returns
    -------
    running : bool
        True if Docker server is responsive.
    """
    try:
        client.ping()
        return True
    except (requests.exceptions.ConnectionError, docker.errors.APIError):
        return False


# Check whether Docker server is running.
client = docker.from_env(timeout=60)
DOCKER_RUNNING = docker_is_running(client)

<commit_msg>change timeout to 30 seconds<commit_after>"""Classes to interact with the Docker Engine (using the package docker-py)"""
# Author: <NAME> <<EMAIL>>

from __future__ import (absolute_import, division, print_function,
                        unicode_literals)
import functools
import threading

import docker
import requests


def docker_is_running(client):
    """Return true if Docker server is responsive.

    Parameters
    ----------
    client : docker.client.DockerClient
        The Docker client. E.g., `client = docker.from_env()`.

    Returns
    -------
    running : bool
        True if Docker server is responsive.
    """
    try:
        client.ping()
        return True
    except (requests.exceptions.ConnectionError, docker.errors.APIError):
        return False


client = docker.from_env(timeout=30)
DOCKER_RUNNING = docker_is_running(client)


{'fraction_non_alphanumeric': 0.10107893242475866, 'fraction_numerical': 0.0034071550255536627, 'mean_word_length': 2.822125813449024, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3684987', 'n_tokens_mistral': 515, 'n_tokens_neox': 470, 'n_words': 148}