code: def has_next(self):
      raise NotImplementedError(
          "Using has_next with distributed queue "
          + "such as pubsub will bite you in the ass! "
          + "Use dequeue with timeout instead"
      )
  
      no_retries = 5
      for i in range(no_retries):
          response = self.subclient.api.pull(
              self.sub_name, return_immediately=True, max_messages=1
          )
          messages = response.received_messages
  
          retval = any(messages)
          if retval:
              break
          else:
              self.logger.debug(
                  "has_next has not found any messages, "
                  + "retrying (attempt {})".format(i)
              )
              time.sleep(5)
  
      for m in messages:
          self.hold(m.ack_id, 0)
  
      return retval
  
file_path: studio/studio/pubsub_queue.py
imports: import os
  import json
  import time
  from google.api_core.exceptions import RetryError
  from studio.util.util import sixdecode, retry, parse_verbosity, check_for_kb_interrupt
  from studio.util import logs
label_desc: Use image node_id 4 for calling the PubsubQueue obj's underlying member method code with example usage: obj.has_next() and returns: retval