def write_file (filename, contents):
    f = open(filename, "w")
    try:
        for line in contents:
            f.write(line + "\n")
    finally:
        f.close()
Called when stream returns non-200 status code
dataset/ETHPy150Open ctxis/canape/CANAPE.Scripting/Lib/distutils/file_util.py/write_file--crossover with--dataset/ETHPy150Open jamesmawm/Mastering-Python-for-Finance-source-codes/B03898_08_codes/oandapy.py/Streamer.on_error