code: def eject_medium(self, attachment):
          
          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
docs: 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.