<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def eject_medium(self, attachment):
 """Tells VBoxSVC that the guest has ejected the medium associated with the medium attachment. in attachment of type :class:`IMediumAttachment` The medium attachment where the eject happened. return new_attachment of type :class:`IMediumAttachment` A new reference to the medium attachment, as the config change can result in the creation of a new instance. """

        if not isinstance(attachment, IMediumAttachment):
            raise TypeError("attachment can only be an instance of type IMediumAttachment")
        new_attachment = self._call("ejectMedium",
                     in_p=[attachment])
        new_attachment = IMediumAttachment(new_attachment)
        return new_attachment