def _chain_forks(elements):
        """Detect whether a sequence of elements leads to a fork of streams"""
        # we are only interested in the result, so unwind from the end
        for element in reversed(elements):
            if element.chain_fork:
                return True
            elif element.chain_join:
                return False
        return False
def _chain_forks ( elements ) : for element in reversed ( elements ) : if element . chain_fork : return True elif element . chain_join : return False return False
Detect whether a sequence of elements leads to a fork of streams