def check_shots_vs_bounds(shot_dict, mosaic_bounds, max_out_of_bounds = 3):
    """Checks whether all but *max_out_of_bounds* shots are within mosaic bounds

    Parameters
    ----------
    shot_dict : dict
        A dictionary (see czd_utils.scancsv_to_dict()) with coordinates of all
        shots in a .scancsv file:
            {shot: [x_coords, y_coords], ...}
    mosaic_bounds : list
        A list of bounds to a .Align file (see get_mos_bounds()):
            [min_x, max_x, min_y, max_y]
    max_out_of_bounds : int, optional
        Max number of out-of-bounds shots allowed for a \
        'match' between mosaic and .scancsv. The default is 3.

    Returns
    -------
    Boolean
        True or False, depending on whether all but *max_out_of_bounds* \
        shots are within mosaic bounds

    """
    total_out_of_bounds = 0

    min_x, max_x, min_y, max_y = mosaic_bounds

    for eachcoords in shot_dict.values():
        if not min_x <= eachcoords[0] <= max_x or not min_y <= eachcoords[1] <= max_y:
            total_out_of_bounds += 1

    return total_out_of_bounds <= max_out_of_bounds