human
I wrote the below code

    def proc_fd_lsof(path):
        '\n                                Return    True    if    any    entry    in    /proc/locks    points    to    path.        Example    data:\n\n                                ..    code-block::    bash\n\n                                                #    cat    /proc/locks\n                                                1:    FLOCK        ADVISORY        WRITE    596    00:0f:10703    0    EOF\n                                                2:    FLOCK        ADVISORY        WRITE    14590    00:0f:11282    0    EOF\n                                                3:    POSIX        ADVISORY        WRITE    653    00:0f:11422    0    EOF\n                                '
        import glob
        locks = run_function('cmd.run', ['cat    /proc/locks']).splitlines()
        for line in locks:
            fields = line.split()
            try:
                (major, minor, inode) = fields[5].split(':')
                inode = int(inode)
            except (IndexError, ValueError):
                return False
            for fd in glob.glob('/proc/*/fd'):
                fd_path = os.path.realpath(fd)
                if ((fd_path == path) and (os.stat(fd_path).st_ino == inode)):
                    return True
        return False
    def get_lock(path):
        '\n                                Return    True    if    any    locks    are    found    for    path\n                                '
        if salt.utils.path.which('lsof'):
            lock = run_function('cmd.run', ['lsof    {0}'.format(path)])
            return (True if len(lock) else False)
        elif (grains.get('kernel') == 'Linux'):
            return proc_fd_lsof(path)
        return False
    if ('Debian' in grains.get('os_family', '')):
        for path in ['/var/lib/apt/lists/lock']:
            if get_lock(path):
                return False
    return True

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

def pkgmgr_avail(run_function, grains):