code: def test_tensor_cpu_squeeze():
      def check_squeeze(shape, dim, in_layout, expected_out_layout):
          arr = np.random.rand(*shape)
          t = TensorCPU(arr, in_layout)
          is_squeezed = t.squeeze(dim)
          should_squeeze = len(expected_out_layout) < len(in_layout)
          arr_squeeze = arr.squeeze(dim)
          t_shape = tuple(t.shape())
          assert (
              t_shape == arr_squeeze.shape
          ), f"{t_shape} != {arr_squeeze.shape}"
          assert (
              t.layout() == expected_out_layout
          ), f"{t.layout()} != {expected_out_layout}"
          assert layout_compatible(
              t.get_property("layout"), expected_out_layout
          ), f'{t.get_property("layout")} doesn\'t match {expected_out_layout}'
          assert np.allclose(arr_squeeze, np.array(t))
          assert (
              is_squeezed == should_squeeze
          ), f"{is_squeezed} != {should_squeeze}"
  
      for dim, shape, in_layout, expected_out_layout in [
          (None, (3, 5, 6), "ABC", "ABC"),
          (None, (3, 1, 6), "ABC", "AC"),
          (1, (3, 1, 6), "ABC", "AC"),
          (-2, (3, 1, 6), "ABC", "AC"),
          (None, (1, 1, 6), "ABC", "C"),
          (1, (1, 1, 6), "ABC", "AC"),
          (None, (1, 1, 1), "ABC", ""),
          (None, (1, 5, 1), "ABC", "B"),
          (-1, (1, 5, 1), "ABC", "AB"),
          (0, (1, 5, 1), "ABC", "BC"),
          (None, (3, 5, 1), "ABC", "AB"),
      ]:
          yield check_squeeze, shape, dim, in_layout, expected_out_layout
  
imports: import numpy
  import nvidia.dali.fn
  import nvidia.dali.types
  import warnings
  from numpy.testing import assert_array_equal
  from nvidia.dali import pipeline_def
  from nvidia.dali.backend_impl import TensorCPU, TensorListCPU, TensorListGPU
  from nvidia.dali.backend_impl import types
  import nvidia.dali
  from nose_utils import assert_raises
  from nose import SkipTest
  from test_utils import dali_type_to_np, py_buffer_from_address, get_device_memory_info
label_desc: Use image node_id 17 for calling a global function with example usage: test_tensor_cpu_squeeze() without return types