class_docstr: Represents a streaming dataset from kafka using consumer groups.
  
  The dataset is created by fetching messages from kafka using consumer clients
  which are part of a consumer group. Owing to the offset management capability of
  the kafka brokers, the dataset can maintain offsets of all the partitions
  without explicit initialization. If the consumer client joins an existing
  consumer group, it will start fetching messages from the already committed offsets.
  To start fetching the messages from the beginning, please join a different consumer group.
  The dataset will be prepared from the committed/start offset until the last offset.
  
  The dataset can be prepared and iterated in the following manner:
  
  >>> import tensorflow_io as tfio
  >>> dataset = tfio.experimental.streaming.KafkaGroupIODataset(
                      topics=["topic1"],
                      group_id="cg",
                      servers="localhost:9092"
                  )
  
  >>> for (message, key) in dataset:
  ...     print(message)
  
  Cases may arise where the consumer read time out issues arise due to
  the consumer group being in a rebalancing state. In order to address that, please
  set `session.timeout.ms` and `max.poll.interval.ms` values in the configuration tensor
  and try again after the group rebalances. For example: considering the kafka cluster
  has been setup with the default settings, `max.poll.interval.ms` would be `300000ms`.
  It can be changed to `8000ms` to reduce the time between pools. Also, the `session.timeout.ms`
  can be changed to `7000ms`. However, the value for `session.timeout.ms` should be
  according to the following relation:
  
  - `group.max.session.timeout.ms` in server.properties > `session.timeout.ms` in the
  consumer.properties.
  - `group.min.session.timeout.ms` in server.properties < `session.timeout.ms` in the
  consumer.properties
  
  >>> dataset = tfio.experimental.streaming.KafkaGroupIODataset(
                      topics=["topic1"],
                      group_id="cg",
                      servers="localhost:9092",
                      configuration=[
                          "session.timeout.ms=7000",
                          "max.poll.interval.ms=8000",
                          "auto.offset.reset=earliest",
                      ],
                  )
  
  In the above example, the `auto.offset.reset` configuration is set to `earliest` so that
  in case the consumer group is being newly created, it will start reading the messages from
  the beginning. If it is not set, it defaults to `latest`. For additional configurations,
  please refer the librdkafka's configurations:
  https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
  
  In addition to the standard streaming functionality, there is added support for a timeout
  based stream. Once the existing data has been fetched, this dataset will block for
  an additional `stream_timeout` milliseconds, for the new messages to be captured.
  
  >>> dataset = tfio.experimental.streaming.KafkaGroupIODataset(
                      topics=["topic1"],
                      group_id="cg",
                      servers="localhost:9092",
                      stream_timeout=30000,
                      configuration=[
                          "session.timeout.ms=7000",
                          "max.poll.interval.ms=8000",
                          "auto.offset.reset=earliest",
                      ],
                  )
  >>> for (message, key) in dataset:
  ...     print(message)
  
  The above loop will run as long as the consumer clients are able to fetch messages
  from the topic(s). However, since we set the `stream_timeout` value to `15000` milliseconds,
  the dataset will wait for any new messages that might be added to the topic for that duration.
  
  As the kafka deployments vary in configuration as per various use-cases, the time required for
  the consumers to fetch a single message might also vary. This timeout value can be adjusted
  using the `message_poll_timeout` parameter.
  
  The `message_poll_timeout` value represents the duration which the consumers
  have to wait while fetching a new message. However, even if we receive a new message
  before the `message_poll_timeout` interval finishes, the consumer doesn't resume the
  consumption but it will wait until the `message_poll_timeout` interval has finished.
  Thus, if we want to block indefinitely until a new message arrives,
  we cannot do it with `message_poll_timeout` alone. This is when the `stream_timeout`
  value comes in, where we can set the value to a very high timeout
  (i.e, block indefinitely) and keep on polling for new messages at
  `message_poll_timeout` intervals.
code: def element_spec(self):
      return self._dataset.element_spec
  
file_path: io/tensorflow_io/python/experimental/kafka_group_io_dataset_ops.py
imports: import sys
  import tensorflow
  from tensorflow_io.python.ops import core_ops
label_desc: Use image node_id 3 for calling the KafkaGroupIODataset obj's underlying member method code with example usage: obj.element_spec() and returns: self