def parse_stop_num(stop_name, stop_id):
    """
    The 2021 Dublin Bus data uses Stop IDs instead of the actual stop
    numbers presented to the public. This method tries to extract the stop
    number from the stop name and if this fails it tries to extract it from
    the ID instead.

    Args
    ---
        stop_name: str
            The stop name as a string

        stop_id: str
            The stop ID as a string

    Returns
    ---
    An int for the extracted stop number
    """

    try:
        stop_num = int(stop_name.split(" ")[-1])
    except ValueError:
        # stop number isn't in the name
        # try parse out of ID instead
        stop_num = int(stop_id.split("DB")[-1])

    return stop_num