# Path: kardboard/app.py
#     DEBUG_TOOLBAR = True
#     DEBUG_TOOLBAR = False
#     SENTRY_SUPPORT = True
#     SENTRY_SUPPORT = False
# def get_app():
# 
# Path: kardboard/util.py
# def now():
#     return datetime.datetime.now()
# 
# def make_end_date(year=None, month=None, day=None, date=None):
#     end_date = munge_date(year, month, day, date)
#     end_date = end_date.replace(hour=23, minute=59, second=59)
#     return end_date
# 
# def make_start_date(year=None, month=None, day=None, date=None):
#     start_date = munge_date(year, month, day, date)
#     start_date = start_date.replace(hour=23, minute=59, second=59)
#     start_date = start_date.replace(hour=0, minute=0, second=0)
#     return start_date
# 
# def average(values):
#     """Computes the arithmetic mean of a list of numbers.
# 
#     >>> print average([20, 30, 70])
#     40.0
#     """
#     try:
#         return stats.mean(values)
#     except ZeroDivisionError:
#         return None


from kardboard.app import app
from kardboard.util import (
    now,
    make_end_date,
    make_start_date,
    average,
)
        from kardboard.models import Kard
        from kardboard.models import ReportGroup
        from kardboard.models import Kard
        from kardboard.models import ReportGroup


def report_on_cards(cards):
    data = {}
    for k in cards:
        class_cards = data.get(k.service_class.get('name'), [])
        class_cards.append(k)
        data[k.service_class.get('name')] = class_cards

    total = sum([len(v) for k, v in data.items()])

    report = {}
    for classname, cards in data.items():
        sclass = cards[0].service_class

# Path: kardboard/app.py
#     DEBUG_TOOLBAR = True
#     DEBUG_TOOLBAR = False
#     SENTRY_SUPPORT = True
#     SENTRY_SUPPORT = False
# def get_app():
# 
# Path: kardboard/util.py
# def now():
#     return datetime.datetime.now()
# 
# def make_end_date(year=None, month=None, day=None, date=None):
#     end_date = munge_date(year, month, day, date)
#     end_date = end_date.replace(hour=23, minute=59, second=59)
#     return end_date
# 
# def make_start_date(year=None, month=None, day=None, date=None):
#     start_date = munge_date(year, month, day, date)
#     start_date = start_date.replace(hour=23, minute=59, second=59)
#     start_date = start_date.replace(hour=0, minute=0, second=0)
#     return start_date
# 
# def average(values):
#     """Computes the arithmetic mean of a list of numbers.
# 
#     >>> print average([20, 30, 70])
#     40.0
#     """
#     try:
#         return stats.mean(values)
#     except ZeroDivisionError:
#         return None


# Path: kardboard/models/serviceclassrecord.py
from kardboard.app import app
from kardboard.util import (
    now,
    make_end_date,
    make_start_date,
    average,
)
        from kardboard.models import Kard
        from kardboard.models import ReportGroup
        from kardboard.models import Kard
        from kardboard.models import ReportGroup



def report_on_cards(cards):
    data = {}
    for k in cards:
        class_cards = data.get(k.service_class.get('name'), [])
        class_cards.append(k)
        data[k.service_class.get('name')] = class_cards

    total = sum([len(v) for k, v in data.items()])

    report = {}
    for classname, cards in data.items():
        sclass = cards[0].service_class

        cycle_time_average = int(round(average(