<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def tree_to_file(tree:'BubbleTree', outfile:str):
 """Compute the bubble representation of given power graph, and push it into given file."""

    with open(outfile, 'w') as fd:
        fd.write(tree_to_bubble(tree))