from typing import Optional
from typing import List


def parse_match_phase_argument(match_phase: Optional[List[str]] = None) -> List[str]:
    """
    Parse match phase argument.

    :param match_phase: An optional list of match phase types to use in the experiments.
        Currently supported types are 'weak_and' and 'or'. By default the experiments will use
        'weak_and'.

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