code: def _decompress(self, key_offset):
      # Copy of `_read_key_value`, but uses memoryview
      pos = key_offset
      key_size = struct.unpack_from(">i", self._buffer, pos)[0]
      pos += self.KEY_LENGTH
      if key_size != -1:
          pos += key_size
      value_size = struct.unpack_from(">i", self._buffer, pos)[0]
      pos += self.VALUE_LENGTH
      if value_size == -1:
          raise CorruptRecordException(
              "Value of compressed message is None"
          )
      else:
          data = self._buffer[pos : pos + value_size]
  
      compression_type = self.compression_type
      self._assert_has_codec(compression_type)
      if compression_type == self.CODEC_GZIP:
          uncompressed = gzip_decode(data)
      elif compression_type == self.CODEC_SNAPPY:
          uncompressed = snappy_decode(data.tobytes())
      elif compression_type == self.CODEC_LZ4:
          if self._magic == 0:
              uncompressed = lz4_decode_old_kafka(data.tobytes())
          else:
              uncompressed = lz4_decode(data.tobytes())
      return uncompressed
  
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 5 for calling the LegacyRecordBatch obj's underlying member method code with example usage: obj._decompress(key_offset) and returns: uncompressed