class_docstr: Base class for tf.data service tests.
docstr: Validates results from a `make_coordinted_read_dataset` dataset.
  
  Each group of `num_consumers` results should be consecutive, indicating that
  they were produced by the same worker.
  
  Args:
    results: The elements produced by the dataset.
    num_consumers: The number of consumers.
docstr_tok: ["Validates","results","from","a","`","make_coordinted_read_dataset","`","dataset",".","Each","group","of","`","num_consumers","`","results","should","be","consecutive",",","indicating","that","they","were","produced","by","the","same","worker",".","Args",":","results",":","The","elements","produced","by","the","dataset",".","num_consumers",":","The","number","of","consumers","."]
code: def checkCoordinatedReadGroups(self, results, num_consumers):
      """Validates results from a `make_coordinted_read_dataset` dataset.
  
      Each group of `num_consumers` results should be consecutive, indicating that
      they were produced by the same worker.
  
      Args:
        results: The elements produced by the dataset.
        num_consumers: The number of consumers.
      """
      groups = [
          results[start : start + num_consumers]
          for start in range(0, len(results), num_consumers)
      ]
      incorrect_groups = []
      for group in groups:
          # Check that each group of `num_consumers` results are consecutive.
          for offset in range(1, len(group)):
              if group[0] + offset != group[offset]:
                  incorrect_groups.append(group)
                  break
      self.assertEmpty(
          incorrect_groups,
          "Incorrect groups: {}.\nAll groups: {}".format(
              incorrect_groups, groups
          ),
      )
  
imports: import os
  import shutil
  import tempfile
  from tensorflow.core.protobuf import service_config_pb2
  from tensorflow.python.data.experimental.ops import data_service_ops
  from tensorflow.python.data.experimental.service import server_lib
  from tensorflow.python.data.kernel_tests import test_base
  from tensorflow.python.data.ops import dataset_ops
  from tensorflow.python.framework import combinations
  from tensorflow.python.framework import dtypes
  from tensorflow.python.ops import math_ops
  from tensorflow.python.platform import googletest
label_desc: Use image node_id 8 for calling the TestBase obj's underlying member method code with example usage: obj.checkCoordinatedReadGroups(results, num_consumers) without return types