code: def check_transpose_layout(
      device,
      batch_size,
      shape,
      in_layout,
      permutation,
      transpose_layout,
      out_layout_arg,
  ):
      eii = RandomDataIterator(batch_size, shape=shape)
      pipe = TransposePipeline(
          device,
          batch_size,
          in_layout,
          iter(eii),
          permutation=permutation,
          transpose_layout=transpose_layout,
          out_layout_arg=out_layout_arg,
      )
      pipe.build()
      out = pipe.run()
  
      expected_out_layout = in_layout
      if out_layout_arg:
          expected_out_layout = out_layout_arg
      elif transpose_layout:
          expected_out_layout = "".join(
              [list(in_layout)[d] for d in permutation]
          )
      else:
          expected_out_layout = "" if in_layout is None else in_layout
  
      assert out[0].layout() == expected_out_layout
  
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  from nvidia.dali import fn, pipeline_def
  import math
  from test_utils import compare_pipelines, as_array, RandomDataIterator, RandomlyShapedDataIterator
  import itertools
  from nose2.tools import params
  import numpy
label_desc: Use image node_id 5 for calling a global function with example usage: check_transpose_layout(device, batch_size, shape, in_layout, permutation, transpose_layout, out_layout_arg) without return types