<commit_before>from django.conf import settings

_enabled = settings.AUTH_ENABLED_SYSTEMS or None
def _is_enabled(system):
    return _enabled is None or system in _enabled

AUTH_SYSTEMS = {}

if _is_enabled('twitter'):
    from . import twitter
    AUTH_SYSTEMS['twitter'] = twitter

if _is_enabled('linkedin'):
    from . import linkedin
    AUTH_SYSTEMS['linkedin'] = linkedin

if _is_enabled('password'):
    from . import password
    AUTH_SYSTEMS['password'] = password

if _is_enabled('cas'):
    from . import cas
    AUTH_SYSTEMS['cas'] = cas

if _is_enabled('facebook'):
    from . import facebook
    AUTH_SYSTEMS['facebook'] = facebook

if _is_enabled('google'):
    from . import google
    AUTH_SYSTEMS['google'] = google

if _is_enabled('yahoo'):
    from . import yahoo
    AUTH_SYSTEMS['yahoo'] = yahoo

if _is_enabled('clever'):
    from . import clever
    AUTH_SYSTEMS['clever'] = clever

# not ready
#import live
#AUTH_SYSTEMS['live'] = live

def can_check_constraint(auth_system):
    return auth_system in AUTH_SYSTEMS and hasattr(AUTH_SYSTEMS[auth_system], 'check_constraint')

def can_list_categories(auth_system):
    return auth_system in AUTH_SYSTEMS and hasattr(AUTH_SYSTEMS[auth_system], 'list_categories')<commit_msg>auth systems should always be present, even if not enabled, otherwise emails can fail<commit_after>from django.conf import settings
from . import password, twitter, linkedin, cas, facebook, google, yahoo, clever

AUTH_SYSTEMS = {}

AUTH_SYSTEMS['password'] = password
AUTH_SYSTEMS['twitter'] = twitter
AUTH_SYSTEMS['linkedin'] = linkedin
AUTH_SYSTEMS['cas'] = cas
AUTH_SYSTEMS['facebook'] = facebook
AUTH_SYSTEMS['google'] = google
AUTH_SYSTEMS['yahoo'] = yahoo
AUTH_SYSTEMS['clever'] = clever

# not ready
#import live
#AUTH_SYSTEMS['live'] = live

def can_check_constraint(auth_system):
    return auth_system in AUTH_SYSTEMS and hasattr(AUTH_SYSTEMS[auth_system], 'check_constraint')

def can_list_categories(auth_system):
    return auth_system in AUTH_SYSTEMS and hasattr(AUTH_SYSTEMS[auth_system], 'list_categories')
{'fraction_non_alphanumeric': 0.10289855072463767, 'fraction_numerical': 0.0, 'mean_word_length': 5.595541401273885, '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': '2998467', 'n_tokens_mistral': 703, 'n_tokens_neox': 635, 'n_words': 166}