def get_first_crawl_hits_posted_sums(days=200):
    results = []
    for i, dt in enumerate(datetime_range(now().date(), periods=days), start=1):
        tt = time.time()
        result = sum([
            sum([
                crawl.hitgroupstatus_set.get(hit_group_content__id=content.id
                ).hits_available for content in crawl.hitgroupcontent_set.all()
            ]) for crawl in
                Crawl.objects.filter(
                    start_time__gt=dt,
                    start_time__lt=dt + datetime.timedelta(days=1))
        ])
        results.append((dt, result))
        print '{0}. {1} - {2}, {3}s elapsed'.format(
            i, dt, result, time.time() - tt)
    return results
dataset/ETHPy150Open ipeirotis/Mturk-Tracker/app/mturk/main/monitoring.py/get_first_crawl_hits_posted_sums/original