<commit_before># MIT License
# Copyright (c) 2017 MassChallenge, Inc.

from __future__ import unicode_literals

from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible

from accelerator_abstract.managers.profile_manager import ProfileManager
from accelerator_abstract.models.accelerator_model import AcceleratorModel

ENTREPRENEUR_USER_TYPE = 'ENTREPRENEUR'
EXPERT_USER_TYPE = 'EXPERT'
MEMBER_USER_TYPE = 'MEMBER'

USER_TYPES = ((EXPERT_USER_TYPE, 'Expert'),
              (ENTREPRENEUR_USER_TYPE, 'Entrepreneur'),
              (MEMBER_USER_TYPE, 'Member'))

TWITTER_HANDLE_MAX_LENGTH = 16
PHONE_MAX_LENGTH = 20


@python_2_unicode_compatible
class BaseBaseProfile(AcceleratorModel):
    """pivot class that returns an appropriate profile based on user_type

    see: ProfileManager
    """
    objects = ProfileManager()
    manager = models.Manager()
    user = models.OneToOneField(settings.AUTH_USER_MODEL)
    user_type = models.CharField(max_length=16, choices=USER_TYPES)
    privacy_policy_accepted = models.BooleanField(
        default=False,
        blank=False,
        null=False)

    class Meta(AcceleratorModel.Meta):
        db_table = '{}_baseprofile'.format(
            AcceleratorModel.Meta.app_label)
        abstract = True

    def __str__(self):
        fn = self.user.first_name
        ln = self.user.last_name
        if fn and ln:
            identifier = "%s %s" % (fn, ln)
        else:
            identifier = self.user.username
        return "Base Profile for %s" % identifier<commit_msg>attempt to specify user-baseprofile related name<commit_after># MIT License
# Copyright (c) 2017 MassChallenge, Inc.

from __future__ import unicode_literals

from django.conf import settings
from django.db import models
from django.utils.encoding import python_2_unicode_compatible

from accelerator_abstract.managers.profile_manager import ProfileManager
from accelerator_abstract.models.accelerator_model import AcceleratorModel

ENTREPRENEUR_USER_TYPE = 'ENTREPRENEUR'
EXPERT_USER_TYPE = 'EXPERT'
MEMBER_USER_TYPE = 'MEMBER'

USER_TYPES = ((EXPERT_USER_TYPE, 'Expert'),
              (ENTREPRENEUR_USER_TYPE, 'Entrepreneur'),
              (MEMBER_USER_TYPE, 'Member'))

TWITTER_HANDLE_MAX_LENGTH = 16
PHONE_MAX_LENGTH = 20


@python_2_unicode_compatible
class BaseBaseProfile(AcceleratorModel):
    """pivot class that returns an appropriate profile based on user_type

    see: ProfileManager
    """
    objects = ProfileManager()
    manager = models.Manager()
    user = models.OneToOneField(settings.AUTH_USER_MODEL,
                                related_name="baseprofile")
    user_type = models.CharField(max_length=16, choices=USER_TYPES)
    privacy_policy_accepted = models.BooleanField(
        default=False,
        blank=False,
        null=False)

    class Meta(AcceleratorModel.Meta):
        db_table = '{}_baseprofile'.format(
            AcceleratorModel.Meta.app_label)
        abstract = True

    def __str__(self):
        fn = self.user.first_name
        ln = self.user.last_name
        if fn and ln:
            identifier = "%s %s" % (fn, ln)
        else:
            identifier = self.user.username
        return "Base Profile for %s" % identifier
{'fraction_non_alphanumeric': 0.0802073802988716, 'fraction_numerical': 0.007319304666056725, 'mean_word_length': 3.4565217391304346, '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': '363847', 'n_tokens_mistral': 1013, 'n_tokens_neox': 966, 'n_words': 223}