def read_file(filename, mode='r'):
    f = open(filename, mode)
    try:
        return f.read()
    finally:
        f.close()
returns content from filename, making sure to close the file explicitly on exit.
dataset/ETHPy150Open uwdata/termite-visualizations/web2py/gluon/fileutils.py/read_file