def compound_statements(logical_line):
line = logical_line<EOL>last_char = len(line) - <NUM_LIT:1><EOL>found = line.find('<STR_LIT::>')<EOL>while -<NUM_LIT:1> < found < last_char:<EOL><INDENT>before = line[:found]<EOL>if ((before.count('<STR_LIT:{>') <= before.count('<STR_LIT:}>') and   <EOL>before.count('<STR_LIT:[>') <= before.count('<STR_LIT:]>') and   <EOL>before.count('<STR_LIT:(>') <= before.count('<STR_LIT:)>'))):    <EOL><INDENT>lambda_kw = LAMBDA_REGEX.search(before)<EOL>if lambda_kw:<EOL><INDENT>before = line[:lambda_kw.start()].rstrip()<EOL>if before[-<NUM_LIT:1>:] == '<STR_LIT:=>' and isidentifier(before[:-<NUM_LIT:1>].strip()):<EOL><INDENT>yield <NUM_LIT:0>, ("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>break<EOL><DEDENT>if before.startswith('<STR_LIT>'):<EOL><INDENT>yield <NUM_LIT:0>, "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>yield found, "<STR_LIT>"<EOL><DEDENT><DEDENT>found = line.find('<STR_LIT::>', found + <NUM_LIT:1>)<EOL><DEDENT>found = line.find('<STR_LIT:;>')<EOL>while -<NUM_LIT:1> < found:<EOL><INDENT>if found < last_char:<EOL><INDENT>yield found, "<STR_LIT>"<EOL><DEDENT>else:<EOL><INDENT>yield found, "<STR_LIT>"<EOL><DEDENT>found = line.find('<STR_LIT:;>', found + <NUM_LIT:1>)<EOL><DEDENT>
r"""Compound statements (on the same line) are generally discouraged.

    While sometimes it's okay to put an if/for/while with a small body
    on the same line, never do this for multi-clause statements.
    Also avoid folding such long lines!

    Always use a def statement instead of an assignment statement that
    binds a lambda expression directly to a name.

    Okay: if foo == 'blah':\n    do_blah_thing()
    Okay: do_one()
    Okay: do_two()
    Okay: do_three()

    E701: if foo == 'blah': do_blah_thing()
    E701: for x in lst: total += x
    E701: while t < 10: t = delay()
    E701: if foo == 'blah': do_blah_thing()
    E701: else: do_non_blah_thing()
    E701: try: something()
    E701: finally: cleanup()
    E701: if foo == 'blah': one(); two(); three()
    E702: do_one(); do_two(); do_three()
    E703: do_four();  # useless semicolon
    E704: def f(x): return 2*x
    E731: f = lambda x: 2*x