parameters: (logical_line)
docstring: r"""
      Compound statements (multiple 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!
  
      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()
docstring_summary: r"""
      Compound statements (multiple statements on the same line) are
      generally discouraged.
docstring_tokens: r Compound statements ( multiple statements on the same line ) are generally discouraged .
function: def compound_statements(logical_line):
      r"""
      Compound statements (multiple 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!
  
      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()
      """
      line = logical_line
      found = line.find(':')
      if -1 < found < len(line) - 1:
          before = line[:found]
          if (before.count('{') <= before.count('}') and  # {'a': 1} (dict)
              before.count('[') <= before.count(']') and  # [1:2] (slice)
              not re.search(r'\blambda\b', before)):      # lambda x: x
              return found, "E701 multiple statements on one line (colon)"
      found = line.find(';')
      if -1 < found:
          return found, "E702 multiple statements on one line (semicolon)"
function_tokens: def compound_statements ( logical_line ) : line = logical_line found = line . find ( ':' ) if - 1 < found < len ( line ) - 1 : before = line [ : found ] if ( before . count ( '{' ) <= before . count ( '}' ) and # {'a': 1} (dict) before . count ( '[' ) <= before . count ( ']' ) and # [1:2] (slice) not re . search ( r'\blambda\b' , before ) ) : # lambda x: x return found , "E701 multiple statements on one line (colon)" found = line . find ( ';' ) if - 1 < found : return found , "E702 multiple statements on one line (semicolon)"