def _check_enum(parameter_name, value, parameter_config):
enum_values = [enum['<STR_LIT>']<EOL>for enum in parameter_config['<STR_LIT>'].values()<EOL>if '<STR_LIT>' in enum]<EOL>if value not in enum_values:<EOL><INDENT>raise errors.EnumRejectionError(parameter_name, value, enum_values)<EOL><DEDENT>
Checks if an enum value is valid.

    This is called by the transform_parameter_value function and shouldn't be
    called directly.

    This verifies that the value of an enum parameter is valid.

    Args:
      parameter_name: A string containing the name of the parameter, which is
        either just a variable name or the name with the index appended. For
        example 'var' or 'var[2]'.
      value: A string containing the value passed in for the parameter.
      parameter_config: The dictionary containing information specific to the
        parameter in question. This is retrieved from request.parameters in
        the method config.

    Raises:
      EnumRejectionError: If the given value is not among the accepted
        enum values in the field parameter.