<commit_before>from .base_settings import *
from google.oauth2 import service_account
import os

INSTALLED_APPS += [
    'sis_provisioner.apps.BridgeProvisionerConfig',
]
RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT = 300
if os.getenv('BRIDGE_ENV') in RESTCLIENTS_DEFAULT_ENVS:
    RESTCLIENTS_BRIDGE_DAO_CLASS = 'Live'
    RESTCLIENTS_BRIDGE_TIMEOUT = os.getenv(
        'BRIDGE_TIMEOUT', RESTCLIENTS_DEFAULT_TIMEOUT)
    RESTCLIENTS_BRIDGE_POOL_SIZE = os.getenv(
        'BRIDGE_POOL_SIZE', RESTCLIENTS_DEFAULT_POOL_SIZE)
    RESTCLIENTS_BRIDGE_BASIC_AUTH_KEY = os.getenv('BRIDGE_BASIC_AUTH_KEY', '')
    RESTCLIENTS_BRIDGE_BASIC_AUTH_SECRET = os.getenv('BRIDGE_BASIC_AUTH_SECRET', '')
    if os.getenv('BRIDGE_ENV') == 'PROD':
        RESTCLIENTS_BRIDGE_HOST = 'https://uw.bridgeapp.com:443'
    else:
        RESTCLIENTS_BRIDGE_HOST = 'https://uwtest.bridgeapp.com:443'

if os.getenv('ENV', 'localdev') == 'localdev':
    DEBUG = True
    BRIDGE_AUTHOR_GROUP_NAME = 'u_bridgeap_authors'
    BRIDGE_IMPORT_USER_FILE_SIZE = 3
    BRIDGE_LOGIN_WINDOW = 0
    ERRORS_TO_ABORT_LOADER = []
    RESTCLIENTS_DAO_CACHE_CLASS = None
    DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
    MEDIA_ROOT = os.getenv('IMPORT_CSV_ROOT', '/data')
else:
    BRIDGE_IMPORT_USER_FILE_SIZE = 20000
    BRIDGE_USER_WORK_POSITIONS = 2
    BRIDGE_AUTHOR_GROUP_NAME = os.getenv('AUTHOR_GROUP')
    BRIDGE_CHECK_ALL_ACCOUNTS = os.getenv('CHECK_ALL_ACCOUNTS')
    BRIDGE_LOGIN_WINDOW = os.getenv('LOGIN_WINDOW', 1)
    BRIDGE_GMEMBER_ADD_WINDOW = os.getenv('GMEMBER_ADD_WINDOW')
    BRIDGE_GMEMBER_DEL_WINDOW = os.getenv('GMEMBER_DEL_WINDOW')
    BRIDGE_PERSON_CHANGE_WINDOW = os.getenv('PERSON_CHANGE_WINDOW')
    BRIDGE_WORKER_CHANGE_WINDOW = os.getenv('WORKER_CHANGE_WINDOW')
    BRIDGE_CRON_SENDER = os.getenv('BRIDGE_CRON_SENDER', '')
    RESTCLIENTS_DISABLE_THREADING = True
    ERRORS_TO_ABORT_LOADER = [401, 403, 500, 502, 503]
    RESTCLIENTS_DAO_CACHE_CLASS = 'sis_provisioner.cache.BridgeAccountCache'
    DEFAULT_FILE_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage'
    GS_PROJECT_ID = os.getenv('STORAGE_PROJECT_ID', '')
    GS_BUCKET_NAME = os.getenv('STORAGE_BUCKET_NAME', '')
    GS_LOCATION = os.path.join(os.getenv('IMPORT_CSV_ROOT', ''))
    GS_CREDENTIALS = service_account.Credentials.from_service_account_file(
        '/gcs/credentials.json')

CACHES = {
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': '/data/cache',
        'OPTIONS': {
            'MAX_ENTRIES': 650000 if os.getenv('ENV', '') == 'prod' else 200000
        }
    }
}

LOGGING['formatters'] = {
    'std': {
        'format': '%(name)s %(levelname)-4s %(asctime)s %(message)s',
    },
}
LOGGING['handlers']['stdout']['formatter'] = 'std'
LOGGING['handlers']['stderr']['formatter'] = 'std'<commit_msg>remove FileBasedCache<commit_after>from .base_settings import *
from google.oauth2 import service_account
import os

