human
I wrote the below code

    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        obj = args[0]
        api_versions = _get_supported_api_versions(obj)
        api_version = None
        index = (-1)
        while True:
            try:
                api_version = api_versions[index]
            except (IndexError, KeyError):
                msg = _('No    compatible    API    version    found    for    this    product:    api_versions    ->    %(api_version)s,    %(func)s')
                LOG.error(msg, api_version=api_version, func=func)
                raise exception.DateraAPIException((msg % {'api_version': api_version, 'func': func}))
            try:
                name = ('_' + '_'.join((func.func_name, api_version.replace('.', '_'))))
            except AttributeError:
                name = ('_' + '_'.join((func.__name__, api_version.replace('.', '_'))))
            try:
                if obj.do_profile:
                    LOG.info('Trying    method:    %s', name)
                    call_id = uuid.uuid4()
                    LOG.debug('Profiling    method:    %s,    id    %s', name, call_id)
                    t1 = time.time()
                    obj.thread_local.trace_id = call_id
                result = getattr(obj, name)(*args[1:], **kwargs)
                if obj.do_profile:
                    t2 = time.time()
                    timedelta = round((t2 - t1), 3)
                    LOG.debug('Profile    for    method    %s,    id    %s:    %ss', name, call_id, timedelta)
                return result
            except AttributeError as e:
                if (name not in six.text_type(e)):
                    raise
                else:
                    LOG.info(e)
                    index -= 1
            except exception.DateraAPIException as e:
                if ('UnsupportedVersionError' in six.text_type(e)):
                    index -= 1
                else:
                    raise
    return wrapper

What's a good function header?

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

def _api_lookup(func):