docs: def extend(self, clauses, weights=None):
          """
              Add several clauses to WCNF formula. The clauses should be given in
              the form of list. For every clause in the list, method
              :meth:`append` is invoked.
  
              The clauses can be hard or soft depending on the ``weights``
              argument. If no weights are set, the clauses are considered to be
              hard.
  
              :param clauses: a list of new clauses to add.
              :param weights: a list of integer weights.
  
              :type clauses: list(list(int))
              :type weights: list(int)
  
              Example:
  
              .. code-block:: python
  
                  >>> from pysat.formula import WCNF
                  >>> cnf = WCNF()
                  >>> cnf.extend([[-3, 4], [5, 6]])
                  >>> cnf.extend([[3], [-4], [-5], [-6]], weights=[1, 5, 3, 4])
                  >>> print cnf.hard
                  [[-3, 4], [5, 6]]
                  >>> print cnf.soft
                  [[3], [-4], [-5], [-6]]
                  >>> print cnf.wght
                  [1, 5, 3, 4]
          """
  
          if weights:
              # clauses are soft
              for i, cl in enumerate(clauses):
                  self.append(cl, weight=weights[i])
          else:
              # clauses are hard
              for cl in clauses:
                  self.append(cl)