code: def as_a_dict(self):
          
          index_dict = {
              'ddoc': self._ddoc_id,
              'name': self._name,
              'type': self._type,
              'def': self._def
          }
  
          if self._partitioned:
              index_dict['partitioned'] = True
  
          return index_dict
docs: Displays the index as a dictionary.  This includes the design document
          id, index name, index type, and index definition.
  
          :returns: Dictionary representation of the index as a dictionary