code: def delete(self, id=None, q=None, commit=None, softCommit=False, waitFlush=None, waitSearcher=None, handler='update'):  # NOQA: A002
          
          if id is None and q is None:
              raise ValueError('You must specify "id" or "q".')
          elif id is not None and q is not None:
              raise ValueError('You many only specify "id" OR "q", not both.')
          elif id is not None:
              if not isinstance(id, (list, set, tuple)):
                  doc_id = [id]
              else:
                  doc_id = list(filter(None, id))
              if doc_id:
                  m = '<delete>%s</delete>' % ''.join('<id>%s</id>' % i for i in doc_id)
              else:
                  raise ValueError('The list of documents to delete was empty.')
          elif q is not None:
              m = '<delete><query>%s</query></delete>' % q
  
          return self._update(m, commit=commit, softCommit=softCommit, waitFlush=waitFlush, waitSearcher=waitSearcher, handler=handler)
docs: Deletes documents.
  
          Requires *either* ``id`` or ``query``. ``id`` is if you know the
          specific document id to remove. Note that ``id`` can also be a list of
          document ids to be deleted. ``query`` is a Lucene-style query
          indicating a collection of documents to delete.
  
          Optionally accepts ``commit``. Default is ``True``.
  
          Optionally accepts ``softCommit``. Default is ``False``.
  
          Optionally accepts ``waitFlush``. Default is ``None``.
  
          Optionally accepts ``waitSearcher``. Default is ``None``.
  
          Usage::
  
              solr.delete(id='doc_12')
              solr.delete(id=['doc_1', 'doc_3'])
              solr.delete(q='*:*')