code: def __getId(cls, test):
      try:
          test_id = test.id
      except AttributeError:
          return str(test)
      try:
          return test_id()
      except TypeError:
          return str(test_id)
      return repr(test)
  
imports: import functools
  import io
  import sys
  import time
  import traceback
  import unittest
  from test import support
label_desc: Use image node_id 2 for calling the RegressionTestResult obj's underlying member method code with example usage: obj.__getId(cls, test) and returns: repr, test_id, str, str