<commit_before>#
# -*- coding: utf-8 -*-
#
# This file is part of reclass (http://github.com/madduck/reclass)
#
# Copyright © 2007–13 <NAME> <<EMAIL>>
# Released under the terms of the Artistic Licence 2.0
#
from classes import Classes
from parameters import Parameters
from applications import Applications

class Entity(object):

    def __init__(self, classes=Classes(), applications=Applications(),
                 parameters=Parameters(), name=None):
        self._applications = applications
        self._classes = classes
        self._parameters = parameters
        self._name = name

    applications = property(lambda self: self._applications)
    classes = property(lambda self: self._classes)
    parameters = property(lambda self: self._parameters)
    name = property(lambda self: self._name)

    def merge(self, other):
        self.classes.merge(other.classes)
        self.applications.merge(other.applications)
        self.parameters.merge(other.parameters)
        self._name = other.name

    def __eq__(self, other):
        return self.applications == other.applications \
                and self.classes == other.classes \
                and self.parameters == other.parameters \
                and self.name == other.name

    def __ne__(self, other):
        return not self.__eq__(other)<commit_msg>Do not use constructors in default arguments<commit_after>#
# -*- coding: utf-8 -*-
#
# This file is part of reclass (http://github.com/madduck/reclass)
#
# Copyright © 2007–13 <NAME> <<EMAIL>>
# Released under the terms of the Artistic Licence 2.0
#
from classes import Classes
from parameters import Parameters
from applications import Applications

class Entity(object):

    def __init__(self, classes=None, applications=None, parameters=None,
                 name=None):
        if applications is None: applications = Applications()
        self._applications = applications
        if classes is None: classes = Classes()
        self._classes = classes
        if parameters is None: parameters = Parameters()
        self._parameters = parameters
        self._name = name

    applications = property(lambda self: self._applications)
    classes = property(lambda self: self._classes)
    parameters = property(lambda self: self._parameters)
    name = property(lambda self: self._name)

    def merge(self, other):
        self.classes.merge(other.classes)
        self.applications.merge(other.applications)
        self.parameters.merge(other.parameters)
        self._name = other.name

    def __eq__(self, other):
        return self.applications == other.applications \
                and self.classes == other.classes \
                and self.parameters == other.parameters \
                and self.name == other.name

    def __ne__(self, other):
        return not self.__eq__(other)
{'fraction_non_alphanumeric': 0.09781843771991555, 'fraction_numerical': 0.0063335679099225895, 'mean_word_length': 2.821236559139785, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5601084', 'n_tokens_mistral': 752, 'n_tokens_neox': 717, 'n_words': 217}