docs: def from_fp(self, file_pointer, comment_lead=['c']):
          """
              Read a WCNF+ formula from a file pointer. A file pointer should be
              specified as an argument. The only default argument is
              ``comment_lead``, which can be used for parsing specific comment
              lines.
  
              :param file_pointer: a file pointer to read the formula from.
              :param comment_lead: a list of characters leading comment lines
  
              :type file_pointer: file pointer
              :type comment_lead: list(str)
  
              Usage example:
  
              .. code-block:: python
  
                  >>> with open('some-file.wcnf+', 'r') as fp:
                  ...     cnf1 = WCNFPlus()
                  ...     cnf1.from_fp(fp)
                  >>>
                  >>> with open('another-file.wcnf+', 'r') as fp:
                  ...     cnf2 = WCNFPlus(from_fp=fp)
          """
  
          self.nv = 0
          self.hard = []
          self.atms = []
          self.soft = []
          self.wght = []
          self.topw = 0
          self.comments = []
          comment_lead = tuple('p') + tuple(comment_lead)
  
          for line in file_pointer:
              line = line.strip()
              if line:
                  if line[0] not in comment_lead:
                      if line[-1] == '0':  # normal clause
                          cl = [int(l) for l in line.split()[:-1]]
                          w = cl.pop(0)
                          self.nv = max([abs(l) for l in cl] + [self.nv])
  
                          if w >= self.topw:
                              self.hard.append(cl)
                          else:
                              self.soft.append(cl)
                              self.wght.append(w)
                      else:  # atmost/atleast constraint
                          items = [i for i in line.split()]
                          lits = [int(l) for l in items[1:-2]]
                          rhs = int(items[-1])
                          self.nv = max([abs(l) for l in lits] + [self.nv])
  
                          if items[-2][0] == '>':
                              lits = list(map(lambda l: -l, lits))
                              rhs = len(lits) - rhs
  
                          self.atms.append([lits, rhs])
                  elif not line.startswith('p wcnf+ '):
                      self.comments.append(line)
                  else:  # expecting the preamble
                      self.topw = int(line.rsplit(' ', 1)[1])