def watch_layouts(continuous=True):
    """Watch layout file and update layout definitions once they change

    Parameters:
        continuous (bool): Set False to only load definitions once

    Returns:
        dict: Layout definitions if `continuous` is False
    """
    import json
    from web_ui import app

    mtime_last = 0
    layout_filename = os.path.join(app.config["RUNTIME_DIR"], 'static', 'layouts.json')
    cont = True
    while cont is True:
        mtime_cur = os.path.getmtime(layout_filename)

        if mtime_cur != mtime_last:

            try:
                with open(layout_filename) as f:
                    app.config['LAYOUT_DEFINITIONS'] = json.load(f)
            except __HOLE__:
                app.logger.error("Failed loading layout definitions")
                app.config['LAYOUT_DEFINITIONS'] = dict()
            else:
                app.logger.info("Loaded {} layout definitions".format(len(app.config["LAYOUT_DEFINITIONS"])))
        mtime_last = mtime_cur

        cont = True if continuous is True else False
        sleep(1)

    return app.config["LAYOUT_DEFINITIONS"]
dataset/ETHPy150Open ciex/souma/web_ui/helpers.py/watch_layouts