<commit_before>import re
from datetime import timedelta
from urlparse import urlparse

import environ
from kombu import (Exchange,
                   Queue)

from treeherder import path

env = environ.Env()


def server_supports_tls(url):
    hostname = urlparse(url).netloc
    # Services such as RabbitMQ/Elasticsearch running on Travis/Vagrant
    # or in SCl3 do not support TLS. We could try adding locally using
    # self-signed certs, but until Travis has support it's not overly useful.
    if hostname == 'localhost' or hostname.endswith('.scl3.mozilla.com'):
        return False
    return True

TREEHERDER_MEMCACHED = env("TREEHERDER_MEMCACHED", default="127.0.0.1:11211")
TREEHERDER_MEMCACHED_KEY_PREFIX = env("TREEHERDER_MEMCACHED_KEY_PREFIX", default="treeherder")

DEBUG = env.bool("TREEHERDER_DEBUG", default=False)
ENABLE_DEBUG_TOOLBAR = env.bool("ENABLE_DEBUG_TOOLBAR", False)
DEBUG_TOOLBAR_PATCH_SETTINGS = False  # disable django debug toolbar automatic configuration

# Default to retaining data for ~4 months.
DATA_CYCLE_DAYS = env.int("DATA_CYCLE_DAYS", default=120)

# Make this unique, and don't share it with anybody.
SECRET_KEY = env("TREEHERDER_DJANGO_SECRET_KEY")

SITE_ID = 1
ROOT_URLCONF = "treeherder.config.urls"
WSGI_APPLICATION = 'treeherder.config.wsgi.application'

TIME_ZONE = "America/Los_Angeles"
USE_I18N = False
USE_L10N = True<commit_msg>Bug 1286702 - Fix hostname extraction in server_supports_tls()<commit_after>import re
from datetime import timedelta
from urlparse import urlparse

import environ
from kombu import (Exchange,
                   Queue)

from treeherder import path

env = environ.Env()


def server_supports_tls(url):
    hostname = urlparse(url).hostname
    # Services such as RabbitMQ/Elasticsearch running on Travis/Vagrant
    # or in SCl3 do not support TLS. We could try adding locally using
    # self-signed certs, but until Travis has support it's not overly useful.
    if hostname == 'localhost' or hostname.endswith('.scl3.mozilla.com'):
        return False
    return True

TREEHERDER_MEMCACHED = env("TREEHERDER_MEMCACHED", default="127.0.0.1:11211")
TREEHERDER_MEMCACHED_KEY_PREFIX = env("TREEHERDER_MEMCACHED_KEY_PREFIX", default="treeherder")

DEBUG = env.bool("TREEHERDER_DEBUG", default=False)
ENABLE_DEBUG_TOOLBAR = env.bool("ENABLE_DEBUG_TOOLBAR", False)
DEBUG_TOOLBAR_PATCH_SETTINGS = False  # disable django debug toolbar automatic configuration

# Default to retaining data for ~4 months.
DATA_CYCLE_DAYS = env.int("DATA_CYCLE_DAYS", default=120)

# Make this unique, and don't share it with anybody.
SECRET_KEY = env("TREEHERDER_DJANGO_SECRET_KEY")

SITE_ID = 1
ROOT_URLCONF = "treeherder.config.urls"
WSGI_APPLICATION = 'treeherder.config.wsgi.application'

TIME_ZONE = "America/Los_Angeles"
USE_I18N = False
USE_L10N = True
{'fraction_non_alphanumeric': 0.08413205537806177, 'fraction_numerical': 0.01810436634717785, 'mean_word_length': 5.034261241970022, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '4414714', 'n_tokens_mistral': 989, 'n_tokens_neox': 932, 'n_words': 245}