code: async def eject(self, device, force=False):
          
          device = self._find_device(device)
          if not self.is_handleable(device):
              self._log.warn(_('not ejecting {0}: unhandled device'))
              return False
          drive = device.drive
          if not (drive.is_drive and drive.is_ejectable):
              self._log.warn(_('not ejecting {0}: drive not ejectable', drive))
              return False
          if force:
              # Can't autoremove 'device.drive', because that will be filtered
              # due to block=False:
              await self.auto_remove(device.root, force=True)
          self._log.debug(_('ejecting {0}', device))
          await drive.eject()
          self._log.info(_('ejected {0}', device))
          return True
docs: Eject a device after unmounting all its mounted filesystems.
  
          :param device: device object, block device path or mount path
          :param bool force: remove child devices before trying to eject
          :returns: whether the operation succeeded