def get_vms(self, vm_names=None):
if not vm_names:<EOL><INDENT>return self._vms.copy()<EOL><DEDENT>missing_vms = []<EOL>vms = {}<EOL>for name in vm_names:<EOL><INDENT>try:<EOL><INDENT>vms[name] = self._vms[name]<EOL><DEDENT>except KeyError:<EOL><INDENT>missing_vms.append(name)<EOL><DEDENT><DEDENT>if missing_vms:<EOL><INDENT>raise utils.LagoUserException(<EOL>'<STR_LIT>'.format(<EOL>'<STR_LIT:\n>'.join(missing_vms)<EOL>)<EOL>)<EOL><DEDENT>return vms<EOL>
Returns the vm objects associated with vm_names
if vm_names is None, return all the vms in the prefix
Args:
    vm_names (list of str): The names of the requested vms
Returns
    dict: Which contains the requested vm objects indexed by name
Raises:
    utils.LagoUserException: If a vm name doesn't exist