class_docstr: A collection of univariate time series, where each row is identified by an (``item_id``, ``timestamp``) pair.
  
  For example, a time series data frame could represent the daily sales of a collection of products, where each
  ``item_id`` corresponds to a product and ``timestamp`` corresponds to the day of the record.
  
  Parameters
  ----------
  data : pd.DataFrame, str, pathlib.Path or Iterable
      Time series data to construct a ``TimeSeriesDataFrame``. The class currently supports four input formats.
  
      1. Time series data in a pandas DataFrame format without multi-index. For example::
  
                 item_id  timestamp  target
              0        0 2019-01-01       0
              1        0 2019-01-02       1
              2        0 2019-01-03       2
              3        1 2019-01-01       3
              4        1 2019-01-02       4
              5        1 2019-01-03       5
              6        2 2019-01-01       6
              7        2 2019-01-02       7
              8        2 2019-01-03       8
  
      You can also use :meth:`~autogluon.timeseries.TimeSeriesDataFrame.from_data_frame` for loading data in such format.
  
      2. Path to a data file in CSV or Parquet format. The file must contain columns ``item_id`` and ``timestamp``, as well as columns with time series values. This is similar to Option 1 above (pandas DataFrame format without multi-index). Both remote (e.g., S3) and local paths are accepted. You can also use :meth:`~autogluon.timeseries.TimeSeriesDataFrame.from_path` for loading data in such format.
  
      3. Time series data in pandas DataFrame format with multi-index on ``item_id`` and ``timestamp``. For example::
  
                                  target
              item_id timestamp
              0       2019-01-01       0
                      2019-01-02       1
                      2019-01-03       2
              1       2019-01-01       3
                      2019-01-02       4
                      2019-01-03       5
              2       2019-01-01       6
                      2019-01-02       7
                      2019-01-03       8
  
      4. Time series data in Iterable format. For example::
  
              iterable_dataset = [
                  {"target": [0, 1, 2], "start": pd.Period("01-01-2019", freq='D')},
                  {"target": [3, 4, 5], "start": pd.Period("01-01-2019", freq='D')},
                  {"target": [6, 7, 8], "start": pd.Period("01-01-2019", freq='D')}
              ]
  
      You can also use :meth:`~autogluon.timeseries.TimeSeriesDataFrame.from_iterable_dataset` for loading data in such format.
  
  static_features : pd.DataFrame, str or pathlib.Path, optional
      An optional data frame describing the metadata of each individual time series that does not change with time.
      Can take real-valued or categorical values. For example, if ``TimeSeriesDataFrame`` contains sales of various
      products, static features may refer to time-independent features like color or brand.
  
      The index of the ``static_features`` index must contain a single entry for each item present in the respective
      ``TimeSeriesDataFrame``. For example, the following ``TimeSeriesDataFrame``::
  
                              target
          item_id timestamp
          A       2019-01-01       0
                  2019-01-02       1
                  2019-01-03       2
          B       2019-01-01       3
                  2019-01-02       4
                  2019-01-03       5
  
      is compatible with the following ``static_features``::
  
                   feat_1 feat_2
          item_id
          A           2.0    bar
          B           5.0    foo
  
      ``TimeSeriesDataFrame`` will ensure consistency of static features during serialization/deserialization, copy
      and slice operations.
  
      If ``static_features`` are provided during ``fit``, the ``TimeSeriesPredictor`` expects the same metadata to be
      available during prediction time.
  id_column : str, optional
      Name of the ``item_id`` column, if it's different from the default. This argument is only used when
      constructing a TimeSeriesDataFrame using format 1 (DataFrame without multi-index) or 2 (path to a file).
  timestamp_column : str, optional
      Name of the ``timestamp`` column, if it's different from the default. This argument is only used when
      constructing a TimeSeriesDataFrame using format 1 (DataFrame without multi-index) or 2 (path to a file).
  num_cpus : int, default = -1
      Number of CPU cores used to process the iterable dataset in parallel. Set to -1 to use all cores. This argument
      is only used when constructing a TimeSeriesDataFrame using format 4 (iterable dataset).
  
  Attributes
  ----------
  freq : str
      A pandas-compatible string describing the frequency of the time series. For example ``"D"`` for daily data,
      ``"H"`` for hourly data, etc. This attribute is determined automatically based on the timestamps. For the full
      list of possible values, see `pandas documentation <https://pandas.pydata.org/pandas-docs/stable/user_guide/timeseries.html#offset-aliases>`_.
  num_items : int
      Number of items (time series) in the data set.
  item_ids : pd.Index
      List of unique time series IDs contained in the data set.
