Modify the keys in |dct| to be valid attribute names.

def make_keys_safe(dct):
    """Modify the keys in |dct| to be valid attribute names."""
    result = {}
    for key, val in dct.items():
        key = key.replace('-', '_')
        if key in keyword.kwlist:
            key = key + '_'
        result[key] = val
    return result