# Path: taskflow/engines/action_engine/compiler.py
# LOG = logging.getLogger(__name__)
# TASK = 'task'
# RETRY = 'retry'
# FLOW = 'flow'
# FLOW_END = 'flow_end'
# ATOMS = (TASK, RETRY)
# FLOWS = (FLOW, FLOW_END)
#     TASK = TASK
#     RETRY = RETRY
#     FLOW = FLOW
#     FLOW_END = FLOW_END
# class Terminator(object):
# class Compilation(object):
# class TaskCompiler(object):
# class FlowCompiler(object):
# class PatternCompiler(object):
#     def __init__(self, flow):
#     def flow(self):
#     def name(self):
#     def __str__(self):
#     def __init__(self, execution_graph, hierarchy):
#     def execution_graph(self):
#     def hierarchy(self):
# def _overlap_occurrence_detector(to_graph, from_graph):
# def _add_update_edges(graph, nodes_from, nodes_to, attr_dict=None):
#     def compile(self, task, parent=None):
#     def __init__(self, deep_compiler_func):
#     def compile(self, flow, parent=None):
#     def __init__(self, root, freeze=True):
#     def _compile(self, item, parent=None):
#     def _pre_item_compile(self, item):
#     def _post_item_compile(self, item, graph, node):
#     def _pre_compile(self):
#     def _post_compile(self, graph, node):
#     def compile(self):
# 
# Path: taskflow/engines/action_engine/traversal.py
# class Direction(enum.Enum):
#     FORWARD = 1
#     BACKWARD = 2
# def _extract_connectors(execution_graph, starting_node, direction,
#                         through_flows=True, through_retries=True,
#                         through_tasks=True):
# def breadth_first_iterate(execution_graph, starting_node, direction,
#                           through_flows=True, through_retries=True,
#                           through_tasks=True):
# def depth_first_iterate(execution_graph, starting_node, direction,
#                         through_flows=True, through_retries=True,
#                         through_tasks=True):
# def depth_first_reverse_iterate(node, start_from_idx=-1):
# 
# Path: taskflow/logging.py
# _BASE = __name__.split(".", 1)[0]
# BLATHER = 5
# TRACE = BLATHER
# CRITICAL = logging.CRITICAL
# DEBUG = logging.DEBUG
# ERROR = logging.ERROR
# FATAL = logging.FATAL
# INFO = logging.INFO
# NOTSET = logging.NOTSET
# WARN = logging.WARN
# WARNING = logging.WARNING
# class _TraceLoggerAdapter(logging.LoggerAdapter):
#     def trace(self, msg, *args, **kwargs):
#     def warn(self, msg, *args, **kwargs):
# def getLogger(name=_BASE, extra=None):


