code: def from_unittest(result):
      return TestStats(
          result.testsRun, len(result.failures), len(result.skipped)
      )
  
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 TestStats obj's underlying member method code with example usage: obj.from_unittest(result) and returns: TestStats