from typing import Optional
from typing import List


def parse_rank_phase_argument(rank_phase: Optional[List[str]] = None) -> List[str]:
    """
    Parse rank phase argument.

    :param rank_phase: An optional list of rank phase types to use in the experiments.
        Currently supported types are 'bm25' and 'native_rank'. By default the experiments will use
        'bm25'.

    :return: A list with all the match phase types to use in the experiments.
    """
    if not rank_phase:
        rank_phase_list = ["bm25"]
    else:
        assert all(
            [x in ["native_rank", "bm25"] for x in rank_phase]
        ), "rank_phase must be a list containing 'native_rank' and/or 'bm25'."
        rank_phase_list = rank_phase
    return rank_phase_list