def whitespace_around_named_parameter_equals(logical_line, tokens):
parens = <NUM_LIT:0><EOL>no_space = False<EOL>prev_end = None<EOL>annotated_func_arg = False<EOL>in_def = logical_line.startswith('<STR_LIT>')<EOL>message = "<STR_LIT>"<EOL>for token_type, text, start, end, line in tokens:<EOL><INDENT>if token_type == tokenize.NL:<EOL><INDENT>continue<EOL><DEDENT>if no_space:<EOL><INDENT>no_space = False<EOL>if start != prev_end:<EOL><INDENT>yield (prev_end, message)<EOL><DEDENT><DEDENT>if token_type == tokenize.OP:<EOL><INDENT>if text == '<STR_LIT:(>':<EOL><INDENT>parens += <NUM_LIT:1><EOL><DEDENT>elif text == '<STR_LIT:)>':<EOL><INDENT>parens -= <NUM_LIT:1><EOL><DEDENT>elif in_def and text == '<STR_LIT::>' and parens == <NUM_LIT:1>:<EOL><INDENT>annotated_func_arg = True<EOL><DEDENT>elif parens and text == '<STR_LIT:U+002C>' and parens == <NUM_LIT:1>:<EOL><INDENT>annotated_func_arg = False<EOL><DEDENT>elif parens and text == '<STR_LIT:=>' and not annotated_func_arg:<EOL><INDENT>no_space = True<EOL>if start != prev_end:<EOL><INDENT>yield (prev_end, message)<EOL><DEDENT><DEDENT>if not parens:<EOL><INDENT>annotated_func_arg = False<EOL><DEDENT><DEDENT>prev_end = end<EOL><DEDENT>
r"""Don't use spaces around the '=' sign in function arguments.

    Don't use spaces around the '=' sign when used to indicate a
    keyword argument or a default parameter value.

    Okay: def complex(real, imag=0.0):
    Okay: return magic(r=real, i=imag)
    Okay: boolean(a == b)
    Okay: boolean(a != b)
    Okay: boolean(a <= b)
    Okay: boolean(a >= b)
    Okay: def foo(arg: int = 42):

    E251: def complex(real, imag = 0.0):
    E251: return magic(r = real, i = imag)