code: def listen_bucket_notification(self, bucket_name, prefix='', suffix='',
                                     events=['s3:ObjectCreated:*',
                                             's3:ObjectRemoved:*',
                                             's3:ObjectAccessed:*']):
          
          is_valid_bucket_name(bucket_name)
  
          # If someone explicitly set prefix to None convert it to empty string.
          if prefix is None:
              prefix = ''
  
          # If someone explicitly set suffix to None convert it to empty string.
          if suffix is None:
              suffix = ''
  
          url_components = urlsplit(self._endpoint_url)
          if url_components.hostname == 's3.amazonaws.com':
              raise InvalidArgumentError(
                  'Listening for event notifications on a bucket is a MinIO '
                  'specific extension to bucket notification API. It is not '
                  'supported by Amazon S3')
  
          query = {
              'prefix': prefix,
              'suffix': suffix,
              'events': events,
          }
          while True:
              response = self._url_open('GET', bucket_name=bucket_name,
                                        query=query, preload_content=False)
              try:
                  for line in response.stream():
                      if line.strip():
                          if hasattr(line, 'decode'):
                              line = line.decode('utf-8')
                          event = json.loads(line)
                          if event['Records'] is not None:
                              yield event
              except JSONDecodeError:
                  response.close()
                  continue
docs: Yeilds new event notifications on a bucket, caller should iterate
          to read new notifications.
  
          NOTE: Notification is retried in case of `JSONDecodeError` otherwise
          the function raises an exception.
  
          :param bucket_name: Bucket name to listen event notifications from.
          :param prefix: Object key prefix to filter notifications for.
          :param suffix: Object key suffix to filter notifications for.
          :param events: Enables notifications for specific event types.
               of events.