<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def write_molecule(filename, format=None):
    '''Write the system displayed in a file as a molecule.'''
    datafile(filename, format=format,
             mode='w').write('molecule',current_system())