def _make_it_3d(img):
shape = img.shape<EOL>if len(shape) == <NUM_LIT:3>:<EOL><INDENT>return img<EOL><DEDENT>elif len(shape) == <NUM_LIT:4> and shape[<NUM_LIT:3>] == <NUM_LIT:1>:<EOL><INDENT>return img[:, :, :, <NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>raise TypeError('<STR_LIT>'.format(shape))<EOL><DEDENT>
Enforce that img is a 3D img-like object, if it is not, raise a TypeError.
    i.e., remove dimensions of size 1.

    Parameters
    ----------
    img: numpy.ndarray
        Image data array

    Returns
    -------
    3D numpy ndarray object