code: def test_open_external(tmp_dir, erepo_dir, cloud):
      erepo_dir.add_remote(config=cloud.config)
  
      with erepo_dir.chdir():
          erepo_dir.dvc_gen("version", "master", commit="add version")
  
          with erepo_dir.branch("branch", new="True"):
              # NOTE: need file to be other size for Mac
              erepo_dir.dvc_gen(
                  "version", "branchver", commit="add version"
              )
  
      assert erepo_dir.dvc.push(all_branches=True) == 2
  
      # Remove cache to force download
      remove(erepo_dir.dvc.cache.local.path)
  
      # Using file url to force clone to tmp repo
      repo_url = f"file://{erepo_dir.as_posix()}"
      with api.open("version", repo=repo_url) as fd:
          assert fd.read() == "master"
  
      assert (
          api.read("version", repo=repo_url, rev="branch")
          == "branchver"
      )
  
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 3 for calling a global function with example usage: test_open_external(tmp_dir, erepo_dir, cloud) without return types