<commit_before># -*- coding: utf-8 -*-
#
# Copyright (c) 2009 <NAME> <<EMAIL>>
#
# This file is part of TimeSide.

# TimeSide is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.

# TimeSide is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.



# This file defines an object interface mechanism and a way to determine
# which components implements a given interface
#
# For example, the following defines the Music class as implementing the
# listenable interface.
#
# class Listenable(Interface):
#     pass
#
# class Music(Component):
#    implements(Listenable)
#
# Several class can implements a such interface, and it is possible to 
# discover which class implements it with implementations():
#
# list_of_classes = implementations(Listenable)
#
# This mechanism support inheritance of both interfaces and components:
#
# - all descendants of a class implementing a given interface are also considered
#   to implement this interface
# - a class implementing a given interface is also considered to implement all
#   the ascendants of this interface

__all__ = ['Component', 'implements', 'Interface', 'implementations']

class Interface(object):
    """Marker base class for interfaces."""

def implements(*interfaces):<commit_msg>migrate TimeSideError into new core (shouldn't be there though)<commit_after># -*- coding: utf-8 -*-
#
# Copyright (c) 2009 <NAME> <<EMAIL>>
#
# This file is part of TimeSide.

# TimeSide is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.

# TimeSide is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with TimeSide.  If not, see <http://www.gnu.org/licenses/>.



# This file defines an object interface mechanism and a way to determine
# which components implements a given interface
#
# For example, the following defines the Music class as implementing the
# listenable interface.
#
# class Listenable(Interface):
#     pass
#
# class Music(Component):
#    implements(Listenable)
#
# Several class can implements a such interface, and it is possible to 
# discover which class implements it with implementations():
#
# list_of_classes = implementations(Listenable)
#
# This mechanism support inheritance of both interfaces and components:
#
# - all descendants of a class implementing a given interface are also considered
#   to implement this interface
# - a class implementing a given interface is also considered to implement all
#   the ascendants of this interface

__all__ = ['Component', 'implements', 'Interface', 'implementations', 'TimeSideError']

class TimeSideError(Exception):
    """Exception base class for errors in TimeSide."""
    # FIXME: is this redundant with Django's error handling ?
    # FIXME: this class doesn't belong to the core

class Interface(object):
    """Marker base class for interfaces."""

def implements(*interfaces):
{'fraction_non_alphanumeric': 0.07533512064343163, 'fraction_numerical': 0.0032171581769436996, 'mean_word_length': 4.470674486803519, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7001107', 'n_tokens_mistral': 941, 'n_tokens_neox': 908, 'n_words': 481}