code: def expand_dims_pipe(
      shapes, axes=None, new_axis_names=None, layout=None
  ):
      data = fn.external_source(
          lambda: get_data(shapes),
          layout=layout,
          batch=True,
          device="cpu",
      )
      return fn.expand_dims(
          data, axes=axes, new_axis_names=new_axis_names
      )
  
file_path: DALI/dali/test/python/operator_1/test_expand_dims.py
imports: from nvidia.dali import pipeline_def
  import nvidia.dali.fn
  import numpy
  from nose_utils import assert_raises
label_desc: Use image node_id 2 for calling a global function with example usage: expand_dims_pipe(shapes, axes, new_axis_names, layout) and returns: fn