from typing import Any


def order_spec_dict(spec_dict: dict[str, Any]) -> dict[str, Any]:
    """Returns spec_dict with keys in a specific order. Requires Python 3.6+."""
    if 'exclude' in spec_dict:
        spec_dict['exclude'] = order_spec_dict(spec_dict['exclude'])
    ordered_spec_dict: dict[str, Any] = {}
    for key in ['dataset_labels', 'taxa', 'exclude', 'max_count', 'prioritize']:
        if key in spec_dict:
            ordered_spec_dict[key] = spec_dict[key]
    return ordered_spec_dict