<commit_before>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from collections import namedtuple


# Functions and classes =======================================================
class Tree(namedtuple('Tree', ["name",
                               "sub_trees",
                               "sub_publications",
                               "aleph_id",
                               "issn",
                               "path"])):
    '''
    Communication structure used to sent data to `storage` subsystem over AMQP.

    Attributes:
        name (str): Name of the periodical.
        sub_trees (list): List of other trees.
        sub_publications (list): List of sub-publication UUID's.
        aleph_id (str): ID used in aleph.
        issn (str): ISSN given to the periodical.
        path (str): Path in the periodical structures.
    '''
    @property
    def indexes(self):
        return [
            "name",
            "aleph_id",
            "issn",
            "path",
        ]<commit_msg>#47: Added type checks into Tree's constructor.<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
#
# Interpreter version: python 2.7
#
# Imports =====================================================================
from collections import namedtuple


# Functions and classes =======================================================
class Tree(namedtuple('Tree', ["name",
                               "sub_trees",
                               "sub_publications",
                               "aleph_id",
                               "issn",
                               "path"])):
    '''
    Communication structure used to sent data to `storage` subsystem over AMQP.

    Attributes:
        name (str): Name of the periodical.
        sub_trees (list): List of other trees.
        sub_publications (list): List of sub-publication UUID's.
        aleph_id (str): ID used in aleph.
        issn (str): ISSN given to the periodical.
        path (str): Path in the periodical structures.
    '''
    def __init__(self, *args, **kwargs):
        super(self.__class__, self).__init__(*args, **kwargs)

        assert self.path
        assert type(self.sub_trees) in [list, tuple]
        assert type(self.sub_publications) in [list, tuple]

    @property
    def indexes(self):
        return [
            "name",
            "aleph_id",
            "issn",
            "path",
        ]
{'fraction_non_alphanumeric': 0.19471817106819078, 'fraction_numerical': 0.0031533307055577452, 'mean_word_length': 1.8710407239819005, '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': '523278', 'n_tokens_mistral': 668, 'n_tokens_neox': 624, 'n_words': 191}