<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def DeleteNotifications(self, session_ids, start=None, end=None):
 """This deletes the notification when all messages have been processed."""

    if not session_ids:
      return

    for session_id in session_ids:
      if not isinstance(session_id, rdfvalue.SessionID):
        raise RuntimeError(
            "Can only delete notifications for rdfvalue.SessionIDs.")

    if start is None:
      start = 0
    else:
      start = int(start)

    if end is None:
      end = self.frozen_timestamp or rdfvalue.RDFDatetime.Now()

    for queue, ids in iteritems(
        collection.Group(session_ids, lambda session_id: session_id.Queue())):
      queue_shards = self.GetAllNotificationShards(queue)
      self.data_store.DeleteNotifications(queue_shards, ids, start, end)