<commit_before># -*- coding: utf-8 -*-
from __future__ import unicode_literals

import six
from docker import client as docker
from fabric.api import env

from dockermap.map import base, client
from .base import ConnectionDict, get_local_port
from .socat import socat_tunnels
from .tunnel import local_tunnels


DOCKER_LOG_FORMAT = "[{0}] docker: {1}"


class DockerFabricConnections(ConnectionDict):
    """
    Cache for connections to the Docker Remote API.
    """
    def get_connection(self):
        """
        Create a new connection, or return an existing one from the cache. Uses Fabric's current ``env.host_string``
        and the URL to the Docker service.
        """
        key = env.host_string, env.docker_base_url<commit_msg>Handling missing host on connection cache.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals

import six
from docker import client as docker
from fabric.api import env

from dockermap.map import base, client
from .base import ConnectionDict, get_local_port
from .socat import socat_tunnels
from .tunnel import local_tunnels


DOCKER_LOG_FORMAT = "[{0}] docker: {1}"


class DockerFabricConnections(ConnectionDict):
    """
    Cache for connections to the Docker Remote API.
    """
    def get_connection(self):
        """
        Create a new connection, or return an existing one from the cache. Uses Fabric's current ``env.host_string``
        and the URL to the Docker service.
        """
        key = env.get('host_string'), env.get('docker_base_url')
{'fraction_non_alphanumeric': 0.08545335942596216, 'fraction_numerical': 0.003913894324853229, 'mean_word_length': 3.5791044776119403, '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': '740387', 'n_tokens_mistral': 458, 'n_tokens_neox': 433, 'n_words': 162}