code: def test_api_missing_local_cache_exists_on_remote(
      tmp_dir, scm, dvc, as_external, remote, files, to_read
  ):
      tmp_dir.dvc_gen(files, commit="DVC track files")
      dvc.push()
  
      # Remove cache to make foo missing
      remove(dvc.cache.local.path)
      remove(first(files))
  
      repo_url = f"file://{tmp_dir.as_posix()}" if as_external else None
      file_content = get_in(files, to_read.split(os.sep))
      assert api.read(to_read, repo=repo_url) == file_content
  
imports: import os
  import pytest
  from funcy import first, get_in
  from dvc import api
  from dvc.exceptions import OutputNotFoundError, PathMissingError
  from dvc.testing.api_tests import TestAPI
  from dvc.testing.tmp_dir import make_subrepo
  from dvc.utils.fs import remove
label_desc: Use image node_id 9 for calling a global function with example usage: test_api_missing_local_cache_exists_on_remote(tmp_dir, scm, dvc, as_external, remote, files, to_read) without return types