<commit_before>from plex.objects.core.base import Property
from plex.objects.directory import Directory
from plex.objects.library.metadata.base import Metadata


class Photo(Directory, Metadata):
    index = Property(type=int)

    def __repr__(self):
        return '<Photo %r>' % self.title<commit_msg>Implemented `PhotoAlbum` object, added `SessionMixin` to the `Photo` object<commit_after>from plex.objects.core.base import Property
from plex.objects.directory import Directory
from plex.objects.library.metadata.base import Metadata
from plex.objects.mixins.session import SessionMixin


class PhotoAlbum(Directory, Metadata):
    index = Property(type=int)

    def __repr__(self):
        return '<PhotoAlbum %r>' % self.title


class Photo(Directory, Metadata, SessionMixin):
    album = Property(resolver=lambda: Photo.construct_album)

    index = Property(type=int)

    def __repr__(self):
        return '<Photo %r>' % self.title

    @staticmethod
    def construct_album(client, node):
        attribute_map = {
            'key':          'parentKey',
            'ratingKey':    'parentRatingKey',
            'index':        'parentIndex',

            'title':        'parentTitle',

            'thumb':        'parentThumb'
        }

        return PhotoAlbum.construct(client, node, attribute_map, child=True)
{'fraction_non_alphanumeric': 0.10435435435435435, 'fraction_numerical': 0.0, 'mean_word_length': 3.1786833855799372, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '4924009', 'n_tokens_mistral': 386, 'n_tokens_neox': 361, 'n_words': 92}