docs: def convert_to_dict(item):
      '''Examine an item of any type and return a true dictionary.
  
      If the item is already a dictionary, then the item is returned as-is. Easy.
  
      Otherwise, it attempts to interpret it. So far, this routine can handle:
      
      * a class, function, or anything with a .__dict__ entry
      * a legacy mongoEngine document (a class for MongoDb handling)
      * a list (index positions are used as keys)
      * a generic object that is iterable
      * a generic object with members
  
      .. versionadded:: 0.0.4
  
      :param item:
          Any object such as a variable, instance, or function.
      :returns:
          A true dictionary. If unable to get convert 'item', then an empty dictionary '{}' is returned.
      '''
      # get type
      actual_type = detect_type(item)
      # given the type, do conversion
      if actual_type=="dict":
          return item
      elif actual_type=="list":
          temp = {}
          ctr = 0
          for entry in item:
              temp[ctr]=entry
              ctr += 1
          return temp
      elif actual_type=="mongoengine":
          return item.__dict__['_data']
      elif actual_type=="class":
          return item.__dict__
      elif actual_type=="iterable_dict":
          # for a 'iterable_dict' create a real dictionary for a ALMOST-dict object.
          d = {}
          for key in item: # NO, you can't use iteritems(). The method might not exist.
              d[key] = item[key]
          return d
      elif actual_type=="object":
          tuples = getmembers(item)
          d = {}
          for (key, value) in tuples:
              d[key] = value
          return d
      return {}