# Path: mlpy/modules/patterns.py
# class RegistryInterface(type):
#     """Metaclass registering all subclasses derived from a given class.
# 
#     The registry interface adds every class derived from a given class
#     to its registry dictionary. The `registry` attribute is a class
#     variable and can be accessed anywhere. Therefore, this interface can
#     be used to find all subclass of a given class.
# 
#     One use case are factory classes.
# 
#     Attributes
#     ----------
#     registry : list
#         List of all classes deriving from a registry class.
# 
#     Methods
#     -------
#     __init__
# 
#     Examples
#     --------
#     Create a registry class:
# 
#     >>> from mlpy.modules.patterns import RegistryInterface
#     >>> class MyRegistryClass(object):
#     ...     __metaclass__ = RegistryInterface
# 
#     .. note::
#         | Project: Code from `A Primer on Python Metaclasses <https://jakevdp.github.io/blog/2012/12/01/a-primer-on-python-metaclasses/>`_.
#         | Code author: `Jake Vanderplas <http://www.astro.washington.edu/users/vanderplas/>`_
#         | License: `CC-Wiki <http://creativecommons.org/licenses/by-sa/3.0/>`_
# 
#     """
#     __metaclass__ = ABCMeta
# 
#     def __init__(cls, name, bases, dct):
#         """Register the deriving class on instantiation."""
#         if not hasattr(cls, 'registry'):
#             cls.registry = {}
#         else:
#             cls.registry[name.lower()] = cls
# 
#         super(RegistryInterface, cls).__init__(name, bases, dct)


from abc import abstractmethod
from ...modules.patterns import RegistryInterface
            initialization.
        kwargs : dict, optional
            Non-positional arguments passed to the class of the given type
            for initialization.

        Returns
        -------
        ICBRMethod :
            A case base method instance of the given type.

        """
        # noinspection PyUnresolvedReferences
        return ICBRMethod.registry[_type.lower()](*args, **kwargs)


class ICBRMethod(object):
    """The method interface.

    This is the interface for reuse, revision, and retention methods and handles
    registration of all subclasses.

    It uses the :class:`.RegistryInterface` ensuring that all subclasses are
    registered. Therefore, new specialty case base reasoning method classes can
    be defined and are recognized by the case base reasoning engine.

    Notes
    -----
    All case base reasoning method must inherit from this class.

    """

# Path: mlpy/modules/patterns.py
# class RegistryInterface(type):
#     """Metaclass registering all subclasses derived from a given class.
# 
#     The registry interface adds every class derived from a given class
#     to its registry dictionary. The `registry` attribute is a class
#     variable and can be accessed anywhere. Therefore, this interface can
#     be used to find all subclass of a given class.
# 
#     One use case are factory classes.
# 
#     Attributes
#     ----------
#     registry : list
#         List of all classes deriving from a registry class.
# 
#     Methods
#     -------
#     __init__
# 
#     Examples
#     --------
#     Create a registry class:
# 
#     >>> from mlpy.modules.patterns import RegistryInterface
#     >>> class MyRegistryClass(object):
#     ...     __metaclass__ = RegistryInterface
# 
#     .. note::
#         | Project: Code from `A Primer on Python Metaclasses <https://jakevdp.github.io/blog/2012/12/01/a-primer-on-python-metaclasses/>`_.
#         | Code author: `Jake Vanderplas <http://www.astro.washington.edu/users/vanderplas/>`_
#         | License: `CC-Wiki <http://creativecommons.org/licenses/by-sa/3.0/>`_
# 
#     """
#     __metaclass__ = ABCMeta
# 
#     def __init__(cls, name, bases, dct):
#         """Register the deriving class on instantiation."""
#         if not hasattr(cls, 'registry'):
#             cls.registry = {}
#         else:
#             cls.registry[name.lower()] = cls
# 
#         super(RegistryInterface, cls).__init__(name, bases, dct)


# Path: mlpy/knowledgerep/cbr/methods.py
from abc import abstractmethod
from ...modules.patterns import RegistryInterface

            initialization.
        kwargs : dict, optional
            Non-positional arguments passed to the class of the given type
            for initialization.

        Returns
        -------
        ICBRMethod :
            A case base method instance of the given type.

        """
        # noinspection PyUnresolvedReferences
        return ICBRMethod.registry[_type.lower()](*args, **kwargs)


class ICBRMethod(object):
    """The method interface.

    This is the interface for reuse, revision, and retention methods and handles
    registration of all subclasses.

    It uses the :class:`.RegistryInterface` ensuring that all subclasses are
    registered. Therefore, new specialty case base reasoning method classes can
    be defined and are recognized by the case base reasoning engine.

    Notes
    -----
    All case base reasoning method must inherit from this class.

    """

    __metaclass__ = RegistryInterface