code: def delete(self, wait_for_deletion=True):
      
      if self.exists():
        try:
          self._api.objects_delete(self._bucket, self._key)
        except Exception as e:
          raise e
        if wait_for_deletion:
          for _ in range(_MAX_POLL_ATTEMPTS):
            objects = Objects(self._bucket, prefix=self.key, delimiter='/',
                              context=self._context)
            if any(o.key == self.key for o in objects):
              time.sleep(_POLLING_SLEEP)
              continue
            break
          else:
            logging.error('Failed to see object deletion after %d attempts.',
                          _MAX_POLL_ATTEMPTS)
docs: Deletes this object from its bucket.
  
      Args:
        wait_for_deletion: If True, we poll until this object no longer appears in
            objects.list operations for this bucket before returning.
  
      Raises:
        Exception if there was an error deleting the object.