code: def make_rnn_cell(
      rnn_layer_sizes,
      dropout_keep_prob=1.0,
      attn_length=0,
      base_cell=rnn.BasicLSTMCell,
      residual_connections=False,
  ):
      """Makes a RNN cell from the given hyperparameters.
  
      Args:
        rnn_layer_sizes: A list of integer sizes (in units) for each layer of the
            RNN.
        dropout_keep_prob: The float probability to keep the output of any given
            sub-cell.
        attn_length: The size of the attention vector.
        base_cell: The base rnn.RNNCell to use for sub-cells.
        residual_connections: Whether or not to use residual connections (via
            rnn.ResidualWrapper).
  
      Returns:
          A rnn.MultiRNNCell based on the given hyperparameters.
      """
      cells = []
      for i in range(len(rnn_layer_sizes)):
          cell = base_cell(rnn_layer_sizes[i])
          if attn_length and not cells:
              # Add attention wrapper to first layer.
              cell = contrib_rnn.AttentionCellWrapper(
                  cell, attn_length, state_is_tuple=True
              )
          if residual_connections:
              cell = rnn.ResidualWrapper(cell)
              if i == 0 or rnn_layer_sizes[i] != rnn_layer_sizes[i - 1]:
                  cell = contrib_rnn.InputProjectionWrapper(
                      cell, rnn_layer_sizes[i]
                  )
          cell = rnn.DropoutWrapper(
              cell, output_keep_prob=dropout_keep_prob
          )
          cells.append(cell)
  
      cell = rnn.MultiRNNCell(cells)
  
      return cell
  
file_path: magenta/magenta/models/shared/events_rnn_graph.py
imports: import numbers
  import magenta.common
  from magenta.contrib import rnn
  import note_seq
  import numpy
  import tensorflow.compat.v1
  import tf_slim
label_desc: Use image node_id 1 for calling a global function with example usage: make_rnn_cell(rnn_layer_sizes, dropout_keep_prob, attn_length, base_cell, residual_connections) and returns: cell