def parse_ast(contents, fname, mode='exec'):
    contents = contents.replace('\r', '')  # py26 barfs on CRs
    if not contents.endswith('\n'):
        contents += '\n'  # to make ast.parse happy :(
    return ast.parse(contents, filename=fname, mode=mode)
Wrapper for ast.parse() that cleans the contents of CRs and ensures
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.util/src/openmdao/util/astutil.py/parse_ast