<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_json(template, clean_up=False):
 """ Assume the input is YAML and convert to JSON """


    data = load_yaml(template)

    if clean_up:
        data = clean(data)

    return dump_json(data)