code: def set_estimator_and_feature_spec(self, estimator, feature_spec):
      
      # If custom function is set, remove it before setting estimator
      self.delete('custom_predict_fn')
  
      self.store('estimator_and_spec', {
        'estimator': estimator, 'feature_spec': feature_spec})
      self.set_inference_address('estimator')
      # If no model name has been set, give a default
      if not self.has_model_name():
        self.set_model_name('1')
      return self
docs: Sets the model for inference as a TF Estimator.
  
      Instead of using TF Serving to host a model for WIT to query, WIT can
      directly use a TF Estimator object as the model to query. In order to
      accomplish this, a feature_spec must also be provided to parse the
      example protos for input into the estimator.
  
      Args:
        estimator: The TF Estimator which will be used for model inference.
        feature_spec: The feature_spec object which will be used for example
        parsing.
  
      Returns:
        self, in order to enabled method chaining.