human
Here's a good function header given the following:
I wrote the below code

    parent_path = installable_context.parent_path
    desc = installable_context.installable_description
    def _check():
        if (not installable_context.is_installed()):
            if auto_init:
                if installable_context.can_install():
                    if install_func(installable_context):
                        installed = False
                        log.warning(('%s    installation    requested    and    failed.' % desc))
                    else:
                        installed = installable_context.is_installed()
                        if (not installed):
                            log.warning(('%s    installation    requested,    seemed    to    succeed,    but    not    found.' % desc))
                else:
                    installed = False
            else:
                installed = False
                log.warning('%s    not    installed    and    auto-installation    disabled.', desc)
        else:
            installed = True
        return installed
    if (not os.path.lexists(parent_path)):
        os.mkdir(parent_path)
    try:
        if (auto_init and os.access(parent_path, os.W_OK)):
            with FileLock(os.path.join(parent_path, desc.lower()), timeout=300):
                return _check()
        else:
            return _check()
    except FileLockException:
        raise Exception(('Failed    to    get    file    lock    for    %s' % os.path.join(parent_path, desc.lower())))

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

def ensure_installed(installable_context, install_func, auto_init):