'Parses the code and computes split penalties.
Arguments:
code: code to parse as a string
dumptree: if True, the parsed pytree (after penalty assignment) is dumped
to stderr. Useful for debugging.
Returns:
Parse tree.'

def _ParseAndComputePenalties(self, code, dumptree=False):

    tree = pytree_utils.ParseCodeToTree(code)
    split_penalty.ComputeSplitPenalties(tree)
    if dumptree:
        pytree_visitor.DumpPyTree(tree, target_stream=sys.stderr)
    return tree
