class_docstr: A floder to fold a graph' nodes which has same scope into one node.
class_docstr_tok: ["A","floder","to","fold","a","graph","'","nodes","which","has","same","scope","into","one","node","."]
code: def check_scope(self):
      name_no_dict = collections.OrderedDict()
      name_inp_out_dict = collections.OrderedDict()
  
      for name, ir_node in self._graph.layer_map.items():
          if ir_node.type == "Scope":
              # get input params
              ir_node.input_params = self._check_and_get_input_params(
                  ir_node
              )
              origi_pattern = re.sub(r"(_\d+)*$", "", ir_node.pattern)
              if name_inp_out_dict.get(origi_pattern, None):
                  inps_and_outs = name_inp_out_dict[origi_pattern]
                  exist_Equal = False
                  for inp_out in inps_and_outs:
                      if len(ir_node.input_params) == len(
                          inp_out[0]
                      ) and len(ir_node.return_variables) == len(
                          inp_out[1]
                      ):
                          exist_Equal = True
                          if inp_out[2]:
                              ir_node.pattern = (
                                  ir_node.pattern
                                  + "_"
                                  + str(inp_out[2])
                              )
  
                  if not exist_Equal:
                      name_inp_out_dict[origi_pattern].append(
                          [
                              ir_node.input_params,
                              ir_node.return_variables,
                              name_no_dict.get(origi_pattern, 1),
                          ]
                      )
                      ir_node.pattern = (
                          ir_node.pattern
                          + "_"
                          + str(name_no_dict.get(origi_pattern, 1))
                      )
                      name_no_dict[origi_pattern] = (
                          name_no_dict.get(origi_pattern, 1) + 1
                      )
  
              else:
                  name_inp_out_dict[origi_pattern] = [
                      [
                          ir_node.input_params,
                          ir_node.return_variables,
                          0,
                      ]
                  ]
                  name_no_dict[ir_node.pattern] = (
                      name_no_dict.get(origi_pattern, 0) + 1
                  )
  
file_path: MMdnn/mmdnn/conversion/rewriter/folder.py
imports: from mmdnn.conversion.common.IR.IR_graph import *
  import sys
  import re
  import numpy
  import collections
label_desc: Use image node_id 11 for calling the Folder obj's underlying member method code with example usage: obj.check_scope() without return types