class_docstr: A Predictor that uses an estimator to train a local model per time series
  and immediately calls this to predict.
  
  Parameters
  ----------
  estimator
      The estimator object to train on each dataset entry at prediction time.
class_docstr_tok: ["A","Predictor","that","uses","an","estimator","to","train","a","local","model","per","time","series","and","immediately","calls","this","to","predict",".","Parameters","--","--","--","--","--","estimator","The","estimator","object","to","train","on","each","dataset","entry","at","prediction","time","."]
code: def predict(self, dataset: Dataset, **kwargs) -> Iterator[Forecast]:
      for i, ts in enumerate(dataset, start=1):
          logger.info(f"training for time series {i} / {len(dataset)}")
          trained_pred = self.estimator.train([ts])
          logger.info(
              f"predicting for time series {i} / {len(dataset)}"
          )
          yield from trained_pred.predict([ts], **kwargs)
  
imports: import itertools
  import json
  import logging
  import multiprocessing
  import sys
  import traceback
  from pathlib import Path
  from pydoc import locate
  from tempfile import TemporaryDirectory
  from typing import TYPE_CHECKING, Callable, Iterator, Optional, Dict, Any
  import numpy
  import gluonts
  from gluonts.core import fqname_for
  from gluonts.core.component import equals, from_hyperparameters
  from gluonts.core.serde import dump_json, load_json
  from gluonts.dataset.common import DataEntry, Dataset
  from gluonts.model.forecast import Forecast
label_desc: Use image node_id 2 for calling the Localizer obj's underlying member method code with example usage: obj.predict(dataset) without return types