human
I wrote the below code

    @wraps(func)
    def func_wrapper(*args, **kwargs):
        wrapped_global_namespace = func.__globals__
        proxy = wrapped_global_namespace.get('__proxy__')
        opts = wrapped_global_namespace.get('__opts__')
        always_alive = opts.get('proxy', {}).get('always_alive', True)
        if (salt.utils.platform.is_proxy() and always_alive):
            wrapped_global_namespace['napalm_device'] = proxy['napalm.get_device']()
        elif (salt.utils.platform.is_proxy() and (not always_alive)):
            if (('inherit_napalm_device' not in kwargs) or (('inherit_napalm_device' in kwargs) and (not kwargs['inherit_napalm_device']))):
                try:
                    wrapped_global_namespace['napalm_device'] = get_device(opts)
                except napalm_base.exceptions.ConnectionException as nce:
                    log.error(nce)
                    return '{base_msg}.    See    log    for    details.'.format(base_msg=str(nce.msg))
            else:
                wrapped_global_namespace['napalm_device'] = kwargs['inherit_napalm_device']
        else:
            _salt_obj = wrapped_global_namespace.get('__salt__')
            if (('inherit_napalm_device' not in kwargs) or (('inherit_napalm_device' in kwargs) and (not kwargs['inherit_napalm_device']))):
                try:
                    wrapped_global_namespace['napalm_device'] = get_device(opts, salt_obj=_salt_obj)
                except napalm_base.exceptions.ConnectionException as nce:
                    log.error(nce)
                    return '{base_msg}.    See    log    for    details.'.format(base_msg=str(nce.msg))
            else:
                wrapped_global_namespace['napalm_device'] = kwargs['inherit_napalm_device']
        if not_always_alive(opts):
            wrapped_global_namespace['napalm_device']['__opts__'] = opts
        return func(*args, **kwargs)
    return func_wrapper

What's a good function header?
assistant
#Here's a good function header.

def proxy_napalm_wrap(func):