code: def get_eval_func(
      obj: ExpectationObject,
      inducing_variable: Optional[InducingVariables],
      slice: Union[slice, EllipsisType, None] = None,
  ) -> Callable[[TensorType], tf.Tensor]:
      """
      Return the function of interest (kernel or mean) for the expectation
      depending on the type of :obj: and whether any inducing are given
      """
  
      slice = ... if slice is None else slice
      if inducing_variable is not None:
          # kernel + inducing_variable combination
          if not isinstance(
              inducing_variable, InducingVariables
          ) or not isinstance(obj, kernels.Kernel):
              raise TypeError(
                  "If `inducing_variable` is supplied, `obj` must be a kernel."
              )
          return lambda x: tf.transpose(Kuf(inducing_variable, obj, x))[
              slice
          ]
      elif isinstance(obj, mfn.MeanFunction):
          return lambda x: obj(x)[slice]  # type: ignore[misc]
      elif isinstance(obj, kernels.Kernel):
          return lambda x: obj(x, full_cov=False)  # type: ignore[call-arg, misc]
  
      raise NotImplementedError()
  
file_path: GPflow/gpflow/expectations/quadratures.py
imports: from typing import Any, Callable, Optional, Type, Union, cast
  import numpy
  import tensorflow
  from check_shapes import check_shapes
  from ..None import kernels
  from ..None import mean_functions
  from ..base import TensorType
  from ..covariances import Kuf
  from ..inducing_variables import InducingVariables
  from ..probability_distributions import DiagonalGaussian, Gaussian, MarkovGaussian
  from ..quadrature import mvnquad
  from .None import dispatch
  from .expectations import ExpectationObject, PackedExpectationObject, quadrature_expectation
label_desc: Use image node_id 1 for calling a global function with example usage: get_eval_func(obj, inducing_variable, slice) and returns: function, function, function