code: def fit(self, dataset, params=None, pipeline=None):
      if params is None:
          params = dict()
      if isinstance(params, (list, tuple)):
          models = [None] * len(params)
          for index, model in self.fitMultiple(dataset, params):
              models[index] = model
          return models
      elif isinstance(params, dict):
          if params:
              return self.copy(params)._fit(dataset, pipeline=pipeline)
          else:
              return self._fit(dataset, pipeline=pipeline)
      else:
          raise ValueError(
              "Params must be either a param map or a list/tuple of param maps, "
              "but got %s." % type(params)
          )
  
file_path: spark-nlp/python/sparknlp/internal/recursive.py
imports: from abc import ABC
  from pyspark.ml.wrapper import JavaEstimator, JavaModel
  from pyspark.sql import DataFrame
label_desc: Use image node_id 3 for calling the RecursiveEstimator obj's underlying member method code with example usage: obj.fit(dataset, params, pipeline) and returns: models, self, self