code: def _rewrite_graph_by_pattern(self, pattern_name, graph_type):
      pattern = rnn_patterns[graph_type][pattern_name]
      matcher = GraphMatcher(pattern)
      match_results = list(matcher.match_ops(self._graph.get_nodes()))
      scope_names_dict = dict()  # name: No.
  
      for i in range(len(match_results)):
          result = match_results[i]
          top_pattern_name = pattern_name + "_" + str(i)
  
          top_pattern = result._name_to_pattern[pattern_name]
          self.create_scope(result, top_pattern, scope_names_dict)
  
          top_op = result._pattern_to_op[top_pattern]
          top_op.scope = top_op.scope + "/top"
  
          # self.store_const_to_top(result)
          # self.set_top_node_prop(result, pattern_name)
          self.process_match_result(result, pattern_name)
  
imports: from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  from tensorflow.python.framework import tensor_util
  from tensorflow.core.framework import attr_value_pb2
  import sys
  from mmdnn.conversion.tensorflow.tensorflow_graph import *
  import mmdnn.conversion.common.IR.graph_pb2
  from mmdnn.conversion.rewriter.graph_matcher import *
  from mmdnn.conversion.common.DataStructure import *
  from tensorflow.core.framework.node_def_pb2 import NodeDef
  from mmdnn.conversion.rewriter.rnn_utils import *
label_desc: Use image node_id 2 for calling the UnitRewriterBase obj's underlying member method code with example usage: obj._rewrite_graph_by_pattern(pattern_name, graph_type) without return types