remove a callback from the list of global hooks

    :param handler:
        the callback function, previously added with global_hook, to remove
        from the list of global hooks
    :type handler: function

    :returns: bool, whether the handler was removed from the global hooks

def remove_global_hook(handler):
    """remove a callback from the list of global hooks

    :param handler:
        the callback function, previously added with global_hook, to remove
        from the list of global hooks
    :type handler: function

    :returns: bool, whether the handler was removed from the global hooks
    """
    for i, cb in enumerate(state.global_hooks):
        cb = cb()
        if cb is not None and cb is handler:
            state.global_hooks.pop(i)
            log.info("removing a global hook callback")
            return True
    return False