def METHOD_NAME(model_params):
    """
    Convert all numpy arrays in model-parameters to lists.
    Used for json support
    """
    for k in model_params.keys():
        param = model_params[k]
        if isinstance(param, np.ndarray):
            model_params[k] = param.tolist()  # for json support
        elif isinstance(param, list) and isinstance(param[0], np.ndarray):
            model_params[k] = [p.tolist() for p in param]  # json support
        else:
            model_params[k] = param
    return model_params