code: def test_log_changes(capsys):
      stats = {
          "added": ["file1", "dir1/"],
          "deleted": ["dir2/"],
          "modified": ["file2"],
      }
  
      from itertools import zip_longest
  
      def _assert_output(stats, expected_outs):
          log_changes(stats)
          out, _ = capsys.readouterr()
          actual_output = out.splitlines()
          for out, line in zip_longest(expected_outs, actual_output):
              assert out.expandtabs() in line
  
      _assert_output(
          stats, ["M\tfile2", "A\tfile1", "A\tdir1/", "D\tdir2/"]
      )
  
      del stats["deleted"][0]
      _assert_output(stats, ["M\tfile2", "A\tfile1", "A\tdir1/"])
  
      del stats["modified"]
      _assert_output(stats, ["A\tfile1", "A\tdir1/"])
  
label_desc: Use image node_id 2 for calling a global function with example usage: test_log_changes(capsys) without return types