code: def one_input_pipeline(
      def_for_dataset,
      device,
      source,
      external_source_device,
      no_copy,
      batch,
  ):
      """Pipeline accepting single input via external source
  
      Parameters
      ----------
      def_for_dataset : bool
           True if this pipeline will be converted to TF Dataset
      device : str
          device that the Dataset will be placed ("cpu" or "gpu")
      source : callable
          callback for the external source in baseline pipeline otherwise None
      external_source_device : str
          Device that we want the external source in TF dataset to be placed
      """
  
      if def_for_dataset:
          if no_copy is None:
              # If no_copy is None, we infer it automatically and we use no_copy=True when
              # the input memory is matching the external source placement,
              # so the Dataset's placement is the same as external source's device,
              # otherwise for cross-backend we use False.
              no_copy = device == external_source_device
          if batch == "dataset":
              # Special value used in tests, reroute it to the default
              batch = None
          input = fn.external_source(
              name="input_placeholder",
              no_copy=no_copy,
              device=external_source_device,
              batch=batch,
          )
      else:
          input = fn.external_source(
              name="actual_input",
              source=source,
              batch=False,
              device=external_source_device,
          )
      input = input if device == "cpu" else input.gpu()
      processed = fn.cast(input + 10, dtype=dali.types.INT32)
      input_padded, processed_padded = fn.pad([input, processed])
      return input_padded, processed_padded
  
imports: import numpy
  import nvidia.dali
  import nvidia.dali.fn
  import nvidia.dali.plugin.tf
  import tensorflow
  from nose.tools import nottest
  from nvidia.dali import pipeline_def
  from test_utils import RandomlyShapedDataIterator
label_desc: Use image node_id 2 for calling a global function with example usage: one_input_pipeline(def_for_dataset, device, source, external_source_device, no_copy, batch) and returns: input_padded,  processed_padded