<commit_before># Copyright (C) 2013-2014 SignalFuse, Inc.
# Copyright (C) 2015 SignalFx, Inc.
#
# Docker container orchestration utility.

import bgtunnel
import datetime
import time
import os

# Import _strptime manually to work around a thread safety issue when using
# strptime() from threads for the first time.
import _strptime # flake8: noqa

import docker
try:
    from docker.errors import APIError
except ImportError:
    # Fall back to <= 0.3.1 location
    from docker.client import APIError

import multiprocessing.pool
import re
import six

# For Python bug workaround
import threading
import weakref

from . import exceptions
from . import lifecycle


# Possible values for the restart policy type.
_VALID_RESTART_POLICIES = ['no', 'always', 'on-failure']


class Entity:
    """Base class for named entities in the orchestrator."""
    def __init__(self, name):
        self._name = name

    @property
    def name(self):
        """Get the name of this entity."""
        return self._name

    def __repr__(self):
        return self._name


class Ship(Entity):
    """A Ship that can host and run Containers.

    Ships are hosts in the infrastructure. A Docker daemon is expected to be
    running on each ship, providing control over the containers that will be
    executed there.
    """

    DEFAULT_DOCKER_PORT = 2375
    DEFAULT_DOCKER_TLS_PORT = 2376
    DEFAULT_DOCKER_VERSION = '1.10'
    DEFAULT_DOCKER_TIMEOUT = 5

    def __init__(self, name, ip, endpoint=None, docker_port=None,
                 socket_path=None, timeout=None, ssh_tunnel=None, tls=None,
                 tls_verify=False, tls_ca_cert=None, tls_cert=None,
                 tls_key=None, ssl_version=None):
        """Instantiate a new ship.

        Args:
            name (string): the name of the ship.<commit_msg>Update default Docker version to 1.15<commit_after># Copyright (C) 2013-2014 SignalFuse, Inc.
# Copyright (C) 2015 SignalFx, Inc.
#
# Docker container orchestration utility.

import bgtunnel
import datetime
import time
import os

# Import _strptime manually to work around a thread safety issue when using
# strptime() from threads for the first time.
import _strptime # flake8: noqa

import docker
try:
    from docker.errors import APIError
except ImportError:
    # Fall back to <= 0.3.1 location
    from docker.client import APIError

import multiprocessing.pool
import re
import six

# For Python bug workaround
import threading
import weakref

from . import exceptions
from . import lifecycle


# Possible values for the restart policy type.
_VALID_RESTART_POLICIES = ['no', 'always', 'on-failure']


class Entity:
    """Base class for named entities in the orchestrator."""
    def __init__(self, name):
        self._name = name

    @property
    def name(self):
        """Get the name of this entity."""
        return self._name

    def __repr__(self):
        return self._name


class Ship(Entity):
    """A Ship that can host and run Containers.

    Ships are hosts in the infrastructure. A Docker daemon is expected to be
    running on each ship, providing control over the containers that will be
    executed there.
    """

    DEFAULT_DOCKER_PORT = 2375
    DEFAULT_DOCKER_TLS_PORT = 2376
    DEFAULT_DOCKER_VERSION = '1.15'
    DEFAULT_DOCKER_TIMEOUT = 5

    def __init__(self, name, ip, endpoint=None, docker_port=None,
                 socket_path=None, timeout=None, ssh_tunnel=None, tls=None,
                 tls_verify=False, tls_ca_cert=None, tls_cert=None,
                 tls_key=None, ssl_version=None):
        """Instantiate a new ship.

        Args:
            name (string): the name of the ship.
{'fraction_non_alphanumeric': 0.07521881838074398, 'fraction_numerical': 0.016137855579868708, 'mean_word_length': 3.1136107986501687, 'pattern_counts': {'":': 0, '<': 5, '<?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': '3784159', 'n_tokens_mistral': 1144, 'n_tokens_neox': 1056, 'n_words': 398}