<commit_before>from datetime import timedelta
from datetime import datetime
from django.db import models
from django.conf import settings


def week_range(date=None):
    """
    Gently get from
    https://bradmontgomery.net/blog/2013/03/07/calculate-week-range-date/
    """
    if not date:
        date = datetime.now()

    year, week, dow = date.isocalendar()
    if dow == 7:
        start_date = date
    else:
        start_date = date - timedelta(dow)
    end_date = start_date + timedelta(6)
    return (start_date, end_date)


class Customer(models.Model):
    user = models.OneToOneField(
        settings.AUTH_USER_MODEL,
        primary_key=True
    )

    hearts = models.PositiveIntegerField(
        default=0
    )

    weekly_hearts = models.PositiveSmallIntegerField(
        default=15
    )

    class Meta:
        verbose_name = "Customer"
        verbose_name_plural = "Customers"

    def __str__(self):
        return '{}'.format(self.user.username)


class Transaction(models.Model):

    receiver = models.ForeignKey(
        Customer,
        related_name='received'
    )

    giver = models.ForeignKey(
        Customer,
        related_name='given'
    )

    qtty = models.PositiveSmallIntegerField(
        default=1
    )

    transaction_time = models.DateTimeField(
        auto_now_add=True
    )

    comment = models.CharField(
        max_length=140,
    )
<commit_msg>return user full name for customers model<commit_after>from datetime import timedelta
from datetime import datetime
from django.db import models
from django.conf import settings


def week_range(date=None):
    """
    Gently get from
    https://bradmontgomery.net/blog/2013/03/07/calculate-week-range-date/
    """
    if not date:
        date = datetime.now()

    year, week, dow = date.isocalendar()
    if dow == 7:
        start_date = date
    else:
        start_date = date - timedelta(dow)
    end_date = start_date + timedelta(6)
    return (start_date, end_date)


class Customer(models.Model):
    user = models.OneToOneField(
        settings.AUTH_USER_MODEL,
        primary_key=True
    )

    hearts = models.PositiveIntegerField(
        default=0
    )

    weekly_hearts = models.PositiveSmallIntegerField(
        default=15
    )

    class Meta:
        verbose_name = "Customer"
        verbose_name_plural = "Customers"

    def __str__(self):
        if self.user.get_full_name():
            name = self.user.get_full_name()
        else:
            name = self.user.username
        return '{}'.format(name)


class Transaction(models.Model):

    receiver = models.ForeignKey(
        Customer,
        related_name='received'
    )

    giver = models.ForeignKey(
        Customer,
        related_name='given'
    )

    qtty = models.PositiveSmallIntegerField(
        default=1
    )

    transaction_time = models.DateTimeField(
        auto_now_add=True
    )

    comment = models.CharField(
        max_length=140,
    )

{'fraction_non_alphanumeric': 0.09216279852001345, 'fraction_numerical': 0.011436259670366633, 'mean_word_length': 2.3795454545454544, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '1722373', 'n_tokens_mistral': 951, 'n_tokens_neox': 892, 'n_words': 187}