<commit_before>"""The UWUM (Unified WeGovNow User Management) provider."""

from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider


class UWUMAccount(ProviderAccount):
    """The UWUM provider account."""

    pass


class UWUMProvider(OAuth2Provider):
    """The UWUM OAuth2 provider."""

    id = 'uwum'
    name = 'UWUM'
    settings = app_settings.PROVIDERS.get(id, {})
    account_class = UWUMAccount

    def get_default_scope(self):
        """Get the default UWUM scope."""
        return ['authentication', 'notify_email']

    def extract_uid(self, data):
        """Extract the unique user (UWUM member) identification number."""
        member = data.get('member', {})
        return str(member.get('id'))


registry.register(UWUMProvider)<commit_msg>Extract common fields for the user<commit_after>"""The UWUM (Unified WeGovNow User Management) provider."""

from allauth.socialaccount import app_settings
from allauth.socialaccount.providers import registry
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider


class UWUMAccount(ProviderAccount):
    """The UWUM provider account."""

    pass


class UWUMProvider(OAuth2Provider):
    """The UWUM OAuth2 provider."""

    id = 'uwum'
    name = 'UWUM'
    settings = app_settings.PROVIDERS.get(id, {})
    account_class = UWUMAccount

    def get_default_scope(self):
        """Get the default UWUM scope."""
        return ['authentication', 'notify_email']

    def extract_uid(self, data):
        """Extract the unique user (UWUM member) identification number."""
        member = data.get('member', {})
        return str(member.get('id'))

    def extract_common_fields(self, data):
        """Extract the common fields for the user (UWUM member)."""
        member = data.get('member', {})
        return {'username': member.get('name'), 'email': member.get('email')}


registry.register(UWUMProvider)
{'fraction_non_alphanumeric': 0.11772917636109818, 'fraction_numerical': 0.0037226617031177293, 'mean_word_length': 4.046948356807512, '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': '7452451', 'n_tokens_mistral': 638, 'n_tokens_neox': 621, 'n_words': 163}