code: def test_operator_erase_vs_python():
      # layout, shape, axis_names, axes, anchor, shape, fill_value
      rois = [
          ("HWC", (60, 80, 3), "HW", None, (4, 10), (40, 50), 0),
          ("HWC", (60, 80, 3), "HW", None, (4, 10), (40, 50), None),
          (
              "HWC",
              (60, 80, 3),
              "HW",
              None,
              (4, 2, 3, 4),
              (50, 10, 10, 50),
              -1,
          ),
          (
              "HWC",
              (60, 80, 3),
              "HW",
              None,
              (4, 2, 3, 4),
              (50, 10, 10, 50),
              (118, 185, 0),
          ),
          (
              "HWC",
              (60, 80, 3),
              "HW",
              None,
              (4, 2, 3, 4),
              (50, 10, 10, 50),
              "random",
          ),
          ("HWC", (60, 80, 3), "H", None, (4,), (7,), 0),
          ("HWC", (60, 80, 3), "H", None, (4, 15), (7, 8), 0),
          ("HWC", (60, 80, 3), "W", None, (4,), (7,), 0),
          ("HWC", (60, 80, 3), "W", None, (4, 15), (7, 8), 0),
          ("HWC", (60, 80, 3), "W", None, (4, 15), (7, 8), "random"),
          ("HWC", (60, 80, 3), None, (0, 1), (4, 10), (40, 50), 0),
          (
              "HWC",
              (60, 80, 3),
              None,
              (0, 1),
              (4, 2, 3, 4),
              (50, 10, 10, 50),
              0,
          ),
          ("HWC", (60, 80, 3), None, (0,), (4,), (7,), 0),
          ("HWC", (60, 80, 3), None, (0,), (4, 15), (7, 8), 0),
          ("HWC", (60, 80, 3), None, (1,), (4,), (7,), 0),
          ("HWC", (60, 80, 3), None, (1,), (4, 15), (7, 8), 0),
          ("HWC", (60, 80, 3), None, (1,), (4, 15), (7, 8), "random"),
          (
              "DHWC",
              (10, 60, 80, 3),
              "DHW",
              None,
              (2, 4, 15),
              (3, 7, 8),
              0,
          ),
          ("HWC", (60, 80, 1), "HW", None, (4, 15), (7, 8), 0),
          ("XYZ", (60, 80, 3), "XY", None, (4, 10), (40, 50), -1),
      ]
  
      for device in ["cpu"]:
          for batch_size in [1, 8]:
              for (
                  input_layout,
                  input_shape,
                  axis_names,
                  axes,
                  anchor,
                  shape,
                  fill_value,
              ) in rois:
                  assert len(input_layout) == len(input_shape)
                  assert len(anchor) == len(shape)
                  if axis_names:
                      assert axes is None
                      assert len(anchor) % len(axis_names) == 0
                  else:
                      assert len(axes) > 0
                      assert len(anchor) % len(axes) == 0
  
                  yield (
                      check_operator_erase_vs_python,
                      device,
                      batch_size,
                      input_shape,
                      anchor,
                      shape,
                      axis_names,
                      axes,
                      input_layout,
                      fill_value,
                  )
  
imports: from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.ops
  import numpy
  from functools import partial
  from test_utils import compare_pipelines
  from test_utils import RandomDataIterator
label_desc: Use image node_id 5 for calling a global function with example usage: test_operator_erase_vs_python() without return types