<commit_before># -*- coding: utf-8 -*-

from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext

from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
from django.contrib.auth.models import UserManager

from greenmine.core.utils.slug import slugify_uniquely, ref_uniquely
from greenmine.core.fields import DictField, ListField
from greenmine.wiki.fields import WikiField
from greenmine.core.utils import iter_points
import reversion

from .choices import *

import datetime
import re

US_STATUS_HAVE_TASK_STATUS = {
        'open': ['open'],
        'progress': ['progress', 'needinfo', 'posponed'],
        'completed': ['completed', 'workaround'],
        'closed': ['closed'],
}

class ProjectManager(models.Manager):
    def get_by_natural_key(self, slug):
        return self.get(slug=slug)

    def can_view(self, user):
        queryset = ProjectUserRole.objects.filter(user=user)\
            .values_list('project', flat=True)
        return Project.objects.filter(pk__in=queryset)


class ProjectExtras(models.Model):
    task_parser_re = models.CharField(max_length=1000, blank=True, null=True, default=None)<commit_msg>Adding removed import from previous merge<commit_after># -*- coding: utf-8 -*-

from django.conf import settings
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ugettext

from django.utils import timezone
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes import generic
from django.contrib.auth.models import User
from django.contrib.auth.models import UserManager

from greenmine.core.utils.slug import slugify_uniquely, ref_uniquely
from greenmine.core.fields import DictField, ListField
from greenmine.wiki.fields import WikiField
from greenmine.core.utils import iter_points
from greenmine.taggit.managers import TaggableManager
import reversion

from .choices import *

import datetime
import re

US_STATUS_HAVE_TASK_STATUS = {
        'open': ['open'],
        'progress': ['progress', 'needinfo', 'posponed'],
        'completed': ['completed', 'workaround'],
        'closed': ['closed'],
}

class ProjectManager(models.Manager):
    def get_by_natural_key(self, slug):
        return self.get(slug=slug)

    def can_view(self, user):
        queryset = ProjectUserRole.objects.filter(user=user)\
            .values_list('project', flat=True)
        return Project.objects.filter(pk__in=queryset)


class ProjectExtras(models.Model):
    task_parser_re = models.CharField(max_length=1000, blank=True, null=True, default=None)
{'fraction_non_alphanumeric': 0.09780297661233169, 'fraction_numerical': 0.003543586109142452, 'mean_word_length': 4.668674698795181, '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': '3602083', 'n_tokens_mistral': 824, 'n_tokens_neox': 805, 'n_words': 212}