def _json_format_dict(data, pretty=False):

    if pretty:
        return json.dumps(data, sort_keys=True, indent=2)
    else:
        return json.dumps(data)
Serialize data to a JSON formated str
dataset/ETHPy150Open openshift/openshift-ansible/inventory/libvirt/hosts/libvirt_generic.py/_json_format_dict