<commit_before># wwwhisper - web access control.
# Copyright (C) 2012 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Data model for the access control mechanism.

Stores information about sites, locations, users and permissions. A
site has users, locations (paths) and permissions - rules that define
which user can access which locations. Sites are isolated. Users and
locations are associated with a single site and are used only for this
site.

Provides methods that map to REST operations that can be performed on
users, locations and permissions resources. Allows to retrieve
externally visible attributes of these resources, the attributes are
returned as a resource representation by REST methods.

Resources are identified by an externally visible UUIDs. Standard
primary key ids are not used for external identification purposes,
because those ids can be reused after object is deleted.

Makes sure entered emails and paths are valid.
"""

from django.contrib.auth.models import User
from django.db import models
from wwwhisper_auth import  url_path

import re
import uuid as uuidgen
import random

USERNAME_LEN=10
assert USERNAME_LEN <= User._meta.get_field('username').max_length

class CreationException(Exception):<commit_msg>Decrease username length.<commit_after># wwwhisper - web access control.
# Copyright (C) 2012 <NAME> <<EMAIL>>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

"""Data model for the access control mechanism.

Stores information about sites, locations, users and permissions. A
site has users, locations (paths) and permissions - rules that define
which user can access which locations. Sites are isolated. Users and
locations are associated with a single site and are used only for this
site.

Provides methods that map to REST operations that can be performed on
users, locations and permissions resources. Allows to retrieve
externally visible attributes of these resources, the attributes are
returned as a resource representation by REST methods.

Resources are identified by an externally visible UUIDs. Standard
primary key ids are not used for external identification purposes,
because those ids can be reused after object is deleted.

Makes sure entered emails and paths are valid.
"""

from django.contrib.auth.models import User
from django.db import models
from wwwhisper_auth import  url_path

import re
import uuid as uuidgen
import random

USERNAME_LEN=7
assert USERNAME_LEN <= User._meta.get_field('username').max_length

class CreationException(Exception):
{'fraction_non_alphanumeric': 0.050417902399568615, 'fraction_numerical': 0.00350498786734969, 'mean_word_length': 4.743034055727554, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, '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': '324399', 'n_tokens_mistral': 918, 'n_tokens_neox': 882, 'n_words': 521}