<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_reporting_data( data, start=None, end=None, max_days=365, allow_billing_period_overshoot=False, ignore_billing_period_gap_for_day_count=False, ):
 """ Filter down to reporting period data. Parameters data : :any:`pandas.DataFrame` or :any:`pandas.Series` The data to filter to reporting data. This data will be filtered down to an acceptable reporting period according to the dates passed as `start` and `end`, or the maximum period specified with `max_days`. start : :any:`datetime.datetime` A timezone-aware datetime that represents the earliest allowable start date for the reporting data, i.e., the earliest date for which data is available after the intervention begins. end : :any:`datetime.datetime` A timezone-aware datetime that represents the latest allowable end date for the reporting data. The stricter of this or `max_days` is used to determine the latest allowable reporting period date. max_days : :any:`int`, default 365 The maximum length of the period. Ignored if `start` is not set. The stricter of this or `end` is used to determine the latest allowable reporting period date. allow_billing_period_overshoot : :any:`bool`, default False If True, count `max_days` from the start of the first billing data period that starts after the `start` date, rather than from the exact `start` date. Otherwise use the exact `start` date as the cutoff. ignore_billing_period_gap_for_day_count : :any:`bool`, default False If True, instead of going forward `max_days` from either the `start` date or the `start` of the first billing period after that date (depending on the value of the `allow_billing_period_overshoot` setting) and excluding the first period that ended after that date, first check to see if excluding or including that period gets closer to a total of `max_days` of data. For example, with `max_days=365`, if an exact 365 period would targeted Feb 15, but the billing period went from Jan 20 to Feb 20, include that period for a total of ~370 days of data, because that's closer to 365 than ~340 days, which would be the total if that period was excluded. If, on the other hand, if that period started Feb 10 and went to Mar 10, exclude the period, because ~360 days of data is closer to than ~390. Returns ------- reporting_data, warnings : :any:`tuple` of (:any:`pandas.DataFrame` or :any:`pandas.Series`, :any:`list` of :any:`eemeter.EEMeterWarning`) Data for only the specified reporting period and any associated warnings. """

    if max_days is not None:
        if end is not None:
            raise ValueError(  # pragma: no cover
                "If max_days is set, end cannot be set: end={}, max_days={}.".format(
                    end, max_days
                )
            )

    start_inf = False
    if start is None:
        # py datetime min/max are out of range of pd.Timestamp min/max
        start_limit = pytz.UTC.localize(pd.Timestamp.min)
        start_inf = True
    else:
        start_limit = start

    end_inf = False
    if end is None:
        end_target = pytz.UTC.localize(pd.Timestamp.max)
        end_inf = True
    else:
        end_target = end

    # copying prevents setting on slice warnings
    data_after_start_limit = data[start_limit:].copy()

    if ignore_billing_period_gap_for_day_count:
        start_limit = data_after_start_limit.index.min()

    if not start_inf and max_days is not None:
        end_target = start_limit + timedelta(days=max_days)

    if allow_billing_period_overshoot:
        # adjust start limit to get a selection closest to max_days
        # also consider bfill for get_loc method - always picks next
        try:
            loc = data_after_start_limit.index.get_loc(end_target, method="nearest")
        except (KeyError, IndexError):  # pragma: no cover
            reporting_data = data_after_start_limit
            end_limit = end_target
        else:
            end_limit = data_after_start_limit.index[loc]
            reporting_data = data_after_start_limit[:end_limit].copy()

    else:
        # use hard limit for baseline start
        end_limit = end_target
        reporting_data = data_after_start_limit[:end_limit].copy()

    if reporting_data.dropna().empty:
        raise NoReportingDataError()

    reporting_data.iloc[-1] = np.nan

    data_end = data.index.max()
    data_start = data.index.min()
    return (
        reporting_data,
        _make_reporting_warnings(
            end_inf, start_inf, data_start, data_end, start_limit, end_limit
        ),
    )