def swap_axes(a, axis1, axis2):
    """Swaps two axes of an array, expanding the array if necessary."""
    shape_pad_right = max(axis1 - a.ndim + 1, axis2 - a.ndim + 1, 0)
    shape_pad_left = max(-axis1 - a.ndim, -axis2 - a.ndim, 0)
    print('TODO')
