from typing import List
from typing import Dict


def make_axes_wrap(axes: List[str], x_axis_wrap: List[str],
                   y_axis_wrap: List[str]) -> Dict[str, List[str]]:
  """Returns an axes_wrap dict for tensorsotre metadata."""
  axes_wrap = {}
  if x_axis_wrap is not None:
    if 'X' not in axes:
      raise ValueError('X must be in axes if x_axis_wrap. is specified.')
    axes_wrap['X'] = list(x_axis_wrap)
  if y_axis_wrap is not None:
    if 'Y' not in axes:
      raise ValueError('Y must be in axes if y_axis_wrap. is specified.')
    axes_wrap['Y'] = list(y_axis_wrap)
  return axes_wrap