code: def test_fn_python_function():
      pipe = Pipeline(1, 1, 0, exec_pipelined=False, exec_async=False)
  
      batch1 = [np.array([1, 2, 3])]
      batch2 = [np.array([2, 3, 4])]
      # we need a context, because we use an operator with potential side-effects (python_function)
      with pipe:
          src = fn.external_source([batch1, batch2])
          out = fn.python_function(src, function=lambda x: x + 1)
          pipe.set_outputs(out)
      pipe.build()
  
      assert np.array_equal(pipe.run()[0].at(0), batch1[0] + 1)
      assert np.array_equal(pipe.run()[0].at(0), batch2[0] + 1)
  
imports: import nvidia.dali.fn
  import nvidia.dali.ops
  from nvidia.dali.pipeline import Pipeline
  import nvidia.dali.types
  import numpy
  from nose_utils import assert_raises
  import sys
  import inspect
  from nose.plugins.attrib import attr
  import nose
label_desc: Use image node_id 6 for calling a global function with example usage: test_fn_python_function() without return types