@memoized
def find_project_root():
    path = os.path.dirname(os.path.abspath(__file__))
    app_yaml_path = os.environ.get('DJANGAE_APP_YAML_LOCATION', None)

    # If the DJANGAE_APP_YAML_LOCATION variable is setup, will try to locate
    # it from there.
    if (app_yaml_path is not None and
            os.path.exists(os.path.join(app_yaml_path, "app.yaml"))):
        return app_yaml_path

    # Failing that, iterates over the parent folders until it finds it,
    # failing when it gets to the root
    while True:
        if os.path.exists(os.path.join(path, "app.yaml")):
            return path
        else:
            parent = os.path.dirname(path)
            if parent == path:  # Filesystem root
                break
            else:
                path = parent

    raise RuntimeError("Unable to locate app.yaml. Did you add it to skip_files?")
cleans up any files left in the temp directory from execution
dataset/ETHPy150Open potatolondon/djangae/djangae/utils.py/find_project_root--crossover with--dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/examples/openmdao.examples.expected_improvement/openmdao/examples/expected_improvement/multi_objective_ei.py/Analysis.cleanup