def number_of_occurrences(element, sample):
    """
    Function that returns the number of occurrences of an element in an array.
    :param element: an integer value.
    :param sample: an array of integers.
    :return: the number of occurrences of an element in an array.
    """
    return sample.count(element)