def __init__(self, choices, **kwargs):
is_cls = inspect.isclass(choices)<EOL>if is_cls:<EOL><INDENT>self.enum_cls = choices<EOL><DEDENT>else:<EOL><INDENT>assert choices, '<STR_LIT>'<EOL>self.enum_cls = choices[<NUM_LIT:0>].__class__<EOL><DEDENT>return super(Enum, self).__init__(choices, **kwargs)<EOL>
Initialize the Enum field.

        The `choices` param can be either:
        * an enum.Enum class (in which case all of its values will become
          valid choices),
        * a list containing a subset of the enum's choices (e.g.
          `[SomeEnumCls.OptionA, SomeEnumCls.OptionB]`). You must provide
          more than one choice in this list and *all* of the choices must
          belong to the same enum class.