code: def filter_graph_dynamic(graph):
      dynamic_nodes = []
  
      def recursive_walk_forward(node):
          if node.name in dynamic_nodes:
              return
          dynamic_nodes.append(node.name)
          for next in node.consumers:
              recursive_walk_forward(next)
  
      recursive_walk_forward(graph.nodes[0])
      return filter_graph(graph, dynamic_nodes)
  
imports: import numpy
  import tensorflow
  import lucid.modelzoo.vision_models
  import lucid.optvis.objectives
  import lucid.optvis.param
  import lucid.optvis.render
  from lucid.misc.io import show, load
  from lucid.misc.io.showing import _image_url, _display_html
  from collections import defaultdict
label_desc: Use image node_id 4 for calling a global function with example usage: filter_graph_dynamic(graph) and returns: filter_graph