def _has_collision_with_bbs(existing_bbs, new_bb):
    '\n    Checks if the new rectangle (new_bb) collides with some existing rectangles.\n    '
    a_left = min([x[0] for x in new_bb])
    a_right = max([x[0] for x in new_bb])
    a_bottom = min([x[1] for x in new_bb])
    a_top = max([x[1] for x in new_bb])
    for bb in existing_bbs:
        b_left = min([x[0] for x in bb])
        b_right = max([x[0] for x in bb])
        b_bottom = min([x[1] for x in bb])
        b_top = max([x[1] for x in bb])
        if ((a_left <= b_right) and (b_left <= a_right) and (a_top >= b_bottom) and (b_top >= a_bottom)):
            return True
    return False
Checks if the new rectangle (new_bb) collides with some existing rectangles.
def _has_collision_with_bbs(existing_bbs, new_bb):
    '\n    \n    '
    a_left = min([x[0] for x in new_bb])
    a_right = max([x[0] for x in new_bb])
    a_bottom = min([x[1] for x in new_bb])
    a_top = max([x[1] for x in new_bb])
    for bb in existing_bbs:
        b_left = min([x[0] for x in bb])
        b_right = max([x[0] for x in bb])
        b_bottom = min([x[1] for x in bb])
        b_top = max([x[1] for x in bb])
        if ((a_left <= b_right) and (b_left <= a_right) and (a_top >= b_bottom) and (b_top >= a_bottom)):
            return True
    return False