class_docstr: Base class for mutators.
  
  Users are not advised to use this class.
docstr: Apply fn to grouped episodes, yielding back the results of the application.
docstr_tok: ["Apply","fn","to","grouped","episodes",",","yielding","back","the","results","of","the","application","."]
code: def _group_into_episodes(
      self, message_stream: Iterable[Message]
  ) -> Iterator[List[Message]]:
      """
      Apply fn to grouped episodes, yielding back the results of the application.
      """
      episode: List[Message] = []
      for message in message_stream:
          if message.is_padding():
              assert not episode
              yield [message]
              continue
          message, episode_done = self._pop_episode_done(message)
          episode.append(message)
          if episode_done:
              yield episode
              episode = []
      if episode:
          yield episode
  
imports: from __future__ import annotations
  import abc
  import importlib
  import pkgutil
  from typing import Optional, Iterable, Tuple, List, Iterator, Callable, Type
  import parlai.mutators
  from parlai.core.params import ParlaiParser
  from parlai.core.opt import Opt
  from parlai.core.message import Message
label_desc: Use image node_id 5 for calling the Mutator obj's underlying member method code with example usage: obj._group_into_episodes(message_stream) without return types