code: def _check_equal_index(X):
      """Check if all time-series in nested pandas DataFrame have the same index.
  
      Parameters
      ----------
      X : nested pd.DataFrame
          Input dataframe with time-series in cells.
  
      Returns
      -------
      indexes : list of indixes
          List of indixes with one index for each column
      """
      # TODO handle 1d series, not only 2d dataframes
      # TODO assumes columns are typed (i.e. all rows for a given column have
      #  the same type)
      # TODO only handles series columns, raises error for columns with
      #  primitives
  
      indexes = []
      # Check index for each column separately.
      for c, col in enumerate(X.columns):
          # Get index from first row, can be either pd.Series or np.array.
          first_index = (
              X.iloc[0, c].index
              if hasattr(X.iloc[0, c], "index")
              else np.arange(X.iloc[c, 0].shape[0])
          )
  
          # Series must contain at least 2 observations, otherwise should be
          # primitive.
          if len(first_index) < 2:
              raise ValueError(
                  f"Time series must contain at least 2 observations, "
                  f"but found: "
                  f"{len(first_index)} observations in column: {col}"
              )
  
          # Check index for all rows.
          for i in range(1, X.shape[0]):
              index = (
                  X.iloc[i, c].index
                  if hasattr(X.iloc[i, c], "index")
                  else np.arange(X.iloc[c, 0].shape[0])
              )
              if not np.array_equal(first_index, index):
                  raise ValueError(
                      f"Found time series with unequal index in column {col}. "
                      f"Input time-series must have the same index."
                  )
          indexes.append(first_index)
  
      return indexes
  
imports: import numpy
  import pandas
  from sktime.datatypes._convert_utils._coerce import _coerce_df_dtypes
  from sktime.datatypes._convert_utils._convert import _extend_conversions
  from sktime.datatypes._panel._registry import MTYPE_LIST_PANEL
  from sktime.utils.pandas import df_map
  from sktime.utils.validation._dependencies import _check_soft_dependencies
label_desc: Use image node_id 7 for calling a global function with example usage: _check_equal_index(X) and returns: indexes