def get_file_contents(filepath, raw_bytes=False, mode='r'):
    with open(filepath, mode) as f:
        return f.read() if raw_bytes else f.read().decode('utf-8')
Gets the contents of a file, given a relative filepath from oppia/.
dataset/ETHPy150Open oppia/oppia/utils.py/get_file_contents