def _check_imports():
    """ Dynamically remove optimizers we don't have
    """

    optlist = ['ALGENCIAN', 'ALHSO', 'ALPSO', 'COBYLA', 'CONMIN', 'FILTERSD',
               'FSQP', 'GCMMA', 'KSOPT', 'MIDACO', 'MMA', 'MMFD', 'NLPQL', 'NLPQLP',
               'NSGA2', 'PSQP', 'SDPEN', 'SLSQP', 'SNOPT', 'SOLVOPT']

    for optimizer in optlist[:]:
        try:
            exec('from pyOpt import %s' % optimizer)
        except __HOLE__:
            optlist.remove(optimizer)

    return optlist
dataset/ETHPy150Open OpenMDAO-Plugins/pyopt_driver/src/pyopt_driver/pyopt_driver.py/_check_imports