<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def remove(self, paths, **params):
 """ Delete paths from the watched list. """

        log = self._getparam('log', self._discard, **params)
        commit = self._getparam('commit', True, **params)

        if type(paths) is not list:
            paths = [paths]

        rebuild = False
        for path in paths:
            if path in self.paths_pending:
                del self.paths_pending[path]
            if path in self.paths:
                del self.paths[path]
                rebuild = True
            else:
                log.error("Attempt to remove %r which was never added", path)
                raise Exception("Path %r has never been added" % path)
        if commit and rebuild:
            self.commit(**params)