<commit_before>import uuid

from gittip.orm import db
from gittip.models.participant import Participant


class User(Participant):
    """Represent a website user.

    Every current website user is also a participant, though if the user is
    anonymous then the methods from Participant will fail with NoParticipantId.
    """

    @classmethod
    def from_session_token(cls, token):
        user = User.query.filter_by(session_token=token).first()
        if user and not user.is_suspicious:
            user = user
        else:
            user = User()
        return user

    @classmethod
    def from_id(cls, user_id):
        user = User.query.filter_by(id=user_id).first()
        if user and not user.is_suspicious:
            user.session_token = <KEY>().hex
            db.session.add(user)
            db.session.commit()
        else:
            user = User()
        return user

    @property
    def ADMIN(self):
        return self.id is not None and self.is_admin<commit_msg>Clarify comment re: Participant class<commit_after>import uuid

from gittip.orm import db
from gittip.models.participant import Participant


class User(Participant):
    """Represent a website user.

    Every current website user is also a participant, though if the user is
    anonymous then the methods from gittip.Participant will fail with
    NoParticipantId.  The methods

    """

    @classmethod
    def from_session_token(cls, token):
        user = User.query.filter_by(session_token=token).first()
        if user and not user.is_suspicious:
            user = user
        else:
            user = User()
        return user

    @classmethod
    def from_id(cls, user_id):
        user = User.query.filter_by(id=user_id).first()
        if user and not user.is_suspicious:
            user.session_token = <KEY>().hex
            db.session.add(user)
            db.session.commit()
        else:
            user = User()
        return user

    @property
    def ADMIN(self):
        return self.id is not None and self.is_admin
{'fraction_non_alphanumeric': 0.07914020517830972, 'fraction_numerical': 0.0, 'mean_word_length': 2.282051282051282, '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': '3354754', 'n_tokens_mistral': 604, 'n_tokens_neox': 577, 'n_words': 179}