code: def exists_maybe_nested(
      paths: Iterable[pathlib.Path], root: pathlib.Path
  ) -> bool:
      """Evaluates whether all paths exist, either as-is, or nested."""
      # Due to differing directory structures between GitHub & Google, we need to
      # check if a path exists as-is, or with the first section repeated.
      for path in paths:
          try:
              resolve_nested_dir(path, root)
          except ValueError:
              return False
      return True
  
file_path: tensorflow-upstream/tensorflow/lite/g3doc/tools/build_java_api_docs.py
imports: import os
  import pathlib
  import shutil
  import tempfile
  from typing import Iterable, Union
  from absl import app
  from absl import flags
  from tensorflow_docs.api_generator import gen_java
label_desc: Use image node_id 3 for calling a global function with example usage: exists_maybe_nested(paths, root) and returns: True, False