class_docstr: Create a PyTorch dataset of a tabularized time-series
class_docstr_tok: ["Create","a","PyTorch","dataset","of","a","tabularized","time-series"]
docstr: Overrides parent class method to get an item at index.
  Parameters
  ----------
      index : int
          Sample location in dataset
  Returns
  -------
  OrderedDict
      Model inputs, each of len(df) but with varying dimensions
      Note
      ----
      Contains the following data:
      Model Inputs
          * ``time`` (np.array, float), dims: (num_samples, 1)
          * ``seasonalities`` (OrderedDict), named seasonalities
          each with features (np.array, float) - dims: (num_samples, n_features[name])
          * ``lags`` (np.array, float), dims: (num_samples, n_lags)
          * ``covariates`` (OrderedDict), named covariates,
          each with features (np.array, float) of dims: (num_samples, n_lags)
          * ``events`` (OrderedDict), events,
          each with features (np.array, float) of dims: (num_samples, n_lags)
          * ``regressors`` (OrderedDict), regressors,
          each with features (np.array, float) of dims: (num_samples, n_lags)
  np.array, float
      Targets to be predicted of same length as each of the model inputs, dims: (num_samples, n_forecasts)
docstr_tok: ["Overrides","parent","class","method","to","get","an","item","at","index",".","Parameters","--","--","--","--","--","index",":","int","Sample","location","in","dataset","Returns","--","--","--","-","OrderedDict","Model","inputs",",","each","of","len","(","df",")","but","with","varying","dimensions","Note","--","--","Contains","the","following","data",":","Model","Inputs","*","``","time","``","(","np.array",",","float",")",",","dims",":","(","num_samples",",","1",")","*","``","seasonalities","``","(","OrderedDict",")",",","named","seasonalities","each","with","features","(","np.array",",","float",")","-","dims",":","(","num_samples",",","n_features","[","name","]",")","*","``","lags","``","(","np.array",",","float",")",",","dims",":","(","num_samples",",","n_lags",")","*","``","covariates","``","(","OrderedDict",")",",","named","covariates",",","each","with","features","(","np.array",",","float",")","of","dims",":","(","num_samples",",","n_lags",")","*","``","events","``","(","OrderedDict",")",",","events",",","each","with","features","(","np.array",",","float",")","of","dims",":","(","num_samples",",","n_lags",")","*","``","regressors","``","(","OrderedDict",")",",","regressors",",","each","with","features","(","np.array",",","float",")","of","dims",":","(","num_samples",",","n_lags",")","np.array",",","float","Targets","to","be","predicted","of","same","length","as","each","of","the","model","inputs",",","dims",":","(","num_samples",",","n_forecasts",")"]
code: def __getitem__(self, index):
      """Overrides parent class method to get an item at index.
      Parameters
      ----------
          index : int
              Sample location in dataset
      Returns
      -------
      OrderedDict
          Model inputs, each of len(df) but with varying dimensions
          Note
          ----
          Contains the following data:
          Model Inputs
              * ``time`` (np.array, float), dims: (num_samples, 1)
              * ``seasonalities`` (OrderedDict), named seasonalities
              each with features (np.array, float) - dims: (num_samples, n_features[name])
              * ``lags`` (np.array, float), dims: (num_samples, n_lags)
              * ``covariates`` (OrderedDict), named covariates,
              each with features (np.array, float) of dims: (num_samples, n_lags)
              * ``events`` (OrderedDict), events,
              each with features (np.array, float) of dims: (num_samples, n_lags)
              * ``regressors`` (OrderedDict), regressors,
              each with features (np.array, float) of dims: (num_samples, n_lags)
      np.array, float
          Targets to be predicted of same length as each of the model inputs, dims: (num_samples, n_forecasts)
      """
      sample = self.samples[index]
      targets = self.targets[index]
      meta = self.meta
      return sample, targets, meta
  
imports: import logging
  from collections import OrderedDict, defaultdict
  from datetime import datetime
  from typing import Optional
  import numpy
  import pandas
  import torch
  from torch.utils.data.dataset import Dataset
  from neuralprophet import configure, utils
  from neuralprophet.df_utils import get_max_num_lags
  from neuralprophet.hdays_utils import get_country_holidays
label_desc: Use image node_id 6 for calling the TimeDataset obj's underlying member method code with example usage: obj.__getitem__(index) and returns: sample,  targets,  meta