from typing import Dict
import random


def choose_neighbor(neighbors: list,
                    labels: Dict[int, int]) -> int:
    """
    Choose a neighbor from a propagation starting node.

    Args:
        neigbours (list): List of neighbors.
        labels (Dict): Dictionary with community labels as values and nodes as keys.

    Returns:
        (int): Community label of the node.
    """

    scores = {}
    for neighbor in neighbors:
        neighbor_label = labels[neighbor]
        if neighbor_label in scores.keys():
            scores[neighbor_label] = scores[neighbor_label] + 1
        else:
            scores[neighbor_label] = 1

    top = []
    for key, val in scores.items():
        if val == max(scores.values()):
            top.append(key)

    return random.sample(top, 1)[0]