code: def parse_file(fname):
          
          try:
              with fopen(fname) as f:
                  fstr = f.read()
          except IOError:
              if fname != 'stdin':
                  raise
              sys.stdout.write('\nReading from stdin:\n\n')
              fstr = sys.stdin.read()
          fstr = fstr.replace('\r\n', '\n').replace('\r', '\n')
          if not fstr.endswith('\n'):
              fstr += '\n'
          return ast.parse(fstr, filename=fname)
docs: Parse a python file into an AST.
  
          This is a very thin wrapper around ast.parse
  
              TODO: Handle encodings other than the default for Python 2
                          (issue #26)