<commit_before># coding: utf8
"""
Main app default settings.

This file gathers default value and documentation about each setting.

Environment-specific values of these parameters are overriden in files:

overrides/development.py
overrides/test.py
overrides/lbbdev.py
overrides/staging.py
overrides/production.py
"""
import os

from labonneboite.common.env import get_current_env, ENV_LBBDEV, ENV_DEVELOPMENT, ENV_TEST
from labonneboite.common.load_data import load_rome_labels, load_naf_labels

DEBUG = False
TESTING = False

LOG_LEVEL = 'DEBUG'

GLOBAL_STATIC_PATH = '/tmp'

ROME_DESCRIPTIONS = load_rome_labels()

NAF_CODES = load_naf_labels()

SEARCHING_TIME = 10000

DISTANCE_FILTER_DEFAULT = 10

ENABLE_TIMEIT_TIMERS = True

SENTRY_DSN = None
SENTRY_ENVIRONMENT = ""

ADMIN_EMAIL = '<EMAIL>'

SERVER_NAME = 'labonneboite.pole-emploi.fr'
PREFERRED_URL_SCHEME = 'http'

WTF_CSRF_ENABLED = True

# Values below are *fake* and should be used in development and test environments only.
# The real values are confidential, stored outside of github repository
# and are only used in production+staging.
# Note that tests don't pass for all values..
SCORE_50_HIRINGS = 10.0
SCORE_60_HIRINGS = 50.0
SCORE_80_HIRINGS = 100.0
SCORE_100_HIRINGS = 500.0

API_KEYS = {}
API_INTERNAL_CONSUMERS = []

VERSION_PRO_ALLOWED_IPS = []
VERSION_PRO_ALLOWED_EMAILS = []
VERSION_PRO_ALLOWED_EMAIL_SUFFIXES = []
VERSION_PRO_ALLOWED_EMAIL_REGEXPS = []

# Headcount
HEADCOUNT_INSEE = {
    '00': '0 salarié',
    '01': '1 ou 2 salariés',
    '02': '3 à 5 salariés',
    '03': '6 à 9 salariés',
    '11': '10 à 19 salariés',
    '12': '20 à 49 salariés',
    '21': '50 à 99 salariés',
    '22': '100 à 199 salariés',
    '31': '200 à 249 salariés',
    '32': '250 à 499 salariés',
    '41': '500 à 999 salariés',
    '42': '1 000 à 1 999 salariés',
    '51': '2 000 à 4 999 salariés',
    '52': '5 000 à 9 999 salariés',
    '53': '10 000 salariés et plus',
}

HEADCOUNT_INSEE_CHOICES = [(key, value) for key, value in sorted(HEADCOUNT_INSEE.items())]

HEADCOUNT_WHATEVER = 1
HEADCOUNT_SMALL_ONLY = 2
HEADCOUNT_BIG_ONLY = 3

HEADCOUNT_SMALL_ONLY_MAXIMUM = 12
HEADCOUNT_BIG_ONLY_MINIMUM = 21
HEADCOUNT_FILTER_DEFAULT = 1

HEADCOUNT_VALUES = {
    'all': HEADCOUNT_WHATEVER,
    'big': HEADCOUNT_BIG_ONLY,
    'small': HEADCOUNT_SMALL_ONLY
}

# Databases
ES_INDEX = 'labonneboite'
# Set ES_TIMEOUT environment variable to 0 to remove ES timeouts entirely
ES_TIMEOUT = int(os.environ.get('ES_TIMEOUT', 10)) or None
DB_HOST = 'localhost'
DB_PORT = 3306
DB_NAME = 'labonneboite'
DB_USER = 'labonneboite'
DB_PASSWORD = '<PASSWORD>'
OFFICE_TABLE = 'etablissements'

TILE_SERVER_URL = "http://openmapsurfer.uni-hd.de/tiles/roads/x={x}&y={y}&z={z}"

ROME_NAF_PROBABILITY_CUTOFF = 0.05

FLASK_SECRET_KEY = '<set it>'

# Settings that need to be overwritten
# FIXME there should be a default value for these settings in the code whenever the setting is not defined.
PEAM_CLIENT_ID = '<set it>'
PEAM_CLIENT_SECRET = '<set it>'
PEAM_AUTH_BASE_URL = '<set it>'
PEAM_API_BASE_URL = '<set it>'
PEAM_USERINFO_URL = '<set it>'
MANDRILL_API_KEY = '<set it>'
FORM_EMAIL = '<set it>'

# GA/GO snippets are only useful in production and staging,
# we use dummy values everywhere else
GOOGLE_ANALYTICS_ID = 'UA-00000000-0'
GOOGLE_OPTIMIZE_ID = 'GTM-AAAA00A'
GOOGLE_TAG_MANAGER_ID = 'AAA-AAAAAAA'
ENABLE_ADBLOCK_TRACKING = False
ENABLE_GOOGLE_OPTIMIZE = False

MEMO_JS_URL = 'https://memo.pole-emploi.fr/js/importButton/memoButton-min.js'
API_ADRESSE_BASE_URL = 'https://api-adresse.data.gouv.fr'

# Tilkee parameters: credentials are provided by the Tilkee tech team
TILKEE_ENABLED = True
TILKEE_API_BASE_URL = 'https://api.tilkee.com'
TILKEE_VERIFY_SSL = True
TILKEE_ACCESS_TOKEN = '<set it>'
TILKEE_X_REF = '<set it>'
TILKEE_COMPANY_ID = '<set it>'

if get_current_env() == ENV_LBBDEV:<commit_msg>Hotfix - disable Tilkee<commit_after># coding: utf8
"""
Main app default settings.

This file gathers default value and documentation about each setting.

Environment-specific values of these parameters are overriden in files:

overrides/development.py
overrides/test.py
overrides/lbbdev.py
overrides/staging.py
overrides/production.py
"""
import os

