def _allow_join_condition(statement):
 if ((not statement) or (not statement.tokens)):
  return False
 last_tok = statement.token_prev(len(statement.tokens))[1]
 return (last_tok.value.lower() in ('on', 'and', 'or'))

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