original_docstring: Convert Suds object into a flattened dictionary
docstring: Convert Suds object into a flattened dictionary
docstring_tokens: Convert Suds object into a flattened dictionary
code: def sudsobj_to_dict(sudsobj, key_prefix=""):
      """Convert Suds object into a flattened dictionary"""
      out = {}
      # Handle lists
      if isinstance(sudsobj, list):
          for i, child in enumerate(sudsobj):
              child_key = "{}[{}]".format(key_prefix, i)
              out.update(sudsobj_to_dict(child, key_prefix=child_key))
          return out
      # Handle Primitives
      if not hasattr(sudsobj, "__keylist__"):
          out[key_prefix] = sudsobj
          return out
      # Handle Suds Objects
      for parent_key, parent_val in sudsobject.asdict(sudsobj).items():
          full_parent_key = (
              "{}.{}".format(key_prefix, parent_key) if key_prefix else parent_key
          )
          out.update(sudsobj_to_dict(parent_val, key_prefix=full_parent_key))
      return out
code_tokens: def sudsobj_to_dict ( sudsobj , key_prefix = "" ) : out = { } if isinstance ( sudsobj , list ) : for i , child in enumerate ( sudsobj ) : child_key = "{}[{}]" . format ( key_prefix , i ) out . update ( sudsobj_to_dict ( child , key_prefix = child_key ) ) return out if not hasattr ( sudsobj , "__keylist__" ) : out [ key_prefix ] = sudsobj return out for parent_key , parent_val in sudsobject . asdict ( sudsobj ) . items ( ) : full_parent_key = ( "{}.{}" . format ( key_prefix , parent_key ) if key_prefix else parent_key ) out . update ( sudsobj_to_dict ( parent_val , key_prefix = full_parent_key ) ) return out
short_docstring: Convert Suds object into a flattened dictionary
short_docstring_tokens: Convert Suds object into a flattened dictionary
comment: """Convert Suds object into a flattened dictionary"""$SEP$# Handle lists$SEP$# Handle Primitives$SEP$# Handle Suds Objects