def testContinuousInterface(algo):
    if not issubclass(algo, bbo.ContinuousOptimizer):
        return True
    # list starting points are internally converted to arrays
    x = algo(sf, xlist2)
    assert isinstance(x.bestEvaluable, ndarray), 'not converted to array'

    # check for dimension mismatch
    try:
        algo(ife1, xa2)
        return "Failed to throw dimension mismatch error"
    except ValueError:
        pass

    return True
Turn an object into JSON.
dataset/ETHPy150Open pybrain/pybrain/pybrain/tests/optimizationtest.py/testContinuousInterface--crossover with--dataset/ETHPy150Open openstack/ironic-python-agent/ironic_python_agent/encoding.py/RESTJSONEncoder.encode