parameters: (lines)
docstring: Does the main work of indenting the input based on the brace counts.
docstring_summary: Does the main work of indenting the input based on the brace counts.
docstring_tokens: Does the main work of indenting the input based on the brace counts .
function: def prettyprint_input(lines):
    """Does the main work of indenting the input based on the brace counts."""
    indent = 0
    basic_offset = 2
    last_line = ""
    for line in lines:
      if COMMENT_RE.match(line):
        print line
      else:
        line = line.strip('\r\n\t ')  # Otherwise doesn't strip \r on Unix.
        if len(line) > 0:
          (brace_diff, after) = count_braces(line)
          if brace_diff != 0:
            if after:
              print " " * (basic_offset * indent) + line
              indent += brace_diff
            else:
              indent += brace_diff
              print " " * (basic_offset * indent) + line
          else:
            print " " * (basic_offset * indent) + line
        else:
          print ""
        last_line = line
function_tokens: def prettyprint_input ( lines ) : indent = 0 basic_offset = 2 last_line = "" for line in lines : if COMMENT_RE . match ( line ) : print line else : line = line . strip ( '\r\n\t ' ) # Otherwise doesn't strip \r on Unix. if len ( line ) > 0 : ( brace_diff , after ) = count_braces ( line ) if brace_diff != 0 : if after : print " " * ( basic_offset * indent ) + line indent += brace_diff else : indent += brace_diff print " " * ( basic_offset * indent ) + line else : print " " * ( basic_offset * indent ) + line else : print "" last_line = line