code: def _get_time_index(X):
      """Get index of time series data, helper function.
  
      Parameters
      ----------
      X : pd.DataFrame
  
      Returns
      -------
      time_index : pandas Index
          Index of time series
      """
      # assumes that all samples share the same the time index, only looks at
      # first row
      if isinstance(X, pd.DataFrame):
          return _get_index(X.iloc[0, 0])
  
      elif isinstance(X, pd.Series):
          return _get_index(X.iloc[0])
  
      elif isinstance(X, np.ndarray):
          return _get_index(X)
  
      else:
          raise ValueError(
              f"X must be a pandas DataFrame or Series, but found: {type(X)}"
          )
  
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 18 for calling a global function with example usage: _get_time_index(X) and returns: _get_index, _get_index, _get_index