code: def test_estimate_size_in_bytes_bigger_than_batch(magic):
      key = b"Super Key"
      value = b"1" * 100
      estimate_size = LegacyRecordBatchBuilder.estimate_size_in_bytes(
          magic, compression_type=0, key=key, value=value
      )
  
      builder = LegacyRecordBatchBuilder(
          magic=magic, compression_type=0, batch_size=9999999
      )
      builder.append(0, timestamp=9999999, key=key, value=value)
      buf = builder.build()
      assert (
          len(buf) <= estimate_size
      ), "Estimate should always be upper bound"
  
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 4 for calling a global function with example usage: test_estimate_size_in_bytes_bigger_than_batch(magic) without return types