class_docstr_tok: ["A","collection","of","univariate","time","series",",","where","each","row","is","identified","by","an","(","``","item_id","``",",","``","timestamp","``",")","pair",".","For","example",",","a","time","series","data","frame","could","represent","the","daily","sales","of","a","collection","of","products",",","where","each","``","item_id","``","corresponds","to","a","product","and","``","timestamp","``","corresponds","to","the","day","of","the","record",".","Parameters","--","--","--","--","--","data",":","pd.DataFrame",",","str",",","pathlib.Path","or","Iterable","Time","series","data","to","construct","a","``","TimeSeriesDataFrame","``",".","The","class","currently","supports","four","input","formats",".","1",".","Time","series","data","in","a","pandas","DataFrame","format","without","multi-index",".","For","example",":",":","item_id","timestamp","target","0","0","2019-01-01","0","1","0","2019-01-02","1","2","0","2019-01-03","2","3","1","2019-01-01","3","4","1","2019-01-02","4","5","1","2019-01-03","5","6","2","2019-01-01","6","7","2","2019-01-02","7","8","2","2019-01-03","8","You","can","also","use",":","meth",":","`","~autogluon.timeseries.TimeSeriesDataFrame.from_data_frame","`","for","loading","data","in","such","format",".","2",".","Path","to","a","data","file","in","CSV","or","Parquet","format",".","The","file","must","contain","columns","``","item_id","``","and","``","timestamp","``",",","as","well","as","columns","with","time","series","values",".","This","is","similar","to","Option","1","above","(","pandas","DataFrame","format","without","multi-index",")",".","Both","remote","(","e.g.",",","S3",")","and","local","paths","are","accepted",".","You","can","also","use",":","meth",":","`","~autogluon.timeseries.TimeSeriesDataFrame.from_path","`","for","loading","data","in","such","format",".","3",".","Time","series","data","in","pandas","DataFrame","format","with","multi-index","on","``","item_id","``","and","``","timestamp","``",".","For","example",":",":","target","item_id","timestamp","0","2019-01-01","0","2019-01-02","1","2019-01-03","2","1","2019-01-01","3","2019-01-02","4","2019-01-03","5","2","2019-01-01","6","2019-01-02","7","2019-01-03","8","4",".","Time","series","data","in","Iterable","format",".","For","example",":",":","iterable_dataset","=","[","{","``","target","''",":","[","0",",","1",",","2","]",",","``","start","''",":","pd.Period","(","``","01-01-2019","''",",","freq='D","'",")","}",",","{","``","target","''",":","[","3",",","4",",","5","]",",","``","start","''",":","pd.Period","(","``","01-01-2019","''",",","freq='D","'",")","}",",","{","``","target","''",":","[","6",",","7",",","8","]",",","``","start","''",":","pd.Period","(","``","01-01-2019","''",",","freq='D","'",")","}","]","You","can","also","use",":","meth",":","`","~autogluon.timeseries.TimeSeriesDataFrame.from_iterable_dataset","`","for","loading","data","in","such","format",".","static_features",":","pd.DataFrame",",","str","or","pathlib.Path",",","optional","An","optional","data","frame","describing","the","metadata","of","each","individual","time","series","that","does","not","change","with","time",".","Can","take","real-valued","or","categorical","values",".","For","example",",","if","``","TimeSeriesDataFrame","``","contains","sales","of","various","products",",","static","features","may","refer","to","time-independent","features","like","color","or","brand",".","The","index","of","the","``","static_features","``","index","must","contain","a","single","entry","for","each","item","present","in","the","respective","``","TimeSeriesDataFrame","``",".","For","example",",","the","following","``","TimeSeriesDataFrame","``",":",":","target","item_id","timestamp","A","2019-01-01","0","2019-01-02","1","2019-01-03","2","B","2019-01-01","3","2019-01-02","4","2019-01-03","5","is","compatible","with","the","following","``","static_features","``",":",":","feat_1","feat_2","item_id","A","2.0","bar","B","5.0","foo","``","TimeSeriesDataFrame","``","will","ensure","consistency","of","static","features","during","serialization\/deserialization",",","copy","and","slice","operations",".","If","``","static_features","``","are","provided","during","``","fit","``",",","the","``","TimeSeriesPredictor","``","expects","the","same","metadata","to","be","available","during","prediction","time",".","id_column",":","str",",","optional","Name","of","the","``","item_id","``","column",",","if","it","'s","different","from","the","default",".","This","argument","is","only","used","when","constructing","a","TimeSeriesDataFrame","using","format","1","(","DataFrame","without","multi-index",")","or","2","(","path","to","a","file",")",".","timestamp_column",":","str",",","optional","Name","of","the","``","timestamp","``","column",",","if","it","'s","different","from","the","default",".","This","argument","is","only","used","when","constructing","a","TimeSeriesDataFrame","using","format","1","(","DataFrame","without","multi-index",")","or","2","(","path","to","a","file",")",".","num_cpus",":","int",",","default","=","-1","Number","of","CPU","cores","used","to","process","the","iterable","dataset","in","parallel",".","Set","to","-1","to","use","all","cores",".","This","argument","is","only","used","when","constructing","a","TimeSeriesDataFrame","using","format","4","(","iterable","dataset",")",".","Attributes","--","--","--","--","--","freq",":","str","A","pandas-compatible","string","describing","the","frequency","of","the","time","series",".","For","example","``","``","D","''","``","for","daily","data",",","``","``","H","''","``","for","hourly","data",",","etc",".","This","attribute","is","determined","automatically","based","on","the","timestamps",".","For","the","full","list","of","possible","values",",","see","`","pandas","documentation","<","https",":","\/\/pandas.pydata.org\/pandas-docs\/stable\/user_guide\/timeseries.html","#","offset-aliases",">","`","_",".","num_items",":","int","Number","of","items","(","time","series",")","in","the","data","set",".","item_ids",":","pd.Index","List","of","unique","time","series","IDs","contained","in","the","data","set","."]
docstr: Validate a multi-index pd.DataFrame can be converted to TimeSeriesDataFrame
docstr_tok: ["Validate","a","multi-index","pd.DataFrame","can","be","converted","to","TimeSeriesDataFrame"]
code: def _validate_multi_index_data_frame(cls, data: pd.DataFrame):
      """Validate a multi-index pd.DataFrame can be converted to TimeSeriesDataFrame"""
  
      if not isinstance(data, pd.DataFrame):
          raise ValueError(
              f"data must be a pd.DataFrame, got {type(data)}"
          )
      if not isinstance(data.index, pd.MultiIndex):
          raise ValueError(
              f"data must have pd.MultiIndex, got {type(data.index)}"
          )
      if not pd.api.types.is_datetime64_dtype(
          data.index.dtypes[TIMESTAMP]
      ):
          raise ValueError(
              f"for {TIMESTAMP}, the only pandas dtype allowed is `datetime64`."
          )
      if not data.index.names == (f"{ITEMID}", f"{TIMESTAMP}"):
          raise ValueError(
              f"data must have index names as ('{ITEMID}', '{TIMESTAMP}'), got {data.index.names}"
          )
      item_id_index = data.index.get_level_values(level=ITEMID)
      if not (
          pd.api.types.is_integer_dtype(item_id_index)
          or pd.api.types.is_string_dtype(item_id_index)
      ):
          raise ValueError(
              f"all entries in index `{ITEMID}` must be of integer or string dtype"
          )
  
imports: from __future__ import annotations
  import copy
  import itertools
  import logging
  import reprlib
  from collections.abc import Iterable
  from itertools import islice
  from pathlib import Path
  from typing import Any, List, Optional, Tuple, Type, Union
  import pandas
  from joblib.parallel import Parallel, delayed
  from pandas.core.internals import ArrayManager, BlockManager
  from autogluon.common.loaders import load_pd
label_desc: Use image node_id 6 for calling the TimeSeriesDataFrame obj's underlying member method code with example usage: obj._validate_multi_index_data_frame(cls, data) without return types