<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_proxy_conf(proxyfile):
    '''
    write to file
    '''
    msg = 'Invalid value for proxy file provided!, Supplied value = {0}' \
        .format(proxyfile)

    log.trace('Salt Proxy Module: write proxy conf')

    if proxyfile:
        log.debug('Writing proxy conf file')
        with salt.utils.files.fopen(proxyfile, 'w') as proxy_conf:
            proxy_conf.write(salt.utils.stringutils.to_str('master = {0}'
                             .format(__grains__['master'])))
        msg = 'Wrote proxy file {0}'.format(proxyfile)
        log.debug(msg)

    return msg