INSTALLED_APPS += [
    'sis_provisioner.apps.BridgeProvisionerConfig',
]
RESTCLIENTS_DEFAULT_CONNECT_TIMEOUT = 300
if os.getenv('BRIDGE_ENV') in RESTCLIENTS_DEFAULT_ENVS:
    RESTCLIENTS_BRIDGE_DAO_CLASS = 'Live'
    RESTCLIENTS_BRIDGE_TIMEOUT = os.getenv(
        'BRIDGE_TIMEOUT', RESTCLIENTS_DEFAULT_TIMEOUT)
    RESTCLIENTS_BRIDGE_POOL_SIZE = os.getenv(
        'BRIDGE_POOL_SIZE', RESTCLIENTS_DEFAULT_POOL_SIZE)
    RESTCLIENTS_BRIDGE_BASIC_AUTH_KEY = os.getenv('BRIDGE_BASIC_AUTH_KEY', '')
    RESTCLIENTS_BRIDGE_BASIC_AUTH_SECRET = os.getenv('BRIDGE_BASIC_AUTH_SECRET', '')
    if os.getenv('BRIDGE_ENV') == 'PROD':
        RESTCLIENTS_BRIDGE_HOST = 'https://uw.bridgeapp.com:443'
    else:
        RESTCLIENTS_BRIDGE_HOST = 'https://uwtest.bridgeapp.com:443'

if os.getenv('ENV', 'localdev') == 'localdev':
    DEBUG = True
    BRIDGE_AUTHOR_GROUP_NAME = 'u_bridgeap_authors'
    BRIDGE_IMPORT_USER_FILE_SIZE = 3
    BRIDGE_LOGIN_WINDOW = 0
    ERRORS_TO_ABORT_LOADER = []
    RESTCLIENTS_DAO_CACHE_CLASS = None
    DEFAULT_FILE_STORAGE = 'django.core.files.storage.FileSystemStorage'
    MEDIA_ROOT = os.getenv('IMPORT_CSV_ROOT', '/data')
else:
    BRIDGE_IMPORT_USER_FILE_SIZE = 20000
    BRIDGE_USER_WORK_POSITIONS = 2
    BRIDGE_AUTHOR_GROUP_NAME = os.getenv('AUTHOR_GROUP')
    BRIDGE_CHECK_ALL_ACCOUNTS = os.getenv('CHECK_ALL_ACCOUNTS')
    BRIDGE_LOGIN_WINDOW = os.getenv('LOGIN_WINDOW', 1)
    BRIDGE_GMEMBER_ADD_WINDOW = os.getenv('GMEMBER_ADD_WINDOW')
    BRIDGE_GMEMBER_DEL_WINDOW = os.getenv('GMEMBER_DEL_WINDOW')
    BRIDGE_PERSON_CHANGE_WINDOW = os.getenv('PERSON_CHANGE_WINDOW')
    BRIDGE_WORKER_CHANGE_WINDOW = os.getenv('WORKER_CHANGE_WINDOW')
    BRIDGE_CRON_SENDER = os.getenv('BRIDGE_CRON_SENDER', '')
    RESTCLIENTS_DISABLE_THREADING = True
    ERRORS_TO_ABORT_LOADER = [401, 403, 500, 502, 503]

    DEFAULT_FILE_STORAGE = 'storages.backends.gcloud.GoogleCloudStorage'
    GS_PROJECT_ID = os.getenv('STORAGE_PROJECT_ID', '')
    GS_BUCKET_NAME = os.getenv('STORAGE_BUCKET_NAME', '')
    GS_LOCATION = os.path.join(os.getenv('IMPORT_CSV_ROOT', ''))
    GS_CREDENTIALS = service_account.Credentials.from_service_account_file(
        '/gcs/credentials.json')
if os.getenv("ENV", '') == "localdev":
        DEBUG = True
        MEMCACHED_SERVERS = ['localhost:11211']
    else:
        RESTCLIENTS_DAO_CACHE_CLASS = 'sis_provisioner.cache.BridgeAccountCache'

LOGGING['formatters'] = {
    'std': {
        'format': '%(name)s %(levelname)-4s %(asctime)s %(message)s',
    },
}
LOGGING['handlers']['stdout']['formatter'] = 'std'
LOGGING['handlers']['stderr']['formatter'] = 'std'
{'fraction_non_alphanumeric': 0.12083183936894945, 'fraction_numerical': 0.01559698816780208, 'mean_word_length': 4.9099576271186445, 'pattern_counts': {'":': 1, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '2531789', 'n_tokens_mistral': 2286, 'n_tokens_neox': 2211, 'n_words': 248}