<commit_before>import re
from django.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError

from period import Period
from node import Node
from abstract_is_admin import AbstractIsAdmin



class RelatedUserBase(models.Model, AbstractIsAdmin):
    """
    Base class for :cls:`RelatedExaminer` and cls:`RelatedStudent`.

    This is used to generate AssignmentGroups and

    .. attribute:: userspec

        One or more usernames followed by optional tags. Format: usernameA, ...., usernameN (tag1, tag2, ..., tagN).
        For RelatedExaminer, only a single username is allowed.
    """
    usersandtags_patt = r'((?:\w+\s*,\s*)*\w+)\s*\(((?:\w+\s*,\s*)*\w+)\)$'
    userspec = models.CharField(max_length=200,
                                help_text='One or more usernames followed by optional tags. Format: usernameA, ...., usernameN (tag1, tag2, ..., tagN). For RelatedExaminer, only a single username is allowed.')<commit_msg>apps.core.models.relateduser: Docs.<commit_after>import re
from django.db import models
from django.db.models import Q
from django.core.exceptions import ValidationError

from period import Period
from node import Node
from abstract_is_admin import AbstractIsAdmin



class RelatedUserBase(models.Model, AbstractIsAdmin):
    """
    Base class for :cls:`RelatedExaminer` and cls:`RelatedStudent`.

    This is used to generate AssignmentGroups and

    .. attribute:: userspec

        One or more usernames prefixed by an optional name and followed by optional tags. Format: Group name:: usernameA, ...., usernameN (tag1, tag2, ..., tagN).
        For RelatedExaminer, only a single username is allowed. For RelatedExaminer, group name can not be specified.
    """
    usersandtags_patt = r'((?:\w+\s*,\s*)*\w+)\s*\(((?:\w+\s*,\s*)*\w+)\)$'
    userspec = models.CharField(max_length=200,
                                help_text='One or more usernames prefixed by an optional name and followed by optional tags. Format: Group name:: usernameA, ...., usernameN (tag1, tag2, ..., tagN). For RelatedExaminer, only a single username is allowed. For RelatedExaminer, group name can not be specified.')
{'fraction_non_alphanumeric': 0.11605504587155964, 'fraction_numerical': 0.006422018348623854, 'mean_word_length': 3.4692622950819674, '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': '5756828', 'n_tokens_mistral': 635, 'n_tokens_neox': 613, 'n_words': 216}