code: def _test_partially_utilized_es_old_style(usage_mask):
      # check that the build time error on unused external source does not interfere
      # with external sources that are manually fed by user provided code
  
      num_outputs = len(usage_mask)
      batch_size = 16
      batch = np.array(list(range(batch_size * 1024))).reshape(
          batch_size, 16, 16, 4
      )
  
      class OldStylePipe(Pipeline):
          def __init__(self, *args, **kwargs):
              super().__init__(*args, **kwargs)
              self.inp = ops.ExternalSource(num_outputs=num_outputs)
              self.gb = ops.GaussianBlur(window_size=3)
  
          def define_graph(self):
              self.all_inputs = self.inp()
              assert len(self.all_inputs) == num_outputs
              self.utilized_inputs = [
                  inp
                  for inp, is_used in zip(self.all_inputs, usage_mask)
                  if is_used
              ]
              return tuple(self.gb(inp) for inp in self.utilized_inputs)
  
          def iter_setup(self):
              assert len(self.utilized_inputs) == sum(usage_mask)
              for out in self.utilized_inputs:
                  self.feed_input(out, batch)
  
      pipe = OldStylePipe(
          batch_size=batch_size, num_threads=4, device_id=0
      )
      pipe.build()
      pipe.run()
  
imports: import random
  import nvidia.dali.fn
  import nvidia.dali.ops
  import nvidia.dali.types
  import numpy
  from nvidia.dali import Pipeline, pipeline_def
  from test_utils import check_batch
  from nose_utils import raises, assert_warns, assert_raises
  from nvidia.dali.types import DALIDataType
  from numpy.random import default_rng
label_desc: Use image node_id 27 for calling a global function with example usage: _test_partially_utilized_es_old_style(usage_mask) and returns: tuple