@staticmethod
def _case_of(text):
    """ Return the case-function appropriate for text: upper, lower, title, or just str. """
    if text.isupper():
        return str.upper
    if text[0].isupper():
        return lambda s: s[0].upper() + s[1:]
    return str
