code: def test_jax_peekable_iterator_peek_async_result_before_next():
      # given
      pipe = pipeline_def(iterator_function_def)(
          batch_size=batch_size, num_threads=4, device_id=0
      )
  
      # when
      iterator = DALIPeekableIterator(
          [pipe], ["data"], reader_name="reader"
      )
  
      # then
      assert iterator.element_spec == {
          "data": ArraySpec(dtype=jnp.int32, shape=batch_shape)
      }
  
      for i in range(5):
          peeked_output = iterator.peek_async()
          peeked_output = peeked_output.result()
          output = iterator.next()
  
          assert jnp.array_equal(
              output["data"], peeked_output["data"]
          ), f"output: {output['data']}, peeked_output: {peeked_output['data']}"
  
file_path: DALI/dali/test/python/jax_plugin/test_peekable_iterator.py
imports: import jax.numpy
  from nvidia.dali.pipeline import pipeline_def
  from nvidia.dali.plugin.jax.clu import DALIGenericPeekableIterator
  from nvidia.dali.plugin.jax.iterator import DALIGenericIterator
  from utils import iterator_function_def
  from clu.data.dataset_iterator import ArraySpec
  from nose_utils import raises
  import time
  import inspect
  from utils import pipeline_with_variable_shape_output
label_desc: Use image node_id 2 for calling a global function with example usage: test_jax_peekable_iterator_peek_async_result_before_next() without return types