code: def plot_ccf(
      y: pd.DataFrame,
      y_label: str,
      fig_defaults: Dict[str, Any],
      X: List[pd.DataFrame] = None,
      X_labels: List[str] = None,
      fig_kwargs: Optional[Dict] = None,
  ) -> PlotReturnType:
      """Plots the Cross Correlation between the data and the exogenous variables X.
      When no exogenous variables are present, simply plots the self correlation (ACF).
  
      Parameters
      ----------
      y : pd.DataFrame
          A dataframe containing the a single plot data types for the target series
          (original, imputed, OR transformed).
      y_label : str
          The name of the target time series.
      fig_defaults : Dict[str, Any]
          The default settings for the plotly plot. Must contain keys for "width",
          "height", and "template".
      X : List[pd.DataFrame]
          The exogenous variables in the data, by default None
          X contains 1 dataframe per exogenous variable. Each dataframe must have only
          1 column at a time since ccf does not work on many data types at a time.
      X_labels : List[str]
          The names of the exogenous variables, by default None
      fig_kwargs : Optional[Dict], optional
          Specific overrides by the user for the plotly figure settings,
          by default None. Can contain keys for "width", "height" and/or "template".
  
      Returns
      -------
      PlotReturnType
          The plotly figure object along with a dictionary with the plot data.
          The data can be returned to the user (if requested) so that the plot can
          be and customized by them if not supported by pycaret by default.
  
      Raises
      ------
      ValueError
          When any dataframe in y or X contains more than 1 column.
      """
      if y.shape[1] != 1:
          raise ValueError(
              "plot_ccf() only works on a single time series, "
              f"but {y.shape[1]} target series were provided."
          )
      if X is not None:
          for dataframe in X:
              if dataframe.shape[1] != 1:
                  raise ValueError(
                      f"plot_ccf() only works on a single time series, but {dataframe.shape[1]} "
                      f"exogenous series were provided: {dataframe.columns}."
                  )
  
      y_series = y.iloc[:, 0]
  
      fig_kwargs = fig_kwargs or {}
  
      title = f"Cross Correlation Plot(s) | {y_series.name}"
  
      plot_data = [y_series]
      column_names = [y_label]
      if X is not None:
          plot_data.extend(X)
          column_names.extend(X_labels)
  
      plot_data = pd.concat(plot_data, axis=1)
      plot_data.columns = column_names
  
      # Decide the number of rows and columns ----
      num_subplots = plot_data.shape[1]
      rows = _resolve_dict_keys(
          dict_=fig_kwargs, key="rows", defaults=fig_defaults
      )
      cols = _resolve_dict_keys(
          dict_=fig_kwargs, key="cols", defaults=fig_defaults
      )
      rows, cols = _get_subplot_rows_cols(
          num_subplots=num_subplots, rows=rows, cols=cols
      )
  
      subplot_titles = []
      for i, col_name in enumerate(plot_data.columns):
          subplot_title = f"{y_label} vs. {col_name}"
          subplot_titles.append(subplot_title)
  
      fig = make_subplots(
          rows=rows,
          cols=cols,
          subplot_titles=subplot_titles,
      )
  
      all_ccf_data = {}
      for i, col_name in enumerate(plot_data.columns):
          row = int(i / cols) + 1
          col = i % cols + 1
          # Add CCF plot ----
          fig, ccf_data = corr_subplot(
              fig=fig,
              data=[y_series, plot_data[col_name]],
              row=row,
              col=col,
              plot="ccf",
          )
          all_ccf_data.update({col_name: ccf_data})
  
      fig = _plot_fig_update(fig, title, fig_defaults, fig_kwargs)
  
      return_data_dict = {"ccf": all_ccf_data}
  
      return fig, return_data_dict
  
file_path: pycaret/pycaret/internal/plots/time_series.py
imports: from typing import Any, Dict, List, Optional, Union
  import numpy
  import pandas
  import plotly.graph_objects
  from plotly.subplots import make_subplots
  from sktime.forecasting.model_selection import ExpandingWindowSplitter, SlidingWindowSplitter
  from pycaret.internal.plots.utils.time_series import PlotReturnType, _clean_model_results_labels, _get_subplot_rows_cols, _plot_fig_update, _resolve_hoverinfo, _update_fig_dimensions, corr_subplot, decomp_subplot, dist_subplot, frequency_components_subplot, plot_original_with_overlays, qq_subplot, time_series_subplot
  from pycaret.utils.generic import _resolve_dict_keys
  from pycaret.utils.time_series import get_diffs
label_desc: Use image node_id 11 for calling a global function with example usage: plot_ccf(y, y_label, fig_defaults, X, X_labels, fig_kwargs) and returns: fig,  return_data_dict