code: def validate(cls, partial=True, **kwargs):
          
          data = kwargs
          if not partial:
              data = dict(**kwargs, **{col.name: None for col in cls.__table__.c
                                       if col.name not in kwargs})
  
          errors = defaultdict(list)
          for name, value in data.items():
              for validator in cls._get_validators(name):
                  try:
                      validator(value)
                  except ValidationError as e:
                      e.model = cls
                      e.column = name
                      errors[name].append(str(e))
  
          if errors:
              raise ValidationErrors(errors)
docs: Validate kwargs before setting attributes on the model