<commit_before>"""Creating Models for user profile."""
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.db.models.signals import post_save
from django.dispatch import receiver
import uuid<commit_msg>created user association class and profile<commit_after>"""Creating Models for user profile."""
from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible
from django.db.models.signals import post_save
from django.dispatch import receiver
import uuid


class ActiveUserManager(models.Manager):
    """Query UserProfile of active user."""

    def get_querysets(self):
        """Return query set of profiles for active users."""
        query = super(ActiveUserManager, self).get_querysets()
        return query.filter(user__is_active__exact=True)


class UserProfile(models.Model):
    """Creating profile linked to user."""

    user = models.OneToOneField( # Association user class and profile class
        User,
        related_name="profile",
        on_delete=models.CASCADE
    )


    imager_id = models.UUIDField(default=uuid.uuid4, editable=False)
    active = ActiveUserManager()
    objects = models.Manager()
{'fraction_non_alphanumeric': 0.08487654320987655, 'fraction_numerical': 0.0023148148148148147, 'mean_word_length': 4.542735042735043, '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': '3503786', 'n_tokens_mistral': 345, 'n_tokens_neox': 334, 'n_words': 105}