code: def _prepare_read_metadata(metadata):
      """Convert saved metadata back from JSON."""
      if metadata is not None:
          pd = _check_pandas_installed(strict=False)
          # use json.loads because this preserves ordering
          # (which is necessary for round-trip equivalence)
          metadata = json.loads(metadata, object_pairs_hook=OrderedDict)
          assert isinstance(metadata, list)
          if pd:
              metadata = pd.DataFrame.from_records(metadata)
              assert isinstance(metadata, pd.DataFrame)
      return metadata
  
imports: import json
  import logging
  from collections import OrderedDict
  from copy import deepcopy
  import numpy
  from ._logging import verbose, warn
  from .check import _check_pandas_installed, _check_preload, _validate_type
  from .numerics import _time_mask, object_hash, object_size
label_desc: Use image node_id 3 for calling a global function with example usage: _prepare_read_metadata(metadata) and returns: metadata