code: def decode(cls, data):
      _validated_crc = None
      if isinstance(data, bytes):
          _validated_crc = crc32(data[4:])
          data = io.BytesIO(data)
      # Partial decode required to determine message version
      base_fields = cls.SCHEMAS[0].fields[0:3]
      crc, magic, attributes = [
          field.decode(data) for field in base_fields
      ]
      remaining = cls.SCHEMAS[magic].fields[3:]
      fields = [field.decode(data) for field in remaining]
      if magic == 1:
          timestamp = fields[0]
      else:
          timestamp = None
      msg = cls(
          fields[-1],
          key=fields[-2],
          magic=magic,
          attributes=attributes,
          crc=crc,
          timestamp=timestamp,
      )
      msg._validated_crc = _validated_crc
      return msg
  
imports: from __future__ import absolute_import
  import io
  import time
  from kafka.codec import has_gzip, has_snappy, has_lz4, has_zstd, gzip_decode, snappy_decode, zstd_decode, lz4_decode, lz4_decode_old_kafka
  from kafka.protocol.frame import KafkaBytes
  from kafka.protocol.struct import Struct
  from kafka.protocol.types import Int8, Int32, Int64, Bytes, Schema, AbstractType
  from kafka.util import crc32, WeakMethod
label_desc: Use image node_id 4 for calling the Message obj's underlying member method code with example usage: obj.decode(cls, data) and returns: msg