def dict_strip_unicode_keys(uni_dict):
    if six.PY3:
        return uni_dict

    return {smart_bytes(key): value for key, value in uni_dict.items()}
Converts a dict of unicode keys into a dict of ascii keys.
dataset/ETHPy150Open django-tastypie/django-tastypie/tastypie/utils/dict.py/dict_strip_unicode_keys