code: def validate(cls, data, name, **kwargs):
          
          required = kwargs.get('required', False)
          if required and data is None:
              raise ValidationError("required", name, True)
          elif data is None:
              return
          elif kwargs.get('readonly'):
              return
  
          try:
              for key, value in kwargs.items():
                  validator = cls.validation.get(key, lambda x, y: False)
                  if validator(data, value):
                      raise ValidationError(key, name, value)
          except TypeError:
              raise ValidationError("unknown", name, "unknown")
          else:
              return data
docs: Validate that a piece of data meets certain conditions