code: def display_dist(
      train_column: pd.Series,
      test_column: pd.Series,
      fi: pd.Series,
      cat_features: Container[str],
      max_num_categories: int,
      show_categories_by: str,
      dataset_names: Tuple[str] = DEFAULT_DATASET_NAMES,
  ):
      """Create a distribution comparison plot for the given columns."""
      column_name = train_column.name or ""
      column_fi = fi.loc[column_name]
      title = f"Feature: {column_name} - Explains {format_percent(column_fi)} of dataset difference"
  
      (
          dist_traces,
          xaxis_layout,
          yaxis_layout,
      ) = feature_distribution_traces(
          train_column.dropna(),
          test_column.dropna(),
          column_name,
          is_categorical=column_name in cat_features,
          max_num_categories=max_num_categories,
          show_categories_by=show_categories_by,
          dataset_names=dataset_names,
      )
  
      fig = go.Figure()
      fig.add_traces(dist_traces)
  
      return fig.update_layout(
          go.Layout(
              title=title,
              xaxis=xaxis_layout,
              yaxis=yaxis_layout,
              legend=dict(
                  title="Dataset", yanchor="top", y=0.9, xanchor="left"
              ),
              height=300,
          )
      )
  
imports: import warnings
  from typing import Container, List, Tuple
  import pandas
  import plotly.graph_objects
  from sklearn.ensemble import HistGradientBoostingClassifier
  from sklearn.metrics import roc_auc_score
  from sklearn.model_selection import train_test_split
  from sklearn.preprocessing import OrdinalEncoder
  from deepchecks.tabular import Dataset
  from deepchecks.tabular.utils.feature_importance import N_TOP_MESSAGE, calculate_feature_importance_or_none
  from deepchecks.tabular.utils.task_type import TaskType
  from deepchecks.utils.dataframes import floatify_dataframe
  from deepchecks.utils.distribution.drift import get_drift_plot_sidenote
  from deepchecks.utils.distribution.plot import drift_score_bar_traces, feature_distribution_traces
  from deepchecks.utils.distribution.rare_category_encoder import RareCategoryEncoder
  from deepchecks.utils.plot import DEFAULT_DATASET_NAMES
  from deepchecks.utils.strings import format_percent
  from deepchecks.utils.typing import Hashable
label_desc: Use image node_id 4 for calling a global function with example usage: display_dist(train_column, test_column, fi, cat_features, max_num_categories, show_categories_by, dataset_names) and returns: fig