def get_data_filtered_accident_date_for_year(data, year, condition_boolean):
    """
    This function filters out the data against the year that has been provided, based on the boolean value that is
    given.
    :param data: pandas data frame which has the column for the date
    :param year: a string value for the year
    :param condition_boolean: either True or False
    :return: a filtered pandas data frame either containing the rows for the year provided or excluding the years
    depending on the value of the condition_boolean parameter
    """

    return data[data.ACCIDENTDATE.str.contains(year) == condition_boolean].reset_index(drop=True)