code: def rnn_cell(
      rnn_cell_size, dropout_keep_prob, residual, is_training=True
  ):
      """Builds an LSTMBlockCell based on the given parameters."""
      dropout_keep_prob = dropout_keep_prob if is_training else 1.0
      cells = []
      for i in range(len(rnn_cell_size)):
          cell = contrib_rnn.LSTMBlockCell(rnn_cell_size[i])
          if residual:
              cell = rnn.ResidualWrapper(cell)
              if i == 0 or rnn_cell_size[i] != rnn_cell_size[i - 1]:
                  cell = contrib_rnn.InputProjectionWrapper(
                      cell, rnn_cell_size[i]
                  )
          cell = rnn.DropoutWrapper(
              cell, input_keep_prob=dropout_keep_prob
          )
          cells.append(cell)
      return rnn.MultiRNNCell(cells)
  
imports: import collections
  from magenta.contrib import rnn
  from magenta.contrib import seq2seq
  import tensorflow.compat.v1
label_desc: Use image node_id 1 for calling a global function with example usage: rnn_cell(rnn_cell_size, dropout_keep_prob, residual, is_training) and returns: rnn