:return True: in case the node should be _skipped_ and not included into processing

def should_skip_tree_node(self, node):
        """ :return True: in case the node should be _skipped_ and not included into processing """
        # case 1: node processing is complete
        if node.job_record.is_finished:
            return True

        # case 2: this is a bottom-level leaf node. retry this node for MAX_NUMBER_OF_FAILURES
        if node.process_name == self.process_hierarchy.bottom_process.process_name:
            if len(node.children) == 0:
                # no children - this is a leaf
                return node.job_record.number_of_failures > MAX_NUMBER_OF_FAILURES

        # case 3: here we process process_daily, process_monthly and process_yearly that have children
        # iterate thru children and check if all of them are in STATE_SKIPPED (i.e. no data for parent to process)
        # if any is still in processing (i.e. has produced some data) - then we can not skip parent of the child node
        # case 3': consider parent as worth processing (i.e. do not skip) if child's job_record is None
        all_children_spoiled = True
        for key, child in node.children.items():
            if child.job_record is None or \
                    (child.job_record.number_of_failures <= MAX_NUMBER_OF_FAILURES
                     and not child.job_record.is_skipped):
                all_children_spoiled = False
                break
        return all_children_spoiled