code: def _get_inverse_funcs(estimator, terminal=True):
      """Retrieve the inverse functions of an pipeline or an estimator."""
      inverse_func = [False]
      if hasattr(estimator, "steps"):
          # if pipeline, retrieve all steps by nesting
          inverse_func = list()
          for _, est in estimator.steps:
              inverse_func.extend(
                  _get_inverse_funcs(est, terminal=False)
              )
      elif hasattr(estimator, "inverse_transform"):
          # if not pipeline attempt to retrieve inverse function
          inverse_func = [estimator.inverse_transform]
  
      # If terminal node, check that that the last estimator is a classifier,
      # and remove it from the transformers.
      if terminal:
          last_is_estimator = inverse_func[-1] is False
          all_invertible = False not in inverse_func[:-1]
          if last_is_estimator and all_invertible:
              # keep all inverse transformation and remove last estimation
              inverse_func = inverse_func[:-1]
          else:
              inverse_func = list()
  
      return inverse_func
  
imports: import datetime
  import numbers
  import numpy
  from ..fixes import BaseEstimator, _check_fit_params, _get_check_scoring
  from ..parallel import parallel_func
  from ..utils import verbose, warn
label_desc: Use image node_id 3 for calling a global function with example usage: _get_inverse_funcs(estimator, terminal) and returns: inverse_func