<commit_before>from django.conf import settings


def is_user_privileged(user):
    return not (user.is_patient or user.is_parent or user.is_carrier)


def can_user_self_unlock(user):
    return (
        getattr(settings, 'ACCOUNT_SELF_UNLOCK_ENABLED', False) and not
        is_user_privileged(user) and not user.is_curator and not user.prevent_self_unlock)<commit_msg>rdrf #1327 unwanted code removed from can_user_self_unlock<commit_after>from django.conf import settings


def is_user_privileged(user):
    return not (user.is_patient or user.is_parent or user.is_carrier)


def can_user_self_unlock(user):
    return (
        getattr(settings, 'ACCOUNT_SELF_UNLOCK_ENABLED', False) and not
        is_user_privileged(user) and not user.prevent_self_unlock)
{'fraction_non_alphanumeric': 0.07077326343381389, 'fraction_numerical': 0.005242463958060288, 'mean_word_length': 5.015748031496063, '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': '4120753', 'n_tokens_mistral': 258, 'n_tokens_neox': 251, 'n_words': 58}