def relative_grade_percentage(
    parsed_list, passing_grade, personal_grade, overall_percentage=True
):
    """
    This function calculates the percentage of people that the user's grade
    is above. If overall_percentage is True, then it calculates the above
    taking into account all the grades, otherwise it only considers the passing
    grades.

    :param parsed_list: the parsed list of the grades
    :param passing_grade: the grade passing threshold
    :param overall_percentage: True, when taking into account all the grades,
    False, when considering only the passing grades
    :return: the percentage of grades that you scored above of
    """

    if overall_percentage is False:
        passing_grades_list = (
            [item for item in parsed_list if item >= passing_grade]
        )
        total_grades = len(passing_grades_list)

        lower_grades = (
            [item for item in passing_grades_list if personal_grade > item]
        )

    else:
        total_grades = len(parsed_list)

        lower_grades = (
            [item for item in parsed_list if personal_grade > item]
        )

    total_lower_grades = len(lower_grades)

    if (total_grades > 0):
        relative_grade_percentage = (total_lower_grades / total_grades) * 100

    else:
        relative_grade_percentage = 0.0

    return relative_grade_percentage