@flake8ext
def check_no_sqlalchemy_event_import(logical_line, filename, noqa):
 if noqa:
  return
 is_import = (logical_line.startswith('import') or logical_line.startswith('from'))
 if (not is_import):
  return
 for kw in ('sqlalchemy', 'event'):
  if (kw not in logical_line):
   return
 (yield (0, 'N346: Register sqlalchemy events through neutron.db.api.sqla_listen so they can be cleaned up between unit tests'))

@ flake8ext def check_no_sqlalchemy_event_import ( logical_line , filename , noqa ) : if noqa : return is_import = ( logical_line . startswith ( 'import' ) or logical_line . startswith ( 'from' ) ) if ( not is_import ) : return for kw in ( 'sqlalchemy' , 'event' ) : if ( kw not in logical_line ) : return ( yield ( 0 , 'N346: Register sqlalchemy events through neutron.db.api.sqla_listen so they can be cleaned up between unit tests' ) )
n346 - use neutron .