code: def _chain_forks(elements):
          
          # 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
docs: Detect whether a sequence of elements leads to a fork of streams