def block(**kwargs):
    """
    Decorator to define a block, so it can get added to the registry.
    Use it as follows:
    @block(engine='foo', description='bar', my_other_metadata='foobar')
    def my_block()...
    """
    def block_decorator(func):
        func._metadata = kwargs
        func._is_block = True
        return func
    return block_decorator