code: def default(self, o: Any) -> dict[str, Any]:
      if isinstance(o, TestResult):
          result = dataclasses.asdict(o)
          result["__test_result__"] = o.__class__.__name__
          return result
      else:
          return super().default(o)
  
imports: import dataclasses
  import json
  from typing import Any
  from .utils import StrJSON, TestName, FilterTuple, format_duration, normalize_test_name, print_warning
label_desc: Use image node_id 1 for calling the _EncodeTestResult obj's underlying member method code with example usage: obj.default(o) and returns: result, super