code: def _get_index(x):
      if hasattr(x, "index"):
          return x.index
      elif isinstance(x, np.ndarray):
          if x.ndim < 3:
              return pd.RangeIndex(x.shape[0])
          else:
              return pd.RangeIndex(x.shape[-1])
      else:
          return pd.RangeIndex(x.shape[-1])
  
file_path: sktime/sktime/datatypes/_utilities.py
imports: import numpy
  import pandas
label_desc: Use image node_id 1 for calling a global function with example usage: _get_index(x) and returns: x, pd, pd, pd