code: def test_sort_stats_enum(self):
      for member in SortKey:
          self.stats.sort_stats(member)
          self.assertEqual(
              self.stats.sort_type,
              self.stats.sort_arg_dict_default[member.value][-1],
          )
  
      class CheckedSortKey(StrEnum):
          CALLS = "calls", "ncalls"
          CUMULATIVE = "cumulative", "cumtime"
          FILENAME = "filename", "module"
          LINE = "line"
          NAME = "name"
          NFL = "nfl"
          PCALLS = "pcalls"
          STDNAME = "stdname"
          TIME = "time", "tottime"
  
          def __new__(cls, *values):
              value = values[0]
              obj = str.__new__(cls, value)
              obj._value_ = value
              for other_value in values[1:]:
                  cls._value2member_map_[other_value] = obj
              obj._all_values = values
              return obj
  
      _test_simple_enum(CheckedSortKey, SortKey)
  
imports: import unittest
  from test import support
  from io import StringIO
  from pstats import SortKey
  from enum import StrEnum, _test_simple_enum
  import os
  import pstats
  import tempfile
  import cProfile
label_desc: Use image node_id 9 for calling the StatsTestCase obj's underlying member method code with example usage: obj.test_sort_stats_enum() and returns: obj