code: def comments_between_tokens(token1, token2):
      
      if token2 is None:
          buf = token1.end_mark.buffer[token1.end_mark.pointer:]
      elif (token1.end_mark.line == token2.start_mark.line and
            not isinstance(token1, yaml.StreamStartToken) and
            not isinstance(token2, yaml.StreamEndToken)):
          return
      else:
          buf = token1.end_mark.buffer[token1.end_mark.pointer:
                                       token2.start_mark.pointer]
  
      line_no = token1.end_mark.line + 1
      column_no = token1.end_mark.column + 1
      pointer = token1.end_mark.pointer
  
      comment_before = None
      for line in buf.split('\n'):
          pos = line.find('#')
          if pos != -1:
              comment = Comment(line_no, column_no + pos,
                                token1.end_mark.buffer, pointer + pos,
                                token1, token2, comment_before)
              yield comment
  
              comment_before = comment
  
          pointer += len(line) + 1
          line_no += 1
          column_no = 1
docs: Find all comments between two tokens