def parse_winner(turn, log, attacker, defender):
    """
    parses round winner from log
    :param turn: simulation round
    :param log: log file
    :param attacker: attacker nation id
    :param defender: defender nation id
    :return: dictionary with the nation that won the turn
    """

    p_loc = log.find('got turn info for player') + 25
    player = int(log[p_loc:].split('\n')[0])
    pd_log_string = log.find('whatPD')

    # Define Winner based on Province Defense at Battle Province
    winner = None
    if pd_log_string > 0 and player == attacker:  # Player is attacker and won battle
        winner = attacker
    elif pd_log_string > 0 and player == defender:  # Player is defender and won battle
        winner = defender
    elif pd_log_string == -1 and player == attacker:  # Player is attacker lost battle
        winner = defender
    elif pd_log_string == -1 and player == defender:  # Player is defender and list battle
        winner = attacker

    turn_score = {
        'Turn': turn,
        'Nation': winner
    }

    return turn_score