def CheckOperatorSpacing(filename, clean_lines, linenum, error):
line = clean_lines.elided[linenum]<EOL>while True:<EOL><INDENT>match = Match(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>line = match.group(<NUM_LIT:1>) + ('<STR_LIT:_>' * len(match.group(<NUM_LIT:2>))) + match.group(<NUM_LIT:3>)<EOL><DEDENT>else:<EOL><INDENT>break<EOL><DEDENT><DEDENT>if ((Search(r'<STR_LIT>', line) or<EOL>Search(r'<STR_LIT>', line))<EOL>and not Search(r'<STR_LIT>', line)<EOL>and not Search(r'<STR_LIT>', line)<EOL>and not Search(r'<STR_LIT>', line)):<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:4>,<EOL>'<STR_LIT>')<EOL><DEDENT>match = Search(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:3>,<EOL>'<STR_LIT>' % match.group(<NUM_LIT:1>))<EOL><DEDENT>elif not Match(r'<STR_LIT>', line):<EOL><INDENT>match = Match(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>(_, _, end_pos) = CloseExpression(<EOL>clean_lines, linenum, len(match.group(<NUM_LIT:1>)))<EOL>if end_pos <= -<NUM_LIT:1>:<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:3>,<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT>match = Match(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>(_, _, start_pos) = ReverseCloseExpression(<EOL>clean_lines, linenum, len(match.group(<NUM_LIT:1>)))<EOL>if start_pos <= -<NUM_LIT:1>:<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:3>,<EOL>'<STR_LIT>')<EOL><DEDENT><DEDENT><DEDENT>match = Search(r'<STR_LIT>', line)<EOL>if (match and not (match.group(<NUM_LIT:1>).isdigit() and match.group(<NUM_LIT:2>).isdigit()) and<EOL>not (match.group(<NUM_LIT:1>) == '<STR_LIT>' and match.group(<NUM_LIT:2>) == '<STR_LIT:;>')):<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:3>,<EOL>'<STR_LIT>')<EOL><DEDENT>match = Search(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:3>,<EOL>'<STR_LIT>')<EOL><DEDENT>match = Search(r'<STR_LIT>', line)<EOL>if match:<EOL><INDENT>error(filename, linenum, '<STR_LIT>', <NUM_LIT:4>,<EOL>'<STR_LIT>' % match.group(<NUM_LIT:1>))<EOL><DEDENT>
Checks for horizontal spacing around operators.

    Args:
      filename: The name of the current file.
      clean_lines: A CleansedLines instance containing the file.
      linenum: The number of the line to check.
      error: The function to call with any errors found.