code: def test_report_crash():
      with mock.patch(
          "pickle.dump", mock.MagicMock()
      ) as mock_pickle_dump:
          with mock.patch(
              "nipype.pipeline.plugins.tools.format_exception",
              mock.MagicMock(),
          ):  # see iss 1517
              mock_pickle_dump.return_value = True
              mock_node = mock.MagicMock(name="mock_node")
              mock_node._id = "an_id"
              mock_node.config = {
                  "execution": {
                      "crashdump_dir": ".",
                      "crashfile_format": "pklz",
                  }
              }
  
              actual_crashfile = report_crash(mock_node)
  
              expected_crashfile = re.compile(
                  r".*/crash-.*-an_id-[0-9a-f\-]*.pklz"
              )
  
              assert (
                  expected_crashfile.match(actual_crashfile).group()
                  == actual_crashfile
              )
              assert mock_pickle_dump.call_count == 1
  
imports: import numpy
  import scipy.sparse
  import re
  from unittest import mock
  from nipype.pipeline.plugins.tools import report_crash
label_desc: Use image node_id 1 for calling a global function with example usage: test_report_crash() without return types