code: def extract_params_from_pipeline(pipeline, X_train, feature_names):
      """
      Extracts necessary parameters from an :py:class:`sklearn.pipeline.Pipeline` to pass into
      :py:class:`dtreeviz.models.sklearn_decision_trees.ShadowSKDTree`.
  
      Args:
          pipeline (sklearn.pipeline.Pipeline): An SKlearn pipeline whose last component is a decision tree model.
          X_train (numpy.ndarray): The (X)-input data on which the pipeline was fitted on.
          feature_names (list): List of names of the features in `X_train`.
  
      Returns:
          tuple: Tuple consisting of the tree model, the transformed input data, and a list of feature
          names used by the model.
      """
      # Pick last element of pipeline
      tree_model = pipeline.steps[-1][1]
  
      feature_names = _extract_final_feature_names(
          pipeline=pipeline, features=feature_names
      )
  
      X_train = pd.DataFrame(
          data=pipeline[:-1].transform(X_train), columns=feature_names
      )
      return tree_model, X_train, feature_names
  
imports: import os
  import re
  import tempfile
  import warnings
  import xml.etree.cElementTree
  from pathlib import Path
  from sys import platform
  import graphviz
  import numpy
  import pandas
  from matplotlib import patches
  from numpy import ndarray
  from numbers import Number
  from typing import Tuple, Sequence
label_desc: Use image node_id 8 for calling a global function with example usage: extract_params_from_pipeline(pipeline, X_train, feature_names) and returns: tree_model,  X_train,  feature_names