<commit_before>import os

from django.contrib.auth.middleware import RemoteUserMiddleware

class EnvRemoteUserMiddleware(RemoteUserMiddleware):
    header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')<commit_msg>sentry: Configure user's e-mail via REMOTE_USER_EMAIL_SUFFIX<commit_after>import os

from django.contrib.auth.middleware import RemoteUserMiddleware

class EnvRemoteUserMiddleware(RemoteUserMiddleware):
    header = os.environ.get('REMOTE_USER_HEADER', 'REMOTE_USER')

    def configure_user(user):
        if 'REMOTE_USER_EMAIL_SUFFIX' in os.environ:
            user.email = "{0}{1}".format(user.username, os.environ['REMOTE_USER_EMAIL_SUFFIX'])
            user.save()
        return user
{'fraction_non_alphanumeric': 0.0970464135021097, 'fraction_numerical': 0.0028129395218002813, 'mean_word_length': 5.191304347826087, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5990639', 'n_tokens_mistral': 232, 'n_tokens_neox': 225, 'n_words': 38}