def _unique_participants(thread):
    """count unique participants and number of comments in a thread"""
    users = set([thread['user_id']])
    n_replies = 1 + len(thread['children'])
    for reply in thread['children']:
        r_users, r_replies = _unique_participants(reply)
        n_replies += r_replies
        users = users | r_users
    return users, n_replies