code: def put(self, block_id, priority, pb_type='offline'):
          if pb_type not in ('offline', 'realtime'):
              raise ValueError('Invalid PB type.')
          with self._mutex:
              added_time = datetime.datetime.utcnow().isoformat()
              entry = (priority, sys.maxsize-self._index, block_id, pb_type,
                       added_time)
              self._index += 1
              if self._block_map.get(block_id) is not None:
                  raise KeyError('ERROR: Block id "{}" already exists in '
                                 'PC PB queue!'.
                                 format(block_id))
              self._block_map[block_id] = entry
              LOG.debug("Adding PB %s to queue", block_id)
              self._queue.append(entry)
              self._queue.sort()
              self._queue.reverse()