def METHOD_NAME(estimator,
                   serving_input_receiver_fn,
                   output_key=None,
                   graph=None,
                   config=None):
  """Constructs a `Predictor` from a `tf.python.estimator.Estimator`.
  Args:
    estimator: an instance of `learn.python.estimator.Estimator`.
    serving_input_receiver_fn: a function that takes no arguments and returns
      an instance of `ServingInputReceiver` compatible with `estimator`.
    output_key: Optional string specifying the export output to use. If
      `None`, then `DEFAULT_SERVING_SIGNATURE_DEF_KEY` is used.
    graph: Optional. The Tensorflow `graph` in which prediction should be
      done.
    config: `ConfigProto` proto used to configure the session.
  Returns:
    An initialized `Predictor`.
  Raises:
    TypeError: if `estimator` is a contrib `Estimator` instead of a core
      `Estimator`.
  """
  if isinstance(estimator, contrib_estimator.Estimator):
    raise TypeError('Expected estimator to be of type '
                    'tf.python.estimator.Estimator, but got type '
                    'tf.contrib.learn.Estimator. You likely want to call '
                    'from_contrib_estimator.')
  return core_estimator_predictor.CoreEstimatorPredictor(
      estimator,
      serving_input_receiver_fn,
      output_key=output_key,
      graph=graph,
      config=config)