code: def _final_estimator_has(attr):
      """Check that final_estimator has attribute `attr`.
  
      Used together with `available_if` in Pipeline.
  
      """
  
      def check(self):
          # Raise original `AttributeError` if `attr` does not exist
          getattr(self._final_estimator, attr)
          return True
  
      return check
  
imports: import platform
  import warnings
  from copy import deepcopy
  from inspect import signature
  import imblearn.pipeline
  import sklearn.pipeline
  from sklearn.base import clone
  from sklearn.utils import _print_elapsed_time
  from sklearn.utils.metaestimators import available_if
  from sklearn.utils.validation import check_memory
  from pycaret.utils._show_versions import _get_deps_info
  from pycaret.utils.generic import get_all_object_vars_and_properties, variable_return
label_desc: Use image node_id 2 for calling a global function with example usage: _final_estimator_has(attr) and returns: check, True