def scale_image(ar, n):
    """Given a 2d numpy array, return a version of the array created by
    replacing each cell with an n by n square of cells.

    This is useful if you don't want each cell of your cellular automaton
    picture to appear larger than 1 pixel. """
    return ar.repeat(n, axis=0).repeat(n, axis=1)
