Ref : https://github.com/python/cpython/pull/25174

https://github.com/localstack/localstack/blob/5a5edcd9d9ccbd6a56f23d71e3a1131b8c814996/localstack/utils/common.py#L324
""" make sure the keys of a JSON are strings (not binary type or other) """
    item_copy = item
    if isinstance(item, list):
        item_copy = []
        for i in item:
            item_copy.append(fix_json_keys(i))
    if isinstance(item, dict):
        item_copy = {}
        for k, v in item.items():
            item_copy[to_str(k)] = fix_json_keys(v)
    return item_copy
def canonical_json(obj):
    return json.dumps(obj, sort_keys=True)
def extract_jsonpath(value, path):
    from jsonpath_rw import parse
    jsonpath_expr = parse(path)
    result = [match.value for match in jsonpath_expr.find(value)]
    result = result[0] if len(result) == 1 else result
    return result
def assign_to_path(target, path, value):
    path = path.split('.')
    for i in range(len(path) - 1):
        target_new = target[path[i]] = target.get(path[i], {})
        target = target_new
    target[path[-1]] = value
def save_file(file, content, append=False):