'Validate value against possible values.
The default implementation checks the value against self.valid_values
if it was defined.
Args:
value: The value to validate.'

def validate(self, value):

    self._basic_validation(value)
    if (not value):
        return
    if (self.valid_values is not None):
        if (value not in self.valid_values):
            raise configexc.ValidationError(value, 'valid    values:    {}'.format(',    '.join(self.valid_values)))
    else:
        raise NotImplementedError('{}    does    not    implement    validate.'.format(self.__class__.__name__))
