def METHOD_NAME(tempdir):
    import intake
    from intake.container.persist import store
    old = intake.config.conf.copy()
    olddir = intake.config.confdir
    intake.config.confdir = tempdir
    intake.config.conf.update({"cache_dir": make_path_posix(str(tempdir)), "cache_download_progress": False, "cache_disabled": False})
    intake.config.conf.save()
    store.__init__(os.path.join(tempdir, "persist"))
    try:
        yield
    finally:
        intake.config.confdir = olddir
        intake.config.conf.update(old)
        intake.config.save_conf()