def _get_frozen_unfrozen(tensorstore_metadata):
  """Returns two lists with the names of axes that are frozen and unfrozen."""
  frozen = []
  unfrozen = []
  for axis_name in tensorstore_metadata['axes']:
    if axis_name in tensorstore_metadata['axesWrap']:
      wrapped_axes = tensorstore_metadata['axesWrap'][axis_name]
      # The first name in the axesWrap list is the coarsest. It can be expanded.
      unfrozen.extend(wrapped_axes[:1])
      # All later axes names in the axesWrap list is the finer and are frozen.
      frozen.extend(wrapped_axes[1:])
    else:
      unfrozen.append(axis_name)
  return frozen, unfrozen