code: def __init__(
      self,
      function,
      batch_size,
      iterator,
      data_shape,
      data_layout,
      dtype,
      num_threads=1,
      device_id=0,
      dictionary={},
      default_value=0.0,
  ):
      super().__init__(
          batch_size,
          num_threads,
          device_id,
          exec_async=False,
          exec_pipelined=False,
      )
      self.iterator = iterator
      self.inputs = ops.ExternalSource()
      self.data_shape = data_shape
      self.data_layout = data_layout
  
      def lookup_table_func(input_data):
          return function(
              input_data,
              dictionary=dictionary,
              default_value=default_value,
          )
  
      self.lookup = ops.PythonFunction(
          function=lookup_table_func,
          output_layouts=data_layout,
          batch_processing=False,
      )
      self.cast = ops.Cast(dtype=dtype)
  
imports: import numpy
  import random
  from nvidia.dali import fn, types, ops, pipeline_def
  from nvidia.dali.pipeline import Pipeline
  from test_utils import RandomlyShapedDataIterator
  from test_utils import compare_pipelines
  from nose2.tools import params
label_desc: Use image node_id 1 to create a new LookupTablePythonOpPipeline object from inherited base classes: Pipeline with example: obj = LookupTablePythonOpPipeline(function, batch_size, iterator, data_shape, data_layout, dtype, num_threads, device_id, dictionary, default_value)