code: def test_shuffling_queue_with_ngrams(synthetic_dataset):
      """Read data without tensorflow shuffling queue and with it (no rowgroup shuffling). Read ngrams
      Check the the order is deterministic within unshuffled read and is random with shuffled read
      """
      fields = {
          0: [TestSchema.id],
          1: [TestSchema.id],
          2: [TestSchema.id],
      }
  
      # Expecting delta between ids to be 1. Setting 1.5 as upper bound
      ngram = NGram(
          fields=fields,
          delta_threshold=1.5,
          timestamp_field=TestSchema.id,
      )
      unshuffled_1, _ = _read_from_tf_tensors(
          synthetic_dataset,
          30,
          shuffling_queue_capacity=0,
          min_after_dequeue=0,
          ngram=ngram,
      )
      unshuffled_2, _ = _read_from_tf_tensors(
          synthetic_dataset,
          30,
          shuffling_queue_capacity=0,
          min_after_dequeue=0,
          ngram=ngram,
      )
  
      shuffled_1, shuffled_1_ngram = _read_from_tf_tensors(
          synthetic_dataset,
          20,
          shuffling_queue_capacity=30,
          min_after_dequeue=29,
          ngram=ngram,
      )
      shuffled_2, _ = _read_from_tf_tensors(
          synthetic_dataset,
          20,
          shuffling_queue_capacity=30,
          min_after_dequeue=29,
          ngram=ngram,
      )
  
      # shuffled_1_ngram is a dictionary of named tuple indexed by time:
      # {0: (tensor, tensor, tensor, ...),
      #  1: (tensor, tensor, tensor, ...),
      #  ...}
      for row_tensor in shuffled_1_ngram.values():
          _assert_all_tensors_have_shape(row_tensor)
  
      # shuffled_1 is a list of dictionaries of named tuples indexed by time:
      # [{0: (tensor, tensor, tensor, ...),
      #  1: (tensor, tensor, tensor, ...),
      #  ...}
      # {0: (tensor, tensor, tensor, ...),
      #  1: (tensor, tensor, tensor, ...),
      #  ...},...
      # ]
      for one_ngram_dict in shuffled_1:
          _assert_expected_rows_data(
              synthetic_dataset.data, one_ngram_dict.values()
          )
  
      def flatten(list_of_ngrams):
          return [row for seq in list_of_ngrams for row in seq.values()]
  
      assert [f.id for f in flatten(unshuffled_1)] == [
          f.id for f in flatten(unshuffled_2)
      ]
  
      assert [f.id for f in flatten(unshuffled_1)] != [
          f.id for f in flatten(shuffled_2)
      ]
      assert [f.id for f in flatten(shuffled_1)] != [
          f.id for f in flatten(shuffled_2)
      ]
  
imports: from __future__ import division
  import datetime
  from calendar import timegm
  from collections import namedtuple
  from contextlib import contextmanager
  from decimal import Decimal
  from functools import wraps
  import inspect
  import numpy
  from packaging import version
  import pytest
  import tensorflow.compat.v1
  from unittest import mock
  from petastorm import make_reader, make_batch_reader, TransformSpec
  from petastorm.ngram import NGram
  from petastorm.tests.test_common import TestSchema
  from petastorm.tf_utils import _sanitize_field_tf_types, _numpy_to_tf_dtypes, _schema_to_tf_dtypes, tf_tensors, _ngrams_generator, _unflatten_and_set_shape
  from petastorm.unischema import Unischema, UnischemaField
label_desc: Use image node_id 15 for calling a global function with example usage: test_shuffling_queue_with_ngrams(synthetic_dataset) and returns: unknown