<commit_before>import os
from twisted.application import service, internet
#from twisted.protocols.policies import TrafficLoggingFactory
from urlparse import urlparse

from powerstrip.powerstrip import ServerProtocolFactory

application = service.Application("Powerstrip")

DOCKER_HOST = os.environ.get('DOCKER_HOST')
if "://" not in DOCKER_HOST:
    DOCKER_HOST = "tcp://" + DOCKER_HOST
if DOCKER_HOST.startswith("tcp://"):
    parsed = urlparse(DOCKER_HOST)
    dockerAPI = ServerProtocolFactory(dockerAddr=parsed.hostname,
        dockerPort=parsed.port)<commit_msg>sensible default = unix socket<commit_after>import os
from twisted.application import service, internet
#from twisted.protocols.policies import TrafficLoggingFactory
from urlparse import urlparse

from powerstrip.powerstrip import ServerProtocolFactory

application = service.Application("Powerstrip")

DOCKER_HOST = os.environ.get('DOCKER_HOST')
if DOCKER_HOST is None:
    # Default to assuming we've got a Docker socket bind-mounted into a
    # container we're running in.
    DOCKER_HOST = "unix:///var/run/docker.sock"
if "://" not in DOCKER_HOST:
    DOCKER_HOST = "tcp://" + DOCKER_HOST
if DOCKER_HOST.startswith("tcp://"):
    parsed = urlparse(DOCKER_HOST)
    dockerAPI = ServerProtocolFactory(dockerAddr=parsed.hostname,
        dockerPort=parsed.port)
{'fraction_non_alphanumeric': 0.09602400600150038, 'fraction_numerical': 0.0, 'mean_word_length': 5.262910798122066, 'pattern_counts': {'":': 2, '<': 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': '1594753', 'n_tokens_mistral': 414, 'n_tokens_neox': 412, 'n_words': 97}