<commit_before>
from django.contrib.auth.models import User, Permission, Group
from django.db import models
from django.db.models import Q

from extensions.models import ExtensionVersion, STATUSES

def get_all_reviewers():
    perm = Permission.objects.get(codename="can-review-extensions")

    # Dark magic to get all the users with a specific permission
    # Thanks to <schinckel> in #django
    groups = Group.objects.filter(permissions=perm)
    return User.objects.filter(Q(is_superuser=True)|Q(user_permissions=perm)|Q(groups__in=groups)).distinct()

class CodeReview(models.Model):
    reviewer = models.ForeignKey(User)
    date = models.DateTimeField(auto_now_add=True)
    comments = models.TextField(blank=True)
    version = models.ForeignKey(ExtensionVersion, related_name="reviews")
    new_status = models.PositiveIntegerField(choices=STATUSES.items(), null=True)
    auto = models.BooleanField(default=False)

    class Meta:
        permissions = (
            ("can-review-extensions", "Can review extensions"),
            ("trusted", "Has his extensions auto-approved"),
        )<commit_msg>models: Rename the trusted permission<commit_after>
from django.contrib.auth.models import User, Permission, Group
from django.db import models
from django.db.models import Q

from extensions.models import ExtensionVersion, STATUSES

def get_all_reviewers():
    perm = Permission.objects.get(codename="can-review-extensions")

    # Dark magic to get all the users with a specific permission
    # Thanks to <schinckel> in #django
    groups = Group.objects.filter(permissions=perm)
    return User.objects.filter(Q(is_superuser=True)|Q(user_permissions=perm)|Q(groups__in=groups)).distinct()

class CodeReview(models.Model):
    reviewer = models.ForeignKey(User)
    date = models.DateTimeField(auto_now_add=True)
    comments = models.TextField(blank=True)
    version = models.ForeignKey(ExtensionVersion, related_name="reviews")
    new_status = models.PositiveIntegerField(choices=STATUSES.items(), null=True)
    auto = models.BooleanField(default=False)

    class Meta:
        permissions = (
            ("can-review-extensions", "Can review extensions"),
            ("trusted", "Trusted author"),
        )
{'fraction_non_alphanumeric': 0.10653536257833482, 'fraction_numerical': 0.0, 'mean_word_length': 4.451219512195122, 'pattern_counts': {'":': 0, '<': 5, '<?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': '7458459', 'n_tokens_mistral': 637, 'n_tokens_neox': 624, 'n_words': 146}