code: def test_get_url_subrepos(tmp_dir, scm, local_cloud):
      subrepo = tmp_dir / "subrepo"
      make_subrepo(subrepo, scm, config=local_cloud.config)
      with subrepo.chdir():
          subrepo.dvc_gen(
              {"dir": {"foo": "foo"}, "bar": "bar"}, commit="add files"
          )
          subrepo.dvc.push()
  
      expected_url = os.fspath(
          local_cloud
          / "files"
          / "md5"
          / "ac"
          / "bd18db4cc2f85cedef654fccc4a4d8"
      )
      assert (
          api.get_url(os.path.join("subrepo", "dir", "foo"))
          == expected_url
      )
      assert (
          api.get_url(os.path.join("subrepo", "dir", "foo"), repo=".")
          == expected_url
      )
  
      expected_url = os.fspath(
          local_cloud
          / "files"
          / "md5"
          / "37"
          / "b51d194a7513e45b56f6524f2d51f2"
      )
      assert api.get_url("subrepo/bar") == expected_url
      assert api.get_url("subrepo/bar", repo=".") == 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 12 for calling a global function with example usage: test_get_url_subrepos(tmp_dir, scm, local_cloud) without return types