def implements(*interfaces):
    """Can be used in the class definiton of `Component` subclasses to
    declare the extension points that are extended.
    Can also be used for normal classes to declare them implementing
    `API`s.
    """
    import sys
    frame = sys._getframe(1)
    locals_ = frame.f_locals
    assert locals_ is not frame.f_globals and '__module__' in locals_, 'implements() can only be used in a class definition'
    locals_.setdefault('_implements', []).extend(interfaces)
