def run_model(prob, ignore_exception=False):
    '\n    Call `run_model` on problem and capture output.\n\n    Parameters\n    ----------\n    prob : Problem\n        An instance of Problem.\n    ignore_exception : bool\n        Set to True to ignore an exception of any kind.\n\n    Returns\n    -------\n    string\n        Output from calling `run_model` on the Problem, captured from stdout.\n    '
    stdout = sys.stdout
    strout = StringIO()
    sys.stdout = strout
    try:
        prob.run_model()
    except Exception as err:
        if (not ignore_exception):
            raise err
    finally:
        sys.stdout = stdout
    return strout.getvalue()
Call `run_model` on problem and capture output.

Parameters
----------
prob : Problem
    An instance of Problem.
ignore_exception : bool
    Set to True to ignore an exception of any kind.

Returns
-------
string
    Output from calling `run_model` on the Problem, captured from stdout.
def run_model(prob, ignore_exception=False):
    '\n    Call `run_model` on problem and capture output.\n\n    Parameters\n    ----------\n    prob : Problem\n        An instance of Problem.\n    ignore_exception : bool\n        Set to True to ignore an exception of any kind.\n\n    Returns\n    -------\n    string\n        Output from calling `run_model` on the Problem, captured from stdout.\n    '
    stdout = sys.stdout
    strout = StringIO()
    sys.stdout = strout
    try:
        prob.run_model()
    except Exception as err:
        if (not ignore_exception):
            raise err
    finally:
        sys.stdout = stdout
    return strout.getvalue()