code: def check_layout(tensor, in_layout, axes, keep_dims):
      expected_layout = get_expected_layout(in_layout, axes, keep_dims)
      assert (
          tensor.layout() == expected_layout
      ), f"Layout mismatch. Got: `{tensor.layout()}`, expected `{expected_layout}` (axes: {axes})"
  
imports: import nvidia.dali.fn
  from nvidia.dali.pipeline import Pipeline
  from nose.tools import nottest
  import numpy
  from test_utils import np_type_to_dali
  from nose_utils import assert_raises
label_desc: Use image node_id 2 for calling a global function with example usage: check_layout(tensor, in_layout, axes, keep_dims) without return types