code: def test_get_url_external(tmp_dir, erepo_dir, cloud):
      erepo_dir.add_remote(config=cloud.config)
      with erepo_dir.chdir():
          erepo_dir.dvc_gen("foo", "foo", commit="add foo")
  
      # Using file url to force clone to tmp repo
      repo_url = f"file://{erepo_dir.as_posix()}"
      expected_url = (
          cloud / "files" / "md5" / "ac/bd18db4cc2f85cedef654fccc4a4d8"
      ).url
      assert api.get_url("foo", repo=repo_url) == expected_url
  
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 1 for calling a global function with example usage: test_get_url_external(tmp_dir, erepo_dir, cloud) without return types