def _train_val_test_dict_sort(tvt):
    """

    Sort a dictionary with any of 'train', 'validation', 'test'
    as keys into that order.

    :param tvt: a dictionary containing 'train', 'validation', 'test' keys.
    :type tvt: ``dict``
    :return: ``tvt`` as a list of tuples
    :rtype: ``list``
    :raises ``KeyError``: if any key other than 'train', 'validation' or 'test' is in ``tvt``
    """
    order_dict = {'train': 1, 'validation': 2, 'test': 3}
    return sorted(tvt.items(), key=lambda x: order_dict.get(x[0]))
