<commit_before>from django.contrib.auth.models import AbstractBaseUser
from django.db import models


class Relationship(models.Model):
    from_user = models.ForeignKey("User")
    to_user = models.ForeignKey("User")
    is_block = models.BooleanField(default=False)


class User(AbstractBaseUser):
    name = models.CharField(max_length=255)
    email = models.EmailField(max_length=255)
    about = models.TextField()
    subscribers = models.ManyToManyField(
        "self", through="Relationship", symmetrical=False,
        related_name="subscribed")
    join_date = models.DateTimeField(auto_now_add=True, editable=False)

    # AbstractBaseUser username field definition
    USERNAME_FIELD = 'email'

    def get_full_name(self):
        return self.name

    def get_short_name(self):
        return self.name

    def subscribe(self, subscriber):
        """Add a subscriber to this user."""
        r = Relationship(from_user=subscriber, to_user=self)
        r.save()

    def unsubscribe(self, subscriber):
        sub = self.subscribers.objects.get(from_user=subscriber)
        if sub:
            sub.delete()
            return True
        else:
            return False


class Post(models.Model):
    user = models.ForeignKey("User")
    text = models.TextField()
    post_date = models.DateTimeField()<commit_msg>Flip the subscriber relationship.<commit_after>from django.contrib.auth.models import AbstractBaseUser
from django.db import models


class Relationship(models.Model):
    from_user = models.ForeignKey("User")
    to_user = models.ForeignKey("User")
    is_block = models.BooleanField(default=False)


class User(AbstractBaseUser):
    name = models.CharField(max_length=255)
    email = models.EmailField(max_length=255)
    about = models.TextField()
    subscribees = models.ManyToManyField(
        "self", through="Relationship", symmetrical=False,
        related_name="subscribed")
    join_date = models.DateTimeField(auto_now_add=True, editable=False)

    # AbstractBaseUser username field definition
    USERNAME_FIELD = 'email'

    def get_full_name(self):
        return self.name

    def get_short_name(self):
        return self.name

    def subscribe(self, subscribee):
        r = Relationship(from_user=self, to_user=subscribee)
        r.save()

    def unsubscribe(self, subscribee):
        sub = self.subscribees.objects.get(to_user=subscribee)
        if sub:
            sub.delete()
            return True
        else:
            return False


class Post(models.Model):
    user = models.ForeignKey("User")
    text = models.TextField()
    post_date = models.DateTimeField()
{'fraction_non_alphanumeric': 0.09920484664899659, 'fraction_numerical': 0.004543733434305188, 'mean_word_length': 3.261290322580645, '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': '3703535', 'n_tokens_mistral': 786, 'n_tokens_neox': 746, 'n_words': 158}