<commit_before># Django settings for ocradmin project.


import os
import sys
import socket

# Ensure celery/lazy loading Django models play nice 
import djcelery
djcelery.setup_loader()

SITE_ROOT = os.path.abspath(os.path.dirname(__file__))

# flag whether we're on a server.  Really need a better way of doing this.
# ocr1 is the db master
SERVER = False
MASTERNAME = "ocr1"
if SITE_ROOT.find("/dev/") == -1:
    # WSGI can't print to stdout, so map
    # it to stderr
    sys.stdout = sys.stderr
    SERVER = True


# don't run in debug mode on the servers
DEBUG = TEMPLATE_DEBUG = not SERVER

ADMINS = (
    ('<NAME>', '<EMAIL>'),
)

MANAGERS = ADMINS

#DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
#DATABASE_NAME = "%s/admindb" % SITE_ROOT    # Or path to database file if using sqlite3.
#DATABASE_USER = ''                          # Not used with sqlite3.
#DATABASE_PASSWORD = ''         # Not used with sqlite3.
#DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
#DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

DATABASE_HOST = "localhost" if not SERVER else MASTERNAME
DATABASE_NAME = "ocr_testing" if not DEBUG else "ocr_production"
DATABASE_USER = "ocr_testing" if not DEBUG else "ocr_production"
DATABASES = {
    'default' : {
        'ENGINE'    : 'django.db.backends.mysql',
        'NAME'      : DATABASE_NAME,
        'USER'      : DATABASE_USER,
        'PASSWORD'  : '<PASSWORD>',
        'HOST'      : DATABASE_HOST,
    },
}

# celery settings - not sure this'll work...
# mysql
CELERY_RESULT_BACKEND = "database"
CELERY_RESULT_DBURI = "mysql://celery:celery@localhost/celeryresults"
BROKER_HOST = "localhost" if not SERVER else MASTERNAME
BROKER_PORT = 5672
BROKER_VHOST = "/"
BROKER_USER = "guest"<commit_msg>Arrgh with the typos.  Really need more coffee.<commit_after># Django settings for ocradmin project.


import os
import sys
import socket

# Ensure celery/lazy loading Django models play nice 
import djcelery
djcelery.setup_loader()

SITE_ROOT = os.path.abspath(os.path.dirname(__file__))

# flag whether we're on a server.  Really need a better way of doing this.
# ocr1 is the db master
SERVER = False
MASTERNAME = "ocr1"
if SITE_ROOT.find("/dev/") == -1:
    # WSGI can't print to stdout, so map
    # it to stderr
    sys.stdout = sys.stderr
    SERVER = True


# don't run in debug mode on the servers
DEBUG = TEMPLATE_DEBUG = not SERVER

ADMINS = (
    ('<NAME>', '<EMAIL>'),
)

MANAGERS = ADMINS

#DATABASE_ENGINE = 'sqlite3'           # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'.
#DATABASE_NAME = "%s/admindb" % SITE_ROOT    # Or path to database file if using sqlite3.
#DATABASE_USER = ''                          # Not used with sqlite3.
#DATABASE_PASSWORD = ''         # Not used with sqlite3.
#DATABASE_HOST = ''             # Set to empty string for localhost. Not used with sqlite3.
#DATABASE_PORT = ''             # Set to empty string for default. Not used with sqlite3.

DATABASE_HOST = "localhost" if not SERVER else MASTERNAME
DATABASE_NAME = "ocr_testing" if DEBUG else "ocr_production"
DATABASE_USER = "ocr_testing" if DEBUG else "ocr_production"
DATABASES = {
    'default' : {
        'ENGINE'    : 'django.db.backends.mysql',
        'NAME'      : DATABASE_NAME,
        'USER'      : DATABASE_USER,
        'PASSWORD'  : '<PASSWORD>',
        'HOST'      : DATABASE_HOST,
    },
}

# celery settings - not sure this'll work...
# mysql
CELERY_RESULT_BACKEND = "database"
CELERY_RESULT_DBURI = "mysql://celery:celery@localhost/celeryresults"
BROKER_HOST = "localhost" if not SERVER else MASTERNAME
BROKER_PORT = 5672
BROKER_VHOST = "/"
BROKER_USER = "guest"
{'fraction_non_alphanumeric': 0.10723718964606445, 'fraction_numerical': 0.00792393026941363, 'mean_word_length': 3.1478641840087622, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '593536', 'n_tokens_mistral': 1350, 'n_tokens_neox': 1291, 'n_words': 380}