code: def test_metadata_exceeds_message_size():
      # ARROW-13655: Thrift may enable a default message size that limits
      # the size of Parquet metadata that can be written.
      NCOLS = 1000
      NREPEATS = 4000
  
      table = pa.table(
          {str(i): np.random.randn(10) for i in range(NCOLS)}
      )
  
      with pa.BufferOutputStream() as out:
          pq.write_table(table, out)
          buf = out.getvalue()
  
      original_metadata = pq.read_metadata(pa.BufferReader(buf))
      metadata = pq.read_metadata(pa.BufferReader(buf))
      for i in range(NREPEATS):
          metadata.append_row_groups(original_metadata)
  
      with pa.BufferOutputStream() as out:
          metadata.write_metadata_file(out)
          buf = out.getvalue()
  
      metadata = pq.read_metadata(pa.BufferReader(buf))
  
imports: import datetime
  import decimal
  from collections import OrderedDict
  import io
  import numpy
  import pytest
  import pyarrow
  from pyarrow.tests.parquet.common import _check_roundtrip, make_sample_file
  from pyarrow.fs import LocalFileSystem
  from pyarrow.tests import util
label_desc: Use image node_id 19 for calling a global function with example usage: test_metadata_exceeds_message_size() without return types