<commit_before>from django.db import models
from django.utils import timezone


class DiscordUser(models.Model):
    user_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255)

    def __str__(self):
        display_name = self.user_id
        if self.name:
            display_name = '{} ({})'.format(self.name, self.user_id)
        return display_name

    class Meta:
        verbose_name = "Discord User"
        verbose_name_plural = "Discord Users"


class Game(models.Model):
    name = models.CharField(max_length=255)
    url = models.URLField(blank=True, null=True, default="")

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

    class Meta:
        verbose_name = "Game"
        verbose_name_plural = "Games"


class GameUser(models.Model):
    user = models.ForeignKey('DiscordUser')
    game = models.ForeignKey('Game')

    def __str__(self):
        return '{} - {}'.format(str(self.user), str(self.game))

    class Meta:
        verbose_name = "Game User"
        verbose_name_plural = "Game Users"


class Server(models.Model):
    server_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255, blank=True, null=True, default="")

    def __str__(self):
        display_name = '{}'.format(self.server_id)
        if self.name:
            display_name = '{} ({})'.format(self.name, self.server_id)
        return display_name

    class Meta:
        verbose_name = "Server"
        verbose_name_plural = "Servers"


class Role(models.Model):
    server = models.ForeignKey('Server')
    role_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255)

    def __str__(self):
        return '{} ({})'.format(self.name, str(self.server))

    class Meta:
        verbose_name = "Role"
        verbose_name_plural = "Roles"


class Channel(models.Model):
    server = models.ForeignKey('Server')
    channel_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255)
    created_date = models.DateTimeField(default=timezone.now)
    expire_date = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return '{} ({})'.format(self.name, self.channel_id)

    def save(self, *args, **kwargs):
        from datetime import timedelta
        if not self.id:
            self.expire_date = timezone.now() + timedelta(minutes=15)
        super(Channel, self).save(*args, **kwargs)

    class Meta:
        verbose_name = "Channel"
        verbose_name_plural = "Channels"


class GameSearch(models.Model):
    user = models.ForeignKey('DiscordUser')
    game = models.ForeignKey('Game')
    # server = models.ForeignKey('Server')
    created_date = models.DateTimeField(default=timezone.now)
    expire_date = models.DateTimeField(default=timezone.now)
    cancelled = models.BooleanField(default=False)
    game_found = models.BooleanField(default=False)

    def __str__(self):
        return '{} - {}'.format(str(self.user), str(self.game))

    def save(self, *args, **kwargs):
        from datetime import timedelta
        if not self.id:
            self.expire_date = timezone.now() + timedelta(minutes=30)
        super(GameSearch, self).save(*args, **kwargs)

    class Meta:
        verbose_name = "Game Search"
        verbose_name_plural = "Game Searches"


class ServerUser(models.Model):
    user = models.ForeignKey('DiscordUser')
    server = models.ForeignKey('Server')

    def __str__(self):
        return '{} - {}'.format(str(self.user), str(self.Server))

    class Meta:
        verbose_name = "Server User"
        verbose_name_plural = "Server Users"<commit_msg>wtf...<commit_after>from django.db import models
from django.utils import timezone


class DiscordUser(models.Model):
    user_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255)

    def __str__(self):
        display_name = self.user_id
        if self.name:
            display_name = '{} ({})'.format(self.name, self.user_id)
        return display_name

    class Meta:
        verbose_name = "Discord User"
        verbose_name_plural = "Discord Users"


class Game(models.Model):
    name = models.CharField(max_length=255)
    url = models.URLField(blank=True, null=True, default="")

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

    class Meta:
        verbose_name = "Game"
        verbose_name_plural = "Games"


class GameUser(models.Model):
    user = models.ForeignKey('DiscordUser')
    game = models.ForeignKey('Game')

    def __str__(self):
        return '{} - {}'.format(str(self.user), str(self.game))

    class Meta:
        verbose_name = "Game User"
        verbose_name_plural = "Game Users"


class Server(models.Model):
    server_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255, blank=True, null=True, default="")

    def __str__(self):
        display_name = '{}'.format(self.server_id)
        if self.name:
            display_name = '{} ({})'.format(self.name, self.server_id)
        return display_name

    class Meta:
        verbose_name = "Server"
        verbose_name_plural = "Servers"


class Role(models.Model):
    server = models.ForeignKey('Server')
    role_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255)

    def __str__(self):
        return '{} ({})'.format(self.name, str(self.server))

    class Meta:
        verbose_name = "Role"
        verbose_name_plural = "Roles"


class Channel(models.Model):
    server = models.ForeignKey('Server')
    channel_id = models.CharField(max_length=255, unique=True)
    name = models.CharField(max_length=255)
    created_date = models.DateTimeField(default=timezone.now)
    expire_date = models.DateTimeField(default=timezone.now)

    def __str__(self):
        return '{} ({})'.format(self.name, self.channel_id)

    def save(self, *args, **kwargs):
        from datetime import timedelta
        if not self.id:
            self.expire_date = timezone.now() + timedelta(minutes=15)
        super(Channel, self).save(*args, **kwargs)

    class Meta:
        verbose_name = "Channel"
        verbose_name_plural = "Channels"


class GameSearch(models.Model):
    user = models.ForeignKey('DiscordUser')
    game = models.ForeignKey('Game')
    # server = models.ForeignKey('Server')
    created_date = models.DateTimeField(default=timezone.now)
    expire_date = models.DateTimeField(default=timezone.now)
    cancelled = models.BooleanField(default=False)
    game_found = models.BooleanField(default=False)

    def __str__(self):
        return '{} - {}'.format(str(self.user), str(self.game))

    def save(self, *args, **kwargs):
        from datetime import timedelta
        if not self.id:
            self.expire_date = timezone.now() + timedelta(minutes=30)
        super(GameSearch, self).save(*args, **kwargs)

    class Meta:
        verbose_name = "Game Search"
        verbose_name_plural = "Game Searches"


class ServerUser(models.Model):
    user = models.ForeignKey('DiscordUser')
    server = models.ForeignKey('Server')

    def __str__(self):
        return '{} - {}'.format(str(self.user), str(self.server))

    class Meta:
        verbose_name = "Server User"
        verbose_name_plural = "Server Users"
{'fraction_non_alphanumeric': 0.12800325777114158, 'fraction_numerical': 0.008415908782408036, 'mean_word_length': 3.143982002249719, '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': '3256598', 'n_tokens_mistral': 2407, 'n_tokens_neox': 2272, 'n_words': 447}