from taskflow.engines.action_engine import compiler as co
from taskflow.engines.action_engine import traversal as tr
from taskflow import logging

        Then for additional scopes we continue up the tree, by finding the
        parent of ``X`` (lets call it ``Z``) and perform the same operation,
        going through the children in a reverse manner from the index in
        parent ``Z`` where ``X`` was located. This forms another *potential*
        scope which we provide back as an *actual* scope after reducing the
        potential set to only include predecessors previously gathered. We
        then repeat this process until we no longer have any parent
        nodes (aka we have reached the top of the tree) or we run out of
        predecessors.
        """
        graph = self._execution_graph
        if self._predecessors is None:
            predecessors = set(
                node for node in graph.bfs_predecessors_iter(self._atom)
                if graph.nodes[node]['kind'] in co.ATOMS)
            self._predecessors = predecessors.copy()
        else:
            predecessors = self._predecessors.copy()
        last = self._node
        for lvl, parent in enumerate(self._node.path_iter(include_self=False)):
            if not predecessors:
                break
            last_idx = parent.index(last.item)
            try:
                visible, removals = self._level_cache[lvl]
                predecessors = predecessors - removals
            except KeyError:
                visible = []
                removals = set()

# Path: taskflow/engines/action_engine/compiler.py
# LOG = logging.getLogger(__name__)
# TASK = 'task'
# RETRY = 'retry'
# FLOW = 'flow'
# FLOW_END = 'flow_end'
# ATOMS = (TASK, RETRY)
# FLOWS = (FLOW, FLOW_END)
#     TASK = TASK
#     RETRY = RETRY
#     FLOW = FLOW
#     FLOW_END = FLOW_END
# class Terminator(object):
# class Compilation(object):
# class TaskCompiler(object):
# class FlowCompiler(object):
# class PatternCompiler(object):
#     def __init__(self, flow):
#     def flow(self):
#     def name(self):
#     def __str__(self):
#     def __init__(self, execution_graph, hierarchy):
#     def execution_graph(self):
#     def hierarchy(self):
# def _overlap_occurrence_detector(to_graph, from_graph):
# def _add_update_edges(graph, nodes_from, nodes_to, attr_dict=None):
#     def compile(self, task, parent=None):
#     def __init__(self, deep_compiler_func):
#     def compile(self, flow, parent=None):
#     def __init__(self, root, freeze=True):
#     def _compile(self, item, parent=None):
#     def _pre_item_compile(self, item):
#     def _post_item_compile(self, item, graph, node):
#     def _pre_compile(self):
#     def _post_compile(self, graph, node):
#     def compile(self):
# 
# Path: taskflow/engines/action_engine/traversal.py
# class Direction(enum.Enum):
#     FORWARD = 1
#     BACKWARD = 2
# def _extract_connectors(execution_graph, starting_node, direction,
#                         through_flows=True, through_retries=True,
#                         through_tasks=True):
# def breadth_first_iterate(execution_graph, starting_node, direction,
#                           through_flows=True, through_retries=True,
#                           through_tasks=True):
# def depth_first_iterate(execution_graph, starting_node, direction,
#                         through_flows=True, through_retries=True,
#                         through_tasks=True):
# def depth_first_reverse_iterate(node, start_from_idx=-1):
# 
# Path: taskflow/logging.py
# _BASE = __name__.split(".", 1)[0]
# BLATHER = 5
# TRACE = BLATHER
# CRITICAL = logging.CRITICAL
# DEBUG = logging.DEBUG
# ERROR = logging.ERROR
# FATAL = logging.FATAL
# INFO = logging.INFO
# NOTSET = logging.NOTSET
# WARN = logging.WARN
# WARNING = logging.WARNING
# class _TraceLoggerAdapter(logging.LoggerAdapter):
#     def trace(self, msg, *args, **kwargs):
#     def warn(self, msg, *args, **kwargs):
# def getLogger(name=_BASE, extra=None):


# Path: taskflow/engines/action_engine/scopes.py
from taskflow.engines.action_engine import compiler as co
from taskflow.engines.action_engine import traversal as tr
from taskflow import logging


        Then for additional scopes we continue up the tree, by finding the
        parent of ``X`` (lets call it ``Z``) and perform the same operation,
        going through the children in a reverse manner from the index in
        parent ``Z`` where ``X`` was located. This forms another *potential*
        scope which we provide back as an *actual* scope after reducing the
        potential set to only include predecessors previously gathered. We
        then repeat this process until we no longer have any parent
        nodes (aka we have reached the top of the tree) or we run out of
        predecessors.
        """
        graph = self._execution_graph
        if self._predecessors is None:
            predecessors = set(
                node for node in graph.bfs_predecessors_iter(self._atom)
                if graph.nodes[node]['kind'] in co.ATOMS)
            self._predecessors = predecessors.copy()
        else:
            predecessors = self._predecessors.copy()
        last = self._node
        for lvl, parent in enumerate(self._node.path_iter(include_self=False)):
            if not predecessors:
                break
            last_idx = parent.index(last.item)
            try:
                visible, removals = self._level_cache[lvl]
                predecessors = predecessors - removals
            except KeyError:
                visible = []
                removals = set()

                atom_it = tr.depth_first_reverse_iterate(