code: def test_open_in_history(tmp_dir, scm, dvc):
      tmp_dir.gen("foo", "foo")
      dvc.add("foo")
      dvc.scm.add(["foo.dvc", ".gitignore"])
      dvc.scm.commit("foo")
  
      tmp_dir.gen("foo", "foofoo")
      dvc.add("foo")
      dvc.scm.add(["foo.dvc", ".gitignore"])
      dvc.scm.commit("foofoo")
  
      with dvc.switch("HEAD~1"):
          fs = DVCFileSystem(repo=dvc)
          with fs.open("foo", "r") as fobj:
              assert fobj.read() == "foo"
  
imports: import os
  import posixpath
  import shutil
  import pytest
  from fsspec.utils import tokenize
  from dvc.fs import localfs
  from dvc.fs.dvc import DVCFileSystem
  from dvc.testing.tmp_dir import make_subrepo
  from dvc_data.hashfile.build import build
  from dvc_data.hashfile.hash_info import HashInfo
label_desc: Use image node_id 5 for calling a global function with example usage: test_open_in_history(tmp_dir, scm, dvc) without return types