def check_solver_status(status, raise_error=False):
if status == OPTIMAL:<EOL><INDENT>return<EOL><DEDENT>elif (status in has_primals) and not raise_error:<EOL><INDENT>warn("<STR_LIT>".format(status), UserWarning)<EOL><DEDENT>elif status is None:<EOL><INDENT>raise OptimizationError(<EOL>"<STR_LIT>")<EOL><DEDENT>else:<EOL><INDENT>raise OptimizationError("<STR_LIT>".format(status))<EOL><DEDENT>
Perform standard checks on a solver's status.