<commit_before>"""Author: <NAME>
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'

Brings up a couchbase cluster.
"""

from __future__ import print_function

import re
import requests
import sys
import time

from . import common, docker, dns as dns_mod

COUCHBASE_READY_WAIT_SECONDS = 60


def _couchbase(cluster_name, num):
    return 'couchbase{0}_{1}'.format(num, cluster_name)


def config_entry(cluster_name, num, uid):
    return '{0}:11211'.format(common.format_hostname(_couchbase(cluster_name, num), uid))


def _node_up(command, cluster_name, num, dns, image, uid):
    hostname = common.format_hostname(_couchbase(cluster_name, num), uid)
    node = docker.run(
        image=image,
        name=hostname,
        hostname=hostname,
        detach=True,
        interactive=True,
        tty=True,
        dns_list=dns,
        command=command)

    return {
        'docker_ids': [node],
        'couchbase_nodes': [hostname]
    }


def _ready(container):<commit_msg>docker 1.11 compatibility fix<commit_after>"""Author: <NAME>
Copyright (C) 2015 ACK CYFRONET AGH
This software is released under the MIT license cited in 'LICENSE.txt'

Brings up a couchbase cluster.
"""

from __future__ import print_function

import re
import requests
import sys
import time

from . import common, docker, dns as dns_mod

COUCHBASE_READY_WAIT_SECONDS = 60


def _couchbase(cluster_name, num):
    return 'couchbase{0}-{1}'.format(num, cluster_name)


def config_entry(cluster_name, num, uid):
    return '{0}:11211'.format(common.format_hostname(_couchbase(cluster_name, num), uid))


def _node_up(command, cluster_name, num, dns, image, uid):
    hostname = common.format_hostname(_couchbase(cluster_name, num), uid)
    node = docker.run(
        image=image,
        name=hostname,
        hostname=hostname,
        detach=True,
        interactive=True,
        tty=True,
        dns_list=dns,
        command=command)

    return {
        'docker_ids': [node],
        'couchbase_nodes': [hostname]
    }


def _ready(container):
{'fraction_non_alphanumeric': 0.10325047801147227, 'fraction_numerical': 0.014818355640535373, 'mean_word_length': 3.713963963963964, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '353600', 'n_tokens_mistral': 720, 'n_tokens_neox': 690, 'n_words': 176}