code: def _flip_path(path, path_length, xp):
      """Flips label sequence.
  
      This function rotates a label sequence and flips it.
      ``path[b, t]`` stores a label at time ``t`` in ``b``-th batch.
      The rotated matrix ``r`` is defined as
      ``r[b, t] = path[b, t + path_length[b]]``
  
      .. ::
  
         a b c d .     . a b c d    d c b a .
         e f . . .  -> . . . e f -> f e . . .
         g h i j k     g h i j k    k j i h g
  
      """
      n_batch, n_label = path.shape
      rotate = (xp.arange(n_label) + path_length[:, None]) % n_label
      return path[xp.arange(n_batch, dtype=xp.int32)[:, None], rotate][
          :, ::-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 4 for calling a global function with example usage: _flip_path(path, path_length, xp) and returns: path