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

https://github.com/localstack/localstack/blob/5a5edcd9d9ccbd6a56f23d71e3a1131b8c814996/localstack/utils/common.py#L324
return json.loads(self.to_json())
    @classmethod
    def from_json(cls, j):
        j = JsonObject.as_dict(j)
        result = cls()
        result.apply_json(j)
        return result
    @classmethod
    def from_json_list(cls, json_list):
        return [cls.from_json(j) for j in json_list]
    @classmethod
    def as_dict(cls, obj):
        if isinstance(obj, dict):
            return obj
        return obj.to_dict()
    def __str__(self):
        return self.to_json()
    def __repr__(self):
        return self.__str__()
class DelSafeDict(dict):
    """Useful when applying jsonpatch. Use it as follows:
        obj.__dict__ = DelSafeDict(obj.__dict__)
        apply_patch(obj.__dict__, patch)
    """
    def __delitem__(self, key, *args, **kwargs):
        self[key] = None
class CaptureOutput(object):