<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_config(filename, config, mode="w"):
    '''use configparser to write a config object to filename
    '''
    with open(filename, mode) as filey:
        config.write(filey)
    return filename