code: def solve(self):
          
          if self.solve_begun:
              raise ResolveError("cannot run solve() on a solve that has "
                                 "already been started")
  
          t1 = time.time()
          pt1 = package_repo_stats.package_load_time
  
          # iteratively solve phases
          while self.status == SolverStatus.unsolved:
              self.solve_step()
              if self.status == SolverStatus.unsolved and not self._do_callback():
                  break
  
          self.load_time = package_repo_stats.package_load_time - pt1
          self.solve_time = time.time() - t1
  
          # print stats
          if self.pr.verbosity > 2:
              from pprint import pformat
              self.pr.subheader("SOLVE STATS:")
              self.pr(pformat(self.solve_stats))
  
          elif self.print_stats:
              from pprint import pformat
              data = {"solve_stats": self.solve_stats}
              print >> (self.buf or sys.stdout), pformat(data)
docs: Attempt to solve the request.