code: def solve_resource(self, value, resource):
          for solver in self.get_resource_solvers(resource):
              try:
                  return solver.solve(value, resource)
              except CannotSolve:
                  continue
          raise SolveFailure(self, resource, value)