def blit(im1, im2, pos=None, mask=None):
    """Blit an image over another.

    Blits ``im1`` on ``im2`` as position ``pos=(x,y)``, using the
    ``mask`` if provided.
    """
    if pos is None:
        pos = (0, 0)  # pragma: no cover
    else:
        # Cast to tuple in case pos is not subscriptable.
        pos = tuple(pos)
    im2.paste(im1, pos, mask)
    return im2