@contextlib.contextmanager
def override_temp(replacement):
    if not os.path.isdir(replacement):
        os.makedirs(replacement)

    saved = tempfile.tempdir

    tempfile.tempdir = replacement

    try:
        yield
    finally:
        tempfile.tempdir = saved
Make sure no existing applications are using a logo.
dataset/ETHPy150Open chalasr/Flask-P2P/venv/lib/python2.7/site-packages/setuptools/sandbox.py/override_temp--crossover with--dataset/ETHPy150Open dimagi/commcare-hq/corehq/apps/accounting/subscription_changes.py/DomainDowngradeActionHandler.response_commcare_logo_uploader