<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_pyenv_paths(pyenv_root_func=None):
 """Returns a list of paths to Python interpreters managed by pyenv. :param pyenv_root_func: A no-arg function that returns the pyenv root. Defaults to running `pyenv root`, but can be overridden for testing. """

    pyenv_root_func = pyenv_root_func or get_pyenv_root
    pyenv_root = pyenv_root_func()
    if pyenv_root is None:
      return []
    versions_dir = os.path.join(pyenv_root, 'versions')
    paths = []
    for version in sorted(os.listdir(versions_dir)):
      path = os.path.join(versions_dir, version, 'bin')
      if os.path.isdir(path):
        paths.append(path)
    return paths