parameters: (base_meta_graph_def, meta_graph_def,
                             collection_name, removed_op_names)
docstring: Copy collection to the transformed MetaGraphDef, omitting removed items.
docstring_summary: Copy collection to the transformed MetaGraphDef, omitting removed items.
docstring_tokens: Copy collection to the transformed MetaGraphDef omitting removed items .
function: def _add_pruned_collection(base_meta_graph_def, meta_graph_def,
                             collection_name, removed_op_names):
    """Copy collection to the transformed MetaGraphDef, omitting removed items."""
  
    base_collection = base_meta_graph_def.collection_def[collection_name]
    collection = meta_graph_def.collection_def[collection_name]
  
    if base_collection.HasField('any_list'):
      for any_value in base_collection.any_list.value:
        # just search the serialized proto as a string
        if not _is_removed_mentioned(any_value.value, removed_op_names):
          copied_any = collection.any_list.value.add()
          copied_any.CopyFrom(any_value)
    elif base_collection.HasField('bytes_list'):
      collection.bytes_list.value[:] = [
          s for s in base_collection.bytes_list.value
          if not _is_removed_mentioned(s, removed_op_names)]
    elif base_collection.HasField('node_list'):
      collection.node_list.value[:] = [
          s for s in base_collection.node_list.value
          if not _is_removed(s, removed_op_names)]
    else:
      collection.CopyFrom(base_collection)
function_tokens: def _add_pruned_collection ( base_meta_graph_def , meta_graph_def , collection_name , removed_op_names ) : base_collection = base_meta_graph_def . collection_def [ collection_name ] collection = meta_graph_def . collection_def [ collection_name ] if base_collection . HasField ( 'any_list' ) : for any_value in base_collection . any_list . value : # just search the serialized proto as a string if not _is_removed_mentioned ( any_value . value , removed_op_names ) : copied_any = collection . any_list . value . add ( ) copied_any . CopyFrom ( any_value ) elif base_collection . HasField ( 'bytes_list' ) : collection . bytes_list . value [ : ] = [ s for s in base_collection . bytes_list . value if not _is_removed_mentioned ( s , removed_op_names ) ] elif base_collection . HasField ( 'node_list' ) : collection . node_list . value [ : ] = [ s for s in base_collection . node_list . value if not _is_removed ( s , removed_op_names ) ] else : collection . CopyFrom ( base_collection )