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

def returner(ret):
    '''
    Write the return data to a file on the minion.
    '''
    opts = _get_options(ret)
    try:
        with salt.utils.files.flopen(opts['filename'], 'a') as logfile:
            salt.utils.json.dump(ret, logfile)
            logfile.write(str('\n'))  # future lint: disable=blacklisted-function
    except Exception:
        log.error('Could not write to rawdata_json file %s', opts['filename'])
        raise