code: def _extract_final_feature_names(pipeline, features):
      """
      Computes the final features names of a :py:mod:`~sklearn.pipeline.Pipeline` used in its last
      component.
  
      Args:
          pipeline (sklearn.pipeline.Pipeline): A pipeline
          features (list): List of input features to the pipeline
  
      Returns:
          list: Features names used by the last component
  
      Note:
          This function depends on how the feature names in :py:mod:`sklearn` are handled. Any
          API-breaking change is likely to break this function.
      """
  
      pipeline_preprocessing = pipeline[:-1]
  
      # Extraction for feature_names in sklearn>=1.2.0
      if hasattr(pipeline_preprocessing, "get_feature_names_out"):
          return pipeline_preprocessing.get_feature_names_out(
              features
          ).tolist()
  
      # Extraction for feature_names in  sklearn<1.2.0
      for component in pipeline_preprocessing:
          if hasattr(component, "get_support"):
              features = [
                  f
                  for f, s in zip(features, component.get_support())
                  if s
              ]
          if hasattr(component, "get_feature_names"):
              features = component.get_feature_names(features)
      return features
  
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 6 for calling a global function with example usage: _extract_final_feature_names(pipeline, features) and returns: features, pipeline_preprocessing