<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_machine_states(self, machines):
 """Gets the state of several machines in a single operation. in machines of type :class:`IMachine` Array with the machine references. return states of type :class:`MachineState` Machine states, corresponding to the machines. """

        if not isinstance(machines, list):
            raise TypeError("machines can only be an instance of type list")
        for a in machines[:10]:
            if not isinstance(a, IMachine):
                raise TypeError(
                        "array can only contain objects of type IMachine")
        states = self._call("getMachineStates",
                     in_p=[machines])
        states = [MachineState(a) for a in states]
        return states