code: def function_wrapper_per_sample(
      pipeline,
      function,
      num_outputs,
      from_dlpack,
      to_dlpack,
      *dlpack_inputs,
  ):
      with pipeline:
          arrays = [from_dlpack(dlpack) for dlpack in dlpack_inputs]
          arr_out = function(*arrays)
          if arr_out is None:
              return
          PythonFunction.check_outputs(arr_out, num_outputs)
          if isinstance(arr_out, tuple):
              return tuple(map(lambda t: to_dlpack(t), arr_out))
          else:
              return to_dlpack(arr_out)
  
imports: import nvidia.dali.python_function_plugin
  from nvidia.dali import backend
  from nvidia.dali import ops
  from nvidia.dali.ops import _registry
  from nvidia.dali.data_node import DataNode
  from nvidia.dali.pipeline import Pipeline
  from nvidia.dali.types import CUDAStream
label_desc: Use image node_id 3 for calling the PythonFunction obj's underlying member method code with example usage: obj.function_wrapper_per_sample(pipeline, function, num_outputs, from_dlpack, to_dlpack) and returns: tuple, to_dlpack