def ensure_dirs_exist(path):
    outdir = os.path.dirname(path)
    if outdir != '' and not os.path.isdir(outdir):
        os.makedirs(outdir)
    return path
Simple helper that ensures that any directories specified in the path are
dataset/ETHPy150Open NervanaSystems/neon/neon/util/persist.py/ensure_dirs_exist