code: def call_recurrent_link(
      link, sequences, recurrent_state, output_mode
  ):
      """Call a recurrent link following the interface of `StatelessRecurrent`.
  
      Args:
          link (chainer.Link): Recurrent link.
          sequences, recurrent_state, output_mode: See the docstring of
              `StatelessRecurrent.n_step_forward`.
  
      Returns:
          object: Output sequences. See the docstring of
              `StatelessRecurrent.n_step_forward`.
          object: New batched recurrent state.
      """
      assert isinstance(link, chainer.Link)
      assert isinstance(sequences, list)
      if isinstance(link, L.NStepLSTM):
          if recurrent_state is None:
              h = None
              c = None
          else:
              h, c = recurrent_state
          h, c, sequences = link(h, c, sequences)
          if output_mode == "concat":
              sequences = concatenate_sequences(sequences)
          return sequences, (h, c)
      if isinstance(link, (L.NStepGRU, L.NStepRNNReLU, L.NStepRNNTanh)):
          h = recurrent_state
          h, sequences = link(h, sequences)
          if output_mode == "concat":
              sequences = concatenate_sequences(sequences)
          return sequences, h
      if isinstance(link, StatelessRecurrent):
          return link.n_step_forward(
              sequences, recurrent_state, output_mode=output_mode
          )
      else:
          raise ValueError("{} is not a recurrent link".format(link))
  
imports: from cached_property import cached_property
  import chainer
  import chainer.functions
  import chainer.links
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: call_recurrent_link(link, sequences, recurrent_state, output_mode) and returns: sequences,  h,  c, sequences,  h, link