code: def test_enum_ivalue_type(self):
      class Color(Enum):
          RED = 1
          GREEN = 2
  
      make_global(Color)
  
      @torch.jit.script
      def is_color_enum(x: Any):
          return isinstance(x, Color)
  
      FileCheck().check(
          "prim::isinstance[types=[Enum<__torch__.jit.test_enum.Color>]]"
      ).check_next("return").run(str(is_color_enum.graph))
  
      self.assertEqual(is_color_enum(Color.RED), True)
      self.assertEqual(is_color_enum(Color.GREEN), True)
      self.assertEqual(is_color_enum(1), False)
  
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 9 for calling the TestEnum obj's underlying member method code with example usage: obj.test_enum_ivalue_type() and returns: isinstance