def assign_machine(self, machine, lock_type, token):
        """Assigns the machine object associated with this direct-type
        session or informs the session that it will be a remote one
        (if @a machine == @c null).

        in machine of type :class:`IMachine`

        in lock_type of type :class:`LockType`

        in token of type :class:`IToken`

        raises :class:`VBoxErrorInvalidVmState`
            Session state prevents operation.
        
        raises :class:`VBoxErrorInvalidObjectState`
            Session type prevents operation.
        
        """
        if not isinstance(machine, IMachine):
            raise TypeError("machine can only be an instance of type IMachine")
        if not isinstance(lock_type, LockType):
            raise TypeError("lock_type can only be an instance of type LockType")
        if not isinstance(token, IToken):
            raise TypeError("token can only be an instance of type IToken")
        self._call("assignMachine",
                     in_p=[machine, lock_type, token])
Assigns the machine object associated with this direct-type
        session or informs the session that it will be a remote one
        (if @a machine == @c null).

        in machine of type :class:`IMachine`

        in lock_type of type :class:`LockType`

        in token of type :class:`IToken`

        raises :class:`VBoxErrorInvalidVmState`
            Session state prevents operation.
        
        raises :class:`VBoxErrorInvalidObjectState`
            Session type prevents operation.