def _ensure_callable_or_list(self, field, msg_flag):
        """
        Ensure the value submitted via field is either
        a callable object to convert to list or it is
        in fact a valid list value.

        """
        if field is not None:
            if callable(field):
                field = [field]
            else:
                msg = "Argument '%s' must be a list value" % msg_flag
                if not isinstance(field, list):
                    raise TypeError(msg)

        return field
dataset/ETHPy150Open MongoEngine/flask-mongoengine/flask_mongoengine/wtf/base.py/WtfBaseField._ensure_callable_or_list/original