code: def test_open_rev(tmp_dir, scm, dvc):
      tmp_dir.scm_gen("foo", "foo", commit="foo")
  
      (tmp_dir / "foo").write_text("bar")
  
      with api.open("foo", rev="master") as fobj:
          assert fobj.read() == "foo"
  
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 8 for calling a global function with example usage: test_open_rev(tmp_dir, scm, dvc) without return types