code: def test_num_output():
      """Test that a proper number of outputs is produced, depending on arguments"""
      inp = fn.external_source(data, batch=False)
      assert len(fn.segmentation.random_object_bbox(inp)) == 2
      for label_out_param in [None, False, True]:
          label_out = 1 if label_out_param else 0
          for format, num_box_outputs in [
              ("anchor_shape", 2),
              ("start_end", 2),
              ("box", 1),
          ]:
              assert (
                  count_outputs(
                      fn.segmentation.random_object_bbox(
                          inp,
                          format=format,
                          output_class=label_out_param,
                      )
                  )
                  == label_out + num_box_outputs
              )
  
imports: from nose_utils import assert_raises
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.ops
  import numpy
  import scipy.ndimage
  import scipy.ndimage.measurements
  import random
  from test_utils import check_batch, np_type_to_dali
  from nose.tools import nottest
  from nose.plugins.attrib import attr
label_desc: Use image node_id 2 for calling a global function with example usage: test_num_output() without return types