def mode_mods_to_int(mode: str) -> int:
    """Converts mode_mods (str) to mode_mods (int)."""

    # NOTE: This is a temporary function to convert the leaderboard mode to an int.
    # It will be removed when the site is fully converted to use the new
    # stats table.

    for mode_num, mode_str in enumerate((
        'vn_std', 'vn_taiko', 'vn_catch', 'vn_mania',
        'rx_std', 'rx_taiko', 'rx_catch',
        'ap_std'
    )):
        if mode == mode_str:
            return mode_num
    else:
        return 0