code: def stripped_op_list_for_graph(graph_def):
      """Collect the stripped OpDefs for ops used by a graph.
  
      This function computes the `stripped_op_list` field of `MetaGraphDef` and
      similar protos.  The result can be communicated from the producer to the
      consumer, which can then use the C++ function
      `RemoveNewDefaultAttrsFromGraphDef` to improve forwards compatibility.
  
      Args:
        graph_def: A `GraphDef` proto, as from `graph.as_graph_def()`.
  
      Returns:
        An `OpList` of ops used by the graph.
      """
      # This is similar to StrippedOpListForGraph in C++, but unlike its
      # C++ counterpart, this version does not require all ops to be registered.
      # This is done to support Prelu fusion in tfjs.
      used_ops = ops_used_by_graph_def(graph_def)
      op_defs = []
      for op in sorted(used_ops):
          op_def = op_def_registry.get(op)
          if op_def is not None:
              op_defs.append(op_def)
      return op_def_pb2.OpList(op=op_defs)
  
imports: import copy
  from packaging import version
  import os.path
  import re
  import sys
  from google.protobuf.any_pb2 import Any
  from google.protobuf import text_format
  from tensorflow.core.framework import attr_value_pb2
  from tensorflow.core.framework import graph_pb2
  from tensorflow.core.framework import op_def_pb2
  from tensorflow.core.protobuf import meta_graph_pb2
  from tensorflow.core.protobuf import saver_pb2
  from tensorflow.python.client import pywrap_tf_session
  from tensorflow.python.eager import context
  from tensorflow.python.framework import byte_swap_tensor
  from tensorflow.python.framework import error_interpolation
  from tensorflow.python.framework import graph_io
  from tensorflow.python.framework import importer
  from tensorflow.python.framework import op_def_registry
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import tensor
  from tensorflow.python.framework import versions
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import tf_logging
  from tensorflow.python.util import compat
label_desc: Use image node_id 4 for calling a global function with example usage: stripped_op_list_for_graph(graph_def) and returns: op_def_pb2