def validate(self, str_in):
        # type: (Text) -> None
        """ Validates an entry in the field.

            Raises `InvalidEntryError` iff the entry is invalid.

            An entry is invalid iff it is not one of the permitted
            values.

            :param str str_in: String to validate.
            :raises InvalidEntryError: When entry is invalid.
        """
        if self.is_missing_value(str_in):
            return
        # noinspection PyCompatibility
        super().validate(str_in)

        if str_in not in self.values:
            msg = ("Expected enum value to be one of {}. Read '{}'."
                   .format(list(self.values), str_in))
            e = InvalidEntryError(msg)
            e.field_spec = self
            raise e
def validate ( self , str_in ) : if self . is_missing_value ( str_in ) : return super ( ) . validate ( str_in ) if str_in not in self . values : msg = ( "Expected enum value to be one of {}. Read '{}'." . format ( list ( self . values ) , str_in ) ) e = InvalidEntryError ( msg ) e . field_spec = self raise e
Validates an entry in the field.

            Raises `InvalidEntryError` iff the entry is invalid.

            An entry is invalid iff it is not one of the permitted
            values.

            :param str str_in: String to validate.
            :raises InvalidEntryError: When entry is invalid.