<commit_before># coding=utf-8
import datetime

from .base import VKBase
from .database import City, Country
from .friends import Friends
from .wall import Wall


class User(VKBase):
    """
    https://vk.com/dev/objects/user
    """
    USER_FIELDS = ('bdate', 'domain', 'sex',
                   'maiden_name', 'nickname', 'verified', 'last_seen', 'platform', 'status')

    __slots__ = ('id', 'first_name', 'last_name', 'is_deactivated', 'is_deleted', 'is_banned', 'is_hidden', 'bdate', 'domain', 'screen_name', 'sex',
                 'maiden_name', 'nickname', 'is_verified', 'status', '_session')

    @classmethod
    def from_json(cls, session, json_obj):
        user = cls()
        user.id = json_obj.get('id')
        user.first_name = json_obj.get('first_name')
        user.last_name = json_obj.get('last_name')
        user.maiden_name = json_obj.get('maiden_name')
        user.nickname = json_obj.get('nickname')
        user.bdate = json_obj.get('bdate')
        user.sex = cls._sex(json_obj.get('sex'))
        user.status = cls._status(json_obj)

        user.is_deactivated = bool(json_obj.get('deactivated'))
        user.is_deleted = bool(json_obj.get('deactivated') == 'deleted')
        user.is_banned = bool(json_obj.get('deactivated') == 'banned')
        user.is_hidden = bool(json_obj.get('hidden'))
        user.is_verified = bool(json_obj.get('verified'))

        user.domain = json_obj.get('domain')
        user.screen_name = user.domain
        user.last_seen = cls._last_seen(json_obj.get('last_seen'))
        user.platform = cls._platform(json_obj.get('last_seen'))

        user._session = session

        return user

    def get_about(self):
        response = self._session.fetch("users.get", user_ids=self.id, fields="about")[0]
        return response.get('about')<commit_msg>Refactoring `User`<commit_after># coding=utf-8
import datetime

from .base import VKBase
from .database import City, Country
from .friends import Friends
from .wall import Wall


class User(VKBase):
    """
    https://vk.com/dev/objects/user
    """
    USER_FIELDS = (
        'about',
        'activities',
        'bdate',
        'books',
        'career',
        'city',
        'connections',
        'counters',
        'country',
        'domain',
        'education',
        'exports',
        'games',
        'sex',
        'maiden_name',
        'nickname',
        'verified',
        'last_seen',
        'platform',
        'status',
    )

    __slots__ = (
        'id',
        'first_name',
        'last_name',
        'is_deactivated',
        'is_deleted',
        'is_banned',
        'is_hidden',
        'bdate',
        'domain',
        'screen_name',
        'sex',
        'maiden_name',
        'nickname',
        'is_verified',
        'status',
        '_session',
    )

    @classmethod
    def from_json(cls, session, json_obj):
        user = cls()
        user.id = json_obj.get('id')
        user.first_name = json_obj.get('first_name')
        user.last_name = json_obj.get('last_name')
        user.maiden_name = json_obj.get('maiden_name')
        user.nickname = json_obj.get('nickname')
        user.bdate = json_obj.get('bdate')
        user.sex = cls._sex(json_obj.get('sex'))
        user.status = cls._status(json_obj)

        user.about = json_obj.get('about')

        user.is_deactivated = bool(json_obj.get('deactivated'))
        user.is_deleted = bool(json_obj.get('deactivated') == 'deleted')
        user.is_banned = bool(json_obj.get('deactivated') == 'banned')
        user.is_hidden = bool(json_obj.get('hidden'))
        user.is_verified = bool(json_obj.get('verified'))

        user.domain = json_obj.get('domain')
        user.screen_name = user.domain
        user.last_seen = cls._last_seen(json_obj.get('last_seen'))
        user.platform = cls._platform(json_obj.get('last_seen'))

        user._session = session

        return user

    def get_about(self):
        response = self._session.fetch("users.get", user_ids=self.id, fields="about")[0]
        return response.get('about')
{'fraction_non_alphanumeric': 0.14909269249632173, 'fraction_numerical': 0.000980872976949485, 'mean_word_length': 2.489307100085543, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '167694', 'n_tokens_mistral': 1355, 'n_tokens_neox': 1336, 'n_words': 225}