def blackout(im, bb):
    """
    Set intensity values at all locations on the given image im
    within bounding box bb to 0.

    Parameters
    ----------
    im : ndarray image with region to be blacked out
    bb : bounding box tuple of ints structured as (x_min, x_max, y_min, y_max)

    Returns
    -------
    blacked out : the image with all locations within bounding box bb
        set to 0
    """
    blacked_out = im
    for r in range(blacked_out.shape[0]):
        for c in range(blacked_out.shape[1]):
            if (r >= bb[2]) and (r <= bb[3]):
                if (c >= bb[0]) and (c <= bb[1]):
                    blacked_out[r][c] = 0
    return blacked_out