code: def test_ngram_length_1(synthetic_dataset, reader_factory):
      """Test to verify that ngram generalize to support length 1"""
      dataset_dicts = synthetic_dataset.data
      fields = {0: [TestSchema.id, TestSchema.id2]}
      ngram = NGram(
          fields=fields,
          delta_threshold=0.012,
          timestamp_field=TestSchema.id,
      )
      with reader_factory(
          synthetic_dataset.url,
          schema_fields=ngram,
          shuffle_row_groups=True,
          shuffle_row_drop_partitions=3,
      ) as reader:
          for _ in range(10):
              actual = next(reader)
              expected_ngram = _get_named_tuple_from_ngram(
                  ngram, dataset_dicts, actual[min(actual.keys())].id
              )
              _assert_equal_ngram(actual, expected_ngram)
  
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 25 for calling a global function with example usage: test_ngram_length_1(synthetic_dataset, reader_factory) without return types