code: def test_remove_broken_symlink(tmp_dir, dvc):
      tmp_dir.gen("foo", "foo")
      dvc.cache.local.cache_types = ["symlink"]
  
      (stage,) = dvc.add("foo")
      remove(dvc.cache.local.path)
      assert system.is_symlink("foo")
  
      with pytest.raises(ObjectDBError):
          dvc.remove(stage.addressing)
      assert os.path.lexists("foo")
      assert (tmp_dir / stage.relpath).exists()
  
      dvc.remove(stage.addressing, outs=True)
      assert not os.path.lexists("foo")
      assert not (tmp_dir / stage.relpath).exists()
  
file_path: dvc/tests/func/test_remove.py
imports: import os
  import pytest
  from dvc.cli import main
  from dvc.fs import system
  from dvc.stage.exceptions import StageFileDoesNotExistError, StageFileIsNotDvcFileError
  from dvc.utils.fs import remove
  from dvc_objects.errors import ObjectDBError
  from tests.utils import get_gitignore_content
label_desc: Use image node_id 4 for calling a global function with example usage: test_remove_broken_symlink(tmp_dir, dvc) without return types