def serialize(obj, **options):

    #round-trip this through JSON to avoid OrderedDict types
    # there's probably a more performant way to do this...
    # TODO remove json round-trip when all dataset will use
    # serializers
    return pprint.pformat(
        json.loads(
            json.dumps(obj),
            object_hook=salt.utils.decode_dict
        ),
        **options
    )
Serialize Python data to a Python string representation (via pprint.format)
dataset/ETHPy150Open saltstack/salt/salt/serializers/python.py/serialize