code: def test_remove_default(tmp_dir, dvc):
      remote = "mys3"
      assert (
          main(
              ["remote", "add", "--default", remote, "s3://bucket/name"]
          )
          == 0
      )
      assert (
          main(["remote", "modify", remote, "profile", "default"]) == 0
      )
      assert main(["config", "--local", "core.remote", remote]) == 0
  
      config = configobj.ConfigObj(dvc.config.files["repo"])
      local_config = configobj.ConfigObj(dvc.config.files["local"])
      assert config["core"]["remote"] == remote
      assert local_config["core"]["remote"] == remote
  
      assert main(["remote", "remove", remote]) == 0
  
      config = configobj.ConfigObj(dvc.config.files["repo"])
      local_config = configobj.ConfigObj(dvc.config.files["local"])
      assert config.get("core", {}).get("remote") is None
      assert local_config.get("core", {}).get("remote") is None
  
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 5 for calling a global function with example usage: test_remove_default(tmp_dir, dvc) without return types