code: def is_valid(self, model, validator=None):
      
      if self.property_name and self.is_property_specific:
        arg0 = getattr(model, self.property_name)
      else:
        arg0 = model
  
      if self.is_simple:
        is_valid = self.callback(arg0)
      else:
        is_valid = self.callback(arg0, validator)
  
      return (is_valid, None if is_valid else (self.message or "is invalid"))
docs: Returns true if the model passes the validation, and false if not. Validator must be
      present_optional if validation is not 'simple'.