code: def test_remote_duplicated(dvc):
      remote_name = "drive"
      remote_url = "gdrive://test/test"
      used_name = "overlap"
      another_url = "gdrive://test/test1"
      # prepare
      assert main(["remote", "add", remote_name, remote_url]) == 0
      assert (
          main(["remote", "add", "--local", used_name, another_url])
          == 0
      )
      config = dvc.config.load_one("repo")
      assert config["remote"][remote_name]["url"] == remote_url
      local_config = dvc.config.load_one("local")
      assert local_config["remote"][used_name]["url"] == another_url
  
      # rename duplicated
      assert main(["remote", "rename", remote_name, used_name]) == 251
      config = dvc.config.load_one("repo")
      assert config["remote"][remote_name]["url"] == remote_url
      local_config = dvc.config.load_one("local")
      assert local_config["remote"][used_name]["url"] == another_url
  
imports: import errno
  import itertools
  import os
  import stat
  import configobj
  import pytest
  from dvc.cli import main
  from dvc.config import Config
  from dvc.exceptions import DownloadError, UploadError
  from dvc.utils.fs import remove
label_desc: Use image node_id 20 for calling a global function with example usage: test_remote_duplicated(dvc) without return types