<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_sif(graph: BELGraph, file: Optional[TextIO] = None, sep: Optional[str] = None) -> None: """Write the graph as a tab-separated SIF file. The resulting file will contain the following columns: 1. Source BEL term 2. Relation 3. Target BEL term This format is simple and can be used readily with many applications, but is lossy in that it does not include relation metadata. """

    if sep is None:
        sep = '\t'

    for u, v, data in graph.edges(data=True):
        print(
            graph.edge_to_bel(u, v, edge_data=data, sep=sep),
            file=file,
        )