code: def get_all(self, seq_set: SequenceSet) \
              -> Sequence[Tuple[int, CachedMessage]]:
          
          if seq_set.uid:
              all_uids = seq_set.flatten(self.max_uid) & self._uids
              return [(seq, self._cache[uid])
                      for seq, uid in enumerate(self._sorted, 1)
                      if uid in all_uids]
          else:
              all_seqs = seq_set.flatten(self.exists)
              return [(seq, self._cache[uid])
                      for seq, uid in enumerate(self._sorted, 1)
                      if seq in all_seqs]
docs: Return the cached messages, and their sequence numbers, for the
          given sequence set.
  
          Args:
              seq_set: The message sequence set.