<commit_before>from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import Permission, User


class UserProfile(models.Model):
    user = models.OneToOneField(User)
    profile_picture = models.ImageField(upload_to='profile_images', blank=True, null=True, default="profile_images/default.jpg")
    website = models.URLField(blank=True)
    about = models.TextField(blank=True)
    def __unicode__(self):
        return self.user.username


class Question(models.Model):
    domain = models.CharField(max_length=30,blank=False)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    title = models.CharField(max_length=300,blank=False)
    text = models.CharField(max_length=1000,blank=True)
    views = models.IntegerField(default=0)
    rating  =
    def __unicode__(self):
        return self.title


class Answer(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    text = models.CharField(max_length=5000,blank=False)

    def __unicode__(self):
        return self.text+" ->"+self.user.username

class Vote(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
    question_vote = models.IntegerField(default=0)
    answer_vote = models.IntegerField(default=0)

    def __unicode__(self):
        return  self.user.username + " q_vote:"+str(self.question_vote) +  " a_vote:"+str(self.answer_vote)<commit_msg>bug fix<commit_after>from __future__ import unicode_literals
from django.db import models
from django.contrib.auth.models import Permission, User


class UserProfile(models.Model):
    user = models.OneToOneField(User)
    profile_picture = models.ImageField(upload_to='profile_images', blank=True, null=True, default="profile_images/default.jpg")
    website = models.URLField(blank=True)
    about = models.TextField(blank=True)
    def __unicode__(self):
        return self.user.username


class Question(models.Model):
    domain = models.CharField(max_length=30,blank=False)
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    title = models.CharField(max_length=300,blank=False)
    text = models.CharField(max_length=1000,blank=True)
    views = models.IntegerField(default=0)
    def __unicode__(self):
        return self.title


class Answer(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    text = models.CharField(max_length=5000,blank=False)

    def __unicode__(self):
        return self.text+" ->"+self.user.username

class Vote(models.Model):
    user = models.ForeignKey(User, on_delete=models.CASCADE)
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    answer = models.ForeignKey(Answer, on_delete=models.CASCADE)
    question_vote = models.IntegerField(default=0)
    answer_vote = models.IntegerField(default=0)

    def __unicode__(self):
        return  self.user.username + " q_vote:"+str(self.question_vote) +  " a_vote:"+str(self.answer_vote)
{'fraction_non_alphanumeric': 0.11314321140731556, 'fraction_numerical': 0.009919404835709857, 'mean_word_length': 4.793536804308797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '195652', 'n_tokens_mistral': 1051, 'n_tokens_neox': 993, 'n_words': 167}