def _count_contributors_in_range(querysets, users, 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)

def _count_contributors_in_range ( querysets , users , 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 )
of the group users .