code: def __init__(
      self,
      value,
      key=None,
      magic=0,
      attributes=0,
      crc=0,
      timestamp=None,
  ):
      assert value is None or isinstance(
          value, bytes
      ), "value must be bytes"
      assert key is None or isinstance(key, bytes), "key must be bytes"
      assert (
          magic > 0 or timestamp is None
      ), "timestamp not supported in v0"
  
      # Default timestamp to now for v1 messages
      if magic > 0 and timestamp is None:
          timestamp = int(time.time() * 1000)
      self.timestamp = timestamp
      self.crc = crc
      self._validated_crc = None
      self.magic = magic
      self.attributes = attributes
      self.key = key
      self.value = value
      self.encode = WeakMethod(self._encode_self)
  
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 1 to create a new Message object from inherited base classes: Struct with example: obj = Message(value, key, magic, attributes, crc, timestamp)