Decorator marking wrapped :py:class:`Module` method as :term:`provider` for
    given :term:`specification`.

    For example::

        class ApplicationModule(Module):

            @provides('db_connection')
            def provide_db_connection(self):
                return DBConnection(host='localhost')

def provides(*specification):
    """
    Decorator marking wrapped :py:class:`Module` method as :term:`provider` for
    given :term:`specification`.

    For example::

        class ApplicationModule(Module):

            @provides('db_connection')
            def provide_db_connection(self):
                return DBConnection(host='localhost')
    """
    if len(specification) == 1:
        specification = specification[0]
    else:
        specification = tuple(specification)

    def decorator(function):
        function.__provides__ = specification
        return function

    return decorator