code: def test_closed_over_enum_constant(self):
      class Color(Enum):
          RED = 1
          GREEN = 2
  
      a = Color
  
      @torch.jit.script
      def closed_over_aliased_type():
          return a.RED.value
  
      FileCheck().check(
          "prim::Constant[value={}]".format(a.RED.value)
      ).check_next("return").run(str(closed_over_aliased_type.graph))
  
      self.assertEqual(closed_over_aliased_type(), Color.RED.value)
  
      b = Color.RED
  
      @torch.jit.script
      def closed_over_aliased_value():
          return b.value
  
      FileCheck().check(
          "prim::Constant[value={}]".format(b.value)
      ).check_next("return").run(str(closed_over_aliased_value.graph))
  
      self.assertEqual(closed_over_aliased_value(), Color.RED.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 10 for calling the TestEnum obj's underlying member method code with example usage: obj.test_closed_over_enum_constant() and returns: a, b