class_docstr: Registry responsible for built-in keras layers.
docstr: Get rnn cells from layer.
code: def _get_rnn_cells(rnn_layer):  # pylint: disable=no-self-argument
      """Get rnn cells from layer."""
  
      if isinstance(rnn_layer, tf.keras.layers.Bidirectional):
          return [
              rnn_layer.forward_layer.cell,
              rnn_layer.backward_layer.cell,
          ]
      if isinstance(rnn_layer.cell, tf.keras.layers.StackedRNNCells):
          return rnn_layer.cell.cells
      # The case when RNN contains multiple cells
      if isinstance(rnn_layer.cell, (list, tuple)):
          return rnn_layer.cell
      # The case when RNN contains a single cell
      else:
          return [rnn_layer.cell]
  
file_path: model-optimization/tensorflow_model_optimization/python/core/clustering/keras/clustering_registry.py
imports: import tensorflow
  from tensorflow_model_optimization.python.core.clustering.keras import clusterable_layer
  from tensorflow_model_optimization.python.core.clustering.keras import clustering_algorithm
label_desc: Use image node_id 2 for calling the ClusteringRegistry obj's underlying member method code with example usage: obj._get_rnn_cells(rnn_layer) and returns: list, rnn_layer, rnn_layer, list