code: def _flip_label_probability(y, input_length, xp):
      """Flips a label probability matrix.
  
      This function rotates a label probability matrix and flips it.
      ``y[i, b, l]`` stores log probability of label ``l`` at ``i``-th
      input in ``b``-th batch.
      The rotated matrix ``r`` is defined as
      ``r[i, b, l] = y[i + input_length[b], b, l]``
  
      """
      seq, n_batch, n_vocab = y.shape
      rotate = (
          xp.arange(seq, dtype=xp.int32)[:, None] + input_length
      ) % seq
      return y[
          rotate[:, :, None],
          xp.arange(n_batch, dtype=xp.int32)[None, :, None],
          xp.arange(n_vocab, dtype=xp.int32)[None, None, :],
      ][::-1]
  
imports: import numpy
  import six
  import chainer
  from chainer import backend
  from chainer.backends import cuda
  from chainer import function
  from chainer import utils
  from chainer.utils import collections_abc
  from chainer.utils import type_check
label_desc: Use image node_id 5 for calling a global function with example usage: _flip_label_probability(y, input_length, xp) and returns: y