EnumFactory.create(*type_parameters) expects:
        enumeration name, (enumeration values)
342318
def create(type_dict, *type_parameters):
    
    name, values = type_parameters
    assert isinstance(values, (list, tuple))
    for value in values:
      assert isinstance(value, Compatibility.stringy)
    return TypeMetaclass(str(name), (EnumContainer,), { 'VALUES': values })
620385
public static Type[] getEnvironmentRepositoryFactoryTypeParams(
			ConfigurableListableBeanFactory beanFactory, String factoryName) {
		MethodMetadata methodMetadata = (MethodMetadata) beanFactory
				.getBeanDefinition(factoryName).getSource();
		Class<?> factoryClass = null;
		try {
			factoryClass = Class.forName(methodMetadata.getReturnTypeName());
		}
		catch (ClassNotFoundException e) {
			throw new IllegalStateException(e);
		}
		Optional<AnnotatedType> annotatedFactoryType = Arrays
				.stream(factoryClass.getAnnotatedInterfaces()).filter(i -> {
					ParameterizedType parameterizedType = (ParameterizedType) i.getType();
					return parameterizedType.getRawType()
							.equals(EnvironmentRepositoryFactory.class);
				}).findFirst();
		ParameterizedType factoryParameterizedType = (ParameterizedType) annotatedFactoryType
				.orElse(factoryClass.getAnnotatedSuperclass()).getType();
		return factoryParameterizedType.getActualTypeArguments();
	}
359274
public static function create()
	{
		switch (func_num_args()) {
			case 0:
				return new EnumOptions();
			case 1:
				return new EnumOptions(func_get_arg(0));
			case 2:
				return new EnumOptions(func_get_arg(0), func_get_arg(1));
			case 3:
				return new EnumOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2));
			case 4:
				return new EnumOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3));
			case 5:
				return new EnumOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4));
			case 6:
				return new EnumOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5));
			case 7:
				return new EnumOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6));
			case 8:
				return new EnumOptions(func_get_arg(0), func_get_arg(1), func_get_arg(2), func_get_arg(3), func_get_arg(4), func_get_arg(5), func_get_arg(6), func_get_arg(7));
			default:
				throw new \InvalidArgumentException('More than 8 arguments supplied, please be reasonable.');
		}
	}
1055148
def parse_enum(type_name, body, name):
    '''
    '''
    type_name, name = type_name.strip(), name.strip()
    lines = [l.strip(' ,') for l in body.splitlines() if l.strip(', ')]
    members = []

    for line in lines:
        vals = [v.strip() for v in line.split('=')]
        if len(vals) == 1:
            members.append(EnumMemberSpec(vals[0], ''))
        else:
            members.append(EnumMemberSpec(*vals))

    return EnumSpec(type_name, [n.strip() for n in name.split(',')], members)
1026761
def _handle_enum(self, node, scope, ctxt, stream):
        
        self._dlog("handling enum")
        if node.type is None:
            enum_cls = fields.Int
        else:
            enum_cls = self._handle_node(node.type, scope, ctxt, stream)

        enum_vals = {}
        curr_val = enum_cls()
        curr_val._pfp__value = -1
        for enumerator in node.values.enumerators:
            if enumerator.value is not None:
                curr_val = self._handle_node(enumerator.value, scope, ctxt, stream)
            else:
                curr_val = curr_val + 1
            curr_val._pfp__freeze()
            enum_vals[enumerator.name] = curr_val
            enum_vals[fields.PYVAL(curr_val)] = enumerator.name
            scope.add_local(enumerator.name, curr_val)

        if node.name is not None:
            enum_cls = EnumDef(node.name, enum_cls, enum_vals)
            scope.add_type_class(node.name, enum_cls)

        else:
            enum_cls = EnumDef("enum_" + enum_cls.__name__, enum_cls, enum_vals)
            # don't add to scope if we don't have a name

        return enum_cls
299347
protected void _generate(SarlEnumeration enumeration, IExtraLanguageGeneratorContext context) {
		final JvmDeclaredType jvmType = getJvmModelAssociations().getInferredType(enumeration);
		final PyAppendable appendable = createAppendable(jvmType, context);
		if (generateEnumerationDeclaration(enumeration, appendable, context)) {
			final QualifiedName name = getQualifiedNameProvider().getFullyQualifiedName(enumeration);
			writeFile(name, appendable, context);
		}
	}
571403
private List<Enum> getSelectableEnumsList(FormModel formModel,
			String formPropertyPath, Map context) {
		List<Enum> out = new ArrayList<Enum>();
		Boolean nullable;
		if (context.containsKey(NULLABLE_KEY)) {
			nullable = (Boolean) context.get(NULLABLE_KEY);
		} else {
			nullable = this.nullable;
		}
		if (nullable) {
			out.add(null);
		}
		for (Enum e : ((Class<Enum>) getPropertyType(formModel,
				formPropertyPath)).getEnumConstants()) {
			out.add(e);
		}
		return out;
	}
77314
def create_enum_subset(enum_type, help_string=NO_HELP, default=NO_DEFAULT):
        # type: (Type[Enum], str, EnumSubset) -> EnumSubset
        
        # noinspection PyTypeChecker
        return ParamEnumSubset(
            help_string=help_string,
            default=default,
            enum_type=enum_type,
        )
