code: def test_json_output_match(capsys, tmpdir):
      # GH39701
      pd.show_versions(as_json=True)
      result_console = capsys.readouterr().out
  
      out_path = os.path.join(tmpdir, "test_json.json")
      pd.show_versions(as_json=out_path)
      with open(out_path, encoding="utf-8") as out_fd:
          result_file = out_fd.read()
  
      assert result_console == result_file
  
file_path: pandas/pandas/tests/util/test_show_versions.py
imports: import json
  import os
  import re
  from pandas.util._print_versions import _get_dependency_info, _get_sys_info
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: test_json_output_match(capsys, tmpdir) without return types