code: def tag(self, node, tag, graph, conditional=False):
      # Return if the node is already tagged
      if hasattr(node, "__tag__") and node.__tag__ == "tag":
          return
      # If conditional, then tag the node if and only if all its
      # outgoing nodes already have the same tag.
      if conditional:
          # Are all outgoing nodes already tagged?
          outgoing = graph.outgoing(node)
          tagged = filter(
              lambda n: hasattr(n, "__tag__") and n.__tag__ == tag,
              outgoing,
          )
          if len(list(tagged)) != len(outgoing):
              # Not all outgoing are tagged
              return
      # Tag the node
      node.__tag__ = tag
      # Tag incoming nodes
      for n in graph.incoming(node):
          self.tag(n, tag, graph, conditional=True)
  
imports: import re
  import copy
  from .graph import Node
  from .None import ge
label_desc: Use image node_id 2 for calling the PruneBranch obj's underlying member method code with example usage: obj.tag(node, tag, graph, conditional) without return types