code: def filter_layers(self, layers):
      phase_map = {0: "train", 1: "test"}
      filtered_layer_names = set()
      filtered_layers = []
      for layer in layers:
          phase = self.phase
          if len(layer.include):
              phase = phase_map[layer.include[0].phase]
          if len(layer.exclude):
              phase = phase_map[1 - layer.include[0].phase]
          exclude = phase != self.phase
          # Dropout layers appear in a fair number of Caffe
          # test-time networks. These are just ignored. We'll
          # filter them out here.
          if (not exclude) and (phase == "test"):
              exclude = layer.type == LayerType.Dropout
          if not exclude:
              exclude = layer.type == LayerType.Silence
          if not exclude:
              if layer.name in filtered_layer_names:
                  for i in range(1, len(filtered_layer_names)):
                      new_name = layer.name + "_%s" % i
                      if new_name not in filtered_layer_names:
                          layer.name = new_name
                          break
              filtered_layer_names.add(layer.name)
              filtered_layers.append(layer)
      return filtered_layers
  
imports: from collections import namedtuple
  from functools import reduce
  from google.protobuf import text_format
  from copy import deepcopy
  import numbers
  import os
  import tempfile
  from mmdnn.conversion.caffe.mapper import get_handler_name
  from mmdnn.conversion.caffe.resolver import get_caffe_resolver, has_pycaffe
  from mmdnn.conversion.caffe.shape import *
  from mmdnn.conversion.caffe.errors import print_stderr, ConversionError
label_desc: Use image node_id 4 for calling the GraphBuilder obj's underlying member method code with example usage: obj.filter_layers(layers) and returns: filtered_layers