code: def get_rnn_cell(
      cell_class,
      cell_params,
      num_layers=1,
      dropout_input_keep_prob=1.0,
      dropout_output_keep_prob=1.0,
      residual_connections=False,
      residual_combiner="add",
      residual_dense=False,
  ):
      """Creates a new RNN Cell
  
      Args:
        cell_class: Name of the cell class, e.g. "BasicLSTMCell".
        cell_params: A dictionary of parameters to pass to the cell constructor.
        num_layers: Number of layers. The cell will be wrapped with
          `tf.contrib.rnn.MultiRNNCell`
        dropout_input_keep_prob: Dropout keep probability applied
          to the input of cell *at each layer*
        dropout_output_keep_prob: Dropout keep probability applied
          to the output of cell *at each layer*
        residual_connections: If true, add residual connections
          between all cells
  
      Returns:
        An instance of `tf.contrib.rnn.RNNCell`.
      """
  
      cells = []
      for _ in range(num_layers):
          cell = cell_from_spec(cell_class, cell_params)
          if (
              dropout_input_keep_prob < 1.0
              or dropout_output_keep_prob < 1.0
          ):
              cell = tf.contrib.rnn.DropoutWrapper(
                  cell=cell,
                  input_keep_prob=dropout_input_keep_prob,
                  output_keep_prob=dropout_output_keep_prob,
              )
          cells.append(cell)
  
      if len(cells) > 1:
          final_cell = rnn_cell.ExtendedMultiRNNCell(
              cells=cells,
              residual_connections=residual_connections,
              residual_combiner=residual_combiner,
              residual_dense=residual_dense,
          )
      else:
          final_cell = cells[0]
  
      return final_cell
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  import inspect
  import os
  from collections import defaultdict
  from pydoc import locate
  import json
  import tensorflow
  from tensorflow import gfile
  from seq2seq.contrib import rnn_cell
label_desc: Use image node_id 2 for calling a global function with example usage: get_rnn_cell(cell_class, cell_params, num_layers, dropout_input_keep_prob, dropout_output_keep_prob, residual_connections, residual_combiner, residual_dense) and returns: final_cell