<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def delete(self, key=None):
 """Deletes the given key, or the whole bucket."""


        # Delete the whole bucket.
        if key is None:
            # Delete everything in the bucket.
            for key in self.all():
                key.delete()

            # Delete the bucket.
            return self._boto_bucket.delete()

        # If a key was passed, delete they key.
        k = self.key(key)
        return k.delete()