def _count_contributors_in_range(querysets, users, date_range):
    """Of the group ``users``, count how many made a contribution in ``date_range``."""
    start, end = date_range
    retained_users = set()

    for queryset, fields in querysets:
        for field in fields:
            filters = {'%s__in' % field: users, 'created__gte': start, 'created__lt': end}
            retained_users |= set(getattr(o, field) for o in queryset.filter(**filters))

    return len(retained_users)
dataset/ETHPy150Open mozilla/kitsune/kitsune/kpi/cron.py/_count_contributors_in_range/original