<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 async def list_vms(self, preset):
 """ Listing virtual machines in a given preset :arg string preset: preset name :return: (Size of a preset, list of virtual machines) - first element of a tuple is a size of virtual machines in a preset - second element is a dict which contains all Virtual Machines, where every element of this dict looks like that: ``{ "VIRTUAL_MACHINE_ID": { "ip": "IP_ADDR", "state": "VM_STATE" }`` :rtype: tuple Sample response: ``( 1, {'180aa486-ee46-4628-ab1c-f4554b63231': {'ip': '172.1.1.2', 'state': 'running'}} )`` """

        vmshepherd = self.request.app.vmshepherd
        preset = vmshepherd.preset_manager.get_preset(preset)
        result_vms = {vm.id: {'ip': vm.ip[0], 'state': vm.state.value} for vm in preset.vms}
        return preset.count, result_vms