def to_json_dict(self, preserve_ro=False):
        dic = {}
        for name, attr in six.iteritems(self._get_attributes()):
            if not preserve_ro and attr and not attr.rw:
                continue
            try:
                value = getattr(self, name)
                if value is not None:
                    if attr:
                        dic[name] = attr.to_json(value, preserve_ro)
                    else:
                        dic[name] = value
            except __HOLE__:
                pass
        return dic
dataset/ETHPy150Open openstack/sahara/sahara/plugins/cdh/client/types.py/BaseApiObject.to_json_dict