# 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
        exist (and execute) before this atom but it does not tell us the
        corresponding scope *level* (flow, nested flow...) that each
        predecessor was created in, so we need to find this information.

        For that information we consult the location of the atom ``Y`` in the
        :py:class:`~.compiler.Compilation` hierarchy/tree. We lookup in a
        reverse order the parent ``X`` of ``Y`` and traverse backwards from
        the index in the parent where ``Y`` exists to all siblings (and
        children of those siblings) in ``X`` that we encounter in this
        backwards search (if a sibling is a flow itself, its atom(s)
        will be recursively expanded and included). This collection will
        then be assumed to be at the same scope. This is what is called
        a *potential* single scope, to make an *actual* scope we remove the
        items from the *potential* scope that are **not** predecessors
        of ``Y`` to form the *actual* scope which we then yield back.

        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)

# 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

        exist (and execute) before this atom but it does not tell us the
        corresponding scope *level* (flow, nested flow...) that each
        predecessor was created in, so we need to find this information.

        For that information we consult the location of the atom ``Y`` in the
        :py:class:`~.compiler.Compilation` hierarchy/tree. We lookup in a
        reverse order the parent ``X`` of ``Y`` and traverse backwards from
        the index in the parent where ``Y`` exists to all siblings (and
        children of those siblings) in ``X`` that we encounter in this
        backwards search (if a sibling is a flow itself, its atom(s)
        will be recursively expanded and included). This collection will
        then be assumed to be at the same scope. This is what is called
        a *potential* single scope, to make an *actual* scope we remove the
        items from the *potential* scope that are **not** predecessors
        of ``Y`` to form the *actual* scope which we then yield back.

        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)