def _create_(cls, class_name, names=None, module=None, type=None):
metacls = cls.__class__<EOL>if type is None:<EOL><INDENT>bases = (cls, )<EOL><DEDENT>else:<EOL><INDENT>bases = (type, cls)<EOL><DEDENT>classdict = metacls.__prepare__(class_name, bases)<EOL>__order__ = []<EOL>if isinstance(names, basestring):<EOL><INDENT>names = names.replace('<STR_LIT:U+002C>', '<STR_LIT:U+0020>').split()<EOL><DEDENT>if isinstance(names, (tuple, list)) and isinstance(names[<NUM_LIT:0>], basestring):<EOL><INDENT>names = [(e, i+<NUM_LIT:1>) for (i, e) in enumerate(names)]<EOL><DEDENT>for item in names:<EOL><INDENT>if isinstance(item, basestring):<EOL><INDENT>member_name, member_value = item, names[item]<EOL><DEDENT>else:<EOL><INDENT>member_name, member_value = item<EOL><DEDENT>classdict[member_name] = member_value<EOL>__order__.append(member_name)<EOL><DEDENT>if not isinstance(item, basestring):<EOL><INDENT>classdict['<STR_LIT>'] = '<STR_LIT:U+0020>'.join(__order__)<EOL><DEDENT>enum_class = metacls.__new__(metacls, class_name, bases, classdict)<EOL>if module is None:<EOL><INDENT>try:<EOL><INDENT>module = _sys._getframe(<NUM_LIT:2>).f_globals['<STR_LIT>']<EOL><DEDENT>except (AttributeError, ValueError):<EOL><INDENT>pass<EOL><DEDENT><DEDENT>if module is None:<EOL><INDENT>_make_class_unpicklable(enum_class)<EOL><DEDENT>else:<EOL><INDENT>enum_class.__module__ = module<EOL><DEDENT>return enum_class<EOL>
Convenience method to create a new Enum class.

        `names` can be:

        * A string containing member names, separated either with spaces or
          commas.  Values are auto-numbered from 1.
        * An iterable of member names.  Values are auto-numbered from 1.
        * An iterable of (member name, value) pairs.
        * A mapping of member name -> value.