code: def from_pandas(obj):
      """Convert pandas offsets, date indices and data frames into ``zebras``
      equivalents."""
      import pandas as pd
      from pandas.core.base import IndexOpsMixin
      from pandas.tseries.offsets import BaseOffset
  
      if isinstance(obj, pd.DataFrame):
          return TimeFrame.from_pandas(obj)
  
      if isinstance(obj, IndexOpsMixin):
          return Periods.from_pandas(obj)
  
      if isinstance(obj, BaseOffset):
          return Freq.from_pandas(obj)
  
      raise ValueError(
          f"Can not convert value of type {type(obj).__name__}"
      )
  
file_path: gluonts/src/gluonts/zebras/__init__.py
imports: from typing import TypeVar
  from ._freq import Freq, freq
  from ._period import period, Period, periods, Periods
  from ._split_frame import split_frame, SplitFrame, BatchSplitFrame
  from ._time_frame import time_frame, TimeFrame, BatchTimeFrame
  from ._time_series import time_series, TimeSeries, BatchTimeSeries
  from .None import schema
label_desc: Use image node_id 2 for calling a global function with example usage: from_pandas(obj) and returns: TimeFrame, Periods, Freq