

def writeFile(fname, contents):
    dir = os.path.split(fname)[0]
    if (dir and (not os.path.exists(dir))):
        mkdirs(dir)
    f = open(fname, 'w')
    f.write(contents)
    f.close()

dataset/ETHPy150Open azoft-dev-team/imagrium/env/Lib/test/test_mhlib.py writeFile/original