def _find_player(player_index, summary):
    """Find player in summary data."""
    player = [player for player in summary['players'] if player['index'] == player_index]
    if not player:
        raise ValueError('player not found')
    return player[0]