code: def create_keras_model(
      nlayers,
      layer1=None,
      layer2=None,
      layer3=None,
      layer4=None,
      layer5=None,
      layer6=None,
      layer7=None,
      layer8=None,
      layer9=None,
      layer10=None,
      optimizer=None,
      loss=None,
      metrics=None,
  ):
      r"""Create a Keras Sequential model.
  
      Parameters
      ----------
      nlayers : int
          Number of layers of the Sequential model.
      layer1...layer10 : str
          Ordered layers of the Sequential model.
      optimizer : str
          Compiler optimizer for the Sequential model.
      loss : str
          Compiler loss function for the Sequential model.
      metrics : str
          Compiler evaluation metric for the Sequential model.
  
      Returns
      -------
      model : keras.models.Sequential
          Compiled Keras Sequential Model.
  
      """
  
      model = Sequential()
      for i in range(nlayers):
          lvar = "layer" + str(i + 1)
          layer = eval(lvar)
          model.add(eval(layer))
      model.compile(optimizer=optimizer, loss=loss, metrics=[metrics])
      return model
  
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 3 for calling a global function with example usage: create_keras_model(nlayers, layer1, layer2, layer3, layer4, layer5, layer6, layer7, layer8, layer9, layer10, optimizer, loss, metrics) and returns: model