code: def validator(input_data):
      
      global data
      # check num dims
      if input_data.ndim != 2:
          return False, 'Data should have two dimensions.'
      # check number of columns
      if input_data.shape[1] != data.data.shape[1]:
          reason = '{} features required, {} features provided'.format(
              data.data.shape[1], input_data.shape[1])
          return False, reason
      # validation passed
      return True, None
docs: Simple model input validator.
  
      Validator ensures the input data array is
          - two dimensional
          - has the correct number of features.