code: def get_published_events(self, process=True) -> List[Event]:
          
          LOG.debug('Getting published events (%s)', self._pub_key)
          if process:
              LOG.debug('Marking returned published events as processed.')
              DB.watch(self._pub_key, pipeline=True)
              event_ids = DB.get_list(self._pub_key, pipeline=True)
              if event_ids:
                  DB.delete(self._pub_key, pipeline=True)
                  DB.append_to_list(self._processed_key, *event_ids,
                                    pipeline=True)
              DB.execute()
          else:
              event_ids = DB.get_list(self._pub_key)
  
          events = []
          for event_id in event_ids[::-1]:
              event_str = DB.get_hash_value(self._data_key, event_id)
              event_dict = ast.literal_eval(event_str)
              event_dict['id'] = event_id
              event = Event.from_config(event_dict)
              LOG.debug('Loaded event: %s (%s)', event.id, event.type)
              events.append(event)
          return events
docs: Get a list of published (pending) events.
  
          Return a list of Event objects which have been published
          and are therefore pending to be processed. If the process argument
          is set to true, any events returned from this method will also be
          marked as processed by moving them to the processed events queue.
  
          This method is intended to be used either to print the list of
          pending published events, or also to recover from events
          missed by the get() method. The latter of these use cases may be needed
          for recovering when a subscriber drops out.
  
          Args:
              process (bool): If true, also move the events to the Processed
                              event queue.
  
          Return:
              list[Events], list of Event objects