Set context of running notebook.

    :param context_info: dict of extra context parameters, see comm.py comments

def set_context(pid_file, context_info):
    """Set context of running notebook.

    :param context_info: dict of extra context parameters, see comm.py comments
    """
    assert type(context_info) == dict

    port_file = get_context_file_name(pid_file)
    with open(port_file, "wt") as f:
        f.write(json.dumps(context_info))