code: def _test_use_foreground(classes, weights, bg):
      inp = fn.external_source(data, batch=False, cycle="quiet")
      pipe = dali.pipeline.Pipeline(10, 4, 0, 12345)
      pipe_outs = fn.segmentation.random_object_bbox(
          inp,
          output_class=True,
          foreground_prob=1,
          classes=classes,
          class_weights=weights,
          background=bg,
      )
      pipe.set_outputs(*pipe_outs)
      pipe.build()
      outs = pipe.run()
      for i in range(len(outs[2])):
          assert outs[2].at(i) != (bg or 0)
  
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 3 for calling a global function with example usage: _test_use_foreground(classes, weights, bg) without return types