def get_unavailable_group_ids_percent(period=30, periods=40):
    results = []
    today = now().date()
    today -= datetime.timedelta(days=today.day)
    for dt in datetime_range(today, period=period, periods=periods):
        dte = dt + datetime.timedelta(days=period)
        items = HitGroupContent.objects.filter(
            first_crawl__start_time__gt=dt, first_crawl__start_time__lt=dte
            ).only('group_id_hashed')
        hashed = len([i for i in items if i.group_id_hashed])
        percent = len(items) * 100 / float(hashed) if len(items) != 0 else 0
        results.append((dt, percent))
        print "{0} {1}".format(*results[-1])
    return results
dataset/ETHPy150Open ipeirotis/Mturk-Tracker/app/mturk/main/monitoring.py/get_unavailable_group_ids_percent/swapped operands of `/`