def calculate_group_counts(messages, user_email):
 res = defaultdict(int)
 for msg in messages:
  participants = _get_participants(msg, [user_email])
  if (len(participants) >= MIN_GROUP_SIZE):
   res[', '.join(participants)] += 1
 return res

def calculate_group_counts ( messages , user_email ) : res = defaultdict ( int ) for msg in messages : participants = _get_participants ( msg , [ user_email ] ) if ( len ( participants ) >= MIN_GROUP_SIZE ) : res [ ', ' . join ( participants ) ] += 1 return res
strips out most of the logic from calculate_group_scores algorithm and just returns raw counts for each group .