<commit_before>from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible


# @python_2_unicode_compatible
# class Package(models.Model):
#     """Python Package Manager for pip requirements.txt"""
#     display_name = models.CharField(max_length=63)
#     install_name = models.CharField(max_length=63)
#     version = models.FloatField(null=True, blank=True)
#     website = models.URLField()
#     description = models.TextField()

#     class Meta:
#         verbose_name = "pip package"

#     def __str__(self):
#         return str(self.display_name)


# @python_2_unicode_compatible
# class TerminalPrompt(models.Model):
#     """Terminal prompt customization"""
#     display_name = models.CharField(max_length=63)
#     install_name = models.TextField()
#     description = models.TextField()

#     def __str__(self):
#         return str(self.display_name)


@python_2_unicode_compatible
class UserChoice(models.Model):
    description = models.CharField(max_length=63)

    def __str__(self):
        return str(self.description)


@python_2_unicode_compatible
class Step(models.Model):
    STEP_TYPE_CHOICES = (
        ('dl', 'Download'),
        ('pip', 'Install with Pip'),
        ('edprof', 'Edit a profile'),
        ('edfile', 'Edit a file'),
        ('env', 'Set environment variable'),
        ('exec', 'Run a shell command')
        )

    step_type = models.CharField(max_length=63, choices=STEP_TYPE_CHOICES)
    url = models.CharField(max_length=63, blank=True, null=True)
    args = models.CharField(max_length=63, blank=True, null=True)
    dependency = models.CharField(max_length=63, blank=True, null=True)
    user_choice = models.ForeignKey(UserChoice, related_name='step')

    def __str__(self):
        return str(self.step_type) + " " + str(self.args)


@python_2_unicode_compatible
class EnvironmentProfile(models.Model):
    """Unique environment profile created by a user"""
    user = models.ForeignKey(User, related_name='profile')
    description = models.CharField(max_length=63)
    choices = models.ManyToManyField(UserChoice,
                                     related_name='profiles',
                                     blank=True,
                                     null=True)

    def __str__(self):
        return str(self.description)
<commit_msg>added order to choices model for widget<commit_after>from django.db import models
from django.contrib.auth.models import User
from django.utils.encoding import python_2_unicode_compatible


# @python_2_unicode_compatible
# class Package(models.Model):
#     """Python Package Manager for pip requirements.txt"""
#     display_name = models.CharField(max_length=63)
#     install_name = models.CharField(max_length=63)
#     version = models.FloatField(null=True, blank=True)
#     website = models.URLField()
#     description = models.TextField()

#     class Meta:
#         verbose_name = "pip package"

#     def __str__(self):
#         return str(self.display_name)


# @python_2_unicode_compatible
# class TerminalPrompt(models.Model):
#     """Terminal prompt customization"""
#     display_name = models.CharField(max_length=63)
#     install_name = models.TextField()
#     description = models.TextField()

#     def __str__(self):
#         return str(self.display_name)


@python_2_unicode_compatible
class UserChoice(models.Model):
    description = models.CharField(max_length=63)
    display_order = models.IntegerField(default=100)
    
    def __str__(self):
        return str(self.description)


@python_2_unicode_compatible
class Step(models.Model):
    STEP_TYPE_CHOICES = (
        ('dl', 'Download'),
        ('pip', 'Install with Pip'),
        ('edprof', 'Edit a profile'),
        ('edfile', 'Edit a file'),
        ('env', 'Set environment variable'),
        ('exec', 'Run a shell command')
        )

    step_type = models.CharField(max_length=63, choices=STEP_TYPE_CHOICES)
    url = models.CharField(max_length=63, blank=True, null=True)
    args = models.CharField(max_length=63, blank=True, null=True)
    dependency = models.CharField(max_length=63, blank=True, null=True)
    user_choice = models.ForeignKey(UserChoice, related_name='step')

    def __str__(self):
        return str(self.step_type) + " " + str(self.args)


@python_2_unicode_compatible
class EnvironmentProfile(models.Model):
    """Unique environment profile created by a user"""
    user = models.ForeignKey(User, related_name='profile')
    description = models.CharField(max_length=63)
    choices = models.ManyToManyField(UserChoice,
                                     related_name='profiles',
                                     blank=True,
                                     null=True)
    def __str__(self):
        return str(self.description)

{'fraction_non_alphanumeric': 0.11416184971098266, 'fraction_numerical': 0.010528488852188274, 'mean_word_length': 3.257469244288225, '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': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5546821', 'n_tokens_mistral': 1464, 'n_tokens_neox': 1397, 'n_words': 288}