# Path: therapist/collection.py
# class Collection(object):
#     """A generic iterable set of objects."""
# 
#     class Meta:
#         pass
# 
#     def __init__(self, objects=None):
#         self._objects = []
# 
#         if objects:
#             for obj in objects:
#                 self.append(obj)
# 
#     def __iter__(self):
#         return iter(self._objects)
# 
#     def __getitem__(self, item):
#         return self._objects[item]
# 
#     def __str__(self):  # pragma: no cover
#         return str(self._objects)
# 
#     def __repr__(self):  # pragma: no cover
#         return "<{}>".format(self.__class__.__name__)
# 
#     def __bool__(self):
#         return bool(self._objects)
# 
#     __nonzero__ = __bool__
# 
#     @property
#     def objects(self):
#         return self._objects
# 
#     def append(self, v):
#         object_class = getattr(self.Meta, "object_class", object)
# 
#         if not isinstance(v, object_class):
#             raise TypeError("Expected an instance of `{}`.".format(object_class.__name__))
# 
#         self._objects.append(v)
# 
# Path: therapist/exc.py
# class Error(Exception):
#     def __init__(self, message=None, *args, **kwargs):
#         self.message = message
#         super(Error, self).__init__(*args, **kwargs)
# 
# Path: therapist/process.py
# class Process(object):
#     def __init__(self, name, **kwargs):
#         self.name = name
#         self.description = kwargs.pop("description", None)
# 
#         self._include = None
#         self.include = kwargs.pop("include", None)
# 
#         self._exclude = None
#         self.exclude = kwargs.pop("exclude", None)
# 
#         self.config = kwargs
# 
#     def __call__(self, **kwargs):
#         return self.execute(**kwargs)
# 
#     def __str__(self):
#         return self.description if self.description else self.name
# 
#     def __repr__(self):
#         return "<{} {}>".format(self.__class__.__name__, self.name)
# 
#     @property
#     def include(self):
#         return self._include
# 
#     @include.setter
#     def include(self, value):
#         if value is None:
#             self._include = []
#         else:
#             self._include = value if isinstance(value, list) else [value]
# 
#     @property
#     def exclude(self):
#         return self._exclude
# 
#     @exclude.setter
#     def exclude(self, value):
#         if value is None:
#             self._exclude = []
#         else:
#             self._exclude = value if isinstance(value, list) else [value]
# 
#     def filter_files(self, files):
#         if self.include:
#             spec = PathSpec(map(GitWildMatchPattern, self.include))
#             files = list(spec.match_files(files))
# 
#         if self.exclude:
#             spec = PathSpec(map(GitWildMatchPattern, self.exclude))
#             exclude = list(spec.match_files(files))
#             files = list(filter(lambda f: f not in exclude, files))
# 
#         return files
# 
#     def execute(self, **kwargs):
#         raise NotImplementedError()  # pragma: no cover


from therapist.collection import Collection
from therapist.exc import Error
from therapist.process import Process


class Plugin(Process):  # pragma: no cover
    def __repr__(self):
        return "<Plugin {}>".format(self.name)

    def execute(self, **kwargs):
        raise NotImplementedError()


class PluginCollection(Collection):

# Path: therapist/collection.py
# class Collection(object):
#     """A generic iterable set of objects."""
# 
#     class Meta:
#         pass
# 
#     def __init__(self, objects=None):
#         self._objects = []
# 
#         if objects:
#             for obj in objects:
#                 self.append(obj)
# 
#     def __iter__(self):
#         return iter(self._objects)
# 
#     def __getitem__(self, item):
#         return self._objects[item]
# 
#     def __str__(self):  # pragma: no cover
#         return str(self._objects)
# 
#     def __repr__(self):  # pragma: no cover
#         return "<{}>".format(self.__class__.__name__)
# 
#     def __bool__(self):
#         return bool(self._objects)
# 
#     __nonzero__ = __bool__
# 
#     @property
#     def objects(self):
#         return self._objects
# 
#     def append(self, v):
#         object_class = getattr(self.Meta, "object_class", object)
# 
#         if not isinstance(v, object_class):
#             raise TypeError("Expected an instance of `{}`.".format(object_class.__name__))
# 
#         self._objects.append(v)
# 
# Path: therapist/exc.py
# class Error(Exception):
#     def __init__(self, message=None, *args, **kwargs):
#         self.message = message
#         super(Error, self).__init__(*args, **kwargs)
# 
# Path: therapist/process.py
# class Process(object):
#     def __init__(self, name, **kwargs):
#         self.name = name
#         self.description = kwargs.pop("description", None)
# 
#         self._include = None
#         self.include = kwargs.pop("include", None)
# 
#         self._exclude = None
#         self.exclude = kwargs.pop("exclude", None)
# 
#         self.config = kwargs
# 
#     def __call__(self, **kwargs):
#         return self.execute(**kwargs)
# 
#     def __str__(self):
#         return self.description if self.description else self.name
# 
#     def __repr__(self):
#         return "<{} {}>".format(self.__class__.__name__, self.name)
# 
#     @property
#     def include(self):
#         return self._include
# 
#     @include.setter
#     def include(self, value):
#         if value is None:
#             self._include = []
#         else:
#             self._include = value if isinstance(value, list) else [value]
# 
#     @property
#     def exclude(self):
#         return self._exclude
# 
#     @exclude.setter
#     def exclude(self, value):
#         if value is None:
#             self._exclude = []
#         else:
#             self._exclude = value if isinstance(value, list) else [value]
# 
#     def filter_files(self, files):
#         if self.include:
#             spec = PathSpec(map(GitWildMatchPattern, self.include))
#             files = list(spec.match_files(files))
# 
#         if self.exclude:
#             spec = PathSpec(map(GitWildMatchPattern, self.exclude))
#             exclude = list(spec.match_files(files))
#             files = list(filter(lambda f: f not in exclude, files))
# 
#         return files
# 
#     def execute(self, **kwargs):
#         raise NotImplementedError()  # pragma: no cover


# Path: therapist/plugins/plugin.py
from therapist.collection import Collection
from therapist.exc import Error
from therapist.process import Process



class Plugin(Process):  # pragma: no cover
    def __repr__(self):
        return "<Plugin {}>".format(self.name)

    def execute(self, **kwargs):
        raise NotImplementedError()


class PluginCollection(Collection):

    class Meta: