##### SUMMARY

Move the remaining files needed by `ansible-test` into the `test/lib/ansible_test/` directory. This is required to implement: https://github.com/ansible/ansible/issues/59884

##### ISSUE TYPE

Feature Idea

##### COMPONENT NAME

ansible-test

for path_dir in path_dirs:
                if path_dir in seen_dirs:
                    continue
                seen_dirs.add(path_dir)
                if os.path.abspath(path_dir) == real_cwd:
                    path_dir = cwd
                candidate = os.path.join(path_dir, executable)
                if os.path.exists(candidate) and os.access(candidate, os.F_OK | os.X_OK):
                    match = candidate
                    break
    if not match and required:
        message = 'Required program "%s" not found.' % executable
        if required != 'warning':
            raise ApplicationError(message)
        display.warning(message)
    return match
def find_python(version, path=None, required=True):
    """
    :type version: str
    :type path: str | None
    :type required: bool
    :rtype: str
    """
    version_info = tuple(int(n) for n in version.split('.'))
    if not path and version_info == sys.version_info[:len(version_info)]:
        python_bin = sys.executable
    else:
        python_bin = find_executable('python%s' % version, path=path, required=required)
    return python_bin
def get_available_python_versions(versions):