<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 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 """


        self.nv = 0
        self.hard = []
        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:
                    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)
                elif not line.startswith('p wcnf '):
                    self.comments.append(line)
                else:  # expecting the preamble
                    self.topw = int(line.rsplit(' ', 1)[1])