code: def _get_nodes(
      module,
      nodes,
      output_format,
      nested=False,
      layer_names=None,
      depth=0,
  ):
      def update_node(n):
          is_node_a_model = isinstance(n, (Model, Sequential))
          if not is_placeholder(n):
              if is_node_a_model and nested:
                  return
              try:
                  mod = None if depth == 0 else module
                  name = n_(n, output_format, nested, mod)
                  if layer_names is None or name in layer_names:
                      if is_node_a_model:
                          if hasattr(n, "_layers"):
                              output = n._layers[-1].output
                          else:
                              output = n.layers[-1].output
                      else:
                          output = n.output
                      nodes.update({name: output})
              except AttributeError:
                  pass
  
      try:
          layers = (
              module._layers
              if hasattr(module, "_layers")
              else module.layers
          )
      except AttributeError:
          return
      for layer in layers:
          update_node(layer)
          if nested:
              _get_nodes(
                  layer,
                  nodes,
                  output_format,
                  nested,
                  layer_names,
                  depth + 1,
              )
  
imports: import json
  import os
  from collections import OrderedDict
  import numpy
  import tensorflow
  import tensorflow.keras.backend
  from tensorflow.keras import Sequential
  from tensorflow.keras.models import Model
label_desc: Use image node_id 8 for calling a global function with example usage: _get_nodes(module, nodes, output_format, nested, layer_names, depth) without return types