code: def test_snappy_encode_xerial():
      to_ensure = (
          b"\x82SNAPPY\x00\x00\x00\x00\x01\x00\x00\x00\x01"
          b"\x00\x00\x00\x18"
          b"\xac\x02\x14SNAPPY\xfe\x06\x00\xfe\x06\x00\xfe\x06\x00\xfe\x06\x00\x96\x06\x00"
          b"\x00\x00\x00\x18"
          b"\xac\x02\x14XERIAL\xfe\x06\x00\xfe\x06\x00\xfe\x06\x00\xfe\x06\x00\x96\x06\x00"
      )
  
      to_test = (b"SNAPPY" * 50) + (b"XERIAL" * 50)
  
      compressed = snappy_encode(
          to_test, xerial_compatible=True, xerial_blocksize=300
      )
      assert compressed == to_ensure
  
file_path: kafka-python/test/test_codec.py
imports: from __future__ import absolute_import
  import platform
  import struct
  import pytest
  from kafka.vendor.six.moves import range
  from kafka.codec import has_snappy, has_lz4, has_zstd, gzip_encode, gzip_decode, snappy_encode, snappy_decode, lz4_encode, lz4_decode, lz4_encode_old_kafka, lz4_decode_old_kafka, zstd_encode, zstd_decode
  from test.testutil import random_string
label_desc: Use image node_id 5 for calling a global function with example usage: test_snappy_encode_xerial() without return types