def convert(input):
    if isinstance(input, dict):
        return {convert(key): convert(value) for key, value in input.
            items()}
Python: Convert complex dictionary of strings from Unicode to ASCII