<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dump(bqm, fp, vartype_header=False):
 """Dump a binary quadratic model to a string in COOrdinate format."""

    for triplet in _iter_triplets(bqm, vartype_header):
        fp.write('%s\n' % triplet)