code: def _apply_rnn_encoder_output_layer(
      output_layer,
      time_major,
      hparams,
      mode,
      cell_outputs,
      cell_output_size,
  ):
      map_func = functools.partial(
          _forward_output_layers,
          output_layer=output_layer,
          time_major=time_major,
          hparams=hparams,
          mode=mode,
      )
      cell_outputs_flat = nest.flatten(cell_outputs)
      cell_output_size_flat = nest.flatten(cell_output_size)
      o = [
          map_func(inputs=x, input_size=xs)
          for x, xs in zip(cell_outputs_flat, cell_output_size_flat)
      ]
      outputs_flat, output_size_flat = zip(*o)
      outputs = nest.pack_sequence_as(cell_outputs, outputs_flat)
      output_size = nest.pack_sequence_as(
          cell_outputs, output_size_flat
      )
      return outputs, output_size
  
imports: import functools
  import numpy
  import tensorflow
  from tensorflow.contrib.framework import nest
  from texar.tf.modules.encoders.encoder_base import EncoderBase
  from texar.tf.modules.networks.conv_networks import _to_list
  from texar.tf.core import layers
  from texar.tf.utils.mode import is_train_mode
  from texar.tf.utils.shapes import mask_sequences
  from texar.tf.hyperparams import HParams
label_desc: Use image node_id 6 for calling a global function with example usage: _apply_rnn_encoder_output_layer(output_layer, time_major, hparams, mode, cell_outputs, cell_output_size) and returns: outputs,  output_size