def _NoBlankLinesBeforeCurrentToken(text, cur_token, prev_token):
 cur_token_lineno = cur_token.lineno
 if cur_token.is_comment:
  cur_token_lineno -= cur_token.value.count(u'\n')
 num_newlines = (text.count(u'\n') if (not prev_token.is_comment) else 0)
 return ((prev_token.lineno + num_newlines) == (cur_token_lineno - 1))

def _NoBlankLinesBeforeCurrentToken ( text , cur_token , prev_token ) : cur_token_lineno = cur_token . lineno if cur_token . is_comment : cur_token_lineno -= cur_token . value . count ( u'\n' ) num_newlines = ( text . count ( u'\n' ) if ( not prev_token . is_comment ) else 0 ) return ( ( prev_token . lineno + num_newlines ) == ( cur_token_lineno - 1 ) )
determine if there are no blank lines before the current token .