code: def _FilterGoldenProtoDict(
      golden_proto_dict, omit_golden_symbols_map
  ):
      """Filter out golden proto dict symbols that should be omitted."""
      if not omit_golden_symbols_map:
          return golden_proto_dict
      filtered_proto_dict = dict(golden_proto_dict)
      for key, symbol_list in omit_golden_symbols_map.items():
          api_object = api_objects_pb2.TFAPIObject()
          api_object.CopyFrom(filtered_proto_dict[key])
          filtered_proto_dict[key] = api_object
          module_or_class = None
          if api_object.HasField("tf_module"):
              module_or_class = api_object.tf_module
          elif api_object.HasField("tf_class"):
              module_or_class = api_object.tf_class
          if module_or_class is not None:
              for members in (
                  module_or_class.member,
                  module_or_class.member_method,
              ):
                  filtered_members = [
                      m for m in members if m.name not in symbol_list
                  ]
                  # Two steps because protobuf repeated fields disallow slice assignment.
                  del members[:]
                  members.extend(filtered_members)
      return filtered_proto_dict
  
imports: import argparse
  import os
  import re
  import sys
  import tensorflow
  from google.protobuf import message
  from google.protobuf import text_format
  from tensorflow.python.lib.io import file_io
  from tensorflow.python.platform import resource_loader
  from tensorflow.python.platform import test
  from tensorflow.python.platform import tf_logging
  from tensorflow.tools.api.lib import api_objects_pb2
  from tensorflow.tools.api.lib import python_object_to_proto_visitor
  from tensorflow.tools.common import public_api
  from tensorflow.tools.common import traverse
label_desc: Use image node_id 9 for calling a global function with example usage: _FilterGoldenProtoDict(golden_proto_dict, omit_golden_symbols_map) and returns: filtered_proto_dict, golden_proto_dict