def METHOD_NAME(self, dict_):
    """Group keys within a dict by their type and sort within type."""
    type_sorted = sorted(dict_, key=self._type_sort_key)
    type_and_value_sorted = []
    for _, group in itertools.groupby(type_sorted, self._type_sort_key):
        type_and_value_sorted.extend(sorted(group))
    return type_and_value_sorted