def _check_method(method, methods):
    if method not in methods:
        message = "Unknown fit method %s" % method
        raise ValueError(message)
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/base/optimizer.py/_check_method/original