def make_column_kv_fmt(keys, sep=" "):
    """Return the format function for a key/value pair that lines up all the
    keys and values.
    """
    maxlen = max(len(k) for k in keys) if keys else 1
    return "{{:{:d}s}}{:s}{{!s}}".format(maxlen, sep).format