code: def get_all_predictions(self, X):
      def get_predictions_for_one_estimator(estimator, X):
          estimator_name = estimator.name
  
          if self.type_of_estimator == "regressor":
              predictions = estimator.predict(X)
          else:
              # For classifiers
              predictions = list(estimator.predict_proba(X))
          return_obj = {estimator_name: predictions}
          return return_obj
  
      # Don't bother parallelizing if this is a single dictionary
      if X.shape[0] == 1:
          predictions_from_all_estimators = map(
              lambda predictor: get_predictions_for_one_estimator(
                  predictor, X
              ),
              self.ensemble_predictors,
          )
  
      else:
          # Pathos doesn't like datasets beyond a certain size. So fall back on single, non-parallel predictions instead.
          # try:
          if os.environ.get("is_test_suite", False) == "True":
              predictions_from_all_estimators = map(
                  lambda predictor: get_predictions_for_one_estimator(
                      predictor, X
                  ),
                  self.ensemble_predictors,
              )
  
          else:
              # Open a new multiprocessing pool
              pool = pathos.multiprocessing.ProcessPool()
  
              # Since we may have already closed the pool, try to restart it
              try:
                  pool.restart()
              except AssertionError as e:
                  pass
              predictions_from_all_estimators = pool.map(
                  lambda predictor: get_predictions_for_one_estimator(
                      predictor, X
                  ),
                  self.ensemble_predictors,
              )
  
              # Once we have gotten all we need from the pool, close it so it's not taking up unnecessary memory
              pool.close()
              try:
                  pool.join()
              except AssertionError:
                  pass
  
      predictions_from_all_estimators = list(
          predictions_from_all_estimators
      )
  
      results = {}
      for result_dict in predictions_from_all_estimators:
          results.update(result_dict)
  
      # if this is a single row we are getting predictions from, just return a dictionary with single values for all the predictions
      if X.shape[0] == 1:
          return results
      else:
          predictions_df = pd.DataFrame.from_dict(
              results, orient="columns"
          )
  
          return predictions_df
  
file_path: auto_ml/auto_ml/utils_ensembling.py
imports: import os
  import numpy
  import pandas
  import pathos
  from sklearn.base import BaseEstimator, TransformerMixin
label_desc: Use image node_id 2 for calling the Ensembler obj's underlying member method code with example usage: obj.get_all_predictions(X) and returns: return_obj, results, predictions_df