@staticmethod
def sort_prefixes(key):
    """
        Returns a numeric value for a named prefix mode: higher ranks have lower values
        (sorted first), and lower ranks have higher values (sorted last).

        This function essentially implements a sorted() key function for named prefix modes.
        """
    values = {'owner': 0, 'admin': 100, 'op': 200, 'halfop': 300, 'voice': 500}
    return values.get(key, 1000)
