<commit_before>import base64
import datetime
import logging
import os
import pickle
import re

import braintree
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.utils import BadDsn

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRETS_DIR = os.path.join(BASE_DIR, 'secrets')


def get_secret(filename):
    with open(os.path.join(SECRETS_DIR, filename)) as f:
        return f.read().strip()


DEBUG = False
SECRET_KEY = get_secret('secret_key.txt')

GA_CODE = 'UA-69242364-1'
SEND_GA_EVENTS = True

SCHEME = 'https://'
HOST = 'gchat.simon.codes'
ALLOWED_HOSTS = [HOST]
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

PORT = 8000
WORKER_PORT = 50001
TESTWORKER_PORT = 50002

GOOGLE_OAUTH2_CLIENT_SECRETS_JSON = os.path.join(SECRETS_DIR, 'client_secrets.json')
OAUTH_SCOPE = ' '.join(['https://www.googleapis.com/auth/googletalk', 'profile', 'email'])
OAUTH_REDIRECT_URI = "%s%s/%s" % (SCHEME, HOST, 'autorespond/oauth2callback/')

# This is a CredentialsField, not a GoogleCredentials.
try:
    TEST_CREDENTIALS = pickle.loads(base64.b64decode(get_secret('test_account.credentialrow')))
except:
    logging.warning("test worker credentials unavailable", exc_info=True)
    TEST_CREDENTIALS = None


LOGIN_URL = '/'

try:
    with open(os.path.join(BASE_DIR, 'release.sha')) as f:
        RELEASE = f.read().strip()
except:
    RELEASE = str(datetime.datetime.now())

# Security
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
X_FRAME_OPTIONS = 'DENY'

# Braintree
BRAINTREE_MERCHANT_ID = get_secret('bt_prod.merchant_id')
BRAINTREE_PUBLIC_KEY = get_secret('bt_prod.public_key')
BRAINTREE_PRIVATE_KEY = get_secret('bt_prod.private_key')
braintree.Configuration.configure(braintree.Environment.Production,
                                  merchant_id=BRAINTREE_MERCHANT_ID,
                                  public_key=BRAINTREE_PUBLIC_KEY,
                                  private_key=BRAINTREE_PRIVATE_KEY)
PRICE_REPR = '$2'
PLAN_ID = 'monthly_v0'

<commit_msg>reflect price<commit_after>import base64
import datetime
import logging
import os
import pickle
import re

import braintree
import sentry_sdk
from sentry_sdk.integrations.django import DjangoIntegration
from sentry_sdk.integrations.logging import LoggingIntegration
from sentry_sdk.integrations.flask import FlaskIntegration
from sentry_sdk.utils import BadDsn

BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRETS_DIR = os.path.join(BASE_DIR, 'secrets')


def get_secret(filename):
    with open(os.path.join(SECRETS_DIR, filename)) as f:
        return f.read().strip()


DEBUG = False
SECRET_KEY = get_secret('secret_key.txt')

GA_CODE = 'UA-69242364-1'
SEND_GA_EVENTS = True

SCHEME = 'https://'
HOST = 'gchat.simon.codes'
ALLOWED_HOSTS = [HOST]
USE_X_FORWARDED_HOST = True
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')

PORT = 8000
WORKER_PORT = 50001
TESTWORKER_PORT = 50002

GOOGLE_OAUTH2_CLIENT_SECRETS_JSON = os.path.join(SECRETS_DIR, 'client_secrets.json')
OAUTH_SCOPE = ' '.join(['https://www.googleapis.com/auth/googletalk', 'profile', 'email'])
OAUTH_REDIRECT_URI = "%s%s/%s" % (SCHEME, HOST, 'autorespond/oauth2callback/')

# This is a CredentialsField, not a GoogleCredentials.
try:
    TEST_CREDENTIALS = pickle.loads(base64.b64decode(get_secret('test_account.credentialrow')))
except:
    logging.warning("test worker credentials unavailable", exc_info=True)
    TEST_CREDENTIALS = None


LOGIN_URL = '/'

try:
    with open(os.path.join(BASE_DIR, 'release.sha')) as f:
        RELEASE = f.read().strip()
except:
    RELEASE = str(datetime.datetime.now())

# Security
SECURE_CONTENT_TYPE_NOSNIFF = True
SECURE_BROWSER_XSS_FILTER = True
SESSION_COOKIE_SECURE = True
CSRF_COOKIE_SECURE = True
CSRF_COOKIE_HTTPONLY = True
X_FRAME_OPTIONS = 'DENY'

# Braintree
BRAINTREE_MERCHANT_ID = get_secret('bt_prod.merchant_id')
BRAINTREE_PUBLIC_KEY = get_secret('bt_prod.public_key')
BRAINTREE_PRIVATE_KEY = get_secret('bt_prod.private_key')
braintree.Configuration.configure(braintree.Environment.Production,
                                  merchant_id=BRAINTREE_MERCHANT_ID,
                                  public_key=BRAINTREE_PUBLIC_KEY,
                                  private_key=BRAINTREE_PRIVATE_KEY)
PRICE_REPR = '$0'
PLAN_ID = 'monthly_v0'


{'fraction_non_alphanumeric': 0.1033434650455927, 'fraction_numerical': 0.014329135909683021, 'mean_word_length': 4.773182957393484, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1853071', 'n_tokens_mistral': 1734, 'n_tokens_neox': 1658, 'n_words': 283}