code: def _lu_pivot_to_permutation(swaps, m):
      """Converts the pivot (row swaps) returned by LU to a permutation.
  
      Args:
        swaps: an array of shape (k,) of row swaps to perform
        m: the size of the output permutation. m should be >= k.
      Returns:
        An int32 array of shape (m,).
      """
      assert len(swaps.shape) >= 1
  
      permutation = np.arange(m, dtype=np.int32)
      for i in range(swaps.shape[-1]):
          j = swaps[i]
          permutation[i], permutation[j] = (
              permutation[j],
              permutation[i],
          )
      return permutation
  
imports: import collections
  import functools
  import numpy
  from tensorflow_probability.python.internal.backend.numpy import _utils
  from tensorflow_probability.python.internal.backend.numpy import ops
label_desc: Use image node_id 10 for calling a global function with example usage: _lu_pivot_to_permutation(swaps, m) and returns: permutation