human
I wrote the below code

    def is_exe(fpath):
        return (os.path.exists(fpath) and os.access(fpath, os.X_OK) and os.path.isfile(os.path.realpath(fpath)))
    found_path = None
    (fpath, fname) = os.path.split(program)
    if fpath:
        program = os.path.abspath(os.path.expanduser(program))
        if is_exe(program):
            found_path = program
    else:
        paths_to_search = []
        if isinstance(paths, (tuple, list)):
            paths_to_search.extend(paths)
        else:
            env_paths = os.environ.get('PATH', '').split(os.pathsep)
            paths_to_search.extend(env_paths)
        for path in paths_to_search:
            exe_file = os.path.join(path, program)
            if is_exe(exe_file):
                found_path = exe_file
                break
    return found_path

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

def which(program, paths=None):