def add_hook(name, pass_function=False):

    def outer(f):
        f.__hook_name__ = name

        @functools.wraps(f)
        def inner(*args, **kwargs):
            manager = _HOOKS.setdefault(name, HookManager(name))

            function = None
            if pass_function:
                function = f

            manager.run_pre(name, args, kwargs, f=function)
            rv = f(*args, **kwargs)
            manager.run_post(name, rv, args, kwargs, f=function)

            return rv

        return inner
    return outer
Select a new cover photo for this viewpoint.  Or clear it if none are available.
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/hooks.py/add_hook--crossover with--dataset/ETHPy150Open viewfinderco/viewfinder/backend/db/tools/dbchk.py/DatabaseChecker._RepairBadCoverPhoto