code: def _reconstruct_columns_from_metadata(columns, column_indexes):
      """Construct a pandas MultiIndex from `columns` and column index metadata
      in `column_indexes`.
  
      Parameters
      ----------
      columns : List[pd.Index]
          The columns coming from a pyarrow.Table
      column_indexes : List[Dict[str, str]]
          The column index metadata deserialized from the JSON schema metadata
          in a :class:`~pyarrow.Table`.
  
      Returns
      -------
      result : MultiIndex
          The index reconstructed using `column_indexes` metadata with levels of
          the correct type.
  
      Notes
      -----
      * Part of :func:`~pyarrow.pandas_compat.table_to_blockmanager`
      """
      pd = _pandas_api.pd
      # Get levels and labels, and provide sane defaults if the index has a
      # single level to avoid if/else spaghetti.
      levels = getattr(columns, "levels", None) or [columns]
      labels = _get_multiindex_codes(columns) or [
          pd.RangeIndex(len(level)) for level in levels
      ]
  
      # Convert each level to the dtype provided in the metadata
      levels_dtypes = [
          (
              level,
              col_index.get("pandas_type", str(level.dtype)),
              col_index.get("numpy_type", None),
          )
          for level, col_index in zip_longest(
              levels, column_indexes, fillvalue={}
          )
      ]
  
      new_levels = []
      encoder = operator.methodcaller("encode", "UTF-8")
  
      for level, pandas_dtype, numpy_dtype in levels_dtypes:
          dtype = _pandas_type_to_numpy_type(pandas_dtype)
          # Since our metadata is UTF-8 encoded, Python turns things that were
          # bytes into unicode strings when json.loads-ing them. We need to
          # convert them back to bytes to preserve metadata.
          if dtype == np.bytes_:
              level = level.map(encoder)
          # ARROW-13756: if index is timezone aware DataTimeIndex
          if pandas_dtype == "datetimetz":
              tz = pa.lib.string_to_tzinfo(
                  column_indexes[0]["metadata"]["timezone"]
              )
              level = pd.to_datetime(level, utc=True).tz_convert(tz)
          elif level.dtype != dtype:
              level = level.astype(dtype)
          # ARROW-9096: if original DataFrame was upcast we keep that
          if (
              level.dtype != numpy_dtype
              and pandas_dtype != "datetimetz"
          ):
              level = level.astype(numpy_dtype)
  
          new_levels.append(level)
  
      return pd.MultiIndex(new_levels, labels, names=columns.names)
  
imports: import ast
  from collections.abc import Sequence
  from concurrent import futures
  import concurrent.futures.thread
  from copy import deepcopy
  from itertools import zip_longest
  import json
  import operator
  import re
  import warnings
  import numpy
  import pyarrow
  from pyarrow.lib import _pandas_api, frombytes
label_desc: Use image node_id 32 for calling a global function with example usage: _reconstruct_columns_from_metadata(columns, column_indexes) and returns: pd