def _gen_validate(self, data, piecewise=False):
        """ This is an internal utility function that does the grunt work of
        running validation logic for a :class:`Form`. It is called by the other
        primary validation methods. """

        # Allows user to set a modular processor on incoming data
        data = self._processor().filter_post(data)


        # reset all error lists and data
        for node in self._node_list:
            node.errors = []
            node.data = ''
            node.resolve_data(data)
            # Pull out all our shorthand validators
            self._parse_shorthand_validator(node)

        # try to load our visited list of it's piecewise validation
        if '_visited_names' not in data and piecewise:
            raise AttributeError("No _visited_names present in data submission"
                                 ". Data is required for piecewise validation")
        elif piecewise:
            visited = json.loads(data['_visited_names'])

        # assume to be not blocking
        block = False
        # loop over our checks and run our validators
        for check in self._validation_list:
            check.resolve_attr_names(self)
            if piecewise is False or check.node_visited(visited):
                check()
            else:
                # If even a single check can't be run, we need to block
                block = True

        # Run the one off validation method
        self.validator()

        # a list to hold Nodes that actually have errors
        error_node_list = []
        for node in self._node_list:
            # slightly confusing way of setting our block = True by
            # default
            if node.errors:

                error_node_list.append(node)

            for error in node.errors:
                block |= error.get('block', True)

        return block, error_node_list
dataset/ETHPy150Open icook/yota/src/yota/__init__.py/Form._gen_validate/original