code: def _flip_path_probability(prob, input_length, path_length, xp):
      """Flips a path probability matrix.
  
      This function returns a path probability matrix and flips it.
      ``prob[i, b, t]`` stores log probability at ``i``-th input and
      at time ``t`` in a output sequence in ``b``-th batch.
      The rotated matrix ``r`` is defined as
      ``r[i, j, k] = prob[i + input_length[j], j, k + path_length[j]]``
  
      """
      seq, n_batch, n_label = prob.shape
      rotate_input = (
          xp.arange(seq, dtype=xp.int32)[:, None] + input_length
      ) % seq
      rotate_label = (
          xp.arange(n_label, dtype=xp.int32) + path_length[:, None]
      ) % n_label
      return prob[
          rotate_input[:, :, None],
          xp.arange(n_batch, dtype=xp.int32)[None, :, None],
          rotate_label,
      ][::-1, :, ::-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 6 for calling a global function with example usage: _flip_path_probability(prob, input_length, path_length, xp) and returns: prob