'Either returns an existing member, or creates a new enum class.
This method is used both when an enum class is given a value to match
to an enumeration member (i.e. Color(3)) and for the functional API
(i.e. Color = Enum(\'Color\', names=\'red green blue\')).
When used for the functional API: `module`, if set, will be stored in
the new class\' __module__ attribute; `type`, if set, will be mixed in
as the first base class.
Note: if `module` is not set this routine will attempt to discover the
calling module by walking the frame stack; if this is unsuccessful
the resulting class will not be pickleable.'

def __call__(cls, value, names=None, module=None, type=None):

    if (names is None):
        return cls.__new__(cls, value)
    return cls._create_(value, names, module=module, type=type)
