<commit_before>import time
import requests
try:
    import docker
except:
    RuntimeError("Please run 'pip install docker' before using this module.")

class Helper(object):

    def __init__(self, start=True):
        self.client = docker.from_env()
        if start:
            self.start()

    def start(self, tb_ip=8888, server_ip=8889, name="crayon"):
        self.container = self.client.containers.run(
            "alband/crayon:latest",
            ports={tb_ip: tb_ip,
                   server_ip: server_ip},
            detach=True,
            name=name)
        # check server is working
        running = False
        retry = 20
        while not running:
            try:
                assert(requests.get("http://localhost:"+str(server_ip)).ok)
                running = True
            except:
                retry -= 1
                if retry == 0:
                    # The test will trigger the not running server error<commit_msg>give more time to the server to start for unit tests<commit_after>import time
import requests
try:
    import docker
except:
    RuntimeError("Please run 'pip install docker' before using this module.")

class Helper(object):

    def __init__(self, start=True):
        self.client = docker.from_env()
        if start:
            self.start()

    def start(self, tb_ip=8888, server_ip=8889, name="crayon"):
        self.container = self.client.containers.run(
            "alband/crayon:latest",
            ports={tb_ip: tb_ip,
                   server_ip: server_ip},
            detach=True,
            name=name)
        # check server is working
        running = False
        retry = 40
        while not running:
            try:
                assert(requests.get("http://localhost:"+str(server_ip)).ok)
                running = True
            except:
                retry -= 1
                if retry == 0:
                    # The test will trigger the not running server error
{'fraction_non_alphanumeric': 0.09169638308711156, 'fraction_numerical': 0.012226184411614875, 'mean_word_length': 1.7239944521497919, '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': '2824000', 'n_tokens_mistral': 558, 'n_tokens_neox': 522, 'n_words': 151}