def missing_whitespace(logical_line):
 line = logical_line
 for index in range((len(line) - 1)):
  char = line[index]
  if ((char in ',;:') and (line[(index + 1)] not in WHITESPACE)):
   before = line[:index]
   if ((char == ':') and (before.count('[') > before.count(']')) and (before.rfind('{') < before.rfind('['))):
    continue
   if ((char == ',') and (line[(index + 1)] == ')')):
    continue
   (yield (index, ("E231 missing whitespace after '%s'" % char)))

def missing_whitespace ( logical_line ) : line = logical_line for index in range ( ( len ( line ) - 1 ) ) : char = line [ index ] if ( ( char in ',;:' ) and ( line [ ( index + 1 ) ] not in WHITESPACE ) ) : before = line [ : index ] if ( ( char == ':' ) and ( before . count ( '[' ) > before . count ( ']' ) ) and ( before . rfind ( '{' ) < before . rfind ( '[' ) ) ) : continue if ( ( char == ',' ) and ( line [ ( index + 1 ) ] == ')' ) ) : continue ( yield ( index , ( "E231 missing whitespace after '%s'" % char ) ) )
jcr: each comma .