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

def package(self, vm_name=None, base=None, output=None, vagrantfile=None):
        '''
        Packages a running vagrant environment into a box.

        vm_name=None: name of VM.
        base=None: name of a VM in virtualbox to package as a base box
        output=None: name of the file to output
        vagrantfile=None: Vagrantfile to package with this box
        '''
        cmd = ['package', vm_name]
        if output is not None:
            cmd += ['--output', output]
        if vagrantfile is not None:
            cmd += ['--vagrantfile', vagrantfile]

        self._call_vagrant_command(cmd)