code: def apply(self, graph):
      # Copy the graph. Don't change the original.
      graph = copy.deepcopy(graph)
  
      while True:
          matches, _ = graph.search(self.pattern)
          if not matches:
              break
          # Remove found nodes
          graph.remove(matches)
      return graph
  
imports: import re
  import copy
  from .graph import Node
  from .None import ge
label_desc: Use image node_id 2 for calling the Prune obj's underlying member method code with example usage: obj.apply(graph) and returns: graph