def getCorrespondingWindow(index, windows):
    """
    Finds the corresponding window to the each predicted anomaly
    :param index (type:int): index of predicted anomaly point
    :param windows (type list of tuples (start, end)): list of true anomaly windows
    :return (typ: tuple): anomaly window if point lies inside it else the preceding window
    """
    
    for i, window in enumerate(windows):
        if window[0] <= index and (i == len(windows)-1 or index < windows[i+1][0]):
            return window