code: def with_peer(events):
      
  
      stack = []
      for obj in events:
          if obj['type'] == ENTER:
              stack.append(obj)
              yield obj, None
          elif obj['type'] == EXIT:
              yield obj, stack.pop()
          else:
              yield obj, None
docs: locates ENTER peer for each EXIT object. Convenient when selectively
      filtering out XML markup