code: def test_get_unused_links(tmp_dir, dvc):
      tmp_dir.dvc_gen({"foo": "foo_content", "bar": "bar_content"})
  
      links = [
          os.path.join(dvc.root_dir, link) for link in ["foo", "bar"]
      ]
      assert set(dvc.state.get_unused_links([], dvc.fs)) == {
          "foo",
          "bar",
      }
      assert set(dvc.state.get_unused_links(links[:1], dvc.fs)) == {
          "bar"
      }
      assert set(dvc.state.get_unused_links(links, dvc.fs)) == set()
      assert set(
          dvc.state.get_unused_links(
              (
                  links[:1]
                  + [os.path.join(dvc.root_dir, "not-existing-file")]
              ),
              dvc.fs,
          )
      ) == {"bar"}
  
file_path: dvc/tests/func/test_state.py
imports: import os
  from dvc_data.hashfile.hash import file_md5
  from dvc_data.hashfile.hash_info import HashInfo
  from dvc_data.hashfile.state import State
label_desc: Use image node_id 5 for calling a global function with example usage: test_get_unused_links(tmp_dir, dvc) without return types