docstr: Returns previously fetched records and updates consumed offsets.
  
  Arguments:
      max_records (int): Maximum number of records returned. Defaults
          to max_poll_records configuration.
  
  Raises:
      OffsetOutOfRangeError: if no subscription offset_reset_strategy
      CorruptRecordException: if message crc validation fails (check_crcs
          must be set to True)
      RecordTooLargeError: if a message is larger than the currently
          configured max_partition_fetch_bytes
      TopicAuthorizationError: if consumer is not authorized to fetch
          messages from the topic
  
  Returns: (records (dict), partial (bool))
      records: {TopicPartition: [messages]}
      partial: True if records returned did not fully drain any pending
          partition requests. This may be useful for choosing when to
          pipeline additional fetch requests.
code: def fetched_records(self, max_records=None, update_offsets=True):
      """Returns previously fetched records and updates consumed offsets.
  
      Arguments:
          max_records (int): Maximum number of records returned. Defaults
              to max_poll_records configuration.
  
      Raises:
          OffsetOutOfRangeError: if no subscription offset_reset_strategy
          CorruptRecordException: if message crc validation fails (check_crcs
              must be set to True)
          RecordTooLargeError: if a message is larger than the currently
              configured max_partition_fetch_bytes
          TopicAuthorizationError: if consumer is not authorized to fetch
              messages from the topic
  
      Returns: (records (dict), partial (bool))
          records: {TopicPartition: [messages]}
          partial: True if records returned did not fully drain any pending
              partition requests. This may be useful for choosing when to
              pipeline additional fetch requests.
      """
      if max_records is None:
          max_records = self.config["max_poll_records"]
      assert max_records > 0
  
      drained = collections.defaultdict(list)
      records_remaining = max_records
  
      while records_remaining > 0:
          if not self._next_partition_records:
              if not self._completed_fetches:
                  break
              completion = self._completed_fetches.popleft()
              self._next_partition_records = self._parse_fetched_data(
                  completion
              )
          else:
              records_remaining -= self._append(
                  drained,
                  self._next_partition_records,
                  records_remaining,
                  update_offsets,
              )
      return dict(drained), bool(self._completed_fetches)
  
imports: from __future__ import absolute_import
  import collections
  import copy
  import logging
  import random
  import sys
  import time
  from kafka.vendor import six
  import kafka.errors
  from kafka.future import Future
  from kafka.metrics.stats import Avg, Count, Max, Rate
  from kafka.protocol.fetch import FetchRequest
  from kafka.protocol.offset import OffsetRequest, OffsetResetStrategy, UNKNOWN_OFFSET
  from kafka.record import MemoryRecords
  from kafka.serializer import Deserializer
  from kafka.structs import TopicPartition, OffsetAndTimestamp
label_desc: Use image node_id 13 for calling the Fetcher obj's underlying member method code with example usage: obj.fetched_records(max_records, update_offsets) and returns: dict,  bool