code: def _format_failed(self):
      if self.errors and self.failures:
          le = len(self.errors)
          lf = len(self.failures)
          error_s = "error" + ("s" if le > 1 else "")
          failure_s = "failure" + ("s" if lf > 1 else "")
          return f"{self.test_name} failed ({le} {error_s}, {lf} {failure_s})"
  
      if self.errors:
          le = len(self.errors)
          error_s = "error" + ("s" if le > 1 else "")
          return f"{self.test_name} failed ({le} {error_s})"
  
      if self.failures:
          lf = len(self.failures)
          failure_s = "failure" + ("s" if lf > 1 else "")
          return f"{self.test_name} failed ({lf} {failure_s})"
  
      return f"{self.test_name} failed"
  
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 2 for calling the TestResult obj's underlying member method code with example usage: obj._format_failed() and returns: self, str, self, str, le, str, error_s, str, lf, str, failure_s, str, self, str, le, str, error_s, str, self, str, lf, str, failure_s, str