def METHOD_NAME(path):
    def gen_be_fn(fnm):
        res = ""
        if "prepare" in fnm:
            res = '{%d, {"%s", %d, %s, %s, %s' % (
                fnm["id"], fnm["name"], fnm["args_nums"], fnm["fn"], fnm["prepare"], fnm["close"])
        else:
            res ='{%d, {"%s", %d, %s' % (
                fnm["id"], fnm["name"], fnm["args_nums"], fnm["fn"])
        if "exception_safe" in fnm:
            res = res + ", " + str(fnm["exception_safe"])
        return res + "}}"
    value = dict()
    value["license"] = license_string
    value["functions"] = ", \n        ".join([gen_be_fn(i) for i in function_list])
    content = cpp_template.substitute(value)
    with open(path, mode="w+") as f:
        f.write(content)