from typing import List
from typing import Callable
from typing import Any


def decorate(decorators: List[Callable[..., Any]]) -> Callable[..., Any]:
    """Use this decorator function to apply a list of decorators to a function.

    Useful when sharing a common group of decorators among functions.

    The original use case is with click decorators (see: https://github.com/pallets/click/issues/108)
    """
    def func_with_shared_decorators(func: Callable[..., Any]) -> Callable[..., Any]:
        for option in reversed(decorators):
            func = option(func)
        return func
    return func_with_shared_decorators