code: def test_ngram_delta_small_threshold_tf(
      reader_factory, dataset_range_0_99_5
  ):
      """Test to verify that a small threshold work in ngrams."""
  
      fields = {
          0: [
              TestSchema.id,
              TestSchema.id2,
              TestSchema.image_png,
              TestSchema.matrix,
          ],
          1: [TestSchema.id, TestSchema.id2, TestSchema.sensor_name],
      }
      ngram = NGram(
          fields=fields,
          delta_threshold=1,
          timestamp_field=TestSchema.id,
      )
      with reader_factory(
          dataset_range_0_99_5.url, schema_fields=ngram
      ) as reader:
          with tf.Session() as sess:
              with pytest.raises(tf.errors.OutOfRangeError):
                  sess.run(tf_tensors(reader))
  
imports: from decimal import Decimal
  import numpy
  import pytest
  import tensorflow.compat.v1
  from unittest import mock
  from petastorm import make_reader
  from petastorm.ngram import NGram
  from petastorm.tests.conftest import SyntheticDataset, maybe_cached_dataset
  from petastorm.tests.test_common import create_test_dataset, TestSchema
  from petastorm.tests.test_tf_utils import create_tf_graph
  from petastorm.tf_utils import tf_tensors
label_desc: Use image node_id 21 for calling a global function with example usage: test_ngram_delta_small_threshold_tf(reader_factory, dataset_range_0_99_5) without return types