parameters: (self,
                       node,
                       parent_op_type,
                       input_index=None,
                       output_name_to_node=None,
                       exclude=[],
                       return_indice=None)
return_statement: return None
docstring: Find parent node based on constraints on op_type and index.
          When input_index is None, we will find the first parent node based on constraints, and return_indice will be appended the corresponding input index.
  
          Args:
              node (str): current node name.
              parent_op_type (str): constraint of parent node op_type.
              input_index (int or None): only check the parent given input index of current node.
              output_name_to_node (dict): dictionary with output name as key, and node as value.
              exclude (list): list of nodes that are excluded (not allowed to match as parent).
              return_indice (list): a list to append the input index when input_index is None.
  
          Returns:
              parent: The matched parent node.
docstring_summary: Find parent node based on constraints on op_type and index.
          When input_index is None, we will find the first parent node based on constraints, and return_indice will be appended the corresponding input index.
docstring_tokens: Find parent node based on constraints on op_type and index . When input_index is None we will find the first parent node based on constraints and return_indice will be appended the corresponding input index .
function: def match_parent(self,
                       node,
                       parent_op_type,
                       input_index=None,
                       output_name_to_node=None,
                       exclude=[],
                       return_indice=None):
          '''
          Find parent node based on constraints on op_type and index.
          When input_index is None, we will find the first parent node based on constraints, and return_indice will be appended the corresponding input index.
  
          Args:
              node (str): current node name.
              parent_op_type (str): constraint of parent node op_type.
              input_index (int or None): only check the parent given input index of current node.
              output_name_to_node (dict): dictionary with output name as key, and node as value.
              exclude (list): list of nodes that are excluded (not allowed to match as parent).
              return_indice (list): a list to append the input index when input_index is None.
  
          Returns:
              parent: The matched parent node.
          '''
          assert node is not None
          assert input_index is None or input_index >= 0
  
          if output_name_to_node is None:
              output_name_to_node = self.output_name_to_node()
  
          if input_index is None:
              parent, index = self.match_first_parent(node, parent_op_type, output_name_to_node, exclude)
              if return_indice is not None:
                  return_indice.append(index)
              return parent
  
          if input_index >= len(node.input):
              logger.debug(f"input_index {input_index} >= node inputs {len(node.input)}")
              return None
  
          parent = self.get_parent(node, input_index, output_name_to_node)
          if parent is not None and parent.op_type == parent_op_type and parent not in exclude:
              return parent
  
          if parent is not None:
              logger.debug(f"Expect {parent_op_type}, Got {parent.op_type}")
  
          return None
function_tokens: def match_parent ( self , node , parent_op_type , input_index = None , output_name_to_node = None , exclude = [ ] , return_indice = None ) : assert node is not None assert input_index is None or input_index >= 0 if output_name_to_node is None : output_name_to_node = self . output_name_to_node ( ) if input_index is None : parent , index = self . match_first_parent ( node , parent_op_type , output_name_to_node , exclude ) if return_indice is not None : return_indice . append ( index ) return parent if input_index >= len ( node . input ) : logger . debug ( f"input_index {input_index} >= node inputs {len(node.input)}" ) return None parent = self . get_parent ( node , input_index , output_name_to_node ) if parent is not None and parent . op_type == parent_op_type and parent not in exclude : return parent if parent is not None : logger . debug ( f"Expect {parent_op_type}, Got {parent.op_type}" ) return None