code: def pytest_report_from_serializable(data):
      if "_report_type" in data:
          if data["_report_type"] == "TestReport":
              return TestReport._from_json(data)
          elif data["_report_type"] == "CollectReport":
              return CollectReport._from_json(data)
          assert (
              False
          ), "Unknown report_type unserialize data: {}".format(
              data["_report_type"]
          )
  
imports: from pprint import pprint
  import py
  import six
  from _pytest._code.code import ExceptionInfo
  from _pytest._code.code import ReprEntry
  from _pytest._code.code import ReprEntryNative
  from _pytest._code.code import ReprExceptionInfo
  from _pytest._code.code import ReprFileLocation
  from _pytest._code.code import ReprFuncArgs
  from _pytest._code.code import ReprLocals
  from _pytest._code.code import ReprTraceback
  from _pytest._code.code import TerminalRepr
  from _pytest.outcomes import skip
  from _pytest.pathlib import Path
label_desc: Use image node_id 4 for calling a global function with example usage: pytest_report_from_serializable(data) and returns: TestReport, CollectReport