<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_billing_cycle_number(self, billing_cycle):
 """Gets the 1-indexed number of the billing cycle relative to the provided billing cycle"""

        begins_before_initial_date = billing_cycle.date_range.lower < self.initial_billing_cycle.date_range.lower
        if begins_before_initial_date:
            raise ProvidedBillingCycleBeginsBeforeInitialBillingCycle(
                '{} precedes initial cycle {}'.format(billing_cycle, self.initial_billing_cycle)
            )

        billing_cycle_number = BillingCycle.objects.filter(
            date_range__contained_by=DateRange(
                self.initial_billing_cycle.date_range.lower,
                billing_cycle.date_range.upper,
                bounds='[]',
            ),
        ).count()

        return billing_cycle_number