def __init__(self, package_requests, package_paths, context=None,<EOL>package_filter=None, package_orderers=None, callback=None,<EOL>building=False, optimised=True, verbosity=<NUM_LIT:0>, buf=None,<EOL>package_load_callback=None, prune_unfailed=True,<EOL>suppress_passive=False, print_stats=False):
self.package_paths = package_paths<EOL>self.package_filter = package_filter<EOL>self.package_orderers = package_orderers<EOL>self.callback = callback<EOL>self.prune_unfailed = prune_unfailed<EOL>self.package_load_callback = package_load_callback<EOL>self.building = building<EOL>self.request_list = None<EOL>self.context = context<EOL>self.pr = _Printer(verbosity, buf=buf, suppress_passive=suppress_passive)<EOL>self.print_stats = print_stats<EOL>self.buf = buf<EOL>if _force_unoptimised_solver:<EOL><INDENT>self.optimised = False<EOL><DEDENT>else:<EOL><INDENT>self.optimised = optimised<EOL><DEDENT>self.non_conflict_package_requests = [x for x in package_requests<EOL>if not x.conflict]<EOL>self.phase_stack = None<EOL>self.failed_phase_list = None<EOL>self.abort_reason = None<EOL>self.callback_return = None<EOL>self.depth_counts = None<EOL>self.solve_begun = None<EOL>self.solve_time = None<EOL>self.load_time = None<EOL>self.solve_count = <NUM_LIT:0><EOL>self.extractions_count = <NUM_LIT:0><EOL>self.intersections_count = <NUM_LIT:0><EOL>self.intersection_tests_count = <NUM_LIT:0><EOL>self.intersection_broad_tests_count = <NUM_LIT:0><EOL>self.reductions_count = <NUM_LIT:0><EOL>self.reduction_tests_count = <NUM_LIT:0><EOL>self.reduction_broad_tests_count = <NUM_LIT:0><EOL>self.extraction_time = [<NUM_LIT:0.0>]<EOL>self.intersection_time = [<NUM_LIT:0.0>]<EOL>self.intersection_test_time = [<NUM_LIT:0.0>]<EOL>self.reduction_time = [<NUM_LIT:0.0>]<EOL>self.reduction_test_time = [<NUM_LIT:0.0>]<EOL>self._init()<EOL>self.package_cache = PackageVariantCache(self)<EOL>if self.pr:<EOL><INDENT>self.pr("<STR_LIT>", '<STR_LIT:U+0020>'.join(map(str, package_requests)))<EOL><DEDENT>self.request_list = RequirementList(package_requests)<EOL>if self.request_list.conflict:<EOL><INDENT>req1, req2 = self.request_list.conflict<EOL>if self.pr:<EOL><INDENT>self.pr("<STR_LIT>", req1, req2)<EOL><DEDENT>conflict = DependencyConflict(req1, req2)<EOL>phase = _ResolvePhase(solver=self)<EOL>phase.failure_reason = DependencyConflicts([conflict])<EOL>phase.status = SolverStatus.failed<EOL>self._push_phase(phase)<EOL>return<EOL><DEDENT>elif self.pr:<EOL><INDENT>s = '<STR_LIT:U+0020>'.join(map(str, self.request_list.requirements))<EOL>self.pr("<STR_LIT>", s)<EOL><DEDENT>phase = _ResolvePhase(solver=self)<EOL>self._push_phase(phase)<EOL>
Create a Solver.

        Args:
            package_requests: List of Requirement objects representing the
                request.
            package_paths: List of paths to search for pkgs.
            context (`ResolvedContext`): Context this solver is used within, if
                any. This is needed in a solve if any packages contain late
                binding package attributes that need access to context info.
            package_filter (`PackageFilterBase`): Filter for excluding packages.
            package_orderers (list of `PackageOrder`): Custom package ordering.
            building: True if we're resolving for a build.
            optimised: Run the solver in optimised mode. This is only ever set
                to False for testing purposes.
            callback: If not None, this callable will be called after each
                solve step. It is passed a `SolverState` object. It must return
                a 2-tuple:
                - `SolverCallbackReturn` object indicating what to do next;
                - str: Reason for solve abort, ignored if solve not aborted.
                If the callable returns `SolverCallbackReturn.fail`, but there
                has not been a failure, the solver will ignore the callback and
                continue on with the solve.
            package_load_callback: If not None, this callable will be called
                prior to each package being loaded. It is passed a single
                `Package` object.
            prune_unfailed (bool): If the solve failed, and `prune_unfailed` is
                True, any packages unrelated to the conflict are removed from
                the graph.
            suppress_passive (bool): If True, don't print debugging info that
                has had no effect on the solve. This argument only has an
                effect if `verbosity` > 2.
            print_stats (bool): If true, print advanced solver stats at the end.