from collections import Counter


def _get_majority_class(y):
    """Get the majority class.

    Note that if two or more classes have the same occurrences, one of them is returned arbitrarily.
    """
    mc = Counter(y).most_common()
    return mc[0][0]