233060
private static function createEnumFilter(Endpoint $endpoint, FieldDefinition $field, string $enumName, array $enumValues): Filter
    {
        $name = "{$enumName}ComparisonExpression";
        if ($endpoint->hasType($name)) {
            $condition = $endpoint->getType($name);
        } else {
            /** @var InputObjectDefinition $condition */
            $condition = unserialize(serialize($endpoint->getType(EnumComparisonExpression::class)), ['allowed_classes' => true]);
            $condition->setName($name);
            $condition->getField('values')->setType($enumName)->setList(true);
            $description = $condition->getDescription();
            $description = str_replace('\'{VALUE_1}\'', array_values($enumValues)[0], $description);
            if (isset(array_values($enumValues)[1])) {
                $description = str_replace('\'{VALUE_2}\'', array_values($enumValues)[1], $description);
            } else {
                $description = str_replace(', \'{VALUE_2}\'', null, $description);
            }
            $condition->setDescription($description);
            $endpoint->add($condition);
        }
        $filter = new Filter();
        $filter->name = $filter->field = $field->getName();
        $filter->resolver = EnumFilter::class;
        $filter->type = $condition->getName();

        return $filter;
    }
518702
private static Map<String, Object> getEnumNamesMap(Class<? extends Enum<?>> enumType) {
		final String sourceMethod = "getEnumNameMap"; //$NON-NLS-1$
		final boolean isTraceLogging = log.isLoggable(Level.FINER);
		if (isTraceLogging) {
			log.entering(sourceClass, sourceMethod, new Object[]{enumType});
		}
		Map<String, Object> result = new HashMap<String, Object>();
		Enum<?>[] values = enumType.getEnumConstants();
		for (Enum<?> value : values) {
			result.put(value.name(), value);
		}
		if (isTraceLogging) {
			log.exiting(sourceMethod, sourceMethod, result);
		}
		return result;
	}
237373
public static EnumConstantBuilder getInstance(Context context,
            TypeElement typeElement, EnumConstantWriter writer) {
        return new EnumConstantBuilder(context, typeElement, writer);
    }
1063019
private static <T> T[] newEnumMap(Class<?> elementType,
                                      Function<SessionProtocol, T> factory,
                                      SessionProtocol... allowedProtocols) {
        @SuppressWarnings("unchecked")
        final T[] maps = (T[]) Array.newInstance(elementType, SessionProtocol.values().length);
        // Attempting to access the array with an unallowed protocol will trigger NPE,
        // which will help us find a bug.
        for (SessionProtocol p : allowedProtocols) {
            maps[p.ordinal()] = factory.apply(p);
        }
        return maps;
    }
1304677
@Override
    public Object create(ActionParameter argument, Context context, ParameterFactories engine) {
        Object object = createNewInstance(argument.getRawType(), context, engine);

        for (Method method : argument.getRawType().getMethods()) {
            if (method.getName().startsWith(SETTER_PREFIX)) {
                if (method.getParameterTypes().length != 1) {
                    LOGGER.warn("The class {} has a setter method called {} but with too many parameters to be " +
                                    "injected with the 'BeanParameter' annotation", argument.getRawType().getName(),
                            method.getName());
                    continue;
                }

                // Only 1 parameter
                Annotation[] annotation = method.getParameterAnnotations()[0];
                Class<?> typesOfParameter = method.getParameterTypes()[0];
                Type genericTypeOfParameter = method.getGenericParameterTypes()[0];
                ActionParameter parameter = ActionParameter.from(method, annotation, typesOfParameter,
                        genericTypeOfParameter);
                // An exception is thrown if we can't build the parameter object.
                Object value = Bindings.create(parameter, context, engine);
                if (value != null) {
                    inject(object, method, value);
                }
            }
        }
        return object;
    }
750465
function createFactory(type) {
    const ret = createElement.bind(null, type);
    ret.type = type;

    return ret;
}
1106792
void compile() {
    TypeInfo factoryType = innerClasses.registerInnerClass(FACTORY_CLASS, FACTORY_ACCESS);
    SoyClassWriter cw =
        SoyClassWriter.builder(factoryType)
            .implementing(FACTORY_TYPE)
            .setAccess(FACTORY_ACCESS)
            .sourceFileName(templateNode.getSourceLocation().getFileName())
            .build();
    innerClasses.registerAsInnerClass(cw, factoryType);

    generateStaticInitializer(cw);
    defineDefaultConstructor(cw, factoryType);
    generateCreateMethod(cw, factoryType);
    cw.visitEnd();
    innerClasses.add(cw.toClassData());
  }
877865
private final void setTypeSerializerFactory(TypeSerializerFactory<?> factory, 
			String classNameKey, String parametersPrefix)
	{
		// sanity check the factory type
		InstantiationUtil.checkForInstantiation(factory.getClass());
		
		// store the type
		this.config.setString(classNameKey, factory.getClass().getName());
		// store the parameters
		final DelegatingConfiguration parameters = new DelegatingConfiguration(this.config, parametersPrefix);
		factory.writeParametersToConfig(parameters);
	}
244085
def enums(*names):
    
    if len(names) != len(list(set(names))):
        raise TypeError("Names in an enumeration must be unique")

    item_types = set(True if isinstance(x, tuple) else False for x in names)
    if len(item_types) == 2:
        raise TypeError("Mixing of ordered and unordered enumeration items is not allowed")
    else:
        is_ordered = item_types.pop() is True
        if not is_ordered:
            names = [(None, x) for x in names]
        return [EnumValue(name, order) for order, name in names]