from labonneboite.common.env import get_current_env, ENV_LBBDEV, ENV_DEVELOPMENT, ENV_TEST
from labonneboite.common.load_data import load_rome_labels, load_naf_labels

DEBUG = False
TESTING = False

LOG_LEVEL = 'DEBUG'

GLOBAL_STATIC_PATH = '/tmp'

ROME_DESCRIPTIONS = load_rome_labels()

NAF_CODES = load_naf_labels()

SEARCHING_TIME = 10000

DISTANCE_FILTER_DEFAULT = 10

ENABLE_TIMEIT_TIMERS = True

SENTRY_DSN = None
SENTRY_ENVIRONMENT = ""

ADMIN_EMAIL = '<EMAIL>'

SERVER_NAME = 'labonneboite.pole-emploi.fr'
PREFERRED_URL_SCHEME = 'http'

WTF_CSRF_ENABLED = True

# Values below are *fake* and should be used in development and test environments only.
# The real values are confidential, stored outside of github repository
# and are only used in production+staging.
# Note that tests don't pass for all values..
SCORE_50_HIRINGS = 10.0
SCORE_60_HIRINGS = 50.0
SCORE_80_HIRINGS = 100.0
SCORE_100_HIRINGS = 500.0

API_KEYS = {}
API_INTERNAL_CONSUMERS = []

VERSION_PRO_ALLOWED_IPS = []
VERSION_PRO_ALLOWED_EMAILS = []
VERSION_PRO_ALLOWED_EMAIL_SUFFIXES = []
VERSION_PRO_ALLOWED_EMAIL_REGEXPS = []

# Headcount
HEADCOUNT_INSEE = {
    '00': '0 salarié',
    '01': '1 ou 2 salariés',
    '02': '3 à 5 salariés',
    '03': '6 à 9 salariés',
    '11': '10 à 19 salariés',
    '12': '20 à 49 salariés',
    '21': '50 à 99 salariés',
    '22': '100 à 199 salariés',
    '31': '200 à 249 salariés',
    '32': '250 à 499 salariés',
    '41': '500 à 999 salariés',
    '42': '1 000 à 1 999 salariés',
    '51': '2 000 à 4 999 salariés',
    '52': '5 000 à 9 999 salariés',
    '53': '10 000 salariés et plus',
}

HEADCOUNT_INSEE_CHOICES = [(key, value) for key, value in sorted(HEADCOUNT_INSEE.items())]

HEADCOUNT_WHATEVER = 1
HEADCOUNT_SMALL_ONLY = 2
HEADCOUNT_BIG_ONLY = 3

HEADCOUNT_SMALL_ONLY_MAXIMUM = 12
HEADCOUNT_BIG_ONLY_MINIMUM = 21
HEADCOUNT_FILTER_DEFAULT = 1

HEADCOUNT_VALUES = {
    'all': HEADCOUNT_WHATEVER,
    'big': HEADCOUNT_BIG_ONLY,
    'small': HEADCOUNT_SMALL_ONLY
}

# Databases
ES_INDEX = 'labonneboite'
# Set ES_TIMEOUT environment variable to 0 to remove ES timeouts entirely
ES_TIMEOUT = int(os.environ.get('ES_TIMEOUT', 10)) or None
DB_HOST = 'localhost'
DB_PORT = 3306
DB_NAME = 'labonneboite'
DB_USER = 'labonneboite'
DB_PASSWORD = '<PASSWORD>'
OFFICE_TABLE = 'etablissements'

TILE_SERVER_URL = "http://openmapsurfer.uni-hd.de/tiles/roads/x={x}&y={y}&z={z}"

ROME_NAF_PROBABILITY_CUTOFF = 0.05

FLASK_SECRET_KEY = '<set it>'

# Settings that need to be overwritten
# FIXME there should be a default value for these settings in the code whenever the setting is not defined.
PEAM_CLIENT_ID = '<set it>'
PEAM_CLIENT_SECRET = '<set it>'
PEAM_AUTH_BASE_URL = '<set it>'
PEAM_API_BASE_URL = '<set it>'
PEAM_USERINFO_URL = '<set it>'
MANDRILL_API_KEY = '<set it>'
FORM_EMAIL = '<set it>'

# GA/GO snippets are only useful in production and staging,
# we use dummy values everywhere else
GOOGLE_ANALYTICS_ID = 'UA-00000000-0'
GOOGLE_OPTIMIZE_ID = 'GTM-AAAA00A'
GOOGLE_TAG_MANAGER_ID = 'AAA-AAAAAAA'
ENABLE_ADBLOCK_TRACKING = False
ENABLE_GOOGLE_OPTIMIZE = False

MEMO_JS_URL = 'https://memo.pole-emploi.fr/js/importButton/memoButton-min.js'
API_ADRESSE_BASE_URL = 'https://api-adresse.data.gouv.fr'

# Tilkee parameters: credentials are provided by the Tilkee tech team
TILKEE_ENABLED = False
TILKEE_API_BASE_URL = 'https://api.tilkee.com'
TILKEE_VERIFY_SSL = True
TILKEE_ACCESS_TOKEN = '<set it>'
TILKEE_X_REF = '<set it>'
TILKEE_COMPANY_ID = '<set it>'

if get_current_env() == ENV_LBBDEV:
{'fraction_non_alphanumeric': 0.10662002850110118, 'fraction_numerical': 0.04197434900893898, 'mean_word_length': 5.026541764246682, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 29, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '359186', 'n_tokens_mistral': 3229, 'n_tokens_neox': 2982, 'n_words': 753}