def check_solver(prob, solver_name):
 (objective, constraints) = prob.canonicalize()
 if (solver_name == ROBUST_CVXOPT):
  solver_name = CVXOPT
 solver = SOLVERS[solver_name]
 try:
  solver.validate_solver(constraints)
  return True
 except Exception as e:
  return False

def check_solver ( prob , solver_name ) : ( objective , constraints ) = prob . canonicalize ( ) if ( solver_name == ROBUST_CVXOPT ) : solver_name = CVXOPT solver = SOLVERS [ solver_name ] try : solver . validate_solver ( constraints ) return True except Exception as e : return False
can the solver solve the problem? .