def _allow_join(statement):
 if ((not statement) or (not statement.tokens)):
  return False
 last_tok = statement.token_prev(len(statement.tokens))[1]
 return (last_tok.value.lower().endswith('join') and (last_tok.value.lower() not in ('cross join', 'natural join')))

def _allow_join ( statement ) : if ( ( not statement ) or ( not statement . tokens ) ) : return False last_tok = statement . token_prev ( len ( statement . tokens ) ) [ 1 ] return ( last_tok . value . lower ( ) . endswith ( 'join' ) and ( last_tok . value . lower ( ) not in ( 'cross join' , 'natural join' ) ) )
tests if a join should be suggested we need this to avoid bad suggestions when entering e .