<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def on_medium_change(self, medium_attachment, force):
 """Triggered when attached media of the associated virtual machine have changed. in medium_attachment of type :class:`IMediumAttachment` The medium attachment which changed. in force of type bool If the medium change was forced. raises :class:`VBoxErrorInvalidVmState` Session state prevents operation. raises :class:`VBoxErrorInvalidObjectState` Session type prevents operation. """

        if not isinstance(medium_attachment, IMediumAttachment):
            raise TypeError("medium_attachment can only be an instance of type IMediumAttachment")
        if not isinstance(force, bool):
            raise TypeError("force can only be an instance of type bool")
        self._call("onMediumChange",
                     in_p=[medium_attachment, force])