code: def _read_all_headers(self):
      pos = 0
      msgs = []
      buffer_len = len(self._buffer)
      while pos < buffer_len:
          header = self._read_header(pos)
          msgs.append((header, pos))
          pos += self.LOG_OVERHEAD + header[1]  # length
      return msgs
  
imports: import struct
  import time
  from kafka.record.abc import ABCRecord, ABCRecordBatch, ABCRecordBatchBuilder
  from kafka.record.util import calc_crc32
  from kafka.codec import gzip_encode, snappy_encode, lz4_encode, lz4_encode_old_kafka, gzip_decode, snappy_decode, lz4_decode, lz4_decode_old_kafka
  import kafka.codec
  from kafka.errors import CorruptRecordException, UnsupportedCodecError
label_desc: Use image node_id 7 for calling the LegacyRecordBatch obj's underlying member method code with example usage: obj._read_all_headers() and returns: msgs