/usr/lib/python2.7/dist-packages/zeep/helpers.py is in python-zeep 0.23.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | from collections import OrderedDict
from zeep.xsd.valueobjects import CompoundValue
def serialize_object(obj):
"""Serialize zeep objects to native python data structures"""
if obj is None:
return obj
if isinstance(obj, list):
return [serialize_object(sub) for sub in obj]
result = OrderedDict()
for key in obj:
value = obj[key]
if isinstance(value, (list, CompoundValue)):
value = serialize_object(value)
result[key] = value
return result
|