code: def _get_predictor(
      xs_train, ys_train, method, deg, span, seed, max_n
  ):
      if method == "lm":
          return _get_lm_predictor(xs_train, ys_train, deg)
      if method in ["loess", "lowess"]:
          return _get_loess_predictor(
              xs_train, ys_train, span, seed, max_n
          )
      if method == "none":
          return lambda xs: np.array([0] * xs.size)
      else:
          raise Exception("Unknown method '{0}'".format(method))
  
file_path: lets-plot/python-package/lets_plot/bistro/residual.py
imports: from ..plot.core import PlotSpec, aes
  from ..plot.geom import geom_hline
  from ..plot.label import ylab
  from ..plot.theme_ import *
  from ._plot2d_common import _get_bin_params_2d, _get_geom2d_layer, _get_marginal_layers
label_desc: Use image node_id 5 for calling a global function with example usage: _get_predictor(xs_train, ys_train, method, deg, span, seed, max_n) and returns: _get_lm_predictor, _get_loess_predictor, function