def METHOD_NAME(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 + "}}"