code: def _test_permute_batch(device, type):
      batch_size = 10
      pipe = Pipeline(batch_size, 4, 0)
      data = fn.external_source(
          source=lambda: gen_data(batch_size, type),
          device=device,
          layout="abc",
      )
      perm = fn.batch_permutation()
      pipe.set_outputs(data, fn.permute_batch(data, indices=perm), perm)
      pipe.build()
  
      for i in range(10):
          orig, permuted, idxs = pipe.run()
          idxs = [int(idxs.at(i)) for i in range(batch_size)]
          if isinstance(orig, dali.backend.TensorListGPU):
              orig = orig.as_cpu()
          ref = [orig.at(idx) for idx in idxs]
          check_batch(permuted, ref, len(ref), 0, 0, "abc")
  
file_path: DALI/dali/test/python/operator_1/test_batch_permute.py
imports: import nvidia.dali
  import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  import numpy
  from test_utils import check_batch
  from nose_utils import raises
label_desc: Use image node_id 5 for calling a global function with example usage: _test_permute_batch(device, type) without return types