code: def _data_period(index) -> Union[pd.Timedelta, Number]:
      """Return data index period as pd.Timedelta"""
      values = pd.Series(index[-100:])
      return values.diff().dropna().median()
  
imports: import warnings
  from numbers import Number
  from typing import Dict, List, Optional, Sequence, Union, cast
  import numpy
  import pandas
label_desc: Use image node_id 4 for calling a global function with example usage: _data_period(index) and returns: values