def _MatchBrackets(uwline):
 bracket_stack = []
 for token in uwline.tokens:
  if (token.value in pytree_utils.OPENING_BRACKETS):
   bracket_stack.append(token)
  elif (token.value in pytree_utils.CLOSING_BRACKETS):
   bracket_stack[(-1)].matching_bracket = token
   token.matching_bracket = bracket_stack[(-1)]
   bracket_stack.pop()

def _MatchBrackets ( uwline ) : bracket_stack = [ ] for token in uwline . tokens : if ( token . value in pytree_utils . OPENING_BRACKETS ) : bracket_stack . append ( token ) elif ( token . value in pytree_utils . CLOSING_BRACKETS ) : bracket_stack [ ( - 1 ) ] . matching_bracket = token token . matching_bracket = bracket_stack [ ( - 1 ) ] bracket_stack . pop ( )
visit the node and match the brackets .