code: def _predict_batch_one_shot(
      self, dataset: Iterable[Dict], **kwargs
  ) -> Iterator[Forecast]:
      # TODO clean up
      # TODO optimize
      item_ids = []
      scales = []
      forecast_start_timestamps = []
      dfs = []
  
      for entry in dataset:
          item_ids.append(entry.get(FieldName.ITEM_ID, None))
          series, scale = self.scaling(to_pandas(entry))
          scales.append(scale)
          forecast_start = series.index[-1] + series.index.freq
          forecast_start_timestamps.append(forecast_start)
          forecast_index = pd.period_range(
              forecast_start,
              periods=self.prediction_length,
          )
          forecast_series = pd.Series(
              [None] * self.prediction_length,
              index=forecast_index,
          )
          dfs.append(
              get_features_dataframe(
                  forecast_series,
                  time_features=self.time_features,
                  lag_indices=self.lag_indices,
                  past_data=series,
              )
          )
  
      df = pd.concat(dfs)
      output = self.ag_model.predict(df)
  
      for arr, scale, forecast_start, item_id in zip(
          np.split(output, len(dfs)),
          scales,
          forecast_start_timestamps,
          item_ids,
      ):
          yield self._to_forecast(
              scale * arr.values,
              forecast_start,
              item_id=item_id,
          )
  
imports: from typing import Callable, Dict, List, Optional, Iterator, Iterable, Tuple
  import numpy
  import pandas
  import shutil
  from pathlib import Path
  from autogluon.tabular import TabularPredictor
  from gluonts.core.serde import dump_json, load_json
  from gluonts.dataset.util import to_pandas
  from gluonts.dataset.field_names import FieldName
  from gluonts.itertools import batcher
  from gluonts.model.forecast import SampleForecast, QuantileForecast, Forecast
  from gluonts.model.predictor import Predictor
  from gluonts.time_feature import TimeFeature
label_desc: Use image node_id 5 for calling the TabularPredictor obj's underlying member method code with example usage: obj._predict_batch_one_shot(dataset) without return types