def _len_categories(date_enrollment, date_exit):
    """Returns a length category for given date-of-enrollment and date-of-exit.
    """
    delta = (date_exit - date_enrollment).days
    if delta < 14:
        return "<2 weeks"
    elif delta >= 14 and delta < 62:
        return "2-9 weeks"
    elif delta >= 62:
        return ">2 months"