code: def test_read_from_remote(tmp_dir, erepo_dir, cloud, local_cloud):
      erepo_dir.add_remote(config=cloud.config, name="other")
      erepo_dir.add_remote(config=local_cloud.config, default=True)
      erepo_dir.dvc_gen(
          {"dir": {"foo": "foo content"}}, commit="create file"
      )
      erepo_dir.dvc.push(remote="other")
      remove(erepo_dir.dvc.cache.local.path)
  
      assert (
          api.read(
              os.path.join("dir", "foo"),
              repo=f"file://{erepo_dir.as_posix()}",
              remote="other",
          )
          == "foo content"
      )
  
      assert (
          api.read(
              os.path.join("dir", "foo"),
              repo=f"file://{erepo_dir.as_posix()}",
              config={"core": {"remote": "other"}},
          )
          == "foo 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 14 for calling a global function with example usage: test_read_from_remote(tmp_dir, erepo_dir, cloud, local_cloud) without return types