class_docstr: Used by default implementation of Estimator.fitMultiple to produce models in a thread safe
  iterator. This class handles the simple case of fitMultiple where each param map should be
  fit independently.
  
  Parameters
  ----------
  fitSingleModel : function
      Callable[[int], Transformer] which fits an estimator to a dataset.
      `fitSingleModel` may be called up to `numModels` times, with a unique index each time.
      Each call to `fitSingleModel` with an index should return the Model associated with
      that index.
  numModel : int
      Number of models this iterator should produce.
  
  Notes
  -----
  See :py:meth:`Estimator.fitMultiple` for more info.
docstr: For python2 compatibility.
docstr_tok: ["For","python2","compatibility","."]
code: def next(self) -> Tuple[int, M]:
      """For python2 compatibility."""
      return self.__next__()
  
imports: from abc import ABCMeta, abstractmethod
  import copy
  import threading
  from typing import Any, Callable, Generic, Iterator, List, Optional, Sequence, Tuple, TypeVar, Union, cast, overload, TYPE_CHECKING
  from pyspark import since
  from pyspark.ml.param import P
  from pyspark.ml.common import inherit_doc
  from pyspark.ml.param.shared import HasInputCol, HasOutputCol, HasLabelCol, HasFeaturesCol, HasPredictionCol, Params
  from pyspark.sql.dataframe import DataFrame
  from pyspark.sql.functions import udf
  from pyspark.sql.types import DataType, StructField, StructType
label_desc: Use image node_id 4 for calling the _FitMultipleIterator obj's underlying member method code with example usage: obj.next() and returns: self