code: def test_enum_iterate(self):
      class Color(Enum):
          RED = 1
          GREEN = 2
          BLUE = 3
  
      def iterate_enum(x: Color):
          res: List[int] = []
          for e in Color:
              if e != x:
                  res.append(e.value)
          return res
  
      make_global(Color)
      scripted = torch.jit.script(iterate_enum)
  
      FileCheck().check(
          "Enum<__torch__.jit.test_enum.Color>[]"
      ).check_same("Color.RED").check_same("Color.GREEN").check_same(
          "Color.BLUE"
      ).run(
          str(scripted.graph)
      )
  
      # PURPLE always appears last because we follow Python's Enum definition order.
      self.assertEqual(
          scripted(Color.RED), [Color.GREEN.value, Color.BLUE.value]
      )
      self.assertEqual(
          scripted(Color.GREEN), [Color.RED.value, Color.BLUE.value]
      )
  
imports: import os
  import sys
  import torch
  from torch.testing import FileCheck
  from enum import Enum
  from typing import Any, List
  from torch.testing._internal.jit_utils import JitTestCase, make_global
label_desc: Use image node_id 15 for calling the TestEnum obj's underlying member method code with example usage: obj.test_enum_iterate() and returns: res