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