def whitespace_around_keywords(logical_line):
 for match in KEYWORD_REGEX.finditer(logical_line):
  (before, after) = match.groups()
  if (' DCTB ' in before):
   (yield (match.start(1), 'E274 tab before keyword'))
  elif (len(before) > 1):
   (yield (match.start(1), 'E272 multiple spaces before keyword'))
  if (' DCTB ' in after):
   (yield (match.start(2), 'E273 tab after keyword'))
  elif (len(after) > 1):
   (yield (match.start(2), 'E271 multiple spaces after keyword'))

def whitespace_around_keywords ( logical_line ) : for match in KEYWORD_REGEX . finditer ( logical_line ) : ( before , after ) = match . groups ( ) if ( ' DCTB ' in before ) : ( yield ( match . start ( 1 ) , 'E274 tab before keyword' ) ) elif ( len ( before ) > 1 ) : ( yield ( match . start ( 1 ) , 'E272 multiple spaces before keyword' ) ) if ( ' DCTB ' in after ) : ( yield ( match . start ( 2 ) , 'E273 tab after keyword' ) ) elif ( len ( after ) > 1 ) : ( yield ( match . start ( 2 ) , 'E271 multiple spaces after keyword' ) )
avoid extraneous whitespace around keywords .