code: def test_snappy_decode_xerial():
      header = b"\x82SNAPPY\x00\x00\x00\x00\x01\x00\x00\x00\x01"
      random_snappy = snappy_encode(
          b"SNAPPY" * 50, xerial_compatible=False
      )
      block_len = len(random_snappy)
      random_snappy2 = snappy_encode(
          b"XERIAL" * 50, xerial_compatible=False
      )
      block_len2 = len(random_snappy2)
  
      to_test = (
          header
          + struct.pack("!i", block_len)
          + random_snappy
          + struct.pack("!i", block_len2)
          + random_snappy2
      )
      assert snappy_decode(to_test) == (b"SNAPPY" * 50) + (
          b"XERIAL" * 50
      )
  
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 4 for calling a global function with example usage: test_snappy_decode_xerial() without return types