def METHOD_NAME(cls, dataframe, start_datetime, end_datetime, gap, **kwargs):
    def date_diff_in_months(row):
        col_start = to_datetime(row[start_datetime])
        col_end = to_datetime(row[end_datetime])
        col_gap = row[gap]
        if col_start is None or col_end is None or col_gap is None:
            return None
        diff_months = (col_end.year - col_start.year) * 12 + (
            col_end.month - col_start.month
        )
        return col_gap == diff_months
    return dataframe.apply(lambda row: date_diff_in_months(row), axis=1)