code: def get_algos_config(cfg_dir):
      r"""Read the algorithms configuration file.
  
      Parameters
      ----------
      cfg_dir : str
          The directory where the configuration file ``algos.yml``
          is stored.
  
      Returns
      -------
      specs : dict
          The specifications for determining which algorithms to run.
  
      """
  
      logger.info("Algorithm Configuration")
  
      # Read the configuration file
  
      full_path = SSEP.join([cfg_dir, "algos.yml"])
      with open(full_path, "r") as ymlfile:
          specs = yaml.load(ymlfile, Loader=yaml.FullLoader)
  
      # Find optional packages
  
      find_optional_packages()
  
      # Ensure each algorithm has required keys
  
      minimum_keys = ["model_type", "params", "grid"]
      required_keys_keras = minimum_keys + ["layers", "compiler"]
      for algo in specs:
          if "KERAS" in algo:
              required_keys = required_keys_keras
          else:
              required_keys = minimum_keys
          algo_keys = list(specs[algo].keys())
          if set(algo_keys) != set(required_keys):
              logger.warning(
                  "Algorithm %s has the wrong keys %s",
                  algo,
                  required_keys,
              )
              logger.warning("Keys found instead: %s", algo_keys)
          else:
              # determine whether or not model type is valid
              model_types = {x.name: x.value for x in ModelType}
              model_type = specs[algo]["model_type"]
              if model_type in model_types:
                  specs[algo]["model_type"] = ModelType(
                      model_types[model_type]
                  )
              else:
                  raise ValueError(
                      "algos.yml model:type %s unrecognized"
                      % model_type
                  )
  
      # Algorithm Specifications
      return specs
  
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 2 for calling a global function with example usage: get_algos_config(cfg_dir) and returns: specs