def get_period(invoice_date, date_ranges):
    """Returns the period ('month-year') that the invoice_date falls into.

    Args:
        invoice_date (datetime.date): the date the invoice was retrieved
            Example: datetime.date(2018, 12, 31)
        date_ranges (list of tuples): a period ('month-year'), and date ranges for that period
            Example: [
                ('11-2019', datetime.date(2019, 11, 1), datetime.date(2019, 11, 1)),
                ...
            ]

    Returns:
        period (str): the period that the invoice_date is a part of (e.g. '12-2018')
    """
    for period, month_start, month_end in date_ranges:
        if month_end >= invoice_date >= month_start:
            return period