<s> """<STR_LIT>""" <EOL> from __future__ import absolute_import <EOL> from __future__ import print_function <EOL> from __future__ import unicode_literals <EOL> import io <EOL> import sys <EOL> __author__ = '<STR_LIT>' <EOL> def read_file ( filename , print_error = True ) : <EOL> """<STR_LIT>""" <EOL> try : <EOL> for encoding in [ '<STR_LIT:utf-8>' , '<STR_LIT>' ] : <EOL> try : <EOL> with io . open ( filename , encoding = encoding ) as fp : <EOL> return fp . read ( ) <EOL> except UnicodeDecodeError : <EOL> pass <EOL> except IOError as exception : <EOL> if print_error : <EOL> print ( exception , file = sys . stderr ) <EOL> return None </s>
