code: def get_ymodel_keras(keras_model, X):
      """Calculate each layer's ouput and put them into a dictionary.
  
      Args:
          keras_model (_type_): A keras Model
          X (ndarray): Test data on which to evaluate the model to profile activations.
              Must be formatted suitably for the ``model.predict(X)``.
  
      Returns:
          dict: A dictionary in the form {"layer_name": ouput array of layer}.
      """
      ymodel = {}
      traced_layers = []
      layer_names = []
      for layer in keras_model.layers:
          if _is_ignored_layer(layer):
              continue
          # If the layer has activation integrated then separate them
          # Note that if the layer is a standalone activation layer then skip this
          name = layer.name
          if (
              hasattr(layer, "activation")
              and layer.activation.__name__ != "linear"
              and not isinstance(
                  layer,
                  (keras.layers.Activation, qkeras.qlayers.QActivation),
              )
          ):
              tmp_activation = layer.activation
              layer.activation = None
              ymodel.update(
                  {
                      layer.name: _get_outputs(
                          [layer], X, keras_model.input
                      )
                  }
              )
              layer.activation = tmp_activation
              name = layer.name + f"_{tmp_activation.__name__}"
          traced_layers.append(layer)
          layer_names.append(name)
      outputs = _get_outputs(traced_layers, X, keras_model.input)
      for name, output in zip(layer_names, outputs):
          ymodel[name] = output
      print("Done taking outputs for Keras model.")
      return ymodel
  
imports: import json
  import os
  import shutil
  import uuid
  from collections import defaultdict
  import matplotlib.pyplot
  import numpy
  import pandas
  import seaborn
  from hls4ml.model.graph import ModelGraph
  from hls4ml.model.layers import GRU, LSTM, SeparableConv1D, SeparableConv2D
label_desc: Use image node_id 22 for calling a global function with example usage: get_ymodel_keras(keras_model, X) and returns: ymodel