code: def test_read_write_serde_v0_v1_no_compression(magic):
      builder = LegacyRecordBatchBuilder(
          magic=magic, compression_type=0, batch_size=9999999
      )
      builder.append(0, timestamp=9999999, key=b"test", value=b"Super")
      buffer = builder.build()
  
      batch = LegacyRecordBatch(bytes(buffer), magic)
      msgs = list(batch)
      assert len(msgs) == 1
      msg = msgs[0]
  
      assert msg.offset == 0
      assert msg.timestamp == (9999999 if magic else None)
      assert msg.timestamp_type == (0 if magic else None)
      assert msg.key == b"test"
      assert msg.value == b"Super"
      assert (
          msg.checksum
          == (-2095076219 if magic else 278251978) & 0xFFFFFFFF
      )
  
file_path: kafka-python/test/record/test_legacy_records.py
imports: from __future__ import unicode_literals
  import pytest
  from mock import patch
  from kafka.record.legacy_records import LegacyRecordBatch, LegacyRecordBatchBuilder
  import kafka.codec
  from kafka.errors import UnsupportedCodecError
label_desc: Use image node_id 1 for calling a global function with example usage: test_read_write_serde_v0_v1_no_compression(magic) without return types