import jinja2


def create_run_hoc(template_path, main_protocol):
    """Returns a string containing run.hoc.

    Args:
        template_path (str): path to the template to fill in
        main_protocol (bool): whether the Main Protocol is used or not

    Returns:
        str: hoc script to run the simulation
    """
    # load template
    with open(template_path, "r", encoding="utf-8") as template_file:
        template = template_file.read()
        template = jinja2.Template(template)

    # edit template
    return template.render(
        main_protocol=main_protocol,
    )