code: def apply_func_to_columns(row_func, cols):
      """Returns a function that applies ``row_func`` to
      the selected ``cols``. Helper function for
      `~greykite.framework.output.univariate_forecast.UnivariateForecast.autocomplete_map_func_dict`.
  
      Parameters
      ----------
      row_func : callable
          A function.
      cols : `list` [`str` or `int`]
          Names of the columns (or dictionary keys, list indices)
          to pass to ``row_func``.
  
      Returns
      -------
      new_func : callable
          Takes ``row`` and returns the result of ``row_func``
          applied to the selected values ``row[col]``.
      """
  
      def new_func(row):
          return row_func(*[row[col] for col in cols])
  
      return new_func
  
imports: import copy
  import dataclasses
  import functools
  import math
  import re
  import warnings
  from dataclasses import field
  from typing import List
  import numpy
  import pandas
  from pandas.testing import assert_frame_equal
  from pandas.testing import assert_index_equal
  from pandas.testing import assert_series_equal
label_desc: Use image node_id 12 for calling a global function with example usage: apply_func_to_columns(row_func, cols) and returns: new_func, row_func