<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _cron_profile():
 """Sets up the .cron_profile file if it does not already exist. """

    #The main ingredients of the file are the import of the virtualenvwrapper
    #and the setting of the PYCI_XML variable for global configuration.
    from os import path
    cronpath = path.expanduser("~/.cron_profile")
    if not path.isfile(cronpath):
        from os import getenv
        xmlpath = getenv("PYCI_XML")    
        contents = ['source /usr/local/bin/virtualenvwrapper.sh',
                    'export PYCI_XML="{}"'.format(xmlpath)]
        with open(cronpath, 'w') as f:
            f.write('\n'.join(contents))