def to_marshallable_type(obj):
if obj is None:<EOL><INDENT>return None  <EOL><DEDENT>if hasattr(obj, '<STR_LIT>'):<EOL><INDENT>return obj.__marshallable__()<EOL><DEDENT>if hasattr(obj, '<STR_LIT>'):<EOL><INDENT>return obj  <EOL><DEDENT>return dict(obj.__dict__)<EOL>
Helper for converting an object to a dictionary only if it is not
    dictionary already or an indexable object nor a simple type