<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def list_instances(self, machine_state):
 """Returns the list of the instances in the Cloud. in machine_state of type :class:`CloudMachineState` out return_names of type str VM names. return return_ids of type str VM ids. """

        if not isinstance(machine_state, CloudMachineState):
            raise TypeError("machine_state can only be an instance of type CloudMachineState")
        (return_ids, return_names) = self._call("listInstances",
                     in_p=[machine_state])
        return (return_ids, return_names)