code: def get_index_for_series(obj, cutoff=0):
      """Get pandas index for a Series object.
  
      Returns index even for numpy array, in that case a RangeIndex.
  
      Assumptions on obj are not checked, these should be validated separately.
      Function may return unexpected results without prior validation.
  
      Parameters
      ----------
      obj : sktime data container
          must be of one of the following mtypes:
              pd.Series, pd.DataFrame, np.ndarray, of Series scitype
      cutoff : int, or pd.datetime, optional, default=0
          current cutoff, used to offset index if obj is np.ndarray
  
      Returns
      -------
      index : pandas.Index, index for obj
      """
      if hasattr(obj, "index"):
          return obj.index
      # now we know the object must be an np.ndarray
      return pd.RangeIndex(cutoff, cutoff + obj.shape[0])
  
file_path: sktime/sktime/datatypes/_utilities.py
imports: import numpy
  import pandas
label_desc: Use image node_id 3 for calling a global function with example usage: get_index_for_series(obj, cutoff) and returns: pd, obj