code: def get_estimators(model):
      r"""Define all the AlphaPy estimators based on the contents
      of the ``algos.yml`` file.
  
      Parameters
      ----------
      model : alphapy.Model
          The model object containing global AlphaPy parameters.
  
      Returns
      -------
      estimators : dict
          All of the estimators required for running the pipeline.
  
      """
  
      # Extract model data
  
      directory = model.specs["directory"]
      n_estimators = model.specs["n_estimators"]
      n_jobs = model.specs["n_jobs"]
      seed = model.specs["seed"]
      verbosity = model.specs["verbosity"]
  
      # Reference training data for Keras input_dim
      X_train = model.X_train
  
      # Initialize estimator dictionary
      estimators = {}
  
      # Global parameter substitution fields
  
      ps_fields = {
          "n_estimators": "n_estimators",
          "iterations": "n_estimators",
          "n_jobs": "n_jobs",
          "nthread": "n_jobs",
          "thread_count": "n_jobs",
          "seed": "seed",
          "random_state": "seed",
          "random_seed": "seed",
          "verbosity": "verbosity",
          "verbose": "verbosity",
      }
  
      # Get algorithm specifications
  
      config_dir = SSEP.join([directory, "config"])
      algo_specs = get_algos_config(config_dir)
  
      # Create estimators for all of the algorithms
  
      for algo in algo_specs:
          model_type = algo_specs[algo]["model_type"]
          params = algo_specs[algo]["params"]
          for param in params:
              if param in ps_fields and isinstance(param, str):
                  algo_specs[algo]["params"][param] = eval(
                      ps_fields[param]
                  )
          try:
              algo_found = True
              func = estimator_map[algo]
          except:
              algo_found = False
              logger.info(
                  "Algorithm %s not found (check package installation)"
                  % algo
              )
          if algo_found:
              if "KERAS" in algo:
                  params["build_fn"] = create_keras_model
                  layers = algo_specs[algo]["layers"]
                  params["nlayers"] = len(layers)
                  input_dim_string = ", input_dim={})".format(
                      X_train.shape[1]
                  )
                  layers[0] = layers[0].replace(")", input_dim_string)
                  for i, layer in enumerate(layers):
                      params["layer" + str(i + 1)] = layer
                  compiler = algo_specs[algo]["compiler"]
                  params["optimizer"] = compiler["optimizer"]
                  params["loss"] = compiler["loss"]
                  try:
                      params["metrics"] = compiler["metrics"]
                  except:
                      pass
              est = func(**params)
              grid = algo_specs[algo]["grid"]
              estimators[algo] = Estimator(algo, model_type, est, grid)
  
      # return the entire classifier list
      return estimators
  
imports: from alphapy.globals import ModelType
  from alphapy.globals import Objective
  from alphapy.globals import SSEP
  from keras.layers import *
  from keras.models import Sequential
  from keras.wrappers.scikit_learn import KerasClassifier
  from keras.wrappers.scikit_learn import KerasRegressor
  import logging
  import numpy
  from scipy.stats import randint
  from sklearn.ensemble import AdaBoostClassifier
  from sklearn.ensemble import ExtraTreesClassifier
  from sklearn.ensemble import ExtraTreesRegressor
  from sklearn.ensemble import GradientBoostingClassifier
  from sklearn.ensemble import GradientBoostingRegressor
  from sklearn.ensemble import RandomForestClassifier
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.linear_model import LinearRegression
  from sklearn.linear_model import LogisticRegression
  from sklearn.naive_bayes import MultinomialNB
  from sklearn.neighbors import KNeighborsClassifier
  from sklearn.neighbors import KNeighborsRegressor
  from sklearn.svm import LinearSVC
  from sklearn.svm import SVC
  import sys
  import yaml
label_desc: Use image node_id 4 for calling a global function with example usage: get_estimators(model) and returns: estimators