def parse_function_type(parser):
    """Create a mutually exclusive selection group for datasets, methods and metrics."""
    selection_group = parser.add_mutually_exclusive_group(required=True)
    selection_group.add_argument(
        "--datasets",
        dest="function_type",
        action="store_const",
        const="DATASETS",
        help="List datasets from the selected task",
    )
    selection_group.add_argument(
        "--methods",
        dest="function_type",
        action="store_const",
        const="METHODS",
        help="List methods from the selected task",
    )
    selection_group.add_argument(
        "--metrics",
        dest="function_type",
        action="store_const",
        const="METRICS",
        help="List metrics from the selected task",
    )
    return selection_group