docs: def _check_targets(self):
          """
          Returns a function to terminate the ArciDispatch algorithm when all
          targets have been visited.
  
          :return:
              A function to terminate the ArciDispatch algorithm.
          :rtype: (str) -> bool
          """
  
          if self.outputs:
  
              targets = self.outputs.copy()  # Namespace shortcut for speed.
  
              def check_targets(node_id):
                  """
                  Terminates ArciDispatch algorithm when all targets have been
                  visited.
  
                  :param node_id:
                      Data or function node id.
                  :type node_id: str
  
                  :return:
                      True if all targets have been visited, otherwise False.
                  :rtype: bool
                  """
  
                  try:
                      targets.remove(node_id)  # Remove visited node.
                      return not targets  # If no targets terminate the algorithm.
                  except KeyError:  # The node is not in the targets set.
                      return False
          else:
              # noinspection PyUnusedLocal
              def check_targets(node_id):
                  return False
  
          return check_targets