code: def prepare_data(
      model: LudwigModel,
      inputs_df: pd.DataFrame,
      sample_df: pd.DataFrame,
      target: str,
  ):
      config = model.config
      feature_cols = [
          feature[COLUMN] for feature in config[INPUT_FEATURES]
      ]
      if SPLIT in config.get(PREPROCESSING, {}):
          # Keep columns required for Ludwig preprocessing
          splitter = get_splitter(**config[PREPROCESSING][SPLIT])
          feature_cols += splitter.required_columns
      target_feature_name = get_feature_name(model, target)
  
      inputs_df = filter_cols(inputs_df, feature_cols)
      if sample_df is not None:
          sample_df = filter_cols(sample_df, feature_cols)
  
      return inputs_df, sample_df, feature_cols, target_feature_name
  
file_path: ludwig/ludwig/explain/util.py
imports: from copy import deepcopy
  import pandas
  import torch
  from ludwig.api import LudwigModel
  from ludwig.constants import COLUMN, INPUT_FEATURES, PREPROCESSING, SPLIT
  from ludwig.data.split import get_splitter
  from ludwig.features.base_feature import BaseFeature
label_desc: Use image node_id 2 for calling a global function with example usage: prepare_data(model, inputs_df, sample_df, target) and returns: inputs_df,  sample_df,  feature_cols,  target_feature_name