class_docstr: This class manages the coordination process with the consumer coordinator.
docstr: Poll for coordinator events. Only applicable if group_id is set, and
  broker version supports GroupCoordinators. This ensures that the
  coordinator is known, and if using automatic partition assignment,
  ensures that the consumer has joined the group. This also handles
  periodic offset commits if they are enabled.
docstr_tok: ["Poll","for","coordinator","events",".","Only","applicable","if","group_id","is","set",",","and","broker","version","supports","GroupCoordinators",".","This","ensures","that","the","coordinator","is","known",",","and","if","using","automatic","partition","assignment",",","ensures","that","the","consumer","has","joined","the","group",".","This","also","handles","periodic","offset","commits","if","they","are","enabled","."]
code: def poll(self):
      """
      Poll for coordinator events. Only applicable if group_id is set, and
      broker version supports GroupCoordinators. This ensures that the
      coordinator is known, and if using automatic partition assignment,
      ensures that the consumer has joined the group. This also handles
      periodic offset commits if they are enabled.
      """
      if self.group_id is None:
          return
  
      self._invoke_completed_offset_commit_callbacks()
      self.ensure_coordinator_ready()
  
      if (
          self.config["api_version"] >= (0, 9)
          and self._subscription.partitions_auto_assigned()
      ):
          if self.need_rejoin():
              # due to a race condition between the initial metadata fetch and the
              # initial rebalance, we need to ensure that the metadata is fresh
              # before joining initially, and then request the metadata update. If
              # metadata update arrives while the rebalance is still pending (for
              # example, when the join group is still inflight), then we will lose
              # track of the fact that we need to rebalance again to reflect the
              # change to the topic subscription. Without ensuring that the
              # metadata is fresh, any metadata update that changes the topic
              # subscriptions and arrives while a rebalance is in progress will
              # essentially be ignored. See KAFKA-3949 for the complete
              # description of the problem.
              if self._subscription.subscribed_pattern:
                  metadata_update = (
                      self._client.cluster.request_update()
                  )
                  self._client.poll(future=metadata_update)
  
              self.ensure_active_group()
  
          self.poll_heartbeat()
  
      self._maybe_auto_commit_offsets_async()
  
imports: from __future__ import absolute_import, division
  import collections
  import copy
  import functools
  import logging
  import time
  from kafka.vendor import six
  from kafka.coordinator.base import BaseCoordinator, Generation
  from kafka.coordinator.assignors.range import RangePartitionAssignor
  from kafka.coordinator.assignors.roundrobin import RoundRobinPartitionAssignor
  from kafka.coordinator.assignors.sticky.sticky_assignor import StickyPartitionAssignor
  from kafka.coordinator.protocol import ConsumerProtocol
  import kafka.errors
  from kafka.future import Future
  from kafka.metrics import AnonMeasurable
  from kafka.metrics.stats import Avg, Count, Max, Rate
  from kafka.protocol.commit import OffsetCommitRequest, OffsetFetchRequest
  from kafka.structs import OffsetAndMetadata, TopicPartition
  from kafka.util import WeakMethod
label_desc: Use image node_id 10 for calling the ConsumerCoordinator obj's underlying member method code with example usage: obj.poll() without return types